1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6594],{53490:function(e,t,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/user/[username]/tickets/[id]",function(){return s(31386)}])},31386:function(e,t,s){"use strict";s.r(t),s.d(t,{__N_SSP:function(){return z},default:function(){return S}});var i=s(85893),n=s(11163),l=s(70309),a=s(48689),r=s(30271),c=s(89508),o=s(89681),d=s(67294),u=s(15694),x=s(91162),h=s(23615),p=s(76885),m=s(57014),f=s(98029),j=s(86795),v=s(34466);let k=(e,t)=>(0,v._i)(j.Z.API.GH.V1.USER.TICKETS.CHECK_IN(e.username,String(e.ticketId),e.signature),{...t,method:"POST"});function y(e){var t,s,j,v,y,b;let{user:w,userTicket:N,onCheckIn:T}=e,{query:I}=(0,n.useRouter)(),{mutateAsync:C,isPending:E}=(0,f.D)({mutationKey:["check-in-user-ticket"],mutationFn:e=>k(e)}),[_,z]=(0,d.useState)(!1),S=I.signature;if(!S)return null;let A=async()=>{let e=(0,m.Am)({variant:"animated",title:"Checking in..."});try{let{checkedInAt:t}=await C({username:w.username,ticketId:N.number,signature:S});if(!t)throw Error("Failed to check-in for unknown reason");e.update({variant:"success",title:"User successfully checked-in",description:"".concat(w.name," has been checked-in")}),null==T||T()}catch(i){var t,s;e.update({variant:"destructive",title:"Failed to check-in",description:null!==(s=null===(t=i.response)||void 0===t?void 0:t.data.message)&&void 0!==s?s:"Please check if the user is eligible"}),console.error(i)}finally{z(!1)}};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{className:"relative flex flex-col gap-8 self-stretch rounded-2xl border-2 border-dashed border-secondary-border p-[24px] pt-[32px] transition-all md:p-[32px]",children:[(0,i.jsx)("p",{className:"text-paragraph absolute -top-[14px] left-[calc(24px-8px)] rounded-md bg-white px-[8px] font-bold text-secondary-border md:left-[calc(32px-8px)]",children:"User Ticket Check-In"}),(0,i.jsx)(c.M,{children:!!N.checkedInAt&&(0,i.jsxs)(o.E.span,{className:"text-paragraph rounded-lg bg-success px-5 py-3 text-center font-bold text-white",initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0},transition:{duration:.5},children:["This ticket was checked-in"," ",(0,i.jsx)("time",{className:"underline",dateTime:N.checkedInAt,children:function(e){let t=(0,l.D)(e);return(0,a.z)(t)?"Today at ".concat((0,r.p6)(t,"HH:mm")):"at ".concat((0,r.p6)(t,"MMM d, yyyy, HH:mm"))}(N.checkedInAt)})," ","\xa0",(0,i.jsx)(u.f,{})]})}),(0,i.jsx)("div",{className:"relative flex flex-col gap-8",children:(0,i.jsxs)("div",{className:"flex flex-col gap-6 md:gap-4",children:[(0,i.jsx)(g,{label:"Email",value:w.email}),(0,i.jsx)(g,{label:"T-Shirt Size",value:null===(s=w.profile)||void 0===s?void 0:null===(t=s.sizes)||void 0===t?void 0:t.tshirt}),(0,i.jsx)(g,{label:"Food Restrictions",value:null===(j=w.profile)||void 0===j?void 0:j.allergies}),(0,i.jsx)(g,{label:"Description",value:null===(v=w.profile)||void 0===v?void 0:v.description,hideIfEmpty:!0}),(0,i.jsx)(g,{label:"Phone",value:null===(y=w.profile)||void 0===y?void 0:y.phone,hideIfEmpty:!0}),(0,i.jsx)(g,{label:"Tax ID",value:null===(b=w.profile)||void 0===b?void 0:b.taxId,hideIfEmpty:!0})]})}),!N.checkedInAt&&(0,i.jsx)("div",{className:"flex justify-end gap-4",children:(0,i.jsxs)(x.z,{className:"maxMedium:flex-1",variant:"success",onClick:()=>z(!0),children:["Check-in Ticket ",(0,i.jsx)(p.J,{name:"check"})]})})]}),(0,i.jsx)(h.Vq,{open:_,onOpenChange:z,children:(0,i.jsx)(h.cZ,{children:(0,i.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,i.jsx)("p",{className:"text-size6 font-bold",children:"Are you sure you want to check-in this ticket?"}),(0,i.jsxs)("div",{className:"flex justify-end gap-4",children:[(0,i.jsx)(x.z,{variant:"ghost",size:"sm",onClick:()=>z(!1),children:"Cancel"}),(0,i.jsx)(x.z,{variant:"success",size:"sm",onClick:A,disabled:E,children:"Confirm"})]})]})})})]})}function g(e){let{label:t,value:s,hideIfEmpty:n=!1}=e;return n&&!s?null:(0,i.jsxs)("div",{className:"flex justify-between md:gap-6 maxMedium:flex-col",children:[(0,i.jsx)("p",{className:"text-paragraph whitespace-nowrap font-bold",children:t}),(0,i.jsx)("p",{className:"text-paragraph hyphens-auto",children:null!=s?s:"N/A"})]})}var b=s(41664),w=s.n(b),N=s(51896),T=s(8602),I=s(19811);function C(e){let{event:t,ticketUser:s,userTicket:n,isMe:l=!1,userHasTicket:a=!1,showActions:r=!0}=e,{user:c}=(0,I.Pi)();return(0,i.jsxs)("div",{className:"flex flex-col items-center justify-center gap-11 self-stretch",children:[l?(0,i.jsxs)("h1",{className:"text-size5 items-center text-center font-bold",children:["This is your ticket, welcome aboard \xa0",(0,i.jsx)(u.f,{})]}):(0,i.jsxs)("h1",{className:"text-size5 items-center text-center font-bold",children:["Join me at ",t.name," \xa0",(0,i.jsx)(u.f,{})]}),(0,i.jsx)(N.D,{userTicket:n,user:s,tilt:!0}),r&&(l?(0,i.jsx)(T.z,{userTicket:n}):a&&c?(0,i.jsx)(x.z,{asChild:!0,children:(0,i.jsxs)(w(),{href:j.Z.UI.AUTH.PROFILE.TICKETS(c.username,n.number),children:["View my own ticket ",(0,i.jsx)(p.J,{name:"arrowDown",rotation:"270"})]})}):(0,i.jsx)(x.z,{asChild:!0,children:(0,i.jsxs)(w(),{href:j.Z.UI.REGISTER(),children:["Get your ticket ",(0,i.jsx)(p.J,{name:"arrowDown",rotation:"270"})]})}))]})}var E=s(80935);let _=e=>{let{event:t,user:s,userTicket:l,isMe:a,canCheckIn:r}=e,{query:c}=(0,n.useRouter)(),{username:o,id:d}=c,{data:u,query:x}=(0,E.C)({username:o,id:d}),h=null!=u?u:l;return(0,i.jsxs)("div",{className:"mx-auto flex w-full max-w-[860px] flex-1 flex-col items-center justify-center gap-15",children:[(0,i.jsx)(C,{ticketUser:s,userTicket:h,event:t,isMe:a,showActions:!r}),r&&(0,i.jsx)(y,{user:s,userTicket:h,onCheckIn:x})]})};_.pageOptions={contentSize:"large"};var z=!0,S=_}},function(e){e.O(0,[2993,4393,2744,8749,2888,9774,179],function(){return e(e.s=53490)}),_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.