PageSourceSearch

https://nerdstreet.com/_next/static/chunks/pages/events/[slug]/invites/[id]/accept-938034216a2dc516.js

js nerdstreet.com collected 2026-10-09 21:51:39 UTC 17,329 bytes, 1 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="50382d43-88d3-4791-9f57-12113a77003b",e._sentryDebugIdIdentifier="sentry-dbid-50382d43-88d3-4791-9f57-12113a77003b")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5566],{61723:function(e,t,r){"use strict";var n,i,o=r(52983);function a(){return(a=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}t.Z=function(e){return o.createElement("svg",a({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",width:"20px",className:"icon-check","aria-hidden":"true",style:{fill:"#fff"}},e),n||(n=o.createElement("title",null,"Check")),i||(i=o.createElement("path",{d:"M5.488 9.128L4 11.705l7.094 4.096L17 5.57 14.278 4 9.86 11.653 5.488 9.128z"})))}},82736:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/events/[slug]/invites/[id]/accept",function(){return r(6157)}])},4588:function(e,t,r){"use strict";var n=r(97458);r(52983);var i=r(89603),o=r(22834),a=r(17436),s=r(1166),c=r(61321);let u=(0,s.zo)("div",{flex:"100%",select:{margin:0}});t.Z=e=>{let{lobbyUser:t}=(0,a.C)(o.dy),{teams:r}=(0,i.y)(),{onChange:s,selected:l,teamSize:d=1,disabled:f}=e,p=r.filter(e=>!e.deleted);return(0,n.jsx)(u,{children:r&&t&&(0,n.jsxs)(c.Z,{onChange:e=>{s(e.currentTarget.value)},value:l||"",disabled:f,id:"team-cart-dropdown",children:[(0,n.jsx)("option",{value:"",disabled:!0,children:"Select a team"}),p.filter(e=>e.captain.username===t.username).filter(e=>e.members.length+1>=d).map(e=>(0,n.jsx)("option",{value:e._id,children:e.name},e._id))]})})}},33208:function(e,t,r){"use strict";let n=(0,r(1166).zo)("div",{display:"flex",marginBottom:"20px",marginRight:"10px",position:"relative",svg:{border:0,height:"20px",width:"20px",opacity:0,position:"absolute",left:0,top:0,transition:"opacity 0.2s ease-in-out"},input:{height:"20px",left:0,opacity:0,position:"absolute",top:0,width:"20px"},"input + label":{paddingLeft:"30px",lineHeight:1.25},"input + label::before":{backgroundColor:"$background",border:"1px solid $primary",content:"",height:"20px",left:0,position:"absolute",top:0,width:"20px"},"input:checked + label svg":{opacity:1,backgroundColor:"$primary"},"input:focus + label::before":{boxShadow:"0 0 0 2px blue"}});t.Z=n},39801:function(e,t,r){"use strict";r.d(t,{j:function(){return u}});var n=r(97458),i=r(65662);r(52983);var o=r(61723),a=r(1166),s=r(33208),c=r(22758);let u=e=>{let{hint:t,label:r,rules:a,...u}=e,{id:d,name:f}=u,{errors:p,register:h,setValue:g}=(0,c.O)(f),v=u.onChange?u.onChange:e=>{g(f,e.target.checked)};return(0,n.jsx)(c.W,{errors:p,id:d,hint:t,rules:a,children:(0,n.jsxs)(s.Z,{children:[(0,n.jsx)(l,{ref:h(a),type:"checkbox",onChange:v,...u}),(0,n.jsxs)("label",{htmlFor:d,children:[(0,n.jsx)(o.Z,{})," ",r,t&&(0,n.jsx)(i.O,{children:t})]})]})})},l=(0,a.zo)("input",{height:"20px",left:0,opacity:0,position:"absolute",top:0,width:"20px","&::before":{border:"2px solid",content:"",height:"20px",left:0,position:"absolute",top:0,width:"20px"},svg:{display:"none"},"&:checked":{svg:{display:"block"}}});t.Z=l},22758:function(e,t,r){"use strict";r.d(t,{O:function(){return l},W:function(){return d}});var n=r(97458),i=r(64131),o=r(3379),a=r(1166),s=r(2744),c=r(65662);let u=(0,a.zo)("div",{marginBottom:"$4"}),l=e=>{let t=(0,i.qo)({name:e}),{control:r,errors:n,register:a,setValue:s}=(0,i.Gc)();return{control:r,errors:(0,o.b_)(e,n),register:a,setValue:s,value:t}},d=e=>{let{children:t,errors:r,hint:i,label:a,...l}=e,{id:d,rules:f}=l;return(0,n.jsxs)(u,{children:[a&&(0,n.jsxs)(c.Z,{htmlFor:d,children:[a,i&&(0,n.jsx)(c.O,{children:i})]}),t,r&&(0,n.jsx)(s.Z,{error:r.type&&(0,o.e$)(a,r,f)})]})}},2744:function(e,t,r){"use strict";var n=r(97458);r(52983);let i=(0,r(1166).zo)("small",{color:"$danger",fontSize:"$1",height:"32px",marginBottom:"12px",marginTop:"-12px",width:"100%","& + small":{marginTop:"-22px"}});t.Z=e=>{let{css:t,error:r}=e;return r?(0,n.jsx)(i,{css:{...t},children:r}):(0,n.jsx)(n.Fragment,{})}},65662:function(e,t,r){"use strict";r.d(t,{O:function(){return o}});var n=r(97458);r(52983);var i=r(1166);let o=(0,i.zo)("span",{color:"$nsgBlack70",display:"block",fontWeight:"normal",marginTop:"$2",variants:{display:{inline:{display:"inline"}}}}),a=(0,i.zo)("label",{cursor:"pointer",fontSize:"$3",fontWeight:"bold",display:"block",marginBottom:"$3"});t.Z=e=>{let{children:t,className:r,htmlFor:i,isRequired:o,onClick:s}=e;return(0,n.jsxs)(a,{htmlFor:i,onClick:s,className:r,children:[t," ",o?"*":""]})}},93538:function(e,t,r){"use strict";r.d(t,{U:function(){return s}});var n=r(97458);r(52983);var i=r(1166),o=r(22758),a=r(25044);let s=e=>{let{hint:t,label:r,rules:i,type:a="text",...s}=e,{id:u,name:l}=s,{errors:d,register:f}=(0,o.O)(l);return(0,n.jsx)(o.W,{errors:d,id:u,hint:t,label:r,rules:i,children:(0,n.jsx)(c,{css:{marginBottom:0},hasError:!!d,ref:f(i),type:a,...s})})},c=(0,i.zo)("input",a.T,{borderRadius:"0",height:"44px",padding:"0 10px",variants:{size:{large:{fontSize:"$3",height:"52px"}}}});t.Z=c},61321:function(e,t,r){"use strict";var n=r(1166),i=r(25044);let o=(0,n.zo)("select",i.T,{mozAppearance:"none",webkitAppearance:"none",appearance:"none",backgroundImage:"url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 8' class='chevron__Svg-smzrpq-0 jYtTFD icon-chevron'%3E%3Ctitle%3EChevron%3C/title%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M1 1l6 6 6-6'%3E%3C/path%3E%3C/svg%3E\")",backgroundRepeat:"no-repeat",backgroundPosition:"right 1em top 50%",backgroundSize:"1em auto",height:"44px",paddingLeft:"8px",paddingRight:"2em"});t.Z=o},72370:function(e,t,r){"use strict";let n=(0,r(1166).zo)("form",{display:"flex",flexDirection:"column",margin:"0 auto"});t.Z=n},25044:function(e,t,r){"use strict";r.d(t,{T:function(){return n}});let n=(0,r(37210).iv)({backgroundColor:"$nsgGray10",border:"2px s
1olid $nsgGray10",transition:"all 0.2s ease-out",marginBottom:"20px",width:"100%",fontSize:"$3",fontFamily:"$body","&:disabled":{backgroundColor:"$nsgGray30",borderColor:"$nsgGray30"},"&:focus":{outline:"none",borderColor:"$nsgBlue"},"&:focus::-webkit-input-placeholder":{opacity:0},"&::placeholder":{color:"$nsgBlack30",opacity:1,transition:"opacity 0.2s ease-out"},variants:{hasError:{true:{borderColor:"$danger"}}}})},89603:function(e,t,r){"use strict";r.d(t,{y:function(){return a}});var n=r(37738),i=r(90610),o=r(65270);let a=()=>{let{data:e,error:t,mutate:r,revalidate:a}=(0,n.ZP)(i.Oy,o.Z);return{setTeams:r,teams:e||[],teamsError:t,isPending:!e,loadTeams:a}}},6157:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return I}});var n=r(97458),i=r(39817),o=r.n(i),a=r(89949),s=r(52983),c=r(94311),u=r.n(c),l=r(64131),d=r(90610),f=r(65270),p=r(61723),h=r(1166),g=r(4588),v=r(4288),y=r(72370),m=r(39801),x=r(33208),b=r(93538),j=r(2744),w=r(65662),Z=r(61321);let _=e=>"teamMeetupTicket"===e.product.kind,k=(0,h.zo)("div",{display:"flex",flexDirection:"column"}),O=(0,h.zo)("p",{marginBottom:"10px"}),S=(0,h.zo)("div",{marginBottom:"15px"});var T=e=>{let{event:t,mutateEvent:r,invite:i}
1=e,o=(0,a.useRouter)(),[c,h]=(0,s.useState)(""),[T,C]=(0,s.useState)(""),{control:E,errors:z,handleSubmit:P,register:$}=(0,l.cI)(),A=async e=>i&&i.product.fields&&i.product.fields.reduce((t,r)=>({...t,[r._id]:"object"==typeof e[r._id]?e[r._id].getTime():e[r._id]}),{})||{},q=async e=>({responses:await A(e),...T&&{team:T}}),B=async e=>{let n=await q(e),a=await (0,f.Z)("".concat(d.cx,"/").concat(t.slug,"/invites/").concat(i._id,"/accept"),{body:JSON.stringify(n),method:"POST"});a.errors&&a.errors.length>0&&h(a.errors[0].message),a.errors||r().then(()=>{o.push("/events/".concat(t.slug,"?section=attendees"))})};return(0,n.jsxs)(y.Z,{onSubmit:P(B),children:[_(i)&&(0,n.jsxs)(S,{children:[(0,n.jsx)(O,{children:"You have been invited to an Event that requires a team of at least ".concat(i.product.teamSize," members")}),(0,n.jsx)(g.Z,{onChange:C,selected:T,teamSize:i.product.teamSize})]}),i&&i.product.fields&&i.product.fields.map(e=>(0,n.jsxs)(k,{children:["checkbox"!==e.kind&&(0,n.jsx)(w.Z,{htmlFor:e._id,children:e.label}),"string"===e.kind&&(0,n.jsx)(b.Z,{type:"text",name:e._id,ref:$({required:!0})}),"checkbox"===e.kind&&(0,n.jsxs)(x.Z,{children:[(0,n.jsx)(m.Z,{type:"checkbox",name:e._id,id:e._id,ref:$({required:!0})}),(0,n.jsxs)(w.Z,{htmlFor:e._id,children:[(0,n.jsx)(p.Z,{}),e.label]})]}),"number"===e.kind&&(0,n.jsx)(b.Z,{type:"number",name:e._id,ref:$({required:!0})}),"date"===e.kind&&(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(l.Qr,{control:E,name:e._id,render:t=>(0,n.jsx)(u(),{id:e._id,className:"date-picker",onChange:e=>t.onChange(e),selected:t.value})})}),"select"===e.kind&&(0,n.jsx)(Z.Z,{name:e._id,ref:$({required:!0}),children:e.options.map(e=>(0,n.jsx)("option",{value:e,children:e},e))}),z[e._id]&&"required"===z[e._id].type&&(0,n.jsx)(j.Z,{error:"".concat(e.label," is required")})]},e._id)),c&&(0,n.jsx)("p",{children:(0,n.jsx)(j.Z,{error:c})}),(0,n.jsx)(v.ZP,{type:"submit",children:"Accept Invite"})]})},C=r(69848),E=r(37738),z=r(33338);let P=()=>{let{slug:e}=(0,a.useRouter)().query,{data:t,error:r,mutate:n}=(0,E.ZP)(e?"".concat(d.cx,"/").concat(e):null,f.Z),i=t||null,o=r||(0,z.E)(t);return{event:i,mutate:n,eventError:o,isPending:!i&&!o}};var $=r(22834),A=r(17436);let q=e=>{let{lobbyUser:t}=(0,A.C)($.dy),{data:r,error:n}=(0,E.ZP)(t&&e?(0,d.R$)(e):null,f.Z),i=r||null,o=n||(0,z.E)(r);return{eventStatus:i,eventStatusError:o,isPending:!i&&!o}},B=(0,h.zo)("div",{padding:"100px 0",margin:"0 auto",maxWidth:"600px"});var I=()=>{let{query:{id:e}}=(0,a.useRouter)(),{user:t,initializing:r}=(0,A.C)($.dy),{event:i,isPending:s,eventError:c,mutate:u}=P(),{eventStatus:l,isPending:d,eventStatusError:f}=q(i&&i.slug),p=c||f;return p?(0,n.jsx)(C.Z,{sectionTitle:"Accept Invite",children:(0,n.jsx)(B,{children:(0,n.jsx)("p",{children:"There was an error: ".concat(p,". Please try again.")})})}):t?r||s||d?(0,n.jsx)(C.Z,{sectionTitle:"Accept Invite",children:(0,n.jsx)(B,{children:(0,n.jsx)("p",{children:"Loading..."})})}):i&&l&&l.invite&&l.invite._id===e?(0,n.jsx)(C.Z,{sectionTitle:"Accept Invite",children:(0,n.jsxs)(B,{children:[(0,n.jsxs)("h2",{children:["You have been invited to the event: ",i.title,"."]}),(0,n.jsx)("p",{children:'Fill out the information below and click "submit" to complete your registration.'}),(0,n.jsx)(T,{event:i,mutateEvent:u,invite:l.invite})]})}):(0,n.jsx)(C.Z,{sectionTitle:"Accept Invite",children:(0,n.jsxs)(B,{children:[(0,n.jsx)("h2",{children:"Sorry, this invite is for another user or no longer exists"}),(0,n.jsx)(o(),{href:"/events/[slug]",as:"/events/".concat(null==i?void 0:i.slug),children:"Go to event page"})]})}):(0,n.jsx)(C.Z,{sectionTitle:"Accept Invite",children:(0,n.jsxs)(B,{children:[(0,n.jsx)("h2",{children:"You must be logged in to accept an invite."}),(0,n.jsx)(o(),{href:"/login",children:"Go to login page"})]})})}},3379:function(e,t,r){"use strict";r.d(t,{MP:function(){return s},P6:function(){return o},ZA:function(){return c},bD:function(){return a},b_:function(){return i},e$:function(){return n}});let n=(e,t,r)=>{let{type:n,message:i}=t;if(i&&""!==i)return i.toString();switch(n){case"required":return"".concat(e||"Field"," is required");case"min":if(r&&void 0!==r.min)return"".concat(e||"Field"," must be at least ").concat(r.min);break;case"max":if(r&&void 0!==r.max)return"".concat(e||"Field"," must be a maximum of ").concat(r.max)}return"This caused a problem submitting your request"},i=(e,t)=>{let r;if(e){if(t[e])return t[e];let n=e.replace(/\]/g,"").split("[");r=n.reduce((e,r,i)=>{let o=e||t;return o[r]?o[r]:i===n.length-1?null:e},null)}return r},o=(e,t,r,n)=>r&&(Array.isArray(e)||void 0===e)?e?n?t.filter(t=>e.includes(t.value)):e:[]:n?t.find(t=>e===t.value):""===e?void 0:e,a=(e,t,r)=>{if(!r)return e;let n=null;return t&&(Array.isArray(e)||void 0===e)?(n=e?e.map(e=>"object"==typeof e&&e.value?e.value:e):[]).length?n:[]:(null==e?void 0:e.value)||null},s=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Field",t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0;if(!t)return t;let n={...t};if(r&&(null==t?void 0:t.required)){let r="function"==typeof t.validate?{validate:t.validate}:t.validate;n.validate={...r,requiredMultiSelect:r=>{let n="string"==typeof t.required?t.required:"".concat(e," is required");return r&&!!r.length||n}}}return n},c=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"name";return null==e?void 0:e.map(e=>{let{_id:r}=e;return{label:e[t]?e[t]:r,value:r}})}},31772:function(e,t,r){"use strict";var n=r(25148);function i(){}function o(){}o.resetWarningCache=i,e.exports=function(){function e(e,t,r,i,o,a){if(a!==n){var s=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var r={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol
1:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:o,resetWarningCache:i};return r.PropTypes=r,r}},7862:function(e,t,r){e.exports=r(31772)()},25148:function(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},81690:function(e){var t="undefined"!=typeof Element,r="function"==typeof Map,n="function"==typeof Set,i="function"==typeof ArrayBuffer&&!!ArrayBuffer.isView;e.exports=function(e,o){try{return function e(o,a){if(o===a)return!0;if(o&&a&&"object"==typeof o&&"object"==typeof a){var s,c,u,l;if(o.constructor!==a.constructor)return!1;if(Array.isArray(o)){if((s=o.length)!=a.length)return!1;for(c=s;0!=c--;)if(!e(o[c],a[c]))return!1;return!0}if(r&&o instanceof Map&&a instanceof Map){if(o.size!==a.size)return!1;for(l=o.entries();!(c=l.next()).done;)if(!a.has(c.value[0]))return!1;for(l=o.entries();!(c=l.next()).done;)if(!e(c.value[1],a.get(c.value[0])))return!1;return!0}if(n&&o instanceof Set&&a instanceof Set){if(o.size!==a.size)return!1;for(l=o.entries();!(c=l.next()).done;)if(!a.has(c.value[0]))return!1;return!0}if(i&&ArrayBuffer.isView(o)&&ArrayBuffer.isView(a)){if((s=o.length)!=a.length)return!1;for(c=s;0!=c--;)if(o[c]!==a[c])return!1;return!0}if(o.constructor===RegExp)return o.source===a.source&&o.flags===a.flags;if(o.valueOf!==Object.prototype.valueOf&&"function"==typeof o.valueOf&&"function"==typeof a.valueOf)return o.valueOf()===a.valueOf();if(o.toString!==Object.prototype.toString&&"function"==typeof o.toString&&"function"==typeof a.toString)return o.toString()===a.toString();if((s=(u=Object.keys(o)).length)!==Object.keys(a).length)return!1;for(c=s;0!=c--;)if(!Object.prototype.hasOwnProperty.call(a,u[c]))return!1;if(t&&o instanceof Element)return!1;for(c=s;0!=c--;)if(("_owner"!==u[c]&&"__v"!==u[c]&&"__o"!==u[c]||!o.$$typeof)&&!e(o[u[c]],a[u[c]]))return!1;return!0}return o!=o&&a!=a}(e,o)}catch(e){if((e.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw e}}},63829:function(e,t,r){"use strict";function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}r.d(t,{Z:function(){return n}})},99358:function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}r.d(t,{Z:function(){return n}})},60545:function(e,t,r){"use strict";r.d(t,{Z:function(){return o}});var n=r(72790);function i(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,(0,n.Z)(i.key),i)}}function o(e,t,r){return t&&i(e.prototype,t),r&&i(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}},93904:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});var n=r(28289),i=r(11670),o=r(58611),a=r(10363);function s(e){var t=(0,i.Z)();return function(){var r,i=(0,n.Z)(e);return r=t?Reflect.construct(i,arguments,(0,n.Z)(this).constructor):i.apply(this,arguments),function(e,t){if(t&&("object"===(0,o.Z)(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return(0,a.Z)(e)}(this,r)}}},27969:function(e,t,r){"use strict";r.d(t,{Z:function(){return i}});var n=r(13192);function i(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&(0,n.Z)(e,t)}},84963:function(e,t,r){"use strict";r.d(t,{Z:function(){return i}});var n=r(63829);function i(e,t){if(e){if("string"==typeof e)return(0,n.Z)(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return(0,n.Z)(e,t)}}}},function(e){e.O(0,[7738,4311,2888,9774,179],function(){return e(e.s=82736)}),_N_E=e.O()}]);

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.