PageSourceSearch

https://boraprorole.com.br/assets/evento._slug-B0Rml3LI.js

js boraprorole.com.br collected 2026-10-02 18:50:30 UTC 16,172 bytes, 1 lines download raw bytes

1import{c as q,r as n,s as h,j as e,B as k,L as b,m as O,A as U}from"./index-D9-Yrhnj.js";import{S as F,a as V}from"./SiteHeader-CuRXH4tB.js";import{b as G}from"./index-Chdu5NfX.js";import{T as J,a as K}from"./textarea-CULf0rrd.js";import{t as y}from"./index-NykTA54A.js";import{u as H}from"./useTranslation-98Pc1mQ8.js";import{S as Q}from"./star-iopSLNAb.js";import{T as X}from"./tag-B96H3DGK.js";import{C as Y,M as R}from"./map-pin-CtVZ_0f4.js";import{C as Z}from"./clock-BxKXmWC5.js";import{T as ee}from"./ticket-TTaM-VkC.js";import"./bora-pro-role-logo.webp.asset-IGKqk89C.js";import"./index-BHWo7APl.js";import"./index-Jc0Gbcgd.js";import"./Combination-CT-h_0Vg.js";import"./index-BIcTmGFC.js";import"./chart-column-B8Jan20v.js";const te=[["line",{x1:"19",x2:"5",y1:"5",y2:"19",key:"1x9vlm"}],["circle",{cx:"6.5",cy:"6.5",r:"2.5",key:"4mh3h7"}],["circle",{cx:"17.5",cy:"17.5",r:"2.5",key:"1mdrzq"}]],se=q("percent",te);function ie({eventId:t}){const{t:s,i18n:o}=H(),{user:l}=G(),[r,u]=n.useState([]),[c,i]=n.useState(!0),[m,v]=n.useState(0),[d,S]=n.useState(0),[T,L]=n.useState(""),[P,C]=n.useState(!1),[z,E]=n.useState(!1);n.useEffect(()=>{if(!l){E(!1);return}h.rpc("has_role",{_user_id:l.id,_role:"admin"}).then(({data:a})=>E(!!a))},[l]);const N=async()=>{i(!0);const{data:a}=await h.from("event_ratings").select("id, user_id, rating, comment, created_at").eq("event_id",t).order("created_at",{ascending:!1}),p=a??[],M=Array.from(new Set(p.map(w=>w.user_id)));if(M.length>0){const{data:w}=await h.from("profiles").select("id, display_name, avatar_url").in("id",M),W=new Map((w??[]).map(j=>[j.id,j]));p.forEach(j=>{j.profile=W.get(j.user_id)??null})}u(p),i(!1)};n.useEffect(()=>{N()},[t]);const f=n.useMemo(()=>l?r.find(a=>a.user_id===l.id)??null:null,[r,l]);n.useEffect(()=>{f&&(S(f.rating),L(f.comment??""))},[f]);const D=n.useMemo(()=>r.length===0?0:r.reduce((a,p)=>a+p.rating,0)/r.length,[r]),A=async()=>{if(!l||d<1)return;C(!0);const{error:a}=await h.from("event_ratings").upsert({event_id:t,user_id:l.id,rating:d,comment:T.trim()||null},{onConflict:"event_id,user_id"});if(C(!1),a){y.error(s("vibe.error"));return}y.success(s("vibe.thanks")),N()},B=async a=>{if(!confirm(s("vibe.confirmDelete")))return;const{error:p}=await h.from("event_ratings").delete().eq("id",a);if(p){y.error(s("vibe.error"));return}y.success(s("vibe.deleted")),N()},$=o.language.startsWith("en")?"en-US":o.language.startsWith("es")?"es-ES":"pt-BR";return e.jsxs("section",{children:[e.jsx("h2",{className:"mb-3 text-xl font-bold",children:s("vibe.title")}),e.jsx("p",{className:"mb-4 text-foreground/80",children:s("vibe.description")}),e.jsxs("div",{className:"rounded-2xl border border-border bg-secondary/40 p-5",children:[e.jsx("div",{className:"flex flex-col items-center gap-2 sm:flex-row sm:justify-between",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"text-4xl font-bold text-primary",children:D.toFixed(1)}),e.jsxs("div",{children:[e.jsx(_,{value:Math.round(D),readOnly:!0}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s("vibe.basedOn",{count:r.length})})]})]})}),e.jsx("div",{className:"my-5 h-px bg-border"}),l?e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{className:"text-sm font-semibold",children:s(f?"vibe.yourRating":"vibe.rateNow")}),e.jsx(_,{value:m||d,onHover:v,onSelect:S}),e.jsx(J,{value:T,onChange:a=>L(a.target.value),placeholder:s("vibe.commentPlaceholder"),rows:3,maxLength:500}),e.jsx("div",{className:"flex justify-end",children:e.jsx(k,{onClick:A,disabled:d<1||P,children:s(P?"vibe.sending":f?"vibe.update":"vibe.send")})})]}):e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"mb-3 text-sm text-muted-foreground",children:s("vibe.signInToRate")}),e.jsx(b,{to:"/auth",search:{tab:"signin"},className:"inline-flex items-center justify-center rounded-2xl bg-primary px-5 py-2.5 text-sm font-semibold text-primary-foreground shadow-glow transition hover:opacity-90",children:s("vibe.signIn")})]})]}),c?null:r.length>0?e.jsx("ul",{className:"mt-6 space-y-4",children:r.slice(0,10).map(a=>e.jsxs("li",{className:"rounded-2xl border border-border bg-card p-4",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[a.profile?.avatar_url?e.jsx("img",{src:a.profile.avatar_url,alt:"",className:"h-9 w-9 rounded-full object-cover"}):e.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-full bg-muted text-xs font-semibold",children:(a.profile?.display_name??"?").slice(0,1).toUpperCase()}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-semibold",children:a.profile?.display_name??s("vibe.anonymous")}),e.jsx("p",{className:"text-xs text-muted-foreground",suppressHydrationWarning:!0,children:new Date(a.created_at).toLocaleDateString($)})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(_,{value:a.rating,readOnly:!0,small:!0}),z&&e.jsx("button",{type:"button",onClick:()=>B(a.id),className:"rounded-md p-1.5 text-muted-foreground transition hover:bg-destructive/10 hover:text-destructive","aria-label":s("vibe.delete"),title:s("vibe.delete"),children:e.jsx(K,{className:"h-4 w-4"})})]})]}),a.comment&&e.jsx("p",{className:"mt-3 whitespace-pre-line text-sm text-foreground
1/90",children:a.comment})]},a.id))}):e.jsx("p",{className:"mt-6 text-center text-sm text-muted-foreground",children:s("vibe.empty")})]})}function _({value:t,onSelect:s,onHover:o,readOnly:l,small:r}){const u=r?"h-4 w-4":"h-7 w-7";return e.jsx("div",{className:"flex items-center gap-1",onMouseLeave:()=>o?.(0),children:[1,2,3,4,5].map(c=>{const i=c<=t;return e.jsx("button",{type:"button",disabled:l,onMouseEnter:()=>o?.(c),onClick:()=>s?.(c),className:l?"cursor-default":"transition hover:scale-110 cursor-pointer","aria-label":`${c}`,children:e.jsx(Q,{className:`${u} ${i?"fill-primary text-primary":"fill-transparent text-muted-foreground"}`})},c)})})}function re({eventId:t,eventTitle:s}){const[o,l]=n.useState([]);return n.useEffect(()=>{let r=!0;return(async()=>{const{data:u}=await h.from("blog_post_events").select("blog_posts(slug, title, excerpt, cover_image_url, published)").eq("event_id",t).limit(6),c=(u??[]).map(i=>i.blog_posts).filter(i=>i&&i.published).map(({slug:i,title:m,excerpt:v,cover_image_url:d})=>({slug:i,title:m,excerpt:v,cover_image_url:d}));r&&l(c)})(),()=>{r=!1}},[t]),o.length===0?null:e.jsxs("section",{className:"mt-12",children:[e.jsxs("h2",{className:"text-2xl font-bold",children:["Matérias sobre ",s]}),e.jsx("div",{className:"mt-5 grid gap-5 sm:grid-cols-2 lg:grid-cols-3",children:o.map(r=>e.jsxs(b,{to:"/$slug",params:{slug:r.slug},className:"group overflow-hidden rounded-2xl border border-border bg-card transition hover:shadow-md",children:[r.cover_image_url?e.jsx("img",{src:r.cover_image_url,alt:r.title,loading:"lazy",className:"h-36 w-full object-cover"}):e.jsx("div",{className:"h-36 w-full bg-muted"}),e.jsxs("div",{className:"p-4",children:[e.jsx("h3",{className:"text-sm font-semibold leading-snug group-hover:underline",children:r.title}),r.excerpt&&e.jsx("p",{className:"mt-2 line-clamp-2 text-xs text-muted-foreground",children:r.excerpt})]})]},r.slug))}),e.jsx("div",{className:"mt-5",children:e.jsx(b,{to:"/materia",className:"text-sm font-semibold text-primary hover:underline",children:"Ver todas as matérias do blog"})})]})}function I(t){return t.startsWith("en")?"en-US":t.startsWith("es")?"es-ES":"pt-BR"}function ae(t,s){return new Date(t).toLocaleDateString(I(s),{weekday:"long",day:"2-digit",month:"long",year:"numeric"})}function le(t,s){return new Date(t).toLocaleTimeString(I(s),{hour:"2-digit",minute:"2-digit"})}function x({html:t,as:s="p",className:o}){return e.jsx(s,{className:o,dangerouslySetInnerHTML:{__html:t}})}function _e(){const t=O.useLoaderData(),{t:s,i18n:o}=H(),l=o.language,r=t.dates.length?t.dates:t.event_date?[t.event_date]:[];n.useEffect(()=>{h.from("event_metrics").insert({event_id:t.id,kind:"view",referrer:typeof document<"u"&&document.referrer||null,user_agent:typeof navigator<"u"?navigator.userAgent:null})},[t.id]);const u=i=>h.from("event_metrics").insert({event_id:t.id,kind:i}),c=t.city?`: ${t.city}`:"";return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx(F,{}),e.jsxs("div",{className:"relative h-[40vh] min-h-[280px] w-full overflow-hidden",children:[t.image_url&&e.jsx("img",{src:t.image_url,alt:t.title,className:"absolute inset-0 h-full w-full object-cover"}),e.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/80 via-black/40 to-black/20"}),e.jsx("div",{className:"absolute inset-x-0 top-0 p-4",children:e.jsxs(b,{to:"/",className:"inline-flex items-center gap-1 rounded-full bg-white/90 px-3 py-1.5 text-sm font-medium text-primary backdrop-blur hover:bg-white",children:[e.jsx(U,{className:"h-4 w-4"})," ",s("evento.back")]})}),e.jsxs("div",{className:"absolute inset-x-0 bottom-0 mx-auto max-w-4xl p-6 text-white sm:p-10",children:[t.category&&e.jsx("span",{className:"inline-block rounded-full bg-primary px-3 py-1 text-xs font-semibold uppercase tracking-widest shadow-glow",children:t.category.name}),e.jsx("h1",{className:"mt-3 text-3xl font-bold leading-tight sm:text-5xl",children:t.title}),t.city&&e.jsx("p",{className:"mt-2 text-white/85",children:t.city}),t.tags.length>0&&e.jsx("div",{className:"mt-3 flex flex-wrap gap-2",children:t.tags.map(i=>e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-white/30 bg-white/10 px-3 py-1 text-xs font-medium text-white backdrop-blur",children:[e.jsx(X,{className:"h-3 w-3"})," ",i]},i))})]})]}),e.jsxs("main",{className:"mx-auto max-w-4xl space-y-10 px-4 py-10 sm:px-6 lg:px-8",children:[e.jsxs("section",{children:[e.jsx("h2",{className:"text-2xl font-bold",children:s("evento.aboutTitle",{title:t.title})}),t.description&&e.jsx("p",{className:"mt-3 whitespace-pre-line text-base text-foreground
1/90",children:t.description})]}),t.attractions&&e.jsx(g,{title:s("evento.attractionsTitle",{title:t.title}),children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(x,{html:s("evento.attractionsP1",{title:t.title})}),e.jsx(x,{html:s("evento.attractionsP2",{title:t.title})}),e.jsx("h3",{className:"text-lg font-semibold",children:s("evento.lineupConfirmed",{title:t.title})}),e.jsx("p",{className:"whitespace-pre-line",children:t.attractions})]})}),r.length>0&&e.jsx(g,{title:s("evento.dateTitle",{title:t.title}),children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(x,{html:s("evento.dateP1",{title:t.title})}),e.jsx("ul",{className:"space-y-2 rounded-2xl border border-border bg-secondary/40 p-4 text-center",children:r.map(i=>e.jsxs("li",{className:"flex flex-col items-center justify-center gap-2 sm:flex-row sm:gap-6",children:[e.jsxs("span",{className:"flex items-center justify-center gap-2 capitalize",suppressHydrationWarning:!0,children:[e.jsx(Y,{className:"h-4 w-4 text-primary"}),s("evento.dateLabel")," ",ae(i,l)]}),e.jsxs("span",{className:"flex items-center justify-center gap-2",suppressHydrationWarning:!0,children:[e.jsx(Z,{className:"h-4 w-4 text-primary"}),s("evento.timeLabel")," ",le(i,l)]})]},i))}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-bold",children:s("evento.stayTunedTitle",{title:t.title})}),e.jsx("p",{className:"mt-2",children:s("evento.stayTunedBody")})]})]})}),t.ticket_url&&e.jsx(g,{title:s("evento.ticketsTitle",{title:t.title}),children:e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsx(x,{html:s("evento.ticketsP1",{title:t.title})}),e.jsx(x,{html:s("evento.ticketsP2")})]}),t.coupon_code&&e.jsxs("div",{className:"mx-auto w-full max-w-md rounded-2xl border-2 border-dashed border-primary bg-primary/5 p-4 text-center",children:[e.jsx("p",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:s("evento.couponLabel",{title:t.title})}),e.jsxs("div",{className:"mt-2 flex items-center justify-center gap-2",children:[e.jsx(se,{className:"h-5 w-5 shrink-0 text-primary"}),e.jsx("div",{className:"text-xl font-bold tracking-wider text-primary",children:t.coupon_code}),e.jsx(k,{size:"sm",variant:"outline",onClick:()=>{navigator.clipboard.writeText(t.coupon_code),u("coupon_copy")},children:s("evento.copy")})]}),e.jsx("p",{className:"mt-3 text-xs text-muted-foreground",children:s("evento.couponHint")})]}),e.jsx("div",{className:"flex justify-center pt-2",children:e.jsx("a",{href:t.ticket_url,target:"_blank",rel:"noopener noreferrer",onClick:()=>u("ticket_click"),children:e.jsxs(k,{size:"lg",children:[e.jsx(ee,{className:"mr-2 h-4 w-4"})," ",s("evento.buyTicket")]})})})]})}),(t.location||t.city)&&e.jsx(g,{title:s("evento.locationTitle",{title:t.title}),children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(x,{html:s("evento.locationP1",{title:t.title,cityPart:c})}),e.jsx(x,{html:s("evento.locationP2",{title:t.title})}
1),e.jsxs("div",{className:"flex flex-col gap-4 rounded-2xl border border-border bg-secondary/40 p-4 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[e.jsx(R,{className:"mt-1 h-5 w-5 shrink-0 text-primary"}),e.jsxs("div",{className:"min-w-0",children:[t.location&&e.jsx("p",{className:"font-semibold",children:t.location}),t.city&&e.jsx("p",{className:"text-sm text-muted-foreground",children:t.city})]})]}),(()=>{const i=encodeURIComponent([t.location,t.city].filter(Boolean).join(", "));return i?e.jsxs("a",{href:`https://www.google.com/maps/search/?api=1&query=${i}`,target:"_blank",rel:"noopener noreferrer",className:"inline-flex shrink-0 items-center justify-center gap-2 rounded-2xl bg-primary px-5 py-3 text-sm font-semibold text-primary-foreground shadow-glow transition hover:opacity-90",children:[e.jsx(R,{className:"h-4 w-4"})," ",s("evento.searchMaps")]}):null})()]})]})}),(t.hosting_tips||t.location||t.city)&&e.jsxs(g,{title:s("evento.hostingTitle",{title:t.title}),children:[e.jsxs("div",{className:"mb-4 space-y-3",children:[e.jsx(x,{html:s("evento.hostingP1",{title:t.title})}),e.jsx(x,{html:s("evento.hostingP2",{title:t.title})}),e.jsx("p",{className:"font-semibold",children:s("evento.hostingHint")})]}),(()=>{const i=[t.location,t.city].filter(Boolean).join(", ");if(!i)return null;const m=new URLSearchParams({aid:"boraprorole",address:i});if(t.slug&&m.set("campaign",t.slug),t.location&&m.set("venue",t.location),r[0]){const v=new Date(r[0]),d=new Date(r[r.length-1]);d.setDate(d.getDate()+1),m.set("checkin",v.toISOString().slice(0,10)),m.set("checkout",d.toISOString().slice(0,10))}return e.jsx("div",{className:"overflow-hidden rounded-2xl border",children:e.jsx("iframe",{src:`https://www.stay22.com/embed/gm?${m.toString()}`,title:s("evento.hostingIframeTitle",{title:t.title}),width:"100%",height:460,frameBorder:0,loading:"lazy"})})})()]}),e.jsx(ie,{eventId:t.id}),t.related.length>0&&e.jsx(g,{title:s("evento.relatedTitle",{title:t.title}),children:e.jsx("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3",children:t.related.map(i=>e.jsx(b,{to:"/evento/$slug",params:{slug:i.slug},className:"block",children:e.jsxs("article",{className:"group flex h-full flex-col overflow-hidden rounded-2xl border border-border bg-card transition hover:-translate-y-1 hover:shadow-glow",children:[e.jsx("div",{className:"relative aspect-[3/4] overflow-hidden",children:i.image_url?e.jsx("img",{src:i.image_url,alt:i.title,loading:"lazy",className:"h-full w-full object-cover transition duration-700 group-hover:scale-105"}):e.jsx("div",{className:"h-full w-full bg-muted"})}),e.jsxs("div",{className:"flex flex-1 flex-col p-3",children:[e.jsx("h3",{className:"text-sm font-semibold leading-tight text-foreground line-clamp-2",children:i.title}),i.city&&e.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:i.city})]})]})},i.id))})}),e.jsx(re,{eventId:t.id,eventTitle:t.title})]}),e.jsx(V,{variant:"posrole"})]})}function g({title:t,children:s}){return e.jsxs("section",{children:[e.jsx("h2",{className:"mb-3 text-xl font-bold",children:t}),e.jsx("div",{className:"text-foreground/90",children:s})]})}export{_e as component};

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.