1"use strict";(self.webpackChunkearth_fm=self.webpackChunkearth_fm||[]).push([[6980],{5442:function(e,t,n){n.d(t,{A:function(){return m}});var i=n(55268),a=n(96540),r=n(41920),o=n(41541),l=n(34033),s=n.p+"static/error-b90f4eff281d740d7a7bf3e906d4da63.svg";const d=r.default.div.withConfig({displayName:"ErrorScreen__Wrapper",componentId:"sc-rkfr1f-0"})(["display:flex;flex-direction:column;justify-content:center;align-items:center;gap:20px;min-height:100vh;background:var(--earth-fm--color--green);text-align:center;img{width:100%;max-width:240px;height:auto;}@media (min-width:992px){img{max-width:none;width:360px;}}"]),c=r.default.p.withConfig({displayName:"ErrorScreen__Message",componentId:"sc-rkfr1f-1"})(["max-width:640px;margin:18px auto clamp(20px,15vh,128px);font-size:20px;font-weight:700;line-height:1.5;color:var(--earth-fm--color--yellow);text-align:center;"]);var m=function({message:e="Uh-oh, something went wrong!"}){return a.createElement(d,null,a.createElement("div",{className:"container"},a.createElement("img",{src:s,alt:""}),a.createElement(c,null,e),a.createElement(l.A,{as:i.Link,to:o.Bd.home},"Go home")))}},25177:function(e,t,n){n.r(t),n.d(t,{Head:function(){return x},default:function(){return w}});var i=n(96540),a=n(55268),r=n(95262),o=n(37068),l=n(6805),s=n(33897),d=n(34033),c=n(65261),m=n(37987),u=n(41541),h=n(6004),p=n(62383),f=n(5442);const g="undefined"!=typeof window,y=e=>{const t="business"===e?"team":"family",n="business"===e?"team":"family group";return[{id:"family-exists",title:`You are already a ${t} member`,primaryButton:{content:"Membership settings",url:u.Bd.memberMembershipSettings},secondaryButtons:[{content:"Go home",url:u.Bd.home}],content:`It looks like you are already a member of a ${n}. Please leave your current ${n} first to join this ${t}. Thank you!`},{id:"already-member",title:"You are already a member",primaryButton:{content:"Membership settings",url:u.Bd.memberMembershipSettings},secondaryButtons:[{content:"Go home",url:u.Bd.home}],content:`It looks like you already have an active membership. Please cancel your current membership first, then try to join the ${t}. Thank you!`},{id:"already-family",title:`You are already a ${t} member`,primaryButton:{content:"Membership settings",url:u.Bd.memberMembershipSettings},secondaryButtons:[{content:"Go home",url:u.Bd.home}],content:`You are already a member of this ${t}. Thank you!`},{id:"family-full",title:"No more slots available",primaryButton:{content:"Go home",url:u.Bd.home},secondaryButtons:[],content:`The ${t} has reached its maximum limit, and no more slots are available. Please contact the plan manager. Thank you!`}]},v={hasMembership:"already-member",hasFamily:"family-exists",alreadyMember:"already-family",familyFull:"family-full"};function w({params:e}){var t,n,w,x;const{inviteCode:b}=e,[E,C]=i.useState(!0),[k,I]=i.useState(!1),[S,B]=i.useState({id:"",open:!1}),[_,j]=i.useState(null),[$,A]=i.useState(null),[N,M]=i.useState("family"),[P,T]=i.useState("family"),L="business"===N?"business plan":"family",z=y(P),{initializing:F,user:H,member:G,loadingMembership:O,membership:W}=i.useContext(c.A),Y=i.useCallback((e,t)=>{T(t||N),e.includes("resource-exhausted")?B({id:v.familyFull,open:!0}):e.includes("already-exists")?B({id:v.alreadyMember,open:!0}):j("Oops, something went wrong. Please try again later.")},[N]),J=i.useCallback(async()=>{try{const e=(0,r.Qg)(l.Cn,"checkInviteCode"),t=await e({inviteCode:b});if(!t||!t.data)return A(null),void C(!1);const{subscriptionType:n,organizer:i}=t.data,a=n||"family";A(i||null),C(!1),M(a),T(a)}catch(e){if(e instanceof o.g&&e.code){let t;return e.details&&e.details.subscriptionType&&(t=e.details.subscriptionType),void Y(e.code,t)}j("Oops, something went wrong. Please try again later.")}},[b,Y]),D=i.useCallback(async()=>{try{C(!0);const e=(0,r.Qg)(l.Cn,"acceptInviteCode"),t=await e({inviteCode:b});t&&t.data.success&&(await(null==H?void 0:H.getIdToken(!0)),(0,a.navigate)(u.Bd.memberProfileSetup,{replace:!0}))}catch(e){if(e instanceof o.g&&e.code){let t=N;e.details&&e.details.subscriptionType&&(t=e.details.subscriptionType),Y(e.code,t)}j("Oops, something went wrong. Please try again later.")}finally{C(!1)}},[Y,b,H,N]);i.useEffect(()=>{g&&(F||O||(null!==H&&I(!0),O||W===m.D.None?J():B({id:v.hasMembership,open:!0})))},[_,J,F,b,O,G,W,H]);const Q=i.useCallback(()=>{D()},[D]),U=i.useCallback(()=>{g&&(window.localStorage.setItem(u.wK.redirectAfterSignIn,u.Bd.invite.replace(":inviteCode",b)),(0,a.navigate)(u.Bd.signIn))},[b]);return _?i.createElement(f.A,{message:_}):i.createElement("div",null,E?i.createElement(p.A,null):i.createElement(s.A,{title:"You're invited "+($?`by ${$}`:"to Earth.fm"),description:"Get unlimited access to our 1000+ high quality, immersive soundscapes from more than 150 field recordists around world. And other member only features by joining "+($?`${$}'s ${L}.`:`the ${L}.`),hideHeader:!0,justifyContent:"center"},i.createElement(d.A,{onClick:k?Q:U},k?`Join the ${L.charAt(0).toUpperCase()+L.slice(1)}`:`Sign up to join the ${L}`)),i.createElement(h.A,{open:S.open,title:(null===(t=z.find(e=>
1e.id===S.id))||void 0===t?void 0:t.title)||"",primaryButton:null===(n=z.find(e=>e.id===S.id))||void 0===n?void 0:n.primaryButton,secondaryButtons:null===(w=z.find(e=>e.id===S.id))||void 0===w?void 0:w.secondaryButtons,onClose:()=>{B({id:"",open:!1}),(0,a.navigate)(u.Bd.home,{replace:!0})}},i.createElement("p",null,null===(x=z.find(e=>e.id===S.id))||void 0===x?void 0:x.content)))}function x(){return i.createElement(i.Fragment,null,i.createElement("meta",{name:"robots",content:"noindex"}),i.createElement("title",null,`Join the group - ${u.l$}`))}},28139:function(e,t,n){var i=n(98859);t.A=i.A},33897:function(e,t,n){n.d(t,{A:function(){return y}});var i=n(96540),a=n(41920),r=n(28139),o=n(19715),l=n(20843),s=n.p+"static/illustration-de275021041a362d0e65b7c77524d593.svg",d=n.p+"static/waves-b1a4ad08daaed8f3c5023f872089f27d.svg";const c=a.default.div.withConfig({displayName:"SignInPageLayout__Container",componentId:"sc-l5d1jt-0"})(["flex:1;display:flex;flex-direction:column;justify-content:",";padding-top:",";",""],({$headerHidden:e})=>e?"flex-start":"center",({$headerHidden:e})=>e?(0,l.o1)(40,80):"0",({$justifyContent:e})=>e?(0,a.css)(["justify-content:",";"],e):""),m=(0,a.default)(o.sT).withConfig({displayName:"SignInPageLayout__Title",componentId:"sc-l5d1jt-1"})(["margin:0 0 20px;text-align:center;font-size:",";"],(0,l.o1)(48,64)),u=a.default.p.withConfig({displayName:"SignInPageLayout__Description",componentId:"sc-l5d1jt-2"})(["max-width:600px;margin:0 auto;text-align:center;"]),h=a.default.div.withConfig({displayName:"SignInPageLayout__Content",componentId:"sc-l5d1jt-3"})(["position:relative;margin-top:40px;text-align:center;z-index:2;"]),p=a.default.div.withConfig({displayName:"SignInPageLayout__WavesWrapper",componentId:"sc-l5d1jt-4"})(["overflow:hidden;img{width:100%;max-width:100%;min-width:800px;height:auto;margin-bottom:-10px;}"]),f=a.default.div.withConfig({displayName:"SignInPageLayout__IllustrationContainer",componentId:"sc-l5d1jt-5"})(["position:relative;"]),g=a.default.div.withConfig({displayName:"SignInPageLayout__IllustrationWrapper",componentId:"sc-l5d1jt-6"})(["position:absolute;bottom:34px;right:20px;z-index:1;img{width:110px;height:auto;}@media (min-width:768px){right:0;}@media (min-width:768px) and (min-height:600px){img{width:200px;}}@media (min-width:992px) and (min-height:800px){img{width:250px;}}@media (min-width:1200px) and (min-height:900px){img{width:350px;}}"]);var y=function({title:e,description:t=null,hideHeader:n=!1,justifyContent:a,children:o}){return i.createElement(r.A,{hideFooter:!0,hideHeader:n,hideSearch:!0},i.createElement(c,{className:"container",$headerHidden:n,$justifyContent:a},e&&i.createElement(m,null,e),t&&i.createElement(u,null,t),i.createElement(h,null,o)),i.createElement(p,null,i.createElement("img",{src:d,alt:""})),i.createElement(f,{className:"container"},i.createElement(g,null,i.createElement("img",{src:s,alt:""}))))}},62383:function(e,t,n){n.d(t,{A:function(){return h}});var i,a,r=n(96540),o=n(41920),l=n(28574);function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},s.apply(null,arguments)}var d=e=>r.createElement("svg",s({xmlns:"http://www.w3.org/2000/svg",width:226,height:226,fill:"none",viewBox:"0 0 226 226"},e),i||(i=r.createElement("path",{fill:"#FFAA25",d:"M46.31 156.692c-14.578-3.122-29.73-4.995-37.595-13.758s1.205-13.84 9.079-20.324c15.096-12.454 17.536-13.074 10.32-19.111-8.354-6.88-13.222-9.939-16.075-16.757-5.213-12.379 12.863-11.554 34.656-19.793 1.001-3.633-.787-3.992-3.784-21.604a20.6 20.6 0 0 1 1.79-11.582 8.1 8.1 0 0 1 3.637-4.5 7.8 7.8 0 0 1 5.647-.859c4.872.711 21.597 7.823 25.053 8.4 4.345.838 4.05-1.399 7.398-9.826 3.947-10.04 4.8-12.03 6.94-14.82 10.711-14.09 21.283 12.265 28.687 19.309 6.403 6.079 17.041-12.018 33.983-19.444 6.29-2.86 10.707.167 11.123 7.11-.019.263.094 16.545.587 28.355.486 10.983 6.13 4.902 19.896 4.394 4.312-.099 8.626.12 12.906.655a6.6 6.6 0 0 1 2.905.912 6.7 6.7 0 0 1 2.206 2.134 6.9 6.9 0 0 1 1.05 2.913 7 7 0 0 1-.324 3.09c-8.157 16.453-12.005 18.197-15.115 28.295-2.18 7.023 4.187 5.822 21.718 18.945a15.2 15.2 0 0 1 2.3 2.281c8.297 9.522-3.541 12.979-18.802 21.352-12.843 7.156-11.077 9.663-8.615 15.594 2.463 5.931 7.315 15.174 8.359 19.184 1.715 5.977-4.535 7.814-10.584 7.714-30.909-.679-29.263-4.73-30.121 7.414-.465 6.583-.309 15.359-1.138 19.765-1.195 6.365-8.452 6.874-13.644 3.362a958 958 0 0 1-15.438-10.659c-10.586-7.369-4.901-7.163-25.239 16.23-5.427 6.229-11.524 9.102-16.765 2.61-3.246-4.002-3.05-9.082-4.8-19.593-1.947-11.848-2.222-14.381-5.919-13.388-7.626 2.07-17.645 8.667-26.79 9.305a7.25 7.25 0 0 1-3.87-.202 7.35 7.35 0 0 1-3.233-2.173 7.6 7.6 0 0 1-1.71-3.546 7.7 7.7 0 0 1 .282-3.948 165 165 0 0 1 9.04-23.436z"})),a||(a=r.createElement("path",{fill:"#000",d:"M98.366 119.044c.258.018 27.574 4.805 27.859 4.892a2.47 2.47 0 0 1 1.686 1.286 2.58 2.58 0 0 1 .111 2.149c-7.043 18.982-39.934 15.187-40.11-5.663-.03-5.526 5.368-3.555 10.447-2.565zm25.08-14.762c1.393-3.208 2.465-7.829 6.266-6.17a3.24 3.24 0 0 1 1.676 1.463c.372.673.501 1.46.362 2.222a44 44 0 0 1-1.436 5.653 3.6 3.6 0 0 1-1.498 1.818 3.46 3.46 0 0 1-4.344-.604 3.6 3.6 0 0 1-.956-2.161c-.023-.597-.025-1.027-.07-2.221m
1-25.69-1.291a3.55 3.55 0 0 1-1.395 1.517 3.44 3.44 0 0 1-1.984.466 3.44 3.44 0 0 1-1.898-.742 3.56 3.56 0 0 1-1.167-1.699c-.97-3.211.636-8.985 4.42-8.451.86.142 1.64.603 2.187 1.295.549.691.828 1.566.785 2.456a18.3 18.3 0 0 1-.948 5.158"})));const c=(0,o.keyframes)(["from{transform:rotate(0deg);}to{transform:rotate(360deg);}"]),m=o.default.div.withConfig({displayName:"LoadingScreen__Wrapper",componentId:"sc-1whsckj-0"})(["display:flex;flex-direction:column;justify-content:center;align-items:center;gap:20px;min-height:100vh;background:var(--earth-fm--color--yellow);text-align:center;svg{width:100%;max-width:150px;height:auto;}@media (prefers-reduced-motion:no-preference){svg{path:first-of-type{animation:"," 10s linear infinite;transform-origin:center;}}}@media (min-width:992px){svg{max-width:226px;}}"],c),u=o.default.p.withConfig({displayName:"LoadingScreen__Message",componentId:"sc-1whsckj-1"})(["margin:20px 0 0;font:inherit;"]);var h=function({message:e="Just a moment... the sun is rising!"}){return r.createElement(m,null,r.createElement(l.mg,null,r.createElement("meta",{name:"theme-color",content:"#f6e53b"})),r.createElement("div",{className:"container"},r.createElement(d,null),r.createElement(u,null,e)))}}}]); 2//# sourceMappingURL=component---src-pages-invite-invite-code-tsx-963f63e0a2a8592590f9.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.