1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9195],{3613:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/blog",function(){return n(55436)}])},50575:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(27378),a=n(31542);function i(e){let{children:t,selector:n}=e,i=(0,r.useRef)(),[s,l]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{i.current=document.querySelector(n),l(!0)},[n]),s?(0,a.createPortal)(t,i.current):null}},56317:function(e,t,n){"use strict";function r(e){let{src:t,width:n,quality:r}=e;return"".concat(t,"?auto=format&w=").concat(n,"&q=").concat(r||75,"&fit=max")}n.d(t,{Z:function(){return r}})},55436:function(e,t,n){"use strict";n.r(t),n.d(t,{__N_SSG:function(){return v},default:function(){return _}});var r=n(24246),a=n(27378),i=n(55331),s=n(72456),l=n(42803),c=n(20298),o=n(50575),u=n(90599),d=n(25250);let m=e=>{let{topics:t,filters:n}=e,[i,s]=(0,a.useState)();return(0,r.jsxs)("div",{className:"c-modal".concat(i?" open":""),children:[(0,r.jsx)(u.Av,{className:"c-btn c-btn--primary",onClick:()=>s(!0),text:"Filter by topic",modifier:"sec"}),i&&(0,r.jsx)(g,{title:"Filter by topic",options:t,setOpen:s,filters:n})]})},g=e=>{let t=(0,i.useDispatch)(),{title:n="",options:l,setOpen:c,filters:m}=e,[g,f]=(0,a.useState)(m),h=(0,a.useRef)();(0,d.t)(h,()=>c(!1)),(0,d.N)();let p=(e,t)=>{let n=[...g];e.target.checked?n.push(t):n.splice(n.indexOf(t),1),f(n)};return(0,r.jsx)(o.Z,{selector:"#modal",children:(0,r.jsx)("aside",{className:"c-modal__cover","aria-modal":"true",tabIndex:"-1",role:"dialog",onKeyDown:e=>{27===e.keyCode&&c(!1)},children:(0,r.jsxs)("div",{className:"c-modal__area c-modal--filters",ref:h,children:[(0,r.jsxs)("div",{className:"c-modal__top",children:[(0,r.jsx)("h3",{className:"c-modal__title",children:n}),(0,r.jsx)(u.PZ,{onClick:e=>c(!1)})]}),(0,r.jsx)("hr",{className:"u-section-underline--no-margins"}),(0,r.jsx)("div",{className:"c-modal__content",children:(0,r.jsx)("div",{className:"c-modal__list",children:l&&l.map((e,t)=>(0,r.jsxs)("label",{className:"c-modal__label",children:[(0,r.jsx)("input",{className:"c-modal__input",onChange:t=>p(t,e),type:"checkbox",checked:g.some(t=>t.title===e.title),name:e.title}),(0,r.jsx)("span",{className:"c-modal__custom-checkbox"}),(0,r.jsx)("span",{className:"c-modal__label-title",children:e.title})]},t))})}),(0,r.jsxs)("div",{className:"c-modal__bottom",children:[(0,r.jsx)("hr",{className:"u-section-underline--no-margins"}),(0,r.jsxs)("div",{className:"c-modal__controls",children:[g.length<1?(0,r.jsx)(u.Av,{text:"Clear",modifier:"qua--disabled"}):(0,r.jsx)(u.Av,{onClick:e=>f([]),text:"Clear",modifier:"qua"}),(0,r.jsx)(u.Av,{onClick:()=>{t((0,s.ms)(g)),t((0,s.bt)(1)),c(!1)},text:"Apply",modifier:"pri"})]})]})]})})})};var f=n(273),h=n(88632);let p=(e,t)=>e.length?t.filter(t=>{if(t.topics)return!!t.topics.find(t=>e.find(e=>e.title===t.title))}):t,x=e=>{let{blogEntries:t=[],topics:n=[]}=e,l=(0,i.useDispatch)(),c=(0,i.useSelector)(e=>e.blogPageNum),o=(0,i.useSelector)(e=>e.blogFilters),[d,g]=(0,a.useState)([]),[x,b]=(0,a.useState)([]),j=0===o.length?12:9,v=(c-1)*j,_=d.length?d.length:x.length*j;(0,a.useEffect)(()=>{-1===window.location.search.indexOf("blogPageNum")&&l((0,s.bt)(1))},[]);let P=e=>{l((0,s.$B)(e)),l((0,s.bt)(1))};return(0,a.useEffect)(()=>{g(p(o,t))},[o]),(0,a.useEffect)(()=>{b(d.slice(v,v+j))},[d,v]),(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"c-blog-index__filters ".concat(o.length?"c-blog-index__filters--active":""),children:[(0,r.jsx)(m,{topics:n,filters:o}),(0,r.jsx)("div",{className:"c-blog-index__filters-set",children:o.map((e,t)=>(0,r.jsxs)("div",{className:"c-blog-index__tag-container",children:[(0,r.jsx)("div",{className:"c-blog-index__tag",children:e.title}),(0,r.jsx)(u.PZ,{onClick:()=>P(t),text:"Remove all",modifier:"ter"})]},t))}),o.length?(0,r.jsx)("div",{className:"c-blog-index__filters-info",children:(0,r.jsx)("h5",{children:"".concat(d.length," Blog articles")})}):(0,r.jsx)("div",{className:"c-blog-index__filters--none",children:(0,r.jsx)("h5",{children:"".concat(t.length," Blog articles")})})]}),x?(0,r.jsx)("div",{className:"c-blog-index__list",children:x.map((e,t)=>(0,r.jsx)(h.S,{post:e,type:h.J.BLOG,slug:e.slug},t))}):null,(0,r.jsx)(f.Q,{total:_,limit:j,currentPage:c})]})};var b=n(33134);let j=(0,s.N2)();var v=!0,_=e=>{let{data:{blogEntries:t=[],topics:n=[],publications:a=[]}}=e;return(0,r.jsx)(i.Provider,{store:j,children:(0,r.jsxs)(l.A,{hideLogo:!1,headComponentConfig:{title:"Blog",description:"Practitioners, policymakers, activists, and academics
1share insights on how to build a sustainable and inclusive future by curbing corruption.",url:"https://www.u4.no/blog",image:t.ImageUrl||"https://cdn.sanity.io/images/1f1lcoov/production/3e59eddc41cd02132774902dd229b24e55dbfcb5-1000x207.png"},children:[(0,r.jsxs)("div",{className:"c-blog-index",children:[(0,r.jsx)("section",{className:"o-wrapper-medium",children:(0,r.jsx)(b.O,{className:"c-page-intro--about-u4",title:"The U4 Blog",type:"about-u4",text:"Practitioners, policymakers, activists, and academics share insights on how to build a sustainable and inclusive future by curbing corruption."})}),(0,r.jsx)("hr",{className:"u-section-underline--no-margins"}),(0,r.jsx)("section",{className:"o-wrapper-medium",children:(0,r.jsx)(x,{blogEntries:t,topics:n})})]}),(0,r.jsx)("div",{id:"modal"}),(0,r.jsx)(c.Z,{})]})})}},82698:function(e,t){"use strict";t.rx=function(e,t){return[...Array(t-e+1)].map((t,n)=>e+n)},t.UM=function(e){let{limit:t,pageCount:n,total:r,page:a}=e,i=Math.ceil(r/t),s=a;s<1&&(s=1),s>i&&(s=i);let l=Math.max(1,s-Math.floor(n/2)),c=Math.min(i,s+Math.floor(n/2));c-l+1<n&&(s<i/2?c=Math.min(i,c+(n-(c-l))):l=Math.max(1,l-(n-(c-l)))),c-l+1>n&&(s>i/2?l+=1:c-=1);let o=Math.min(c-l+1,i),u=s-1,d=s+1,m=s>1,g=s<i,f=t*(s-1),h=t*s-1;return{totalPages:i,pages:o,currentPage:s,firstPage:l,lastPage:c,previousPage:u,nextPage:d,hasPreviousPage:m,hasNextPage:g,totalResults:r,results:Math.min(h-f+1,r),firstResult:f,lastResult:h}}},89016:function(e,t,n){"use strict";var r=n(27378),a=n(23615),i=n.n(a),s=n(82698);function l(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 c(e){var t,n=function(e){if(Array.isArray(e))return e}(t=(0,r.useState)(1))||function(e,t){var n=[],r=!0,a=!1,i=void 0;try{for(var s,l=e[Symbol.iterator]();!(r=(s=l.next()).done)&&(n.push(s.value),2!==n.length);r=!0);}catch(e){a=!0,i=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw i}}return n}(t,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance")}(),a=n[0],i=n[1];e.currentPage&&a!==e.currentPage&&i(parseInt(e.currentPage,10));var c=e.total,o=e.limit,u=e.pageCount,d=e.className,m=(0,s.UM)({limit:o,pageCount:u,total:c,page:a}),g=m.firstPage,f=m.lastPage,h=m.hasNextPage,p=m.hasPreviousPage,x=m.previousPage,b=m.nextPage,j=m.totalPages,v=c>0?(0,s.rx)(g,f):[];return r.createElement("div",{className:d},e.children({pages:v,previousPage:x,nextPage:b,totalPages:j,currentPage:a,hasNextPage:h,hasPreviousPage:p,getPageItemProps:function(e){var t=e.pageValue,n=e.onPageChange;return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(n,!0).forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({onClick:function(e){"function"==typeof n&&n(t,e),i(t)}},function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,["pageValue","onPageChange"]))}}))}c.propTypes={total:i().number.isRequired,className:i().string,limit:i().number,pageCount:i().number,currentPage:i().number,pageValue:i().number,children:i().func.isRequired,onPageChange:i().func},c.defaultProps={limit:10,pageCount:5,currentPage:0,pageValue:0},t.Z=c}},function(e){e.O(0,[5288,2508,6813,8579,1048,7813,273,2888,9774,179],function(){return e(e.s=3613)}),_N_E=e.O()}]);
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.