PageSourceSearch

https://resourcewatch.org/_next/static/chunks/2790-10e6d6f339363466.js

js resourcewatch.org collected 2026-09-24 08:55:06 UTC 9,863 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2790],{35447:function(e,t,n){var r=n(92777),o=n(82262),a=n(10748),i=n(45959),c=n(63553),s=n(37247),u=(n(94301),n(67294),n(45697)),l=n.n(u),p=n(63003),f=n(77677),h=n(12654),g=n(85893);function d(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,s.Z)(e);if(t){var o=(0,s.Z)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,c.Z)(this,n)}}var v=function(e){(0,i.Z)(n,e);var t=d(n);function n(e){var o;(0,r.Z)(this,n),o=t.call(this,e);var i=e.properties.default,c="".concat(i||""),s=e.getUrlImage;return o.state={value:i&&!s?o.getBase64FromURL(c):"",accepted:i?[{name:i,preview:c}]:[],rejected:[],dropzoneActive:!1,loading:!1},o.triggerBrowseOrCancel=o.triggerBrowseOrCancel.bind((0,a.Z)(o)),o.onDragEnter=o.onDragEnter.bind((0,a.Z)(o)),o.onDragLeave=o.onDragLeave.bind((0,a.Z)(o)),o.onDrop=o.onDrop.bind((0,a.Z)(o)),o}return(0,o.Z)(n,[{key:"onDragEnter",value:function(){this.setState({dropzoneActive:!0})}},{key:"onDragLeave",value:function(){this.setState({dropzoneActive:!1})}},{key:"onDrop",value:function(e,t){var n=this;this.setState({accepted:e,rejected:t,dropzoneActive:!1},(function(){if(e.length)switch(n.props.mode){case"image":default:n.getBase64(e[0]);break;case"url":n.props.getUrlImage(e[0]).then((function(e){n.setState({value:e},(function(){n.props.onChange&&n.props.onChange(n.state.value),n.triggerValidate()}))}))}}))}},{key:"getBase64",value:function(e){var t=this,n=new FileReader;n.readAsDataURL(e),n.onload=function(){t.setState({value:n.result},(function(){t.props.onChange&&t.props.onChange(t.state.value),t.triggerValidate()}))},n.onerror=function(e){t.setState({value:"",error:e},(function(){t.props.onChange&&t.props.onChange(t.state.value),t.triggerValidate()}))}}},{key:"getBase64FromURL",value:function(e){var t=this,n=new XMLHttpRequest;n.open("get",e),n.responseType="blob",n.onload=function(){t.getBase64(n.response)},n.send()}},{key:"triggerBrowseOrCancel",value:function(){var e=this;this.state.accepted.length?this.setState({accepted:[],value:""},(function(){e.props.onChange&&e.props.onChange(e.state.value),e.triggerValidate()})):this.dropzone.open()}},{key:"triggerChange",value:function(e){var t=this;this.setState({value:e.currentTarget.value},(function(){t.props.onChange&&t.props.onChange(t.state.value),t.triggerValidate()}))}},{key:"getFileImageName",value:function(){var e=this.state.accepted;return e.length?e[0].name:"Select file to upload"}},{key:"render",value:function(){var e=this,t=this.props.properties,n=this.state.accepted;return(0,g.jsx)("div",{className:"c-file-image",children:(0,g.jsxs)(p.Z,{accept:".jpg,.jpeg,.png",ref:function(t){e.dropzone=t},className:"file-dropzone",disableClick:!0,multiple:!1,onDrop:this.onDrop,onDragEnter:this.onDragEnter,onDragLeave:this.onDragLeave,children:[!n.length&&(0,g.jsx)("div",{className:"file-placeholder",onClick:this.triggerBrowseOrCancel,children:t.placeholder}),!!n.length&&n[0].preview&&(0,g.jsxs)("div",{className:"file-preview",children:[(0,g.jsx)("img",{className:"file-image",src:n[0].preview,alt:n[0].name}),(0,g.jsx)("button",{onClick:this.triggerBrowseOrCancel,className:"file-button c-button",children:(0,g.jsx)(f.Z,{name:"icon-cross",className:"-small"})})]})]})})}}]),n}(h.Z);v.propTypes={properties:l().object.isRequired,validations:l().array,onChange:l().func},t.Z=v},13345:function(e,t,n){n.d(t,{Z:function(){return C}});var r=n(92777),o=n(82262),a=n(10748),i=n(45959),c=n(63553),s=n(37247),u=n(59499),l=n(67294),p=n(94184),f=n.n(p),h=n(85893);function g(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 d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};
1t%2?g(Object(n),!0).forEach((function(t){(0,u.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function v(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,s.Z)(e);if(t){var o=(0,s.Z)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,c.Z)(this,n)}}var y=function(e){(0,i.Z)(n,e);var t=v(n);function n(e){var o;return(0,r.Z)(this,n),(o=t.call(this,e)).triggerClick=o.triggerClick.bind((0,a.Z)(o)),o.triggerMouseOver=o.triggerMouseOver.bind((0,a.Z)(o)),o.triggerMouseOut=o.triggerMouseOut.bind((0,a.Z)(o)),o}return(0,o.Z)(n,[{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.setState({className:e.className})}},{key:"triggerClick",value:function(e){this.props.onClick(e)}},{key:"triggerMouseOver",value:function(e){this.props.onMouseOver(e)}},{key:"triggerMouseOut",value:function(e){this.props.onMouseOut(e)}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.properties,r=e.onClick,o=e.onMouseOver,a=e.onMouseOut;return e.disabled?(0,h.jsx)("button",d(d({},n),{},{disabled:!0,className:"c-button ".concat(n.className||""),children:t})):(0,h.jsx)("button",d(d({},n),{},{className:"c-button ".concat(n.className||""),onClick:r?this.triggerClick:null,onMouseOver:o?this.triggerMouseOver:null,onMouseOut:a?this.triggerMouseOut:null,children:t}))}}]),n}(l.Component);(0,u.Z)(y,"defaultProps",{properties:{}});var m=y,b=n(52202);function O(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,s.Z)(e);if(t){var o=(0,s.Z)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,c.Z)(this,n)}}var j=function(e){(0,i.Z)(n,e);var t=O(n);function n(e){var o;return(0,r.Z)(this,n),(o=t.call(this,e)).onStepChange=o.onStepChange.bind((0,a.Z)(o)),o.onBack=o.onBack.bind((0,a.Z)(o)),o}return(0,o.Z)(n,[{key:"onStepChange",value:function(e){e.preventDefault(),this.props.onStepChange&&this.props.onStepChange(this.props.step-1)}},{key:"onBack",value:function(e){e.preventDefault();var t=this.props.onBack;return t?t():window.history.go(-1)}},{key:"render",value:function(){var e=this.props,t=e.step,n=e.stepLength,r=e.submitting,o=e.hideCancel,a=e.showDelete,i=e.onDelete,c=e.disabled,s=f()({"-submitting":r});return(0,h.jsxs)("ul",{className:f()({"c-field-buttons":!0,"-disabled":c}),children:[a&&(0,h.jsx)("li",{className:"c-button-container -full-width",children:(0,h.jsx)(m,{properties:{type:"button",name:"commit",className:"-secondary -expanded"},onClick:i,children:"Delete"})}),1!==t&&(0,h.jsx)("li",{children:(0,h.jsx)(m,{properties:{type:"button",name:"commit",className:"-secondary -expanded"},onClick:this.onStepChange,children:"Back"})}),t!==n&&(0,h.jsx)("li",{children:(0,h.jsx)(m,{properties:{type:"submit",name:"commit",className:"-primary -expanded"},children:"Next"})}),1===n&&!o&&(0,h.jsx)("li",{children:(0,h.jsx)(m,{properties:{type:"button",name:"commit",className:"-secondary -expanded"},onClick:this.onBack,children:"Cancel"})}),t===n&&(0,h.jsx)("li",{children:(0,h.jsxs)(m,{properties:{type:"submit",name:"commit",disabled:r,className:"-primary -expanded ".concat(s)},children:[r&&(0,h.jsx)(b.Z,{className:"-small -transparent -white-icon",isLoading:r}),"Save"]})})]})}}]),n}(l.PureComponent);(0,u.Z)(j,"defaultProps",{hideCancel:!1,showDelete:!1,disabled:!1,onBack:null,onDelete:null});var C=j},14197:function(e,t,n){var r=n(59499),o=n(92777),a=n(82262),i=n(45959),c=n(63553),s=n(37247),u=(n(67294),n(45697)),l=n.n(u),p=n(12654),f=n(85893);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 g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};
1t%2?h(Object(n),!0).forEach((function(t){(0,r.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function d(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,s.Z)(e);if(t){var o=(0,s.Z)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,c.Z)(this,n)}}var v=function(e){(0,i.Z)(n,e);var t=d(n);function n(){return(0,o.Z)(this,n),t.apply(this,arguments)}return(0,a.Z)(n,[{key:"triggerChange",value:function(e){var t=this;this.setState({value:e.currentTarget.value},(function(){t.triggerValidate(),t.props.onChange&&t.props.onChange(t.state.value)}))}},{key:"render",value:function(){var e=this.props.properties;return(0,f.jsx)("textarea",g(g({},e),{},{value:this.state.value,id:"input-".concat(e.name),onChange:this.triggerChange}))}}]),n}(p.Z);v.propTypes={properties:l().object.isRequired,validations:l().array,onChange:l().func},t.Z=v}}]);

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.