PageSourceSearch

https://resourcewatch.org/_next/static/chunks/pages/data/explore/[[...dataset]]-67dcc5f9ec387dcc.js

js resourcewatch.org collected 2026-09-24 08:54:29 UTC 118,276 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9567],{48615:function(e){e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(r,a,function(t){return e[t]}.bind(null,a));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var o=n(1),s=n(7),i=s.get,c=(s.deepValue,s.isArray),l=function(){function e(t,n){var r=n.location,a=void 0===r?0:r,o=n.distance,s=void 0===o?100:o,c=n.threshold,l=void 0===c?.6:c,u=n.maxPatternLength,d=void 0===u?32:u,f=n.caseSensitive,p=void 0!==f&&f,h=n.tokenSeparator,b=void 0===h?/ +/g:h,v=n.findAllMatches,g=void 0!==v&&v,m=n.minMatchCharLength,y=void 0===m?1:m,j=n.id,x=void 0===j?null:j,O=n.keys,w=void 0===O?[]:O,S=n.shouldSort,k=void 0===S||S,P=n.getFn,N=void 0===P?i:P,C=n.sortFn,A=void 0===C?function(e,t){return e.score-t.score}:C,D=n.tokenize,E=void 0!==D&&D,Z=n.matchAllTokens,T=void 0!==Z&&Z,L=n.includeMatches,_=void 0!==L&&L,R=n.includeScore,I=void 0!==R&&R,M=n.verbose,F=void 0!==M&&M;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.options={location:a,distance:s,threshold:l,maxPatternLength:d,isCaseSensitive:p,tokenSeparator:b,findAllMatches:g,minMatchCharLength:y,id:x,keys:w,includeMatches:_,includeScore:I,shouldSort:k,getFn:N,sortFn:A,verbose:F,tokenize:E,matchAllTokens:T},this.setCollection(t),this._processKeys(w)}var t,n,s;return t=e,(n=[{key:"setCollection",value:function(e){return this.list=e,e}},{key:"_processKeys",value:function(e){if(this._keyWeights={},this._keyNames=[],e.length&&"string"==typeof e[0])for(var t=0,n=e.length;t<n;t+=1){var r=e[t];this._keyWeights[r]=1,this._keyNames.push(r)}else{for(var a=null,o=null,s=0,i=0,c=e.length;i<c;i+=1){var l=e[i];if(!l.hasOwnProperty("name"))throw new Error('Missing "name" property in key object');var u=l.name;if(this._keyNames.push(u),!l.hasOwnProperty("weight"))throw new Error('Missing "weight" property in key object');var d=l.weight;if(d<0||d>1)throw new Error('"weight" property in key must bein the range of [0, 1)');o=null==o?d:Math.max(o,d),a=null==a?d:Math.min(a,d),this._keyWeights[u]=d,s+=d}if(s>1)throw new Error("Total of weights cannot exceed 1")}}},{key:"search",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{limit:!1};this._log('---------\nSearch pattern: "'.concat(e,'"'));var n=this._prepareSearchers(e),r=n.tokenSearchers,a=n.fullSearcher,o=this._search(r,a);return this._computeScore(o),this.options.shouldSort&&this._sort(o),t.limit&&"number"==typeof t.limit&&(o=o.slice(0,t.limit)),this._format(
1o)}},{key:"_prepareSearchers",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=[];if(this.options.tokenize)for(var n=e.split(this.options.tokenSeparator),r=0,a=n.length;r<a;r+=1)t.push(new o(n[r],this.options));return{tokenSearchers:t,fullSearcher:new o(e,this.options)}}},{key:"_search",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=this.list,r={},a=[];if("string"==typeof n[0]){for(var o=0,s=n.length;o<s;o+=1)this._analyze({key:"",value:n[o],record:o,index:o},{resultMap:r,results:a,tokenSearchers:e,fullSearcher:t});return a}for(var i=0,c=n.length;i<c;i+=1)for(var l=n[i],u=0,d=this._keyNames.length;u<d;u+=1){var f=this._keyNames[u];this._analyze({key:f,value:this.options.getFn(l,f),record:l,index:i},{resultMap:r,results:a,tokenSearchers:e,fullSearcher:t})}return a}},{key:"_analyze",value:function(e,t){var n=this,r=e.key,a=e.arrayIndex,o=void 0===a?-1:a,s=e.value,i=e.record,l=e.index,u=t.tokenSearchers,d=void 0===u?[]:u,f=t.fullSearcher,p=t.resultMap,h=void 0===p?{}:p,b=t.results,v=void 0===b?[]:b;!function e(t,a,o,s){if(null!=a)if("string"==typeof a){var i=!1,l=-1,u=0;n._log("\nKey: ".concat(""===r?"--":r));var p=f.search(a);if(n._log('Full text: "'.concat(a,'", score: ').concat(p.score)),n.options.tokenize){for(var b=a.split(n.options.tokenSeparator),g=b.length,m=[],y=0,j=d.length;y<j;y+=1){var x=d[y];n._log('\nPattern: "'.concat(x.pattern,'"'));for(var O=!1,w=0;w<g;w+=1){var S=b[w],k=x.search(S),P={};k.isMatch?(P[S]=k.score,i=!0,O=!0,m.push(k.score)):(P[S]=1,n.options.matchAllTokens||m.push(1)),n._log('Token: "'.concat(S,'", score: ').concat(P[S]))}O&&(u+=1)}l=m[0];for(var N=m.length,C=1;C<N;C+=1)l+=m[C];l/=N,n._log("Token score average:",l)}var A=p.score;l>-1&&(A=(A+l)/2),n._log("Score average:",A);var D=!n.options.tokenize||!n.options.matchAllTokens||u>=d.length;if(n._log("\nCheck Matches: ".concat(D)),(i||p.isMatch)&&D){var E={key:r,arrayIndex:t,value:a,score:A};n.options.includeMatches&&(E.matchedIndices=p.matchedIndices);var Z=h[s];Z?Z.output.push(E):(h[s]={item:o,output:[E]},v.push(h[s]))}}else if(c(a))for(var T=0,L=a.length;T<L;T+=1)e(T,a[T],o,s)}(o,s,i,l)}},{key:"_computeScore",value:function(e){this._log("\n\nComputing score:\n");for(var t=this._keyWeights,n=!!Object.keys(t).length,r=0,a=e.length;r<a;r+=1){for(var o=e[r],s=o.output,i=s.length,c=1,l=0;l<i;l+=1){var u=s[l],d=u.key,f=n?t[d]:1,p=0===u.score&&t&&t[d]>0?Number.EPSILON:u.score;c*=Math.pow(p,f)}o.score=c,this._log(o)}}},{key:"_sort",value:function(e){this._log("\n\nSorting...."),e.sort(this.options.sortFn)}},{key:"_format",value:function(e){var t=[];if(this.options.verbose){var n=[];this._log("\n\nOutput:\n\n",JSON.stringify(e,(function(e,t){if("object"===r(t)&&null!==t){if(-1!==n.indexOf(t))return;n.push(t)}return t}),2)),n=null}var a=[];this.options.includeMatches&&a.push((function(e,t){var n=e.output;t.matches=[];for(var r=0,a=n.length;r<a;r+=1){var o=n[r];if(0!==o.matchedIndices.length){var s={indices:o.matchedIndices,value:o.value};o.key&&(s.key=o.key),o.hasOwnProperty("arrayIndex")&&o.arrayIndex>-1&&(s.arrayIndex=o.arrayIndex),t.matches.push(s)}}})),this.options.includeScore&&a.push((function(e,t){t.score=e.score}));for(var o=0,s=e.length;o<s;o+=1){var i=e[o];if(this.options.id&&(i.item=this.options.getFn(i.item,this.options.id)[0]),a.length){for(var c={item:i.item},l=0,u=a.length;l<u;l+=1)a[l](i,c);t.push(c)}else t.push(i.item)}return t}},{key:"_log",value:function(){var e;this.options.verbose&&(e=console).log.apply(e,arguments)}}])&&a(t.prototype,n),s&&a(t,s),e}();e.exports=l},function(e,t,n){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var a=n(2),o=n(3),s=n(6),i=function(){function e(t,n){var r=n.location,a=void 0===r?0:r,o=n.distance,i=void 0===o?100:o,c=n.threshold,l=void 0===c?.6:c,u=n.maxPatternLength,d=void 0===u?32:u,f=n.isCaseSensitive,p=void 0!==f&&f,h=n.tokenSeparator,b=void 0===h?/ +/g:h,v=n.findAllMatches,g=void 0!==v&&v,m=n.minMatchCharLength,y=void 0===m?1:m,j=n.includeMatches,x=void 0!==j&&j;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.options={location:a,distance:i,threshold:l,maxPatternLength:d,isCaseSensitive:p,tokenSeparator:b,findAllMatches:g,includeMatches:x,minMatchCharLength:y},this.pattern=p?t:t.toLowerCase(),this.pattern.length<=d&&(this.patternAlphabet=s(this.pattern))}var t,n,i;return t=e,(n=[{key:"search",value:function(e){var t=this.options,n=t.isCaseSensitive,r=t.includeMatches;if(n||(e=e.toLowerCase()),this.pattern===e){var s={isMatch:!0,score:0};return r&&(s.matchedIndices=[[0,e.length-1]]),s}var i=this.options,c=i.maxPatternLength,l=i.tokenSeparator;if(this.pattern.length>c)return a(e,this.pattern,l);var u=this.options,d=u.location,f=u.distance,p=u.threshold,h=u.findAllMatches,b=u.minMatchCharLength;return o(e,this.pattern,this.patternAlphabet,{location:d,distance:f,threshold:p,findAllMatches:h,minMatchCharLength:b,includeMatches:r})}}])&&r(t.prototype,n),i&&r(t,i),e}();e.exports=i},function(e,t){var n=/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g;e.exports=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:/ +/g,a=new RegExp(t.replace(n,"\\$&").replace(r,"|")),o=e.match(a),s=!!o,i=[];if(s)for(var c=0,l=o.length;c<l;c+=1){var u=o[c];
1i.push([e.indexOf(u),u.length-1])}return{score:s?.5:1,isMatch:s,matchedIndices:i}}},function(e,t,n){var r=n(4),a=n(5);e.exports=function(e,t,n,o){for(var s=o.location,i=void 0===s?0:s,c=o.distance,l=void 0===c?100:c,u=o.threshold,d=void 0===u?.6:u,f=o.findAllMatches,p=void 0!==f&&f,h=o.minMatchCharLength,b=void 0===h?1:h,v=o.includeMatches,g=void 0!==v&&v,m=i,y=e.length,j=d,x=e.indexOf(t,m),O=t.length,w=[],S=0;S<y;S+=1)w[S]=0;if(-1!==x){var k=r(t,{errors:0,currentLocation:x,expectedLocation:m,distance:l});if(j=Math.min(k,j),-1!==(x=e.lastIndexOf(t,m+O))){var P=r(t,{errors:0,currentLocation:x,expectedLocation:m,distance:l});j=Math.min(P,j)}}x=-1;for(var N=[],C=1,A=O+y,D=1<<(O<=31?O-1:30),E=0;E<O;E+=1){for(var Z=0,T=A;Z<T;)r(t,{errors:E,currentLocation:m+T,expectedLocation:m,distance:l})<=j?Z=T:A=T,T=Math.floor((A-Z)/2+Z);A=T;var L=Math.max(1,m-T+1),_=p?y:Math.min(m+T,y)+O,R=Array(_+2);R[_+1]=(1<<E)-1;for(var I=_;I>=L;I-=1){var M=I-1,F=n[e.charAt(M)];if(F&&(w[M]=1),R[I]=(R[I+1]<<1|1)&F,0!==E&&(R[I]|=(N[I+1]|N[I])<<1|1|N[I+1]),R[I]&D&&(C=r(t,{errors:E,currentLocation:M,expectedLocation:m,distance:l}))<=j){if(j=C,(x=M)<=m)break;L=Math.max(1,2*m-x)}}if(r(t,{errors:E+1,currentLocation:m,expectedLocation:m,distance:l})>j)break;N=R}var U={isMatch:x>=0,score:0===C?.001:C};return g&&(U.matchedIndices=a(w,b)),U}},function(e,t){e.exports=function(e,t){var n=t.errors,r=void 0===n?0:n,a=t.currentLocation,o=void 0===a?0:a,s=t.expectedLocation,i=void 0===s?0:s,c=t.distance,l=void 0===c?100:c,u=r/e.length,d=Math.abs(i-o);return l?u+d/l:d?1:u}},function(e,t){e.exports=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=[],r=-1,a=-1,o=0,s=e.length;o<s;o+=1){var i=e[o];i&&-1===r?r=o:i||-1===r||((a=o-1)-r+1>=t&&n.push([r,a]),r=-1)}return e[o-1]&&o-r>=t&&n.push([r,o-1]),n}},function(e,t){e.exports=function(e){for(var t={},n=e.length,r=0;r<n;r+=1)t[e.charAt(r)]=0;for(var a=0;a<n;a+=1)t[e.charAt(a)]|=1<<n-a-1;return t}},function(e,t){var n=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===Object.prototype.toString.call(e)},r=function(e){return null==e?"":function(e){if("string"==typeof e)return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(e)},a=function(e){return"string"==typeof e},o=function(e){return"number"==typeof e};e.exports={get:function(e,t){var s=[];return function e(t,i){if(i){var c=i.indexOf("."),l=i,u=null;-1!==c&&(l=i.slice(0,c),u=i.slice(c+1));var d=t[l];if(null!=d)if(u||!a(d)&&!o(d))if(n(d))for(var f=0,p=d.length;f<p;f+=1)e(d[f],u);else u&&e(d,u);else s.push(r(d))}else s.push(t)}(e,t),s},isArray:n,isString:a,isNum:o,toString:r}}])},44174:function(e){e.exports=function(e,t,n,r){for(var a=-1,o=null==e?0:e.length;++a<o;){var s=e[a];t(r,s,n(s),e)}return r}},48983:function(e,t,n){var r=n(40371)("length");e.exports=r},44286:function(e){e.exports=function(e){return e.split("")}},81119:function(e,t,n){var r=n(89881);e.exports=function(e,t,n,a){return r(e,(function(e,r,o){t(a,e,n(e),o)})),a}},23933:function(e,t,n){var r=n(44239),a=n(37005);e.exports=function(e){return a(e)&&"[object RegExp]"==r(e)}},40180:function(e,t,n){var r=n(14259);e.exports=function(e,t,n){var a=e.length;return n=void 0===n?a:n,!t&&n>=a?e:r(e,t,n)}},55189:function(e,t,n){var r=n(44174),a=n(81119),o=n(11243),s=n(1469);e.exports=function(e,t){return function(n,i){var c=s(n)?r:a,l=t?t():{};return c(n,e,o(i,2),l)}}},62689:function(e){var t=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");e.exports=function(e){return t.test(e)}},88016:function(e,t,n){var r=n(48983),a=n(62689),o=n(21903);e.exports=function(e){return a(e)?o(e):r(e)}},83140:function(e,t,n){var r=n(44286),a=n(62689),o=n(676);e.exports=function(e){return a(e)?o(e):r(e)}},21903:function(e){var t="[\\ud800-\\udfff]",n="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",r="\\ud83c[\\udffb-\\udfff]",a="[^\\ud800-\\udfff]",o="(?:\\ud83c[\\udde6-\\uddff]){2}",s="[\\ud800-\\udbff][\\udc00-\\udfff]",i="(?:"+n+"|"+r+")"+"?",c="[\\ufe0e\\ufe0f]?",l=c+i+("(?:\\u200d(?:"+[a,o,s].join("|")+")"+c+i+")*"),u="(?:"+[a+n+"?",n,o,s,t].join("|")+")",d=RegExp(r+"(?="+r+")|"+u+l,"g");e.exports=function(e){for(var t=d.lastIndex=0;d.test(e);)++t;return t}},676:function(e){var t="[\\ud800-\\udfff]",n="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",r="\\ud83c[\\udffb-\\udfff]",a="[^\\ud800-\\udfff]",o="(?:\\ud83c[\\udde6-\\uddff]){2}",s="[\\ud800-\\udbff][\\udc00-\\udfff]",i="(?:"+n+"|"+r+")"+"?",c="[\\ufe0e\\ufe0f]?",l=c+i+("(?:\\u200d(?:"+[a,o,s].join("|")+")"+c+i+")*"),u="(?:"+[a+n+"?",n,o,s,t].join("|")+")",d=RegExp(r+"(?="+r+")|"+u+l,"g");e.exports=function(e){return e.match(d)||[]}},7739:function(e,t,n){var r=n(89465),a=n(55189),o=Object.prototype.hasOwnProperty,s=a((function(e,t,n){o.call(e,n)?e[n].push(t):r(e,n,[t])}));e.exports=s},96347:function(e,t,n){var r=n(23933),a=n(7518),o=n(31167),s=o&&o.isRegExp,i=s?a(s):r;e.exports=i},39138:function(e,t,n){var r=n(80531),a=n(40180),o=n(62689),s=n(13218),i=n(96347),c=n(88016),l=n(83140),u=n(40554),d=n(79833),f=/\w*$/;e.exports=function(e,t){var n=30,p="...";if(s(t)){var h="separator"in t?t.separator:h;n="length"in t?u(t.length):n,p="omission"in t?r(t.omission):p}var b=(e=d(e)).length;if(o(e)){var v=l(e);b=v.length}if(n>=b)return e;var g=n-c(p);if(g<1)return p;var m=v?a(v,0,g).join(""):e.slice(0,g);
1if(void 0===h)return m+p;if(v&&(g+=m.length-g),i(h)){if(e.slice(g).search(h)){var y,j=m;for(h.global||(h=RegExp(h.source,d(f.exec(h))+"g")),h.lastIndex=0;y=h.exec(j);)var x=y.index;m=m.slice(0,void 0===x?g:x)}}else if(e.indexOf(r(h),g)!=g){var O=m.lastIndexOf(h);O>-1&&(m=m.slice(0,O))}return m+p}},95817:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(85893);function a(){return(0,r.jsx)("div",{className:"c-card-placeholder"})}},12754:function(e,t,n){"use strict";var r=n(16835),a=n(4730),o=n(70131),s=["children"];t.Z=function(e){e.children;var t=(0,a.Z)(e,s),n=(0,o.YD)(t),i=(0,r.Z)(n,3),c=i[0],l=i[1],u=i[2];return"IntersectionObserver"in window?e.children({inView:l,ref:c,entry:u}):e.children({inView:!0})}},95710:function(e,t,n){"use strict";n.d(t,{Z:function(){return h}});var r=n(92777),a=n(82262),o=n(10748),s=n(45959),i=n(63553),c=n(37247),l=n(59499),u=n(67294),d=n(85893);function f(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,c.Z)(e);if(t){var a=(0,c.Z)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return(0,i.Z)(this,n)}}var p=function(e){(0,s.Z)(n,e);var t=f(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,s=new Array(a),i=0;i<a;i++)s[i]=arguments[i];return e=t.call.apply(t,[this].concat(s)),(0,l.Z)((0,o.Z)(e),"state",{error:null}),e}return(0,a.Z)(n,[{key:"componentDidCatch",value:function(e,t){console.error(e,t)}},{key:"render",value:function(){var e=this.state.error,t=this.props.message;return(0,d.jsxs)("div",{className:"c-error-boundary",children:[e&&(0,d.jsx)("div",{children:t}),!e&&this.props.children]})}}],[{key:"getDerivedStateFromError",value:function(e){return{error:e}}}]),n}(u.PureComponent);p.defaultProps={message:"There was an error"};var h=p},29209:function(e,t,n){"use strict";n.d(t,{D:function(){return c}});var r=n(59499),a=n(88767),o=n(78386);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){(0,r.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var c=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,a.useQuery)(["fetch-datasets",e],(function(){return(0,o.Qu)(e)}),i({},t))};t.Z=c},69447:function(e,t,n){"use strict";n.r(t),n.d(t,{__N_SSP:function(){return Xr},default:function(){return $r}});var r={};n.r(r),n.d(r,{fetchTags:function(){return Le},resetTags:function(){return Te},setTags:function(){return Ae},setTagsError:function(){return Ze},setTagsLoading:function(){return Ee},setTagsTooltip:function(){return De}});var a=n(59499),o=n(92777),s=n(82262),i=n(45959),c=n(63553),l=n(37247),u=n(67294),d=n(14416),f=n(11163),p=n(92296),h=n(9008),b=n.n(h),v=n(5152),g=n.n(v),m=n(49863),y=n(65230),j=n(10748),x=n(94184),O=n.n(x),w=n(77677),S=n(85893);function k(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,l.Z)(e);if(t){var a=(0,l.Z)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return(0,c.Z)(this,n)}}var P=function(e){(0,i.Z)(n,e);var t=k(n);function n(){var e;(0,o.Z)(this,n);for(var r=arguments.length,s=new Array(r),i=0;i<r;i++)s[i]=arguments[i];return e=t.call.apply(t,[this].concat(s)),(0,a.Z)((0,j.Z)(e),"triggerToggle",(function(){var t=e.props.open;e.props.setSidebarOpen(!t)})),e}return(0,s.Z)(n,[{key:"render",value:function(){var e=this.props.open;return(0,S.jsxs)("aside",{className:O()({"c-sidebar":!0,"-open":e}),children:[(0,S.jsx)("button",{type:"button",className:"btn-toggle",onClick:this.triggerToggle,children:(0,S.jsx)(w.Z,{className:O()({"-little":!0,"-left":e,"-right":!e}),name:"icon-arrow-down"})}),(0,S.jsx)("div",{className:"sidebar-content explore-sidebar",children:this.props.children})]})}}]),n}(u.Component),N=P;function C(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var A=(0,d.connect)((function(e){return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};
1t%2?C(Object(n),!0).forEach((function(t){(0,a.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):C(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},e.explore.sidebar)}),p)(N),D=n(85564),E=n.n(D),Z=n(7739),T=n.n(Z),L=n(57557),_=n.n(L),R=n(48615),I=n.n(R);function M(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,l.Z)(e);if(t){var a=(0,l.Z)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return(0,c.Z)(this,n)}}var F=function(e){(0,i.Z)(n,e);var t=M(n);function n(e){var r;(0,o.Z)(this,n),r=t.call(this,e),(0,a.Z)((0,j.Z)(r),"state",{index:0,value:"",filteredList:[],groupedFilteredList:{}}),(0,a.Z)((0,j.Z)(r),"onScreenClick",(function(e){var t=document.querySelector(".c-dataset-search");t&&t.contains&&!t.contains(e.target)&&r.onToggleOpen(!1)})),(0,a.Z)((0,j.Z)(r),"onScreenKeyup",(function(e){switch(e.keyCode){case 27:r.onToggleOpen(!1);break;case 13:r.onKeyEnter();break;case 38:r.onKeyArrow("up");break;case 40:r.onKeyArrow("down");break;default:return!0}})),(0,a.Z)((0,j.Z)(r),"onToggleOpen",(function(e){requestAnimationFrame((function(){e?(window.addEventListener("click",r.onScreenClick),window.addEventListener("keyup",r.onScreenKeyup)):(window.removeEventListener("click",r.onScreenClick),window.removeEventListener("keyup",r.onScreenKeyup),r.setState({index:0,value:"",filteredList:[],groupedFilteredList:{}}),r.input&&r.input.blur())})),r.props.onChangeOpen(e)})),(0,a.Z)((0,j.Z)(r),"onKeyArrow",(function(e){var t=r.state,n=t.index,a=t.filteredList;"up"===e&&r.setState({index:0!==n?n-1:a.length}),"down"===e&&r.setState({index:n!==a.length?n+1:0})})),(0,a.Z)((0,j.Z)(r),"onKeyEnter",(function(){var e=r.state,t=e.value,n=e.index,a=e.groupedFilteredList;if(0!==n){var o=E()(Object.keys(a).map((function(e){return a[e]})))[n-1];r.props.onToggleSelected(o)}else r.props.onChangeTextSearch(t);r.onToggleOpen(!1)})),(0,a.Z)((0,j.Z)(r),"onListItemMouseOver",(function(e){r.setState({index:e})})),(0,a.Z)((0,j.Z)(r),"onChangeSearch",(function(e){var t=e.currentTarget.value;!r.props.open&&t.length>2&&r.onToggleOpen(!0);var n=t.length>2?r.fuse.search(t).sort((function(e,n){var r=e.label.toLowerCase().indexOf(t.toLowerCase()),a=n.label.toLowerCase().indexOf(t.toLowerCase()),o=e.label.toLowerCase()===t.toLowerCase(),s=n.label.toLowerCase()===t.toLowerCase();return o?-1:s?1:r>a})):[],a=_()(T()(n,(function(e){return e.labels&&e.labels[1]||"undefined"})),["undefined","GEOGRAPHY"]);r.setState({index:Object.keys(a).length>0?1:0,value:t,filteredList:n,groupedFilteredList:a})}));var s=e.list;return r.fuse=new(I())(s,{keys:[{name:"label",weight:.6},{name:"synonyms",weight:.3},{name:"id",weight:.1}],threshold:.2,minMatchCharLength:2}),r}return(0,s.Z)(n,[{key:"render",value:function(){var e=this,t=this.props.open,n=this.state,r=n.index,a=n.value,o=n.groupedFilteredList,s=0;return(0,S.jsxs)("div",{className:"c-dataset-search",children:[(0,S.jsxs)("div",{className:"search-container",children:[(0,S.jsx)("button",{className:O()({"search-icon":!0,"-search":!0}),children:(0,S.jsx)(w.Z,{name:"icon-search",className:"-small"})}),(0,S.jsx)("input",{ref:function(t){e.input=t},className:O()({"search-input":!0,"-open":t}),type:"search",placeholder:"Search datasets",value:a,onChange:this.onChangeSearch})]}),t&&a&&(0,S.jsx)("div",{className:"search-dropdown",children:(0,S.jsxs)("div",{className:"search-dropdown-list",children:[Object.keys(o).map((function(t){return(0,S.jsxs)("div",{className:"search-dropdown-list-item",children:[!!t&&t.toLowerCase&&(0,S.jsxs)("h4",{children:["Filter by",t.toLowerCase(),":"]}),(0,S.jsx)("ul",{className:"list-item-results",children:o[t].map((function(t){var n=++s;return(0,S.jsx)("li",{children:(0,S.jsx)("button",{type:"button",className:O()({"-active":r===n}),onClick:function(){e.props.onToggleSelected(t),e.onToggleOpen(!1)},onMouseOver:function(){return e.onListItemMouseOver(n)},children:t.label})},t.id)}))})]},t)})),(0,S.jsxs)("div",{className:"search-dropdown-list-item",children:[(0,S.jsx)("h4",{children:"Search by text:"}),(0,S.jsx)("ul",{className:"list-item-results",children:(0,S.jsx)("li",{children:(0,S.jsx)("button",{type:"button",className:O()({"-active":0===r}),onClick:function(){e.props.onChangeTextSearch(a),e.onToggleOpen(!1)},onMouseOver:function(){return e.onListItemMouseOver(0)},children:a})})})]})]})})]})}}]),n}(u.Component),U=F,V=n(16210),z=n(43533),q=function(e){var t=e.token,n=e.open,r=e.options,a=e.tab,o=e.tags,s=e.search,i=e.selected,c=e.section,l=e.selectedCollection,d=e.setSidebarSection,f=e.setSidebarSelectedCollection,p=e.setFiltersOpen,h=e.setFiltersTab,b=e.userIsLoggedIn,v=e.selectedDataset,g=e.setDatasetsPage,m=e.fetchDatasets,y=e.resetFiltersSort,j=e.setSortSelected,x=e.setSortDirection,k=e.sortSelected,P=e.shouldAutoUpdateSortDirection,N=e.setFiltersSearch,C=e.toggleFiltersSelected,A=e.setFiltersSelected,D=(0,V.Z)(t,{sort:"name"},{initialData:[],initialStale:!0,enabled:!!t}).data,E=(0,u.useCallback)((function(){g(1),m()}),[g,m]),Z=(0,u.useCallback)((function(e){e||"relevance"!==k||y(),N(e),e&&P&&(j("relevance"),x(-1)),d(z.of.ALL_DATA),E()}),[y,N,j,x,d,E,P,k]),T=(0,u.useCallback)((function(e){c!==z.of.ALL_DATA&&d(z.of.ALL_DATA),C({tag:e,tab:"topics"}),E()}),[c,d,C,E]),L=(0,u.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];A({key:a,list:e}),E()}),[A,a,E]),_=(0,u.useMemo)((function(){return D.filter((function(e){return e.resources.find((function(e){return"dataset"===e.type}))}))}),[D]);
1return(0,S.jsxs)("div",{className:O()({"c-explore-menu":!0,"-hidden":v}),children:[(0,S.jsx)(U,{open:n,tab:a,list:o,search:s,options:r,selected:i,onChangeOpen:p,onChangeTab:h,onChangeTextSearch:Z,onToggleSelected:T,onChangeSelected:L}),(0,S.jsxs)("div",{className:"menu-options",children:[(0,S.jsxs)("div",{className:O()({"menu-option":!0,"-active":c===z.of.DISCOVER}),role:"button",tabIndex:0,onKeyPress:function(){d(z.of.DISCOVER)},onClick:function(){d(z.of.DISCOVER)},children:[(0,S.jsx)(w.Z,{name:"icon-discover-".concat(c===z.of.DISCOVER?"on":"off")}),"Discover"]}),(0,S.jsxs)("div",{className:O()({"menu-option":!0,"-active":c===z.of.ALL_DATA}),role:"button",tabIndex:0,onKeyPress:function(){d(z.of.ALL_DATA)},onClick:function(){d(z.of.ALL_DATA)},children:[(0,S.jsx)(w.Z,{name:"icon-all-".concat(c===z.of.ALL_DATA?"on":"off")}),"All Data"]}),(0,S.jsxs)("div",{className:O()({"menu-option":!0,"-active":c===z.of.NEAR_REAL_TIME}),role:"button",tabIndex:0,onKeyPress:function(){d(z.of.NEAR_REAL_TIME)},onClick:function(){d(z.of.NEAR_REAL_TIME)},children:[(0,S.jsx)(w.Z,{name:"icon-recent-".concat(c===z.of.NEAR_REAL_TIME?"on":"off")}),"Near Real-Time"]}),(0,S.jsxs)("div",{className:O()({"menu-option":!0,"-active":c===z.of.TOPICS}),role:"button",tabIndex:0,onKeyPress:function(){d(z.of.TOPICS)},onClick:function(){d(z.of.TOPICS)},children:[(0,S.jsx)(w.Z,{name:"icon-topics-".concat(c===z.of.TOPICS?"on":"off")}),"Topics"]}),(0,S.jsxs)("div",{className:O()({"menu-option":!0,"-active":c===z.of.AREAS_OF_INTEREST}),role:"button",tabIndex:0,onKeyPress:function(){d(z.of.AREAS_OF_INTEREST)},onClick:function(){d(z.of.AREAS_OF_INTEREST)},children:[(0,S.jsx)(w.Z,{name:"icon-aoi-".concat(c===z.of.AREAS_OF_INTEREST?"on":"off")}),"Areas of Interest"]}),(0,S.jsx)("hr",{}),(0,S.jsx)("div",{className:O()({"menu-option":!0,"-active":c===z.of.MY_DATA}),role:"button",tabIndex:0,"data-cy":"my-data-tab",onKeyPress:function(){d(z.of.MY_DATA)},onClick:function(){d(z.of.MY_DATA)},children:(0,S.jsx)("span",{className:"section-name",children:"My Data"})}),(0,S.jsx)("div",{className:O()({"menu-option":!0,"-active":c===z.of.FAVORITES}),role:"button",tabIndex:0,onKeyPress:function(){d(z.of.FAVORITES)},onClick:function(){d(z.of.FAVORITES)},children:(0,S.jsx)("span",{className:"collection-name",children:"My Favorites"})}),b&&_.map((function(e){return(0,S.jsx)("div",{className:O()({"menu-option":!0,collection:!0,"-active":c===z.of.COLLECTIONS&&l===e.id}),role:"button",tabIndex:0,onKeyPress:function(){d(z.of.COLLECTIONS),f(e.id)},onClick:function(){d(z.of.COLLECTIONS),f(e.id)},children:(0,S.jsx)("span",{className:"collection-name",children:e.name})},e.id)}))]})]})};q.defaultProps={token:null,selectedCollection:null,selectedDataset:null};var G=q;function K(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function W(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?K(Object(n),!0).forEach((function(t){(0,a.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):K(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var B=(0,d.connect)((function(e){return W(W({},e.explore.filters),{},{shouldAutoUpdateSortDirection:e.explore.sort.isSetFromDefaultState,sortSelected:e.explore.sort.selected,section:e.explore.sidebar.section,selectedCollection:e.explore.sidebar.selectedCollection,userIsLoggedIn:!!e.user.id,selectedDataset:e.explore.datasets.selected,token:e.user.token})}),p)(G),Y=n(42279),Q=n(91851);function H(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function J(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?H(Object(n),!0).forEach((function(t){(0,a.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):H(Object(n)).forEac
1h((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var X=(0,Y.P1)([function(e){return e.explore.datasets.list}],(function(e){return e.map((function(e){return J(J({},e),{},{dateLastUpdated:(0,Q.f2)(e.dataLastUpdated)})}))})),$=(0,Y.P1)([function(e){return e.explore.filters.tags},function(e){return e.explore.filters.selected.topics}],(function(e,t){return t.map((function(t){return{id:t,label:e.find((function(e){return e.id===t})).label}}))})),ee=n(41664),te=n.n(ee),ne=n(60672),re=[{id:"food_and_agriculture",label:"Food and Agriculture",backgroundURL:"/static/images/components/layout/explore/topics/topics-food.jpg",backgroundColor:"rgba(181,122,0,0.7)",slug:"food"},{id:"energy",label:"Energy",backgroundURL:"/static/images/components/layout/explore/topics/topics-energy.jpg",backgroundColor:"rgba(44,117,176,0.7)",slug:"slug"},{id:"climate",label:"Climate",backgroundURL:"/static/images/components/layout/explore/topics/topics-climate.png",backgroundColor:"rgba(179,21,0,0.7)",slug:"climate"},{id:"forest",label:"Forests",backgroundURL:"/static/images/components/layout/explore/topics/topics-forests.jpg",backgroundColor:"rgba(101,182,13,0.7)",slug:"forests"},{id:"water",label:"Water",backgroundURL:"/static/images/components/layout/explore/topics/topics-water.jpg",backgroundColor:"rgba(59,178,208,0.7)",slug:"water"},{id:"society",label:"Society",backgroundURL:"/static/images/components/layout/explore/topics/topics-society.jpg",backgroundColor:"rgba(195,45,123,0.7)",slug:"society"},{id:"ocean",label:"Ocean",backgroundURL:"/static/images/components/layout/explore/topics/topics-oceans.jpg",backgroundColor:"rgba(44,117,176,0.7)",slug:"ocean-watch"},{id:"urban",label:"Cities",backgroundURL:"/static/images/components/layout/explore/topics/topics-cities.jpg",backgroundColor:"rgba(5,181,120,0.7)",slug:"cities"},{id:"coral_reef",label:"Coral Reefs",backgroundURL:"/static/images/components/layout/explore/topics/topics-corals.jpg",backgroundColor:"rgba(250,136,102,0.7)",slug:"coral-reefs"},{id:"air_quality",label:"Air Quality",backgroundURL:"/static/images/components/layout/explore/topics/topics-air.jpg",backgroundColor:"rgba(89,127,165,0.7)",slug:"air-quality"}],ae=n(58350),oe=n(42493),se=n(80769);function ie(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,l.Z)(e);if(t){var a=(0,l.Z)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return(0,c.Z)(this,n)}}var ce=function(e){(0,i.Z)(n,e);var t=ie(n);function n(){var e;(0,o.Z)(this,n);for(var r=arguments.length,s=new Array(r),i=0;i<r;i++)s[i]=arguments[i];return e=t.call.apply(t,[this].concat(s)),(0,a.Z)((0,j.Z)(e),"onSortSelected",(function(t){var n=e.props,r=n.setSortSelected,a=n.setSortDirection,o=n.setSortIsUserSelected,s=n.fetchDatasets;r(t),"relevance"===t&&a(-1),o(),s()})),(0,a.Z)((0,j.Z)(e),"onSortDirection",(function(){var t=e.props,n=t.direction,r=t.canChangeSortDirection,a=t.setSortDirection,o=t.setSortIsUserSelected,s=t.fetchDatasets;r&&(a(-n),o(),s())})),e}return(0,s.Z)(n,[{key:"render",value:function(){var e=this.props,t=e.selected,n=e.direction,r=e.options,a=e.canChangeSortDirection;return(0,S.jsxs)("div",{className:"c-explore-datasets-sort",children:[(0,S.jsx)(ae.Tooltip,{overlay:(0,S.jsx)(se.Z,{name:"sort",properties:{default:t},options:r,onChange:this.onSortSelected}),overlayClassName:"c-rc-tooltip -default",placement:"top",trigger:["click"],mouseLeaveDelay:0,getTooltipContainer:oe.m,destroyTooltipOnHide:!0,children:(0,S.jsx)("button",{className:"actions-sort-button",children:(0,S.jsx)("span",{children:"SORT BY ".concat(r.find((function(e){return e.value===t})).label.toUpperCase())})})}),(0,S.jsxs)("button",{className:O()({"actions-sort-button":!0,isInteractive:a}),onClick:this.onSortDirection,children:[n<0&&(0,S.jsx)(w.Z,{className:"-small",name:"icon-arrow-down"}),n>0&&(0,S.jsx)(w.Z,{className:"-small",name:"icon-arrow-up"})]})]})}}]),n}(u.PureComponent),le=ce;function ue(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function de(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};
1t%2?ue(Object(n),!0).forEach((function(t){(0,a.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ue(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var fe=(0,d.connect)((function(e){return de(de({},e.explore.sort),{},{canChangeSortDirection:"relevance"!==e.explore.sort.selected,options:e.explore.sort.options.filter((function(t){return"relevance"!==t.value||e.explore.filters.search.length>0}))})}),p)(le),pe=n(52202),he=n(45392),be=n(40537),ve=n(31570),ge=n(39246);function me(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ye(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?me(Object(n),!0).forEach((function(t){(0,a.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):me(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function je(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,l.Z)(e);if(t){var a=(0,l.Z)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return(0,c.Z)(this,n)}}var xe=function(e){(0,i.Z)(n,e);var t=je(n);function n(){var e;(0,o.Z)(this,n);for(var r=arguments.length,s=new Array(r),i=0;i<r;i++)s[i]=arguments[i];return e=t.call.apply(t,[this].concat(s)),(0,a.Z)((0,j.Z)(e),"renderChart",(function(){var t=e.props,n=t.dataset,r=t.widget,a=t.layer,o=t.expandedChart,s=r&&"map"===r.widgetConfig.type,i=r&&"embed"===r.widgetConfig.type,c=O()({"list-item-chart":!0,"-expanded-chart":o});return!r||s||i?a||s?(0,S.jsx)(te(),{href:"/data/explore/".concat(n.slug),passHref:!0,children:(0,S.jsx)("div",{className:c,children:(0,S.jsx)(be.Z,{layer:a})})}):(0,S.jsx)("div",{className:c,children:(0,S.jsx)(te(),{href:"/data/explore/".concat(n.slug),children:(0,S.jsx)("a",{children:(0,S.jsx)(ve.Z,{})})})}):(0,S.jsx)(te(),{href:"/data/explore/".concat(n.slug),passHref:!0,children:(0,S.jsx)("div",{className:c,children:(0,S.jsx)(he.Z,{widget:r,thumbnail:!0})})})})),(0,a.Z)((0,j.Z)(e),"handleClick",(function(){var t=e.props,n=t.dataset,r=t.toggleMapLayerGroup,a=t.resetMapLayerGroupsInteraction,o=t.setMapLayerGroupActive,s=t.layer;t.router.push("/data/explore/".concat(n.slug)),!e.props.active&&s&&(r({dataset:n,toggle:!0}),o({dataset:{id:n.id},active:s.id}),a())})),e}return(0,s.Z)(n,[{key:"render",value:function(){var e,t=this.props,n=t.dataset,r=t.metadata,a=t.actions,o=t.active,s=t.filters,i=t.sort,c=t.sidebar,l=(0,Q.f2)(n.dataLastUpdated,!0),d=O()({"c-explore-dataset-list-item":!0,"-active":o});return(0,S.jsxs)("div",{className:d,children:[(0,S.jsx)(ge.pU,{greaterThanOrEqual:"md",children:this.renderChart()}),(0,S.jsx)(ge.pU,{at:"sm",children:(0,S.jsx)(te(),{href:"/data/explore/".concat(n.slug),children:this.renderChart()})}),(0,S.jsxs)("div",{className:"info",children:[(0,S.jsxs)("div",{className:"source-date",children:[(0,S.jsx)("div",{className:"source",title:r&&r.source,children:r&&r.source}),(0,S.jsx)("div",{className:"date",children:l})]}),(0,S.jsxs)("div",{className:"title-actions",children:[(0,S.jsx)("h4",{children:(0,S.jsx)(te(),{href:{pathname:"/data/explore/".concat(n.slug),query:ye(ye(ye(ye(ye({},s.search&&{search:s.search}),(null===(e=s.selected.topics)||void 0===e?void 0:e.length)&&{topics:encodeURIComponent(JSON.stringify(s.selected.topics))}),i.selected&&{sort:i.selected}),i.direction&&{sortDirection:i.direction}),c.section&&{section:c.section})},children:(0,S.jsx)("a",{className:"line-clamp-2",children:r&&r.info&&r.info.name||n.name})})}),a&&(0,S.jsx)(ge.pU,{greaterThanOrEqual:"md",children:u.cloneElement(a,ye({},this.props))})]})]})]})}}]),n}(u.Component);xe.defaultProps={layer:null,widget:null,expandedChart:!1};var Oe,we=(0,f.withRouter)(xe),Se=n(89734),ke=n.n(Se),Pe=n(17638),Ne=n(1641),Ce=void 0,Ae=(0,Pe.createAction)("DATASET_LIST_ITEM/setTags"),De=(0,Pe.createAction)("DATASET_LIST_ITEM/setTagsTooltip"),Ee=(0,Pe.createAction)("DATASET_LIST_ITEM/setTagsLoading"),Ze=(0,Pe.createAction)("DATASET_LIST_ITEM/setTagsError"),Te=(0,Pe.createAction)("DATASET_LIST_ITEM/resetTags"),Le=(0,Pe.createThunkAction)("DATASET_LIST_ITEM/fetchTags",(function(){return function(e){return e(Ee(!0)),fetch("".concat("https://api.resourcewatch.org","/v1/dataset/").concat(Ce.datasetId,"?application=").concat("rw","&language=").concat(Ce.opts.language,'&includes="metadata"&page[size]=999')).then((function(e){if(e.status>=400)throw Error(e.statusText);return e.json()})).then((function(t){var n=t.data;e(Ae(ke()(n.filter((function(e){return!Ne.o.includes(e.id)}
1)),(function(e){return e.label})))),e(Ee(!1))})).catch((function(t){e(Ee(!1)),e(Ze({payload:t.message}))}))}})),_e={tooltip:!1,tags:[],loading:!1,error:null};function Re(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ie(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Re(Object(n),!0).forEach((function(t){(0,a.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Re(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}Oe={},(0,a.Z)(Oe,De,(function(e,t){var n=t.payload;return Ie(Ie({},e),{},{tooltip:n})})),(0,a.Z)(Oe,Ae,(function(e,t){var n=t.payload;return Ie(Ie({},e),{},{tags:n})})),(0,a.Z)(Oe,Ee,(function(e,t){var n=t.payload;return Ie(Ie({},e),{},{loading:n,error:null})})),(0,a.Z)(Oe,Ze,(function(e,t){var n=t.payload;return Ie(Ie({},e),{},{loading:!1,error:n})})),(0,a.Z)(Oe,Te,(function(){return _e}));var Me=(0,Y.P1)([function(e){return e.explore.map.layerGroups},function(e,t){return t.dataset.id}],(function(e,t){return!!e.find((function(e){return e.dataset===t}))}));function Fe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ue(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Fe(Object(n),!0).forEach((function(t){(0,a.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fe(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Ve=(0,d.connect)((function(e,t){return{user:e.user,active:Me(e,t),filters:e.explore.filters,sort:e.explore.sort,sidebar:e.explore.sidebar}}),Ue(Ue({},r),{},{toggleMapLayerGroup:p.toggleMapLayerGroup,resetMapLayerGroupsInteraction:p.resetMapLayerGroupsInteraction,setMapLayerGroupActive:p.setMapLayerGroupActive}))(we);function ze(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,l.Z)(e);if(t){var a=(0,l.Z)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return(0,c.Z)(this,n)}}var qe=function(e){(0,i.Z)(n,e);var t=ze(n);function n(){return(0,o.Z)(this,n),t.apply(this,arguments)}return(0,s.Z)(n,[{key:"render",value:function(){for(var e=this.props,t=e.list,n=e.actions,r=e.tags,a=e.expandedChart,o=e.numberOfPlaceholders,s=e.loading,i=[],c=0;c<o;c++)i.push(c);return(0,S.jsxs)("div",{className:"c-explore-dataset-list",children:[(0,S.jsx)(pe.Z,{isLoading:s,className:"-light"}),(0,S.jsxs)("div",{className:"l-row row",children:[!s&&t.map((function(e){return(0,S.jsx)("div",{className:"column small-12",children:(0,S.jsx)(Ve,{dataset:e,widget:e.widget?e.widget.find((function(e){return e.default})):null,layer:e.layer?e.layer.find((function(e){return e.default})):null,metadata:e.metadata&&Array.isArray(e.metadata)?e.metadata[0]:e.metadata,actions:n,tags:r,expandedChart:a})},e.id)})),s&&i.map((function(e){return(0,S.jsx)("div",{className:"column small-12",children:(0,S.jsx)("div",{className:"dataset-placeholder"})},"dataset-placeholder-".concat(e))}))]})]})}}]),n}(u.PureComponent);(0,a.Z)(qe,"defaultProps",{expandedChart:!1,tags:[],loading:!1,numberOfPlaceholders:4});var Ge=qe,Ke=n(82359),We=n(13734),Be=n(24740),Ye=n(11592),Qe=function(e){var t,n,r=e.dataset,a=e.layer,o=e.user,s=e.selectedCollection,i=e.layerGroups,c=e.toggleMapLayerGroup,l=e.resetMapLayerGroupsInteraction,d=(0,Be.Z)(r.id,o.token).isInACollection,f=(0,Ye.Z)(s,o.token,{},{enabled:!(!s||!o.token)}).refetch,p=(0,u.useMemo)((function(){return!!i.find((function(e){return e.dataset===r.i
1d}))}),[r,i]),h=(0,u.useCallback)((function(e){e.stopPropagation(),c({dataset:r,toggle:!p}),l()}),[p,r,c,l]),b=(0,u.useCallback)((function(){s&&f()}),[s,f]),v=(0,u.useCallback)((function(){s&&f()}),[s,f]),g=(o.token,null===r||void 0===r||null===(t=r.metadata[0])||void 0===t||null===(n=t.info)||void 0===n||n.name,O()({"icon-star-full":d,"icon-star-empty":!d})),m=O()({"-small":!0,"-filled":!0,"-empty":!d});return(0,S.jsxs)("div",{className:"c-explore-datasets-actions",children:[(0,S.jsx)("button",{className:O()({"c-button":!0,"-secondary":!p,"-primary":p,"-compressed":!0,"-disable":!a,"-fullwidth":!0}),type:"button",disabled:!a,onClick:h,children:p?"Active":"Add to map"}),(0,S.jsx)(Ke.Z,{children:(0,S.jsx)(ae.Tooltip,{overlay:(0,S.jsx)(We.Z,{resource:r,resourceType:"dataset",onClick:function(e){return e.stopPropagation()},onKeyPress:function(e){return e.stopPropagation()},onToggleFavorite:b,onToggleCollection:v}),overlayClassName:"c-rc-tooltip",placement:"bottomRight",trigger:"click",getTooltipContainer:oe.m,monitorWindowResize:!0,children:(0,S.jsx)("button",{type:"button",className:"c-button -secondary -compressed",tabIndex:-1,onClick:function(e){e.stopPropagation()},children:(0,S.jsx)(w.Z,{name:g,className:m})})})})]})};Qe.defaultProps={selectedCollection:null};var He=Qe;function Je(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Xe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Je(Object(n),!0).forEach((function(t){(0,a.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Je(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var $e=(0,d.connect)((function(e){return Xe(Xe({},e.explore.map),{},{user:e.user,selectedCollection:e.explore.sidebar.selectedCollection})}),p)(He);function et(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function tt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?et(Object(n),!0).forEach((function(t){(0,a.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):et(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function nt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function rt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?nt(Object(n),!0).forEach((function(t){(0,a.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var at=(0,d.connect)((function(e){return rt(rt({datasets:e.explore.datasets,list:X(e)},e.explore.filters),{},{selectedTags:$(e),loading:e.explore.datasets.loading})}),p)((function(e){var t=e.datasets,n=t.selected,r=t.list,a=t.total,o=t.limit,s=t.page,i=t.loading,c=e.selectedTags,l=e.search,d=e.setDatasetsPage,f=e.fetchDatasets,p=(0,u.useMemo)((function(){return re.filter((function(e){return c.find((function(t){return t.id===e.id}))})).map((function(e){return tt(tt({},e),"ocean-watch"===e.slug&&{label:"Ocean Watch"})}))}),[c]),h=(0,u.useCallback)((function(e){d(e),f()}),[d,f]);(0,u.useEffect)((function(){h(1)}),[h]);var b=O()({"c-explore-datasets":!0,"-hidden":n});return(0,S.jsxs)("div",{className:b,children:[(0,S.jsxs)("div",{className:"explore-datasets-header",children:[(0,S.jsxs)("div",{className:"left-container",children:[(0,S.jsx)(fe,{}),(0,S.jsxs)("div",{className:"tags-container",children:[c.length>0&&c.map((function(t){return(0,S.jsxs)("button",{className:"c-button -primary -compressed",onClick:function(){e.toggleFiltersSelected({tag:t,tab:"topics"}),h(1)},children:[(0,S.jsx)("span",{className:"button-text",title:t.label.toUpperCase(),children:t.label.toUpperCase()}),(0,S.jsx)(w.Z,{name:"icon-cross",className:"-tiny"})]},t.id)})),l&&(0,S.jsxs)("button",{className:"c-button -primary -compressed",onClick:function(){e.resetFiltersSort(),e.setFiltersSearch(""),h(1)},children:[(0,S.jsx)("span",{className:"button-text",title:"TEXT: ".concat(l.toUpperCase()),children:"TEXT: ".concat(l.toUpperCase())}),(0,S.jsx)(w.Z,{name:"icon-cross",className:"-tiny"})]},"text-filter")]})]}),(0,S.jsx)("div",{className:"number-of-datasets",children:"".concat(a," ").concat(1===a?"DATASET":"DATASETS")})]}),p.length>0&&(0,S.jsxs)("div",{className:"related-dashboards",children:[(0,S.jsxs)("div",{className:"header",children:[(0,S.jsx)("h4",{children:"Related dashboards"}),(0,S.jsx)(te(),{href:"/dashboards",children:(0,S.jsx)("a",{className:"header-button",children:"SEE ALL"})})]}),p.map((function(e){return(0,S.jsx)(te(),{href:"/dashboards/".concat(e.slug),passHref:!0,children:(0,S.jsx)("div",{className:"dashboard-button",style:{background:"linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.30)),url(".concat(e.backgroundURL,")"),"background-position":"center","background-size":"cover"},role:"button",tabIndex:0,children:(0,S.jsx)("div",{className:"dashboard-title",children:e.label})})},e.id)}))]}),!r.length&&!i&&(0,S.jsxs)("div",{className:"request-data-container",children:[(0,S.jsx)("div",{className:"request-data-text",children:"Oops! We couldn't find data for your search..."}),(0,S.jsx)("a",{className:"c-button -primary",href:"https://docs.google.com/forms/d/e/1FAIpQLSfXsPGQxM6p8KloU920t5Tfhx9FYFOq8-Rjml07UDH9EvsI1w/viewform",target:"_blank",rel:"noopener noreferrer",children:"Request data"})]}),(0,S.jsx)(Ge,{loading:i,numberOfPlaceholders:20,list:r,actions:(0,S.jsx)($e,{})}),!!r.length&&a>o&&(0,S.jsx)(ne.Z,{options:{page:s,limit:o,size:a},onChange:function(e){var t=document.querySelector(".sidebar-content");window.scrollTo&&window.scrollTo(0,0),t&&t.scrollTo&&t.scrollTo(0,0),h(e)}})]})})),ot=n(43541),st=n(16938),it=n(78386),ct=n(59882),lt=n(39138),ut=n.n(lt),dt=n(30724),ft=n.n(dt);function pt(e){var t=(0,u.useState)(!1),n=t[0],r=t[1],a=e.text,o=e.limitChar,s=e.markdown,i=e.readMoreClicked;if(a.length<=o)return(0,S.jsxs)("div",{className:"c-read-more",children:[s&&(0,S.jsx)(ft(),{linkTarget:"_blank",source:a}),!s&&(0,S.jsx)("p",{children:a})]});var c=n?a:ut()(a,{length:o,separator:"",omission:"..."}),l=O()({"c-read-more":!0,"-truncated":!n});return(0,S.jsxs)("div",{className:l,children:[s&&(0,S.jsx)(ft(),{linkTarget:"_blank",source:c}),!s&&(0,S.jsx)("p",{children:c}),(0,S.jsx)("div",{className:"overlay"}),(0,S.jsx)("button",{className:"c-button -clean",onClick:function(){i&&!n&&i(),r(!n)},children:n?"Read less":"Read more"})]})}pt.defaultProps={text:"",limitChar:1300,markdown:!1,readMoreClicked:null};var ht=pt,bt=n(22521);function vt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function gt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};
1t%2?vt(Object(n),!0).forEach((function(t){(0,a.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var mt=(0,d.connect)((function(e){return{userIsLoggedIn:!!e.user.token,isSidebarOpen:e.explore.sidebar.open}}),p)((function(e){var t=e.dataset,n=e.setSelectedDataset,r=(e.userIsLoggedIn,e.isSidebarOpen),a=e.setSidebarSection,o=e.setFiltersSearch,s=e.setFiltersSelected,i=(0,f.useRouter)().query,c=(0,u.useState)(!1),l=c[0],d=c[1],p=(0,u.useCallback)((function(){var e=i.search,t=i.section,r=i.topics;n(null),a(t),r&&s({key:"topics",list:JSON.parse(decodeURIComponent(r))}),e&&o(e)}),[i,n,a,s,o]),h=window.location;return t&&t.metadata&&t.metadata[0]&&t.metadata[0].info&&t.metadata[0].info.name,(0,S.jsxs)("div",{className:"c-explore-detail-header",style:gt({},!r&&{position:"absolute"}),children:[(0,S.jsxs)("button",{type:"button",onClick:p,className:"c-btn -primary -compressed -fs-tiny all-datasets-button",children:[(0,S.jsx)(w.Z,{className:"-small",name:"icon-arrow-left-2"}),(0,S.jsx)("span",{children:"ALL DATASETS"})]}),(0,S.jsxs)("div",{className:"right-buttons",children:[(0,S.jsx)(Ke.Z,{children:(0,S.jsx)(ae.Tooltip,{overlay:(0,S.jsx)(We.Z,{resource:t,resourceType:"dataset"}),overlayClassName:"c-rc-tooltip",placement:"bottomRight",trigger:"click",getTooltipContainer:oe.m,monitorWindowResize:!0,children:(0,S.jsxs)("button",{className:"c-btn -quaternary -compressed -fs-tiny",type:"button",children:[(0,S.jsx)(w.Z,{className:"-small",name:"icon-star-full"}),(0,S.jsx)("span",{children:"SAVE"})]})})}),(0,S.jsxs)("button",{className:"c-btn -quaternary -compressed -fs-tiny share-button",onClick:function(){return d(!0)},children:[(0,S.jsx)(w.Z,{className:"-small",name:"icon-arrow-up-2"}),(0,S.jsx)("span",{children:"SHARE"}),(0,S.jsx)(y.Z,{isOpen:l,className:"-medium",onRequestClose:function(){return d(!1)},children:(0,S.jsx)(bt.ZP,{links:{link:h&&h.href,embed:h&&"".concat(h.origin,"/embed").concat(h.pathname).concat(h.search)}})})]})]})]})}));function yt(e){var t=e.setSidebarAnchor,n=e.showVizualizationLink;return(0,S.jsxs)("div",{className:"c-explore-detail-footer",children:[(0,S.jsx)("a",{onClick:function(){t("overview")},onKeyPress:function(){t("overview")},role:"button",tabIndex:0,children:"OVERVIEW"}),(0,S.jsx)("a",{onClick:function(){t("layers")},onKeyPress:function(){t("layers")},role:"button",tabIndex:0,children:"LAYERS"}),n&&(0,S.jsx)("a",{onClick:function(){t("visualization")},onKeyPress:function(){t("visualization")},role:"button",tabIndex:0,children:"VISUALIZATION"}),(0,S.jsx)("a",{onClick:function(){t("further_information")},onKeyPress:function(){t("further_information")},role:"button",tabIndex:0,children:"FURTHER INFORMATION"})]})}yt.defaultProps={showVizualizationLink:!0};var jt=yt,xt=(0,d.connect)(null,p)(jt),Ot=300,wt=function(e){var t=e.metadata,n=t.info,r=n.technical_title,a=n.cautions,o=n.citation,s=n.sources,i=n.geographic_coverage,c=n.frequency_of_updates,l=n.license,u=n.license_link,d=n.date_of_content,f=n.spatial_resolution,p=t.language;return(0,S.jsxs)("div",{className:"c-further-information",children:[(0,S.jsx)("h3",{children:"Further information"}),r&&(0,S.jsxs)("div",{className:"metadata-field",children:[(0,S.jsx)("h4",{children:"Formal name"}),(0,S.jsx)("p",{children:r})]}),a&&(0,S.jsxs)("div",{className:"metadata-field",children:[(0,S.jsx)("h4",{children:"Cautions"}),(0,S.jsx)(ht,{markdown:!0,text:a,limitChar:Ot})]}),o&&(0,S.jsxs)("div",{className:"metadata-field",children:[(0,S.jsx)("h4",{children:"Suggested citation"}),(0,S.jsx)(ht,{markdown:!0,text:o,limitChar:Ot})]}),f&&(0,S.jsxs)("div",{className:"metadata-field",children:[(0,S.jsx)("h4",{children:"Spatial resolution"}),(0,S.jsx)(ht,{markdown:!0,text:f,limitChar:Ot})]}),s&&(0,S.jsxs)("div",{className:"metadata-field",children:[(0,S.jsx)("h4",{children:"Sources"}),s.map((function(e){return(0,S.jsxs)("div",{children:[e["source-name"],e["source-description"]]},e.id)}))]}),(0,S.jsxs)("div",{className:"row",children:[(0,S.jsx)("div",{className:"column small-6",children:(0,S.jsxs)("div",{className:"metadata-field",children:[(0,S.jsx)("h4",{children:"Geographic coverage"}),(0,S.jsx)(ft(),{linkTarget:"_blank",source:i})]})}),(0,S.jsx)("div",{className:"column small-6",children:(0,S.jsxs)("div",{className:"metadata-field",children:[(0,S.jsx)("h4",{children:"Frequency of updates"}),(0,S.jsx)(ft(),{linkTarget:"_blank",source:c})]})}),(0,S.jsx)("div",{className:"column small-6",children:(0,S.jsxs)("div",{className:"metadata-field",children:[(0,S.jsx)("h4",{children:"Published language"}),(0,S.jsx)(ft(),{linkTarget:"_blank",source:p})]})}),(0,S.jsx)("div",{className:"column small-6",children:(0,S.jsxs)("div",{className:"metadata-field",children:[(0,S.jsx)("h4",{children:"License"}),(0,S.jsx)("a",{href:u,target:"_blank",rel:"noreferrer noopener",children:l})]})}),(0,S.jsx)("div",{className:"column small-6",children:(0,S.jsxs)("div",{className:"metadata-field",children:[(0,S.jsx)("h4",{children:"Date of content"}),(0,S.jsx)(ft(),{linkTarget:"_blank",source:d})]})})]})]})},St=n(18446),kt=n.n(St),Pt=n(37629),Nt=n(92813),Ct=n(36646),At=n(43026),Dt=n(64960),Et=n(20401),Zt=n(51608);function Tt(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,l.Z)(e);if(t){var a=(0,l.Z)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return(0,c.Z)(this,n)}}var Lt=function(e){(0,i.Z)(n,e);var t=Tt(n);function n(){var e;(0,o.Z)(this,n);for(var r=arguments.length,s=new Array(r),i=0;i<r;i++)s[i]=arguments[i];return e=t.call.apply(t,[this].concat(s)),(0,a.Z)((0,j.Z)(e),"state",{showSubscribePreview:!1}),(0,a.Z)((0,j.Z)(e),"onChangeArea",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.props,r=n.activeDataset,a=n.onRequestClose,o=n.setUserSelection,s=n.router,i=e.state,c=i.selectedType,l=i.selectedThreshold;"upload_area"===t.value?(a(),s.push("/myrw-detail/areas/new?subscriptionDataset=".concat(r.id,"&subscriptionType=").concat(c,"&subscriptionThreshold=").concat(l))):o({area:t})})),(0,a.Z)((0,j.Z)(e),"handleCancel",(function(){var t=e.props,n=t.resetModal;(0,t.onRequestClose)(),n()})),(0,a.Z)((0,j.Z)(e),"handleShowSubscribePreview",(function(){e.setState({showSubscribePreview:!0})})),(0,a.Z)((0,j.Z)(e),"handleSubscribe",(function(){var t=e.props,n=t.userSelection,r=t.userAreas,a=t.areaFound,o=t.createSubscriptionToArea,s=t.createSubscriptionOnNewArea,i=t.updateSubscription,c=e.state.showSubscribePreview;n.area?n.area.areaID?a?st.Rt.confirm("There already exists a subscription for the selected area.\n            Do you want to update it?",{onOk:function(){i()},onCancel:function(){}}):o():r.map((function(e){return e.geostore})).includes(n.area.value)?o():s().then((function(){c&&e.setState({showSubscribePreview:!1})})):st.Rt.error("Data missing","Please select an area and a subscription type")})),(0,a.Z)((0,j.Z)(e),"handleGoToMySubscriptions",(function(){var t=e.props,n=t.onRequestClose,r=t.router;n(),r.push("/myrw/areas")})),(0,a.Z)((0,j.Z)(e),"handleState",(function(t){e.setState({showSubscribePreview:t})})),e}return(0,s.Z)(n,[{key:"render",value:function(){var e=this.props,t=e.areas,n=e.activeArea,r=e.activeDataset,a=e.userSelection,o=e.loading,s=e.subscription,i=e.onRequestClose,c=this.state.showSubscribePreview,l="Subscription saved!",u=s.success,d=r&&r.metadata&&r.metadata.name;Object.keys(r).length&&(l="Subscribe to ".concat(d)),n&&(l="".concat(n.name," subscriptions"));var f=u?(0,S.jsxs)("p",{children:["Your subscription was successfully created.",(0,S.jsx)("strong",{children:" Please check your email address to confirm it."})]}):null;return c?(0,S.jsx)(Zt.Z,{handleCancel:this.handleCancel,handleSubscribe:this.handleSubscribe,onRequestClose:i,handleState:this.handleState}):(0,S.jsxs)("div",{className:"c-subscriptions-modal",children:[(0,S.jsx)(pe.Z,{className:"-light",isLoading:o}),!u&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)("div",{className:"header-div",children:[(0,S.jsx)("h2",{children:l}),f]}),(0,S.jsx)("div",{className:"selectors-container",children:(0,S.jsx)(At.Z,{properties:{name:"areas",label:"Areas"},children:(0,S.jsx)(Dt.Z,{placeholder:"Select area",options:t,className:O()({"-disabled":!!n}),clearable:!n,onValueChange:this.onChangeArea,allowNonLeafSelection:!1,value:a.area?a.area.value:null})})}),(0,S.jsx)("div",{className:"separator"}),(0,S.jsx)(Et.Z,{activeArea:n})]}),u&&(0,S.jsx)("div",{className:"icon-container",children:(0,S.jsx)("img",{alt:"success",src:"/static/images/components/modal/widget-saved.svg"})}),!u&&(0,S.jsxs)("div",{className:"buttons",children:[(0,S.jsx)("button",{className:"c-btn -primary",onClick:this.handleSubscribe,children:"Save"}),(0,S.jsx)("button",{className:O()({"c-btn":!0,"-secondary":!0,"-disabled":!!n}),onClick:this.handleShowSubscribePreview,disabled:null===a.area||0===a.datasets.length,children:"Preview"}),(0,S.jsx)("button",{className:"c-btn -secondary",onClick:this.handleCancel,children:"Cancel"})]}),u&&(0,S.jsxs)("div",{className:"buttons",children:[(0,S.jsx)("button",{className:"c-btn -secondary",onClick:this.handleCancel,children:"Ok"}),(0,S.jsx)("button",{className:"c-btn -primary",onClick:this.handleGoToMySubscriptions,children:"View my subscriptions"})]})]})}}]),n}(u.PureComponent);(0,a.Z)(Lt,"defaultProps",{activeArea:null});var _t=(0,f.withRouter)(Lt);function Rt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function It(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};
1t%2?Rt(Object(n),!0).forEach((function(t){(0,a.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Rt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Mt(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,l.Z)(e);if(t){var a=(0,l.Z)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return(0,c.Z)(this,n)}}var Ft=function(e){(0,i.Z)(n,e);var t=Mt(n);function n(){return(0,o.Z)(this,n),t.apply(this,arguments)}return(0,s.Z)(n,[{key:"UNSAFE_componentWillMount",value:function(){var e=this.props,t=e.activeDataset,n=e.setUserSelection,r=e.getAreas,a=e.getUserAreas,o=e.getDatasets,s=e.getUserSubscriptions;r(),a(),o(),s(),Object.keys(t).length&&n({datasets:[t].map((function(e){return{id:e.id,label:e.name,value:e.name,subscriptions:ke()(Object.keys(e.subscribable||e.attributes.subscribable).map((function(t,n){return It(It({label:t,value:t},(e.subscribable||e.attributes.subscribable)[t]&&{query:((e.subscribable||e.attributes.subscribable)[t]||{}).dataQuery}),0===n&&{selected:!0})})),"label"),threshold:1}}))})}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){var t=this.props,n=t.subscriptions,r=t.setUserSelection,a=t.activeArea,o=e.subscriptions,s=e.activeArea,i=!kt()(n,o);if(o.length&&i&&s&&s.subscription){var c=o.find((function(e){return e.id===a.subscription.id})).attributes.datasetsQuery.filter((function(e){return e.type})).map((function(e){return e.type}));r({datasets:a.subscription.attributes.datasets.map((function(e,t){return{id:e.id,label:e.name,value:e.name,subscriptions:ke()(Object.keys(e.subscribable||e.attributes.subscribable).map((function(e){return It({label:e,value:e},c.includes(e)&&{selected:!0})})),"label"),threshold:a.subscription.attributes.datasetsQuery[t].threshold}}))})}}},{key:"componentWillUnmount",value:function(){var e=this.props,t=e.clearSubscriptions,n=e.clearUserSelection,r=e.clearLocalSubscriptions,a=e.activeDataset,o=e.setUserSelection;r(),t(),n(),Object.keys(a).length&&o({datasets:[a].map((function(e){return{id:e.id,label:e.name,value:e.name,subscriptions:ke()(Object.keys(e.subscribable||e.attributes.subscribable).map((function(t,n){return It(It({label:t,value:t},(e.subscribable||e.attributes.subscribable)[t]&&{query:((e.subscribable||e.attributes.subscribable)[t]||{}).dataQuery}),0===n&&{selected:!0})})),"label"),threshold:1}}))})}},{key:"render",value:function(){return(0,S.jsx)(_t,It({},this.props))}}]),n}(u.Component),Ut=(0,d.connect)((function(e,t){return{userSelection:e.subscriptions.userSelection,areas:(0,Ct.Ai)(e),areaFound:(0,Ct.ng)(e),userAreas:e.user.areas.items,activeDataset:t.dataset,subscriptions:e.subscriptions.list,subscription:e.subscriptions.subscriptionCreation,preview:e.subscriptions.list.preview,loading:e.subscriptions.areas.loading||e.subscriptions.userAreas.loading||e.subscriptions.datasets.loading}}),It({getUserAreas:Pt.eo},Nt))(Ft),Vt=function(e){var t,n=e.isLink,r=e.onClick,o=e.className,s=e.children,i=(0,u.useRef)(null),c=(0,u.useCallback)((function(e){return"Escape"!==e.key?null:i.current.blur()}),[]);return(0,u.useEffect)((function(){return window.addEventListener("keydown",c),function(){window.removeEventListener("keydown",c)}}),[c]),(0,S.jsx)("button",{ref:i,type:"button",className:O()("c-prominent-button",(t={},(0,a.Z)(t,o,!!o),(0,a.Z)(t,"-is-link",n),t)),onClick:r,children:s})};Vt.defaultProps={onClick:function(){},isLink:!1,className:null};var zt=Vt;function qt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Gt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};
1t%2?qt(Object(n),!0).forEach((function(t){(0,a.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Kt=function(e){var t=e.dataset,n=(0,u.useState)(!1),r=n[0],a=n[1],o=t.metadata,s=t.subscribable,i=o[0].info,c=s&&Object.keys(s).length>0,l=(0,u.useCallback)((function(){a(!0)}),[]),d=(0,u.useCallback)((function(){a(!1)}),[]);return(0,S.jsxs)("div",{className:"c-explore-detail-buttons",children:[(0,S.jsxs)("div",{className:"dataset-actions",children:[i.data_download_original_link&&(0,S.jsx)(zt,{isLink:!0,children:(0,S.jsxs)("a",{target:"_blank",rel:"noopener noreferrer",href:i.data_download_original_link,children:[(0,S.jsx)(w.Z,{name:"icon-download"}),(0,S.jsx)("span",{children:"download from source"})]})}),i.data_download_link&&(0,S.jsx)(zt,{isLink:!0,children:(0,S.jsxs)("a",{href:i.data_download_link,children:[(0,S.jsx)(w.Z,{name:"icon-download"}),(0,S.jsx)("span",{children:"download"})]})}),i.learn_more_link&&(0,S.jsx)(zt,{isLink:!0,children:(0,S.jsxs)("a",{target:"_blank",rel:"noopener noreferrer",href:i.learn_more_link,children:[(0,S.jsx)(w.Z,{name:"icon-learn-more"}),(0,S.jsx)("span",{children:"learn more from source"})]})}),c&&(0,S.jsx)(Ke.Z,{children:(0,S.jsxs)(zt,{onClick:l,children:[(0,S.jsx)(w.Z,{name:"icon-subscription"}),(0,S.jsx)("span",{children:"subscribe to alerts"})]})})]}),(0,S.jsx)(y.Z,{isOpen:r,onRequestClose:d,children:(0,S.jsx)(Ut,{onRequestClose:d,dataset:Gt(Gt({},t),{},{metadata:o[0]})})})]})};var Wt=function(e){var t=e.tags;return(0,S.jsxs)("div",{className:"c-explore-detail-tags",children:[(0,S.jsx)("div",{className:"title",children:(0,S.jsx)("h4",{children:"Tags"})}),(0,S.jsx)("div",{className:"tags",children:t.map((function(t){return(0,S.jsx)("button",{className:"c-button -secondary -compressed",onClick:function(){e.setSelectedDataset(null),e.setSidebarSection(z.of.ALL_DATA),e.setFiltersSelected(function(e){var t=e.id,n=e.labels,r="topics";return n.includes("TOPIC")?r="topics":n.includes("GEOGRAPHY")?r="geographies":n.includes("DATA_TYPE")&&(r="dataTypes"),{key:r,list:[t]}}(t)),e.setDatasetsPage(1),e.fetchDatasets()},children:t.label},t.id)}))})]})},Bt=(0,d.connect)(null,p)(Wt),Yt=function(e,t){return e.explore.map.layerGroups.find((function(e){return e.dataset===t.dataset.id}))},Qt=(0,Y.P1)([Yt,function(e,t){return t.layer.id}],(function(e,t){var n=e&&e.layers&&e.layers.find((function(e){return e.id===t}));return n&&n.active}));var Ht=function(e){var t=e.dataset,n=e.layer,r=n.id,a=n.name,o=n.description,s=e.layerGroup,i=e.layerIsActive,c=e.setMapLayerGroupActive,l=e.toggleMapLayerGroup,u=O()({"c-dataset-layer-card":!0,"-active":i}),d=O()({"c-button":!0,"-secondary":!i,"-primary":i,"-fullwidth":!0});return(0,S.jsxs)("div",{className:u,children:[(0,S.jsxs)("div",{className:"layer-data",children:[(0,S.jsx)("strong",{children:a}),(0,S.jsx)("p",{className:"description",children:o})]}),(0,S.jsx)("div",{className:"button-container",children:(0,S.jsxs)("button",{className:d,onClick:function(){i?l({dataset:{id:t.id},toggle:!1}):(s||l({dataset:t,toggle:!0}),c({dataset:{id:t.id},active:r}))},children:[!i&&(0,S.jsx)("span",{children:"Show layer"}),i&&(0,S.jsx)("span",{children:"Active"})]})})]})},Jt=(0,d.connect)((function(e,t){return{layerGroup:Yt(e,t),layerIsActive:Qt(e,t)}}),p)(Ht);var Xt=function(e){var t=e.layers,n=e.dataset,r=e.isATimeline,a=e.timelineLayerMapbox,o=e.timelineLayer,s=r&&!!a,i=r&&!a&&o;return(0,S.jsxs)("div",{className:"c-dataset-layers",children:[(0,S.jsx)("h3",{children:"Dataset layers"}),(0,S.jsxs)("div",{className:"layers-container",children:[i&&(0,S.jsx)(Jt,{layer:o,dataset:n}),s&&(0,S.jsx)(Jt,{layer:a,dataset:n}),!r&&t.map((function(e){return(0,S.jsx)(Jt,{layer:e,dataset:n})}))]})]})},$t=function(e,t){return e.explore.map.layerGroups.find((function(e){return e.dataset===t.dataset.id}))},en=(0,Y.P1)([$t],(function(e){return!!e&&e.layers.find((function(e){return e.layerConfig.timeline}))})),tn=function(e,t){return t.layers.find((function(e){return!!e.layerConfig.timeline_config}))},nn=(0,Y.P1)([$t,en,function(e,t){return t.layers}],(function(e,t,n){if(!t)return null;var r=e&&e.layers.find((function(e){return e.active})),a=r&&n.find((function(e){return e.id===r.id}));return a||(n.length&&n.length>0?n[0]:void 0)})),rn=(0,d.connect)((function(e,t){return{isATimeline:en(e,t),timelineLayerMapbox:tn(0,t),timelineLayer:nn(e,t)}}),null)(Xt);var an=function(e){var t=e.datasets,n=t.list,r=t.loading,a=e.setSelectedDataset;return(0,S.jsxs)("div",{className:"c-related-content",children:[(0,S.jsx)("h3",{children:"Related content"}),(0,S.jsx)(Ge,{list:n,loading:r,numberOfPlaceholders:3,actions:(0,S.jsx)($e,{}),expandedChart:!0}),(0,S.jsx)("div",{className:"actions",children:(0,S.jsx)("button",{className:"c-button -secondary",onClick:function(){return a(null)},children:"See all datasets"})})]})};function on(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var sn=function(e){var t=e.datasetID,n=(0,u.useState)({list:[],loading:!1}),r=n[0],o=n[1];
1return(0,u.useEffect)((function(){t&&(o({list:[],loading:!0}),(0,ct.S0)({dataset:t,published:!0,limit:3,env:"production"}).then((function(e){e.length>0&&(0,it.Qu)({ids:e.map((function(e){return e.dataset})).join(","),includes:"widget,metadata,layer,vocabulary",env:"production"}).then((function(e){o({list:e,loading:!1})}))})).catch((function(e){return st.Rt.error("Error loading related content",e)})))}),[t]),(0,S.jsx)(an,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?on(Object(n),!0).forEach((function(t){(0,a.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):on(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({datasets:r},e))};sn.defaultProps={datasetID:null};var cn=(0,d.connect)(null,p)(sn),ln=n(2465),un=n(27812),dn=n(14996),fn=n(33817),pn=n(95710),hn=n(88767),bn=n(8371);function vn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function gn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?vn(Object(n),!0).forEach((function(t){(0,a.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var mn=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return(0,hn.useQuery)(["user-area",e,t,n],(function(){return(0,bn.eS)(e,n,{Authorization:t})}),gn({},r))},yn=n(6442),jn=n(12881);function xn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function On(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?xn(Object(n),!0).forEach((function(t){(0,a.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function wn(e){var t=e.widgetId,n=e.datasetId,r=e.aoi,a=e.authorization,o=e.RWAdapter,s=(0,f.useRouter)(),i=(0,u.useState)(!1),c=i[0],l=i[1],d=(0,u.useState)(!1),p=d[0],h=d[1],b=mn(r,a,{},{enabled:!(!r||!a)}).data;return(0,S.jsxs)("div",{className:"c-explore-detail-visualization",children:[(0,S.jsx)(pe.Z,{isLoading:p,className:"-light -relative"}),(0,S.jsx)("h3",{children:"Customize visualization"}),(0,S.jsx)(pn.Z,{message:"There was an error loading the visualization",children:(0,S.jsx)(dn.ZP,On(On(On({datasetId:n},t&&{widgetId:t}),(null===b||void 0===b?void 0:b.geostore)&&{areaIntersection:b.geostore}),{},{compact:!0,map:jn.aE,onSave:function(e){if(a){var t={name:e.name,description:e.description,widgetConfig:e.widgetConfig,published:!1,application:"rw".split(","),env:"production"};h(!0),(0,yn.A4)(t,n,a).then((function(t){(0,yn.Dt)(t.id,t.dataset,{language:"en",info:{caption:e.metadata.caption}},a).then((function(){s.push("/myrw/widgets/my_widgets"),st.Rt.success("Success","Widget created successfully!")}))})).catch((function(e){h(!1),st.Rt.error("Error creating widget",e)}))}else l(!0)},theme:jn.pk,adapter:o,schemes:jn.g1,authenticated:!0,disable:[].concat((0,un.Z)(jn.Qx),["advanced-editor"])}))}),(0,S.jsx)(y.Z,{isOpen:c,onRequestClose:function(){return l(!1)},children:(0,S.jsx)(fn.Z,{})})]})}wn.defaultProps={widgetId:null,authorization:null,aoi:null};var Sn=wn,kn=(0,d.connect)((function(e){return{authorization:e.user.token,aoi:e.explore.map.aoi,RWAdapter:(0,ln.b)(e)}}),null)(Sn);function Pn(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,l.Z)(e);if(t){var a=(0,l.Z)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return(0,c.Z)(this,n)}}var Nn=function(e){(0,i.Z)(n,e);var t=Pn(n);function n(){return(0,o.Z)(this,n),t.apply(this,arguments)}
1return(0,s.Z)(n,[{key:"componentWillUnmount",value:function(){this.props.setSidebarAnchor(null)}},{key:"render",value:function(){var e=this.props,t=e.dataset,n=e.datasetLoading,r=e.tags,a=t&&t.metadata&&t.metadata.length>0&&t.metadata[0],o=a&&a.info,s=t&&t.layer,i=(0,Q.f2)(t&&t.dataLastUpdated),c=t&&t.widget&&t.widget.find((function(e){return e.defaultEditableWidget})),l=t&&t.layer&&t.layer.length>0,u=r&&r.length>0;return(0,S.jsxs)("div",{className:"c-explore-detail",children:[(0,S.jsx)(pe.Z,{isLoading:n,className:"-light"}),a&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)("div",{className:"content",children:[(0,S.jsx)(mt,{dataset:t}),(0,S.jsxs)("div",{id:"overview",className:"overview metadata-section",children:[(0,S.jsx)("div",{className:"title",children:(0,S.jsx)("h2",{children:o&&o.name})}),(0,S.jsxs)("div",{className:"source-date",children:[(0,S.jsx)("div",{className:"source",title:a.source,children:"SOURCE: ".concat(a.source)}),(0,S.jsx)("div",{className:"date",children:i?"UPDATED ON ".concat(i).toUpperCase():""})]}),(0,S.jsx)("div",{className:"functions metadata-field",children:o&&o.functions}),(0,S.jsx)(Kt,{dataset:t}),(0,S.jsx)("div",{className:"description metadata-field",children:(0,S.jsx)(ht,{markdown:!0,text:a.description,limitChar:Ot})}),u&&(0,S.jsx)(Bt,{tags:r})]}),l&&(0,S.jsx)("div",{id:"layers",className:"metadata-section",children:(0,S.jsx)(rn,{layers:s,dataset:t})}),(0,S.jsx)("div",{id:"visualization",className:"metadata-section",children:(0,S.jsx)(kn,{datasetId:t.id,widgetId:c&&c.id})}),(0,S.jsx)("div",{id:"further_information",className:"metadata-section",children:(0,S.jsx)(wt,{metadata:a})}),(0,S.jsx)("div",{id:"related_content",className:"metadata-section",children:(0,S.jsx)(cn,{datasetID:t.id})})]}),(0,S.jsx)(xt,{})]}),!a&&!n&&(0,S.jsxs)("div",{className:"content",children:[(0,S.jsx)(mt,{dataset:t}),(0,S.jsx)("div",{id:"overview",className:"overview metadata-section",children:(0,S.jsx)("p",{children:"Metadata for this dataset couldn't be loaded."})})]})]})}}]),n}(u.Component);(0,a.Z)(Nn,"defaultProps",{dataset:null});var Cn=Nn,An="SET_DATASET",Dn="SET_DATASET_LOADING",En="SET_TAGS",Zn="SET_TAGS_LOADING",Tn=(0,Pe.createAction)(An),Ln=(0,Pe.createAction)(Dn),_n=(0,Pe.createAction)(En),Rn=(0,Pe.createAction)(Zn);function In(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Mn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?In(Object(n),!0).forEach((function(t){(0,a.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):In(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Fn=function(e,t){var n=t.type,r=t.payload;switch(n){case Dn:return Mn(Mn({},e),{},{datasetLoading:r});case An:return Mn(Mn({},e),{},{dataset:r});case Zn:return Mn(Mn({},e),{},{tagsLoading:r});case En:return Mn(Mn({},e),{},{tags:r});default:throw new Error("action not found")}},Un={dataset:null,tags:[],datasetLoading:!0,tagsLoading:!1};function Vn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function zn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Vn(Object(n),!0).forEach((function(t){(0,a.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Vn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var qn=(0,d.connect)((function(e){return{datasetID:e.explore.datasets.selected,anchor:e.explore.sidebar.anchor,layerGroups:e.explore.map.layerGroups}}),p)((function(e){var t=(0,u.useReducer)(Fn,Un),n=t[0],r=t[1],a=e.datasetID,o=e.anchor,s=e.onDatasetLoaded,i=e.layerGroups,c=e.toggleMapLayerGroup;return(0,u.useEffect)((function(){a&&(r(Ln(!0)),r(Rn(!0)),(0,it.Kb)(a,{includes:"metadata,layer,vocabulary,widget",application:"rw",env:"production"}).then((function(e){r(Tn(e)),r(Ln(!1)),s(e);var t=document.getElementById(o);t&&t.scrollIntoView({behavior:"smooth",block:"start"});var n=e.layer.length>0;0===i.length&&n&&c({dataset:e,toggle:!0});var a=e.vocabulary&&e.vocabulary.find((function(e){return"knowledge_graph"===e.name})),l=a&&a.tags;l&&(0,ct.yZ)({concepts:l.join(",")}).then((function(e){r(_n(e.filter((function(e){return e.labels.find((function(e){return"TOPIC"===e||"GEOGRAPHY"===e}))&&!Ne.o.includes(e.id)}
1)))),r(Rn(!1))})).catch((function(e){st.Rt.error("Error loading dataset inferred tags",e),r(Rn(!1))}))})).catch((function(e){r(Ln(!1)),st.Rt.error("Error loading dataset data"),console.error("Error loading dataset data",e)})))}),[o,a]),(0,u.useEffect)((function(){var e=document.getElementById(o);e&&e.scrollIntoView({behavior:"smooth",block:"start"})}),[o]),(0,S.jsx)(Cn,zn(zn({},n),e))}));var Gn=function(e){var t=e.topics,n=e.onClick;return(0,S.jsx)("div",{className:"c-topics-list",children:(0,S.jsx)("div",{className:"row",children:t.map((function(e){return(0,S.jsx)("div",{className:"column small-6",children:(0,S.jsxs)("div",{id:e.id,className:"topic-button",role:"button",tabIndex:0,onClick:function(){return n(e.id)},onKeyPress:function(){return n(e.id)},children:[(0,S.jsx)("div",{className:"topic-image",style:{backgroundImage:"linear-gradient(".concat(e.backgroundColor,",").concat(e.backgroundColor,"),\n                    linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.30)),url(").concat(e.backgroundURL,")"),backgroundPosition:"center",backgroundSize:"cover"}}),(0,S.jsx)("div",{className:"topic-title",children:e.label})]})},e.id)}))})})};var Kn=function(e){return(0,S.jsx)("div",{className:"c-explore-topics",children:(0,S.jsx)(Gn,{topics:re,onClick:function(t){e.setFiltersSearch(""),e.resetFiltersSort(),e.setFiltersSelected({key:"topics",list:[t]}),e.setDatasetsPage(1),e.fetchDatasets(),e.setSidebarSection(z.of.ALL_DATA)}})})},Wn=(0,d.connect)(null,p)(Kn),Bn=n(67196),Yn=function(e){var t=e.setSidebarSection,n=(0,u.useCallback)((function(){t(z.of.ALL_DATA)}),[t]);return(0,S.jsxs)("div",{className:"c-explore-areas-of-interest-intro",children:[(0,S.jsxs)("h4",{className:"-text-center",children:["Analyze data in the areas",(0,S.jsx)("br",{}),"you're most interested in"]}),(0,S.jsx)("p",{className:"-text-center",children:'Use your areas of interest as a "geographic filter" in the custom visualization creator for any of the datasets in the catalog.'}),(0,S.jsx)("button",{type:"button",className:"c-btn -primary",onClick:n,children:"See all datasets"})]})},Qn=(0,d.connect)(null,{setSidebarSection:p.setSidebarSection})(Yn),Hn=n(89562);function Jn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Xn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Jn(Object(n),!0).forEach((function(t){(0,a.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Jn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var $n=function(e){var t=e.token,n=e.aoi,r=e.setSidebarSubsection,a=e.setAreaOfInterest,o=(0,u.useState)({page:1,limit:3,size:0}),s=o[0],i=o[1],c=(0,Hn.Z)(t,{"page[size]":s.limit,"page[number]":s.page,sort:"name"}),l=c.data,d=l.areas,f=l.meta,p=c.isFetching,h=c.isSuccess,b=c.isFetchedAfterMount,v=c.refetch,g=(0,u.useCallback)((function(){r(z.Iu.NEW_AREA)}),[r]),m=(0,u.useCallback)((function(e){i(Xn(Xn({},s),{},{page:e}))}),[s]),y=(0,u.useCallback)((function(e){var t=e.id;a(n&&n===t?null:t)}),[a,n]),j=(0,u.useCallback)((function(){i((function(e){return Xn(Xn({},e),{},{page:1})})),v()}),[v]),x=(0,u.useMemo)((function(){return d.map((function(e){return Xn(Xn({},e),{},{isVisible:n===e.id})}))}),[d,n]);return(0,u.useEffect)((function(){i((function(e){return Xn(Xn({},e),{},{size:f["total-items"]})}))}),[f]),(0,S.jsxs)("div",{className:"c-explore-areas-of-interest",children:[(0,S.jsx)("div",{className:"menu",children:(0,S.jsxs)("button",{className:"c-button -quaternary -compressed -fs-tiny",type:"button",onClick:g,children:[(0,S.jsx)(w.Z,{name:"icon-plus"}),"New Area"]})}),(0,S.jsx)(Qn,{}),(0,S.jsxs)("div",{className:"user-areas-header",children:[(0,S.jsx)("h4",{children:"Your saved areas"}),p&&(0,S.jsx)(pe.Z,{isLoading:!0,className:"-tiny -transparent -right"})]}),h&&b&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(Bn.Z,{areas:x,isColumn:!0,showSubscriptions:!1,onMapView:y,onEditArea:v,onChangedVisibility:v,onDeletionArea:j}),s.size>s.limit&&(0,S.jsx)(ne.Z,{options:s,onChange:m})]})]})};$n.defaultProps={aoi:null};var er=$n,tr=(0,d.connect)((function(e){return{token:e.user.token,aoi:e.explore.map.aoi}}),{setSidebarSubsection:p.setSidebarSubsection,setAreaOfInterest:p.setAreaOfInterest})(er),nr=n(50029),rr=n(87794),ar=n.n(rr),or=n(63003),sr=n(33964),ir=n(34094),cr=n(30087),lr=n(91789),ur=function(e){var t=e.onClickCountry,n=(0,u.useRef)(null),r=(0,u.useState)(""),a=r[0],o=r[1],s=(0,u.useCallback)((function(e){o(e)}),[o]),i=(0,u.useCallback)((function(e){n.current=e}),[]),c=(0,u.useCallback)((function(e){var n=e.target.dataset,r=n.geostore,a=n.name;t({name:a,geostore:r})}),[t]),l=(0,lr.Z)({refetchOnWindowFocus:!1,keepPreviousData:!0}),d=l.data,f=l.isFetching,p=l.isSuccess,h=l.isInitialData,b=(0,u.useMemo)((function(){return d.filter((function(e){return!!e.name})).map((function(e){return{name:e.name,geostoreId:e.geostoreId}}))}
1),[d]),v=(0,u.useMemo)((function(){return b.filter((function(e){return e.name.toLocaleLowerCase().includes(a.toLocaleLowerCase())}))}),[b,a]);return(0,u.useEffect)((function(){n.current&&n.current.focus()}),[]),(0,S.jsxs)("div",{className:"c-country-search-selector",children:[(0,S.jsx)("div",{className:"search-container",children:(0,S.jsx)(cr.Z,{getRef:i,input:{value:a,placeholder:"Type a country"},onSearch:s})}),(0,S.jsxs)("div",{className:"countries-container",children:[h&&f&&(0,S.jsx)(pe.Z,{isLoading:!0,className:"-small -transparent"}),p&&(0,S.jsx)("ul",{className:"country-list",children:v.map((function(e){var t=e.name,n=e.geostoreId;return(0,S.jsx)("li",{className:"country-list-item",children:(0,S.jsx)("button",{type:"button",onClick:c,"data-geostore":n,"data-name":t,children:t})},n)}))})]})]})};function dr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function fr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?dr(Object(n),!0).forEach((function(t){(0,a.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var pr="DRAW_AREA",hr="PRESET_COUNTRY",br="UPLOAD_FILE",vr=function(e){var t=e.area,n=e.drawer,r=e.setIsDrawing,a=e.stopDrawing,o=e.onSubmit,s=e.onFileAccepted,i=e.onCancel,c=n.isDrawing,l=n.data,d=(0,u.useRef)(null),f=!!t,p=(0,u.useState)({name:t?t.name:"",geostore:t?t.geostore:null}),h=p[0],b=p[1],v=(0,u.useState)(!1),g=v[0],m=v[1],y=(0,u.useState)(null),j=y[0],x=y[1],k=(0,u.useState)("select a preset area"),P=k[0],N=k[1],C=(0,u.useState)({accepted:null,rejected:null,dropzoneActive:!1,loading:!1,errors:[]}),A=C[0],D=C[1],E=(0,u.useCallback)((function(e){e.preventDefault(),o(h)}),[o,h]),Z=(0,u.useCallback)((function(e){b(fr(fr({},h),{},{name:e}))}),[b,h]),T=(0,u.useCallback)((function(e){var t=e.name,n=e.geostore;b(fr(fr({},h),{},{geostore:n})),N(t),m(!1)}),[b,h]),L=(0,u.useCallback)((function(e){c&&a(),x(e?hr:null),m(e)}),[c,a]),_=(0,u.useCallback)((function(){var e=j!==pr;r(e),x(e?pr:null)}),[j,r]),R=(0,u.useCallback)((function(){c&&a(),x(null),d.current.open()}),[c,a]),I=(0,u.useCallback)((function(){D(fr(fr({},A),{},{dropzoneActive:!0}))}),[A]),M=(0,u.useCallback)((function(){D(fr(fr({},A),{},{dropzoneActive:!1}))}),[A]),F=(0,u.useCallback)(function(){var e=(0,nr.Z)(ar().mark((function e(t,n){var r;return ar().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return x(br),D({accepted:t[0],rejected:n[0],dropzoneActive:!1,loading:!0,errors:[]}),e.prev=2,e.next=5,(0,sr.$E)(t[0]);case 5:r=e.sent,b(fr(fr({},h),{},{geostore:r})),s&&s(fr(fr({},h),{},{geostore:r})),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(2),st.Rt.error("There was an error processing the file",e.t0.message);case 13:case"end":return e.stop()}}),e,null,[[2,10]])})));return function(t,n){return e.apply(this,arguments)}}(),[h,s]),U=h.name;(0,u.useEffect)((function(){c||x(null)}),[c]),(0,u.useEffect)((function(){j!==hr&&(N("select a preset area"),b((function(e){return fr(fr({},e),{},{geostore:null})})))}),[j]);var V=(0,u.useMemo)((function(){return!j||(!h.name||""===h.name||(j===pr&&!l||(j===hr&&!h.geostore||j===br&&!A.accepted)))}),[j,h.name,l,h.geostore,A.accepted]);return(0,S.jsxs)("form",{onSubmit:E,className:"c-explore-area-form",children:[(0,S.jsx)("fieldset",{className:"c-field-container",children:(0,S.jsx)(At.Z,{onChange:Z,validations:["required"],properties:{name:"name",label:"Title",type:"text",value:U,default:U,placeholder:"Type a name",required:!0},children:ir.Z})}),!f&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)("div",{className:"areas-actions",children:[(0,S.jsxs)(zt,{onClick:_,className:O()({"-alt":j===pr}),children:[(0,S.jsx)(w.Z,{name:"icon-meta-draw"}),(0,S.jsx)("span",{children:"Draw your area in the map"})]}),(0,S.jsx)(ae.Tooltip,{overlay:(0,S.jsx)(ur,{onClickCountry:T}),overlayClassName:"c-rc-tooltip -default",placement:"bottom",trigger:"click",visible:g,onVisibleChange:L,destroyTooltipOnHide:!0,children:(0,S.jsxs)(zt,{className:O()({"-alt":j===hr}),children:[(0,S.jsx)(w.Z,{name:"icon-meta-select"}),(0,S.jsx)("span",{children:P})]})}),(0,S.jsx)(or.Z,{ref:d,className:"dropzone-container",activeClassName:"-active",rejectClassName:"-reject",multiple:!1,disableClick:!0,disablePreview:!0,onDrop:F,onDragEnter:I,onDragLeave:M,children:(0,S.jsxs)(zt,{onClick:R,className:O()({"-alt":j===br}),children:[(0,S.jsx)(w.Z,{name:"icon-meta-upload"}
1),(0,S.jsx)("span",{children:"Upload a shapefile"})]})})]}),j===br&&(0,S.jsxs)(S.Fragment,{children:[A.accepted&&(0,S.jsx)("div",{className:"accepted-file-container",children:(0,S.jsx)(At.Z,{properties:{name:"accepted",type:"text",disabled:!0,default:A.accepted.name},children:ir.Z})}),(0,S.jsxs)("div",{className:"specs",children:[(0,S.jsx)("p",{children:"Recommended maximum file size: 1MB. Anything larger than that may not work properly."}),(0,S.jsx)("p",{children:"Supported file formats: .csv (must contain a geom column that contains geographic information), .geojson, .kml, .kmz, .wkt, .shp (must include the .shp, .shx, .dbf and .prj files)"})]})]})]}),(0,S.jsxs)("div",{className:"buttons -align-left",children:[(0,S.jsx)("button",{type:"submit",className:"c-btn -primary",disabled:V,children:"Save"}),(0,S.jsx)("button",{type:"button",className:"c-btn -tertiary",onClick:i,children:"Cancel"})]})]})};vr.defaultProps={area:null,onFileAccepted:null};var gr=vr,mr=(0,d.connect)((function(e){return{drawer:e.explore.map.drawer}}),{setIsDrawing:p.setIsDrawing,stopDrawing:p.stopDrawing})(gr),yr=n(90953),jr=function(e){var t=e.token,n=e.drawer,r=e.clearSidebarSubsection,a=e.stopDrawing,o=e.setPreviewAoi,s=e.setAreaOfInterest,i=(0,u.useState)(!1),c=i[0],l=i[1],d=(0,u.useCallback)((function(){r()}),[r]),f=(0,u.useCallback)(function(){var e=(0,nr.Z)(ar().mark((function e(i){var c,u,d,f,p,h,b,v;return ar().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(c=n.isDrawing,u=n.data,d=i.name,f=i.geostore,l(!0),e.prev=3,!c||!u){e.next=14;break}return e.next=7,(0,yr.pg)(u);case 7:return p=e.sent,h=p.id,e.next=11,(0,bn.ne)(d,h,t);case 11:a(),e.next=20;break;case 14:return e.next=16,(0,bn.ne)(d,f,t);case 16:b=e.sent,v=b.id,o(null),s(v);case 20:l(!1),r(),e.next=29;break;case 24:e.prev=24,e.t0=e.catch(3),console.error(e.t0.message),st.Rt.error("There was an error creating the area"),l(!1);case 29:case"end":return e.stop()}}),e,null,[[3,24]])})));return function(t){return e.apply(this,arguments)}}(),[t,n,a,r,o,s]),p=(0,u.useCallback)((function(e){var t=e.geostore;s(null),o(t)}),[s,o]),h=(0,u.useCallback)((function(){o(null),r()}),[r,o]);return(0,u.useEffect)((function(){return function(){n.isDrawing&&a()}}),[n.isDrawing,a]),(0,S.jsxs)("div",{className:"c-explore-areas-of-interest-new-area",children:[c&&(0,S.jsx)(pe.Z,{isLoading:!0,className:"-transparent"}),!c&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)("div",{className:"menu",children:(0,S.jsxs)("button",{type:"button",className:"c-btn -primary -compressed -fs-tiny",onClick:d,children:[(0,S.jsx)(w.Z,{name:"icon-arrow-left-2"}),(0,S.jsx)("span",{children:"All areas"})]})}),(0,S.jsx)("span",{className:"section-name",children:"Area of Interest"}),(0,S.jsx)("h2",{children:"New Area"}),(0,S.jsx)(mr,{onSubmit:f,onFileAccepted:p,onCancel:h})]})]})},xr=(0,d.connect)((function(e){return{token:e.user.token,drawer:e.explore.map.drawer}}),{clearSidebarSubsection:p.clearSidebarSubsection,setSidebarSubsection:p.setSidebarSubsection,stopDrawing:p.stopDrawing,setPreviewAoi:p.setPreviewAoi,setAreaOfInterest:p.setAreaOfInterest})(jr),Or=n(29209),wr=function(e){var t=e.token,n=e.selectedCollection,r=(0,Ye.Z)(n,t,{},{enabled:!!n}),a=r.data,o=r.isFetching,s=(0,u.useMemo)((function(){return a?a.resources.filter((function(e){return"dataset"===e.type})).map((function(e){return e.id})):[]}),[a]),i=(0,Or.Z)({ids:s.join(","),includes:"widget,metadata,layer,vocabulary",env:"production"},{enabled:s.length>0,initialData:[],initialStale:!0}),c=i.data,l=i.isFetching;return(0,S.jsxs)("div",{className:"c-explore-collections",children:[(l||o)&&(0,S.jsx)(pe.Z,{isLoading:!0,className:"-light"}),c.length>0&&(0,S.jsx)(Ge,{list:c,actions:(0,S.jsx)($e,{})})]})},Sr=(0,d.connect)((function(e){return{token:e.user.token,selectedCollection:e.explore.sidebar.selectedCollection}}),null)(wr),kr=n(95817),Pr=function(){return(0,S.jsxs)("div",{className:"c-explore-login",children:[(0,S.jsx)(kr.Z,{}),(0,S.jsx)(Ke.Z,{children:(0,S.jsxs)("div",{className:"card-login",children:[(0,S.jsx)("h4",{children:"Log in or create a free account to access advanced features"}),(0,S.jsx)("p",{children:"Save your favorite data, create customized collections, and more."}),(0,S.jsx)("button",{type:"button",className:"c-button -primary -compressed",children:"Log in"})]})}),(0,S.jsx)(kr.Z,{}),(0,S.jsx)(kr.Z,{})]})},Nr=n(36125);function Cr(e){var t=e.setSidebarSection,n=e.selectedDataset,r=e.setSortSelected,a=e.setSortIsUserSelected,o=(0,u.useState)(null),s=o[0],i=o[1],c=(0,u.useState)({loading:!0,list:[]}),l=c[0],d=c[1],f=(0,u.useState)({loading:!0,list:[]}),p=f[0],h=f[1],b=(0,u.useState)({loading:!0,list:[]}),v=b[0],g=b[1];(0,u.useEffect)((function(){(0,Nr.w0)().then((function(e){i(e),(0,it.Qu)({"page[size]":4,published:!0,"applicationConfig.rw.highlighted":"true",includes:"layer,metadata,widget",env:"production"}).then((function(e){return d({loading:!1,list:e})})).catch((function(e){return st.Rt.error("Error loading highlighted datasets",e)})),(0,it.Qu)({"page[size]":4,published:!0,sort:"-dataLastUpdated",includes:"layer,metadata,widget",env:"production","concepts[0][0]":"near_real_time"}).then((function(e){return h({loading:!1,list:e})})).catch((function(e){return st.Rt.error("Error loading recently updated datasets",e)})),(0,it.Qu)({"page[size]":4,published:!0,sort:"-createdAt",includes:"layer,metadata,widget",env:"production"}).then((function(e){return g({loading:!1,list:e})})).catch((function(e){return st.Rt.error("Error loading recently added datasets",e)}))}
1)).catch((function(e){return st.Rt.error("Error loading Explore configuration",e)}))}),[]);var m=s&&s.explore.discover["related-topics"];return(0,S.jsxs)("div",{className:O()({"c-explore-discover":!0,"-hidden":n}),children:[(0,S.jsxs)("div",{className:"trending-datasets discover-section",children:[(0,S.jsxs)("div",{className:"header",children:[(0,S.jsx)("h4",{children:s&&s.explore.discover.subtitles["highlighted-datasets"]}),(0,S.jsx)("div",{className:"header-button",role:"button",tabIndex:-1,onClick:function(){t(z.of.ALL_DATA)},onKeyPress:function(){t(z.of.ALL_DATA)},children:"SEE ALL DATA"})]}),(0,S.jsx)(Ge,{loading:l.loading,numberOfPlaceholders:4,list:l.list,actions:(0,S.jsx)($e,{})})]}),(0,S.jsxs)("div",{className:"related-topics discover-section",children:[(0,S.jsxs)("div",{className:"header",children:[(0,S.jsx)("h4",{children:s&&s.explore.discover.subtitles["related-topics"]}),(0,S.jsx)("div",{className:"header-button",role:"button",tabIndex:-1,onClick:function(){t(z.of.TOPICS)},onKeyPress:function(){t(z.of.TOPICS)},children:"SEE ALL"})]}),m&&m.length>0&&(0,S.jsx)(Gn,{topics:re.filter((function(e){return m.find((function(t){return t===e.id}))})),onClick:function(t){e.setFiltersSearch(""),e.resetFiltersSort(),e.setFiltersSelected({key:"topics",list:[t]}),e.setDatasetsPage(1),e.fetchDatasets(),e.setSidebarSection(z.of.ALL_DATA)}})]}),(0,S.jsxs)("div",{className:"recently-added discover-section",children:[(0,S.jsxs)("div",{className:"header",children:[(0,S.jsx)("h4",{children:s&&s.explore.discover.subtitles["recently-added-datasets"]}),(0,S.jsx)("div",{className:"header-button",role:"button",tabIndex:-1,onClick:function(){t(z.of.ALL_DATA),r("createdAt"),a(),e.fetchDatasets()},onKeyPress:function(){t(z.of.ALL_DATA),r("createdAt"),a(),e.fetchDatasets()},children:"SEE ALL DATA"})]}),(0,S.jsx)(Ge,{loading:v.loading,numberOfPlaceholders:4,list:v.list,actions:(0,S.jsx)($e,{})})]}),(0,S.jsxs)("div",{className:"recent-updated discover-section",children:[(0,S.jsxs)("div",{className:"header",children:[(0,S.jsx)("h4",{children:s&&s.explore.discover.subtitles["recently-updated-datasets"]}),(0,S.jsx)("div",{className:"header-button",role:"button",tabIndex:-1,onClick:function(){t(z.of.NEAR_REAL_TIME)},onKeyPress:function(){t(z.of.NEAR_REAL_TIME)},children:"SEE ALL DATA"})]}),(0,S.jsx)(Ge,{loading:p.loading,numberOfPlaceholders:4,list:p.list,actions:(0,S.jsx)($e,{})})]})]})}Cr.defaultProps={selectedDataset:null};var Ar=Cr,Dr=(0,d.connect)((function(e){return{selectedDataset:e.explore.datasets.selected}}),p)(Ar);var Er=function(e){var t=e.datasets,n=t.today,r=t.week,a=t.month,o=t.loading,s=e.selectedDataset;return(0,S.jsxs)("div",{className:O()({"c-explore-near-real-time":!0,"-hidden":s}),children:[(0,S.jsxs)("div",{className:"explore-near-real-time-section",children:[(0,S.jsxs)("div",{className:"header",children:[(0,S.jsx)("h4",{children:"Updated today"}),(0,S.jsx)("span",{className:"number-of-datasets",children:"".concat(n.length," DATASET").concat(1!==n.length&&"S")})]}),(0,S.jsx)(Ge,{loading:o,numberOfPlaceholders:4,list:n,actions:(0,S.jsx)($e,{})})]}),(0,S.jsxs)("div",{className:"explore-near-real-time-section",children:[(0,S.jsxs)("div",{className:"header",children:[(0,S.jsx)("h4",{children:"Updated this week"}),(0,S.jsx)("span",{className:"number-of-datasets",children:"".concat(r.length," DATASET").concat(1!==r.length&&"S")})]}),(0,S.jsx)(Ge,{loading:o,numberOfPlaceholders:4,list:r,actions:(0,S.jsx)($e,{})})]}),(0,S.jsxs)("div",{className:"explore-near-real-time-section",children:[(0,S.jsxs)("div",{className:"header",children:[(0,S.jsx)("h4",{children:"Updated this month"}),(0,S.jsx)("span",{className:"number-of-datasets",children:"".concat(a.length," DATASET").concat(1!==a.length&&"S")})]}),(0,S.jsx)(Ge,{loading:o,numberOfPlaceholders:4,list:a,actions:(0,S.jsx)($e,{})})]})]})};function Zr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var Tr=function(e){var t=(0,u.useState)({today:[],week:[],month:[],loading:!0}),n=t[0],r=t[1];return(0,u.useEffect)((function(){(0,it.Qu)({"concepts[0][0]":"near_real_time","page[size]":99,includes:"layer,metadata",published:!0,env:"production"}).then((function(e){var t={today:[],week:[],month:[],loading:!1},n=new Date,a=864e5;e.forEach((function(e){if(e.dataLastUpdated){var r=new Date(e.dataLastUpdated),o=n-r;o<a?t.today.push(e):o<6048e5?t.week.push(e):o<2592e6&&t.month.push(e)}})),r(t)}
1)).catch((function(e){return st.Rt.error("Error loading Near-Real-Time datasets",e)}))}),[]),(0,S.jsx)(Er,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Zr(Object(n),!0).forEach((function(t){(0,a.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Zr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({datasets:n},e))};Tr.defaultProps={datasetID:null};var Lr=(0,d.connect)((function(e){return{selectedDataset:e.explore.datasets.selected}}),p)(Tr),_r=n(8676),Rr=function(e){var t=e.userToken,n=(0,_r.K7)([t],{initialData:[],initialStale:!0}).data,r=(0,u.useMemo)((function(){return n.filter((function(e){return"dataset"===e.resourceType}))}),[n]),a=(0,u.useMemo)((function(){return r.map((function(e){return e.resourceId}))}),[r]),o=(0,Or.Z)({ids:a.join(","),includes:"widget,metadata,layer,vocabulary",env:"production"},{enabled:!!a.length,initialData:[],initialStale:!0,keepPreviousData:!0}),s=o.data,i=o.isFetchedAfterMount;return(0,S.jsxs)("div",{className:"c-explore-favorites",children:[!i&&!s.length&&(0,S.jsx)(pe.Z,{isLoading:!0,className:"-light"}),(0,S.jsx)(Ge,{list:s,actions:(0,S.jsx)($e,{})}),i&&!s.length&&(0,S.jsxs)("div",{className:"no-datasets",children:[(0,S.jsx)(kr.Z,{}),(0,S.jsxs)("div",{className:"message",children:[(0,S.jsx)("h5",{children:"You currently have no favorite datasets"}),(0,S.jsxs)("p",{children:["To favorite a dataset or start a collection, click the \xa0",(0,S.jsx)(w.Z,{name:"icon-star-full",className:"-star -small"}),"\xa0 on any dataset card."]})]}),(0,S.jsx)(kr.Z,{}),(0,S.jsx)(kr.Z,{})]})]})},Ir=(0,d.connect)((function(e){return{userToken:e.user.token}}),null)(Rr),Mr=n(7301),Fr=n(42622);function Ur(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Vr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ur(Object(n),!0).forEach((function(t){(0,a.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ur(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var zr=function(){var e=(0,Mr.P)().data,t=(0,u.useState)({email:(null===e||void 0===e?void 0:e.email)||""}),n=t[0],r=t[1],a=(0,u.useCallback)((function(e){r(Vr(Vr({},n),{email:e}))}),[n]);return(0,S.jsxs)("div",{className:"c-explore-my-data-coming-soon",children:[(0,S.jsx)(kr.Z,{}),(0,S.jsxs)("div",{className:"card-coming-soon",children:[(0,S.jsxs)("h4",{children:["Would you like to see your data on\xa0",(0,S.jsx)("br",{}),"Resource Watch?"]}),(0,S.jsx)("p",{children:"We are exploring ways to let you bring your data to the platform. Would you use this feature? Let us know."}),(0,S.jsxs)("form",{id:"my-data-sign-up",className:"c-form my-data-form",action:Fr.Y$,children:[(0,S.jsx)(At.Z,{validations:["required","email"],className:"-fluid",onChange:a,properties:{name:"email",label:"Email",type:"email",default:n.email,placeholder:"Your email address",disabled:!(null===e||void 0===e||!e.email),required:!0},children:ir.Z}),(0,S.jsx)(At.Z,{className:"-pi-hidden",properties:{name:"pi_extra_field",label:"Comments",type:"text",required:!1},children:ir.Z}),(0,S.jsx)("button",{type:"submit",className:"c-button -primary -compressed",children:"I'm interested"})]})]}),(0,S.jsx)(kr.Z,{}),(0,S.jsx)(kr.Z,{})]})},qr=["cartodb","gee"];function Gr(){var e=(0,Mr.P)().data,t=(0,Or.D)({userId:null===e||void 0===e?void 0:e.id,application:"rw",includes:"layer,metadata",env:"production"},{enabled:!(null===e||void 0===e||!e.id),refetchOnWindowFocus:!1,initialData:[],initialStale:!0}),n=t.data,r=t.isFetching,a=(0,u.useMemo)((function(){return n.filter((function(e){var t=e.layer,n=e.provider;return t.length>0&&qr.includes(n)}))}),[n]);return(0,S.jsxs)("div",{className:"c-explore-my-data",children:[r&&(null===e||void 0===e?void 0:e.id)&&(0,S.jsx)(pe.Z,{className:"-light",isLoading:!0}),!r&&a.length>0&&(0,S.jsx)(Ge,{list:a,actions:(0,S.jsx)($e,{})}),(!r&&!a.length||!(null!==e&&void 0!==e&&e.id))&&(0,S.jsx)(zr,{})]})}var Kr=function(e){var t=e.explore,r=t.datasets.selected,a=t.sidebar,o=a.section,s=a.subsection,i=t.map.drawer.isDrawing,c=e.userIsLoggedIn,l=e.stopDrawing,d=e.dataset,f=(0,u.useState)(!0),p=f[0],h=f[1],v=(0,u.useState)(null),j=v[0],x=v[1],O=(0,u.useCallback)((function(){l()}),[l]),w=(0,u.useMemo)((function(){return[z.of.COLLECTIONS,z.of.FAVORITES,z.of.AREAS_OF_INTEREST].includes(o)}),[o]),k=function(){return(0,S.jsxs)(S.Fragment,{children:[!s&&!r&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(B,{}),(0,S.jsxs)("div",{className:"explore-sidebar-content",id:"sidebar-content-container",children:[o===z.of.ALL_DATA&&(0,S.jsx)(at,{}),o===z.of.TOPICS&&(0,S.jsx)(Wn,{}),o===z.of.COLLECTIONS&&c&&(0,S.jsx)(Sr,{}),o===z.of.FAVORITES&&c&&(0,S.jsx)(Ir,{}),w&&!c&&(0,S.jsx)(Pr,{}),o===z.of.DISCOVER&&(0,S.jsx)(Dr,{}),o===z.of.NEAR_REAL_TIME&&(0,S.jsx)(Lr,{}),o===z.of.AREAS_OF_INTEREST&&c&&(0,S.jsx)(tr,{}),o===z.of.MY_DATA&&(0,S.jsx)(Gr,{})]},o)]}),r&&(0,S.jsx)(qn,{onDatasetLoaded:function(e){return x(e)}},r),!r&&s===z.Iu.NEW_AREA&&(0,S.jsx)(xr,{})]})},P=(0,u.useMemo)((function(){return null!==d&&void 0!==d&&d.slug&&z.gw.includes(null===d||void 0===d?void 0:d.slug)?g()((function(){return n(28330)("./".concat(d.slug.toLowerCase()))}),{loadableGenerated:{webpack:function(){return[n(72990).resolve("./".concat(d.slug.toLowerCase()))]}}}):null}),[d]),N=j&&j.metadata&&j.metadata[0],C=N&&N.info,D=r?C&&C.name:"",E=r?C&&C.functions:"Browse more than 200 global data sets on the state of our planet.";return(0,S.jsxs)(m.Z,{title:D,description:E,className:"-fullscreen",isFullScreen:!0,children:[P&&(0,S.jsx)(P,{}),(0,S.jsxs)(b(),{children:[d&&!(null!==d&&void 0!==d&&d.published)&&(0,S.jsx)("meta",{name:"robots",content:"noindex, follow"}),d&&(0,S.jsx)("link",{rel:"canonical",href:"https://resourcewatch.org/data/explore/".concat(d.slug)})]}),(0,S.jsxs)("div",{className:"c-page-explore",children:[(0,S.jsx)(ge.pU,{greaterThanOrEqual:"md",className:"flex flex-1",children:(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(A,{children:k()},o),i&&(0,S.jsx)("div",{className:"clear-polygon-container",children:(0,S.jsx)("button",{type:"button",onClick:O,className:"c-btn -primary -alt",children:"Clear Polygon"})}),(0,S.jsx)(ot.Z,{})]})}),(0,S.jsx)(ge.pU,{at:"sm",className:"flex flex-1",children:(0,S.jsxs)(S.Fragment,{children:[k(),(0,S.jsx)(y.Z,{isOpen:p,onRequestClose:function(){return h(!1)},children:(0,S.jsx)("div",{children:(0,S.jsx)("p",{children:"The mobile version of Explore has limited functionality, please check the desktop version to have access to the full list of features available."})})})]})})]})]})};function Wr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var Br=(0,d.connect)((function(e,t){return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};
1t%2?Wr(Object(n),!0).forEach((function(t){(0,a.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({explore:e.explore,userIsLoggedIn:!!e.user.id},t)}),p)(Kr);function Yr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Qr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Yr(Object(n),!0).forEach((function(t){(0,a.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Yr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Hr(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,l.Z)(e);if(t){var a=(0,l.Z)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return(0,c.Z)(this,n)}}var Jr=function(e){(0,i.Z)(n,e);var t=Hr(n);function n(){return(0,o.Z)(this,n),t.apply(this,arguments)}return(0,s.Z)(n,[{key:"componentDidUpdate",value:function(e){this.shouldUpdateUrl(e)&&this.setExploreURL()}},{key:"componentWillUnmount",value:function(){(0,this.props.resetExplore)()}},{key:"setExploreURL",value:function(){var e=this.props,t=e.explore,n=t.datasets,r=t.filters,a=t.sort,o=t.map,s=o.viewport,i=o.basemap,c=o.labels,l=o.boundaries,u=o.layerGroups,d=o.aoi,f=t.sidebar,p=f.anchor,h=f.section,b=f.selectedCollection,v=e.router,g=Qr(Qr(Qr(Qr(Qr(Qr(Qr(Qr(Qr({},!!n&&n.selected&&{dataset:n.selected}),!!p&&{hash:p}),{},{section:h,selectedCollection:b,zoom:s.zoom,lat:s.latitude,lng:s.longitude,pitch:s.pitch,bearing:s.bearing,basemap:i,labels:c},!!l&&{boundaries:l}),!!u.length&&{layers:encodeURIComponent(JSON.stringify(u.map((function(e){return{dataset:e.dataset,opacity:e.opacity||1,visible:e.visible,layer:e.layers.find((function(e){return!0===e.active})).id}}))))}),{},{aoi:d,page:n.page,sort:a.selected,sortDirection:a.direction},r.search&&{search:r.search}),!!r.selected.topics.length&&{topics:encodeURIComponent(JSON.stringify(r.selected.topics))}),!!r.selected.data_types.length&&{data_types:encodeURIComponent(JSON.stringify(r.selected.data_types))}),!!r.selected.frequencies.length&&{frequencies:encodeURIComponent(JSON.stringify(r.selected.frequencies))}),!!r.selected.time_periods.length&&{time_periods:encodeURIComponent(JSON.stringify(r.selected.time_periods))});v.replace({pathname:"/data/explore/[[...dataset]]",query:g},{},{shallow:!0})}},{key:"shouldUpdateUrl",value:function(e){var t=this.props.explore,n=t.datasets,r=t.filters,a=t.sort,o=t.map,s=e.explore,i=s.datasets,c=s.filters,l=s.sort,u=s.map,d=encodeURIComponent(JSON.stringify(o.layerGroups.map((function(e){return{dataset:e.dataset,opacity:e.opacity||1,visible:e.visible,layer:e.layers.find((function(e){return!0===e.active})).id}})))),f=encodeURIComponent(JSON.stringify(u.layerGroups.map((function(e){return{dataset:e.dataset,opacity:e.opacity||1,visible:e.visible,layer:e.layers.find((function(e){return!0===e.active})).id}}))));return o.viewport.zoom!==u.viewport.zoom||o.viewport.latitude!==u.viewport.latitude||o.viewport.longitude!==u.viewport.longitude||o.viewport.pitch!==u.viewport.pitch||o.viewport.bearing!==u.viewport.bearing||o.basemap!==u.basemap||o.labels.id!==u.labels.id||o.boundaries!==u.boundaries||d!==f||o.aoi!==u.aoi||n.selected!==i.selected||n.page!==i.page||a.selected!==l.selected||a.direction!==l.direction||r.search!==c.search||r.selected.topics.length!==c.selected.topics.length||r.selected.data_types.length!==c.selected.data_types.length||r.selected.frequencies.length!==c.selected.frequencies.length||r.selected.time_periods.length!==c.selected.time_periods.length}},{key:"render",value:function(){return(0,S.jsx)(Br,Qr({},this.props))}}]),n}(u.PureComponent),Xr=!0,$r=(0,d.connect)((function(e,t){return Qr({explore:e.explore},t)}
1),Qr({},p))((0,f.withRouter)(Jr))},36125:function(e,t,n){"use strict";n.d(t,{dc:function(){return i},w0:function(){return s}});var r=n(9669),a=n.n(r),o=n(51756),s=function(){return new Promise((function(e,t){o.k.info("Fetch RW config"),a().get("https://raw.githubusercontent.com/resource-watch/resource-watch/develop/public/static/data/ExploreConfig.json").then((function(t){return e(t.data)})).catch((function(e){return t(new Error("There was an error loading the Explore config",e))}))}))},i=function(){return new Promise((function(e,t){o.k.info("Fetch Country Power Explorer config"),a().get("https://raw.githubusercontent.com/resource-watch/resource-watch/develop/public/static/data/CountryEnergyExplorer.json").then((function(t){return e(t.data)})).catch((function(e){return t(new Error("There was an error loading the Country Power Explorer config: ".concat(e)))}))}))}},10698:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/data/explore/[[...dataset]]",function(){return n(69447)}])},70131:function(e,t,n){"use strict";n.d(t,{YD:function(){return h}});var r=n(67294);function a(){return a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a.apply(this,arguments)}function o(e,t){return o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},o(e,t)}var s=new Map,i=new WeakMap,c=0;function l(e){return Object.keys(e).sort().filter((function(t){return void 0!==e[t]})).map((function(t){return t+"_"+("root"===t?(n=e.root)?(i.has(n)||(c+=1,i.set(n,c.toString())),i.get(n)):"0":e[t]);var n})).toString()}function u(e,t,n){if(void 0===n&&(n={}),!e)return function(){};var r=function(e){var t=l(e),n=s.get(t);if(!n){var r,a=new Map,o=new IntersectionObserver((function(t){t.forEach((function(t){var n,o=t.isIntersecting&&r.some((function(e){return t.intersectionRatio>=e}));e.trackVisibility&&"undefined"===typeof t.isVisible&&(t.isVisible=o),null==(n=a.get(t.target))||n.forEach((function(e){e(o,t)}))}))}),e);r=o.thresholds||(Array.isArray(e.threshold)?e.threshold:[e.threshold||0]),n={id:t,observer:o,elements:a},s.set(t,n)}return n}(n),a=r.id,o=r.observer,i=r.elements,c=i.get(e)||[];return i.has(e)||i.set(e,c),c.push(t),o.observe(e),function(){c.splice(c.indexOf(t),1),0===c.length&&(i.delete(e),o.unobserve(e)),0===i.size&&(o.disconnect(),s.delete(a))}}var d=["children","as","tag","triggerOnce","threshold","root","rootMargin","onChange","skip","trackVisibility","delay","initialInView"];function f(e){return"function"!==typeof e.children}var p=function(e){var t,n;function s(t){var n;return(n=e.call(this,t)||this).node=null,n._unobserveCb=null,n.handleNode=function(e){n.node&&(n.unobserve(),e||n.props.triggerOnce||n.props.skip||n.setState({inView:!!n.props.initialInView,entry:void 0})),n.node=e||null,n.observeNode()},n.handleChange=function(e,t){e&&n.props.triggerOnce&&n.unobserve(),f(n.props)||n.setState({inView:e,entry:t}),n.props.onChange&&n.props.onChange(e,t)},n.state={inView:!!t.initialInView,entry:void 0},n}n=e,(t=s).prototype=Object.create(n.prototype),t.prototype.constructor=t,o(t,n);var i=s.prototype;return i.componentDidUpdate=function(e){e.rootMargin===this.props.rootMargin&&e.root===this.props.root&&e.threshold===this.props.threshold&&e.skip===this.props.skip&&e.trackVisibility===this.props.trackVisibility&&e.delay===this.props.delay||(this.unobserve(),this.observeNode())},i.componentWillUnmount=function(){this.unobserve(),this.node=null},i.observeNode=function(){if(this.node&&!this.props.skip){var e=this.props,t=e.threshold,n=e.root,r=e.rootMargin,a=e.trackVisibility,o=e.delay;this._unobserveCb=u(this.node,this.handleChange,{threshold:t,root:n,rootMargin:r,trackVisibility:a,delay:o})}},i.unobserve=function(){this._unobserveCb&&(this._unobserveCb(),this._unobserveCb=null)},i.render=function(){if(!f(this.props)){var e=this.state,t=e.inView,n=e.entry;return this.props.children({inView:t,entry:n,ref:this.handleNode})}var o=this.props,s=o.children,i=o.as,c=o.tag,l=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(o,d);return r.createElement(i||c||"div",a({ref:this.handleNode},l),s)},s}(r.Component);function h(e){var t=void 0===e?{}:e,n=t.threshold,a=t.delay,o=t.trackVisibility,s=t.rootMargin,i=t.root,c=t.triggerOnce,l=t.skip,d=t.initialInView,f=r.useRef(),p=r.useState({inView:!!d}),h=p[0],b=p[1],v=r.useCallback((function(e){void 0!==f.current&&(f.current(),f.current=void 0),l||e&&(f.current=u(e,(function(e,t){b({inView:e,entry:t}),t.isIntersecting&&c&&f.current&&(f.current(),f.current=void 0)}),{root:i,rootMargin:s,threshold:n,trackVisibility:o,delay:a}))}),[Array.isArray(n)?n.toString():n,i,s,c,l,o,a]);(0,r.useEffect)((function(){f.current||!h.entry||c||l||b({inView:!!d})}));var g=[v,h.inView,h.entry];return g.ref=g[0],g.inView=g[1],g.entry=g[2],g}p.displayName="InView",p.defaultProps={threshold:0,triggerOnce:!1,initialInView:!1}},28330:function(e,t,n){var r={"./foo065brw1-global-cropland-change":[42643,2643],"./foo065brw1-global-cropland-change.tsx":[42643,2643],"./gender-gap-index-2":[58105,8105],"./gender-gap-index-2.tsx":[58105,8105],"./gini-index":[2789,3200],"./gini-index.tsx":[2789,3200],"./material-extraction-trade-and-use":[71890,1890],"./material-extraction-trade-and-use.tsx":[71890,1890],"./population-exposed-to-unhealthy-levels-of-pm-25":[4771,4771],"./population-exposed-to-unhealthy-levels-of-pm-25.tsx":[4771,4771],"./soc-003-2015-gridded-infant-mortality":[31632,1632],"./soc-003-2015-gridded-infant-mortality.tsx":[31632,1632],"./soc025-gender-inequality-index":[58043,8043],"./soc025-gender-inequality-index.tsx":[58043,8043],"./trees-in-mosaic-landscapes":[90622,622],"./trees-in-mosaic-landscapes.tsx":[90622,622],"./wetlands-and-waterbodies":[52398,2398],"./wetlands-and-waterbodies.tsx":[52398,2398]};function a(e){if(!n.o(r,e))return Promise.resolve().then((function(){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=r[e],a=t[0];return n.e(t[1]).then((function(){return n(a)}))}a.keys=function(){return Object.keys(r)},a.id=28330,e.exports=a},72990:function(e,t,n){var r={"./foo065brw1-global-cropland-change":42643,"./foo065brw1-global-cropland-change.tsx":42643,"./gender-gap-index-2":58105,"./gender-gap-index-2.tsx":58105,"./gini-index":2789,"./gini-index.tsx":2789,"./material-extraction-trade-and-use":71890,"./material-extraction-trade-and-use.tsx":71890,"./population-exposed-to-unhealthy-levels-of-pm-25":4771,"./population-exposed-to-unhealthy-levels-of-pm-25.tsx":4771,"./soc-003-2015-gridded-infant-mortality":31632,"./soc-003-2015-gridded-infant-mortality.tsx":31632,"./soc025-gender-inequality-index":58043,"./soc025-gender-inequality-index.tsx":58043,"./trees-in-mosaic-landscapes":90622,"./trees-in-mosaic-landscapes.tsx":90622,"./wetlands-and-waterbodies":52398,"./wetlands-and-waterbodies.tsx":52398};function a(e){var t=o(e);if(!n.m[t]){var r=new Error("Module '"+e+"' ('"+t+"') is not available (weak dependency)");throw r.code="MODULE_NOT_FOUND",r}return n(t)}function o(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}a.keys=function(){return Object.keys(r)},a.resolve=o,a.id=72990,e.exports=a}}
1,function(e){e.O(0,[7789,641,5324,3003,6820,5920,2626,2507,9774,2888,179],(function(){return t=10698,e(e.s=t);var t}));var t=e.O();_N_E=t}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.