@devgateway/dvz-ui-react 1.9.0 → 1.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,33 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=z(),I=K(),k=Q(),F=Y(),j={imagePlaceholder:void 0,cacheBust:!1},v={toSvg:N,toPng:_,toJpeg:X,toBlob:G,toPixelData:V,cloneNode:O,impl:{fontFaces:k,images:F,util:d,inliner:I,options:{}}};typeof module<"u"?module.exports=v:globalThis.domtoimage=v;async function N(o,n){n=n||{},$(n);const t=await Promise.resolve(o),s=await O(t,n.filter,!0),l=await W(s),r=await q(l),c=await h(r);return await J(c,n.width||d.width(o),n.height||d.height(o));function h(m){return n.bgcolor&&(m.style.backgroundColor=n.bgcolor),n.width&&(m.style.width=n.width+"px"),n.height&&(m.style.height=n.height+"px"),n.style&&Object.keys(n.style).forEach(function(g){m.style[g]=n.style[g]}),m}}async function V(o,n){const t=await R(o,n||{});return t?t.getContext("2d").getImageData(0,0,d.width(o),d.height(o)).data:null}async function _(o,n){const t=await R(o,n||{});return t?t.toDataURL():null}async function X(o,n){n=n||{};const t=await R(o,n);return t?t.toDataURL("image/jpeg",n.quality||1):null}function G(o,n){return R(o,n||{}).then(d.canvasToBlob)}function $(o){typeof o.imagePlaceholder>"u"?v.impl.options.imagePlaceholder=j.imagePlaceholder:v.impl.options.imagePlaceholder=o.imagePlaceholder,typeof o.cacheBust>"u"?v.impl.options.cacheBust=j.cacheBust:v.impl.options.cacheBust=o.cacheBust}function R(o,n){return N(o,n).then(d.makeImage).then(d.delay(100)).then(function(s){const l=t(o,n),r=l.getContext("2d");return r?(r.drawImage(s,0,0),l):new HTMLCanvasElement}).catch(function(s){console.error("Failed to draw canvas:",s)});function t(s,l){const r=document.createElement("canvas"),c=s.getBoundingClientRect(),h=window.devicePixelRatio||1;r.width=(l.width||c.width)*h,r.height=(l.height||c.height)*h,r.style.width=(l.width||c.width)+"px",r.style.height=(l.height||c.height)+"px";const m=r.getContext("2d");return m?(m.scale(h,h),l.bgcolor&&(m.fillStyle=l.bgcolor,m.fillRect(0,0,r.width,r.height)),r):new HTMLCanvasElement}}async function O(o,n,t){if(!t&&n&&!n(o))return Promise.resolve();const s=await Promise.resolve(o),l=await c(s),r=await h(o,l,n);return m(o,r);function c(g){return g instanceof HTMLCanvasElement?d.makeImage(g.toDataURL()):g.cloneNode(!1)}async function h(g,a,T){const E=g.childNodes;if(E.length===0)return Promise.resolve(a);return await C(a,d.asArray(E),T),a;function C(S,b,p){let w=Promise.resolve();return b.forEach(function(e){w=w.then(function(){return O(e,p)}).then(function(i){i&&S.appendChild(i)})}),w}}function m(g,a){if(!(a instanceof Element))return a;return Promise.resolve().then(T).then(E).then(C).then(S).then(function(){return a});function T(){b(window.getComputedStyle(g),a.style);function b(p,w){p.cssText?w.cssText=p.cssText:e(p,w);function e(i,f){d.asArray(i).forEach(function(u){f.setProperty(u,i.getPropertyValue(u),i.getPropertyPriority(u))})}}}function E(){[":before",":after"].forEach(function(p){b(p)});function b(p){const w=window.getComputedStyle(g,p),e=w.getPropertyValue("content");if(e===""||e==="none")return;const i=d.uid();a.className=a.className+" "+i;const f=document.createElement("style");f.appendChild(u(i,p,w)),a.appendChild(f);function u(y,x,U){const B="."+y+":"+x,P=U.cssText?L(U):H(U);return document.createTextNode(B+"{"+P+"}");function L(A){const M=A.getPropertyValue("content");return A.cssText+" content: "+M+";"}function H(A){return d.asArray(A).map(M).join("; ")+";";function M(D){return D+": "+A.getPropertyValue(D)+(A.getPropertyPriority(D)?" !important":"")}}}}}function C(){g instanceof HTMLTextAreaElement&&(a.innerHTML=g.value),g instanceof HTMLInputElement&&a.setAttribute("value",g.value)}function S(){a instanceof SVGElement&&(a.setAttribute("xmlns","http://www.w3.org/2000/svg"),a instanceof SVGRectElement&&["width","height"].forEach(function(b){const p=a.getAttribute(b);p&&a.style.setProperty(b,p)}))}}}async function W(o){const n=await k.resolveAll(),t=document.createElement("style");return o.appendChild(t),t.appendChild(document.createTextNode(n)),o}function q(o){return F.inlineAll(o).then(function(){return o})}function J(o,n,t){return Promise.resolve(o).then(function(s){return s.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),new XMLSerializer().serializeToString(s)}).then(d.escapeXhtml).then(function(s){return'<foreignObject x="0" y="0" width="100%" height="100%">'+s+"</foreignObject>"}).then(function(s){return'<svg xmlns="http://www.w3.org/2000/svg" width="'+n+'" height="'+t+'">'+s+"</svg>"}).then(function(s){return"data:image/svg+xml;charset=utf-8,"+s})}function z(){return{escape:T,parseExtension:n,mimeType:t,dataAsUrl:a,isDataUrl:s,canvasToBlob:r,resolveUrl:c,getAndEncode:g,uid:h(),delay:E,asArray:C,escapeXhtml:S,makeImage:m,width:b,height:p};function o(){const e="application/font-woff",i="image/jpeg";return{woff:e,woff2:e,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:i,jpeg:i,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp",avif:"image/avif"}}function n(e){const i=/\.([^\.\/]*?)$/g.exec(e);return i?i[1]:""}function t(e){const i=n(e).toLowerCase();return o()[i]||""}function s(e){return e.search(/^(data:)/)!==-1}function l(e){return new Promise(function(i){const f=window.atob(e.toDataURL().split(",")[1]),u=f.length,y=new Uint8Array(u);for(let x=0;x<u;x++)y[x]=f.charCodeAt(x);i(new Blob([y],{type:"image/png"}))})}function r(e){return e.toBlob?new Promise(function(i){e.toBlob(i)}):l(e)}function c(e,i){const f=document.implementation.createHTMLDocument(),u=f.createElement("base");f.head.appendChild(u);const y=f.createElement("a");return f.body.appendChild(y),u.href=i,y.href=e,y.href}function h(){let e=0;return function(){return"u"+i()+e++;function i(){return("0000"+(Math.random()*Math.pow(36,4)<<0).toString(36)).slice(-4)}}}function m(e){return new Promise(function(i,f){const u=new Image;u.onload=function(){i(u)},u.onerror=f,u.src=e})}function g(e){return v.impl.options.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime()),new Promise(function(f){const u=new XMLHttpRequest;u.onreadystatechange=x,u.ontimeout=U,u.responseType="blob",u.timeout=3e4,u.open("GET",e,!0),u.send();let y;if(v.impl.options.imagePlaceholder){const P=v.impl.options.imagePlaceholder.split(/,/);P&&P[1]&&(y=P[1])}function x(){if(u.readyState!==4)return;if(u.status!==200){y?f(y):B("cannot fetch resource: "+e+", status: "+u.status);return}const P=new FileReader;P.onloadend=function(){const L=P.result.split(/,/)[1];f(L)},P.readAsDataURL(u.response)}function U(){y?f(y):B("timeout of 30000ms occured while fetching resource: "+e)}function B(P){console.error(P),f("")}})}function a(e,i){return"data:"+i+";base64,"+e}function T(e){return e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1")}function E(e){return function(i){return new Promise(function(f){setTimeout(function(){f(i)},e)})}}function C(e){const i=[],f=e.length;for(let u=0;u<f;u++)i.push(e[u]);return i}function S(e){return e.replace(/#/g,"%23").replace(/\n/g,"%0A")}function b(e){const i=w(e,"border-left-width"),f=w(e,"border-right-width");return e.scrollWidth+i+f}function p(e){const i=w(e,"border-top-width"),f=w(e,"border-bottom-width");return e.scrollHeight+i+f}function w(e,i){const f=window.getComputedStyle(e).getPropertyValue(i);return parseFloat(f.replace("px",""))}}function K(){const o=/url\(['"]?([^'"]+?)['"]?\)/g;return{inlineAll:l,shouldProcess:n,impl:{readUrls:t,inline:s}};function n(r){return r.search(o)!==-1}function t(r){const c=[];let h;for(;(h=o.exec(r))!==null;)c.push(h[1]);return c.filter(function(m){return!d.isDataUrl(m)})}function s(r,c,h,m){return Promise.resolve(c).then(function(a){return h?d.resolveUrl(a,h):a}).then(m||d.getAndEncode).then(function(a){return d.dataAsUrl(a,d.mimeType(c))}).then(function(a){return r.replace(g(c),"$1"+a+"$3")});function g(a){return new RegExp(`(url\\(['"]?)(`+d.escape(a)+`)(['"]?\\))`,"g")}}function l(r,c,h){if(m())return Promise.resolve(r);return Promise.resolve(r).then(t).then(function(g){let a=Promise.resolve(r);return g.forEach(function(T){a=a.then(function(E){return s(E,T,c,h)})}),a});function m(){return!n(r)}}}function Q(){return{resolveAll:o,impl:{readAll:n}};function o(){return n().then(function(t){return Promise.all(t.map(function(s){return s.resolve()}))}).then(function(t){return t.join(`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});/*!
2
+ * dom-to-image
3
+ * https://github.com/tsayen/dom-to-image
4
+ *
5
+ * The MIT License (MIT)
6
+ *
7
+ * Copyright 2015 Anatolii Saienko (https://github.com/tsayen)
8
+ * Copyright 2012 Paul Bakaus (http://paulbakaus.com/)
9
+ *
10
+ * Modifications copyright (c) 2025 Development Gateway
11
+ * This file has been modified from the original source.
12
+ * Original source: https://github.com/tsayen/dom-to-image
13
+ *
14
+ * Permission is hereby granted, free of charge, to any person obtaining
15
+ * a copy of this software and associated documentation files (the
16
+ * "Software"), to deal in the Software without restriction, including
17
+ * without limitation the rights to use, copy, modify, merge, publish,
18
+ * distribute, sublicense, and/or sell copies of the Software, and to
19
+ * permit persons to whom the Software is furnished to do so, subject to
20
+ * the following conditions:
21
+ *
22
+ * The above copyright notice and this permission notice shall be
23
+ * included in all copies or substantial portions of the Software.
24
+ *
25
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
26
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
27
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
28
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
29
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
30
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
31
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
32
+ */const d=z(),I=K(),k=Q(),F=Y(),j={imagePlaceholder:void 0,cacheBust:!1},v={toSvg:N,toPng:_,toJpeg:X,toBlob:G,toPixelData:V,cloneNode:O,impl:{fontFaces:k,images:F,util:d,inliner:I,options:{}}};typeof module<"u"?module.exports=v:globalThis.domtoimage=v;async function N(o,n){n=n||{},$(n);const t=await Promise.resolve(o),s=await O(t,n.filter,!0),l=await W(s),r=await q(l),c=await h(r);return await J(c,n.width||d.width(o),n.height||d.height(o));function h(m){return n.bgcolor&&(m.style.backgroundColor=n.bgcolor),n.width&&(m.style.width=n.width+"px"),n.height&&(m.style.height=n.height+"px"),n.style&&Object.keys(n.style).forEach(function(g){m.style[g]=n.style[g]}),m}}async function V(o,n){const t=await R(o,n||{});return t?t.getContext("2d").getImageData(0,0,d.width(o),d.height(o)).data:null}async function _(o,n){const t=await R(o,n||{});return t?t.toDataURL():null}async function X(o,n){n=n||{};const t=await R(o,n);return t?t.toDataURL("image/jpeg",n.quality||1):null}function G(o,n){return R(o,n||{}).then(d.canvasToBlob)}function $(o){typeof o.imagePlaceholder>"u"?v.impl.options.imagePlaceholder=j.imagePlaceholder:v.impl.options.imagePlaceholder=o.imagePlaceholder,typeof o.cacheBust>"u"?v.impl.options.cacheBust=j.cacheBust:v.impl.options.cacheBust=o.cacheBust}function R(o,n){return N(o,n).then(d.makeImage).then(d.delay(100)).then(function(s){const l=t(o,n),r=l.getContext("2d");return r?(r.drawImage(s,0,0),l):new HTMLCanvasElement}).catch(function(s){console.error("Failed to draw canvas:",s)});function t(s,l){const r=document.createElement("canvas"),c=s.getBoundingClientRect(),h=window.devicePixelRatio||1;r.width=(l.width||c.width)*h,r.height=(l.height||c.height)*h,r.style.width=(l.width||c.width)+"px",r.style.height=(l.height||c.height)+"px";const m=r.getContext("2d");return m?(m.scale(h,h),l.bgcolor&&(m.fillStyle=l.bgcolor,m.fillRect(0,0,r.width,r.height)),r):new HTMLCanvasElement}}async function O(o,n,t){if(!t&&n&&!n(o))return Promise.resolve();const s=await Promise.resolve(o),l=await c(s),r=await h(o,l,n);return m(o,r);function c(g){return g instanceof HTMLCanvasElement?d.makeImage(g.toDataURL()):g.cloneNode(!1)}async function h(g,a,T){const E=g.childNodes;if(E.length===0)return Promise.resolve(a);return await C(a,d.asArray(E),T),a;function C(S,b,p){let w=Promise.resolve();return b.forEach(function(e){w=w.then(function(){return O(e,p)}).then(function(i){i&&S.appendChild(i)})}),w}}function m(g,a){if(!(a instanceof Element))return a;return Promise.resolve().then(T).then(E).then(C).then(S).then(function(){return a});function T(){b(window.getComputedStyle(g),a.style);function b(p,w){p.cssText?w.cssText=p.cssText:e(p,w);function e(i,f){d.asArray(i).forEach(function(u){f.setProperty(u,i.getPropertyValue(u),i.getPropertyPriority(u))})}}}function E(){[":before",":after"].forEach(function(p){b(p)});function b(p){const w=window.getComputedStyle(g,p),e=w.getPropertyValue("content");if(e===""||e==="none")return;const i=d.uid();a.className=a.className+" "+i;const f=document.createElement("style");f.appendChild(u(i,p,w)),a.appendChild(f);function u(y,x,U){const B="."+y+":"+x,P=U.cssText?L(U):H(U);return document.createTextNode(B+"{"+P+"}");function L(A){const M=A.getPropertyValue("content");return A.cssText+" content: "+M+";"}function H(A){return d.asArray(A).map(M).join("; ")+";";function M(D){return D+": "+A.getPropertyValue(D)+(A.getPropertyPriority(D)?" !important":"")}}}}}function C(){g instanceof HTMLTextAreaElement&&(a.innerHTML=g.value),g instanceof HTMLInputElement&&a.setAttribute("value",g.value)}function S(){a instanceof SVGElement&&(a.setAttribute("xmlns","http://www.w3.org/2000/svg"),a instanceof SVGRectElement&&["width","height"].forEach(function(b){const p=a.getAttribute(b);p&&a.style.setProperty(b,p)}))}}}async function W(o){const n=await k.resolveAll(),t=document.createElement("style");return o.appendChild(t),t.appendChild(document.createTextNode(n)),o}function q(o){return F.inlineAll(o).then(function(){return o})}function J(o,n,t){return Promise.resolve(o).then(function(s){return s.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),new XMLSerializer().serializeToString(s)}).then(d.escapeXhtml).then(function(s){return'<foreignObject x="0" y="0" width="100%" height="100%">'+s+"</foreignObject>"}).then(function(s){return'<svg xmlns="http://www.w3.org/2000/svg" width="'+n+'" height="'+t+'">'+s+"</svg>"}).then(function(s){return"data:image/svg+xml;charset=utf-8,"+s})}function z(){return{escape:T,parseExtension:n,mimeType:t,dataAsUrl:a,isDataUrl:s,canvasToBlob:r,resolveUrl:c,getAndEncode:g,uid:h(),delay:E,asArray:C,escapeXhtml:S,makeImage:m,width:b,height:p};function o(){const e="application/font-woff",i="image/jpeg";return{woff:e,woff2:e,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:i,jpeg:i,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp",avif:"image/avif"}}function n(e){const i=/\.([^\.\/]*?)$/g.exec(e);return i?i[1]:""}function t(e){const i=n(e).toLowerCase();return o()[i]||""}function s(e){return e.search(/^(data:)/)!==-1}function l(e){return new Promise(function(i){const f=window.atob(e.toDataURL().split(",")[1]),u=f.length,y=new Uint8Array(u);for(let x=0;x<u;x++)y[x]=f.charCodeAt(x);i(new Blob([y],{type:"image/png"}))})}function r(e){return e.toBlob?new Promise(function(i){e.toBlob(i)}):l(e)}function c(e,i){const f=document.implementation.createHTMLDocument(),u=f.createElement("base");f.head.appendChild(u);const y=f.createElement("a");return f.body.appendChild(y),u.href=i,y.href=e,y.href}function h(){let e=0;return function(){return"u"+i()+e++;function i(){return("0000"+(Math.random()*Math.pow(36,4)<<0).toString(36)).slice(-4)}}}function m(e){return new Promise(function(i,f){const u=new Image;u.onload=function(){i(u)},u.onerror=f,u.src=e})}function g(e){return v.impl.options.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime()),new Promise(function(f){const u=new XMLHttpRequest;u.onreadystatechange=x,u.ontimeout=U,u.responseType="blob",u.timeout=3e4,u.open("GET",e,!0),u.send();let y;if(v.impl.options.imagePlaceholder){const P=v.impl.options.imagePlaceholder.split(/,/);P&&P[1]&&(y=P[1])}function x(){if(u.readyState!==4)return;if(u.status!==200){y?f(y):B("cannot fetch resource: "+e+", status: "+u.status);return}const P=new FileReader;P.onloadend=function(){const L=P.result.split(/,/)[1];f(L)},P.readAsDataURL(u.response)}function U(){y?f(y):B("timeout of 30000ms occured while fetching resource: "+e)}function B(P){console.error(P),f("")}})}function a(e,i){return"data:"+i+";base64,"+e}function T(e){return e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1")}function E(e){return function(i){return new Promise(function(f){setTimeout(function(){f(i)},e)})}}function C(e){const i=[],f=e.length;for(let u=0;u<f;u++)i.push(e[u]);return i}function S(e){return e.replace(/#/g,"%23").replace(/\n/g,"%0A")}function b(e){const i=w(e,"border-left-width"),f=w(e,"border-right-width");return e.scrollWidth+i+f}function p(e){const i=w(e,"border-top-width"),f=w(e,"border-bottom-width");return e.scrollHeight+i+f}function w(e,i){const f=window.getComputedStyle(e).getPropertyValue(i);return parseFloat(f.replace("px",""))}}function K(){const o=/url\(['"]?([^'"]+?)['"]?\)/g;return{inlineAll:l,shouldProcess:n,impl:{readUrls:t,inline:s}};function n(r){return r.search(o)!==-1}function t(r){const c=[];let h;for(;(h=o.exec(r))!==null;)c.push(h[1]);return c.filter(function(m){return!d.isDataUrl(m)})}function s(r,c,h,m){return Promise.resolve(c).then(function(a){return h?d.resolveUrl(a,h):a}).then(m||d.getAndEncode).then(function(a){return d.dataAsUrl(a,d.mimeType(c))}).then(function(a){return r.replace(g(c),"$1"+a+"$3")});function g(a){return new RegExp(`(url\\(['"]?)(`+d.escape(a)+`)(['"]?\\))`,"g")}}function l(r,c,h){if(m())return Promise.resolve(r);return Promise.resolve(r).then(t).then(function(g){let a=Promise.resolve(r);return g.forEach(function(T){a=a.then(function(E){return s(E,T,c,h)})}),a});function m(){return!n(r)}}}function Q(){return{resolveAll:o,impl:{readAll:n}};function o(){return n().then(function(t){return Promise.all(t.map(function(s){return s.resolve()}))}).then(function(t){return t.join(`
2
33
  `)})}function n(){return Promise.resolve(d.asArray(document.styleSheets)).then(s).then(t).then(function(r){return r.map(l)});function t(r){return r.filter(function(c){return c.type===CSSRule.FONT_FACE_RULE}).filter(function(c){return I.shouldProcess(c.style.getPropertyValue("src"))})}function s(r){const c=[];return r.forEach(function(h){if(Object.prototype.hasOwnProperty.call(h,"cssRules"))try{d.asArray(h.cssRules||[]).forEach(c.push.bind(c))}catch(m){console.log("Error while reading CSS rules from "+h.href,m.toString())}}),c}function l(r){return{resolve:function(){const h=(r.parentStyleSheet||{}).href;return I.inlineAll(r.cssText,h)},src:function(){return r.style.getPropertyValue("src")}}}}}function Y(){return{inlineAll:n,impl:{newImage:o}};function o(t){return{inline:s};function s(l){return d.isDataUrl(t.src)?Promise.resolve():Promise.resolve(t.src).then(l||d.getAndEncode).then(function(r){return d.dataAsUrl(r,d.mimeType(t.src))}).then(function(r){return new Promise(function(c){t.onload=function(){c()},t.onerror=function(){const h=v.impl.options.imagePlaceholder;if(h)try{t.onload=null,t.onerror=null,t.src=h,t.srcset=""}catch(m){console.error("Image placeholder assignment failed:",m)}else console.warn("Image inline failed, continuing without placeholder:",t.src);c()},t.src=r,t.srcset=""})})}}function n(t){if(!(t instanceof Element))return Promise.resolve(t);return s(t).then(function(){return t instanceof HTMLImageElement?o(t).inline():Promise.all(d.asArray(t.childNodes).map(function(l){return n(l)}))});function s(l){const r=l.style.getPropertyValue("background");return r?I.inlineAll(r).then(function(c){l.style.setProperty("background",c,l.style.getPropertyPriority("background"))}).then(function(){return l}):Promise.resolve(l)}}}exports.domtoimage=v;
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("react/jsx-runtime");require("react");const je=require("react-redux"),qe=require("../data/DataProvider.js"),Ve=require("../data/DataConsumer.js"),We=require("./map.js"),Ge=require("./MapDataFrame.js"),Ze=require("./MapCSVDataFrame.js"),He=[{label:"KENYA",value:"KEN",center:[35.8166634,.1],scale:2e3},{label:"Nigeria",value:"NGA",center:[7.491302,9.072264],scale:2e3},{label:"South Africa",value:"ZAF",center:[24.676997,-28.48322],scale:2e3},{label:"West Africa",value:"West Africa",center:[-7.293255,13.90572],scale:1500},{label:"Africa",value:"Africa",center:[13.134227,-11.523088],scale:550},{label:"Ethiopia",value:"ETH",center:[35.8166634,1.7],scale:2e3},{label:"Zambia",value:"ZMB",center:[26.459455,-14.668135],scale:2e3},{label:"Democratic Republic of the Congo",value:"DRC",center:[23.174338,-5.837475],scale:1250},{label:"World",value:"World",center:[0,20.050043],scale:150}],Je=n=>r.jsx(Ke,{...n}),Ke=n=>{var U;const{unique:m,editing:s,"data-filters":k="{}","data-app":d="csv","data-csv":E="","data-dimension1":M="","data-dimension2":P="","data-measures":u='["prevalenceSmokeAny"]',"data-height":O=600,width:j=960,"data-data-source-text":q="","data-data-source-label":V="Source","data-national-average-label":W="National Average","data-legend-title":G="Legend Title","data-legend-breaks":Z="[]","data-zoom-enabled":b=!1,"data-show-legend-labels":h=!1,"data-map-file":H,"data-mapping-field":J="zone","data-map-label-field":K="admin","data-has-multiple-measures":y="false",topoJSONField:_="collection","data-map-center":Y="NGA","data-map-label-show-value":v="false","data-show-tooltip":C="true","data-measure-selector-label":$="","data-value-format":Q="","data-show-overall-value":F="false","data-auto-generate-breaks":L="false","data-number-of-breaks":X=5,"data-scheme":ee="reds","data-show-no-data-label":w="false","data-group":S="default","data-map-symbols":ae="[]","data-tooltip-theme":te="map-tooltip-dark","data-label-font-size":oe=12,"data-label-font-weight":le="normal","data-label-font-color":re="#595959","data-legend-font-size":ne=12,"data-legend-font-weight":se="normal","data-custom-tooltips":de="[]","data-format-style":p="decimal","data-decimals":D="2","data-currency":ie="","data-tooltip-font-size":ce=14,"data-show-admin-unit-label":me="showAll","data-map-no-data-color":ue="#f8f8f8","data-map-boundary-color":pe="#000","data-map-focus-boundary-color":fe="#000","data-highlighted-location":ge="","data-tooltip-format":be=`{locationName} %({value},2)
2
- {label}: %({value},2)`,"data-show-no-data-tooltip":x="false","data-map-container-bg-color":he="#fff","data-map-position":ye="{}","data-main-layer-id":ve="","data-enabled-layers":Ce,"data-point-label-color":Fe="#fff","data-point-label-format":Le="{locationName} %({value},2)","data-show-no-data-legend-item":I=!1,"data-highlighted-loc-label-format":we="{locationName} - Score: #({value},2)","data-enable-summary-view":Qe="false","data-map-type":N="DEFAULT","data-default-point-color":Se="#FFFF00","data-aggregation-formula":De="COUNT","data-zoom-level-to-show-points":xe=2,"data-zoom-on-filter":T="false","data-zoom-on-filter-field":Ie="","data-no-data-text":Ne="No Data","data-labels-exclusion-list":Te="","data-custom-measure-labels":ze="{}","data-show-shading-layer-labels":Ae="ifUnitHasData","data-dvz-proxy-dataset-id":f,"data-recently-toggled-layer-id":Re=null,intl:Xe,settings:ea}=n,Ue=e=>s?e:decodeURIComponent(e),o=e=>{try{if(e)return JSON.parse(Ue(e))}catch{console.error("error parsing value:"+e)}return null},Be=e=>{let t=o(e)||[];return t=t.map(a=>(a.min&&(a.min=parseFloat(a.min)),a.max&&(a.max=parseFloat(a.max)),a.color=decodeURIComponent(a.color),a)),t},ke=e=>{const t=o(e)||[];let a={};return t&&t.forEach?t.forEach(c=>{c.value!=null&&c.value.filter(B=>B!=null&&B.toString().trim()!="").length>0&&(a[c.param]=c.value)}):a=t,a},Ee={style:p==="compacted"?"decimal":p,notation:p==="compacted"?"compact":"standard",currency:ie,minimumFractionDigits:parseInt(D),maximumFractionDigits:parseInt(D)};let g=o(Ce)||[];g=g.map(e=>(e.bgColor=decodeURIComponent(e.bgColor),e.fontColor=decodeURIComponent(e.fontColor),e));const z=He.find(e=>e.value===Y),A=y==!0||y=="true";let l=[M,P].filter(e=>e!="none"&&e!=null).join("/");const i={unique:m,editing:s,source:`/${H}`,center:z.center,scale:z.scale,measures:u,legendTitle:G,height:O,width:j,topoJSONField:_,mappingField:J,dataSourceText:q,dataSourceLabel:V,nationalAverageLabel:W,legendBreaks:Be(Z),mapLabelField:K,zoomEnabled:b==!0||b=="true",showLegendLabels:h==!0||h=="true",multipleMeasures:A,app:d,mapLabelShowValue:v==!0||v=="true",showTooltip:C==!0||C=="true",showOverallValue:F==!0||F=="true",measureSelectorLabel:$,valueFormat:Q,autoGenerateBreaks:L==!0||L=="true",showNoDataLabel:w==!0||w=="true",numberOfBreaks:X,colorScheme:ee,group:S,symbols:o(ae)||[],tooltipTheme:te,labelFontSize:oe,labelFontColor:decodeURIComponent(re),labelFontWeight:le,legendFontSize:ne,legendFontWeight:se,customTooltips:o(de)||[],format:Ee,tooltipFontSize:ce,showAdminUnitLabel:me,mapNoDataColor:decodeURIComponent(ue),mapBoundaryColor:decodeURIComponent(pe),mapFocusBoundaryColor:decodeURIComponent(fe),highlightedLocation:ge,tooltipFormat:be,showNoDataTooltip:x==!0||x=="true",fields:l.split("/"),mapContainerBgColor:decodeURIComponent(he),mapPosition:o(ye),mainLayerId:ve,enabledLayers:g,pointLabelColor:decodeURIComponent(Fe),pointLabelFormat:Le,showNoDataLegendItem:I==!0||I=="true",highlightedLocLabelFormat:we,mapType:N,defaultPointColor:decodeURIComponent(Se),zoomLevelToShowPoints:xe,zoomOnFilter:T==!0||T=="true",zoomOnFilterField:Ie,noDataText:Ne,labelsExclusionList:Te.split(",").map(e=>e.trim()),showShadingLayerLabels:Ae,dvzProxyDatasetId:f,recentlyToggledLayerId:Re};if(i.recentlyToggledLayerId){const e=i.enabledLayers.find(t=>String(t.id)===String(i.recentlyToggledLayerId));e&&(e!=null&&e.apiField)&&(l=(U=e.apiField)==null?void 0:U.toLowerCase())}const Me=o(ze)||{},Pe=d==="csv"?Ze.default:Ge.default,Oe=s?(o(u)||[]).join(","):u,R=ke(k);return f&&(R.dvzProxyDatasetId=f),r.jsx(qe.default,{params:R,app:d,csv:decodeURIComponent(E),group:S,editing:s,store:[d,m,...l.split("/")],source:l,children:r.jsx(Ve.default,{children:r.jsx(Pe,{measures:Oe,multipleMeasures:A,mapType:N,aggregationFormula:De,customMeasureLabels:Me,source:l,children:r.jsx(We.default,{...i})})})})},_e=(n,m)=>({}),Ye={},$e=je.connect(_e,Ye)(Je);exports.default=$e;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("react/jsx-runtime");require("react");const je=require("react-redux"),qe=require("../data/DataProvider.js"),Ve=require("../data/DataConsumer.js"),We=require("./map.js"),Ge=require("./MapDataFrame.js"),Ze=require("./MapCSVDataFrame.js"),He=[{label:"KENYA",value:"KEN",center:[35.8166634,.1],scale:2e3},{label:"Nigeria",value:"NGA",center:[7.491302,9.072264],scale:2e3},{label:"South Africa",value:"ZAF",center:[24.676997,-28.48322],scale:2e3},{label:"West Africa",value:"West Africa",center:[-7.293255,13.90572],scale:1500},{label:"Africa",value:"Africa",center:[13.134227,-11.523088],scale:550},{label:"Ethiopia",value:"ETH",center:[35.8166634,1.7],scale:2e3},{label:"Zambia",value:"ZMB",center:[26.459455,-14.668135],scale:2e3},{label:"Democratic Republic of the Congo",value:"DRC",center:[23.174338,-5.837475],scale:1250},{label:"World",value:"World",center:[0,20.050043],scale:150}],Je=n=>r.jsx(Ke,{...n}),Ke=n=>{var A;const{unique:m,editing:s,"data-filters":E="{}","data-app":d="csv","data-csv":M="","data-dimension1":P="","data-dimension2":k="","data-measures":u="[]","data-height":O=600,width:j=960,"data-data-source-text":q="","data-data-source-label":V="Source","data-national-average-label":W="National Average","data-legend-title":G="Legend Title","data-legend-breaks":Z="[]","data-zoom-enabled":b=!1,"data-show-legend-labels":h=!1,"data-map-file":H,"data-mapping-field":J="zone","data-map-label-field":K="admin","data-has-multiple-measures":y="false",topoJSONField:_="collection","data-map-center":Y="NGA","data-map-label-show-value":C="false","data-show-tooltip":v="true","data-measure-selector-label":$="","data-value-format":Q="","data-show-overall-value":F="false","data-auto-generate-breaks":L="false","data-number-of-breaks":X=5,"data-scheme":ee="reds","data-show-no-data-label":w="false","data-group":S="default","data-map-symbols":ae="[]","data-tooltip-theme":te="map-tooltip-dark","data-label-font-size":oe=12,"data-label-font-weight":le="normal","data-label-font-color":re="#595959","data-legend-font-size":ne=12,"data-legend-font-weight":se="normal","data-custom-tooltips":de="[]","data-format-style":p="decimal","data-decimals":D="2","data-currency":ie="","data-tooltip-font-size":ce=14,"data-show-admin-unit-label":me="showAll","data-map-no-data-color":ue="#f8f8f8","data-map-boundary-color":pe="#000","data-map-focus-boundary-color":fe="#000","data-highlighted-location":ge="","data-tooltip-format":be=`{locationName} %({value},2)
2
+ {label}: %({value},2)`,"data-show-no-data-tooltip":x="false","data-map-container-bg-color":he="#fff","data-map-position":ye="{}","data-main-layer-id":Ce="","data-enabled-layers":ve,"data-point-label-color":Fe="#fff","data-point-label-format":Le="{locationName} %({value},2)","data-show-no-data-legend-item":I=!1,"data-highlighted-loc-label-format":we="{locationName} - Score: #({value},2)","data-enable-summary-view":Qe="false","data-map-type":N="DEFAULT","data-default-point-color":Se="#FFFF00","data-aggregation-formula":De="COUNT","data-zoom-level-to-show-points":xe=2,"data-zoom-on-filter":T="false","data-zoom-on-filter-field":Ie="","data-no-data-text":Ne="No Data","data-labels-exclusion-list":Te="","data-custom-measure-labels":ze="{}","data-show-shading-layer-labels":Re="ifUnitHasData","data-dvz-proxy-dataset-id":f,"data-recently-toggled-layer-id":Ue=null,intl:Xe,settings:ea}=n,Ae=e=>s?e:decodeURIComponent(e),o=e=>{try{if(e)return JSON.parse(Ae(e))}catch{console.error("error parsing value:"+e)}return null},Be=e=>{let t=o(e)||[];return t=t.map(a=>(a.min&&(a.min=parseFloat(a.min)),a.max&&(a.max=parseFloat(a.max)),a.color=decodeURIComponent(a.color),a)),t},Ee=e=>{const t=o(e)||[];let a={};return t&&t.forEach?t.forEach(c=>{c.value!=null&&c.value.filter(B=>B!=null&&B.toString().trim()!="").length>0&&(a[c.param]=c.value)}):a=t,a},Me={style:p==="compacted"?"decimal":p,notation:p==="compacted"?"compact":"standard",currency:ie,minimumFractionDigits:parseInt(D),maximumFractionDigits:parseInt(D)};let g=o(ve)||[];g=g.map(e=>(e.bgColor=decodeURIComponent(e.bgColor),e.fontColor=decodeURIComponent(e.fontColor),e));const z=He.find(e=>e.value===Y),R=y==!0||y=="true";let l=[P,k].filter(e=>e!="none"&&e!=null).join("/");const i={unique:m,editing:s,source:`/${H}`,center:z.center,scale:z.scale,measures:u,legendTitle:G,height:O,width:j,topoJSONField:_,mappingField:J,dataSourceText:q,dataSourceLabel:V,nationalAverageLabel:W,legendBreaks:Be(Z),mapLabelField:K,zoomEnabled:b==!0||b=="true",showLegendLabels:h==!0||h=="true",multipleMeasures:R,app:d,mapLabelShowValue:C==!0||C=="true",showTooltip:v==!0||v=="true",showOverallValue:F==!0||F=="true",measureSelectorLabel:$,valueFormat:Q,autoGenerateBreaks:L==!0||L=="true",showNoDataLabel:w==!0||w=="true",numberOfBreaks:X,colorScheme:ee,group:S,symbols:o(ae)||[],tooltipTheme:te,labelFontSize:oe,labelFontColor:decodeURIComponent(re),labelFontWeight:le,legendFontSize:ne,legendFontWeight:se,customTooltips:o(de)||[],format:Me,tooltipFontSize:ce,showAdminUnitLabel:me,mapNoDataColor:decodeURIComponent(ue),mapBoundaryColor:decodeURIComponent(pe),mapFocusBoundaryColor:decodeURIComponent(fe),highlightedLocation:ge,tooltipFormat:be,showNoDataTooltip:x==!0||x=="true",fields:l.split("/"),mapContainerBgColor:decodeURIComponent(he),mapPosition:o(ye),mainLayerId:Ce,enabledLayers:g,pointLabelColor:decodeURIComponent(Fe),pointLabelFormat:Le,showNoDataLegendItem:I==!0||I=="true",highlightedLocLabelFormat:we,mapType:N,defaultPointColor:decodeURIComponent(Se),zoomLevelToShowPoints:xe,zoomOnFilter:T==!0||T=="true",zoomOnFilterField:Ie,noDataText:Ne,labelsExclusionList:Te.split(",").map(e=>e.trim()),showShadingLayerLabels:Re,dvzProxyDatasetId:f,recentlyToggledLayerId:Ue};if(i.recentlyToggledLayerId){const e=i.enabledLayers.find(t=>String(t.id)===String(i.recentlyToggledLayerId));e&&(e!=null&&e.apiField)&&(l=(A=e.apiField)==null?void 0:A.toLowerCase())}const Pe=o(ze)||{},ke=d==="csv"?Ze.default:Ge.default,Oe=s?(o(u)||[]).join(","):u,U=Ee(E);return f&&(U.dvzProxyDatasetId=f),r.jsx(qe.default,{params:U,app:d,csv:decodeURIComponent(M),group:S,editing:s,store:[d,m,...l.split("/")],source:l,children:r.jsx(Ve.default,{children:r.jsx(ke,{measures:Oe,multipleMeasures:R,mapType:N,aggregationFormula:De,customMeasureLabels:Pe,source:l,children:r.jsx(We.default,{...i})})})})},_e=(n,m)=>({}),Ye={},$e=je.connect(_e,Ye)(Je);exports.default=$e;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("react/jsx-runtime");require("react");const i=require("semantic-ui-react");function l(e){const c=()=>10,n=e?document.getElementById(e):null;if(n){const r=n.getBoundingClientRect().top+window.pageYOffset;window.scroll({top:r-c(),behavior:"smooth"})}}const a=function(e){return e?e.toString().replace(/&#(\d+);/g,function(c,n){return String.fromCharCode(n)}):""},s=e=>{const{contextRef:c,sections:n=[],navTitle:r,toTopLabel:u}=e;return o.jsx("div",{className:"left navigator",children:o.jsxs(i.Menu,{vertical:!0,children:[o.jsx(i.Menu.Item,{header:!0,children:r}),n.map(t=>o.jsxs(i.Menu.Item,{active:t.active,onClick:()=>l(t.id),children:[t.iconComponent?t.iconComponent:o.jsx(i.Image,{src:t.icon}),o.jsx(i.Label,{basic:!0,children:a(t.label)})]},t.label))]})})};exports.default=s;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("react/jsx-runtime");require("react");const o=require("semantic-ui-react"),l=require("html-entities");function s(e){const r=()=>10,i=e?document.getElementById(e):null;if(i){const c=i.getBoundingClientRect().top+window.pageYOffset;window.scroll({top:c-r(),behavior:"smooth"})}}const a=function(e){return e?l.decode(e.toString()):""},u=e=>{const{contextRef:r,sections:i=[],navTitle:c,toTopLabel:d}=e;return n.jsx("div",{className:"left navigator",children:n.jsxs(o.Menu,{vertical:!0,children:[n.jsx(o.Menu.Item,{header:!0,children:c}),i.map(t=>n.jsxs(o.Menu.Item,{active:t.active,onClick:()=>s(t.id),children:[t.iconComponent?t.iconComponent:n.jsx(o.Image,{src:t.icon}),n.jsx(o.Label,{basic:!0,children:a(t.label)})]},t.label))]})})};exports.default=u;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),o=require("semantic-ui-react"),_=require("react-intersection-observer"),g=require("react"),c=require("@devgateway/wp-react-lib"),C=require("react-intl"),M=require("react-redux"),q=require("../reducers/data.js"),S=require("./FloatingNavigator.js"),h=function(e){return e?e.toString().replace(/&#(\d+);/g,function(i,r){return String.fromCharCode(r)}):""},b=({title:e,subtitle:i,icon:r,media:s})=>t.jsxs(o.Menu,{className:"header title",text:!0,children:[t.jsx(o.Menu.Item,{children:t.jsx(o.Image,{src:s&&s.guid?s.guid.rendered:r,alt:s&&s.alt_text?s.alt_text:""})}),t.jsx(o.Menu.Header,{children:t.jsx("div",{children:t.jsxs("h2",{className:"page-module-title",children:[e,t.jsx("span",{style:{display:"block"},className:"page-module-subtitle",children:i})]})})})]}),T=e=>{var i;return t.jsx("img",{src:(i=e.media)!=null&&i.guid?e.media.guid.rendered:null,alt:""})},I=({page:e,locale:i})=>{var r;return t.jsxs(o.Container,{fluid:!0,className:`section ${e.slug}`,id:e.id,children:[t.jsx("div",{id:`${e.slug}`}),t.jsx(c.MediaProvider,{id:(r=e.meta_fields)!=null&&r.icon?e.meta_fields.icon[0]:null,children:t.jsx(c.MediaConsumer,{children:t.jsx(b,{title:h(e.title.rendered),subtitle:h(e.meta_fields.subtitle)})})}),e&&t.jsx(c.PostContent,{as:o.Container,fluid:!0,post:e})]})},N=({pages:e,locale:i,editing:r,navTitle:s,toTopLabel:a})=>{const[m,d]=g.useState([]),u=g.useCallback((n,{direction:l="down",onScreen:f})=>{d(f?x=>x.indexOf(n)===-1?[...x,n]:x:x=>x.filter(P=>P!==n))},[]),j=e?e.sort((n,l)=>n.menu_order-l.menu_order):[],v=j.map(n=>{var l;return{active:m.includes(n.id),id:n.id,label:n.meta_fields.label?n.meta_fields.label:n.title.rendered,iconComponent:t.jsx(c.MediaProvider,{id:(l=n.meta_fields)!=null&&l.icon?n.meta_fields.icon[0]:null,children:t.jsx(c.MediaConsumer,{children:t.jsx(T,{})})})}});return t.jsxs(g.Fragment,{children:[!r&&t.jsx(S.default,{navTitle:s,toTopLabel:a,sections:v}),t.jsx("div",{className:"pages",children:j.map(n=>t.jsx(_.InView,{as:"div",onChange:(l,f)=>u(n.id,{onScreen:l,direction:f.boundingClientRect.top<0?"up":"down"}),children:t.jsx(I,{locale:i,page:n,onVisibilityUpdate:u})},n.id))})]})},R=e=>{const{navTitle:i,toTopLabel:r,editing:s,parent:a,unique:m,locale:d,onLoadPageModule:u}=e;return g.useEffect(()=>{u({data:e})},[e]),t.jsx(o.Container,{className:"viz dashboard green",fluid:!0,children:e.parent&&t.jsx(c.PageProvider,{locale:d,parent:e.parent,store:`modules_${a}_${m}`,perPage:100,children:t.jsx(c.PageConsumer,{children:t.jsx(N,{toTopLabel:r,navTitle:i,editing:s==="true",locale:d})})})})},w=(e,i)=>{let{"data-nav-label":r="Sections","data-to-top-label":s="TO THE TOP","data-preview-mode":a="Desktop",editing:m,parent:d,unique:u,intl:{locale:j}}=i;return a==="undefined"&&(a="Desktop"),{navTitle:r,toTopLabel:s,previewMode:a,editing:m,parent:d,unique:u,locale:j}},y={onLoadPageModule:q.setPageModuleProps},H=M.connect(w,y)(C.injectIntl(R));exports.SectionHeader=b;exports.default=H;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),o=require("semantic-ui-react"),_=require("react-intersection-observer"),g=require("react"),c=require("@devgateway/wp-react-lib"),M=require("react-intl"),q=require("react-redux"),C=require("../reducers/data.js"),S=require("./FloatingNavigator.js"),T=require("html-entities"),h=function(e){return e?T.decode(e.toString()):""},b=({title:e,subtitle:r,icon:s,media:i})=>t.jsxs(o.Menu,{className:"header title",text:!0,children:[t.jsx(o.Menu.Item,{children:t.jsx(o.Image,{src:i&&i.guid?i.guid.rendered:s,alt:i&&i.alt_text?i.alt_text:""})}),t.jsx(o.Menu.Header,{children:t.jsx("div",{children:t.jsxs("h2",{className:"page-module-title",children:[e,t.jsx("span",{style:{display:"block"},className:"page-module-subtitle",children:r})]})})})]}),I=e=>{var r;return t.jsx("img",{src:(r=e.media)!=null&&r.guid?e.media.guid.rendered:null,alt:""})},N=({page:e,locale:r})=>{var s;return t.jsxs(o.Container,{fluid:!0,className:`section ${e.slug}`,id:e.id,children:[t.jsx("div",{id:`${e.slug}`}),t.jsx(c.MediaProvider,{id:(s=e.meta_fields)!=null&&s.icon?e.meta_fields.icon[0]:null,children:t.jsx(c.MediaConsumer,{children:t.jsx(b,{title:h(e.title.rendered),subtitle:h(e.meta_fields.subtitle)})})}),e&&t.jsx(c.PostContent,{as:o.Container,fluid:!0,post:e})]})},R=({pages:e,locale:r,editing:s,navTitle:i,toTopLabel:d})=>{const[m,l]=g.useState([]),u=g.useCallback((n,{direction:a="down",onScreen:f})=>{l(f?x=>x.indexOf(n)===-1?[...x,n]:x:x=>x.filter(P=>P!==n))},[]),j=e?e.sort((n,a)=>n.menu_order-a.menu_order):[],v=j.map(n=>{var a;return{active:m.includes(n.id),id:n.id,label:h(n.meta_fields.label?n.meta_fields.label:n.title.rendered),iconComponent:t.jsx(c.MediaProvider,{id:(a=n.meta_fields)!=null&&a.icon?n.meta_fields.icon[0]:null,children:t.jsx(c.MediaConsumer,{children:t.jsx(I,{})})})}});return t.jsxs(g.Fragment,{children:[!s&&t.jsx(S.default,{navTitle:i,toTopLabel:d,sections:v}),t.jsx("div",{className:"pages",children:j.map(n=>t.jsx(_.InView,{as:"div",onChange:(a,f)=>u(n.id,{onScreen:a,direction:f.boundingClientRect.top<0?"up":"down"}),children:t.jsx(N,{locale:r,page:n,onVisibilityUpdate:u})},n.id))})]})},w=e=>{const{navTitle:r,toTopLabel:s,editing:i,parent:d,unique:m,locale:l,onLoadPageModule:u}=e;return g.useEffect(()=>{u({data:e})},[e]),t.jsx(o.Container,{className:"viz dashboard green",fluid:!0,children:e.parent&&t.jsx(c.PageProvider,{locale:l,parent:e.parent,store:`modules_${d}_${m}`,perPage:100,children:t.jsx(c.PageConsumer,{children:t.jsx(R,{toTopLabel:s,navTitle:r,editing:i==="true",locale:l})})})})},y=(e,r)=>{let{"data-nav-label":s="Sections","data-to-top-label":i="TO THE TOP","data-preview-mode":d="Desktop",editing:m,parent:l,unique:u,intl:{locale:j}}=r;return d==="undefined"&&(d="Desktop"),{navTitle:s,toTopLabel:i,previewMode:d,editing:m,parent:l,unique:u,locale:j}},H={onLoadPageModule:C.setPageModuleProps},L=q.connect(y,H)(M.injectIntl(w));exports.SectionHeader=b;exports.default=L;
@@ -1,3 +1,35 @@
1
+ /*!
2
+ * dom-to-image
3
+ * https://github.com/tsayen/dom-to-image
4
+ *
5
+ * The MIT License (MIT)
6
+ *
7
+ * Copyright 2015 Anatolii Saienko (https://github.com/tsayen)
8
+ * Copyright 2012 Paul Bakaus (http://paulbakaus.com/)
9
+ *
10
+ * Modifications copyright (c) 2025 Development Gateway
11
+ * This file has been modified from the original source.
12
+ * Original source: https://github.com/tsayen/dom-to-image
13
+ *
14
+ * Permission is hereby granted, free of charge, to any person obtaining
15
+ * a copy of this software and associated documentation files (the
16
+ * "Software"), to deal in the Software without restriction, including
17
+ * without limitation the rights to use, copy, modify, merge, publish,
18
+ * distribute, sublicense, and/or sell copies of the Software, and to
19
+ * permit persons to whom the Software is furnished to do so, subject to
20
+ * the following conditions:
21
+ *
22
+ * The above copyright notice and this permission notice shall be
23
+ * included in all copies or substantial portions of the Software.
24
+ *
25
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
26
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
27
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
28
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
29
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
30
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
31
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
32
+ */
1
33
  const d = z(), I = K(), F = Q(), N = Y(), k = {
2
34
  // Default is to fail on error, no placeholder
3
35
  imagePlaceholder: void 0,
@@ -21,12 +21,12 @@ const Ja = [
21
21
  const {
22
22
  unique: c,
23
23
  editing: s,
24
- "data-filters": k = "{}",
24
+ "data-filters": E = "{}",
25
25
  "data-app": i = "csv",
26
- "data-csv": E = "",
26
+ "data-csv": k = "",
27
27
  "data-dimension1": M = "",
28
28
  "data-dimension2": P = "",
29
- "data-measures": u = '["prevalenceSmokeAny"]',
29
+ "data-measures": u = "[]",
30
30
  "data-height": O = 600,
31
31
  width: V = 960,
32
32
  "data-data-source-text": W = "",
@@ -39,15 +39,15 @@ const Ja = [
39
39
  "data-map-file": J,
40
40
  "data-mapping-field": K = "zone",
41
41
  "data-map-label-field": q = "admin",
42
- "data-has-multiple-measures": y = "false",
42
+ "data-has-multiple-measures": C = "false",
43
43
  topoJSONField: Y = "collection",
44
44
  "data-map-center": $ = "NGA",
45
45
  //country
46
- "data-map-label-show-value": C = "false",
47
- "data-show-tooltip": v = "true",
46
+ "data-map-label-show-value": y = "false",
47
+ "data-show-tooltip": F = "true",
48
48
  "data-measure-selector-label": Q = "",
49
49
  "data-value-format": X = "",
50
- "data-show-overall-value": F = "false",
50
+ "data-show-overall-value": v = "false",
51
51
  "data-auto-generate-breaks": L = "false",
52
52
  "data-number-of-breaks": _ = 5,
53
53
  "data-scheme": aa = "reds",
@@ -74,10 +74,10 @@ const Ja = [
74
74
  {label}: %({value},2)`,
75
75
  "data-show-no-data-tooltip": I = "false",
76
76
  "data-map-container-bg-color": ha = "#fff",
77
- "data-map-position": ya = "{}",
78
- "data-main-layer-id": Ca = "",
79
- "data-enabled-layers": va,
80
- "data-point-label-color": Fa = "#fff",
77
+ "data-map-position": Ca = "{}",
78
+ "data-main-layer-id": ya = "",
79
+ "data-enabled-layers": Fa,
80
+ "data-point-label-color": va = "#fff",
81
81
  "data-point-label-format": La = "{locationName} %({value},2)",
82
82
  "data-show-no-data-legend-item": N = !1,
83
83
  "data-highlighted-loc-label-format": wa = "{locationName} - Score: #({value},2)",
@@ -91,9 +91,9 @@ const Ja = [
91
91
  "data-no-data-text": za = "No Data",
92
92
  "data-labels-exclusion-list": Ta = "",
93
93
  "data-custom-measure-labels": xa = "{}",
94
- "data-show-shading-layer-labels": Aa = "ifUnitHasData",
94
+ "data-show-shading-layer-labels": Ua = "ifUnitHasData",
95
95
  "data-dvz-proxy-dataset-id": f,
96
- "data-recently-toggled-layer-id": Ua = null,
96
+ "data-recently-toggled-layer-id": Aa = null,
97
97
  intl: Xa,
98
98
  settings: _a
99
99
  } = n, Ba = (a) => s ? a : decodeURIComponent(a), o = (a) => {
@@ -107,22 +107,22 @@ const Ja = [
107
107
  }, Ra = (a) => {
108
108
  let t = o(a) || [];
109
109
  return t = t.map((e) => (e.min && (e.min = parseFloat(e.min)), e.max && (e.max = parseFloat(e.max)), e.color = decodeURIComponent(e.color), e)), t;
110
- }, ka = (a) => {
110
+ }, Ea = (a) => {
111
111
  const t = o(a) || [];
112
112
  let e = {};
113
113
  return t && t.forEach ? t.forEach((m) => {
114
114
  m.value != null && m.value.filter((R) => R != null && R.toString().trim() != "").length > 0 && (e[m.param] = m.value);
115
115
  }) : e = t, e;
116
- }, Ea = {
116
+ }, ka = {
117
117
  style: p === "compacted" ? "decimal" : p,
118
118
  notation: p === "compacted" ? "compact" : "standard",
119
119
  currency: da,
120
120
  minimumFractionDigits: parseInt(D),
121
121
  maximumFractionDigits: parseInt(D)
122
122
  };
123
- let g = o(va) || [];
123
+ let g = o(Fa) || [];
124
124
  g = g.map((a) => (a.bgColor = decodeURIComponent(a.bgColor), a.fontColor = decodeURIComponent(a.fontColor), a));
125
- const x = Ja.find((a) => a.value === $), A = y == !0 || y == "true";
125
+ const x = Ja.find((a) => a.value === $), U = C == !0 || C == "true";
126
126
  let l = [M, P].filter((a) => a != "none" && a != null).join("/");
127
127
  const d = {
128
128
  unique: c,
@@ -143,11 +143,11 @@ const Ja = [
143
143
  mapLabelField: q,
144
144
  zoomEnabled: b == !0 || b == "true",
145
145
  showLegendLabels: h == !0 || h == "true",
146
- multipleMeasures: A,
146
+ multipleMeasures: U,
147
147
  app: i,
148
- mapLabelShowValue: C == !0 || C == "true",
149
- showTooltip: v == !0 || v == "true",
150
- showOverallValue: F == !0 || F == "true",
148
+ mapLabelShowValue: y == !0 || y == "true",
149
+ showTooltip: F == !0 || F == "true",
150
+ showOverallValue: v == !0 || v == "true",
151
151
  measureSelectorLabel: Q,
152
152
  valueFormat: X,
153
153
  autoGenerateBreaks: L == !0 || L == "true",
@@ -163,7 +163,7 @@ const Ja = [
163
163
  legendFontSize: na,
164
164
  legendFontWeight: sa,
165
165
  customTooltips: o(ia) || [],
166
- format: Ea,
166
+ format: ka,
167
167
  tooltipFontSize: ma,
168
168
  showAdminUnitLabel: ca,
169
169
  mapNoDataColor: decodeURIComponent(ua),
@@ -174,10 +174,10 @@ const Ja = [
174
174
  showNoDataTooltip: I == !0 || I == "true",
175
175
  fields: l.split("/"),
176
176
  mapContainerBgColor: decodeURIComponent(ha),
177
- mapPosition: o(ya),
178
- mainLayerId: Ca,
177
+ mapPosition: o(Ca),
178
+ mainLayerId: ya,
179
179
  enabledLayers: g,
180
- pointLabelColor: decodeURIComponent(Fa),
180
+ pointLabelColor: decodeURIComponent(va),
181
181
  pointLabelFormat: La,
182
182
  showNoDataLegendItem: N == !0 || N == "true",
183
183
  highlightedLocLabelFormat: wa,
@@ -188,21 +188,21 @@ const Ja = [
188
188
  zoomOnFilterField: Na,
189
189
  noDataText: za,
190
190
  labelsExclusionList: Ta.split(",").map((a) => a.trim()),
191
- showShadingLayerLabels: Aa,
191
+ showShadingLayerLabels: Ua,
192
192
  dvzProxyDatasetId: f,
193
- recentlyToggledLayerId: Ua
193
+ recentlyToggledLayerId: Aa
194
194
  };
195
195
  if (d.recentlyToggledLayerId) {
196
196
  const a = d.enabledLayers.find((t) => String(t.id) === String(d.recentlyToggledLayerId));
197
197
  a && (a != null && a.apiField) && (l = (B = a.apiField) == null ? void 0 : B.toLowerCase());
198
198
  }
199
- const Ma = o(xa) || {}, Pa = i === "csv" ? Ha : Za, Oa = s ? (o(u) || []).join(",") : u, U = ka(k);
200
- return f && (U.dvzProxyDatasetId = f), /* @__PURE__ */ r(
199
+ const Ma = o(xa) || {}, Pa = i === "csv" ? Ha : Za, Oa = s ? (o(u) || []).join(",") : u, A = Ea(E);
200
+ return f && (A.dvzProxyDatasetId = f), /* @__PURE__ */ r(
201
201
  Wa,
202
202
  {
203
- params: U,
203
+ params: A,
204
204
  app: i,
205
- csv: decodeURIComponent(E),
205
+ csv: decodeURIComponent(k),
206
206
  group: S,
207
207
  editing: s,
208
208
  store: [i, c, ...l.split("/")],
@@ -211,7 +211,7 @@ const Ja = [
211
211
  Pa,
212
212
  {
213
213
  measures: Oa,
214
- multipleMeasures: A,
214
+ multipleMeasures: U,
215
215
  mapType: z,
216
216
  aggregationFormula: Da,
217
217
  customMeasureLabels: Ma,
@@ -1,30 +1,29 @@
1
1
  import { jsx as n, jsxs as l } from "react/jsx-runtime";
2
2
  import "react";
3
- import { Menu as i, Image as a, Label as m } from "semantic-ui-react";
4
- function d(t) {
3
+ import { Menu as c, Image as a, Label as m } from "semantic-ui-react";
4
+ import { decode as d } from "html-entities";
5
+ function f(t) {
5
6
  const r = () => 10, o = t ? document.getElementById(t) : null;
6
7
  if (o) {
7
- const c = o.getBoundingClientRect().top + window.pageYOffset;
8
+ const i = o.getBoundingClientRect().top + window.pageYOffset;
8
9
  window.scroll({
9
- top: c - r(),
10
+ top: i - r(),
10
11
  behavior: "smooth"
11
12
  });
12
13
  }
13
14
  }
14
- const f = function(t) {
15
- return t ? t.toString().replace(/&#(\d+);/g, function(r, o) {
16
- return String.fromCharCode(o);
17
- }) : "";
18
- }, g = (t) => {
19
- const { contextRef: r, sections: o = [], navTitle: c, toTopLabel: s } = t;
20
- return /* @__PURE__ */ n("div", { className: "left navigator", children: /* @__PURE__ */ l(i, { vertical: !0, children: [
21
- /* @__PURE__ */ n(i.Item, { header: !0, children: c }),
22
- o.map((e) => /* @__PURE__ */ l(i.Item, { active: e.active, onClick: () => d(e.id), children: [
15
+ const s = function(t) {
16
+ return t ? d(t.toString()) : "";
17
+ }, b = (t) => {
18
+ const { contextRef: r, sections: o = [], navTitle: i, toTopLabel: p } = t;
19
+ return /* @__PURE__ */ n("div", { className: "left navigator", children: /* @__PURE__ */ l(c, { vertical: !0, children: [
20
+ /* @__PURE__ */ n(c.Item, { header: !0, children: i }),
21
+ o.map((e) => /* @__PURE__ */ l(c.Item, { active: e.active, onClick: () => f(e.id), children: [
23
22
  e.iconComponent ? e.iconComponent : /* @__PURE__ */ n(a, { src: e.icon }),
24
- /* @__PURE__ */ n(m, { basic: !0, children: f(e.label) })
23
+ /* @__PURE__ */ n(m, { basic: !0, children: s(e.label) })
25
24
  ] }, e.label))
26
25
  ] }) });
27
26
  };
28
27
  export {
29
- g as default
28
+ b as default
30
29
  };
@@ -1,40 +1,39 @@
1
1
  import { jsxs as f, jsx as t } from "react/jsx-runtime";
2
2
  import { Menu as g, Image as x, Container as b } from "semantic-ui-react";
3
3
  import { InView as M } from "react-intersection-observer";
4
- import T, { useEffect as N, useState as S, useCallback as I } from "react";
4
+ import T, { useEffect as N, useState as I, useCallback as S } from "react";
5
5
  import { PageProvider as w, PageConsumer as k, MediaProvider as _, MediaConsumer as p, PostContent as y } from "@devgateway/wp-react-lib";
6
6
  import { injectIntl as H } from "react-intl";
7
7
  import { connect as L } from "react-redux";
8
8
  import { setPageModuleProps as $ } from "../reducers/data.js";
9
9
  import j from "./FloatingNavigator.js";
10
+ import { decode as E } from "html-entities";
10
11
  const P = function(e) {
11
- return e ? e.toString().replace(/&#(\d+);/g, function(n, r) {
12
- return String.fromCharCode(r);
13
- }) : "";
14
- }, E = ({ title: e, subtitle: n, icon: r, media: o }) => /* @__PURE__ */ f(g, { className: "header title", text: !0, children: [
12
+ return e ? E(e.toString()) : "";
13
+ }, O = ({ title: e, subtitle: o, icon: r, media: n }) => /* @__PURE__ */ f(g, { className: "header title", text: !0, children: [
15
14
  /* @__PURE__ */ t(g.Item, { children: /* @__PURE__ */ t(
16
15
  x,
17
16
  {
18
- src: o && o.guid ? o.guid.rendered : r,
19
- alt: o && o.alt_text ? o.alt_text : ""
17
+ src: n && n.guid ? n.guid.rendered : r,
18
+ alt: n && n.alt_text ? n.alt_text : ""
20
19
  }
21
20
  ) }),
22
21
  /* @__PURE__ */ t(g.Header, { children: /* @__PURE__ */ t("div", { children: /* @__PURE__ */ f("h2", { className: "page-module-title", children: [
23
22
  e,
24
- /* @__PURE__ */ t("span", { style: { display: "block" }, className: "page-module-subtitle", children: n })
23
+ /* @__PURE__ */ t("span", { style: { display: "block" }, className: "page-module-subtitle", children: o })
25
24
  ] }) }) })
26
- ] }), O = (e) => {
27
- var n;
28
- return /* @__PURE__ */ t("img", { src: (n = e.media) != null && n.guid ? e.media.guid.rendered : null, alt: "" });
29
- }, R = ({ page: e, locale: n }) => {
25
+ ] }), R = (e) => {
26
+ var o;
27
+ return /* @__PURE__ */ t("img", { src: (o = e.media) != null && o.guid ? e.media.guid.rendered : null, alt: "" });
28
+ }, q = ({ page: e, locale: o }) => {
30
29
  var r;
31
30
  return /* @__PURE__ */ f(b, { fluid: !0, className: `section ${e.slug}`, id: e.id, children: [
32
31
  /* @__PURE__ */ t("div", { id: `${e.slug}` }),
33
- /* @__PURE__ */ t(_, { id: (r = e.meta_fields) != null && r.icon ? e.meta_fields.icon[0] : null, children: /* @__PURE__ */ t(p, { children: /* @__PURE__ */ t(E, { title: P(e.title.rendered), subtitle: P(e.meta_fields.subtitle) }) }) }),
32
+ /* @__PURE__ */ t(_, { id: (r = e.meta_fields) != null && r.icon ? e.meta_fields.icon[0] : null, children: /* @__PURE__ */ t(p, { children: /* @__PURE__ */ t(O, { title: P(e.title.rendered), subtitle: P(e.meta_fields.subtitle) }) }) }),
34
33
  e && /* @__PURE__ */ t(y, { as: b, fluid: !0, post: e })
35
34
  ] });
36
- }, q = ({ pages: e, locale: n, editing: r, navTitle: o, toTopLabel: l }) => {
37
- const [s, d] = S([]), c = I((i, {
35
+ }, D = ({ pages: e, locale: o, editing: r, navTitle: n, toTopLabel: l }) => {
36
+ const [c, d] = I([]), s = S((i, {
38
37
  direction: a = "down",
39
38
  onScreen: h
40
39
  }) => {
@@ -42,87 +41,87 @@ const P = function(e) {
42
41
  }, []), m = e ? e.sort((i, a) => i.menu_order - a.menu_order) : [], v = m.map((i) => {
43
42
  var a;
44
43
  return {
45
- active: s.includes(i.id),
44
+ active: c.includes(i.id),
46
45
  id: i.id,
47
- label: i.meta_fields.label ? i.meta_fields.label : i.title.rendered,
48
- iconComponent: /* @__PURE__ */ t(_, { id: (a = i.meta_fields) != null && a.icon ? i.meta_fields.icon[0] : null, children: /* @__PURE__ */ t(p, { children: /* @__PURE__ */ t(O, {}) }) })
46
+ label: P(i.meta_fields.label ? i.meta_fields.label : i.title.rendered),
47
+ iconComponent: /* @__PURE__ */ t(_, { id: (a = i.meta_fields) != null && a.icon ? i.meta_fields.icon[0] : null, children: /* @__PURE__ */ t(p, { children: /* @__PURE__ */ t(R, {}) }) })
49
48
  };
50
49
  });
51
50
  return /* @__PURE__ */ f(T.Fragment, { children: [
52
- !r && /* @__PURE__ */ t(j, { navTitle: o, toTopLabel: l, sections: v }),
51
+ !r && /* @__PURE__ */ t(j, { navTitle: n, toTopLabel: l, sections: v }),
53
52
  /* @__PURE__ */ t("div", { className: "pages", children: m.map((i) => /* @__PURE__ */ t(
54
53
  M,
55
54
  {
56
55
  as: "div",
57
- onChange: (a, h) => c(i.id, {
56
+ onChange: (a, h) => s(i.id, {
58
57
  onScreen: a,
59
58
  direction: h.boundingClientRect.top < 0 ? "up" : "down"
60
59
  }),
61
60
  children: /* @__PURE__ */ t(
62
- R,
61
+ q,
63
62
  {
64
- locale: n,
63
+ locale: o,
65
64
  page: i,
66
- onVisibilityUpdate: c
65
+ onVisibilityUpdate: s
67
66
  }
68
67
  )
69
68
  },
70
69
  i.id
71
70
  )) })
72
71
  ] });
73
- }, D = (e) => {
72
+ }, V = (e) => {
74
73
  const {
75
- navTitle: n,
74
+ navTitle: o,
76
75
  toTopLabel: r,
77
- editing: o,
76
+ editing: n,
78
77
  parent: l,
79
- unique: s,
78
+ unique: c,
80
79
  locale: d,
81
- onLoadPageModule: c
80
+ onLoadPageModule: s
82
81
  } = e;
83
82
  return N(() => {
84
- c({ data: e });
83
+ s({ data: e });
85
84
  }, [e]), /* @__PURE__ */ t(b, { className: "viz dashboard green", fluid: !0, children: e.parent && /* @__PURE__ */ t(
86
85
  w,
87
86
  {
88
87
  locale: d,
89
88
  parent: e.parent,
90
- store: `modules_${l}_${s}`,
89
+ store: `modules_${l}_${c}`,
91
90
  perPage: 100,
92
91
  children: /* @__PURE__ */ t(k, { children: /* @__PURE__ */ t(
93
- q,
92
+ D,
94
93
  {
95
94
  toTopLabel: r,
96
- navTitle: n,
97
- editing: o === "true",
95
+ navTitle: o,
96
+ editing: n === "true",
98
97
  locale: d
99
98
  }
100
99
  ) })
101
100
  }
102
101
  ) });
103
- }, V = (e, n) => {
102
+ }, z = (e, o) => {
104
103
  let {
105
104
  "data-nav-label": r = "Sections",
106
- "data-to-top-label": o = "TO THE TOP",
105
+ "data-to-top-label": n = "TO THE TOP",
107
106
  "data-preview-mode": l = "Desktop",
108
- editing: s,
107
+ editing: c,
109
108
  parent: d,
110
- unique: c,
109
+ unique: s,
111
110
  intl: { locale: m }
112
- } = n;
111
+ } = o;
113
112
  return l === "undefined" && (l = "Desktop"), {
114
113
  navTitle: r,
115
- toTopLabel: o,
114
+ toTopLabel: n,
116
115
  previewMode: l,
117
- editing: s,
116
+ editing: c,
118
117
  parent: d,
119
- unique: c,
118
+ unique: s,
120
119
  locale: m
121
120
  };
122
- }, z = {
121
+ }, A = {
123
122
  onLoadPageModule: $
124
- }, X = L(V, z)(H(D));
123
+ }, Z = L(z, A)(H(V));
125
124
  export {
126
- E as SectionHeader,
127
- X as default
125
+ O as SectionHeader,
126
+ Z as default
128
127
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devgateway/dvz-ui-react",
3
- "version": "1.9.0",
3
+ "version": "1.9.1",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/esm/index.js",
6
6
  "types": "dist/types/index.d.ts",