@apollosproject/canvas-embeds 2.1.970 → 2.1.971
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.
- package/package.json +1 -1
- package/widget/index.js +1 -1
package/package.json
CHANGED
package/widget/index.js
CHANGED
|
@@ -363,7 +363,7 @@ Url: ${Bf(a)}`),!0)}function lF0(a,t){return a.type||!t||!t.length?!1:sF0(a).som
|
|
|
363
363
|
...FeatureActionButtonFragment
|
|
364
364
|
}
|
|
365
365
|
}
|
|
366
|
-
`);const qd=({text:a="Open the app",url:t=""})=>{const n=t.startsWith("http://")||t.startsWith("https://");return w.jsx(e2,{...n?{href:t}:{to:t},surface:"solid",children:a})},eq0=({src:a,srcDark:t,alt:n})=>w.jsx("div",{className:"flex space-x-2 items-center",children:a?w.jsxs(w.Fragment,{children:[w.jsx("img",{src:a,alt:n,className:"h-6 w-auto dark:hidden"}),w.jsx("img",{src:t,alt:n,className:"h-6 w-auto hidden dark:block"})]}):w.jsx(fe,{as:"h3",children:n})}),aq0=({church:a,url:t=""})=>w.jsxs("div",{className:"flex flex-col justify-between h-full items-center -mt-8",children:[w.jsx("div",{className:"flex shrink"}),w.jsxs("div",{className:"flex flex-col justify-between items-center gap-y-8",children:[w.jsx(eq0,{src:a.wordmarkLightUrl,srcDark:a.wordmarkDarkUrl}),w.jsx("div",{children:"Continue this experience in the app"}),w.jsx(qd,{url:t})]}),w.jsx("div",{className:"flex shrink"})]}),tq0=({hasComments:a=!1,url:t=""})=>w.jsxs("div",{className:"flex flex-col justify-between h-full items-center -mt-8",children:[w.jsx("div",{className:"flex shrink"}),w.jsxs("div",{className:"flex flex-col justify-between items-center gap-y-8",children:[w.jsx(V70,{size:40,className:"text-action"}),a?w.jsx("div",{children:"Join the conversation in the app"}):w.jsx("div",{children:"Be the first to comment"}),w.jsx(qd,{url:t})]}),w.jsx("div",{className:"flex shrink"})]}),nq0=new Map([["bold",e.createElement(e.Fragment,null,e.createElement("path",{d:"M144,180a16,16,0,1,1-16-16A16,16,0,0,1,144,180Zm92-52A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128ZM128,64c-24.26,0-44,17.94-44,40v4a12,12,0,0,0,24,0v-4c0-8.82,9-16,20-16s20,7.18,20,16-9,16-20,16a12,12,0,0,0-12,12v8a12,12,0,0,0,23.73,2.56C158.31,137.88,172,122.37,172,104,172,81.94,152.26,64,128,64Z"}))],["duotone",e.createElement(e.Fragment,null,e.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),e.createElement("path",{d:"M140,180a12,12,0,1,1-12-12A12,12,0,0,1,140,180ZM128,72c-22.06,0-40,16.15-40,36v4a8,8,0,0,0,16,0v-4c0-11,10.77-20,24-20s24,9,24,20-10.77,20-24,20a8,8,0,0,0-8,8v8a8,8,0,0,0,16,0v-.72c18.24-3.35,32-17.9,32-35.28C168,88.15,150.06,72,128,72Zm104,56A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["fill",e.createElement(e.Fragment,null,e.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,168a12,12,0,1,1,12-12A12,12,0,0,1,128,192Zm8-48.72V144a8,8,0,0,1-16,0v-8a8,8,0,0,1,8-8c13.23,0,24-9,24-20s-10.77-20-24-20-24,9-24,20v4a8,8,0,0,1-16,0v-4c0-19.85,17.94-36,40-36s40,16.15,40,36C168,125.38,154.24,139.93,136,143.28Z"}))],["light",e.createElement(e.Fragment,null,e.createElement("path",{d:"M138,180a10,10,0,1,1-10-10A10,10,0,0,1,138,180ZM128,74c-21,0-38,15.25-38,34v4a6,6,0,0,0,12,0v-4c0-12.13,11.66-22,26-22s26,9.87,26,22-11.66,22-26,22a6,6,0,0,0-6,6v8a6,6,0,0,0,12,0v-2.42c18.11-2.58,32-16.66,32-33.58C166,89.25,149,74,128,74Zm102,54A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z"}))],["regular",e.createElement(e.Fragment,null,e.createElement("path",{d:"M140,180a12,12,0,1,1-12-12A12,12,0,0,1,140,180ZM128,72c-22.06,0-40,16.15-40,36v4a8,8,0,0,0,16,0v-4c0-11,10.77-20,24-20s24,9,24,20-10.77,20-24,20a8,8,0,0,0-8,8v8a8,8,0,0,0,16,0v-.72c18.24-3.35,32-17.9,32-35.28C168,88.15,150.06,72,128,72Zm104,56A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["thin",e.createElement(e.Fragment,null,e.createElement("path",{d:"M136,180a8,8,0,1,1-8-8A8,8,0,0,1,136,180ZM128,76c-19.85,0-36,14.36-36,32v4a4,4,0,0,0,8,0v-4c0-13.23,12.56-24,28-24s28,10.77,28,24-12.56,24-28,24a4,4,0,0,0-4,4v8a4,4,0,0,0,8,0v-4.2c18-1.77,32-15.36,32-31.8C164,90.36,147.85,76,128,76Zm100,52A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z"}))]]),WS=e.forwardRef((a,t)=>e.createElement(E,{ref:t,...a,weights:nq0}));WS.displayName="QuestionIcon";const GS=WS,rq0=Object.freeze(Object.defineProperty({__proto__:null,Question:GS,QuestionIcon:WS},Symbol.toStringTag,{value:"Module"})),lq0=({url:a=""})=>w.jsxs("div",{className:"flex flex-col justify-between h-full items-center -mt-8",children:[w.jsx("div",{className:"flex shrink"}),w.jsxs("div",{className:"flex flex-col justify-between items-center gap-y-8",children:[w.jsx(GS,{size:40,className:"text-action"}),w.jsx("div",{children:"Answer this question in the app"}),w.jsx(qd,{url:a})]}),w.jsx("div",{className:"flex shrink"})]});var Ct=(a=>(a[a.Comment=0]="Comment",a[a.Default=1]="Default",a[a.Like=2]="Like",a[a.Question=3]="Question",a[a.Success=4]="Success",a))(Ct||{});const iq0=({hasLikes:a=!1,url:t=""})=>w.jsxs("div",{className:"flex flex-col justify-between h-full items-center -mt-8",children:[w.jsx("div",{className:"flex shrink"}),w.jsxs("div",{className:"flex flex-col justify-between items-center gap-y-8",children:[w.jsx(sv,{size:40,className:"text-action"}),a?w.jsx("div",{children:"Like this in the app"}):w.jsx("div",{children:"Be the first to like"}),w.jsx(qd,{url:t})]}),w.jsx("div",{className:"flex shrink"})]}),oq0=a=>/^https?:\/\/(localhost)(:\d+)?|(localhost)(:\d+)?|^https?:\/\/(192.\d.\d.\d)(:\d+)?|(192.\d.\d.\d)(:\d+)?/.test(a);function cq0(a){return a.replace(/-/g,"_")}const sq0=new Map([["bold",e.createElement(e.Fragment,null,e.createElement("path",{d:"M176.49,95.51a12,12,0,0,1,0,17l-56,56a12,12,0,0,1-17,0l-24-24a12,12,0,1,1,17-17L112,143l47.51-47.52A12,12,0,0,1,176.49,95.51ZM236,128A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Z"}))],["duotone",e.createElement(e.Fragment,null,e.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),e.createElement("path",{d:"M173.66,98.34a8,8,0,0,1,0,11.32l-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35A8,8,0,0,1,173.66,98.34ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["fill",e.createElement(e.Fragment,null,e.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm45.66,85.66-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35a8,8,0,0,1,11.32,11.32Z"}))],["light",e.createElement(e.Fragment,null,e.createElement("path",{d:"M172.24,99.76a6,6,0,0,1,0,8.48l-56,56a6,6,0,0,1-8.48,0l-24-24a6,6,0,0,1,8.48-8.48L112,151.51l51.76-51.75A6,6,0,0,1,172.24,99.76ZM230,128A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z"}))],["regular",e.createElement(e.Fragment,null,e.createElement("path",{d:"M173.66,98.34a8,8,0,0,1,0,11.32l-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35A8,8,0,0,1,173.66,98.34ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["thin",e.createElement(e.Fragment,null,e.createElement("path",{d:"M170.83,101.17a4,4,0,0,1,0,5.66l-56,56a4,4,0,0,1-5.66,0l-24-24a4,4,0,0,1,5.66-5.66L112,154.34l53.17-53.17A4,4,0,0,1,170.83,101.17ZM228,128A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z"}))]]),YS=e.forwardRef((a,t)=>e.createElement(E,{ref:t,...a,weights:sq0}));YS.displayName="CheckCircleIcon";const Iv=YS,mq0=Object.freeze(Object.defineProperty({__proto__:null,CheckCircle:Iv,CheckCircleIcon:YS},Symbol.toStringTag,{value:"Module"})),dq0=(a,t=!0,n)=>{const r=e.useRef(a);e.useEffect(()=>{r.current=a},[a]),e.useEffect(()=>{if(!t)return;const l=i=>{i.key==="Enter"&&r.current()};return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[t,n])},uq0=({onClose:a,message:t,showAppButtons:n=!1,appUrl:r=""})=>(dq0(a),w.jsxs("div",{className:"flex flex-col justify-between h-full items-center -mt-8",children:[w.jsx("div",{className:"flex shrink"}),w.jsxs("div",{className:"flex flex-col justify-between items-center gap-y-8",children:[w.jsx(Iv,{size:40,className:"text-action"}),w.jsx("div",{className:"text-center",children:w.jsx(fe,{as:"h1",className:"text-2xl font-semibold mb-2",children:"Success!"})}),w.jsx("div",{className:"text-center max-w-sm",children:w.jsx(fe,{className:"text-fg-secondary dark:text-fg-secondary-dark",children:t})}),n&&r&&w.jsx("div",{className:"flex flex-col gap-3 w-full max-w-xs",children:w.jsx(qd,{text:"Open the App",url:r})})]}),w.jsx("div",{className:"flex shrink"})]})),pq0=({church:a,currentPageParams:t,url:n,isInteractionEnabled:r})=>{if(!Vl(n))return n;if(r===!1||!r&&(!a||!a.universalLinkHost))return"";if(a?.universalLinkHost){let l=a.universalLinkHost;l.startsWith("http")||(l=oq0(l)?`http://${l}`:`https://${l}`);const i=t.handle?cq0(t.handle):null,o=i?`?church=${encodeURIComponent(i)}`:"";if(!Vl(t.contentId))return`${l}/app-link/content/${t.contentId.replace("Item-","Item:")}${o}`;if(!Vl(t.eventId))return`${l}/app-link/e/${t.eventId.replace("Event-","Event:")}${o}`;if(!Vl(t.feedId))return`${l}/app-link/f/${t.feedId.replace("Feed-","Feed:")}${o}`}return""},KS=({church:a,currentPageParams:t,hasComments:n=!1,hasLikes:r=!1,isOpen:l=!1,setIsOpen:i=Fd,type:o=Ct.Default,url:c="",message:m,isInteractionEnabled:u,theme:p})=>{let f=null;const A=pq0({church:a,currentPageParams:t,url:c,isInteractionEnabled:u});switch(o){case Ct.Comment:f=w.jsx(tq0,{hasComments:n,url:A});break;case Ct.Like:f=w.jsx(iq0,{hasLikes:r,url:A});break;case Ct.Question:f=w.jsx(lq0,{url:A});break;case Ct.Success:f=w.jsx(uq0,{onClose:()=>i(!1),message:m,showAppButtons:A.length>0,appUrl:A});break;case Ct.Default:default:f=w.jsx(aq0,{church:a,url:A});break}return w.jsx(Uj0,{isOpen:l,setIsOpen:i,theme:p,children:f})};function QS(a){const t=a.split("/").filter(Boolean);return t.length>0?t[0]:null}function Uc0(a,t,n){const r=new URL(t,window.location.origin);return r.searchParams.set("pendingAction",n.type),n.type==="pollVote"?(r.searchParams.set("pollId",n.pollId),r.searchParams.set("optionIds",btoa(JSON.stringify(n.optionIds)))):n.type==="connect"&&(r.searchParams.set("featureId",n.featureId),r.searchParams.set("tagIds",btoa(JSON.stringify(n.tagIds)))),`/${a}/auth/login?redirectTo=${encodeURIComponent(r.pathname+r.search)}`}const hq0=({feature:a,currentChurch:t,userProfile:n,showSuccessModal:r=!1})=>{const l=VR0(),[i,o]=e.useState(!1);e.useEffect(()=>{r&&o(!0)},[r]);try{if(!a)return console.error("ConnectButtonFeature: No feature data provided"),w.jsx("div",{className:"connect-button-container text-center mt-8 mb-10",children:w.jsx("div",{className:"text-red-500",children:"Error: No feature data"})});const c=a.title||"Register",m=a.confirmationMessage||"",u=Array.isArray(a.tags)?a.tags.filter(f=>f!=null):[],p=()=>{if(Vl(n?.id)){const f=window.location.pathname,A=QS(f);if(!A){console.error("ConnectButtonFeature: No handle found in path");return}const Z=Uc0(A,f,{type:"connect",tagIds:u,featureId:a.id});window.location.href=Z}else{const f=new FormData;f.append("_action","connectButton"),fetch(window.location.pathname,{method:"POST",body:f}),o(!0),Vl(u)||l?.({personId:n.id,tagIds:u})}};return w.jsxs(w.Fragment,{children:[w.jsx("div",{className:"connect-button-container text-center mt-8 mb-10",children:w.jsx("div",{className:"max-w-md mx-auto",children:w.jsx(e2,{surface:"solid",className:"w-full",onClick:p,children:c})})}),w.jsx(KS,{type:Ct.Success,currentPageParams:{},isOpen:i,setIsOpen:o,church:t,message:m})]})}catch(c){return console.error("Error rendering ConnectButtonFeature:",c),w.jsx("div",{className:"connect-button-container text-center mt-8 mb-10",children:w.jsx("div",{className:"text-red-500",children:"Error rendering Connect Button"})})}};d2(`
|
|
366
|
+
`);const qd=({text:a="Open the app",url:t=""})=>{const n=t.startsWith("http://")||t.startsWith("https://");return w.jsx(e2,{...n?{href:t}:{to:t},surface:"solid",children:a})},eq0=({src:a,srcDark:t,alt:n})=>w.jsx("div",{className:"flex space-x-2 items-center",children:a?w.jsxs(w.Fragment,{children:[w.jsx("img",{src:a,alt:n,className:"h-6 w-auto dark:hidden"}),w.jsx("img",{src:t,alt:n,className:"h-6 w-auto hidden dark:block"})]}):w.jsx(fe,{as:"h3",children:n})}),aq0=({church:a,url:t=""})=>w.jsxs("div",{className:"flex flex-col justify-between h-full items-center -mt-8",children:[w.jsx("div",{className:"flex shrink"}),w.jsxs("div",{className:"flex flex-col justify-between items-center gap-y-8",children:[w.jsx(eq0,{src:a.wordmarkLightUrl,srcDark:a.wordmarkDarkUrl}),w.jsx("div",{children:"Continue this experience in the app"}),w.jsx(qd,{url:t})]}),w.jsx("div",{className:"flex shrink"})]}),tq0=({hasComments:a=!1,url:t=""})=>w.jsxs("div",{className:"flex flex-col justify-between h-full items-center -mt-8",children:[w.jsx("div",{className:"flex shrink"}),w.jsxs("div",{className:"flex flex-col justify-between items-center gap-y-8",children:[w.jsx(V70,{size:40,className:"text-action"}),a?w.jsx("div",{children:"Join the conversation in the app"}):w.jsx("div",{children:"Be the first to comment"}),w.jsx(qd,{url:t})]}),w.jsx("div",{className:"flex shrink"})]}),nq0=new Map([["bold",e.createElement(e.Fragment,null,e.createElement("path",{d:"M144,180a16,16,0,1,1-16-16A16,16,0,0,1,144,180Zm92-52A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128ZM128,64c-24.26,0-44,17.94-44,40v4a12,12,0,0,0,24,0v-4c0-8.82,9-16,20-16s20,7.18,20,16-9,16-20,16a12,12,0,0,0-12,12v8a12,12,0,0,0,23.73,2.56C158.31,137.88,172,122.37,172,104,172,81.94,152.26,64,128,64Z"}))],["duotone",e.createElement(e.Fragment,null,e.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),e.createElement("path",{d:"M140,180a12,12,0,1,1-12-12A12,12,0,0,1,140,180ZM128,72c-22.06,0-40,16.15-40,36v4a8,8,0,0,0,16,0v-4c0-11,10.77-20,24-20s24,9,24,20-10.77,20-24,20a8,8,0,0,0-8,8v8a8,8,0,0,0,16,0v-.72c18.24-3.35,32-17.9,32-35.28C168,88.15,150.06,72,128,72Zm104,56A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["fill",e.createElement(e.Fragment,null,e.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,168a12,12,0,1,1,12-12A12,12,0,0,1,128,192Zm8-48.72V144a8,8,0,0,1-16,0v-8a8,8,0,0,1,8-8c13.23,0,24-9,24-20s-10.77-20-24-20-24,9-24,20v4a8,8,0,0,1-16,0v-4c0-19.85,17.94-36,40-36s40,16.15,40,36C168,125.38,154.24,139.93,136,143.28Z"}))],["light",e.createElement(e.Fragment,null,e.createElement("path",{d:"M138,180a10,10,0,1,1-10-10A10,10,0,0,1,138,180ZM128,74c-21,0-38,15.25-38,34v4a6,6,0,0,0,12,0v-4c0-12.13,11.66-22,26-22s26,9.87,26,22-11.66,22-26,22a6,6,0,0,0-6,6v8a6,6,0,0,0,12,0v-2.42c18.11-2.58,32-16.66,32-33.58C166,89.25,149,74,128,74Zm102,54A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z"}))],["regular",e.createElement(e.Fragment,null,e.createElement("path",{d:"M140,180a12,12,0,1,1-12-12A12,12,0,0,1,140,180ZM128,72c-22.06,0-40,16.15-40,36v4a8,8,0,0,0,16,0v-4c0-11,10.77-20,24-20s24,9,24,20-10.77,20-24,20a8,8,0,0,0-8,8v8a8,8,0,0,0,16,0v-.72c18.24-3.35,32-17.9,32-35.28C168,88.15,150.06,72,128,72Zm104,56A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["thin",e.createElement(e.Fragment,null,e.createElement("path",{d:"M136,180a8,8,0,1,1-8-8A8,8,0,0,1,136,180ZM128,76c-19.85,0-36,14.36-36,32v4a4,4,0,0,0,8,0v-4c0-13.23,12.56-24,28-24s28,10.77,28,24-12.56,24-28,24a4,4,0,0,0-4,4v8a4,4,0,0,0,8,0v-4.2c18-1.77,32-15.36,32-31.8C164,90.36,147.85,76,128,76Zm100,52A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z"}))]]),WS=e.forwardRef((a,t)=>e.createElement(E,{ref:t,...a,weights:nq0}));WS.displayName="QuestionIcon";const GS=WS,rq0=Object.freeze(Object.defineProperty({__proto__:null,Question:GS,QuestionIcon:WS},Symbol.toStringTag,{value:"Module"})),lq0=({url:a=""})=>w.jsxs("div",{className:"flex flex-col justify-between h-full items-center -mt-8",children:[w.jsx("div",{className:"flex shrink"}),w.jsxs("div",{className:"flex flex-col justify-between items-center gap-y-8",children:[w.jsx(GS,{size:40,className:"text-action"}),w.jsx("div",{children:"Answer this question in the app"}),w.jsx(qd,{url:a})]}),w.jsx("div",{className:"flex shrink"})]});var Ct=(a=>(a[a.Comment=0]="Comment",a[a.Default=1]="Default",a[a.Like=2]="Like",a[a.Question=3]="Question",a[a.Success=4]="Success",a))(Ct||{});const iq0=({hasLikes:a=!1,url:t=""})=>w.jsxs("div",{className:"flex flex-col justify-between h-full items-center -mt-8",children:[w.jsx("div",{className:"flex shrink"}),w.jsxs("div",{className:"flex flex-col justify-between items-center gap-y-8",children:[w.jsx(sv,{size:40,className:"text-action"}),a?w.jsx("div",{children:"Like this in the app"}):w.jsx("div",{children:"Be the first to like"}),w.jsx(qd,{url:t})]}),w.jsx("div",{className:"flex shrink"})]}),oq0=a=>/^https?:\/\/(localhost)(:\d+)?|(localhost)(:\d+)?|^https?:\/\/(192.\d.\d.\d)(:\d+)?|(192.\d.\d.\d)(:\d+)?/.test(a);function cq0(a){return a.replace(/-/g,"_")}const sq0=new Map([["bold",e.createElement(e.Fragment,null,e.createElement("path",{d:"M176.49,95.51a12,12,0,0,1,0,17l-56,56a12,12,0,0,1-17,0l-24-24a12,12,0,1,1,17-17L112,143l47.51-47.52A12,12,0,0,1,176.49,95.51ZM236,128A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Z"}))],["duotone",e.createElement(e.Fragment,null,e.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),e.createElement("path",{d:"M173.66,98.34a8,8,0,0,1,0,11.32l-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35A8,8,0,0,1,173.66,98.34ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["fill",e.createElement(e.Fragment,null,e.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm45.66,85.66-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35a8,8,0,0,1,11.32,11.32Z"}))],["light",e.createElement(e.Fragment,null,e.createElement("path",{d:"M172.24,99.76a6,6,0,0,1,0,8.48l-56,56a6,6,0,0,1-8.48,0l-24-24a6,6,0,0,1,8.48-8.48L112,151.51l51.76-51.75A6,6,0,0,1,172.24,99.76ZM230,128A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z"}))],["regular",e.createElement(e.Fragment,null,e.createElement("path",{d:"M173.66,98.34a8,8,0,0,1,0,11.32l-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35A8,8,0,0,1,173.66,98.34ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["thin",e.createElement(e.Fragment,null,e.createElement("path",{d:"M170.83,101.17a4,4,0,0,1,0,5.66l-56,56a4,4,0,0,1-5.66,0l-24-24a4,4,0,0,1,5.66-5.66L112,154.34l53.17-53.17A4,4,0,0,1,170.83,101.17ZM228,128A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z"}))]]),YS=e.forwardRef((a,t)=>e.createElement(E,{ref:t,...a,weights:sq0}));YS.displayName="CheckCircleIcon";const Iv=YS,mq0=Object.freeze(Object.defineProperty({__proto__:null,CheckCircle:Iv,CheckCircleIcon:YS},Symbol.toStringTag,{value:"Module"})),dq0=(a,t=!0,n)=>{const r=e.useRef(a);e.useEffect(()=>{r.current=a},[a]),e.useEffect(()=>{if(!t)return;const l=i=>{i.key==="Enter"&&r.current()};return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[t,n])},uq0=({onClose:a,message:t,showAppButtons:n=!1,appUrl:r=""})=>(dq0(a),w.jsxs("div",{className:"flex flex-col justify-between h-full items-center -mt-8",children:[w.jsx("div",{className:"flex shrink"}),w.jsxs("div",{className:"flex flex-col justify-between items-center gap-y-8",children:[w.jsx(Iv,{size:40,className:"text-action"}),w.jsx("div",{className:"text-center",children:w.jsx(fe,{as:"h1",className:"text-2xl font-semibold mb-2",children:"Success!"})}),w.jsx("div",{className:"text-center max-w-sm",children:w.jsx(fe,{className:"text-fg-secondary dark:text-fg-secondary-dark",children:t})}),n&&r&&w.jsx("div",{className:"flex flex-col gap-3 w-full max-w-xs",children:w.jsx(qd,{text:"Open the App",url:r})})]}),w.jsx("div",{className:"flex shrink"})]})),pq0=({church:a,currentPageParams:t,url:n,isInteractionEnabled:r})=>{if(!Vl(n))return n;if(r===!1||!r&&(!a||!a.universalLinkHost))return"";if(a?.universalLinkHost){let l=a.universalLinkHost;l.startsWith("http")||(l=oq0(l)?`http://${l}`:`https://${l}`);const i=t.handle?cq0(t.handle):null,o=i?`?church=${encodeURIComponent(i)}`:"";if(!Vl(t.contentId))return`${l}/app-link/content/${t.contentId.replace("Item-","Item:")}${o}`;if(!Vl(t.eventId))return`${l}/app-link/e/${t.eventId.replace("Event-","Event:")}${o}`;if(!Vl(t.feedId))return`${l}/app-link/f/${t.feedId.replace("Feed-","Feed:")}${o}`}return""},KS=({church:a,currentPageParams:t,hasComments:n=!1,hasLikes:r=!1,isOpen:l=!1,setIsOpen:i=Fd,type:o=Ct.Default,url:c="",message:m,isInteractionEnabled:u,theme:p})=>{let f=null;const A=pq0({church:a,currentPageParams:t,url:c,isInteractionEnabled:u});switch(o){case Ct.Comment:f=w.jsx(tq0,{hasComments:n,url:A});break;case Ct.Like:f=w.jsx(iq0,{hasLikes:r,url:A});break;case Ct.Question:f=w.jsx(lq0,{url:A});break;case Ct.Success:f=w.jsx(uq0,{onClose:()=>i(!1),message:m,showAppButtons:A.length>0,appUrl:A});break;case Ct.Default:default:f=w.jsx(aq0,{church:a,url:A});break}return w.jsx(Uj0,{isOpen:l,setIsOpen:i,theme:p,children:f})};function QS(a){const t=a.split("/").filter(Boolean);return t.length>0?t[0]:null}function Uc0(a,t,n){const r=new URL(t,window.location.origin);return r.searchParams.set("pendingAction",n.type),n.type==="pollVote"?(r.searchParams.set("pollId",n.pollId),r.searchParams.set("optionIds",btoa(JSON.stringify(n.optionIds)))):n.type==="connect"&&(r.searchParams.set("featureId",n.featureId),r.searchParams.set("tagIds",btoa(JSON.stringify(n.tagIds)))),`/${a}/auth/login?redirectTo=${encodeURIComponent(r.pathname+r.search)}`}const hq0=({feature:a,currentChurch:t,userProfile:n,showSuccessModal:r=!1})=>{const l=VR0(),[i,o]=e.useState(!1);e.useEffect(()=>{r&&o(!0)},[r]);try{if(!a)return console.error("ConnectButtonFeature: No feature data provided"),w.jsx("div",{className:"connect-button-container text-center mt-8 mb-10",children:w.jsx("div",{className:"text-red-500",children:"Error: No feature data"})});const c=a.title||"Register",m=a.confirmationMessage||"",u=Array.isArray(a.tags)?a.tags.filter(f=>f!=null):[],p=()=>{if(Vl(n?.id)){const f=window.location.pathname,A=QS(f);if(!A){console.error("ConnectButtonFeature: No handle found in path");return}const Z=Uc0(A,f,{type:"connect",tagIds:u,featureId:a.id});window.location.href=Z}else{const f=new FormData;if(f.append("_action","connectButton"),fetch(window.location.pathname,{method:"POST",body:f}).catch(Z=>{console.error("ConnectButtonFeature: connect button action failed",Z)}),o(!0),!Vl(u))try{const Z=l?.({personId:n.id,tagIds:u});Promise.resolve(Z).catch(H=>{console.error("ConnectButtonFeature: addPersonTagAssociation failed",H)})}catch(Z){console.error("ConnectButtonFeature: addPersonTagAssociation threw",Z)}}};return w.jsxs(w.Fragment,{children:[w.jsx("div",{className:"connect-button-container text-center mt-8 mb-10",children:w.jsx("div",{className:"max-w-md mx-auto",children:w.jsx(e2,{surface:"solid",className:"w-full",onClick:p,children:c})})}),w.jsx(KS,{type:Ct.Success,currentPageParams:{},isOpen:i,setIsOpen:o,church:t,message:m})]})}catch(c){return console.error("Error rendering ConnectButtonFeature:",c),w.jsx("div",{className:"connect-button-container text-center mt-8 mb-10",children:w.jsx("div",{className:"text-red-500",children:"Error rendering Connect Button"})})}};d2(`
|
|
367
367
|
fragment ConnectButtonFeatureFragment on ConnectButtonFeature {
|
|
368
368
|
id
|
|
369
369
|
title
|