@apollosproject/canvas-embeds 2.1.536 → 2.1.537

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/widget/index.js +1 -1
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@apollosproject/canvas-embeds",
3
3
  "description": "Apollos React embed widgets",
4
- "version": "2.1.536",
4
+ "version": "2.1.537",
5
5
  "license": "MIT",
6
6
  "main": "./dist/index.umd.js",
7
7
  "module": "./dist/index.es.js",
package/widget/index.js CHANGED
@@ -1912,7 +1912,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1912
1912
  background-color: rgb(var(--color-brand-primary) / 0.3);
1913
1913
  color: inherit;
1914
1914
  }
1915
- `,x4e=({amount:a="0",selectedFrequency:e=null,selectedCampus:r=null,selectedFund:n=null,predefinedAmounts:l="",onError:o,isProcessing:c=!1,onShowPayment:m,onAmountChange:u,onFrequencyChange:h,onCampusChange:g,onFundChange:A,churchName:y,churchLogo:E,message:M,displayLogo:O,title:$,displayHeader:F})=>{var K;const{campuses:j,loading:_}=VL(),N=$L(e),k=p.useRef(null),I=p.useRef(null),z=p.useRef(null),B=l?l.split(",").map(q=>q.trim()).filter(q=>q):[];p.useEffect(()=>{N&&k.current&&z.current&&setTimeout(()=>{const q=z.current,Q=k.current;if(q&&Q){const m0=q.getBoundingClientRect();Q.getBoundingClientRect().bottom>m0.bottom&&Q.scrollIntoView({behavior:"smooth",block:"nearest"})}},100)},[N]),p.useEffect(()=>{r&&I.current&&z.current&&setTimeout(()=>{const q=z.current,Q=I.current;if(q&&Q){const m0=q.getBoundingClientRect();Q.getBoundingClientRect().bottom>m0.bottom&&Q.scrollIntoView({behavior:"smooth",block:"nearest"})}},100)},[r]);const[t0,W]=p.useState(80),i0=p.useRef(null);p.useLayoutEffect(()=>{i0.current&&(i0.current.textContent=a||"0",W(Math.max(i0.current.offsetWidth+16,80)))},[a]),p.useEffect(()=>{const q=setTimeout(()=>{i0.current&&(i0.current.textContent=a||"0",W(Math.max(i0.current.offsetWidth+16,80)))},10);return()=>clearTimeout(q)},[a]);const a0=q=>{const Q=parseFloat(q);return!isNaN(Q)&&Q>999999.99},l0=q=>{let Q=q.replace(/[^0-9.]/g,"");if(Q.includes(".")){const m0=Q.split(".");m0.length>2&&(Q=m0[0]+"."+m0.slice(1).join("")),m0[1]&&m0[1].length>2&&(Q=m0[0]+"."+m0[1].substring(0,2))}Q.length>1&&Q[0]==="0"&&Q[1]!=="."&&(Q=Q.substring(1)),!a0(Q)&&(Q==="."&&(Q="0."),u==null||u(Q))},o0=q=>{const Q=j.find(m0=>m0.id===q);if(Q){const m0={...Q,donationFunds:Q.donationFunds?Q.donationFunds.map(H0=>({...H0})):[]};g==null||g(m0),A==null||A(null)}else g==null||g(null),A==null||A(null)},e0=q=>{var m0;if(!r)return;const Q=(m0=r.donationFunds)==null?void 0:m0.find(H0=>H0.id===q);A==null||A(Q?{...Q}:null)},q0=q=>{const Q=bZ.find(m0=>m0.id===q);h==null||h(Q||null)},p0=()=>{if(typeof a=="string"){const q=parseFloat(a);return isNaN(q)?0:q}return a||0},f0=q=>Number(q).toFixed(2),S0=()=>{const q=p0();if(!q||q<=0){o({message:"Please enter a valid amount"});return}if(!r){o({message:"Please select a campus"});return}if(!n){o({message:"Please select a fund"});return}m&&m()};return S.jsxs("div",{className:"flex flex-col h-full",children:[S.jsx("style",{children:I4e}),F!=="false"?S.jsx(LL,{churchName:y,churchLogo:E,message:M,title:$,displayLogo:O,theme:void 0}):null,S.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto p-6",ref:z,children:S.jsxs("div",{className:"space-y-4",children:[S.jsxs("div",{className:"",children:[S.jsxs("div",{className:"flex items-start justify-center text-[60px] font-bold leading-none min-h-[60px]",children:[S.jsx("span",{className:"text-3xl leading-normal font-bold mt-3 flex-none text-brand dark:text-white",children:"$"}),S.jsx("span",{ref:i0,className:"absolute invisible h-0 overflow-hidden whitespace-pre text-[80px] font-bold font-inherit p-0 m-0",style:{fontFamily:"inherit",position:"absolute",left:"-9999px",top:"-9999px"},children:a||"0"}),S.jsx("input",{type:"text",inputMode:"decimal",placeholder:"0",value:a,onKeyDown:q=>{if(!["Backspace","Delete","Tab","Escape","Enter","ArrowLeft","ArrowUp","ArrowRight","ArrowDown"].includes(q.key)){if(/^[0-9]$/.test(q.key)||q.key==="."||q.ctrlKey||q.metaKey){if(q.key==="."&&a.includes(".")){q.preventDefault();return}if(/^[0-9]$/.test(q.key)){const Q=q.target,m0=Q.value,H0=Q.selectionStart||0,L0=m0.substring(0,H0)+q.key+m0.substring(Q.selectionEnd||0);if(a0(L0)){q.preventDefault();return}}return}q.preventDefault()}},onChange:q=>{const Q=q.target.value;l0(Q),requestAnimationFrame(()=>{if(i0.current){i0.current.textContent=Q||"0";const m0=Math.max(i0.current.offsetWidth+16,80);W(m0)}})},onInput:q=>{const Q=q.target.value;if(i0.current){i0.current.textContent=Q||"0";const m0=Math.max(i0.current.offsetWidth+16,80);W(m0)}},onKeyUp:q=>{const Q=q.target.value;if(i0.current){i0.current.textContent=Q||"0";const m0=Math.max(i0.current.offsetWidth+16,80);W(m0)}},onFocus:q=>{setTimeout(()=>{q.target.select()},0)},onClick:q=>{q.target.select()},disabled:c||_,className:"text-[80px] font-bold border-none outline-none bg-transparent flex-none p-0 m-0 text-brand dark:text-white caret-current text-center appearance-none transition-[width] duration-100 ease-in-out",style:{width:`${t0}px`}})]}),B&&B.length>0?S.jsx("div",{className:"flex flex-wrap pt-12",style:{gap:"6px"},children:B.map(q=>S.jsxs(Qe,{onClick:()=>l0(q),disabled:c||_,surface:a===q?"solid":"material",className:"min-w-0 flex-1",style:{flexBasis:"calc(25% - 4.5px)",minWidth:"0",...a===q&&{"--btn-bg":"rgb(var(--color-brand-primary))","--btn-hover-overlay":"rgb(255 255 255 / 15%)"}},children:["$",q]},q))}):null]}),S.jsx("div",{children:S.jsxs("div",{className:"flex",children:[S.jsxs(Qe,{onClick:()=>{h==null||h(bZ[2])},disabled:c||_,surface:N?"solid":"material",className:"flex-1 rounded-r-none",style:{...N&&{"--btn-bg":"rgb(var(--color-brand-primary))","--btn-hover-overlay":"rgb(255 255 255 / 15%)"}},children:[S.jsx(FL,{size:24}),"Recurring"]}),S.jsxs(Qe,{onClick:()=>h==null?void 0:h(null),disabled:c||_,surface:N?"material":"solid",className:"flex-1 rounded-l-none",style:{...!N&&{"--btn-bg":"rgb(var(--color-brand-primary))","--btn-hover-overlay":"rgb(255 255 255 / 15%)"}},children:[S.jsx(jL,{size:24}),"One time"]})]})}),N?S.jsxs("div",{ref:k,children:[S.jsx(ge,{className:"mb-4 pl-4 text-sm",fg:"secondary",children:"Frequency"}),S.jsxs(cO,{value:(e==null?void 0:e.id)||"",onChange:q=>q0(q.target.value),disabled:c||_,required:!0,surface:"material",children:[S.jsx("option",{value:"",children:"Select a frequency"}),bZ.map(q=>S.jsx("option",{value:q.id,children:q.id},q.id))]})]}):null,S.jsxs("div",{children:[S.jsx(ge,{className:"mb-4 pl-4 text-sm",fg:"secondary",children:"Campus"}),S.jsxs(cO,{value:(r==null?void 0:r.id)||"",onChange:q=>o0(q.target.value),disabled:c||_,required:!0,surface:"material",children:[S.jsx("option",{value:"",children:_?"Loading...":"Select a campus"}),j.map(q=>S.jsx("option",{value:q.id,children:q.name},q.id))]})]}),r?S.jsxs("div",{ref:I,children:[S.jsx(ge,{className:"mb-4 pl-4 text-sm",fg:"secondary",children:"Fund"}),S.jsxs(cO,{value:(n==null?void 0:n.id)||"",onChange:q=>e0(q.target.value),disabled:c,required:!0,surface:"material",children:[S.jsx("option",{value:"",children:"Select a fund"}),(K=r.donationFunds)==null?void 0:K.sort((q,Q)=>(q.displayOrder||0)-(Q.displayOrder||0)).map(q=>S.jsx("option",{value:q.id,children:q.displayName||q.name},q.id))]})]}):null]})}),S.jsxs("div",{className:"sticky bottom-0 z-10 px-6 py-4 bg-system-chrome dark:bg-system-chrome-dark",children:[S.jsxs(Qe,{type:"button",className:"w-full py-3",onClick:S0,disabled:c||_||!r||!n||p0()<=0,surface:"solid",children:["Give $",f0(p0())," ",N&&e?e.id:""]}),S.jsx("div",{className:"text-center mt-4 px-6",children:S.jsxs(ge,{className:"text-sm",fg:"secondary",children:["By making this gift, you agree to our",S.jsx("br",{})," ",S.jsx("a",{href:"https://apollos.com/terms",target:"_blank",rel:"noopener noreferrer",className:"text-brand-primary underline",children:"Terms of Use"})," ","and"," ",S.jsx("a",{href:"https://apollos.com/privacy",target:"_blank",rel:"noopener noreferrer",className:"text-brand-primary underline",children:"Privacy Policy"}),"."]})})]})]})},l00=({onRetry:a,theme:e})=>{var r,n;return S.jsxs("div",{className:"text-center p-6 flex flex-col items-center justify-center min-h-full",children:[S.jsx("div",{className:"mb-6",children:S.jsx(eA,{size:64,color:((n=(r=e==null?void 0:e.colors)==null?void 0:r.base)==null?void 0:n.secondary)||"#17B582",weight:"fill"})}),S.jsx(ge,{as:"h3",className:"mb-4",children:"Thank You!"}),S.jsx(ge,{fg:"secondary",className:"mb-12",children:"Your donation has been processed successfully."}),S.jsx(Qe,{surface:"solid",onClick:a,children:"Make Another Donation"})]})};l00.propTypes={onRetry:Y0.func.isRequired};const D4e=({amount:a="0",frequency:e,message:r="",campus:n="",fund:l="",predefinedAmounts:o="",width:c="",height:m="",displayLogo:u="",title:h="",displayHeader:g="",prefilledPayment:A=null,userFirstName:y=null,userLastName:E=null,userEmail:M=null,userPhone:O=null})=>{var r1,N1,u1,H1,X1,ke;const $=p.useCallback(t1=>{switch(t1){case"weekly":return"Weekly";case"every-2-weeks":return"Every 2 Weeks";case"monthly":return"Monthly";case"one-time":return null;case void 0:return null;default:return"Monthly"}},[]),F=p.useCallback(t1=>{if(t1==="one-time")return null;const B0=$(t1);return bZ.find(d1=>d1.id===B0)||null},[$]),j=t1=>typeof t1=="string"&&parseFloat(t1)>0,_=t1=>typeof t1=="string"&&t1.trim().length>0,N=t1=>t1===null||typeof t1=="string"&&t1.trim().length>0,k=t1=>t1==null||typeof t1=="object"&&!!t1.id,I=p.useCallback(t1=>t1?j(t1.amount)&&_(t1.campusId)&&N(t1.fundId||null)&&k(t1.selectedFrequency):!1,[]),[z,B]=p.useState("setup"),[t0,W]=p.useState(""),[i0,a0]=p.useState(null),[l0,o0]=p.useState(!1),[e0,q0]=p.useState(null),[p0,f0]=p.useState(()=>A&&I(A)?{amount:A.amount,selectedFrequency:A.selectedFrequency??null,selectedCampusId:A.campusId,selectedFundId:A.fundId??null,selectedCampus:null,selectedFund:null}:{amount:j((A==null?void 0:A.amount)||"")?(A==null?void 0:A.amount)||"":a,selectedFrequency:k(A==null?void 0:A.selectedFrequency)?(A==null?void 0:A.selectedFrequency)??null:F(e),selectedCampusId:_((A==null?void 0:A.campusId)||"")?(A==null?void 0:A.campusId)||"":n||null,selectedFundId:N((A==null?void 0:A.fundId)||null)?(A==null?void 0:A.fundId)??null:l||null,selectedCampus:null,selectedFund:null}),[S0,K]=p.useState(!1),q=p.useRef({amount:a,campus:n,fund:l}),{currentChurch:Q,loading:m0,error:H0}=ML(),{campuses:L0}=VL(),c0=qJ(),w0=e4e(),X=p.useMemo(()=>{var B0,d1,x1,ie,Ae,qe,Ge,G2,De,Se,Re,n2,o2,e8;const t1={light:{primary:((d1=(B0=w0==null?void 0:w0.colors)==null?void 0:B0.base)==null?void 0:d1.primary)||"#00676D",background:Xe.colors.light.fill.screen,componentBackground:Xe.colors.light.fill.paper,componentBorder:Xe.colors.light.neutral.gray5,componentDivider:Xe.colors.light.neutral.gray4,primaryText:Xe.colors.light.text.primary,secondaryText:Xe.colors.light.text.secondary,componentText:Xe.colors.light.text.primary,icon:Xe.colors.light.neutral.gray},dark:{primary:((ie=(x1=w0==null?void 0:w0.colors)==null?void 0:x1.base)==null?void 0:ie.secondary)||"#17B582",background:Xe.colors.dark.fill.screen,componentBackground:Xe.colors.dark.fill.paper,componentBorder:Xe.colors.dark.neutral.gray5,componentDivider:Xe.colors.dark.neutral.gray4,primaryText:Xe.colors.dark.text.primary,secondaryText:Xe.colors.dark.text.secondary,componentText:Xe.colors.dark.text.primary,icon:Xe.colors.dark.neutral.gray}};return{theme:c0==="dark"?"night":"stripe",variables:{colorPrimary:((qe=(Ae=w0==null?void 0:w0.colors)==null?void 0:Ae.base)==null?void 0:qe.primary)||"#00676D",colorBackground:c0==="dark"?t1.dark.componentBackground:t1.light.componentBackground,colorText:c0==="dark"?t1.dark.primaryText:t1.light.primaryText,colorTextSecondary:c0==="dark"?t1.dark.secondaryText:t1.light.secondaryText,colorTextPlaceholder:c0==="dark"?t1.dark.secondaryText:t1.light.secondaryText,colorDanger:((G2=(Ge=w0==null?void 0:w0.colors)==null?void 0:Ge.base)==null?void 0:G2.alert)||"#FF4444",colorSuccess:((Se=(De=w0==null?void 0:w0.colors)==null?void 0:De.base)==null?void 0:Se.success)||"#17B582",colorWarning:((n2=(Re=w0==null?void 0:w0.colors)==null?void 0:Re.base)==null?void 0:n2.warning)||"#FFA500",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",fontSizeBase:"16px",spacingUnit:((o2=w0==null?void 0:w0.space)==null?void 0:o2.xxxs)||"4px",borderRadius:((e8=w0==null?void 0:w0.radii)==null?void 0:e8.base)||"6px",iconColor:c0==="dark"?t1.dark.icon:t1.light.icon}}},[w0,c0]);p.useEffect(()=>{var t1;if((t1=Q==null?void 0:Q.stripeConnectAccount)!=null&&t1.publishableKey){const B0=G6e(Q.stripeConnectAccount.publishableKey);q0(B0)}},[(r1=Q==null?void 0:Q.stripeConnectAccount)==null?void 0:r1.publishableKey]),p.useEffect(()=>{A||(((Q==null?void 0:Q.slug)==="crossroads"||(Q==null?void 0:Q.slug)==="crossroads_sandbox")&&e===void 0?f0(t1=>({...t1,selectedFrequency:F("monthly")})):f0(t1=>({...t1,selectedFrequency:F(e)})))},[Q==null?void 0:Q.slug,A,e,F]),p.useEffect(()=>{!A&&a!==q.current.amount&&a!==p0.amount&&f0(t1=>({...t1,amount:a})),q.current.amount=a},[a,A]),p.useEffect(()=>{!A&&n!==q.current.campus&&n!==p0.selectedCampusId&&f0(t1=>({...t1,selectedCampusId:n||null,selectedCampus:null,selectedFund:null,selectedFundId:null})),q.current.campus=n},[n,A]),p.useEffect(()=>{!A&&l!==q.current.fund&&l!==p0.selectedFundId&&f0(t1=>({...t1,selectedFundId:l||null,selectedFund:null})),q.current.fund=l},[l,A]),p.useEffect(()=>{var t1;if(!A&&p0.selectedFundId&&((t1=p0.selectedCampus)!=null&&t1.donationFunds)&&!p0.selectedFund){let B0=p0.selectedCampus.donationFunds.find(d1=>d1.id===p0.selectedFundId);B0||(B0=p0.selectedCampus.donationFunds.find(d1=>wd(p0.selectedFundId,d1.name)||d1.displayName&&wd(p0.selectedFundId,d1.displayName))),B0&&f0(d1=>({...d1,selectedFund:{...B0}}))}},[A,p0.selectedFundId,(N1=p0.selectedCampus)==null?void 0:N1.donationFunds,p0.selectedFund]),p.useEffect(()=>{if(L0.length>0&&p0.selectedCampusId&&!p0.selectedCampus){const t1=p0.selectedCampusId.startsWith("Campus:")?p0.selectedCampusId.substring(7):p0.selectedCampusId;let B0=L0.find(d1=>d1.id===t1);if(B0||(B0=L0.find(d1=>d1.id===p0.selectedCampusId)),B0||(B0=L0.find(d1=>wd(p0.selectedCampusId,d1.name))),B0){const d1={...B0,donationFunds:B0.donationFunds?B0.donationFunds.map(x1=>({...x1})):[]};if(f0(x1=>({...x1,selectedCampus:d1})),p0.selectedFundId&&d1.donationFunds){let x1=d1.donationFunds.find(ie=>ie.id===p0.selectedFundId);x1||(x1=d1.donationFunds.find(ie=>wd(p0.selectedFundId,ie.name)||ie.displayName&&wd(p0.selectedFundId,ie.displayName))),x1&&f0(ie=>({...ie,selectedFund:{...x1}}))}}}},[L0,p0.selectedCampusId,p0.selectedFundId,p0.selectedCampus]);const[Z0,{loading:g0}]=K6e(),b0=p.useCallback(()=>{B("success")},[]),A0=p.useCallback(t1=>{W(t1.message)},[]),n0=p.useCallback(()=>{W("")},[]),_0=p.useCallback(()=>{B("setup"),W(""),a0(null),K(!1),f0({amount:a,selectedFrequency:F(e),selectedCampusId:null,selectedFundId:null,selectedCampus:null,selectedFund:null}),o0(!1)},[a,e,F]),v0=p.useCallback(t1=>{f0(B0=>({...B0,amount:t1}))},[]),U0=p.useCallback(t1=>{f0(B0=>({...B0,selectedFrequency:t1}))},[]),e1=p.useCallback(t1=>{f0(B0=>({...B0,selectedCampus:t1,selectedCampusId:(t1==null?void 0:t1.id)||null,selectedFund:null,selectedFundId:null}))},[]),f1=p.useCallback(t1=>{f0(B0=>({...B0,selectedFund:t1,selectedFundId:(t1==null?void 0:t1.id)||null}))},[]),C1=p.useCallback(async(t1,B0,d1,x1)=>{var ie;try{const Ae={amount:Math.round(t1*100),campusId:d1||"",fundId:x1||null};B0==="one-time"?Ae.recurring={interval:"off",intervalCount:1}:Ae.recurring={interval:B0==="monthly"?"month":"year",intervalCount:1};const{data:qe,errors:Ge}=await Z0({variables:{input:Ae}});if(Ge)throw new Error(Ge[0].message);if((ie=qe==null?void 0:qe.createPaymentIntent)!=null&&ie.clientSecret)a0(qe.createPaymentIntent.clientSecret),B("payment");else throw new Error("No client secret received from server")}catch(Ae){A0(Ae)}},[Z0,A0]),E1=p.useCallback(()=>{B("setup"),a0(null)},[]),m1={width:c?isNaN(Number(c))?c:`${c}px`:"100%",height:m?isNaN(Number(m))?m:`${m}px`:"500px",maxWidth:c?void 0:"400px",margin:c?"0":"0 auto",border:"none",position:"relative",overflow:"hidden",padding:0},a1=m0||!e0||g0||l0;if(p.useEffect(()=>{A&&I(A)&&!m0&&!g0&&!S0&&z==="setup"&&(K(!0),f0({amount:A.amount,selectedFrequency:A.selectedFrequency??null,selectedCampusId:A.campusId,selectedFundId:A.fundId??null,selectedCampus:null,selectedFund:null}),C1(parseFloat(A.amount),YJ(A.selectedFrequency),A.campusId,A.fundId??""))},[A,m0,g0,S0,z,C1,I]),H0)return S.jsx(U6,{style:m1,children:S.jsxs("div",{className:"flex-1 flex flex-col justify-center items-center p-3",children:[S.jsx(ge,{className:"text-red-600",children:"Unable to load church information. Please try again later."}),S.jsx(Qe,{surface:"tinted",onClick:_0,className:"mt-2",children:"Try Again"})]})});if(!m0&&!e0)return S.jsx(U6,{style:m1,children:S.jsx("div",{className:"flex-1 flex flex-col justify-center items-center p-3",children:S.jsx(ge,{className:"text-red-600",children:"Online giving is not currently available. Please contact your church for assistance."})})});if(z==="success")return S.jsx(U6,{style:m1,children:S.jsx("div",{className:"flex-1 flex flex-col justify-center items-center",children:S.jsx(l00,{onRetry:_0,theme:w0||void 0})})});const G0=y||E?`${y} ${E}`.trim():"",T0=(Q==null?void 0:Q.name)||"Your Church";return S.jsxs(U6,{style:m1,children:[a1?S.jsx("div",{className:"absolute inset-0 bg-material-screen dark:bg-material-screen-dark flex items-center justify-center z-[1000]",children:S.jsx(m5,{size:32,className:"animate-spin mx-auto mb-2"})}):null,t0?S.jsxs("div",{className:"absolute top-0 left-0 right-0 z-50 p-3 flex items-center gap-2 bg-red-50 dark:bg-red-900/20 rounded-xl",style:{borderColor:((H1=(u1=w0==null?void 0:w0.colors)==null?void 0:u1.base)==null?void 0:H1.alert)||"#FF4444"},children:[S.jsx(bL,{size:20,color:((ke=(X1=w0==null?void 0:w0.colors)==null?void 0:X1.base)==null?void 0:ke.alert)||"#FF4444",weight:"fill"}),S.jsx("div",{className:"flex-1",children:S.jsx(ge,{className:"text-red-700 dark:text-red-300 font-medium text-sm",children:t0})}),S.jsx(Qe,{surface:"tinted",onClick:n0,className:"p-1 min-w-0 text-red-700 dark:text-red-300 hover:bg-red-100 dark:hover:bg-red-800/30",children:S.jsx(sg,{size:16})})]}):null,S.jsx("div",{className:"flex flex-col h-full min-h-[400px]",children:z==="payment"&&i0&&e0?S.jsx(NJ,{stripe:e0,options:{clientSecret:i0,appearance:X},children:S.jsx(e00,{amount:p0!=null&&p0.amount?parseFloat(p0.amount):parseFloat(a),selectedFrequency:p0==null?void 0:p0.selectedFrequency,selectedCampusId:(p0==null?void 0:p0.selectedCampusId)||void 0,selectedFundId:(p0==null?void 0:p0.selectedFundId)||void 0,onSuccess:b0,onError:A0,isProcessing:l0,onProcessingChange:o0,onBack:E1,userFullName:G0,userEmail:M||void 0,userPhone:O||void 0,churchName:T0,churchLogo:Q==null?void 0:Q.logo,message:r,displayLogo:u,title:h,displayHeader:g})}):S.jsx(S.Fragment,{children:z==="setup"&&!(A&&I(A)&&!S0)?S.jsx(x4e,{amount:p0.amount,selectedFrequency:p0.selectedFrequency,selectedCampus:p0.selectedCampus,selectedFund:p0.selectedFund,predefinedAmounts:o,onError:t1=>A0(new Error(t1.message)),isProcessing:g0,onAmountChange:v0,onFrequencyChange:U0,onCampusChange:e1,onFundChange:f1,onShowPayment:()=>{const t1=typeof p0.amount=="string"?parseFloat(p0.amount):p0.amount,B0=YJ(p0.selectedFrequency);C1(t1,B0,p0.selectedCampusId||"",p0.selectedFundId||"")},churchName:T0,churchLogo:Q==null?void 0:Q.logo,message:r,displayLogo:u,title:h,displayHeader:g}):z==="setup"&&A&&I(A)&&!S0?S.jsxs("div",{className:"flex flex-col justify-center items-center h-full min-h-[400px]",children:[S.jsx(m5,{size:32,className:"animate-spin mx-auto mb-2"}),S.jsx(ge,{children:"Preparing your donation..."})]}):null})})]})},R4e=a=>{const[e,r]=p.useState(!1);p.useEffect(()=>{r(!0)},[]);const n=()=>({width:a.width?isNaN(Number(a.width))?a.width:`${a.width}px`:"100%",height:a.height?isNaN(Number(a.height))?a.height:`${a.height}px`:"500px",maxWidth:a.width?void 0:"400px",margin:a.width?"0":"0 auto",border:"none",position:"relative",overflow:"hidden",padding:0});return S.jsx(GJ,{children:e?S.jsx(D4e,{...a}):S.jsx(U6,{style:n(),children:S.jsxs("div",{className:"flex-1 flex flex-col justify-center items-center p-3",children:[S.jsx(m5,{size:32,className:"animate-spin mx-auto mb-2"}),S.jsx(ge,{className:"text-center",children:"Loading donation form..."})]})})})},z4e=p.forwardRef(function({to:e,href:r,isExternal:n,...l},o){const{navigate:c}=tZ(),m=cK(),u=sK(),h=mK(),g=tL(),A=qJ1();if(n&&r||!e)return S.jsx("a",{ref:o,href:r,...l});let y;if(typeof e=="object"){if(!e.contentId)return null;y=e.contentId.split(":").join("-")}else if(e!=null&&e.includes("ContentItem"))y=e.split("/").slice(-1)[0];else return null;if(!h&&!g)return S.jsx("a",{ref:o,...l,href:`https://apollos.site/@${A}/c/${y}`,target:"_blank",rel:"noopener noreferrer"});let E=u&&g?`/ac/${y}`:`?${m?"apollosId":"id"}=${y}`;return g||(E=`${h}${r}`),S.jsx("a",{ref:o,...l,href:E,onClick:M=>{M.preventDefault(),c({id:y})}})}),U4e=({children:a})=>S.jsx(N$1,{linkComponent:z4e,children:a});function HZ(){return HZ=Object.assign?Object.assign.bind():function(a){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},HZ.apply(null,arguments)}function o00(a,e){if(a==null)return{};var r={};for(var n in a)if({}.hasOwnProperty.call(a,n)){if(e.indexOf(n)>=0)continue;r[n]=a[n]}return r}function PL(a,e){return PL=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},PL(a,e)}function i00(a,e){a.prototype=Object.create(e.prototype),a.prototype.constructor=a,PL(a,e)}function B4e(a,e){return a.classList?!!e&&a.classList.contains(e):(" "+(a.className.baseVal||a.className)+" ").indexOf(" "+e+" ")!==-1}function q4e(a,e){a.classList?a.classList.add(e):B4e(a,e)||(typeof a.className=="string"?a.className=a.className+" "+e:a.setAttribute("class",(a.className&&a.className.baseVal||"")+" "+e))}function c00(a,e){return a.replace(new RegExp("(^|\\s)"+e+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function W4e(a,e){a.classList?a.classList.remove(e):typeof a.className=="string"?a.className=c00(a.className,e):a.setAttribute("class",c00(a.className&&a.className.baseVal||"",e))}const s00={disabled:!1};var m00={},G4e=m00.NODE_ENV!=="production"?Y0.oneOfType([Y0.number,Y0.shape({enter:Y0.number,exit:Y0.number,appear:Y0.number}).isRequired]):null,Y4e=m00.NODE_ENV!=="production"?Y0.oneOfType([Y0.string,Y0.shape({enter:Y0.string,exit:Y0.string,active:Y0.string}),Y0.shape({enter:Y0.string,enterDone:Y0.string,enterActive:Y0.string,exit:Y0.string,exitDone:Y0.string,exitActive:Y0.string})]):null;const u00=t.createContext(null);var d00=function(e){return e.scrollTop},Q4e={},Sd="unmounted",P5="exited",k5="entering",b9="entered",kL="exiting",xn=function(a){i00(e,a);function e(n,l){var o;o=a.call(this,n,l)||this;var c=l,m=c&&!c.isMounting?n.enter:n.appear,u;return o.appearStatus=null,n.in?m?(u=P5,o.appearStatus=k5):u=b9:n.unmountOnExit||n.mountOnEnter?u=Sd:u=P5,o.state={status:u},o.nextCallback=null,o}e.getDerivedStateFromProps=function(l,o){var c=l.in;return c&&o.status===Sd?{status:P5}:null};var r=e.prototype;return r.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},r.componentDidUpdate=function(l){var o=null;if(l!==this.props){var c=this.state.status;this.props.in?c!==k5&&c!==b9&&(o=k5):(c===k5||c===b9)&&(o=kL)}this.updateStatus(!1,o)},r.componentWillUnmount=function(){this.cancelNextCallback()},r.getTimeouts=function(){var l=this.props.timeout,o,c,m;return o=c=m=l,l!=null&&typeof l!="number"&&(o=l.exit,c=l.enter,m=l.appear!==void 0?l.appear:c),{exit:o,enter:c,appear:m}},r.updateStatus=function(l,o){if(l===void 0&&(l=!1),o!==null)if(this.cancelNextCallback(),o===k5){if(this.props.unmountOnExit||this.props.mountOnEnter){var c=this.props.nodeRef?this.props.nodeRef.current:em.findDOMNode(this);c&&d00(c)}this.performEnter(l)}else this.performExit();else this.props.unmountOnExit&&this.state.status===P5&&this.setState({status:Sd})},r.performEnter=function(l){var o=this,c=this.props.enter,m=this.context?this.context.isMounting:l,u=this.props.nodeRef?[m]:[em.findDOMNode(this),m],h=u[0],g=u[1],A=this.getTimeouts(),y=m?A.appear:A.enter;if(!l&&!c||s00.disabled){this.safeSetState({status:b9},function(){o.props.onEntered(h)});return}this.props.onEnter(h,g),this.safeSetState({status:k5},function(){o.props.onEntering(h,g),o.onTransitionEnd(y,function(){o.safeSetState({status:b9},function(){o.props.onEntered(h,g)})})})},r.performExit=function(){var l=this,o=this.props.exit,c=this.getTimeouts(),m=this.props.nodeRef?void 0:em.findDOMNode(this);if(!o||s00.disabled){this.safeSetState({status:P5},function(){l.props.onExited(m)});return}this.props.onExit(m),this.safeSetState({status:kL},function(){l.props.onExiting(m),l.onTransitionEnd(c.exit,function(){l.safeSetState({status:P5},function(){l.props.onExited(m)})})})},r.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},r.safeSetState=function(l,o){o=this.setNextCallback(o),this.setState(l,o)},r.setNextCallback=function(l){var o=this,c=!0;return this.nextCallback=function(m){c&&(c=!1,o.nextCallback=null,l(m))},this.nextCallback.cancel=function(){c=!1},this.nextCallback},r.onTransitionEnd=function(l,o){this.setNextCallback(o);var c=this.props.nodeRef?this.props.nodeRef.current:em.findDOMNode(this),m=l==null&&!this.props.addEndListener;if(!c||m){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var u=this.props.nodeRef?[this.nextCallback]:[c,this.nextCallback],h=u[0],g=u[1];this.props.addEndListener(h,g)}l!=null&&setTimeout(this.nextCallback,l)},r.render=function(){var l=this.state.status;if(l===Sd)return null;var o=this.props,c=o.children;o.in,o.mountOnEnter,o.unmountOnExit,o.appear,o.enter,o.exit,o.timeout,o.addEndListener,o.onEnter,o.onEntering,o.onEntered,o.onExit,o.onExiting,o.onExited,o.nodeRef;var m=o00(o,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return t.createElement(u00.Provider,{value:null},typeof c=="function"?c(l,m):t.cloneElement(t.Children.only(c),m))},e}(t.Component);xn.contextType=u00,xn.propTypes=Q4e.NODE_ENV!=="production"?{nodeRef:Y0.shape({current:typeof Element>"u"?Y0.any:function(a,e,r,n,l,o){var c=a[e];return Y0.instanceOf(c&&"ownerDocument"in c?c.ownerDocument.defaultView.Element:Element)(a,e,r,n,l,o)}}),children:Y0.oneOfType([Y0.func.isRequired,Y0.element.isRequired]).isRequired,in:Y0.bool,mountOnEnter:Y0.bool,unmountOnExit:Y0.bool,appear:Y0.bool,enter:Y0.bool,exit:Y0.bool,timeout:function(e){var r=G4e;e.addEndListener||(r=r.isRequired);for(var n=arguments.length,l=new Array(n>1?n-1:0),o=1;o<n;o++)l[o-1]=arguments[o];return r.apply(void 0,[e].concat(l))},addEndListener:Y0.func,onEnter:Y0.func,onEntering:Y0.func,onEntered:Y0.func,onExit:Y0.func,onExiting:Y0.func,onExited:Y0.func}:{};function H9(){}xn.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:H9,onEntering:H9,onEntered:H9,onExit:H9,onExiting:H9,onExited:H9},xn.UNMOUNTED=Sd,xn.EXITED=P5,xn.ENTERING=k5,xn.ENTERED=b9,xn.EXITING=kL;var K4e={},X4e=function(e,r){return e&&r&&r.split(" ").forEach(function(n){return q4e(e,n)})},_L=function(e,r){return e&&r&&r.split(" ").forEach(function(n){return W4e(e,n)})},CL=function(a){i00(e,a);function e(){for(var n,l=arguments.length,o=new Array(l),c=0;c<l;c++)o[c]=arguments[c];return n=a.call.apply(a,[this].concat(o))||this,n.appliedClasses={appear:{},enter:{},exit:{}},n.onEnter=function(m,u){var h=n.resolveArguments(m,u),g=h[0],A=h[1];n.removeClasses(g,"exit"),n.addClass(g,A?"appear":"enter","base"),n.props.onEnter&&n.props.onEnter(m,u)},n.onEntering=function(m,u){var h=n.resolveArguments(m,u),g=h[0],A=h[1],y=A?"appear":"enter";n.addClass(g,y,"active"),n.props.onEntering&&n.props.onEntering(m,u)},n.onEntered=function(m,u){var h=n.resolveArguments(m,u),g=h[0],A=h[1],y=A?"appear":"enter";n.removeClasses(g,y),n.addClass(g,y,"done"),n.props.onEntered&&n.props.onEntered(m,u)},n.onExit=function(m){var u=n.resolveArguments(m),h=u[0];n.removeClasses(h,"appear"),n.removeClasses(h,"enter"),n.addClass(h,"exit","base"),n.props.onExit&&n.props.onExit(m)},n.onExiting=function(m){var u=n.resolveArguments(m),h=u[0];n.addClass(h,"exit","active"),n.props.onExiting&&n.props.onExiting(m)},n.onExited=function(m){var u=n.resolveArguments(m),h=u[0];n.removeClasses(h,"exit"),n.addClass(h,"exit","done"),n.props.onExited&&n.props.onExited(m)},n.resolveArguments=function(m,u){return n.props.nodeRef?[n.props.nodeRef.current,m]:[m,u]},n.getClassNames=function(m){var u=n.props.classNames,h=typeof u=="string",g=h&&u?u+"-":"",A=h?""+g+m:u[m],y=h?A+"-active":u[m+"Active"],E=h?A+"-done":u[m+"Done"];return{baseClassName:A,activeClassName:y,doneClassName:E}},n}var r=e.prototype;return r.addClass=function(l,o,c){var m=this.getClassNames(o)[c+"ClassName"],u=this.getClassNames("enter"),h=u.doneClassName;o==="appear"&&c==="done"&&h&&(m+=" "+h),c==="active"&&l&&d00(l),m&&(this.appliedClasses[o][c]=m,X4e(l,m))},r.removeClasses=function(l,o){var c=this.appliedClasses[o],m=c.base,u=c.active,h=c.done;this.appliedClasses[o]={},m&&_L(l,m),u&&_L(l,u),h&&_L(l,h)},r.render=function(){var l=this.props;l.classNames;var o=o00(l,["classNames"]);return t.createElement(xn,HZ({},o,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},e}(t.Component);CL.defaultProps={classNames:""},CL.propTypes=K4e.NODE_ENV!=="production"?HZ({},xn.propTypes,{classNames:Y4e,onEnter:Y0.func,onEntering:Y0.func,onEntered:Y0.func,onExit:Y0.func,onExiting:Y0.func,onExited:Y0.func}):{};const p00={Search:xe(CL)`
1915
+ `,x4e=({amount:a="0",selectedFrequency:e=null,selectedCampus:r=null,selectedFund:n=null,predefinedAmounts:l="",onError:o,isProcessing:c=!1,onShowPayment:m,onAmountChange:u,onFrequencyChange:h,onCampusChange:g,onFundChange:A,churchName:y,churchLogo:E,message:M,displayLogo:O,title:$,displayHeader:F})=>{var K;const{campuses:j,loading:_}=VL(),N=$L(e),k=p.useRef(null),I=p.useRef(null),z=p.useRef(null),B=l?l.split(",").map(q=>q.trim()).filter(q=>q):[];p.useEffect(()=>{N&&k.current&&z.current&&setTimeout(()=>{const q=z.current,Q=k.current;if(q&&Q){const m0=q.getBoundingClientRect();Q.getBoundingClientRect().bottom>m0.bottom&&Q.scrollIntoView({behavior:"smooth",block:"nearest"})}},100)},[N]),p.useEffect(()=>{r&&I.current&&z.current&&setTimeout(()=>{const q=z.current,Q=I.current;if(q&&Q){const m0=q.getBoundingClientRect();Q.getBoundingClientRect().bottom>m0.bottom&&Q.scrollIntoView({behavior:"smooth",block:"nearest"})}},100)},[r]);const[t0,W]=p.useState(80),i0=p.useRef(null);p.useLayoutEffect(()=>{i0.current&&(i0.current.textContent=a||"0",W(Math.max(i0.current.offsetWidth+16,80)))},[a]),p.useEffect(()=>{const q=setTimeout(()=>{i0.current&&(i0.current.textContent=a||"0",W(Math.max(i0.current.offsetWidth+16,80)))},10);return()=>clearTimeout(q)},[a]);const a0=q=>{const Q=parseFloat(q);return!isNaN(Q)&&Q>999999.99},l0=q=>{let Q=q.replace(/[^0-9.]/g,"");if(Q.includes(".")){const m0=Q.split(".");m0.length>2&&(Q=m0[0]+"."+m0.slice(1).join("")),m0[1]&&m0[1].length>2&&(Q=m0[0]+"."+m0[1].substring(0,2))}Q.length>1&&Q[0]==="0"&&Q[1]!=="."&&(Q=Q.substring(1)),!a0(Q)&&(Q==="."&&(Q="0."),u==null||u(Q))},o0=q=>{const Q=j.find(m0=>m0.id===q);if(Q){const m0={...Q,donationFunds:Q.donationFunds?Q.donationFunds.map(H0=>({...H0})):[]};g==null||g(m0),A==null||A(null)}else g==null||g(null),A==null||A(null)},e0=q=>{var m0;if(!r)return;const Q=(m0=r.donationFunds)==null?void 0:m0.find(H0=>H0.id===q);A==null||A(Q?{...Q}:null)},q0=q=>{const Q=bZ.find(m0=>m0.id===q);h==null||h(Q||null)},p0=()=>{if(typeof a=="string"){const q=parseFloat(a);return isNaN(q)?0:q}return a||0},f0=q=>Number(q).toFixed(2),S0=()=>{const q=p0();if(!q||q<=0){o({message:"Please enter a valid amount"});return}if(q<.5){o({message:"Please enter an amount of $0.50 or more"});return}if(!r){o({message:"Please select a campus"});return}if(!n){o({message:"Please select a fund"});return}m&&m()};return S.jsxs("div",{className:"flex flex-col h-full",children:[S.jsx("style",{children:I4e}),F!=="false"?S.jsx(LL,{churchName:y,churchLogo:E,message:M,title:$,displayLogo:O,theme:void 0}):null,S.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto p-6",ref:z,children:S.jsxs("div",{className:"space-y-4",children:[S.jsxs("div",{className:"",children:[S.jsxs("div",{className:"flex items-start justify-center text-[60px] font-bold leading-none min-h-[60px]",children:[S.jsx("span",{className:"text-3xl leading-normal font-bold mt-3 flex-none text-brand dark:text-white",children:"$"}),S.jsx("span",{ref:i0,className:"absolute invisible h-0 overflow-hidden whitespace-pre text-[80px] font-bold font-inherit p-0 m-0",style:{fontFamily:"inherit",position:"absolute",left:"-9999px",top:"-9999px"},children:a||"0"}),S.jsx("input",{type:"text",inputMode:"decimal",placeholder:"0",value:a,onKeyDown:q=>{if(!["Backspace","Delete","Tab","Escape","Enter","ArrowLeft","ArrowUp","ArrowRight","ArrowDown"].includes(q.key)){if(/^[0-9]$/.test(q.key)||q.key==="."||q.ctrlKey||q.metaKey){if(q.key==="."&&a.includes(".")){q.preventDefault();return}if(/^[0-9]$/.test(q.key)){const Q=q.target,m0=Q.value,H0=Q.selectionStart||0,L0=m0.substring(0,H0)+q.key+m0.substring(Q.selectionEnd||0);if(a0(L0)){q.preventDefault();return}}return}q.preventDefault()}},onChange:q=>{const Q=q.target.value;l0(Q),requestAnimationFrame(()=>{if(i0.current){i0.current.textContent=Q||"0";const m0=Math.max(i0.current.offsetWidth+16,80);W(m0)}})},onInput:q=>{const Q=q.target.value;if(i0.current){i0.current.textContent=Q||"0";const m0=Math.max(i0.current.offsetWidth+16,80);W(m0)}},onKeyUp:q=>{const Q=q.target.value;if(i0.current){i0.current.textContent=Q||"0";const m0=Math.max(i0.current.offsetWidth+16,80);W(m0)}},onFocus:q=>{setTimeout(()=>{q.target.select()},0)},onClick:q=>{q.target.select()},disabled:c||_,className:"text-[80px] font-bold border-none outline-none bg-transparent flex-none p-0 m-0 text-brand dark:text-white caret-current text-center appearance-none transition-[width] duration-100 ease-in-out",style:{width:`${t0}px`}})]}),B&&B.length>0?S.jsx("div",{className:"flex flex-wrap pt-12",style:{gap:"6px"},children:B.map(q=>S.jsxs(Qe,{onClick:()=>l0(q),disabled:c||_,surface:a===q?"solid":"material",className:"min-w-0 flex-1",style:{flexBasis:"calc(25% - 4.5px)",minWidth:"0",...a===q&&{"--btn-bg":"rgb(var(--color-brand-primary))","--btn-hover-overlay":"rgb(255 255 255 / 15%)"}},children:["$",q]},q))}):null]}),S.jsx("div",{children:S.jsxs("div",{className:"flex",children:[S.jsxs(Qe,{onClick:()=>{h==null||h(bZ[2])},disabled:c||_,surface:N?"solid":"material",className:"flex-1 rounded-r-none",style:{...N&&{"--btn-bg":"rgb(var(--color-brand-primary))","--btn-hover-overlay":"rgb(255 255 255 / 15%)"}},children:[S.jsx(FL,{size:24}),"Recurring"]}),S.jsxs(Qe,{onClick:()=>h==null?void 0:h(null),disabled:c||_,surface:N?"material":"solid",className:"flex-1 rounded-l-none",style:{...!N&&{"--btn-bg":"rgb(var(--color-brand-primary))","--btn-hover-overlay":"rgb(255 255 255 / 15%)"}},children:[S.jsx(jL,{size:24}),"One time"]})]})}),N?S.jsxs("div",{ref:k,children:[S.jsx(ge,{className:"mb-4 pl-4 text-sm",fg:"secondary",children:"Frequency"}),S.jsxs(cO,{value:(e==null?void 0:e.id)||"",onChange:q=>q0(q.target.value),disabled:c||_,required:!0,surface:"material",children:[S.jsx("option",{value:"",children:"Select a frequency"}),bZ.map(q=>S.jsx("option",{value:q.id,children:q.id},q.id))]})]}):null,S.jsxs("div",{children:[S.jsx(ge,{className:"mb-4 pl-4 text-sm",fg:"secondary",children:"Campus"}),S.jsxs(cO,{value:(r==null?void 0:r.id)||"",onChange:q=>o0(q.target.value),disabled:c||_,required:!0,surface:"material",children:[S.jsx("option",{value:"",children:_?"Loading...":"Select a campus"}),j.map(q=>S.jsx("option",{value:q.id,children:q.name},q.id))]})]}),r?S.jsxs("div",{ref:I,children:[S.jsx(ge,{className:"mb-4 pl-4 text-sm",fg:"secondary",children:"Fund"}),S.jsxs(cO,{value:(n==null?void 0:n.id)||"",onChange:q=>e0(q.target.value),disabled:c,required:!0,surface:"material",children:[S.jsx("option",{value:"",children:"Select a fund"}),(K=r.donationFunds)==null?void 0:K.sort((q,Q)=>(q.displayOrder||0)-(Q.displayOrder||0)).map(q=>S.jsx("option",{value:q.id,children:q.displayName||q.name},q.id))]})]}):null]})}),S.jsxs("div",{className:"sticky bottom-0 z-10 px-6 py-4 bg-system-chrome dark:bg-system-chrome-dark",children:[S.jsxs(Qe,{type:"button",className:"w-full py-3",onClick:S0,disabled:c||_||!r||!n||p0()<=0,surface:"solid",children:["Give $",f0(p0())," ",N&&e?e.id:""]}),S.jsx("div",{className:"text-center mt-4 px-6",children:S.jsxs(ge,{className:"text-sm",fg:"secondary",children:["By making this gift, you agree to our",S.jsx("br",{})," ",S.jsx("a",{href:"https://apollos.com/terms",target:"_blank",rel:"noopener noreferrer",className:"text-brand-primary underline",children:"Terms of Use"})," ","and"," ",S.jsx("a",{href:"https://apollos.com/privacy",target:"_blank",rel:"noopener noreferrer",className:"text-brand-primary underline",children:"Privacy Policy"}),"."]})})]})]})},l00=({onRetry:a,theme:e})=>{var r,n;return S.jsxs("div",{className:"text-center p-6 flex flex-col items-center justify-center min-h-full",children:[S.jsx("div",{className:"mb-6",children:S.jsx(eA,{size:64,color:((n=(r=e==null?void 0:e.colors)==null?void 0:r.base)==null?void 0:n.secondary)||"#17B582",weight:"fill"})}),S.jsx(ge,{as:"h3",className:"mb-4",children:"Thank You!"}),S.jsx(ge,{fg:"secondary",className:"mb-12",children:"Your donation has been processed successfully."}),S.jsx(Qe,{surface:"solid",onClick:a,children:"Make Another Donation"})]})};l00.propTypes={onRetry:Y0.func.isRequired};const D4e=({amount:a="0",frequency:e,message:r="",campus:n="",fund:l="",predefinedAmounts:o="",width:c="",height:m="",displayLogo:u="",title:h="",displayHeader:g="",prefilledPayment:A=null,userFirstName:y=null,userLastName:E=null,userEmail:M=null,userPhone:O=null})=>{var r1,N1,u1,H1,X1,ke;const $=p.useCallback(t1=>{switch(t1){case"weekly":return"Weekly";case"every-2-weeks":return"Every 2 Weeks";case"monthly":return"Monthly";case"one-time":return null;case void 0:return null;default:return"Monthly"}},[]),F=p.useCallback(t1=>{if(t1==="one-time")return null;const B0=$(t1);return bZ.find(d1=>d1.id===B0)||null},[$]),j=t1=>typeof t1=="string"&&parseFloat(t1)>0,_=t1=>typeof t1=="string"&&t1.trim().length>0,N=t1=>t1===null||typeof t1=="string"&&t1.trim().length>0,k=t1=>t1==null||typeof t1=="object"&&!!t1.id,I=p.useCallback(t1=>t1?j(t1.amount)&&_(t1.campusId)&&N(t1.fundId||null)&&k(t1.selectedFrequency):!1,[]),[z,B]=p.useState("setup"),[t0,W]=p.useState(""),[i0,a0]=p.useState(null),[l0,o0]=p.useState(!1),[e0,q0]=p.useState(null),[p0,f0]=p.useState(()=>A&&I(A)?{amount:A.amount,selectedFrequency:A.selectedFrequency??null,selectedCampusId:A.campusId,selectedFundId:A.fundId??null,selectedCampus:null,selectedFund:null}:{amount:j((A==null?void 0:A.amount)||"")?(A==null?void 0:A.amount)||"":a,selectedFrequency:k(A==null?void 0:A.selectedFrequency)?(A==null?void 0:A.selectedFrequency)??null:F(e),selectedCampusId:_((A==null?void 0:A.campusId)||"")?(A==null?void 0:A.campusId)||"":n||null,selectedFundId:N((A==null?void 0:A.fundId)||null)?(A==null?void 0:A.fundId)??null:l||null,selectedCampus:null,selectedFund:null}),[S0,K]=p.useState(!1),q=p.useRef({amount:a,campus:n,fund:l}),{currentChurch:Q,loading:m0,error:H0}=ML(),{campuses:L0}=VL(),c0=qJ(),w0=e4e(),X=p.useMemo(()=>{var B0,d1,x1,ie,Ae,qe,Ge,G2,De,Se,Re,n2,o2,e8;const t1={light:{primary:((d1=(B0=w0==null?void 0:w0.colors)==null?void 0:B0.base)==null?void 0:d1.primary)||"#00676D",background:Xe.colors.light.fill.screen,componentBackground:Xe.colors.light.fill.paper,componentBorder:Xe.colors.light.neutral.gray5,componentDivider:Xe.colors.light.neutral.gray4,primaryText:Xe.colors.light.text.primary,secondaryText:Xe.colors.light.text.secondary,componentText:Xe.colors.light.text.primary,icon:Xe.colors.light.neutral.gray},dark:{primary:((ie=(x1=w0==null?void 0:w0.colors)==null?void 0:x1.base)==null?void 0:ie.secondary)||"#17B582",background:Xe.colors.dark.fill.screen,componentBackground:Xe.colors.dark.fill.paper,componentBorder:Xe.colors.dark.neutral.gray5,componentDivider:Xe.colors.dark.neutral.gray4,primaryText:Xe.colors.dark.text.primary,secondaryText:Xe.colors.dark.text.secondary,componentText:Xe.colors.dark.text.primary,icon:Xe.colors.dark.neutral.gray}};return{theme:c0==="dark"?"night":"stripe",variables:{colorPrimary:((qe=(Ae=w0==null?void 0:w0.colors)==null?void 0:Ae.base)==null?void 0:qe.primary)||"#00676D",colorBackground:c0==="dark"?t1.dark.componentBackground:t1.light.componentBackground,colorText:c0==="dark"?t1.dark.primaryText:t1.light.primaryText,colorTextSecondary:c0==="dark"?t1.dark.secondaryText:t1.light.secondaryText,colorTextPlaceholder:c0==="dark"?t1.dark.secondaryText:t1.light.secondaryText,colorDanger:((G2=(Ge=w0==null?void 0:w0.colors)==null?void 0:Ge.base)==null?void 0:G2.alert)||"#FF4444",colorSuccess:((Se=(De=w0==null?void 0:w0.colors)==null?void 0:De.base)==null?void 0:Se.success)||"#17B582",colorWarning:((n2=(Re=w0==null?void 0:w0.colors)==null?void 0:Re.base)==null?void 0:n2.warning)||"#FFA500",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",fontSizeBase:"16px",spacingUnit:((o2=w0==null?void 0:w0.space)==null?void 0:o2.xxxs)||"4px",borderRadius:((e8=w0==null?void 0:w0.radii)==null?void 0:e8.base)||"6px",iconColor:c0==="dark"?t1.dark.icon:t1.light.icon}}},[w0,c0]);p.useEffect(()=>{var t1;if((t1=Q==null?void 0:Q.stripeConnectAccount)!=null&&t1.publishableKey){const B0=G6e(Q.stripeConnectAccount.publishableKey);q0(B0)}},[(r1=Q==null?void 0:Q.stripeConnectAccount)==null?void 0:r1.publishableKey]),p.useEffect(()=>{A||(((Q==null?void 0:Q.slug)==="crossroads"||(Q==null?void 0:Q.slug)==="crossroads_sandbox")&&e===void 0?f0(t1=>({...t1,selectedFrequency:F("monthly")})):f0(t1=>({...t1,selectedFrequency:F(e)})))},[Q==null?void 0:Q.slug,A,e,F]),p.useEffect(()=>{!A&&a!==q.current.amount&&a!==p0.amount&&f0(t1=>({...t1,amount:a})),q.current.amount=a},[a,A]),p.useEffect(()=>{!A&&n!==q.current.campus&&n!==p0.selectedCampusId&&f0(t1=>({...t1,selectedCampusId:n||null,selectedCampus:null,selectedFund:null,selectedFundId:null})),q.current.campus=n},[n,A]),p.useEffect(()=>{!A&&l!==q.current.fund&&l!==p0.selectedFundId&&f0(t1=>({...t1,selectedFundId:l||null,selectedFund:null})),q.current.fund=l},[l,A]),p.useEffect(()=>{var t1;if(!A&&p0.selectedFundId&&((t1=p0.selectedCampus)!=null&&t1.donationFunds)&&!p0.selectedFund){let B0=p0.selectedCampus.donationFunds.find(d1=>d1.id===p0.selectedFundId);B0||(B0=p0.selectedCampus.donationFunds.find(d1=>wd(p0.selectedFundId,d1.name)||d1.displayName&&wd(p0.selectedFundId,d1.displayName))),B0&&f0(d1=>({...d1,selectedFund:{...B0}}))}},[A,p0.selectedFundId,(N1=p0.selectedCampus)==null?void 0:N1.donationFunds,p0.selectedFund]),p.useEffect(()=>{if(L0.length>0&&p0.selectedCampusId&&!p0.selectedCampus){const t1=p0.selectedCampusId.startsWith("Campus:")?p0.selectedCampusId.substring(7):p0.selectedCampusId;let B0=L0.find(d1=>d1.id===t1);if(B0||(B0=L0.find(d1=>d1.id===p0.selectedCampusId)),B0||(B0=L0.find(d1=>wd(p0.selectedCampusId,d1.name))),B0){const d1={...B0,donationFunds:B0.donationFunds?B0.donationFunds.map(x1=>({...x1})):[]};if(f0(x1=>({...x1,selectedCampus:d1})),p0.selectedFundId&&d1.donationFunds){let x1=d1.donationFunds.find(ie=>ie.id===p0.selectedFundId);x1||(x1=d1.donationFunds.find(ie=>wd(p0.selectedFundId,ie.name)||ie.displayName&&wd(p0.selectedFundId,ie.displayName))),x1&&f0(ie=>({...ie,selectedFund:{...x1}}))}}}},[L0,p0.selectedCampusId,p0.selectedFundId,p0.selectedCampus]);const[Z0,{loading:g0}]=K6e(),b0=p.useCallback(()=>{B("success")},[]),A0=p.useCallback(t1=>{W(t1.message)},[]),n0=p.useCallback(()=>{W("")},[]),_0=p.useCallback(()=>{B("setup"),W(""),a0(null),K(!1),f0({amount:a,selectedFrequency:F(e),selectedCampusId:null,selectedFundId:null,selectedCampus:null,selectedFund:null}),o0(!1)},[a,e,F]),v0=p.useCallback(t1=>{f0(B0=>({...B0,amount:t1}))},[]),U0=p.useCallback(t1=>{f0(B0=>({...B0,selectedFrequency:t1}))},[]),e1=p.useCallback(t1=>{f0(B0=>({...B0,selectedCampus:t1,selectedCampusId:(t1==null?void 0:t1.id)||null,selectedFund:null,selectedFundId:null}))},[]),f1=p.useCallback(t1=>{f0(B0=>({...B0,selectedFund:t1,selectedFundId:(t1==null?void 0:t1.id)||null}))},[]),C1=p.useCallback(async(t1,B0,d1,x1)=>{var ie;try{const Ae={amount:Math.round(t1*100),campusId:d1||"",fundId:x1||null};B0==="one-time"?Ae.recurring={interval:"off",intervalCount:1}:Ae.recurring={interval:B0==="monthly"?"month":"year",intervalCount:1};const{data:qe,errors:Ge}=await Z0({variables:{input:Ae}});if(Ge)throw new Error(Ge[0].message);if((ie=qe==null?void 0:qe.createPaymentIntent)!=null&&ie.clientSecret)a0(qe.createPaymentIntent.clientSecret),B("payment");else throw new Error("No client secret received from server")}catch(Ae){A0(Ae)}},[Z0,A0]),E1=p.useCallback(()=>{B("setup"),a0(null)},[]),m1={width:c?isNaN(Number(c))?c:`${c}px`:"100%",height:m?isNaN(Number(m))?m:`${m}px`:"500px",maxWidth:c?void 0:"400px",margin:c?"0":"0 auto",border:"none",position:"relative",overflow:"hidden",padding:0},a1=m0||!e0||g0||l0;if(p.useEffect(()=>{A&&I(A)&&!m0&&!g0&&!S0&&z==="setup"&&(K(!0),f0({amount:A.amount,selectedFrequency:A.selectedFrequency??null,selectedCampusId:A.campusId,selectedFundId:A.fundId??null,selectedCampus:null,selectedFund:null}),C1(parseFloat(A.amount),YJ(A.selectedFrequency),A.campusId,A.fundId??""))},[A,m0,g0,S0,z,C1,I]),H0)return S.jsx(U6,{style:m1,children:S.jsxs("div",{className:"flex-1 flex flex-col justify-center items-center p-3",children:[S.jsx(ge,{className:"text-red-600",children:"Unable to load church information. Please try again later."}),S.jsx(Qe,{surface:"tinted",onClick:_0,className:"mt-2",children:"Try Again"})]})});if(!m0&&!e0)return S.jsx(U6,{style:m1,children:S.jsx("div",{className:"flex-1 flex flex-col justify-center items-center p-3",children:S.jsx(ge,{className:"text-red-600",children:"Online giving is not currently available. Please contact your church for assistance."})})});if(z==="success")return S.jsx(U6,{style:m1,children:S.jsx("div",{className:"flex-1 flex flex-col justify-center items-center",children:S.jsx(l00,{onRetry:_0,theme:w0||void 0})})});const G0=y||E?`${y} ${E}`.trim():"",T0=(Q==null?void 0:Q.name)||"Your Church";return S.jsxs(U6,{style:m1,children:[a1?S.jsx("div",{className:"absolute inset-0 bg-material-screen dark:bg-material-screen-dark flex items-center justify-center z-[1000]",children:S.jsx(m5,{size:32,className:"animate-spin mx-auto mb-2"})}):null,t0?S.jsxs("div",{className:"absolute top-0 left-0 right-0 z-50 p-3 flex items-center gap-2 bg-red-50 dark:bg-red-900/20 rounded-xl",style:{borderColor:((H1=(u1=w0==null?void 0:w0.colors)==null?void 0:u1.base)==null?void 0:H1.alert)||"#FF4444"},children:[S.jsx(bL,{size:20,color:((ke=(X1=w0==null?void 0:w0.colors)==null?void 0:X1.base)==null?void 0:ke.alert)||"#FF4444",weight:"fill"}),S.jsx("div",{className:"flex-1",children:S.jsx(ge,{className:"text-red-700 dark:text-red-300 font-medium text-sm",children:t0})}),S.jsx(Qe,{surface:"tinted",onClick:n0,className:"p-1 min-w-0 text-red-700 dark:text-red-300 hover:bg-red-100 dark:hover:bg-red-800/30",children:S.jsx(sg,{size:16})})]}):null,S.jsx("div",{className:"flex flex-col h-full min-h-[400px]",children:z==="payment"&&i0&&e0?S.jsx(NJ,{stripe:e0,options:{clientSecret:i0,appearance:X},children:S.jsx(e00,{amount:p0!=null&&p0.amount?parseFloat(p0.amount):parseFloat(a),selectedFrequency:p0==null?void 0:p0.selectedFrequency,selectedCampusId:(p0==null?void 0:p0.selectedCampusId)||void 0,selectedFundId:(p0==null?void 0:p0.selectedFundId)||void 0,onSuccess:b0,onError:A0,isProcessing:l0,onProcessingChange:o0,onBack:E1,userFullName:G0,userEmail:M||void 0,userPhone:O||void 0,churchName:T0,churchLogo:Q==null?void 0:Q.logo,message:r,displayLogo:u,title:h,displayHeader:g})}):S.jsx(S.Fragment,{children:z==="setup"&&!(A&&I(A)&&!S0)?S.jsx(x4e,{amount:p0.amount,selectedFrequency:p0.selectedFrequency,selectedCampus:p0.selectedCampus,selectedFund:p0.selectedFund,predefinedAmounts:o,onError:t1=>A0(new Error(t1.message)),isProcessing:g0,onAmountChange:v0,onFrequencyChange:U0,onCampusChange:e1,onFundChange:f1,onShowPayment:()=>{const t1=typeof p0.amount=="string"?parseFloat(p0.amount):p0.amount,B0=YJ(p0.selectedFrequency);C1(t1,B0,p0.selectedCampusId||"",p0.selectedFundId||"")},churchName:T0,churchLogo:Q==null?void 0:Q.logo,message:r,displayLogo:u,title:h,displayHeader:g}):z==="setup"&&A&&I(A)&&!S0?S.jsxs("div",{className:"flex flex-col justify-center items-center h-full min-h-[400px]",children:[S.jsx(m5,{size:32,className:"animate-spin mx-auto mb-2"}),S.jsx(ge,{children:"Preparing your donation..."})]}):null})})]})},R4e=a=>{const[e,r]=p.useState(!1);p.useEffect(()=>{r(!0)},[]);const n=()=>({width:a.width?isNaN(Number(a.width))?a.width:`${a.width}px`:"100%",height:a.height?isNaN(Number(a.height))?a.height:`${a.height}px`:"500px",maxWidth:a.width?void 0:"400px",margin:a.width?"0":"0 auto",border:"none",position:"relative",overflow:"hidden",padding:0});return S.jsx(GJ,{children:e?S.jsx(D4e,{...a}):S.jsx(U6,{style:n(),children:S.jsxs("div",{className:"flex-1 flex flex-col justify-center items-center p-3",children:[S.jsx(m5,{size:32,className:"animate-spin mx-auto mb-2"}),S.jsx(ge,{className:"text-center",children:"Loading donation form..."})]})})})},z4e=p.forwardRef(function({to:e,href:r,isExternal:n,...l},o){const{navigate:c}=tZ(),m=cK(),u=sK(),h=mK(),g=tL(),A=qJ1();if(n&&r||!e)return S.jsx("a",{ref:o,href:r,...l});let y;if(typeof e=="object"){if(!e.contentId)return null;y=e.contentId.split(":").join("-")}else if(e!=null&&e.includes("ContentItem"))y=e.split("/").slice(-1)[0];else return null;if(!h&&!g)return S.jsx("a",{ref:o,...l,href:`https://apollos.site/@${A}/c/${y}`,target:"_blank",rel:"noopener noreferrer"});let E=u&&g?`/ac/${y}`:`?${m?"apollosId":"id"}=${y}`;return g||(E=`${h}${r}`),S.jsx("a",{ref:o,...l,href:E,onClick:M=>{M.preventDefault(),c({id:y})}})}),U4e=({children:a})=>S.jsx(N$1,{linkComponent:z4e,children:a});function HZ(){return HZ=Object.assign?Object.assign.bind():function(a){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},HZ.apply(null,arguments)}function o00(a,e){if(a==null)return{};var r={};for(var n in a)if({}.hasOwnProperty.call(a,n)){if(e.indexOf(n)>=0)continue;r[n]=a[n]}return r}function PL(a,e){return PL=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},PL(a,e)}function i00(a,e){a.prototype=Object.create(e.prototype),a.prototype.constructor=a,PL(a,e)}function B4e(a,e){return a.classList?!!e&&a.classList.contains(e):(" "+(a.className.baseVal||a.className)+" ").indexOf(" "+e+" ")!==-1}function q4e(a,e){a.classList?a.classList.add(e):B4e(a,e)||(typeof a.className=="string"?a.className=a.className+" "+e:a.setAttribute("class",(a.className&&a.className.baseVal||"")+" "+e))}function c00(a,e){return a.replace(new RegExp("(^|\\s)"+e+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function W4e(a,e){a.classList?a.classList.remove(e):typeof a.className=="string"?a.className=c00(a.className,e):a.setAttribute("class",c00(a.className&&a.className.baseVal||"",e))}const s00={disabled:!1};var m00={},G4e=m00.NODE_ENV!=="production"?Y0.oneOfType([Y0.number,Y0.shape({enter:Y0.number,exit:Y0.number,appear:Y0.number}).isRequired]):null,Y4e=m00.NODE_ENV!=="production"?Y0.oneOfType([Y0.string,Y0.shape({enter:Y0.string,exit:Y0.string,active:Y0.string}),Y0.shape({enter:Y0.string,enterDone:Y0.string,enterActive:Y0.string,exit:Y0.string,exitDone:Y0.string,exitActive:Y0.string})]):null;const u00=t.createContext(null);var d00=function(e){return e.scrollTop},Q4e={},Sd="unmounted",P5="exited",k5="entering",b9="entered",kL="exiting",xn=function(a){i00(e,a);function e(n,l){var o;o=a.call(this,n,l)||this;var c=l,m=c&&!c.isMounting?n.enter:n.appear,u;return o.appearStatus=null,n.in?m?(u=P5,o.appearStatus=k5):u=b9:n.unmountOnExit||n.mountOnEnter?u=Sd:u=P5,o.state={status:u},o.nextCallback=null,o}e.getDerivedStateFromProps=function(l,o){var c=l.in;return c&&o.status===Sd?{status:P5}:null};var r=e.prototype;return r.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},r.componentDidUpdate=function(l){var o=null;if(l!==this.props){var c=this.state.status;this.props.in?c!==k5&&c!==b9&&(o=k5):(c===k5||c===b9)&&(o=kL)}this.updateStatus(!1,o)},r.componentWillUnmount=function(){this.cancelNextCallback()},r.getTimeouts=function(){var l=this.props.timeout,o,c,m;return o=c=m=l,l!=null&&typeof l!="number"&&(o=l.exit,c=l.enter,m=l.appear!==void 0?l.appear:c),{exit:o,enter:c,appear:m}},r.updateStatus=function(l,o){if(l===void 0&&(l=!1),o!==null)if(this.cancelNextCallback(),o===k5){if(this.props.unmountOnExit||this.props.mountOnEnter){var c=this.props.nodeRef?this.props.nodeRef.current:em.findDOMNode(this);c&&d00(c)}this.performEnter(l)}else this.performExit();else this.props.unmountOnExit&&this.state.status===P5&&this.setState({status:Sd})},r.performEnter=function(l){var o=this,c=this.props.enter,m=this.context?this.context.isMounting:l,u=this.props.nodeRef?[m]:[em.findDOMNode(this),m],h=u[0],g=u[1],A=this.getTimeouts(),y=m?A.appear:A.enter;if(!l&&!c||s00.disabled){this.safeSetState({status:b9},function(){o.props.onEntered(h)});return}this.props.onEnter(h,g),this.safeSetState({status:k5},function(){o.props.onEntering(h,g),o.onTransitionEnd(y,function(){o.safeSetState({status:b9},function(){o.props.onEntered(h,g)})})})},r.performExit=function(){var l=this,o=this.props.exit,c=this.getTimeouts(),m=this.props.nodeRef?void 0:em.findDOMNode(this);if(!o||s00.disabled){this.safeSetState({status:P5},function(){l.props.onExited(m)});return}this.props.onExit(m),this.safeSetState({status:kL},function(){l.props.onExiting(m),l.onTransitionEnd(c.exit,function(){l.safeSetState({status:P5},function(){l.props.onExited(m)})})})},r.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},r.safeSetState=function(l,o){o=this.setNextCallback(o),this.setState(l,o)},r.setNextCallback=function(l){var o=this,c=!0;return this.nextCallback=function(m){c&&(c=!1,o.nextCallback=null,l(m))},this.nextCallback.cancel=function(){c=!1},this.nextCallback},r.onTransitionEnd=function(l,o){this.setNextCallback(o);var c=this.props.nodeRef?this.props.nodeRef.current:em.findDOMNode(this),m=l==null&&!this.props.addEndListener;if(!c||m){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var u=this.props.nodeRef?[this.nextCallback]:[c,this.nextCallback],h=u[0],g=u[1];this.props.addEndListener(h,g)}l!=null&&setTimeout(this.nextCallback,l)},r.render=function(){var l=this.state.status;if(l===Sd)return null;var o=this.props,c=o.children;o.in,o.mountOnEnter,o.unmountOnExit,o.appear,o.enter,o.exit,o.timeout,o.addEndListener,o.onEnter,o.onEntering,o.onEntered,o.onExit,o.onExiting,o.onExited,o.nodeRef;var m=o00(o,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return t.createElement(u00.Provider,{value:null},typeof c=="function"?c(l,m):t.cloneElement(t.Children.only(c),m))},e}(t.Component);xn.contextType=u00,xn.propTypes=Q4e.NODE_ENV!=="production"?{nodeRef:Y0.shape({current:typeof Element>"u"?Y0.any:function(a,e,r,n,l,o){var c=a[e];return Y0.instanceOf(c&&"ownerDocument"in c?c.ownerDocument.defaultView.Element:Element)(a,e,r,n,l,o)}}),children:Y0.oneOfType([Y0.func.isRequired,Y0.element.isRequired]).isRequired,in:Y0.bool,mountOnEnter:Y0.bool,unmountOnExit:Y0.bool,appear:Y0.bool,enter:Y0.bool,exit:Y0.bool,timeout:function(e){var r=G4e;e.addEndListener||(r=r.isRequired);for(var n=arguments.length,l=new Array(n>1?n-1:0),o=1;o<n;o++)l[o-1]=arguments[o];return r.apply(void 0,[e].concat(l))},addEndListener:Y0.func,onEnter:Y0.func,onEntering:Y0.func,onEntered:Y0.func,onExit:Y0.func,onExiting:Y0.func,onExited:Y0.func}:{};function H9(){}xn.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:H9,onEntering:H9,onEntered:H9,onExit:H9,onExiting:H9,onExited:H9},xn.UNMOUNTED=Sd,xn.EXITED=P5,xn.ENTERING=k5,xn.ENTERED=b9,xn.EXITING=kL;var K4e={},X4e=function(e,r){return e&&r&&r.split(" ").forEach(function(n){return q4e(e,n)})},_L=function(e,r){return e&&r&&r.split(" ").forEach(function(n){return W4e(e,n)})},CL=function(a){i00(e,a);function e(){for(var n,l=arguments.length,o=new Array(l),c=0;c<l;c++)o[c]=arguments[c];return n=a.call.apply(a,[this].concat(o))||this,n.appliedClasses={appear:{},enter:{},exit:{}},n.onEnter=function(m,u){var h=n.resolveArguments(m,u),g=h[0],A=h[1];n.removeClasses(g,"exit"),n.addClass(g,A?"appear":"enter","base"),n.props.onEnter&&n.props.onEnter(m,u)},n.onEntering=function(m,u){var h=n.resolveArguments(m,u),g=h[0],A=h[1],y=A?"appear":"enter";n.addClass(g,y,"active"),n.props.onEntering&&n.props.onEntering(m,u)},n.onEntered=function(m,u){var h=n.resolveArguments(m,u),g=h[0],A=h[1],y=A?"appear":"enter";n.removeClasses(g,y),n.addClass(g,y,"done"),n.props.onEntered&&n.props.onEntered(m,u)},n.onExit=function(m){var u=n.resolveArguments(m),h=u[0];n.removeClasses(h,"appear"),n.removeClasses(h,"enter"),n.addClass(h,"exit","base"),n.props.onExit&&n.props.onExit(m)},n.onExiting=function(m){var u=n.resolveArguments(m),h=u[0];n.addClass(h,"exit","active"),n.props.onExiting&&n.props.onExiting(m)},n.onExited=function(m){var u=n.resolveArguments(m),h=u[0];n.removeClasses(h,"exit"),n.addClass(h,"exit","done"),n.props.onExited&&n.props.onExited(m)},n.resolveArguments=function(m,u){return n.props.nodeRef?[n.props.nodeRef.current,m]:[m,u]},n.getClassNames=function(m){var u=n.props.classNames,h=typeof u=="string",g=h&&u?u+"-":"",A=h?""+g+m:u[m],y=h?A+"-active":u[m+"Active"],E=h?A+"-done":u[m+"Done"];return{baseClassName:A,activeClassName:y,doneClassName:E}},n}var r=e.prototype;return r.addClass=function(l,o,c){var m=this.getClassNames(o)[c+"ClassName"],u=this.getClassNames("enter"),h=u.doneClassName;o==="appear"&&c==="done"&&h&&(m+=" "+h),c==="active"&&l&&d00(l),m&&(this.appliedClasses[o][c]=m,X4e(l,m))},r.removeClasses=function(l,o){var c=this.appliedClasses[o],m=c.base,u=c.active,h=c.done;this.appliedClasses[o]={},m&&_L(l,m),u&&_L(l,u),h&&_L(l,h)},r.render=function(){var l=this.props;l.classNames;var o=o00(l,["classNames"]);return t.createElement(xn,HZ({},o,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},e}(t.Component);CL.defaultProps={classNames:""},CL.propTypes=K4e.NODE_ENV!=="production"?HZ({},xn.propTypes,{classNames:Y4e,onEnter:Y0.func,onEntering:Y0.func,onEntered:Y0.func,onExit:Y0.func,onExiting:Y0.func,onExited:Y0.func}):{};const p00={Search:xe(CL)`
1916
1916
  opacity: 0;
1917
1917
  transition: opacity 0.3s ease-in-out;
1918
1918