PageSourceSearch

https://www.givingwhatwecan.org/_next/static/chunks/328-6d04fba9fa64a78a.js

js givingwhatwecan.org collected 2026-09-24 08:40:23 UTC 36,803 bytes, 1 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="8bc89b1e-930f-4a53-a695-0508e5042e51",e._sentryDebugIdIdentifier="sentry-dbid-8bc89b1e-930f-4a53-a695-0508e5042e51")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[328],{83871:function(e,t,n){n.d(t,{Z:function(){return w}});var i=n(59740),l=n(7896),o=n(2784),a=n(6277),r=n(21407),s=n(6441),d=n(7972),c=n(77766),u=(0,c.Z)(o.createElement("path",{d:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2, 4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0, 0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"}),"SuccessOutlined"),p=(0,c.Z)(o.createElement("path",{d:"M12 5.99L19.53 19H4.47L12 5.99M12 2L1 21h22L12 2zm1 14h-2v2h2v-2zm0-6h-2v4h2v-4z"}),"ReportProblemOutlined"),g=(0,c.Z)(o.createElement("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"ErrorOutline"),m=(0,c.Z)(o.createElement("path",{d:"M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20, 12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10, 10 0 0,0 12,2M11,17H13V11H11V17Z"}),"InfoOutlined"),f=n(61149),h=n(94086),v=n(76028),x={success:o.createElement(u,{fontSize:"inherit"}),warning:o.createElement(p,{fontSize:"inherit"}),error:o.createElement(g,{fontSize:"inherit"}),info:o.createElement(m,{fontSize:"inherit"})},y=o.createElement(f.Z,{fontSize:"small"}),b=o.forwardRef(function(e,t){var n=e.action,r=e.children,s=e.classes,c=e.className,u=e.closeText,p=void 0===u?"Close"
1:u,g=e.color,m=e.icon,f=e.iconMapping,b=e.onClose,w=e.role,j=e.severity,S=void 0===j?"success":j,P=e.variant,N=(0,i.Z)(e,["action","children","classes","className","closeText","color","icon","iconMapping","onClose","role","severity","variant"]);return o.createElement(d.Z,(0,l.Z)({role:void 0===w?"alert":w,square:!0,elevation:0,className:(0,a.Z)(s.root,s["".concat(void 0===P?"standard":P).concat((0,v.Z)(g||S))],c),ref:t},N),!1!==m?o.createElement("div",{className:s.icon},m||(void 0===f?x:f)[S]||x[S]):null,o.createElement("div",{className:s.message},r),null!=n?o.createElement("div",{className:s.action},n):null,null==n&&b?o.createElement("div",{className:s.action},o.createElement(h.Z,{size:"small","aria-label":p,title:p,color:"inherit",onClick:b},y)):null)}),w=(0,s.Z)(function(e){var t="light"===e.palette.type?r._j:r.$n,n="light"===e.palette.type?r.$n:r._j;return{root:(0,l.Z)({},e.typography.body2,{borderRadius:e.shape.borderRadius,backgroundColor:"transparent",display:"flex",padding:"6px 16px"}),standardSuccess:{color:t(e.palette.success.main,.6),backgroundColor:n(e.palette.success.main,.9),"& $icon":{color:e.palette.success.main}},standardInfo:{color:t(e.palette.info.main,.6),backgroundColor:n(e.palette.info.main,.9),"& $icon":{color:e.palette.info.main}},standardWarning:{color:t(e.palette.warning.main,.6),backgroundColor:n(e.palette.warning.main,.9),"& $icon":{color:e.palette.warning.main}},standardError:{color:t(e.palette.error.main,.6),backgroundColor:n(e.palette.error.main,.9),"& $icon":{color:e.palette.error.main}},outlinedSuccess:{color:t(e.palette.success.main,.6),border:"1px solid ".concat(e.palette.success.main),"& $icon":{color:e.palette.success.main}},outlinedInfo:{color:t(e.palette.info.main,.6),border:"1px solid ".concat(e.palette.info.main),"& $icon":{color:e.palette.info.main}},outlinedWarning:{color:t(e.palette.warning.main,.6),border:"1px solid ".concat(e.palette.warning.main),"& $icon":{color:e.palette.warning.main}},outlinedError:{color:t(e.palette.error.main,.6),border:"1px solid ".concat(e.palette.error.main),"& $icon":{color:e.palette.error.main}},filledSuccess:{color:"#fff",fontWeight:e.typography.fontWeightMedium,backgroundColor:e.palette.success.main},filledInfo:{color:"#fff",fontWeight:e.typography.fontWeightMedium,backgroundColor:e.palette.info.main},filledWarning:{color:"#fff",fontWeight:e.typography.fontWeightMedium,backgroundColor:e.palette.warning.main},filledError:{color:"#fff",fontWeight:e.typography.fontWeightMedium,backgroundColor:e.palette.error.main},icon:{marginRight:12,padding:"7px 0",display:"flex",fontSize:22,opacity:.9},message:{padding:"8px 0"},action:{display:"flex",alignItems:"center",marginLeft:"auto",paddingLeft:16,marginRight:-8}}},{name:"MuiAlert"})(b)},61149:function(e,t,n){var i=n(2784),l=n(77766);t.Z=(0,l.Z)(i.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close")},52161:function(e,t){t.Z={src:"/_next/static/media/members.eeeeac5c.webp",height:2435,width:1720,blurDataURL:"data:image/webp;base64,UklGRkwAAABXRUJQVlA4IEAAAADwAQCdASoGAAgAAkA4JQBdgCHiFtjIijgA/vybXGsCdaezn47cAgnSXpVcB/ybUYBn+dej5MWNgnCMYdZuAAAA",blurWidth:6,blurHeight:8}},3830:function(e,t,n){n.d(t,{T:function(){return i}});let i=e=>{let t=e.length,n;for(;0!==t;)n=Math.floor(Math.random()*t),t--,[e[t],e[n]]=[e[n],e[t]];return e}},99124:function(e,t,n){n.d(t,{Fd:function(){return m},OP:function(){return p},WL:function(){return u},qu:function(){return g}});var i=n(52322),l=n(2784),o=n(96299),a=n(72509),r=n(52520),s=n(60971),d=n(31814);let c=(0,l.createContext)(null),u=()=>{let e=(0,l.useContext)(c);if(!e)throw Error("usePledgeRenewalModal must be used within a PledgeRenewalModalWrapper");return e},p=e=>{var t;return null!==(t=[...null!=e?e:[]].sort((e,t)=>t.createdAt.localeCompare(e.createdAt))[0])&&void 0!==t?t:null},g=e=>!!(e.pledgeType===s.Oq.TryGiving&&e.createdAt&&(0,r.ff)(e.period.end))&&o.ou.now().diff(o.ou.fromISO(e.createdAt,{zone:"utc"}),"days").days<=14,m=e=>{let{children:t}=e,[n]=(0,a.WF)(),[o,r]=(0,l.useState)(!1),[u,m]=(0,l.useState)(null),f=(0,l.useMemo)(()=>p(n),[n]),h=!!f&&g(f);return(0,i.jsxs)(c.Provider,{value:{isOpen:o,openModal:()=>{(null==f?void 0:f.pledgeType)===s.Oq.TryGiving&&(m({pledge:f,mode:h?"update":"new"}),r(!0))},closeModal:()=>r(!1),isUpdatable:h},children:[t,u&&(0,i.jsx)(d.h,{open:o,onClose:()=>r(!1),pledge:u.pledge,mode:u.mode}
1,u.pledge.id)]})}},31814:function(e,t,n){n.d(t,{h:function(){return I}});var i=n(52322),l=n(2784),o=n(5632),a=n(96299),r=n(59592),s=n(86786),d=n(64669),c=n(52520),u=n(93033),p=n(72509),g=n(94269),m=n(22143),f=n(67862),h=n(81548),v=n(33379);function x(){let e=(0,f._)(["\n  mutation updatePledge(\n    $pledgeId: BigInt!\n    $incomePercentage: BigFloat!\n    $wealthPercentage: BigFloat\n    $startDate: Date!\n    $duration: IntervalInput\n    $pledgeType: PledgeType!\n  ) {\n    updatePledge(\n      input: {\n        pledgeId: $pledgeId\n        incomePercentage: $incomePercentage\n        wealthPercentage: $wealthPercentage\n        startDate: $startDate\n        duration: $duration\n        pledgeType: $pledgeType\n      }\n    ) {\n      pledge {\n        id\n      }\n    }\n  }\n"]);return x=function(){return e},e}let y={},b=(0,h.Ps)(x());var w=n(15538),j=n(86319),S=n(51942),P=n(89258),N=n(29694);let C=(e,t)=>{var n,i,l;if("infinity"===t)return null;let o=a.ou.fromISO(t,{zone:"utc"}).diff(a.ou.fromISO(e,{zone:"utc"}),["years","months","days"]).toObject();return{years:Math.round(null!==(n=o.years)&&void 0!==n?n:0),months:Math.round(null!==(i=o.months)&&void 0!==i?i:0),days:Math.round(null!==(l=o.days)&&void 0!==l?l:0)}},D=e=>{let{pledgeData:t,pledgeId:n,mode:s,baseUrl:d="/dashboard/survey/pledge-renewal"}=e,c=(0,o.useRouter)(),{Person:f}=(0,r.y)(),[h,x]=(0,l.useState)(null),[D,I]=(0,l.useState)(null),T=(0,l.useCallback)(()=>I(null),[]),[E,{loading:A,error:k}]=(0,p.ih)({variables:{pledgeId:n},skip:!(null==f?void 0:f.id)||"update"===s}),[O,{loading:L}]=(0,m.R)({refetchQueries:["getPledgesByPersonId"]}),[M,{loading:F}]=function(e){let t={...y,...e};return v.D(b,t)}({refetchQueries:["getPledgesByPersonId",...g.V]}),_=(0,l.useCallback)(async e=>{let{startDate:t,endDate:i,incomePercentage:l,wealthPercentage:o,pledgeType:r,actionName:d}=e;if(!(null==f?void 0:f.id)){I("Please sign in again and try once more.");return}I(null);try{if("update"===s)await M({variables:{pledgeId:n,startDate:t,duration:C(t,i),incomePercentage:l.toString(),wealthPercentage:null!=o?o:null,pledgeType:r}});else{let e="infinity"===i?i:a.ou.fromISO(i).minus({days:1}).toISODate();await O({variables:{personId:f.id,startDate:t,endDate:e,incomePercentage:l.toString(),wealthPercentage:null!=o?o:null,pledgeType:r,metadata:{source:"pledge_renewal_dashboard",action:d},firstName:f.firstName,lastName:f.lastName,locale:(null==E?void 0:E.locale)||c.locale||"en",motivation:(null==E?void 0:E.motivation)||""}})}x(r),window.scrollTo(0,0)}catch(e){var p;console.error("update"===s?"Failed to update pledge:":"Failed to sign pledge:",e),null===(p=window.Sentry)||void 0===p||p.captureException(e,{extra:{action:d,pledgeType:r,mode:s},user:{id:f.id}}),I("update"===s?(0,u.e)(e,"Something went wrong while updating your pledge. Please try again or contact us if the problem persists."):"Something went wrong while creating your pledge: ".concat((0,u.e)(e),". Please try again or contact us if the problem persists."))}},[f,null==E?void 0:E.locale,null==E?void 0:E.motivation,s,n,c.locale,O,M]);if(A)return(0,i.jsx)("div",{className:"flex justify-center py-12",children:(0,i.jsx)(w.$,{})});if(k){var B;return console.error("Failed to load authenticated pledge details:",k),null===(B=window.Sentry)||void 0===B||B.captureException(k,{extra:{context:"AuthenticatedPledgeRenewalForm"},user:{id:null==f?void 0:f.id}}),(0,i.jsxs)("div",{className:"flex flex-col text-left max-w-prose mx-auto",children:[(0,i.jsx)(j.X,{size:"h1",className:"mt-4",children:"Something went wrong"}),(0,i.jsxs)(S.uT,{className:"mt-4",children:["We encountered an error loading your pledge information. Please try refreshing the page. If the problem persists,"," ",(0,i.jsx)(P.r,{href:"/about-us/contact-us",children:"contact us"}),"."]})]})}return(0,i.jsx)(N.z,{baseUrl:d,pledgeData:t,mode:s,onSignPledge:_,onActionChange:T,signing:"update"===s?F:L,signError:D,successPledgeType:h})},I=e=>{let{open:t,onClose:n,pledge:u,mode:p}=e,g=(0,o.useRouter)(),{Person:m}=(0,r.y)(),f=(0,d.G)("sm","down"),h=g.asPath.split("?")[0]||"/dashboard/pledge",v=(0,c.ff)(u.period.end),x=(0,l.useMemo)(()=>{var e,t;return{incomePercentage:null!==(e=u.incomePercentage)&&void 0!==e?e:"",wealthPercentage:null!==(t=u.wealthPercentage)&&void 0!==t?t:null,endD
1ate:v,startDate:u.period.start,isExpired:!!v&&a.ou.fromISO(v)<a.ou.now(),signatureName:[null==m?void 0:m.firstName,null==m?void 0:m.lastName].filter(Boolean).join(" ")||""}},[null==m?void 0:m.firstName,null==m?void 0:m.lastName,v,u.period.start,u.incomePercentage,u.wealthPercentage]);return(0,i.jsx)(s.u,{open:t,onClose:()=>{g.asPath!==h&&g.replace(h,void 0,{shallow:!0}),n()},position:f?"fromBottom":"center",contentClassName:"md:w-[90vw] md:max-w-[90vw] lg:w-[62rem] lg:max-w-[62rem]",children:(0,i.jsx)(D,{mode:p,pledgeData:x,pledgeId:u.id,baseUrl:h})})}},93721:function(e,t,n){n.d(t,{Bs:function(){return a},id:function(){return o},ye:function(){return s},g$:function(){return d}});var i=n(2784),l=n(93598);let o={EASTER_EGG_FLAG:"account-easter-egg-greeting",EMAIL_FORWARDING:"email-forwarding",BULK_DONATION_IMPORT:"bulk-donation-import"},a={DASHBOARD_ONBOARDING:{flag:"001-post-pledge-onboarding",variants:{CONTROL:"control",TEST:"test"}}};function r(e){return new URLSearchParams(window.location.search).get(e)}function s(e){let[t,n]=(0,i.useState)(!1);return(0,i.useEffect)(()=>{let t=r(e);if(null!==t){n("true"===t);return}let i=(0,l.Y)();if(!i){n(!1);return}try{let t=()=>{n(!!i.isFeatureEnabled(e))};t();let l=i.onFeatureFlags(t);return()=>{l()}}catch(e){var o;console.error("PostHog failed:",e),null===(o=window.Sentry)||void 0===o||o.captureException(e)}},[e]),t}function d(e){let{flag:t,variants:n}=e,[o,a]=(0,i.useState)(void 0);return(0,i.useEffect)(()=>{let e=r(t);if(null!==e){a(Object.values(n).some(t=>t===e)?e:void 0);return}let i=(0,l.Y)();if(!i){a(void 0);return}try{let e=()=>{let e=i.getFeatureFlag(t),l=void 0===e||!1===e,o=e=>Object.values(n).some(t=>t===e);if(!o(e)&&!l){var r;let i='Received unexpected variant value "'.concat(e,'" for flag "').concat(t,'". Expected one of: ').concat(Object.values(n).join(", "));console.warn(i),null===(r=window.Sentry)||void 0===r||r.captureException(Error(i))}a(o(e)?e:void 0)};e();let l=i.onFeatureFlags(e);return()=>{l()}}catch(e){var o;console.error("PostHog failed:",e),null===(o=window.Sentry)||void 0===o||o.captureException(e)}},[t,n]),o}},65470:function(e,t,n){n.d(t,{Z:function(){return o}});var i=n(52322);n(2784);var l=n(51942);let o=e=>{let{fineprints:t}=e;return(0,i.jsx)("div",{className:"flex flex-col space-y-10",children:(0,i.jsx)("div",{className:"flex flex-col space-y-6",children:(null!=t?t:[{title:"Is a pledge legally binding?",description:"No. A pledge is a voluntary commitment and enforced solely by your own conscience. In some circumstances, it may be best to resign from your pledge by filling in our depledging form."},{title:"What if I'm not ready to pledge?",description:"Set yourself a reminder for later, or get in touch if you'd like to discuss anything! In the meantime, we encourage you to donate to an effective charity, browse our resources, sign up to our newsletter, follow us on social media, attend an event and/or join an effective altruism group."},{title:"What do you mean by effective charities?",description:"Some organisations are especially good at using donations to improve the world. They tend to work on unusually promising interventions, use scientific evidence to plan their activities, and seek out ways to increase their own impact. Our website provides recommendations for specific charities and guidance for doing your own evaluations."}]).map(e=>(0,i.jsxs)("div",{children:[(0,i.jsx)(l.uT,{small:!0,subtitle:!0,bold:!0,children:e.title}),(0,i.jsx)(l.uT,{small:!0,subtitle:!0,children:e.description})]},e.title))})})}},95291:function(e,t,n){n.d(t,{_:function(){return u},e:function(){return c}});var i=n(52322),l=n(12524),o=n.n(l);n(2784);var a=n(89258),r=n(56706),s=n(4804),d=n(27827);let c=e=>{let{disabled:t}=e,n=(0,d.h)();return(0,i.jsxs)("section",{className:o()({[n.section]:!0,[n.disabledSection]:t},"flex flex-col space-y-4 md:space-y-6"),children:[(0,i.jsx)(r.h,{stepLabel:1,title:"Employment status",description:"Which of the following best describes your current employment status?"}),(0,i.jsx)(s.YR,{})]})},u=e=>{let{sectionDisabled:t,pickerDisabled:n,locale:l,className:c}=e,u=(0,d.h)();return(0,i.jsxs)("section",{className:o()({[u.section]:!0,[u.disabledSection]:t},"flex flex-col space-y-6",c),children:[(0,i.jsx)(r.h,{stepLabel:2,title:"Pledge type",description:(0,i.jsxs)(i.Fragment,{children:["Choose the standard \uD83D\uDD3810% Pledge or commit to a \uD83D\uDD39Trial Pledge. Not sure where to start? Use our"," ",(0,i.jsx)(a.r,{href:"/pledge/recommendation",newTab:!0,locale:l,children:"pledge recommendation tool"})," ","to help guide you through the process."]})}),(0,i.jsx)(s.dW,{disabled:n})]})}},56706:function(e,t,n){n.d(t,{h:function(){return r}});var i=n(52322);n(2784);var l=n(86319),o=n(51942),a=n(8186);let r=e=>{let{description:t,title:n,stepLabel:r}=e;return(0,i.jsxs)("div",{className:"flex flex-col space-y-2 md:space-y-4",children:[(0,i.jsxs)("div",{className:"flex flex-col items-start space-y-5 lg:flex-row lg:items-center lg:space-x-8 lg:space-y-0",children:[r&&(0,i.jsx)("div",{className:(0,a.A)("flex justify-center items-center text-center","rotate-45","w-[38px] h-[38px]","bg-orange-primary text-white"),children:(0,i.jsx)(l.X,{size:"h4",className:"-rotate-45",children:r})}),(0,i.jsx)(l.X,{size:"h3","aria-label":n,children:n})]}),t&&(0,i.jsx)(o.uT,{subtitle:!0,small:!0,children:t})]})}},9040:function(e,t,n){n.d(t,{d:function(){return s}});var i=n(52322),l=n(47803),o=n(35547),a=n(11059);n(2784);let r=(0,l.Z)(e=>({sidePaneContainer:{position:"sticky",paddingRight:e.spacing(4),top:"calc(var(--site-header-height, ".concat(e.spacing(6),"px) + ").concat(e.spacing(2),"px)"),[e.breakpoints.down("sm")]:{padding:0,width:"100%",position:"unset",marginTop:e.spacing(2)}},leftGrid:{paddingRight:e.spacing(2),[e.breakpoints.between("xs","xs")]:{paddingRight:e.spacing(0)}},rightGrid:{paddingLeft:e.spacing(2),[e.breakpoints.between("xs","md")]:{paddingLeft:e.spacing(0)}}})),s=e=>{let{sidePaneContent:t,mainContent:n,noHeaderSpacing:l=!1}=e,s=r();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(o.Z,{pt:l?4:10}),(0,i.jsxs)(a.Z,{container:!0,children:[t&&(0,i.jsx)(a.Z,{item:!0,xs:12,md:5,className:s.leftGrid,children:(0,i.jsx)(o.Z,{className:s.sidePaneContainer,children:t})}),(0,i.jsx)(a.Z,{item:!0,xs:12,md:7,className:s.rightGrid,children:(0,i.jsx)(o.Z,{width:"100%",children:n})})]})]})}},36682:function(e,t,n){n.d(t,{T:function(){return u}});var i=n(52322),l=n(96577),o=n.n(l),a=n(5632),r=n(52161);n(2784);var s=n(86319),d=n(10952),c=n(36991);function u(e){var t;let{image:n=r.Z,countColor:l,priority:u=!0}=e,{locale:p}=(0,a.useRouter)(),[g]=(0,c.d1)(),m=null!==(t=(0,d.v1)(g).lifetimePledges)&&void 0!==t?t:0;return(0,i.jsxs)("div",{className:"flex relative m-auto h-[60vh] md:h-[600px] max-w-[420px] z-10 shadow-xl",children:[(0,i.jsx)(o(),{priority:u,quality:100,alt:"",src:n,sizes:"40vw",layout:"fill",objectFit:"cover",className:"rounded-lg shadow-lg"}),(0,i.jsx)("div",{className:"px-2 py-11 md:py-14 lg:px-4 lg:py-9 xl:py-12 text-center z-20 text-balance",children:(0,i.jsxs)(s.X,{size:"h4",className:"!font-bold",children:["Join a community of"," ",(0,i.jsx)("span",{className:l?void 0:"text-red-primary",style:l?{color:l}:void 0,children:new Intl.NumberFormat(p).format(m)})," ","people who have pledged ≥10% of their income"]})})]})}},81126:function(e,t,n){n.d(t,{D:function(){return en}});var i=n(52322),l=n(12524),o=n.n(l),a=n(96299),r=n(5632),s=n(2784),d=n(39754),c=n(59592),u=n(3830),p=n(86319),g=n(51942),m=n(89258),f=n(8186);let h={small:"px-4 py-3 text-sm leading-normal",normal:"px-4 py-3 text-base leading-7",large:"px-6 py-4 text-xl leading-7"},v=e=>{let{children:t,className:n,size:l="normal",...o}=e,a=(0,f.A)("inline-block whitespace-nowrap font-bold rounded-lg bg-sky-subtle text-primary",h[l],n);return(0,i.jsx)("span",{className:a,...o,children:t})};var x=n(45403),y=n(34308),b=n(71950),w=n(14932),j=n(93721),S=n(60477),P=n(69555),N=n(71196),C=n(79513),D=n(85203),I=n(86786),T=n(26851),E=n(51109);let A=e=>{let{open:t,options:n,onSubmit:l,onDismiss:o}
1=e,[a,r]=(0,s.useState)(new Map),d=(0,s.useCallback)((e,t)=>{r(n=>{let i=new Map(n),l=i.get(e);return i.set(e,{selected:t,context:(null==l?void 0:l.context)||""}),i})},[]),c=(0,s.useCallback)((e,t)=>{r(n=>{var i;let l=new Map(n),o=l.get(e);return l.set(e,{selected:null===(i=null==o?void 0:o.selected)||void 0===i||i,context:t}),l})},[]),u=Array.from(a.values()).some(e=>e.selected);return(0,i.jsx)(I.u,{open:t,onClose:o,title:"Every pledge has a unique story",showCloseIcon:!0,preventGlobalScroll:!0,children:(0,i.jsxs)("div",{className:"flex flex-col space-y-4 mt-4",children:[(0,i.jsx)(g.uT,{className:"text-primary mb-1",children:"What was part of yours?"}),(0,i.jsx)("div",{className:"flex flex-col space-y-2",children:n.map(e=>{let t=a.get(e.id),n=(null==t?void 0:t.selected)||!1;return(0,i.jsxs)("div",{children:[(0,i.jsx)(T.X,{id:"attribution-option-".concat(e.id),name:e.label,label:e.label,checked:n,onChange:t=>d(e.id,t),className:"!justify-start"}),(0,i.jsx)(C.M,{initial:!1,children:n&&(0,i.jsx)(D.EAS.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2},className:"overflow-hidden pl-9 mt-1",children:(0,i.jsx)(E.n,{id:"attribution-context-".concat(e.id),placeholder:"Please specify",value:(null==t?void 0:t.context)||"",onChange:t=>c(e.id,t.target.value)})})})]},e.id)})}),(0,i.jsx)("div",{className:"flex flex-row justify-center pt-1.5",children:(0,i.jsx)(w.z,{level:"primary",size:"medium",onClick:()=>{let e=[];a.forEach((t,n)=>{t.selected&&e.push({optionId:n,context:t.context})}),l(e)},disabled:!u,children:"Submit"})})]})})};var k=n(65470),O=n(56706),L=n(9040),M=n(95291),F=n(27827),_=n(92369),B=n(36682),z=n(4804),R=n(52057),$=n(95227),Z=n(93415);function W(e){var t,n;let{introNode:l}=e,o=(0,Z.k)();return(null==o?void 0:o.logo)||(null==o?void 0:null===(t=o.sideBarText)||void 0===t?void 0:t.length)?(0,i.jsxs)(i.Fragment,{children:[l&&(0,i.jsx)("div",{className:"mb-8 material-md:hidden",children:l}),(0,i.jsxs)("div",{className:"flex flex-col z-10 py-6 shadow-xl mb-16 bg-white rounded-lg",children:[o.logo&&(0,i.jsx)($.d,{Image:o.logo,alt:o.parfitSlug,sizes:"(max-width: 960px) 100vw, 40vw"}),!!(null===(n=o.sideBarText)||void 0===n?void 0:n.length)&&(0,i.jsx)("div",{className:"px-4 pt-4 sm:px-8 z-20",children:(0,i.jsx)(R.l,{blocks:o.sideBarText})})]})]}):null}var U=n(8990),G=n(6771),V=n(48840),H=n(64846),X=n(60971),Y=n(68563),q=n(43241),J=n(46397),Q=n(52520),K=n(99124),ee=n(31814),et=n(34406);let en=e=>{let{numRecentPledgers:t=0}=e,n=(0,r.useRouter)(),l=(0,F.h)(),{Person:h,loading:C}=(0,c.y)(),D="test"===(0,j.g$)(j.Bs.DASHBOARD_ONBOARDING),[I,T]=(0,s.useState)(!1),[E,R]=(0,s.useState)(null),[$,en]=(0,s.useState)(!1),[ei]=(0,S.s)(),el=(0,V.HA)(),{pledge:{pledgeType:eo,employmentStatus:ea},updatePledge:er,person:es,derivedState:{activePledgeEndBound:ed,activePledgeType:ec,activePledgeIncomePercentage:eu,activePledge:ep,hasActivePledge:eg,hasValidAccountDetails:em,isValid:ef},mutation:eh}=el,[ev,ex]=(0,s.useState)(!1),[ey,eb]=(0,s.useState)(null),{data:ew,error:ej,loading:eS}=(0,P.yk)({variables:{pollId:"0",sessionToken:h?void 0:es.sessionToken},skip:!D||!h&&!es.sessionToken}),eP=(0,s.useMemo)(()=>{var e;let t=null==ew?void 0:null===(e=ew.Poll)||void 0===e?void 0:e.Options;return(null==t?void 0:t.length)?(0,u.T)(t.slice()).sort((e,t)=>e.id===N.j?1:t.id===N.j?-1:0):null},[ew]);(0,H.pN)(el);let eN=n.locale;(0,s.useEffect)(()=>{er({locale:eN})},[eN,er]);let eC=void 0===ea,eD=void 0===eo;(0,_.K)(eh.loading||!eD&&em);let eI=(0,Z.k)(),eT=(0,s.useCallback)(()=>{if(!D){(0,d.L9)("Primary Signup Completed",{category:"Primary Signup",version:"2026-05-v1",pledgeClub:null==eI?void 0:eI.parfitSlug}),en(!0);return}if(eP||eS)T(!0);else{if(ej){var e;null===(e=window.Sentry)||void 0===e||e.captureException(ej,{extra:{context:"Attribution poll query failed"}})}(0,d.L9)("Primary Signup Completed",{category:"Primary Signup",version:"2026-05-v1",pledgeClub:null==eI?void 0:eI.parfitSlug}),en(!0)}},[D,eP,eS,ej,null==eI?void 0:eI.parfitSlug]),eE=(0,s.useCallback)(e=>{(0,d.L9)("Pledge Attribution Poll Submitted",{category:"Secondary Signup",pathname:window.location.pathname}),(0,d.L9)("Primary Signup Completed",{category:"Primary Signup",version:"2026-05-v1",pledgeClub:null==eI?void 0:eI.parfitSlug}),R(e),T(!1),en(!0)},[null==eI?void 0:eI.parfitSlug]),eA=(0,s.useCallback)(()=>{(0,d.L9)("Primary Signup Completed",{category:"Primary Signup",version:"2026-05-v1",pledgeClub:null==eI?void 0:eI.parfitSlug}),R(null),T(!1),en(!0)},[null==eI?void 0:eI.parfitSlug]),ek=(0,s.useCallback)(async()=>{let e=await eh.perform();if(e){if(E&&E.length>0){let t=es.sessionToken;Promise.all(E.map(n=>ei({variables:{pledgeId:e,pollOptionId:n.optionId,context:n.context,sessionToken:h?void 0:t}}
1))).catch(e=>{var t;return null===(t=window.Sentry)||void 0===t?void 0:t.captureException(e,{user:{id:null==h?void 0:h.id}})})}(h||es.sessionToken)&&n.push("/pledge/flow/welcome?pledge_id=".concat(e))}},[eh,E,es.sessionToken,h,ei,n]),eO="infinity"===ed&&ec===X.Oq.GivingWhatWeCan,eL=ec===X.Oq.TryGiving,eM=!!ep&&(0,K.qu)(ep),eF=eO||eM,e_=(0,Q.ff)(ed),eB=e_?a.ou.fromISO(e_).setLocale(eN||"local").toLocaleString(a.ou.DATE_FULL):null,ez=n.pathname,eR=t>=6&&ez.startsWith("/pledge/flow"),e$=(0,i.jsxs)("section",{className:"flex flex-col space-y-3 text-pretty",children:[(0,i.jsx)(p.X,{size:"h1",children:"Pledge to give"}),(0,i.jsxs)(g.uT,{subtitle:!0,children:["Make your public commitment to give a percentage of your income to the most effective charities in the world. Join our community of people committed to helping others effectively."," ",(0,i.jsx)(m.r,{href:"/pledge",locale:(0,Y.w)({locale:eN}),children:"Learn more about the pledge."})]}),eR&&(0,i.jsxs)(v,{className:"mt-8 flex flex-row items-start whitespace-normal",children:[(0,i.jsx)("div",{className:"w-[20px] min-w-[20px] max-w-[20px] mr-2",children:(0,i.jsx)(x.U,{width:20,height:20,className:"fill-red-primary stroke-red-primary"})}),(0,i.jsxs)(g.uT,{subtitle:!0,small:!0,children:[(0,i.jsxs)("span",{className:"font-medium",children:[t," people pledged this week"]}),", you could be the ",(0,q.ED)(t+1),"!"]})]})]});return"true"===et.env.NEXT_PUBLIC_MAINTENANCE_MODE?(0,i.jsxs)(y.b,{severity:"warning",className:"mt-8",children:["Pledge signing is temporarily disabled due to planned maintenance. Please try again later today.",(0,i.jsx)("p",{children:(0,i.jsx)(m.r,{href:"/",children:"Back to home"})})]}):(0,i.jsxs)(i.Fragment,{children:[D&&(0,i.jsx)(A,{open:I,options:null!=eP?eP:[],onSubmit:eE,onDismiss:eA}),ey&&(0,i.jsx)(ee.h,{open:ev,onClose:()=>ex(!1),pledge:ey,mode:"update"},ey.id),(0,i.jsx)(L.d,{noHeaderSpacing:!!eI,sidePaneContent:eI?(0,i.jsx)(W,{introNode:e$}):(0,i.jsx)("div",{className:"hidden material-md:block",children:(0,i.jsx)(B.T,{})}),mainContent:(0,i.jsxs)(i.Fragment,{children:[ed&&eg&&(0,i.jsxs)(b.Z,{size:"full",className:"mb-8 flex-row space-x-6",children:[(0,i.jsx)(U.c,{}),(0,i.jsxs)("div",{children:[(0,i.jsx)(g.uT,{children:eO?"Congratulations! You have signed a \uD83D\uDD3810% Pledge.":eL&&eB?"Your \uD83D\uDD39Trial Pledge of ".concat((0,J.rU)(null!=eu?eu:"0"),"% ends on ").concat(eB,"."):eB?"You have an active pledge that is ending on ".concat(eB,"."):"You have an active pledge."}),eM?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(g.uT,{small:!0,className:"mt-4",children:"You can still tweak the percentage, duration, or upgrade to a 10% Pledge for the next few days."}),(0,i.jsx)(w.z,{level:"primary",size:"medium",className:"mt-4",onClick:()=>{ep&&((0,d.L9)("pledge_update_started",{entry_point:"sign_page"}),eb(ep),ex(!0))},children:"Update your pledge"})]}):eL?(0,i.jsx)(g.uT,{small:!0,className:"mt-4",children:"Sign a \uD83D\uDD3810% Pledge or a new \uD83D\uDD39Trial Pledge with your preferred percentage and duration below."}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(w.z,{href:"/dashboard/pledge",level:"secondary",size:"medium",className:"mt-4",children:"Visit your Pledge Dashboard"}),!eO&&(0,i.jsx)(g.uT,{small:!0,className:"mt-4",children:"To update the pledge type, percentage or duration, you can sign up for a new pledge below."})]})]})]}),(0,i.jsxs)("div",{"aria-disabled":eF,className:o()({[l.disabledSection]:eF},"flex flex-col space-y-14"),children:[(0,i.jsx)("div",{className:(0,f.A)(eI&&"hidden material-md:block"),children:e$}),(0,i.jsx)(M.e,{disabled:eh.loading}),(0,i.jsx)(M._,{sectionDisabled:eh.loading||eC,pickerDisabled:eC,locale:(0,Y.w)({locale:eN})}),(0,i.jsxs)("section",{className:o()({[l.section]:!0,[l.disabledSection]:C||eh.loading||eD},"flex flex-col space-y-8"),children:[(0,i.jsx)(O.h,{stepLabel:3,title:"Account",description:h?void 0:"Please login or sign up for a Giving What We Can account to continue"}),(0,i.jsx)(z.hm,{disabled:C||eh.loading||eD})]}),(0,i.jsxs)("section",{className:o()({[l.section]:!0,[l.disabledSection]:!em||eh.loading||eD},"flex flex-col space-y-8"),children:[(0,i.jsx)(O.h,{stepLabel:4,title:"Sign your pledge"}),(0,i.jsx)(G.o,{pledge:el.pledge,fieldsDisabled:!em||eh.loading||eD,signingDisabled:!ef||eh.loading,onSignClicked:eT,signingActive:$,onSigningActiveChange:en,onSignatureCompleted:ek,signatureText:"".concat(es.firstName," ").concat(es.lastName),error:eh.error,showPersonalDetails:D,showNewsletterCheckbox:D})]}),(0,i.jsx)("section",{className:"flex flex-col space-y-8",children:(0,i.jsx)(k.Z,{})})]})]})})]})}},6771:function(e,t,n){n.d(t,{o:function(){return v}});var i=n(52322),l=n(83871),o=n(96299),a=n(5632),r=n(2784),s=n(86319),d=n(51942),c=n(57231),u=n(4804),p=n(48840),g=n(73385),m=n(39753);let f=e=>{let{disabled:t}=e,{pledge:{countryCode:n},person:{birthDate:l},updatePledge:a,updatePerson:r}=(0,p.HA)();return(0,i.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 sm:gap-2",children:[(0,i.jsx)(m.j,{countryCode:n,setCountryCode:e=>a({countryCode:e}),disabled:t}),(0,i.jsx)(g.O,{birthDate:l instanceof o.ou?l:void 0,setBirthDate:e=>r({birthDate:e}),disabled:t})]})};var h=n(13111);let v=e=>{let{pledge:t,fieldsDisabled:n,signingDisabled:p,onSignatureCompleted:g,onSignClicked:m,signingActive:v,onSigningActiveChange:x,signatureText:y,error:b,showPersonalDetails:w=!0,showNewsletterCheckbox:j=!0}=e,{locale:S}=(0,a.useRouter)(),[P,N]=(0,r.useState)("");return(0,r.useEffect)(()=>
1{N(o.ou.local().toLocaleString({locale:S}))},[S]),(0,i.jsxs)("div",{className:"flex flex-col space-y-10",children:[(0,i.jsx)(h.a,{pledge:t,className:"mt-6"}),(0,i.jsx)(u.m5,{disabled:n}),(0,i.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,i.jsxs)(s.X,{size:"h5",children:["Signed on ",P," by:"]}),(0,i.jsx)(u.o_,{disabled:n}),w&&(0,i.jsx)(f,{disabled:n})]}),(0,i.jsx)(c.v,{disabled:p,onSignatureCompleted:g,onSignClicked:m,signingActive:v,onSigningActiveChange:x,showNewsletterCheckbox:j,signatureText:y}),!!b&&(0,i.jsxs)(l.Z,{severity:"error",children:[(0,i.jsx)(d.uT,{bold:!0,children:"We’re sorry, but something went wrong"}),(0,i.jsx)(d.uT,{small:!0,children:"We got notified about the error and will try to solve the problem. In the meantime please try again! If you keep getting this error, please contact us at [email protected]"}),(0,i.jsx)("code",{children:(null==b?void 0:b.message.includes("pledge_person_id_period_excl"))?"User already has a pledge with an overlapping period":null==b?void 0:b.message})]})]})}},64846:function(e,t,n){n.d(t,{vf:function(){return s},wi:function(){return r},pN:function(){return c}});var i=n(2784),l=n(93415),o=n(39754);let a=e=>{let{category:t,version:n}=e;return{sendEvent:(0,i.useCallback)((e,i)=>{(0,o.L9)(e,{version:n,category:t,...i})},[t,n])}},r="2021-09-v2",s="Primary Signup",d=["Primary Signup Started","Pledge Existed","Employment Status Selected","Pledge Type Selected","Currency Code Selected","All Impact Fields Selected","Names Entered","Primary Signup Completed","Primary Signup Submitted"],c=e=>{let t=(0,l.k)(),{sendEvent:n}=a({category:s,version:r,events:d}),{pledge:{pledgeType:o,id:c,employmentStatus:u},person:{firstName:p,lastName:g},mutation:{success:m},derivedState:{hasActivePledge:f}}=e;(0,i.useEffect)(()=>{n("Primary Signup Started",{pledgeClub:null==t?void 0:t.parfitSlug})},[null==t?void 0:t.parfitSlug]),(0,i.useEffect)(()=>{f&&n("Pledge Existed")},[f]),(0,i.useEffect)(()=>{u&&n("Employment Status Selected",{employmentStatus:u})},[u]),(0,i.useEffect)(()=>{o&&n("Pledge Type Selected",{pledgeType:o})},[o]),(0,i.useEffect)(()=>{p&&g&&n("Names Entered")},[p,g]);let h=(0,i.useCallback)(()=>{n("Primary Signup Submitted",{pledgeType:o,label:o,pledgeId:c,pledgeClub:null==t?void 0:t.parfitSlug})},[o,c,null==t?void 0:t.parfitSlug]);(0,i.useEffect)(()=>{m&&c&&h()},[m,c])}},27827:function(e,t,n){n.d(t,{h:function(){return i}});let i=(0,n(47803).Z)(()=>({section:{transition:"opacity 200ms"},disabledSection:{position:"relative",cursor:"not-allowed",opacity:.5,"&::after":{content:'" "',position:"absolute",top:0,left:0,bottom:0,right:0}}}))},92369:function(e,t,n){n.d(t,{K:function(){return l}});var i=n(2784);let l=e=>{let t=(0,i.useRef)(e);t.current=e,(0,i.useEffect)(()=>{function e(e){t.current&&e.preventDefault()}return window.addEventListener("beforeunload",e),()=>{window.removeEventListener("beforeunload",e)}},[])}},71196:function(e,t,n){n.d(t,{j:function(){return i}});let i="100"},48659:function(e,t,n){n.d(t,{g:function(){return a}});var i=n(2784),l=n(86869),o=n(61296);let a=e=>{var t;let{page:n,campaign:a}=e,{campaign:r,setCampaign:s}=(0,l.y)(),d=null==n?void 0:null===(t=n.events)||void 0===t?void 0:t.find(e=>"campaignEventTracking"==e._type);return(0,i.useEffect)(()=>{let e=null!=a?a:d?{campaign_organiser:d.campaignOrganiser,campaign_category:d.campaignCategory,campaign_name:d.campaignName,data_sharing_disabled:d.dataSharingDisabled}:void 0;if(!e)return;let t={...r,...e};(0,o.kv)(t,r)||s(t)},[d,r,a,s]),null}},94269:function(e,t,n){n.d(t,{V:function(){return i}});let i=["getFinancialPeriodsByPersonId","getCompletionPaymentsByPersonId","getLiabilityCompletions","getLiabilityTotalCompletions","getLiabilitiesByPersonId"]},60477:function(e,t,n){n.d(t,{s:function(){return d}});var i=n(67862),l=n(81548),o=n(33379);function a(){let e=(0,i._)(["\n  mutation createPollOptionVoteByPersonOrTemporaryPerson(\n    $pledgeId: BigInt!\n    $pollOptionId: BigInt!\n    $context: String!\n    $sessionToken: UUID\n  ) {\n    createPollOptionVoteByPersonOrTemporaryPerson(\n      input: {\n        sessionToken: $sessionToken\n        pledgeId: $pledgeId\n        pollOptionId: $pollOptionId\n        context: $context\n      }\n    ) {\n      pollOptionVote {\n        pledgeId\n        pollOptionId\n        context\n      }\n    }\n  }\n"]);return a=function(){return e},e}let r={},s=(0,l.Ps)(a());function d(e){let t={...r,...e};return o.D(s,t)}},69555:function(e,t,n){n.d(t,{yk:function(){return d}});var i=n(67862),l=n(81548),o=n(2756);function a(){let e=(0,i._)(["\n  query getPollByPersonOrTemporaryPer
1son(\n    $pollId: BigInt!\n    $sessionToken: UUID\n  ) {\n    Poll: pollPublicById(id: $pollId) {\n      id\n      voteMechanism\n      questionOrdering\n      question\n      Options: pollOptionPublicsByPollIdList {\n        id\n        pollId\n        label\n        voteCount\n        Votes: votesByPersonOrTemporaryPersonList(sessionToken: $sessionToken) {\n          pledgeId\n          pollOptionId\n          context\n        }\n      }\n    }\n  }\n"]);return a=function(){return e},e}let r={},s=(0,l.Ps)(a());function d(e){let t={...r,...e};return o.aM(s,t)}},97758:function(e,t,n){n.d(t,{Go:function(){return r},VL:function(){return h},ZO:function(){return d},iQ:function(){return m},iS:function(){return p},ie:function(){return g},pw:function(){return x},si:function(){return f},xG:function(){return s},z4:function(){return c},zg:function(){return v}});var i=n(96299);let l=new Set(["AAVE","ADA","AVAX","BAT","BCH","BNB","BTC","BUSD","DAI","DOGE","ETH","FTM","FTT","LTC","MATIC","MINA","PUNDIX","SOL","TRX","USDC","USDT","WAVES","XMR","XRP","YFI"]),o="en-US",a=e=>{if(e===o)return e;try{return new Intl.NumberFormat(e),e}catch(e){return o}},r=function(e){var t,n;let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o,r=arguments.length>2?arguments[2]:void 0,s=a(i),d=null!==(t=null==r?void 0:r.minimumFractionDigits)&&void 0!==t?t:0,c=null!==(n=null==r?void 0:r.maximumFractionDigits)&&void 0!==n?n:Math.max(2,d),u=()=>{let t=new Intl.NumberFormat(s,{...r,minimumFractionDigits:d,maximumFractionDigits:Math.max(d,c,8)});return n=>"".concat(t.format(n)," ").concat(e)};if(l.has(e.toUpperCase()))return u();try{return new Intl.NumberFormat(s,{...r,minimumFractionDigits:d,maximumFractionDigits:c,style:"currency",currency:e}).format}catch(e){if(e instanceof RangeError)return u();throw e}},s=(e,t,n)=>r(t,"en-US",n)(e),d=(e,t)=>s(e,t,{minimumFractionDigits:2,maximumFractionDigits:2}),c=(e,t)=>Number.isInteger(e)?s(e,t,{minimumFractionDigits:0,maximumFractionDigits:0}):d(e,t),u="d MMM yyyy",p=e=>i.ou.fromJSDate(e).toFormat(u),g=e=>{let t=i.ou.fromISO(e,{setZone:!0});return t.isValid?t.toFormat(u):e},m=(e,t)=>{let n=t.toLowerCase(),i=n.endsWith("s")?n.slice(0,-1):n;return 1===e?i:"".concat(e," ").concat(i,"s")},f=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Date;if(!t)return p(e);let i=e.getFullYear()!==n.getFullYear();return new Intl.DateTimeFormat("en-GB",{day:"numeric",month:"short",...i?{year:"numeric"}:{}}).format(e)},h=(e,t)=>{let n=m(t||1,e);return"Every ".concat(n)},v=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Date,n=i.ou.fromJSDate(e),l=i.ou.fromJSDate(t);if(n.hasSame(l,"day"))return"Today";if(n.hasSame(l.minus({days:1}),"day"))return"Yesterday";if(l.diff(n,"days").days<30){var o;return null!==(o=n.toRelative({base:l}))&&void 0!==o?o:n.toFormat(u)}return n.toFormat(u)},x=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Date,n=i.ou.fromISO(e,{setZone:!0}),l=i.ou.fromJSDate(t),o=n.isValid?l.diff(n,"days").days:Number.NaN;if(o>=0&&o<15){var a;return null!==(a=n.toRelative({base:l,unit:["weeks","days","hours","minutes","seconds"]}))&&void 0!==a?a:g(e)}return g(e)}}}]);

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.