1!function(){try{var e="u">typeof window?window:"u">typeof global?global:"u">typeof globalThis?globalThis:"u">typeof self?self:{};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[(new e.Error).stack]=function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];if(null!=s)for(var n in s)s.hasOwnProperty(n)&&(e[n]=s[n])}return e}({},e._sentryModuleMetadata[(new e.Error).stack],{"_sentryBundlerPluginAppKey:opencollective-frontend":!0});var t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="3f1193b0-8ad5-4488-a376-fab79982d64b",e._sentryDebugIdIdentifier="sentry-dbid-3f1193b0-8ad5-4488-a376-fab79982d64b")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[169,5192,8610],{4281:(e,t,s)=>{"use strict";s.d(t,{A:()=>c});var n=s(37876);s(14232);var a=s(45884),i=s(61184),o=s(8545),r=s(47537),l=s(69020);let d=({children:e,data:t={},description:s,image:l,loadingLoggedInUser:d,LoggedInUser:c,title:u,metaTitle:p,noRobots:m,twitterHandle:h,showSearch:x=!0,canonicalURL:f,collective:g,showMenuItems:j=!0,withTopBar:v=!0,showFooter:b=!0,showProfileAndChangelogMenu:A=!0,loading:y,updatesRss:N})=>t.error?(0,n.jsx)(o.A,{data:t,LoggedInUser:c}):(0,n.jsxs)("div",{className:"flex min-h-screen flex-col",children:[(0,n.jsx)(r.A,{showSearch:x,title:u,noRobots:m,twitterHandle:h,description:s,image:l,metaTitle:p,canonicalURL:f,collective:g,showMenuItems:j,LoggedInUser:c,showProfileAndChangelogMenu:A,loading:y,withTopBar:v,updatesRss:N}),(0,n.jsx)(i.A,{className:"flex-1",children:"function"==typeof e?e({LoggedInUser:c,loadingLoggedInUser:d}):e}),b&&(0,n.jsx)(a.A,{})]});d.displayName="Page";let c=(0,l.Cb)(d)},15192:(e,t,s)=>{"use strict";s.d(t,{I:()=>W,B:()=>z});var n=s(37876),a=s(14232),i=s(670),o=s(12815),r=s(64487),l=s(13223),d=s(5488),c=s(28478),u=s(72202),p=s(3186),m=s(59064),h=s(14548),x=s(76752),f=s(54282),g=s(62449),j=s(6435),v=s(11046),b=s(87058),A=s(33123),y=s(42506),N=s(65221),w=s(16255),I=s(86643),C=s(21098),M=s(30619),E=s(64177),T=s(88490),O=s(36944),P=s(30988),S=s(2948),k=s(60257),R=s(20322),F=s(1509),L=s(27147),_=s(80207);function H({className:e,account:t,isHoverCard:s}){let{LoggedInUser:i,refetchLoggedInUser:o}=(0,k.A)(),r=(0,g.tz)(),[l,d]=a.useState(!1),{toast:c}=(0,_.d)(),u=a.useMemo(()=>!!i&&i.hasRole(A.b_9.FOLLOWER,t),[i,t]),[p]=(0,E.n)((0,T.J1)` 2 mutation FollowAccount($accountSlug: String!) { 3 followAccount(account: { slug: $accountSlug }) { 4 member { 5 id 6 } 7 } 8 } 9 `,{variables:{accountSlug:t.slug}}),[m]=(0,E.n)((0,T.J1)` 10 mutation UnfollowAccount($accountSlug: String!) { 11 unfollowAccount(account: { slug: $accountSlug }) { 12 member { 13 id 14 } 15 } 16 } 17 `,{variables:{accountSlug:t.slug}}),h=a.useCallback(async()=>{d(!0);try{u?await m():await p(),await o()}catch(e){c({variant:"error",message:(0,S.Rp)(r,e)})}finally{d(!1)}},[u,t,r]);return!i||i.collective.slug===t.slug||!t.type||[P.Td.INDIVIDUAL,P.Td.USER,P.Td.VENDOR,P.Td.BOT].includes(t.type)?null:u&&!s?(0,n.jsxs)(L.rI,{children:[(0,n.jsx)(L.ty,{asChild:!0,children:(0,n.jsxs)(F.$n,{size:"xs",variant:"outline",loading:l,className:(0,R.cn)("gap-0.5",e),children:[(0,n.jsx)(g.sA,{id:"Following",defaultMessage:"Following"}),(0,n.jsx)(O.A,{className:"h-4 w-4"})]})}),(0,n.jsx)(L.SQ,{align:"start",children:(0,n.jsx)(L._2,{onClick:h,children:(0,n.jsx)(g.sA,{id:"actions.unfollow",defaultMessage:"Unfollow"})})})]}):(0,n.jsx)(F.$n,{size:"xs",variant:"outline",disabled:l,onClick:h,loading:l,className:(0,R.cn)("group",u&&s&&"hover:border-red-600 hover:bg-transparent hover:text-red-600",e),children:u&&s?(0,n.jsxs)(a.Fragment,{children:[(0,n.jsx)("div",{className:"absolute inset-0 flex items-center justify-center opacity-0 group-hover:opacity-100",children:(0,n.jsx)(g.sA,{id:"actions.unfollow",defaultMessage:"Unfollow"})}),(0,n.jsx)("span",{className:"opacity-100 group-hover:opacity-0",children:(0,n.jsx)(g.sA,{id:"Following",defaultMessage:"Following"})})]}):(0,n.jsx)(g.sA,{id:"actions.follow",defaultMessage:"Follow"})})}var V=s(2996),D=s(69756),$=s(94547);let U=a.lazy(()=>Promise.all([s.e(924),s.e(1321),s.e(6525),s.e(5536),s.e(5956),s.e(7871),s.e(4550),s.e(5398),s.e(9505)]).then(s.bind(s,65398)).then(e=>({default:e.AccountKYCStatusBadge}))),z=(0,v.J1)` 18 fragment AccountHoverCardFields on Account { 19 id 20 publicId 21 name 22 legalName 23 slug 24 type 25 description 26 imageUrl 27 isHost 28 isArchived 29 isVerified 30 hasPublicProfile
31 ... on Individual { 32 id 33 isGuest 34 } 35 ... on AccountWithHost { 36 host { 37 id 38 slug 39 type 40 isTrustedHost 41 isFirstPartyHost 42 isVerified 43 hasPublicProfile 44 } 45 approvedAt 46 } 47 48 ... on Organization { 49 host { 50 id 51 slug 52 type 53 isTrustedHost 54 isFirstPartyHost 55 isVerified 56 hasPublicProfile 57 } 58 } 59 60 ... on AccountWithParent { 61 parent { 62 id 63 slug 64 hasPublicProfile 65 } 66 } 67 } 68`,G=(0,v.J1)` 69 query UserContextualMemberships( 70 $userSlug: String! 71 $accountSlug: String 72 $hostSlug: String 73 $getHostAdmin: Boolean! 74 $getAccountAdmin: Boolean! 75 ) { 76 account(slug: $userSlug) { 77 id 78 accountAdminMemberships: memberOf(role: [ADMIN], account: { slug: $accountSlug }, isApproved: true) 79 @include(if: $getAccountAdmin) { 80 nodes { 81 id 82 role 83 since 84 account { 85 id 86 slug 87 } 88 } 89 } 90 hostAdminMemberships: memberOf(role: [ADMIN], account: { slug: $hostSlug }, isApproved: true) 91 @include(if: $getHostAdmin) { 92 nodes { 93 id 94 role 95 since 96 account { 97 id 98 slug 99 } 100 } 101 } 102 } 103 } 104`,B=({Icon:e,info:t})=>(0,n.jsxs)("div",{className:"flex items-start gap-2 overflow-hidden text-xs text-muted-foreground",children:[(0,n.jsx)(e,{size:14,className:"shrink-0"}),(0,n.jsx)("span",{className:"[&>a]:text-foreground [&>a]:underline [&>a:hover]:text-primary",children:t})]}),W=({trigger:e,account:t,includeAdminMembership:{accountSlug:s,hostSlug:v}={},hoverCardContentProps:E,displayFollowButton:T})=>{let O,P,S,[k,R]=a.useState(!1),F=a.useContext(y.C),L=F?.account,_=!!t&&(0,j.Lb)(t),z=t?.type==="VENDOR",W=a.useRef(null),[q,Y]=a.useState(!1),{data:K,loading:X}=(0,i.IT)(G,{variables:{userSlug:t?.slug,accountSlug:s,hostSlug:v,getHostAdmin:!!v,getAccountAdmin:!!s&&s!==v},skip:!_||!t?.slug||!(s||v)||!(k||q),fetchPolicy:"cache-first"});if(!t)return e;let J=(O=t.parent&&(0,b.bl)(t.parent),P=t.host&&(0,b.bl)(t.host),[...t?.emails?.map(e=>
104({Icon:l.A,info:(0,n.jsxs)("div",{children:[e," ",(0,n.jsx)(N.A,{})]})}))||[],t.parent&&{Icon:"EVENT"===t.type?d.A:c.A,info:(0,n.jsx)(g.sA,{defaultMessage:"{childAccountType, select, EVENT {Event} PROJECT {Project} other {Account}} by {parentAccount}",id:"bZC/zt",values:{childAccountType:t.type,parentAccount:O?(0,n.jsxs)(D.A,{href:O,children:["@",t.parent.slug]}):`@${t.parent.slug}`}})},t?.host&&!t.isHost&&t?.approvedAt&&{Icon:u.A,info:(0,n.jsx)(g.sA,{defaultMessage:"Hosted by {host} since {approvedAt}",id:"PAGBSx",values:{childAccountType:t.type,host:P?(0,n.jsxs)(D.A,{href:P,children:["@",t.host.slug]}):`@${t.host.slug}`,approvedAt:(0,n.jsx)(g.XU,{dateStyle:"medium",value:t.approvedAt})}})},t.hostAgreements?.totalCount>0&&{Icon:p.A,info:(0,n.jsx)(g.sA,{defaultMessage:"Has <AgreementsLink>{hostAgreementsCount} host agreements</AgreementsLink>",id:"Zh9ojg",values:{hostAgreementsCount:t.hostAgreements?.totalCount,AgreementsLink:e=>(0,n.jsx)(D.A,{href:`/dashboard/${t.host.slug}/host-agreements?account=${t.slug}`,children:e})}})},t.stats?.balanceWithBlockedFunds&&{Icon:m.A,info:(0,n.jsx)(g.sA,{id:"BalanceAmount",defaultMessage:"Balance {balance}",values:{balance:(0,n.jsx)("span",{className:"text-foreground",children:(0,n.jsx)(V.A,{amount:(0,r.A)(t,"stats.balanceWithBlockedFunds.valueInCents",0),currency:t.stats.balanceWithBlockedFunds.currency})})}})},t?.stats?.totalPaidExpenses&&{Icon:h.A,info:(0,n.jsx)(g.sA,{defaultMessage:"Total expense payouts {currentYear}: {totalPaidExpenses}",id:"wNU66x",values:{totalPaidExpenses:(0,n.jsx)("span",{className:"text-foreground",children:(0,n.jsx)(V.A,{amount:t?.stats.totalPaidExpenses.valueInCents,currency:t?.stats.totalPaidExpenses.currency,precision:2})}),currentYear:new Date().getFullYear().toString()}})}].filter(Boolean)),Z=(S=Object.values(K?.account&&"kycStatus"in K.account&&K.account.kycStatus||{}).some(e=>e?.status===A.DkH.VERIFIED),[...K?.account?.hostAdminMemberships?.nodes?.map(e=>({Icon:u.A,info:(0,n.jsx)(g.sA,{defaultMessage:"Admin of {account} since {date}",id:"M0vlyv",values:{account:(0,n.jsxs)(D.A,{href:`/${e.account.slug}`,children:["@",e.account.slug]}),date:(0,n.jsx)(g.XU,{dateStyle:"medium",value:e.since})}})}))||[],...K?.account?.accountAdminMemberships?.nodes.map(e=>({Icon:x.A,info:(0,n.jsx)(g.sA,{defaultMessage:"Admin of {account} since {date}",id:"M0vlyv",values:{account:(0,n.jsxs)(D.A,{href:`/${e.account.slug}`,children:["@",e.account.slug]}),date:(0,n.jsx)(g.XU,{dateStyle:"medium",value:e.since})}})}))||[],S&&{Icon:f.A,info:"KYC Verified"}].filter(Boolean)),Q=F?.getProfileUrl?.(t)||(0,b.bl)(t),ee=t.legalName!==t.name&&t.legalName;return(0,n.jsxs)(I.jc,{open:k&&!z,onOpenChange:R,children:[(0,n.jsx)(I.d0,{onMouseEnter:()=>{W.current=setTimeout(()=>{Y(!0)},100)},onMouseLeave:()=>{W.current&&clearTimeout(W.current)},asChild:!0,children:e}),(0,n.jsx)(I.Et,{className:"w-80 cursor-default text-left text-sm font-normal",onClick:e=>e.stopPropagation(),...E,children:(0,n.jsxs)("div",{className:"relative flex flex-col gap-4 text-sm",children:[(0,n.jsx)("div",{className:"absolute top-0 right-0",children:k&&(0,n.jsx)(U,{account:t,host:L})}),(0,n.jsxs)("div",{className:"flex flex-col gap-3 overflow-hidden break-words",children:[(0,n.jsxs)("div",{className:"flex justify-between",children:[Q?(0,n.jsx)(D.A,{href:Q,children:(0,n.jsx)(M.Ay,{collective:t,radius:64})}):(0,n.jsx)(M.Ay,{collective:t,radius:64}),T&&(0,n.jsx)(H,{account:t,isHoverCard:!0})]}),(0,n.jsxs)("div",{className:"overflow-hidden",children:[(0,n.jsxs)("div",{className:"flex items-start gap-1",children:[Q?(0,n.jsx)(D.A,{href:Q,className:"min-w-0 break-words",children:(0,n.jsxs)("span",{className:"font-medium hover:underline",children:[t.name,ee&&(0,n.jsx)("span",{className:"font-normal text-muted-foreground",children:` (${ee})`})]})}):(0,n.jsx)("span",{className:"min-w-0 break-words",children:(0,n.jsxs)("span",{className:"font-medium",children:[t.name,ee&&(0,n.jsx)("span",{className:"font-normal text-muted-foreground",children:` (${ee})`})]})}),(0,n.jsx)(C.T,{account:t})]}),(0,n.jsxs)("span",{className:"truncate text-muted-foreground",children:["@",t.slug]})]})]}),t.description&&(0,n.jsx)("div",{className:"line-clamp-1 text-sm whitespace-pre-wrap text-foreground",children:t.description}),(J.length>0||Z.length>
1040||X)&&(0,n.jsxs)("div",{children:[J.length>0&&(0,n.jsx)("div",{className:"flex flex-col gap-2",children:J.map(({Icon:e,info:t},s)=>(0,n.jsx)(B,{Icon:e,info:t},s))}),(0,n.jsx)(w.Nt,{open:Z.length>0,children:(0,n.jsx)(w.Ke,{children:(0,n.jsx)("div",{className:(0,o.$)("flex flex-col gap-2",J.length>0&&"mt-2"),children:Z.map(({Icon:e,info:t},s)=>(0,n.jsx)(B,{Icon:e,info:t},s))})})})]}),X&&(0,n.jsx)($.A,{className:"absolute top-0 right-0 text-muted-foreground"})]})})]})}},21098:(e,t,s)=>{"use strict";s.d(t,{T:()=>u});var n=s(37876);s(14232);var a=s(54282),i=s(70382),o=s(62449),r=s(20322),l=s(49030),d=s(33341),c=s(5885);let u=({account:e,className:t,size:s=18})=>{let u=(0,r.cn)("cursor-help transition-all duration-200 hover:scale-110",t),p=e.host&&e.host.id===e.id;return e.isFirstPartyHost||p&&e.host.isFirstPartyHost?(0,n.jsxs)(l.m_,{delayDuration:0,children:[(0,n.jsx)(l.k$,{asChild:!0,children:(0,n.jsx)(a.A,{size:s,className:(0,r.cn)(u,"text-yellow-500 hover:text-yellow-600")})}),(0,n.jsxs)(l.ZI,{className:"max-w-xs py-4 font-normal",sideOffset:4,children:[(0,n.jsx)(o.sA,{defaultMessage:"This host is a certified member of <OficoLink>OFi Consortium</OficoLink> - Stewarding the Open Collective Platform. They meet the highest standards of financial management, compliance, and community support.",id:"gpm/lE",values:{OficoLink:(0,d.lv)({href:"https://oficonsortium.org/",openInNewTab:!0,fontWeight:"bold"})}}),(0,n.jsx)("br",{}),(0,n.jsxs)(c.A,{href:"https://documentation.opencollective.com/fiscal-hosts/certified-member-badge",openInNewTab:!0,display:"block",mt:2,color:"blue.300",children:[(0,n.jsx)(i.A,{className:"mr-1 inline-block",size:12}),(0,n.jsx)(o.sA,{defaultMessage:"Learn more about certification",id:"R4FCoG"})]})]})]}):e.isVerified||p&&e.host.isVerified?(0,n.jsxs)(l.m_,{delayDuration:0,children:[(0,n.jsx)(l.k$,{asChild:!0,children:(0,n.jsx)(a.A,{size:s,className:(0,r.cn)(u,"text-blue-500 hover:text-blue-600")})}),(0,n.jsxs)(l.ZI,{className:"max-w-xs py-4 font-normal",sideOffset:4,children:[(0,n.jsx)(o.sA,{defaultMessage:"{name} is a Verified Account.",id:"Z7JfKX",values:{name:(0,n.jsx)("strong",{children:e.name})}}),(0,n.jsx)("br",{}),(0,n.jsxs)(c.A,{href:"https://documentation.opencollective.com/getting-started/verification-badge",openInNewTab:!0,display:"block",mt:2,color:"blue.300",children:[(0,n.jsx)(i.A,{className:"mr-1 inline-block",size:12}),(0,n.jsx)(o.sA,{defaultMessage:"Learn more about verification",id:"oVrfUg"})]})]})]}):null}},22039:(e,t,s)=>{"use strict";s.d(t,{E:()=>W,A:()=>B});var n,a=s(37876),i=s(14232),o=s(46525),r=s(10611),l=s(28678),d=s(72632),c=s(89099),u=s(17067),p=s(62449),m=s(30988),h=s(2948),x=s(33123),f=s(60257),g=s(20322),j=s(92335),v=s(16230),b=s(97526),A=s(5634),y=s(72087),N=s(82039),w=s(87278),I=s(1509),C=s(63037),M=s(99271),E=s(28561),T=s(80207),O=s(55851),P=s(96359),S=s(76363),k=s(37293),R=s(46436);let F=(0,S.$)(function(e){return e.initialLoading?(0,a.jsx)(R.E,{className:"h-12"}):(0,a.jsxs)("div",{children:[(0,a.jsx)(P.Z,{account:e.account}),e.expenseTypeOptionError&&(0,a.jsx)(k.Fc,{variant:"destructive",className:"mt-4",children:(0,a.jsxs)(k.TN,{children:[(0,a.jsx)(O.A,{className:"inline-block align-text-bottom",size:16}),"\xa0",(0,a.jsx)(p.sA,{defaultMessage:"Grant request is not supported for this account.",id:"w5tdiG"})]})})]})},function(e){return{initialLoading:e.initialLoading,...(0,r.A)(e.options,"account"),expenseTypeOptionError:e.errors.expenseTypeOption}});var L=s(95640);let _=(0,S.$)(function(e){return e.initialLoading?(0,a.jsx)(R.E,{className:"h-12"}):(0,a.jsx)(i.Fragment,{children:(0,a.jsxs)("div",{children:[e.host?.slug!==e.account?.slug&&e.host?.policies?.EXPENSE_POLICIES?.grantPolicy&&(0,a.jsx)("div",{className:"mt-4",children:(0,a.jsx)(L.o,{title:(0,a.jsx)(p.sA,{defaultMessage:"Host instructions to submit a grant request",id:"4Yw/zi"}),policy:e.host?.policies?.EXPENSE_POLICIES?.grantPolicy,checked:e.acknowledgedHostGrantExpensePolicy,onAcknowledgedChanged:t=>e.setFieldValue("acknowledgedHostGrantExpensePolicy",t)})}),e.account?.policies?.EXPENSE_POLICIES?.grantPolicy&&(0,a.jsx)("div",{className:"mt-4",children:(0,a.jsx)(L.o,{title:(0,a.jsx)(p.sA,{defaultMessage:"Collective instructions to submit a grant request",id:"BIYvoI"}),policy:e.account?.policies?.EXPENSE_POLICIES?.grantPolicy,checked:e.acknowledgedCollectiveGrantExpensePolicy,onAcknowledgedChanged:t=>e.setFieldValue("acknowledgedCollectiveGrantExpensePolicy",t)})})]})})},function(e){return{initialLoading:e.initialLoading,setFieldValue:e.setFieldValue,...(0,r.A)(e.options,["account","host"]),...(0,r.A)(e.values,["acknowledgedCollectiveGrantExpensePolicy","acknowledgedHostGrantExpensePolicy"])}});var H=s(45574);
104function V(e){return(0,a.jsx)(H.B,{expense:e.form.options.expense})}var D=s(64487),$=s(48119),U=((n={}).INFORMATION="INFORMATION",n.GRANT_PROVIDER="GRANT_PROVIDER",n.INSTRUCTIONS="INSTRUCTIONS",n.INVITATION_NOTE="INVITATION_NOTE",n.APPLICATION_FORM="APPLICATION_FORM",n.WHO_WILL_RECEIVE_FUNDS="WHO_WILL_RECEIVE_FUNDS",n.PAYOUT_METHOD="PAYOUT_METHOD",n.DESCRIPTION="DESCRIPTION",n.SUMMARY="SUMMARY",n);let z={GRANT_PROVIDER:$.Xv.WHO_IS_PAYING,INSTRUCTIONS:["acknowledgedHostGrantExpensePolicy","acknowledgedCollectiveGrantExpensePolicy"],WHO_WILL_RECEIVE_FUNDS:$.Xv.WHO_IS_GETTING_PAID,PAYOUT_METHOD:$.Xv.PAYOUT_METHOD,INFORMATION:[],DESCRIPTION:[],SUMMARY:[],INVITATION_NOTE:[],APPLICATION_FORM:[]};function G(e){let t=i.useMemo(()=>e.steps.findIndex(e=>!e.isComplete&&!e.isHeader),[e.steps]),s=i.useMemo(()=>e.steps.find(e=>e.isHeader&&e.isActive),[e.steps]);return(0,a.jsx)("ol",{className:"fixed pl-[12px] text-sm",children:e.steps.map((e,n)=>e.isHeader?(0,a.jsx)($.ad,{stepNumber:e.stepNumber,isActive:e.isActive,isComplete:e.isComplete,isCompletedPath:t<0||e.isComplete||e.isActive,hasError:e.hasError,children:e.title},e.name):!e.isHeader&&!e.hidden&&s.items?.some(t=>t.name===e.name)?(0,a.jsx)($.yi,{isActive:e.isActive,isComplete:e.isComplete,isCompletedPath:t<0||t>=n,hasError:e.hasError,children:e.title},e.name):void 0)})}function B(e){return(0,a.jsx)(q,{expenseId:e.expenseId,draftKey:e.draftKey,account:e.account,handleOnClose:e.handleOnClose,onGrantSubmitted:e.onGrantSubmitted,duplicateGrant:e.duplicateGrant})}function W(e){let{open:t,setOpen:s,...n}=e;return t?(0,a.jsx)(B,{...n,handleOnClose:()=>s(!1)}):null}function q(e){let t=(0,c.useRouter)(),{LoggedInUser:s}=(0,f.A)(),[n,o]=i.useState(null),r=i.useCallback(()=>{s?t.replace(`/dashboard/${s.collective.slug}/submitted-grants`):t.replace(`${e.account.slug}/expenses?type=GRANT`)},[s,e.account.slug,t]),{onGrantSubmitted:l}=e,u=i.useCallback(e=>{o(e),l?.(e)},[l]);return(0,a.jsx)(C.lG,{defaultOpen:!0,onOpenChange:t=>{t||e.handleOnClose?.()},children:(0,a.jsx)(C.Cf,{hideCloseButton:!0,overlayClassName:"p-0 sm:p-0",className:"overflow-hidden rounded-none p-0 sm:max-w-screen sm:min-w-screen sm:rounded-none sm:p-0",onEscapeKeyDown:t=>{t.preventDefault(),open&&e.handleOnClose?.()},children:(0,a.jsxs)("div",{className:"flex max-h-screen min-h-screen max-w-screen min-w-screen flex-col overflow-hidden sm:bg-[#F8FAFC]",children:[(0,a.jsxs)("header",{className:"flex min-w-screen items-center justify-between border-b border-slate-100 px-4 py-3 sm:px-10",children:[(0,a.jsxs)("span",{className:"text-xl leading-7 font-bold text-slate-800",children:[!n&&(0,a.jsx)(p.sA,{defaultMessage:"Grant request to {accountName}",id:"8XxCaD",values:{accountName:e.account.name}}),n&&(0,a.jsx)("span",{className:"text-xl leading-7 font-bold text-slate-800",children:(0,a.jsx)(p.sA,{defaultMessage:"Grant request #{submittedGrantId} has been submitted successfully!",id:"wpp2sr",values:{submittedGrantId:n}})})]}),(0,a.jsx)(I.$n,{disabled:e.loading,loading:e.loading,onClick:e.handleOnClose,variant:"ghost",className:"hidden cursor-pointer items-center gap-2 px-4 py-3 text-base leading-5 font-medium text-slate-800 sm:visible sm:flex",asChild:!0,children:(0,a.jsxs)("span",{children:[(0,a.jsx)(p.sA,{id:"Close",defaultMessage:"Close"}),(0,a.jsx)(d.A,{})]})}),(0,a.jsx)(I.$n,{loading:e.loading,disabled:e.loading,onClick:e.handleOnClose,variant:"ghost",className:"cursor-pointer sm:hidden",children:(0,a.jsx)(d.A,{})})]}),(0,a.jsxs)("main",{className:"flex w-full grow overflow-hidden",children:[!n&&(0,a.jsx)(Y,{draftKey:e.draftKey,expenseId:e.expenseId,accountSlug:e.account.slug,duplicateGrant:e.duplicateGrant,onGrantSubmitted:u}),n&&(0,a.jsx)("div",{className:"flex w-full grow justify-center overflow-y-scroll",children:(0,a.jsx)("div",{className:"flex w-full max-w-(--breakpoint-xl) flex-col justify-center pt-4 sm:flex sm:flex-row sm:gap-11 sm:px-8 sm:pt-8 lg:pt-24",children:(0,a.jsx)(y.I,{expenseId:n})})})]}),n&&(0,a.jsx)(C.Es,{className:"z-30 flex justify-center border-t bg-[#BBE0FF] p-4 text-sm leading-5 text-[#184090] sm:justify-center sm:px-0",children:(0,a.jsx)(p.sA,{defaultMessage:"To view your requests: <link>View All Grants</link>",id:"aomx++",values:{link:e=>(0,a.jsx)(I.$n,{className:"ml-1 h-5 px-0 leading-5",size:"xs",variant:"link",onClick:r,children:e})}})})]})})})}function Y(e){let{toast:t}=(0,T.d)(),{LoggedInUser:s}=(0,f.A)(),[n,d]=i.useState(0),c=(0,p.tz)(),u=i.useRef(void 0),m=i.useRef({expenseId:e.expenseId,draftKey:e.draftKey,duplicateE
104xpense:e.duplicateGrant}),j=i.useCallback(e=>{t({variant:"error",message:(0,h.Rp)(c,e)})},[c,t]),v=i.useCallback(n=>{t({variant:"success",title:(0,a.jsx)(p.sA,{defaultMessage:"Grant Request submitted",id:"m/bWLw"}),message:s?(0,a.jsx)(w.BN,{hasParentTitle:!0,surveyKey:w.JJ.EXPENSE_SUBMITTED_NEW_FLOW}):null,duration:2e4}),e.onGrantSubmitted(n.data.expense.legacyId)},[s,e,t]),b=(0,N.CP)({formRef:u,initialValues:{accountSlug:e.accountSlug,title:"",expenseTypeOption:x.RBD.GRANT,inviteeAccountType:N.SB.INDIVIDUAL,expenseItems:[{key:"initial",amount:{valueInCents:0},description:""}],additionalAttachments:[],recurrenceFrequency:N.kQ.NONE,hasInvoiceOption:N.yj.NO,inviteeNewIndividual:{},inviteeNewOrganization:{organization:{}},newPayoutMethod:{data:{}}},startOptions:m.current,handleOnSubmit:!0,onSuccess:v,onError:j}),A=function(e,t,s){let[n,a]=i.useState(s),o=i.useMemo(()=>{let s=e.flatMap((e,t)=>[{...e,isHeader:!0,stepNumber:t+1,formValues:(e.items??[]).flatMap(e=>e.formValues??[])},...(e.items??[]).map(s=>({...s,header:e.name,isHeader:!1,stepNumber:t+1}))]);return s.map((e,a)=>({...e,isActive:e.name===n||"items"in e&&(e.items??[]).some(e=>e.name===n),isComplete:a!==s.length-1&&(0,l.A)((0,r.A)(t.errors,e.formValues)),hasError:!(0,l.A)((0,r.A)(t.errors,e.formValues))&&!(0,l.A)((0,r.A)(t.touched,e.formValues))&&t.submitCount>0}))},[e,n,t.errors,t.touched,t.submitCount]),d=i.useMemo(()=>o.find(e=>e.isHeader&&e.isActive),[o]);return{steps:o,activeHeaderName:d?.name,activeHeader:d,setActiveStep:a,activeStep:n}}([{name:U.INFORMATION,title:(0,a.jsx)(p.sA,{defaultMessage:"Information",id:"E80WrK"}),nextButtonMessage:(0,a.jsx)(p.sA,{defaultMessage:"Proceed",id:"VNX4fn"}),items:[{name:U.GRANT_PROVIDER,hidden:!0,formValues:["accountSlug","expenseTypeOption"]},{name:U.INSTRUCTIONS,hidden:!0,formValues:["acknowledgedCollectiveGrantExpensePolicy","acknowledgedHostGrantExpensePolicy"]},{name:U.INVITATION_NOTE,hidden:!0}]},{name:U.APPLICATION_FORM,title:(0,a.jsx)(p.sA,{defaultMessage:"Application Form",id:"TeGcrX"}),previousButtonMessage:(0,a.jsx)(p.sA,{defaultMessage:"Back",id:"Back"}),nextButtonMessage:(0,a.jsx)(p.sA,{defaultMessage:"Proceed to Summary",id:"tqKBWl"}),items:[{name:U.WHO_WILL_RECEIVE_FUNDS,title:(0,a.jsx)(p.sA,{defaultMessage:"Who will receive the funds?",id:"CAYwc2"}),formValues:["payeeSlug","inviteeNewIndividual","inviteeNewOrganization"]},{name:U.PAYOUT_METHOD,title:(0,a.jsx)(p.sA,{defaultMessage:"Payout Method",id:"PayoutMethod"}),formValues:["payoutMethodId","newPayoutMethod","payoutMethodNameDiscrepancyReason"]},{name:U.DESCRIPTION,title:(0,a.jsx)(p.sA,{defaultMessage:"Description",id:"Fields.description"}),formValues:["title","expenseItems"]}]},{name:U.SUMMARY,previousButtonMessage:(0,a.jsx)(p.sA,{defaultMessage:"Edit Grant Request",id:"rt0pRL"}),nextButtonMessage:(0,a.jsx)(p.sA,{defaultMessage:"Submit Grant Request",id:"eUf/fj"}),title:(0,a.jsx)(p.sA,{defaultMessage:"Summary",id:"Summary"})}],b,U.INFORMATION),{setActiveStep:y}=A,C=i.useCallback(e=>y(e),[y]),{setFieldTouched:M,validateForm:E,handleSubmit:O}=b,P=i.useCallback(()=>{A.activeHeaderName===U.SUMMARY?y(U.APPLICATION_FORM):A.activeHeaderName===U.APPLICATION_FORM&&y(U.INFORMATION)},[A.activeHeaderName,y]),S=i.useCallback(async()=>{let e=await E(),t=(0,r.A)(e,A.activeHeader.formValues);if(!(0,l.A)(t)){(0,g.uv)(t).forEach(e=>M(e,!0)),d(n+1);return}A.activeHeaderName===U.INFORMATION?y(U.WHO_WILL_RECEIVE_FUNDS):A.activeHeaderName===U.APPLICATION_FORM?y(U.SUMMARY):O()},[E,A.activeHeader.formValues,A.activeHeaderName,n,O,M,y]),k=Object.values(U).find(e=>!function(e,t){if(e.initialLoading)return!1;let s=z[t];return!!(0,l.A)(s)||s.map(t=>(0,l.A)((0,D.A)(e.errors,t))).every(Boolean)}(b,e));return i.useEffect(()=>{k&&n&&document.querySelector(`#${k}`)?.scrollIntoView({behavior:"smooth"})},[k,n]),(0,a.jsx)(o.QI,{value:b,children:(0,a.jsxs)("div",{className:"relative flex w-full grow flex-row justify-center overflow-y-scroll pt-10 sm:gap-11 sm:pl-8",children:[(0,a.jsx)("div",{className:"hidden w-64 min-w-44 sm:block",children:(0,a.jsx)(G,{steps:A.steps})}),(0,a.jsx)("form",{className:"flex w-full flex-col sm:max-w-3xl",ref:u,onSubmit:e=>e.preventDefault(),children:(0,a.jsxs)("div",{className:"grow basis-1 sm:px-0",children:[(0,a.jsx)("div",{className:"px-4 pb-4",children:(0,a.jsx)(K,{activeHeader:A.activeHeaderName,onVisibleSectionChange:C})}),(0,a.jsx)("div",{className:"sticky bottom-0 z-20 sm:bg-[#F8FAFC]",children:(0,a.jsxs)("div",{className:"flex justify-between px-4 py-4",children:[A.activeHeader.previousButtonMessage?(0,a.jsx)(I.$n,{variant:"outline",onClick:P,disabled:b.isSubmitting,children:A.activeHeader.previousButtonMessage}):(0,a.jsx)("div",{}),A.activeHeader.nextButtonMessage&&(0,a.jsx)(I.$n,{onClick:S,disabled:b.initialLoading,loading:b.isSubmitting,children:A.activeHeader.nextButtonMessage})]})})]})})]})})}function K(e){let t=(0,o.j7)(),s=(0,p.tz)(),{onVisibleSectionChange:n}=e,r=i.useCallback((e,t)=>{e&&n(t.target.id)},[n]);return(0,a.jsxs)("div",{className:"flex flex-col gap-8",children:[e.activeHeader===U.INFORMATION&&(0,a.jsxs)(i.Fragment,{children:[(0,a.jsx)(X,{id:U.GRANT_PROVIDER,inViewChange:r,title:(0,a.jsx)(p.sA,{defaultMessage:"Grant Provider",id:"KfOix2"}),children:(0,a.jsx)(F,{...F.getFormProps(t)})}),(t.options.host?.slug!==t.options.account?.slug&&t.options.host?.policies?.EXPENSE_POLICIES?.grantPolicy||t.options.account?.policies?.EXPENSE_POLICIES?.grantPolicy)&&(0,a.jsx)(X,{id:U.INSTRUCTIONS,inViewChange:r,title:(0,a.jsx)(p.sA,{defaultMessage:"Instructions",id:"sV2v5L"}),children:(0,a.jsx)(_,{..._.getFormProps(t)})}),t.options.expense?.status===x.Drj.DRAFT&&!(0,l.A)(t.options.expense?.draft?.recipientNote)&&(0,a.jsx)(X,{id:U.INVITATION_NOTE,inViewChange:r,title:(0,a.jsx)(p.sA,{defaultMessage:"Invitation Note",id:"aqqLMi"}),children:(0,a.jsx)(V,{form:t})})]}),e.activeHeader===U.APPLICATION_FORM&&(0,a.jsxs)(i.Fragment,{children:[(0,a.jsx)(X,{id:U.WHO_WILL_RECEIVE_FUNDS,inViewChange:r,title:(0,a.jsx)(p.sA,{defaultMessage:"Who will receive the funds?",id:"CAYwc2"}),subtitle:(0,a.jsx)(p.sA,{defaultMessage:"Select the profile of the recipient who will receive the fund",id:"VYoQSx"}),children:(0,a.jsx)(A.D,{...A.D.getFormProps(t)})}),(0,a.jsx)(X,{id:U.PAYOUT_METHOD,inViewChange:r,title:(0,a.jsx)(p.sA,{defaultMessage:"Select a payout method",id:"Ri4REE"}),subtitle:t.options.payee?.type!==m.Td.VENDOR&&t.options.isAdminOfPayee?(0,a.jsx)(p.sA,{defaultMessage:"Where do you want to re
104ceive the money",id:"CNCPij"}):(0,a.jsx)(p.sA,{defaultMessage:"Where the money will be sent to",id:"IQIlkE"}),children:(0,a.jsx)(v.fL,{...v.fL.getFormProps(t)})}),(0,a.jsxs)(X,{id:U.DESCRIPTION,inViewChange:r,title:(0,a.jsx)(p.sA,{defaultMessage:"Application Content",id:"hBBIor"}),subtitle:(0,a.jsx)(p.sA,{defaultMessage:"Add the details and information required",id:"U7azjR"}),children:[(0,a.jsxs)("div",{className:"mb-4",children:[(0,a.jsx)(E.J,{htmlFor:"grant-title",className:"text-base font-medium",children:(0,a.jsx)(p.sA,{defaultMessage:"Grant title",id:"Grant.Title"})}),(0,a.jsx)(o.D0,{name:"title",children:({field:e})=>(0,a.jsx)(M.pd,{...e,id:"grant-title",className:"mt-2",maxLength:255,placeholder:s.formatMessage({defaultMessage:"e.g., Research, software development, etc.",id:"ExpenseForm.GrantSubjectPlaceholder"}),value:e.value??"",onChange:t=>e.onChange(t),onBlur:e.onBlur})})]}),(0,a.jsx)(j.BD,{...j.BD.getFormProps(t)}),(0,a.jsx)("div",{className:"my-4 border-t border-gray-200"}),(0,a.jsx)(j.K5,{...j.K5.getFormProps(t)})]})]}),e.activeHeader===U.SUMMARY&&(0,a.jsx)(i.Fragment,{children:(0,a.jsx)(X,{id:U.SUMMARY,inViewChange:r,title:(0,a.jsx)(p.sA,{defaultMessage:"Review grant request",id:"QQ0CHl"}),children:(0,a.jsx)(b.r,{form:t})})})]})}function X(e){let{ref:t}=(0,u.Wx)({onChange:e.inViewChange,rootMargin:"-50px 0px -70% 0px"});return(0,a.jsx)("div",{ref:t,id:e.id,className:"scroll-m-8",children:(0,a.jsxs)("div",{className:"rounded-lg border border-white bg-white p-4 sm:p-6",children:[e.title&&(0,a.jsxs)("div",{className:"mb-4",children:[(0,a.jsx)("div",{className:"text-xl font-bold text-[#0F1729]",children:e.title}),e.subtitle&&(0,a.jsx)("div",{className:"text-sm text-muted-foreground",children:e.subt
104itle})]}),e.children]})})}},27147:(e,t,s)=>{"use strict";s.d(t,{Hr:()=>p,Ht:()=>f,SQ:()=>m,_2:()=>h,hO:()=>x,lp:()=>g,mB:()=>j,rI:()=>c,ty:()=>u});var n=s(37876),a=s(14232),i=s(55293),o=s(41616),r=s(79847),l=s(66646),d=s(20322);let c=i.bL,u=i.l9;i.YJ,i.ZL,i.Pb;let p=i.z6;a.forwardRef(({className:e,inset:t,children:s,...a},r)=>(0,n.jsxs)(i.ZP,{ref:r,className:(0,d.cn)("flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...a,children:[s,(0,n.jsx)(o.A,{className:"ml-auto h-4 w-4"})]})).displayName=i.ZP.displayName,a.forwardRef(({className:e,...t},s)=>(0,n.jsx)(i.G5,{ref:s,className:(0,d.cn)("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",e),...t})).displayName=i.G5.displayName;let m=a.forwardRef(({className:e,sideOffset:t=4,...s},a)=>(0,n.jsx)(i.ZL,{children:(0,n.jsx)(i.UC,{ref:a,sideOffset:t,className:(0,d.cn)("z-3000 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",e),...s})}));m.displayName=i.UC.displayName;let h=a.forwardRef(({className:e,inset:t,...s},a)=>(0,n.jsx)(i.q7,{ref:a,className:(0,d.cn)("relative flex cursor-pointer items-center gap-1.5 rounded-sm px-2 py-1.5 text-sm outline-hidden transition-colors select-none focus:bg-accent focus:text-accent-foreground data-disabled:cursor-not-allowed data-disabled:text-muted-foreground",t&&"pl-8",e),...s,onClick:s.disabled?void 0:s.onClick}));h.displayName=i.q7.displayName;let x=a.forwardRef(({className:e,children:t,checked:s,...a},o)=>(0,n.jsxs)(i.H_,{ref:o,className:(0,d.cn)("relative flex cursor-default items-center rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden transition-colors select-none focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50",e),checked:s,...a,children:[(0,n.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,n.jsx)(i.VF,{children:(0,n.jsx)(r.A,{className:"h-4 w-4"})})}),t]}));x.displayName=i.H_.displayName;let f=a.forwardRef(({className:e,children:t,...s},a)=>(0,n.jsxs)(i.hN,{ref:a,className:(0,d.cn)("relative flex cursor-default items-center rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden transition-colors select-none focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50",e),...s,children:[(0,n.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,n.jsx)(i.VF,{children:(0,n.jsx)(l.A,{className:"h-2 w-2 fill-current"})})}),t]}));f.displayName=i.hN.displayName;let g=a.forwardRef(({className:e,inset:t,...s},a)=>(0,n.jsx)(i.JU,{ref:a,className:(0,d.cn)("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...s}));g.displayName=i.JU.displayName;let j=a.forwardRef(({className:e,...t},s)=>(0,n.jsx)(i.wv,{ref:s,className:(0,d.cn)("-mx-1 my-1 h-px bg-muted",e),...t}));j.displayName=i.wv.displayName},36323:(e,t,s)=>{"use strict";s.d(t,{A:()=>n});let n=(0,s(49950).A)("lock-keyhole",[["circle",{cx:"12",cy:"16",r:"1",key:"1au0dj"}],["rect",{x:"3",y:"10",width:"18",height:"12",rx:"2",key:"6s8ecr"}],["path",{d:"M7 10V7a5 5 0 0 1 10 0v3",key:"1pqi11"}]])},37505:(e,t,s)=>{"use strict";s.d(t,{N:()=>v});var n=s(37876),a=s(14232),i=s(7218),o=s(58758),r=s(89149),l=s(48256),d=s(53700),c=s(117);function u(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}class p extends a.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if((0,d.s)(t)&&e.isPresent&&!this.props.isPresent&&!1!==this.props.pop){let e=t.offsetParent,s=(0,d.s)(e)&&e.offsetWidth||0,n=(0,d.s)(e)&&e.offsetHeight||0,a=getComputedStyle(t),i=this.props.sizeRef.current;i.height=parseFloat(a.height),i.width=parseFloat(a.width),i.top=t.offsetTop,i.left=t.offsetLeft,i.right=s-i.width-i.left,i.bottom=n-i.height-i.top,i.direction=a.direction}return null}componentDidUpdate(){}render(){return this.props.children}}function m({children:e,isPresent:t,anchorX:s,anchorY:i,root:o,pop:r}){let l=(0,a.useId)(),d=(0,a.useRef)(null),h=(0,a.useRef)({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:x}=(0,a.useContext)(c.Q),f=function(...e){return a.useCallback(function(...e){return t=>{let s=!1,n=e.map(e=>{let n=u(e,t);return s||"function"!=typeof n||(s=!0),n});if(s)return()=>{for(let t=0;t<n.length;t++){let s=n[t];"function"==typeof s?s():u(e[t],null)}}}}(...e),e)}(d,e.props?.ref??e?.ref);return(0,a.useInsertionEffect)(()=>{let{width:e,height:n,top:a,left:c,right:u,bottom:p,direction:m}=h.current;if(t||!1===r||!d.current||!e||!n)return;let f="rtl"===m,g="left"===s?f?`right: ${u}`:`left: ${c}`:f?`left: ${c}`:`right: ${u}`,j="bottom"===i?`bottom: ${p}`:`top: ${a}`;d.current.dataset.motionPopId=l;let v=document.createElement("style");x&&(v.nonce=x);let b=o??document.head;return b.appendChild(v),v.sheet&&v.sheet.insertRule(` 105 [data-motion-pop-id="${l}"] { 106 position: absolute !important; 107 width: ${e}px !important; 108 height: ${n}px !important; 109 ${g}px !important; 110 ${j}px !important; 111 } 112 `),()=>{d.current?.removeAttribute("data-motion-pop-id"),b.contains(v)&&b.removeChild(v)}},[t]),(0,n.jsx)(p,{isPresent:t,childRef:d,sizeRef:h,pop:r,children:!1===r?e:a.cloneElement(e,{ref:f})})}let h=({children:e,initial:t,isPresent:s,onExitComplete:i,custom:r,presenceAffectsLayout:d,mode:c,anch
112orX:u,anchorY:p,root:h})=>{let f=(0,o.M)(x),g=(0,a.useId)(),j=!0,v=(0,a.useMemo)(()=>(j=!1,{id:g,initial:t,isPresent:s,custom:r,onExitComplete:e=>{for(let t of(f.set(e,!0),f.values()))if(!t)return;i&&i()},register:e=>(f.set(e,!1),()=>f.delete(e))}),[s,f,i]);return d&&j&&(v={...v}),(0,a.useMemo)(()=>{f.forEach((e,t)=>f.set(t,!1))},[s]),a.useEffect(()=>{s||f.size||!i||i()},[s]),e=(0,n.jsx)(m,{pop:"popLayout"===c,isPresent:s,anchorX:u,anchorY:p,root:h,children:e}),(0,n.jsx)(l.t.Provider,{value:v,children:e})};function x(){return new Map}var f=s(11559);let g=e=>e.key||"";function j(e){let t=[];return a.Children.forEach(e,e=>{(0,a.isValidElement)(e)&&t.push(e)}),t}let v=({children:e,custom:t,initial:s=!0,onExitComplete:l,presenceAffectsLayout:d=!0,mode:c="sync",propagate:u=!1,anchorX:p="left",anchorY:m="top",root:x})=>{let[v,b]=(0,f.xQ)(u),A=(0,a.useMemo)(()=>j(e),[e]),y=u&&!v?[]:A.map(g),N=(0,a.useRef)(!0),w=(0,a.useRef)(A),I=(0,o.M)(()=>new Map),C=(0,a.useRef)(new Set),[M,E]=(0,a.useState)(A),[T,O]=(0,a.useState)(A);(0,r.E)(()=>{N.current=!1,w.current=A;for(let e=0;e<T.length;e++){let t=g(T[e]);y.includes(t)?(I.delete(t),C.current.delete(t)):!0!==I.get(t)&&I.set(t,!1)}},[T,y.length,y.join("-")]);let P=[];if(A!==M){let e=[...A];for(let t=0;t<T.length;t++){let s=T[t],n=g(s);y.includes(n)||(e.splice(t,0,s),P.push(s))}return"wait"===c&&P.length&&(e=P),O(j(e)),E(A),null}let{forceRender:S}=(0,a.useContext)(i.L);return(0,n.jsx)(n.Fragment,{children:T.map(e=>{let a=g(e),i=(!u||!!v)&&(A===T||y.includes(a));return(0,n.jsx)(h,{isPresent:i,initial:(!N.current||!!s)&&void 0,custom:t,presenceAffectsLayout:d,mode:c,root:x,onExitComplete:i?void 0:()=>{if(C.current.has(a)||!I.has(a))return;C.current.add(a),I.set(a,!0);let e=!0;I.forEach(t=>{t||(e=!1)}),e&&(S?.(),O(w.current),u&&b?.(),l&&l())},anchorX:p,anchorY:m,children:e},a)})})}},41369:(e,t,s)=>{"use strict";s.d(t,{A:()=>o});var n=s(37876);s(14232);var a=s(72976),i=s(56593);let o=({backgroundType:e="white",backgroundOpacity:t,...s})=>{let o="dark"===e,r=(0,a.A)(t)?o?.5:.75:t,l=o?"30":"255";return(0,n.jsx)(i.A,{position:"absolute",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",background:`rgba(${l}, ${l}, ${l}, ${r})`,width:"100%",height:"100%",zIndex:9999,...s})}},45918:(e,t,s)=>{"use strict";s.d(t,{A:()=>h});var n=s(37876),a=s(14232),i=s(21651),o=s(94772),r=s(5646),l=s(23968),d=s(94547);let c=()=>(0,n.jsx)("svg",{width:"8",height:"8",viewBox:"0 0 8 8",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,n.jsx)("path",{id:"checkmark-tiny",d:"M3.30913 8C3.0158 8 2.73358 7.88442 2.52358 7.67438L0.32583 5.47599C-0.10861 5.04257 -0.10861 4.34021 0.32583 3.90569C0.760269 3.47116 1.46248 3.47116 1.89692 3.90569L3.16913 5.17835L5.98574 0.462633C6.34352 -0.0341285 7.03573 -0.149706 7.53683 0.20814C8.03572 0.565985 8.14905 1.26056 7.79128 1.75843L4.21134 7.53769C4.01245 7.81663 3.68357 8 3.30913 8Z"})}),u=r.Ay.span.withConfig({componentId:"sc-19c38272-0"})(["display:flex;justify-content:center;align-items:center;position:absolute;cursor:pointer;border:1px solid #dcdee0;border-radius:4px;background-color:white;transition:background-color 0.2s;svg{opacity:0;height:0.572em;width:0.572em;fill:white;}svg[data-spinner='true']{opacity:1;fill:#999999;}"]),p=r.Ay.div.withConfig({componentId:"sc-19c38272-1"})(["position:relative;display:flex;align-items:",";line-height:1.4em;cursor:pointer;"," width:",";input{position:absolute;opacity:0;height:0;width:0;}label{cursor:pointer;margin:0;margin-left:1.4rem;z-index:9;font-weight:normal;width:auto;}","{"," ","}input:disabled{& ~ ","{background:#f7f8fa;border:1px solid #e8e9eb;cursor:not-allowed;svg{fill:",";}}& ~ label{cursor:not-allowed;}}",""],e=>e.alignItems,l.Il,e=>e.width,u,l.Ej,e=>e.error&&(0,r.AH)(["border-color:",";"],(0,i.y)("colors.red.500")),u,(0,i.y)("colors.primary.200"),e=>e.$checked?(0,r.AH)(["","{background:",";border-color:",";svg{opacity:1;}svg[data-spinner='true']{fill:#eeeeee;}}"],u,(0,i.y)("colors.primary.500"),(0,i.y)("colors.primary.500")):(0,r.AH)(["@media (hover:hover){&:hover ","{background:",";border-color:",";svg{opacity:1;}}}"],u,(0,i.y)("colors.primary.100"),(0,i.y)("colors.primary.100")));class m extends a.Component{constructor(e){super(e),this.state={checked:e.defaultChecked}}onChange(e){let{name:t,checked:s,onChange:n,disabled:a,isLoading:i}=this.props;if(a||i)return!1;void 0===s&&this.setState({checked:e}),n&&n({name:t,checked:e,type:"checkbox",target:{name:t,value:e,checked:e}})}render(){let{name:e,checked:t,label:s,disabled:a,size:i,inputId:r,width:l,alignItems:m,isLoading:h,fontSize:x,...f}=this.props,g=void 0===t?this.state.checked:t;return(0,n.jsxs)(p,{role:"button",tabIndex:0,$checked:g,onClick:e=>{e.preventDefault(),e.stopPropagation(),this.onChange(!g)},onKeyDown:e=>
112{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),this.onChange(!g))},fontSize:x||i,size:i,width:l,alignItems:m,"data-cy":`checkbox-${e}`,...(0,o.A)(f,["defaultChecked","onChange"]),children:[(0,n.jsx)("input",{id:r,name:e,type:"checkbox",checked:g,disabled:a,readOnly:!0,tabIndex:"-1"}),(0,n.jsx)(u,{"data-cy":"custom-checkbox",children:h?(0,n.jsx)(d.A,{size:i}):(0,n.jsx)(c,{})}),s&&(0,n.jsx)("label",{htmlFor:r,children:s})]})}}m.defaultProps={size:"14px",defaultChecked:!1,width:"auto",alignItems:"center"};let h=m},46794:(e,t,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/create-grant",function(){return s(83619)}])},51391:(e,t,s)=>{"use strict";s.d(t,{A:()=>n});let n=(0,s(49950).A)("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},61270:(e,t,s)=>{"use strict";s.d(t,{A:()=>A});var n=s(37876),a=s(14232),i=s(95062),o=s.n(i),r=s(98477),l=s(17771),d=s(57288),c=s(93286),u=s(5646),p=s(23968),m=s(78220),h=s(76654);let x=(0,u.I4)("div").withConfig({componentId:"sc-5062b090-0"})(["max-width:320px;z-index:1000000;opacity:0.96 !important;border-radius:4px;box-shadow:0px 3px 6px 1px rgba(20,20,20,0.08);padding:12px 16px;font-size:12px;text-transform:initial;white-space:normal;color:white;background:#141414;box-shadow:0px 4px 8px rgba(20,20,20,0.16);a{text-decoration:underline;}"]),f=(0,u.I4)("div").withConfig({componentId:"sc-5062b090-1"})(["position:absolute;font-size:8px;width:3em;height:3em;&[data-placement*='bottom']{top:0;left:0;margin-top:-0.9em;width:3em;height:1em;&::before{border-width:0 1.5em 1em 1.5em;border-color:transparent transparent #141414 transparent;filter:drop-shadow(0px -3px 3px rgba(20,20,20,0.1));}}&[data-placement*='top']{bottom:0;left:0;margin-bottom:-0.9em;width:3em;height:1em;&::before{border-width:1em 1.5em 0 1.5em;border-color:#141414 transparent transparent transparent;filter:drop-shadow(0px 3px 3px rgba(20,20,20,0.1));}}&[data-placement*='right']{left:0;margin-left:-0.9em;height:3em;width:1em;&::before{border-width:1.5em 1em 1.5em 0;border-color:transparent #141414 transparent transparent;filter:drop-shadow(-4px 3px 3px rgba(20,20,20,0.1));}}&[data-placement*='left']{right:0;margin-right:-0.9em;height:3em;width:1em;&::before{border-width:1.5em 0 1.5em 1em;border-color:transparent transparent transparent #141414;filter:drop-shadow(4px 3px 3px rgba(20,20,20,0.1));}}&::before{content:'';margin:auto;display:block;width:0;height:0;border-style:solid;}"]),g=u.I4.div.withConfig({componentId:"sc-5062b090-2"})(["display:",";"," "," "," button:disabled{pointer-events:none;}"],e=>e.display,p.wh,h.Dy,p.K_),j=[{name:"flip",options:{fallbackPlacements:["right","bottom","top"],padding:{right:100}}},{name:"offset",options:{offset:({placement:e})=>{switch(e){case"top":case"bottom":return[0,3];case"right":return[0,8];default:return[]}}}}],v=({place:e,content:t,onMouseEnter:s,onMouseLeave:a,noArrow:i})=>r.createPortal((0,n.jsx)(l.N,{placement:e,modifiers:j,children:({ref:e,style:o,placement:r,arrowProps:l})=>(0,n.jsxs)(x,{ref:e,style:o,onMouseEnter:s,onMouseLeave:a,"data-cy":"tooltip-content",children:["function"==typeof t?t():t,!i&&(0,n.jsx)(f,{ref:l.ref,"data-placement":r,style:l.style})]})}),document.body);class b extends a.Component{static{this.propTypes={place:o().oneOf(["top","right","bottom","left"]),content:o().oneOfType([o().func,o().node]),display:o().string,containerVerticalAlign:o().string,containerLineHeight:o().string,containerCursor:o().string,delayHide:o().number,noTooltip:o().bool,noArrow:o().bool,childrenContainer:o().any,children:o().oneOfType([o().func,o().node])}}static{this.defaultProps={type:"dark",place:"top",delayHide:500,display:"inline-block",containerCursor:"help"}}componentDidMount(){this.setState({id:`tooltip-${(0,m.A)()}`})}componentDidUpdate(e,t){!t.isHovered&&this.state.isHovered?(this.closeTimeout&&(clearTimeout(this.closeTimeout),this.closeTimeout=null),this.setState({showPopup:!0})):t.isHovered&&!this.state.isHovered&&(this.closeTimeout=setTimeout(()=>this.setState({showPopup:!1}),this.props.delayHide))}renderChildren(e){return"function"==typeof this.props.children?this.props.children({ref:e,onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave}):(0,n.jsx)(g,{ref:e,as:this.props.childrenContainer,display:this.props.display,onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave,verticalAlign:this.props.containerVerticalAlign,lineHeight:this.props.containerLineHeight,cursor:this.props.noTooltip?void 0:this.props.containerCursor,"data-cy":"tooltip-trigger",children:this.props.children})}
112render(){if(this.props.noTooltip)return this.renderChildren();let e=!!this.state.id;return(0,n.jsx)(a.Fragment,{children:(0,n.jsxs)(d.mS,{children:[(0,n.jsx)(c.O,{children:({ref:e})=>this.renderChildren(e)}),e&&this.state.showPopup&&(0,n.jsx)(v,{place:this.props.place,content:this.props.content,onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave,noArrow:this.props.noArrow})]})})}constructor(...e){super(...e),this.state={id:null,isHovered:!1,showPopup:!1},this.onMouseEnter=()=>{this.setState({isHovered:!0})},this.onMouseLeave=()=>{this.setState({isHovered:!1})}}}let A=b},66281:(e,t,s)=>{"use strict";s.d(t,{A:()=>u});var n=s(37876),a=s(14232),i=s(36323),o=s(62449),r=s(20322),l=s(89083),d=s(51778),c=s(33341);let u=({showContactSupportLink:e=!0})=>(0,n.jsx)("div",{className:"flex min-h-[min(52vh,480px)] w-full flex-col items-center justify-center px-4 py-10 sm:py-16",children:(0,n.jsxs)(l.Zp,{className:(0,r.cn)("mx-auto w-full max-w-lg gap-0 overflow-hidden border-border/60 bg-card py-0 shadow-md ring-1 ring-black/5","dark:ring-white/10"),children:[(0,n.jsxs)(l.aR,{className:"flex flex-col items-center gap-4 px-6 pt-8 pb-8 text-center sm:px-8 sm:pt-9 sm:pb-9",children:[(0,n.jsx)("div",{className:"inline-flex items-center justify-center rounded-full bg-muted/90 px-5 py-2.5 text-muted-foreground shadow-inner ring-1 ring-border/70 dark:bg-muted/50","aria-hidden":!0,children:(0,n.jsx)(i.A,{className:"size-6 stroke-[1.75]"})}),(0,n.jsx)("h1",{className:"max-w-[20ch] text-xl font-semibold tracking-tight text-balance text-foreground sm:max-w-none sm:text-[26px] sm:leading-8",children:(0,n.jsx)(o.sA,{defaultMessage:"Access denied",id:"T26lW2"})})]}),(0,n.jsx)(d.w,{className:"bg-border/70"}),(0,n.jsx)(l.Wu,{className:"px-6 pt-9 pb-9 sm:px-8 sm:pt-10 sm:pb-10",children:(0,n.jsxs)(l.BT,{className:"mx-auto max-w-[42ch] text-center text-[15px] leading-[1.65] text-pretty text-muted-foreground sm:text-base sm:leading-relaxed [&_a]:font-medium [&_a]:underline-offset-4 [&_a]:hover:underline",children:[(0,n.jsx)(o.sA,{id:"FeatureNotSupported.description",defaultMessage:"This page has not been activated for this account or you don't have permission to see it."}),e&&(0,n.jsxs)(a.Fragment,{children:[" ",(0,n.jsx)(o.sA,{id:"ContactSupportForDetails",defaultMessage:"Please contact <SupportLink>support</SupportLink> for more details.",values:{SupportLink:c.Ku}})]})]})})]})})},82558:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});var n=s(37876);s(14232);var a=s(62449),i=s(66281),o=s(4281);let r=({showContactSupportLink:e=!1,...t})=>{let{formatMessage:s}=(0,a.tz)(),r=s({defaultMessage:"Access denied",id:"T26lW2"});return(0,n.jsx)(o.A,{noRobots:!0,title:r,...t,children:(0,n.jsx)(i.A,{showContactSupportLink:e})})}},83619:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>P});var n=s(37876),a=s(14232),i=s(88490),o=s(89099),r=s(62449),l=s(66740),d=s(6435),c=s(2948),u=s(33123),p=s(60257),m=s(87058),h=s(8084),x=s(16201),f=s(61205),g=s(56593),j=s(41369),v=s(8545),b=s(99202),A=s(98064),y=s(98263),N=s(4281),w=s(82558),I=s(266),C=s(22039),M=s(85418);let E={hasSubmitExpense:!1,hasRequestGrant:!1},T=(0,r.YK)({TITLE:{defaultMessage:"Grant application to {account}",id:"miGVdq"}});function O(e){let t=(0,r.tz)(),s=(0,o.useRouter)(),{LoggedInUser:i,loadingLoggedInUser:l}=(0,p.A)(),f=a.useMemo(()=>{if(!e.account)return null;let s=`${(0,m.zA)(e.account)}/grants/new`;return{...(0,d.zJ)(e.account),canonicalURL:s,title:t.formatMessage(T.TITLE,{account:e.account.name})}},[e.account,t]),O=a.useCallback(()=>{let t=(0,m.bl)(e.account);s.replace(t)},[e.account,s]),{queryResult:P}=e;if(!P)return(0,n.jsx)(M.default,{});if(P.loading||l)return(0,n.jsx)(N.A,{...f,collective:e.account,withTopBar:!1,showFooter:!1,children:(0,n.jsx)("div",{className:"flex h-screen flex-col items-center justify-center p-12",children:(0,n.jsx)(A.A,{})})});if(e.error)return(0,n.jsx)(v.A,{error:e.error});if(!e.account||(0,d._w)(e.account))return(0,n.jsx)(v.A,{error:(0,c.hK)(e.collectiveSlug),log:!1});if(!(e.account.supportedExpenseTypes||[]).includes(u.RBD.GRANT))return(0,n.jsx)(w.A,{});let S=e.account;return(0,d.nh)(S,i)?l||i?(0,n.jsx)(N.A,{...f,collective:S,withTopBar:!1,showFooter:!1,children:(0,n.jsx)(C.A,{expenseId:s.query.expenseId?parseInt(s.query.expenseId,10):null,draftKey:s.query.draftKey,account:S,handleOnClose:O})}):(0,n.jsxs)(N.A,{...f,collective:S,children:[(0,n.jsx)(h.A,{collective:S,selectedCategory:x.q.BUDGET,callsToAction:E}),(0,n.jsx)(g.A,{position:"relative",minHeight:[null,800],children:(0,n.jsx)(j.A,{py:[2,null,6],top:"0",position:["fixed",null,"absolute"],justifyContent:["center",null,"flex-start"],children:(0,n.jsx)(I.B,{children:(0,n.jsx)(I.A,{showOCLogo:!1,showSubHeading:!1,hideFooter:!0,routes:{join:`/create-account?next=${encodeURIComponent(s.asPath)}`}})})})})]}):(0,n.jsx)(N.A,{...f,collective:S,children:(0,n.jsx)(b.so,{justifyContent:"center",p:5,children:(0,n.jsx)(y.A,{type:"error",withIcon:!0,children:(0,n.jsx)(r.sA,{id:"mustBeMemberOfCollective",defaultMessage:"You must be a member of the collective to see this page"})})})})}O.getInitialProps=async e=>{var t;let s=e.query.collectiveSlug,n=(t=e,t.req?.apolloClient||(0,l.K0)({initialState:window?.__NEXT_DATA__?.props?.[l.kG]})),a=await n.query({query:(0,i.J1)` 113 query CreateGrantPage($collectiveSlug: String!) { 114 account(slug: $collectiveSlug) { 115 id 116 type 117 legacyId 118 slug 119 settings 120 name 121 description 122 backgroundImageUrl 123 imageUrl 124 supportedExpenseTypes 125 isSuspended 126 features { 127 id 128 ...NavbarFields 129 } 130 ... on AccountWithParent { 131 parent { 132 id 133 legacyId 134 slug 135 type 136 backgroundImageUrl 137 imageUrl 138 } 139 } 140 } 141 } 142 143 ${f.P} 144 `,variables:{collectiveSlug:s}});return{collectiveSlug:s,account:a.data?.account,error:a.error,queryResult:a}};let P=O},85418:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>l});var n=s(37876);s(14232);var a=s(89099),i=s(56593),o=s(66906),r=s(4281);function l(){let e=(0,a.useRouter)();return(0,n.jsx)(r.A,{"data-cy":"error-page",children:(0,n.jsx)(i.A,{py:[5,6],children:(0,n.jsx)(o.A,{searchTerm:e.query?.slug})})})}},86643:(e,t,s)=>{"use strict";s.d(t,{Et:()=>d,d0:()=>l,jc:()=>r});var n=s(37876),a=s(14232),i=s(68910),o=s(20322);let r=i.bL,l=i.l9,d=a.forwardRef(({className:e,align:t="center",sideOffset:s=12,...a},r)=>(0,n.jsx)(i.UC,{ref:r,align:t,sideOffset:s,className:(0,o.cn)("z-3000 w-64 roun
144ded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",e),...a}));d.displayName=i.UC.displayName},94019:(e,t,s)=>{"use strict";s.d(t,{A:()=>x});var n=s(37876),a=s(5646),i=s(14232),o=s(73871),r=s(51812),l=s(62449),d=s(65221),c=s(99202),u=s(61270),p=s(72945);let m=()=>(0,n.jsxs)(i.Fragment,{children:["\xa0",(0,n.jsx)(d.A,{})]}),h=({helpText:e,labelFontSize:t,labelColor:s})=>(0,n.jsxs)(u.A,{content:e,children:["\xa0",(0,n.jsx)(r.v,{size:t,color:s})]}),x=({children:e,label:t,htmlFor:s,name:a,error:r,hint:d,hintPosition:u="below",success:x,disabled:g,required:j,inputType:v,labelFontSize:b,labelFontWeight:A="700",labelColor:y="black.800",labelProps:N,hideOptionalLabel:w,useRequiredLabel:I,requiredIndicator:C="*",isPrivate:M,helpText:E,flexDirection:T,justifyContent:O,alignItems:P,placeholder:S,...k})=>{let R="checkbox"===v;s=s||(a?`input-${a}`:void 0);let F=!w&&!1===j,L=!!I&&!0===j;A=N?.fontWeight||A,b=N?.labelFontSize||b;let _=t&&(0,n.jsx)(p.L9,{color:y,fontSize:b,fontWeight:A,children:t});return(0,n.jsxs)(c.az,{"data-cy":`InputField-${a||s||"unknown"}`,...k,children:[(0,n.jsxs)(c.so,{alignItems:P,flexDirection:T??(R?"row-reverse":"column"),justifyContent:O??"flex-end",children:[t&&(0,n.jsxs)(p.P,{as:"label",htmlFor:s,display:"flex",alignItems:"center",fontSize:b,fontWeight:A,mb:2*!R,mr:2,ml:R?2:void 0,cursor:R?"pointer":void 0,...N,children:[F&&!R?(0,n.jsxs)(p.L9,{color:"black.700",fontWeight:"normal",children:[(0,n.jsx)(l.sA,{id:"OptionalFieldLabel",defaultMessage:"{field} (optional)",values:{field:_}}),M&&(0,n.jsx)(m,{})]}):L?(0,n.jsxs)(p.L9,{color:"black.700",fontWeight:"label"===C?"normal":void 0,children:["label"===C?(0,n.jsx)(l.sA,{id:"RequiredFieldLabel",defaultMessage:"{field} (required)",values:{field:_}}):(0,n.jsxs)(i.Fragment,{children:[_," *"]})," ",M&&(0,n.jsx)(m,{})]}):(0,n.jsxs)(i.Fragment,{children:[_,M&&(0,n.jsx)(m,{})]}),E&&(0,n.jsx)(h,{helpText:E,labelColor:y,labelFontSize:b})]}),d&&"above"===u&&(0,n.jsx)("div",{className:"mb-2 text-xs font-light text-gray-600",children:d}),"function"==typeof e?e({name:a||s,id:s,type:v,error:!!r||void 0,success:x,disabled:g,required:j,placeholder:S}):e]}),r&&"string"==typeof r&&(0,n.jsxs)(c.az,{pt:2,lineHeight:"1em",children:[(0,n.jsx)(o.s,{color:"#E03F6A",size:16}),(0,n.jsx)(f,{ml:1,color:"black.700",fontSize:"0.9em",children:r})]}),d&&"below"===u&&(0,n.jsx)("div",{className:"mt-1 text-xs font-light text-gray-600",children:d})]})};var f=(0,a.Ay)(p.L9).withConfig({componentId:"sc-e2dca124-0"})({verticalAlign:"middle"})}},e=>{e.O(0,[1152,888,1507,924,2024,297,1321,6525,1596,5536,5956,533,3337,5520,7103,8235,4876,5303,9751,7147,9918,341,8545,7871,4550,266,9473,713,7357,8084,5398,321,8407,636,6593,8792],()=>e(e.s=46794)),_N_E=e.O()}]); 145//# sourceMappingURL=create-grant-cc4695fee3802cf4.js.map
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.