1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9590],{15861:function(e,t,n){"use strict";n.d(t,{Z:function(){return b}});var r=n(63366),i=n(87462),a=n(67294),l=n(86010),c=n(39707),o=n(27192),s=n(11496),u=n(33616),d=n(98216),m=n(28979);function v(e){return(0,m.Z)("MuiTypography",e)}(0,n(76087).Z)("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]);var f=n(85893);let h=["align","className","component","gutterBottom","noWrap","paragraph","variant","variantMapping"],p=e=>{let{align:t,gutterBottom:n,noWrap:r,paragraph:i,variant:a,classes:l}=e,c={root:["root",a,"inherit"!==e.align&&`align${(0,d.Z)(t)}`,n&&"gutterBottom",r&&"noWrap",i&&"paragraph"]};return(0,o.Z)(c,v,l)},g=(0,s.ZP)("span",{name:"MuiTypography",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.variant&&t[n.variant],"inherit"!==n.align&&t[`align${(0,d.Z)(n.align)}`],n.noWrap&&t.noWrap,n.gutterBottom&&t.gutterBottom,n.paragraph&&t.paragraph]}})(({theme:e,ownerState:t})=>(0,i.Z)({margin:0},t.variant&&e.typography[t.variant],"inherit"!==t.align&&{textAlign:t.align},t.noWrap&&{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t.gutterBottom&&{marginBottom:"0.35em"},t.paragraph&&{marginBottom:16})),x={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},N={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},y=e=>N[e]||e,j=a.forwardRef(function(e,t){let n=(0,u.Z)({props:e,name:"MuiTypography"}),a=y(n.color),o=(0,c.Z)((0,i.Z)({},n,{color:a})),{align:s="inherit",className:d,component:m,gutterBottom:v=!1,noWrap:N=!1,paragraph:j=!1,variant:b="body1",variantMapping:D=x}=o,k=(0,r.Z)(o,h),w=(0,i.Z)({},o,{align:s,color:a,className:d,component:m,gutterBottom:v,noWrap:N,paragraph:j,variant:b,variantMapping:D}),Z=m||(j?"p":D[b]||x[b])||"span",T=p(w);return(0,f.jsx)(g,(0,i.Z)({as:Z,ref:t,ownerState:w,className:(0,l.default)(T.root,d)},k))});var b=j},39707:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(87462),i=n(63366),a=n(59766),l=n(48528);let c=["sx"],o=e=>{let t={systemProps:{},otherProps:{}};return Object.keys(e).forEach(n=>{l.Gc[n]?t.systemProps[n]=e[n]:t.otherProps[n]=e[n]}),t};function s(e){let t;let{sx:n}=e,l=(0,i.Z)(e,c),{systemProps:s,otherProps:u}=o(l);return t=Array.isArray(n)?[s,...n]:"function"==typeof n?(...e)=>{let t=n(...e);return(0,a.P)(t)?(0,r.Z)({},s,t):s}:(0,r.Z)({},s,n),(0,r.Z)({},u,{sx:t})}},55855:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(19013),i=n(13882);function a(e){return(0,i.Z)(1,arguments),(0,r.Z)(e).getDate()}},78966:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(19013),i=n(13882);function a(e){return(0,i.Z)(1,arguments),(0,r.Z)(e).getMonth()}},98946:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/ticket-purchase-list/[token]/ticket/[id]",function(){return n(49302)}])},45507:function(e,t,n){"use strict";var r=n(86455),i=n.n(r),a=n(58467),l=n(60845),c=n(67294),o=n(97762);function s(e){if(null==e)return"";if("string"==typeof e){try{let t=JSON.parse(e);if("string"==typeof(null==t?void 0:t.message))return t.message}catch(e){}return e}return"object"==typeof e?"string"==typeof e.message?e.message:JSON.stringify(e):String(e)}let u=e=>{let{title:t,text:n,icon:r,confirmButtonText:u,endpoint:d,endpointConfig:m,onSuccess:v,onConfirm:f,onError:h,onCancel:p,successMessage:g,skipConfirm:x,onConfirmOnSuccess:N,showCancelButton:y=!0,cancelButtonText:j,messageError:b,doneMassage:D,confirmWord:k}=e;return x?(async()=>{let{t:e}=(0,l.$G)("common");try{let t=await (0,a.ZP)(d,m);t.error?(i().fire({title:"".concat(e("ops_error")),text:"".concat(e("reason"))+s(t.error),icon:"error"}),h&&h()):(g&&i().fire({title:"".concat(e("Done")),text:g,icon:"success"}),v&&v(t))}catch(e){return{error:e.message}}})():d?i().fire({title:t,html:"string"==typeof n?n:n?(0,o.Dq)(c.createElement("div",null,n)):void 0,icon:r||"question",showCancelButton:y,reverseButtons:!0,confirmButtonText:u||"
1Sim, tenho certeza",cancelButtonText:j||"Cancelar",showLoaderOnConfirm:!0,allowOutsideClick:!1,preConfirm:async()=>{try{let e=await (0,a.ZP)(d,m);if(e.data.error)return{error:e.data.error};return e}catch(e){return{error:e.message}}}}).then(e=>{if(e.dismiss===i().DismissReason.cancel)return p&&p();e.error||e.value.error?(i().fire({title:b||"Oops, ocorreu um erro!",text:"Motivo: "+s(e.error||e.value.error),icon:"error"}),h&&h()):(g&&i().fire({title:D||"Pronto!",text:g,icon:"success"}).then(e=>{e.isConfirmed&&N&&N()}),v&&v(e.value))}):void i().fire({title:t,html:"string"==typeof n?n||"Tem certeza que deseja sair e descatar as altera\xe7\xf5es?":n?(0,o.Dq)(c.createElement("div",null,n)):"Tem certeza que deseja sair e descatar as altera\xe7\xf5es?",icon:r||"question",showCancelButton:y,reverseButtons:!0,confirmButtonText:u||"Descartar e sair",cancelButtonText:j||"Cancelar",allowOutsideClick:!1,didOpen:()=>{let e=i().getContainer(),t=e=>e.stopPropagation();if(null==e||e.addEventListener("keydown",t,!0),null==e||e.addEventListener("keyup",t,!0),!k)return;let n=i().getConfirmButton(),r=i().getInput();n&&(n.disabled=!0);let a=()=>null==r?void 0:r.focus();a(),requestAnimationFrame(a),null==r||r.addEventListener("input",()=>{n&&(n.disabled=r.value!==k)})},...k?{input:"text",inputPlaceholder:"Digite ".concat(k),inputValidator:e=>{if(e!==k)return"Digite ".concat(k," para confirmar")}}:{}}).then(e=>{if(e.isConfirmed)return f&&f();p&&p()})};t.Z=u},96013:function(e,t,n){"use strict";var r=n(85893),i=n(67294),a=n(89755),l=n.n(a),c=n(45332);let o=e=>{let{src:t,...n}=e,[a,o]=(0,i.useState)((0,c.e6)(t));return i.useEffect(()=>{o((0,c.e6)(t))},[t]),(0,r.jsx)(l(),{src:a,alt:"",placeholder:"blur",className:"placeholder image-with-fallback",draggable:!1,objectFit:"contain",blurDataURL:c.LG,unoptimized:"/placeholder.png"===a,onError:()=>{o("/placeholder.png")},...n})};t.Z=o},67773:function(e,t,n){"use strict";n.r(t);var r=n(85893),i=n(67294),a=n(11163),l=n(21313);let c=()=>{let e=(0,a.useRouter)();return i.useEffect(()=>{setTimeout(()=>{e.replace("/")},5e3)},[e]),(0,r.jsx)("div",{style:{justifyContent:"center",alignItems:"center",display:"flex",height:"100vh"},children:(0,r.jsx)(l.aN,{message:"\xc1rea destinada a compradores com um link de permiss\xe3o para alterar ingressos comprados"})})};t.default=c},49302:function(e,t,n){"use strict";n.r(t),n.d(t,{__N_SSP:function(){return L},default:function(){return H}});var r=n(85893),i=n(67294),a=n(58467),l=n(72132),c=n(50811),o=n(45507),s=n(77349),u=n(94552),d=n(11163),m=n(46870),v=n(62672);function f(e){var t,n;return null!==(n=null!==(t=e.id)&&void 0!==t?t:e._id)&&void 0!==n?n:""}let h=(e,t)=>{var n,r,c,h;let p=(0,v.L6)(),{cart:g}=(0,u.jD)(),x=(0,d.useRouter)(),{type:N,sellStartDate:y,sellEndDate:j,availableDays:b,disabledDays:D,eventPriceRules:k}=e,w=i.useRef({}),Z=i.useRef([]),T=i.useRef(""),S=i.useRef([]),[P,C]=i.useState(!1),[E,M]=i.useState(""),I=i.useRef(""),_=null===(n=Z.current)||void 0===n?void 0:n.length,R=null===(r=Z.current)||void 0===r?void 0:r.reduce((e,t)=>e+t.totalValue,0),O=null===(c=S.current)||void 0===c?void 0:c.find(e=>f(e)===T.current),A=null==O?void 0:O.limit,B=(null==O?void 0:O.discount)||0,L=(null==O?void 0:O.price)?O.price*(1-B/100):0,H=null==g?void 0:g.items.find(e=>e.packId===(null==g?void 0:g.editTicketPackId)),q=(null==H?void 0:H.id)||"";async function F(){E&&(0,o.Z)({title:"Confirmar Convite",text:"Voc\xea confirma gerar seu convite para ".concat((0,m.p6)(E,"P")," ").concat(I.current),confirmButtonText:"Confirmar",endpoint:"/ticket-invitation/confirm",endpointConfig:{method:"POST",data:{orderId:null==t?void 0:t.orderId,userTimezoneOffset:(0,m.Y5)(),ticketId:e.id,tickets:[{invitationId:null==t?void 0:t.id,date:new Date(E),time:I.current,ticketHourId:T.current,dayOfWeek:Number((0,m.uP)(E))}]}},successMessage:"Seu convite foi gerado com sucesso e em instantes enviaremos um email para ".concat(null==t?void 0:t.user.email," com seu convite."),onConfirmOnSuccess:()=>x.replace("/")})}i.useEffect(()=>{if("passport"===N||!y)return;let e=new Date(y),t=new Date;q?H&&(e=H.date,I.current=H.time,T.current=H.ticketHourId):t>=new Date(y)&&(e=t),function e(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(n>365)return;let r=(0,m.tE)(t);if(D.some(e=>(0,m.nv)(e,r))){e((0,s.Z)(r,1),n+1);return}let i=(0,m.uP)(r);(null==b?void 0:b.includes(i))?(M(r),z(r,i,I.current)):e((0,s.Z)(r,1),n+1)}(e)},[e,y,j,q]);let J=i.useMemo(()=>{var e;return null===(e=S.current)||void 0===e?void 0:e.map(e=>{let t=f(e),{startTime:n,endTime:r,qty:i,price:a,discount:l}=e,{sold:c={}}=w.current||{}
1,o=1===S.current.length?"".concat(n,"-").concat(r,"h"):"".concat(n,"h"),s="".concat(n,"-").concat(r),u=c[s]||0,d=[...k].map(e=>{var t;let n=e.type.replace(" (esgotado)",""),r=w.current["limit-percent-"+n],a=(null===(t=w.current["sold-"+n])||void 0===t?void 0:t[s])||0;return a>=i*r/100?(e.type=n+" (esgotado)",e.disabled=!0):(e.type=n,e.disabled=!1),e});return{label:o,time:s,available:i,sold:u,value:t+","+n+"-"+r,disabled:i<=u,price:a,discountPrice:a*(1-l/100),hasDiscount:l>0,purchaseLimit:e.limit,availablePriceRules:d}})},[S.current,w.current,k]),V=i.useCallback(e=>null==e?void 0:e.map(t=>{let{_id:n,startTime:r,endTime:i,qty:a,price:l,discount:c}=t,{sold:o={}}=w.current||{},s=1===e.length?"".concat(r,"-").concat(i,"h"):"".concat(r,"h"),u="".concat(r,"-").concat(i),d=o[u]||0,m=[...k].map(e=>{var t;let n=e.type.replace(" (esgotado)",""),r=w.current["limit-percent-"+n],i=(null===(t=w.current["sold-"+n])||void 0===t?void 0:t[u])||0;return i>=a*r/100?(e.type=n+" (esgotado)",e.disabled=!0):(e.type=n,e.disabled=!1),e}),v={label:s,time:u,available:a,sold:d,value:n+","+r+"-"+i,disabled:a<=d,price:l,discountPrice:l*(1-c/100),hasDiscount:c>0,purchaseLimit:t.limit,availablePriceRules:m};return v}),[w.current,k]),z=i.useCallback(async function(t,n){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";try{if("passport"===e.type)return;C(!0);let i=await a.ZP.get("/ticket/get-hours?ticketId=".concat(e.id,"&date=").concat(t,"&selectedDayOfWeek=").concat(n)),{error:l,availableHoursOfSelectedDay:c,ticketsPurchasedAmount:o}=i.data;if(l)throw Error(l);S.current=c,w.current=o,I.current=r,C(!1)}catch(e){l.Am.error(e.message),C(!1)}},[null==e?void 0:e.id]),U=i.useCallback(t=>{if(t){var n,r;let i=(0,m.tE)(t),a=(0,m.uP)(i);H&&(0,m.nv)(H.date,i)?(I.current=H.time,T.current=H.ticketHourId):(I.current="",T.current=""),M((null===(n=e.availableDays)||void 0===n?void 0:n.includes(a))?i:null),(null===(r=e.availableDays)||void 0===r?void 0:r.includes(a))&&z(i,a,I.current)}},[e,H]),W=i.useCallback(e=>{if(!e)return;let[t,n]=e.split(",");I.current=n,T.current=t,Z.current=[],p()},[q]);return{selectedDay:E,setSelectedDay:M,setDay:U,selectedTime:I.current,setTime:W,price:L,ticketHourId:T.current,ticketData:Z.current,subtractTicket:function(e){let t=[...Z.current],n=t.findIndex(t=>t.ticketType.id===e.id);t.splice(n,1),Z.current=t,p()},totalQty:_,totalValue:R,checkingTicketAvailability:P,confirmInvite:F,discount:B,hoursOptions:J,specificDatesOptions:V,purchaseLimit:A,editingItemId:q,availablePriceRules:(null===(h=null==J?void 0:J.find(e=>e.time===I.current))||void 0===h?void 0:h.availablePriceRules)||[]}};var p=n(50135),g=n(83321),x=n(89834),N=n(34768);let y=e=>{let{text:t}=e;return(0,r.jsx)("div",{className:"group-banner",children:(0,r.jsx)("div",{className:"content",children:(0,r.jsx)(x.D,{rehypePlugins:[N.Z],children:t})})})},j=e=>{let{text:t}=e;return(0,r.jsx)("div",{className:"legal-text",children:(0,r.jsx)("div",{className:"content",children:(0,r.jsx)(x.D,{rehypePlugins:[N.Z],children:t})})})};var b=n(45332),D=n(801),k=n(93946);let w=e=>{let t=(0,d.useRouter)(),{cart:n,clearCartItems:a}=(0,u.jD)(),{onGoBack:l}=e,c=t.query.payment?"paymentTab":t.query.checkout?"checkoutTab":t.query.ticket?"ticketTab":"ticketsTab";return i.useEffect(()=>{var e;!["paymentTab","checkoutTab"].includes(c)||(null==n?void 0:null===(e=n.items)||void 0===e?void 0:e.length)||t.replace({pathname:t.pathname,query:{slug:t.query.slug}},void 0,{shallow:!0})},[c,null==n?void 0:n.updatedAt]),i.useEffect(()=>{let e=document.querySelector(".grecaptcha-badge");if(e)return e.style.bottom="140px","paymentTab"===c?e.style.visibility="visible":e.style.visibility="hidden",()=>{e.style.visibility="hidden"}},[c]),(0,r.jsxs)("div",{className:"ticket-navigator",children:[(0,r.jsx)(k.Z,{onClick:l,children:(0,r.jsx)(D.pf,{})}),(0,r.jsx)("span",{children:"Voltar"})]})};var Z=n(96013);let T=e=>{let{ticket:t,isInvitation:n}=e,{title:i,useLimit:a,useLimitDays:l,event:c,hours:o={},type:s,price:u}=t,d=[];Object.values(o).map(e=>e.map(e=>d.push(e.price)));let v=Math.min(...d),f=Math.max(...d),h="passport"===s?(0,b.fe)(u).slice(0,-3):v===f?(0,b.fe)(v).slice(0,-3):(0,b.fe)(v).slice(0,-3)+" - "+f/100;return(0,r.jsxs)("div",{className:"ticket-info",children:[(0,r.jsx)("div",{className:"cover-image",children:(0,r.jsx)(Z.Z,{src:null==c?void 0:c.image,layout:"fill"})}),(0,r.jsxs)("div",{className:"col",children:[(0,r.jsxs)("div",{className:"title",children:[n&&"Convite - "," ",i]}),"passport"===s?(0,r.jsx)("div",{className:"description",children:"".concat((0,m.p6)(c.startAt,"dd 'de' MMMM")," \xe0 ").concat((0,m.p6)(c.endAt,"dd 'de' MMMM")," | ").concat((0,m.p6)(c.startAt,"p"),"h")}):(0,r.jsx)(r.Fragment,{children:!!l&&(0,r.jsxs)("div",{className:"description",children:["Validade ",l,1===l?" dia":" dias"]})}),(0,r.jsx)("div",{className:"price",children:h})]})]})};var S=n(47097),P=n(21313),C=n(32912),E=n(95570),M=n(78966),I=n(55855),_=n(82711),R=n(36050);let O=e=>{var t,n,s,v;let{ticketPurchase:f}=e,[x,N]=i.useState(!1),[D,k]=i.useState({}),{cart:Z}=(0,u.jD)(),O=i.useRef({}),A=(0,d.useRouter)(),{id:B,title:L,slug:H,availableDays:q,disabledDays:F,legalText:J,infoText:V,type:z,specificDates:U,sellStartDate:W,sellEndDate:$,donation:G,eventId:Y}=O.current,{selectedDay:X,setSelectedDay:Q,setDay:K,selectedTime:ee,setTime:et,checkingTicketAvailability:en,ticketHourId:er,confirmInvite:ei,price:ea,specificDatesOptions:el,hoursOptions:ec,purchaseLimit:eo,editingItemId:es,availablePriceRules:eu}
1=h(O.current);i.useEffect(()=>{let{ticket:e,slug:t}=A.query;f&&(0,a.a8)({method:"get",url:"/ticket/list?slug=".concat(e,"&event_slug=").concat(t),onProcessing:N,onSuccess:e=>{O.current=e.tickets[0]||{},Q((null==f?void 0:f.date)?new Date(f.date):"")}})},[f]);let ed=i.useCallback(()=>{if(!X){l.Am.error("Selecione uma data");return}if(!ee){l.Am.error("Selecione um hor\xe1rio");return}let{token:t}=e,[n,r]=ee.split("-")[0].split(":"),i=new Date(X||new Date);null==i||i.setHours(parseInt(n),parseInt(r),0),(0,o.Z)({text:"Deseja realmente alterar a data e hor\xe1rio do ingresso para ".concat((0,C.Z)(i,"dd/MM/yyyy HH:mm"),"?"),cancelButtonText:"Fechar",confirmButtonText:"Confirmar",onConfirm:async()=>{(0,a.a8)({method:"put",url:"/order-payer-user/ticket-purchase/".concat(null==f?void 0:f.id,"?token=").concat(t),body:{date:i,time:ee},onProcessing:N,onSuccess:e=>{A.replace("/ticket-purchase-list/".concat(t))}})}})},[null==f?void 0:f.id,X,ee,e,A]);return x?(0,r.jsx)(P.aN,{}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"ticket-config content-wrapper",children:[(0,r.jsx)(w,{onGoBack:()=>A.back()}),(0,r.jsx)(T,{ticket:O.current}),(0,r.jsx)(S.Z,{notice:(0,_.$I)(O.current,X)}),(0,r.jsxs)("div",{className:"config",children:[(0,r.jsxs)("div",{className:"col",children:[(0,r.jsx)("div",{className:"label",children:"ALTERAR A DATA"}),(0,r.jsx)(c.Z,{displayStaticWrapperAs:"desktop",openTo:"day",disablePast:!0,value:X,minDate:(0,m.U6)(W),maxDate:(0,m.j9)($),onChange:K,renderInput:e=>(0,r.jsx)(p.Z,{...e}),shouldDisableDate:e=>{var t;if((0,_.gU)(null===(t=(0,_.$I)(O.current,e))||void 0===t?void 0:t.message))return!1;let n=(0,m.uP)(e);return!(null==q?void 0:q.includes(n))||F.some(t=>(0,m.nv)(t,e))}})]}),(0,r.jsxs)("div",{className:"col",children:[(0,r.jsx)("div",{className:"label",children:"ALTERAR O HOR\xc1RIO"}),en?(0,r.jsxs)("div",{className:"loading",children:[(0,r.jsx)("div",{className:"placeholder",children:(0,r.jsx)("div",{className:"shimmer"})}),(0,r.jsx)("div",{className:"placeholder",children:(0,r.jsx)("div",{className:"shimmer"})}),(0,r.jsx)("div",{className:"placeholder",children:(0,r.jsx)("div",{className:"shimmer"})})]}):(0,r.jsx)("div",{className:"hours-select",children:U&&U.length&&U.filter(e=>{let{specificDate:t}=e;return(0,E.Z)(new Date(t))===(0,E.Z)(new Date(X))&&(0,M.Z)(new Date(t))===(0,M.Z)(new Date(X))&&(0,I.Z)(new Date(t))===(0,I.Z)(new Date(X))}).length?null===(t=el(null==U?void 0:U.filter(e=>{let{specificDate:t}=e;return(0,E.Z)(new Date(t))===(0,E.Z)(new Date(X))&&(0,M.Z)(new Date(t))===(0,M.Z)(new Date(X))&&(0,I.Z)(new Date(t))===(0,I.Z)(new Date(X))})))||void 0===t?void 0:t.map((e,t)=>{var n,i,a;let l=new Date(X),c=null==Z?void 0:Z.items.map(e=>e.ticketHourId+","+e.time+","+new Date(e.date).toDateString()),o=e.value+","+new Date(X).toDateString(),s=(null==c?void 0:c.filter(e=>e===o).length)||0,u=(0,R.aN)(e),d=s>=u,v=d||e.disabled||(0,m.oJ)((0,m.mr)(l,(null==e?void 0:null===(n=e.time)||void 0===n?void 0:null===(i=n.split)||void 0===i?void 0:null===(a=i.call(n,"-"))||void 0===a?void 0:a[1])||"23:00")),f=er+","+ee===e.value;return v&&e.time===ee&&et(""),(0,r.jsxs)("div",{className:"card hour-card"+(f?" selected":"")+(v?" disabled":""),onClick:v?()=>null:()=>{et(e.value),k(e)},children:[(0,r.jsx)("div",{className:"checkbox",children:(0,r.jsx)("div",{className:"checkbox-fill"})}),(0,r.jsxs)("div",{className:"col1",children:[(0,r.jsx)("div",{className:"time",children:e.label}),d&&(0,r.jsx)("div",{className:"limit",children:(0,R.m2)(e)?"Sem vagas restantes":"Limite de compra excedido"})]}),(0,r.jsxs)("div",{className:"col",children:[(0,r.jsx)("div",{className:"price",children:e.hasDiscount?(0,r.jsxs)("span",{className:"discount-price",children:[(0,r.jsx)("span",{children:(0,b.fe)(e.price)}),(0,r.jsx)("span",{children:(0,b.fe)(e.discountPrice)})]}):(0,b.fe)(e.price)}),(0,r.jsx)("div",{children:"".concat(s,"/").concat(u)})]}),(0,r.jsx)("div",{className:"bar"}),(0,r.jsx)("div",{className:"fill",style:{width:"".concat(e.sold/e.available*100,"%")}})]},"".concat(e.value,"-").concat(t))}):(null==ec?void 0:ec.length)?ec.map((e,t)=>{var n,i,a;let l=new Date(X),c=null==Z?void 0:Z.items.map(e=>e.ticketHourId+","+e.time+","+new Date(e.date).toDateString()),o=e.value+","+new Date(X).toDateString(),s=(null==c?void 0:c.filter(e=>e===o).length)||0,u=(0,R.aN)(e),d=s>=u,v=d||e.disabled||(0,m.oJ)((0,m.mr)(l,(null==e?void 0:null===(n=e.time)||void 0===n?void 0:null===(i=n.split)||void 0===i?void 0:null===(a=i.call(n,"-"))||void 0===a?void 0:a[1])||"23:00")),f=er+","+ee===e.value;return v&&e.time===ee&&et(""),(0,r.jsxs)("div",{className:"card hour-card"+(f?" selected":"")+(v?" disabled":""),onClick:v?()=>null:()=>{et(e.value),k({})},children:[(0,r.jsx)("div",{className:"checkbox",children:(0,r.jsx)("div",{className:"checkbox-fill"})}),(0,r.jsxs)("div",{className:"col1",children:[(0,r.jsx)("div",{className:"time",children:e.label}),d&&(0,r.jsx)("div",{className:"limit",children:(0,R.m2)(e)?"Sem vagas restantes":"Limite de compra excedido"})]}),(0,r.jsxs)("div",{className:"col",children:[(0,r.jsx)("div",{className:"price",children:e.hasDiscount?(0,r.jsxs)("span",{className:"discount-price",children:[(0,r.jsx)("span",{children:(0,b.fe)(e.price)}),(0,r.jsx)("span",{children:(0,b.fe)(e.discountPrice)})]}):(0,b.fe)(e.price)}),(0,r.jsx)("div",{children:"".concat(s,"/").concat(u)})]}),(0,r.jsx)("div",{className:"bar"}),(0,r.jsx)("div",{className:"fill",style:{width:"".concat(e.sold/e.available*100,"%")}})]},"".concat(e.value,"-").concat(t))}):(0,r.jsx)("div",{className:"no-hours",children:"N\xe3o h\xe1 hor\xe1rios dispon\xedveis"})})]}),(0,r.jsxs)("div",{className:"col",children:[(0,r.jsx)("div",{className:"label",children:"Detalhes do ingresso"}),(0,r.jsxs)("div",{className:"ticket",onClick:()=>null,children:[(0,r.jsxs)("div",{className:"details",children:[(0,r.jsx)("div",{className:"title",children:"Ingresso"}),(0,r.jsx)("p",{children:"Tipo ingresso: ".concat(null==f?void 0:null===(n=f.ticketType)||void 0===n?void 0:n.type)}),(0,r.jsx)("p",{children:"Data da visita: ".concat((null==f?void 0:f.date)?(0,C.Z)(new Date(f.date),"dd/MM/yyyy HH:mm"):"-")})]}),(0,r.jsxs)("div",{className:"details",children:[(0,r.jsx)("div",{className:"title",children:"Portador"}),(0,r.jsx)("p",{children:"Nome: ".concat(null==f?void 0:null===(s=f.user)||void 0===s?void 0:s.name)}),(0,r.jsx)("p",{children:"Email: ".concat(null==f?void 0:null===(v=f.user)||void 0===v?void 0:v.email)})]}),(0,r.jsx)(g.Z,{onClick:ed,children:"Salvar"})]})]})]})]}),(0,r.jsx)(y,{text:V}),(0,r.jsx)(j,{text:J})]})};var A=n(67773);let B=e=>e.error?(0,r.jsx)(A.default,{}):(0,r.jsx)("div",{className:"tickets fade-in-animation",children:(0,r.jsx)(O,{...e})});var L=!0,H=B},47097:function(e,t,n){"use strict";var r=n(85893);n(67294);var i=n(89834),a=n(34768),l=n(801),c=n(82711);let o=e=>{let{notice:t}=e,n=String((null==t?void 0:t.message)||"");if(!(0,c.gU)(n))return null;let o=(null==t?void 0:t.blockSale)!==!1?"Venda indispon\xedvel neste dia":"Aviso";return(0,r.jsxs)("div",{className:"ticket-notice-alert",role:"alert",children:[(0,r.jsx)("div",{className:"ticket-notice-alert__icon","aria-hidden":!0,
1children:(0,r.jsx)(l.zM,{})}),(0,r.jsxs)("div",{className:"ticket-notice-alert__body",children:[(0,r.jsx)("div",{className:"ticket-notice-alert__title",children:o}),(0,r.jsx)("div",{className:"ticket-notice-alert__content",children:(0,r.jsx)(i.D,{rehypePlugins:[a.Z],components:{a:e=>{let{node:t,...n}=e;return(0,r.jsx)("a",{...n,target:"_blank",rel:"noopener noreferrer"})}},children:n})})]})]})};t.Z=o},46870:function(e,t,n){"use strict";n.d(t,{Au:function(){return x},GT:function(){return D},MQ:function(){return p},O:function(){return m},Rg:function(){return y},U6:function(){return k},Y5:function(){return d},YR:function(){return s},j9:function(){return w},mX:function(){return v},mr:function(){return N},nv:function(){return f},oJ:function(){return j},p6:function(){return u},qb:function(){return Z},tE:function(){return g},uP:function(){return h},y5:function(){return b}});var r=n(61436),i=n(32912),a=n(29081),l=n(95826),c=n(99490);let o={pt:a.Z,en:l.Z},s="America/Sao_Paulo";function u(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"PPPP",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"pt";if(!e)return;if(!(0,r.Z)(new Date(e)))return"".concat(e);let a=(0,i.Z)(new Date(e),t,{locale:o[n]});return a}function d(){return new Date().getTimezoneOffset()}function m(e){let t=new Date(e);if(Number.isNaN(t.getTime()))return{year:NaN,month:NaN,day:NaN};if(0===t.getHours()&&0===t.getMinutes()&&0===t.getSeconds()&&0===t.getMilliseconds())return{year:t.getFullYear(),month:t.getMonth()+1,day:t.getDate()};let n=c.ou.fromJSDate(t,{zone:s});return n.isValid?{year:n.year,month:n.month,day:n.day}:{year:NaN,month:NaN,day:NaN}}function v(e){let{year:t,month:n,day:r}=m(e);return Number.isNaN(t)?"":"".concat(t,"-").concat(String(n).padStart(2,"0"),"-").concat(String(r).padStart(2,"0"))}function f(e,t){let n=v(e),r=v(t);return Boolean(n&&r&&n===r)}function h(e){let{year:t,month:n,day:r}=m(e);return Number.isNaN(t)?"NaN":new Date(Date.UTC(t,n-1,r,12)).getUTCDay().toString()}function p(e,t){let n=v(e),r=v(t);return!!n&&!!r&&n>r}function g(e){let{year:t,month:n,day:r}=m(e);return Number.isNaN(t)?new Date(NaN):new Date(t,n-1,r)}function x(){return c.ou.now().toJSDate()}function N(e,t){let{year:n,month:r,day:i}=m(e);if(Number.isNaN(n))return new Date(NaN);let[a="0",l="0"]=t.split(":");return c.ou.fromObject({year:n,month:r,day:i,hour:Number(a)||0,minute:Number(l)||0,second:0,millisecond:0},{zone:s}).toJSDate()}function y(e,t){let[n="00:00",r="23:00"]=(t||"").split("-");return{start:N(e,n),end:N(e,r)}}function j(e){let t=c.ou.fromJSDate(new Date(e));return!t.isValid||t.toMillis()<c.ou.now().toMillis()}function b(e,t){return new Date(e).getTime()>new Date(t).getTime()}function D(e,t){return new Date(e).getTime()<new Date(t).getTime()}function k(e,t){return(null==t?void 0:t.onlyToday)?g(x()):g(e)}function w(e,t){return(null==t?void 0:t.onlyToday)?g(x()):g(e)}function Z(e){return(0,r.Z)(new Date(e))}},62672:function(e,t,n){"use strict";n.d(t,{L6:function(){return u},Nr:function(){return c},gt:function(){return s},ss:function(){return o}});var r=n(67294),i=n(11163),a=n.n(i),l=n(3990);function c(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:300,[n,i]=r.useState(e);return r.useEffect(()=>{let n=setTimeout(()=>{i(e)},t);return()=>{clearTimeout(n)}},[t,e]),n}function o(e,t){let n=r.useRef(!0);r.useEffect(()=>{if(n.current){n.current=!1;return}e()},t)}let s=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Are you sure want to leave this page?";(0,l.Z)(e,t),(0,r.useEffect)(()=>{let n=()=>{if(e&&!window.confirm(t))throw"Route Canceled"};return a().events.on("beforeHistoryChange",n),()=>{a().events.off("beforeHistoryChange",n)}},[e,t])},u=()=>{let[e,t]=r.useState(0);return function(){t(e=>e+1)}}},82711:function(e,t,n){"use strict";n.d(t,{$I:function(){return o},OF:function(){return c},Zc:function(){return l},eU:function(){return i},gU:function(){return a}});var r=n(46870);function i(e){return String(e||"").replace(/<[^>]*>/g," ").replace(/ /gi," ").replace(/\s+/g," ").trim()}function a(e){return i(e).length>0}function l(e,t){if((null==e?void 0:e.length)&&t)return e.find(e=>(0,r.nv)(e.date,t))}function c(e,t){let n=l(e,t);return Boolean(n&&!1!==n.blockSale)}function o(e,t){let n=e.noticeDates;if(null==n?void 0:n.length){if("passport"===e.type)return l(n,new Date);if(t){let e=l(n,t);if(e)return e}return l(n,new Date)}}},36050:function(e,t,n){"use strict";function r(e){if(!e)return 0;let t=Math.max(0,Number(e.available||0)-Number(e.sold||0)),n=Number(e.purchaseLimit);return!Number.isFinite(n)||n<=0?t:Math.min(n,t)}function i(e,t,n){let r=Number(e),i=Math.max(0,n-t);return i<=0?0:!Number.isFinite(r)||r<1?1:Math.min(r,i)}function a(e){if(!e)return!1;let t=Math.max(0,Number(e.available||0)-Number(e.sold||0)),n=Number(e.purchaseLimit)||Number.POSITIVE_INFINITY;return t<n}n.d(t,{Eh:function(){return i},aN:function(){return r},m2:function(){return a}})},3990:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(67294),i=function(e,t){void 0===e&&(e=!0);var n=(0,r.useCallback)(function(n){if("function"!=typeof e||e())return n.preventDefault(),t&&(n.returnValue=t),t},[e,t]);(0,r.useEffect)(function(){if(e)return!function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];e&&e.addEventListener&&e.addEventListener.apply(e,t)}(window,"beforeunload",n),function(){return function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];e&&e.removeEventListener&&e.removeEventListener.apply(e,t)}(window,"beforeunload",n)}},[e,n])}}},function(e){e.O(0,[9774,9809,9755,3243,135,8423,6455,5089,811,2888,179],function(){return e(e.s=98946)}),_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.