PageSourceSearch

https://www.partymate.ai/_next/static/chunks/0woup22ao49nb.js?dpl=dpl_AajgEEENEqqjKC4qRhjwt9uwpKfv

js partymate.ai collected 2026-10-05 14:20:58 UTC 162,175 bytes, 1 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,755366,e=>{"use strict";let t,r;var i=e.i(843476),s=e.i(271645),n=e.i(266027),a=e.i(87316),o=e.i(958377),l=e.i(475254);let d=(0,l.default)("footprints",[["path",{d:"M4 16v-2.38C4 11.5 2.97 10.5 3 8c.03-2.72 1.49-6 4.5-6C9.37 2 10 3.8 10 5.5c0 3.11-2 5.66-2 8.68V16a2 2 0 1 1-4 0Z",key:"1dudjm"}],["path",{d:"M20 20v-2.38c0-2.12 1.03-3.12 1-5.62-.03-2.72-1.49-6-4.5-6C14.63 6 14 7.8 14 9.5c0 3.11 2 5.66 2 8.68V20a2 2 0 1 0 4 0Z",key:"l2t8xc"}],["path",{d:"M16 17h4",key:"1dejxt"}],["path",{d:"M4 13h4",key:"1bwh8b"}]]),c=(0,l.default)("earth",[["path",{d:"M21.54 15H17a2 2 0 0 0-2 2v4.54",key:"1djwo0"}],["path",{d:"M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17",key:"1tzkfa"}],["path",{d:"M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05",key:"14pb5j"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);var u=e.i(991799),m=e.i(210407);let h=(0,l.default)("palette",[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]]);var p=e.i(283086),f=e.i(664030),x=e.i(297387);let g=[{id:"nightlife-this-week",label:"Top Picks this week",blurb:"Personalised to your taste · this week in your city",megaCategory:"nightlife",scope:"local",icon:p.Sparkles,accent:"lime",isDefault:!0,kind:"native",filter:{popularityGt:70}},{id:"nightlife-techno",label:"Techno",blurb:"Underground, peak-time, after-hours",megaCategory:"nightlife",scope:"local",icon:u.Moon,accent:"violet",kind:"native",filter:{genres:["TECHNO"]}},{id:"nightlife-house",label:"House",blurb:"From deep to peak",megaCategory:"nightlife",scope:"local",icon:m.Music2,accent:"amber",kind:"native",filter:{genres:["HOUSE"]}},{id:"nightlife-hiphop",label:"Hip Hop",blurb:"Rap, trap, R&B nights",megaCategory:"nightlife",scope:"local",icon:m.Music2,accent:"rose",kind:"native",filter:{genres:["HIPHOP"]}},{id:"festivals",label:"Festivals",blurb:"Multi-day, open-air, line-ups worth travelling for",megaCategory:"nightlife",scope:"national",icon:o.Flame,accent:"orange",kind:"native",filter:{tags:["FESTIVAL","OPEN_AIR"]}},{id:"rooftop-pool",label:"Rooftop & Pool",blurb:"Day-drinking, sunset sessions, open-air",megaCategory:"lifestyle",scope:"national",icon:x.Wine,accent:"sky",kind:"native",filter:{tags:["ROOFTOP","POOL_PARTY","SUNSET_SESSION","DAY_DRINKING"]}},{id:"formula-one",label:"Formula 1",blurb:"Every Grand Prix of the 2026 season",megaCategory:"sports",scope:"global",icon:f.Trophy,accent:"red",kind:"curated",curatedId:"formula-one-2026"},{id:"marathons",label:"Marathons",blurb:"Major European marathons & city runs",megaCategory:"sports",scope:"global",icon:d,accent:"emerald",kind:"curated",curatedId:"marathons-eu-2026"},{id:"hamburg-citywide",label:"Hamburg Citywide",blurb:"Hafengeburtstag, Schlagermove, Filmfest & co.",megaCategory:"citywide",scope:"local",icon:c,accent:"teal",kind:"curated",curatedId:"hamburg-citywide"},{id:"live-music",label:"Live Music",blurb:"Bands, gigs, special venues",megaCategory:"culture",scope:"local",icon:m.Music2,accent:"indigo",kind:"native",filter:{tags:["LIVE_BAND","BIG_ARTIST"]}},{id:"special-locations",label:"Special Locations",blurb:"Boat parties, lakeside, underground",megaCategory:"culture",scope:"national",icon:h,accent:"fuchsia",kind:"native",filter:{tags:["SPECIAL_LOCATION","BOAT_PARTY","LAKESIDE","UNDERGROUND"]}}],y=g.filter(e=>e.isDefault).map(e=>e.id);function b(e){return g.find(t=>t.id===e)}let v={nightlife:"Nightlife",sports:"Sports",culture:"Culture",lifestyle:"Lifestyle",citywide:"Citywide"},w={lime:{chip:"bg-lime/15 text-lime-text border-lime/40",dot:"bg-lime",ring:"ring-lime/40",pin:"#bef264"},violet:{chip:"bg-violet-500/10 text-violet-700 dark:text-violet-300 border-violet-500/30",dot:"bg-violet-500",ring:"ring-violet-500/30",pin:"#a78bfa"},amber:{chip:"bg-amber-500/10 text-amber-700 dark:text-amber-300 border-amber-500/30",dot:"bg-
1amber-500",ring:"ring-amber-500/30",pin:"#fbbf24"},rose:{chip:"bg-rose-500/10 text-rose-700 dark:text-rose-300 border-rose-500/30",dot:"bg-rose-500",ring:"ring-rose-500/30",pin:"#fb7185"},orange:{chip:"bg-orange-500/10 text-orange-700 dark:text-orange-300 border-orange-500/30",dot:"bg-orange-500",ring:"ring-orange-500/30",pin:"#fb923c"},sky:{chip:"bg-sky-500/10 text-sky-700 dark:text-sky-300 border-sky-500/30",dot:"bg-sky-500",ring:"ring-sky-500/30",pin:"#38bdf8"},red:{chip:"bg-red-500/10 text-red-700 dark:text-red-300 border-red-500/30",dot:"bg-red-500",ring:"ring-red-500/30",pin:"#ef4444"},emerald:{chip:"bg-emerald-500/10 text-emerald-700 dark:text-emerald-300 border-emerald-500/30",dot:"bg-emerald-500",ring:"ring-emerald-500/30",pin:"#10b981"},teal:{chip:"bg-teal-500/10 text-teal-700 dark:text-teal-300 border-teal-500/30",dot:"bg-teal-500",ring:"ring-teal-500/30",pin:"#14b8a6"},indigo:{chip:"bg-indigo-500/10 text-indigo-700 dark:text-indigo-300 border-indigo-500/30",dot:"bg-indigo-500",ring:"ring-indigo-500/30",pin:"#818cf8"},fuchsia:{chip:"bg-fuchsia-500/10 text-fuchsia-700 dark:text-fuchsia-300 border-fuchsia-500/30",dot:"bg-fuchsia-500",ring:"ring-fuchsia-500/30",pin:"#e879f9"}},j={nightlife:u.Moon,sports:f.Trophy,culture:h,lifestyle:x.Wine,citywide:c},k="for-you:subscriptions:v1",N="partymate:for-you-subscriptions-updated",S=new Set(g.map(e=>e.id));function M(){return"u">typeof localStorage}function E(){if(!M())return[];try{let e=localStorage.getItem(k);if(!e)return[];let t=JSON.parse(e);return Array.isArray(t)?t.filter(e=>"string"==typeof e&&S.has(e)):[]}catch{return[]}}function D(e){if(M())try{localStorage.setItem(k,JSON.stringify(e)),window.dispatchEvent(new Event(N))}catch{}}let P=[{topicId:"formula-one",insertAtSectionIndex:1,match:({subscribedIds:e})=>e.some(e=>["nightlife-this-week","rooftop-pool"].includes(e))?"Cool kids in your city also follow Formula 1 — race weekends are peak content":null},{topicId:"festivals",insertAtSectionIndex:2,match:({subscribedIds:e})=>e.some(e=>e.startsWith("nightlife-"))?"Festival season is built into your nightlife — don't miss it":null},{topicId:"hamburg-citywide",insertAtSectionIndex:2,match:({city:e})=>e?.toLowerCase()==="hamburg"?"You're in Hamburg — the city does more than just nightlife":null},{topicId:"marathons",insertAtSectionIndex:3,match:({subscribedIds:e})=>e.includes("rooftop-pool")||e.includes("hamburg-citywide")?"Adjacent to your weekend mode — a major marathon weekend turns a city around":null},{topicId:"live-music",insertAtSectionIndex:3,match:({subscribedIds:e})=>e.includes("nightlife-this-week")&&!e.includes("live-music")?"Bands and live gigs sit nicely between club nights":null}];Array.from(new Set(P.map(e=>e.topicId))).filter(e=>g.some(t=>t.id===e)),e.i(247167);var T=e.i(540143),C=e.i(869230),R=e.i(915823),A=e.i(619273);function I(e,t){let r=new Set(t);return e.filter(e=>!r.has(e))}var L=class extends R.Subscribable{#e;#t;#r;#i;#s;#n;#a;#o;#l;#d=[];constructor(e,t,r){super(),this.#e=e,this.#i=r,this.#r=[],this.#s=[],this.#t=[],this.setQueries(t)}onSubscribe(){1===this.listeners.size&&this.#s.forEach(e=>{e.subscribe(t=>{this.#c(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#s.forEach(e=>{e.destroy()})}setQueries(e,t){this.#r=e,this.#i=t,T.notifyManager.batch(()=>{let e=this.#s,t=this.#u(this.#r);t.forEach(e=>e.observer.setOptions(e.defaultedQueryOptions));let r=t.map(e=>e.observer),i=r.map(e=>e.getCurrentResult()),s=e.length!==r.length,n=r.some((t,r)=>t!==e[r]),a=s||n,o=!!a||i.some((e,t)=>{let r=this.#t[t];return!r||!(0,A.shallowEqualObjects)(e,r)});(a||o)&&(a&&(this.#d=t,this.#s=r),this.#t=i,this.hasListeners()&&(a&&(I(e,r).forEach(e=>{e.destroy()}),I(r,e).forEach(e=>{e.subscribe(t=>{this.#c(e,t)})})),this.#m()))})}getCurrentResult(){return this.#t}getQueries(){return this.#s.map(e=>e.getCurrentQuery())}getObservers(){return this.#s}getOptimisticResult(e,t){let r=this.#u(e),i=r.map(e=>e.observer.getOptimisticResult(e.defaultedQueryOptions)),s=r.map(e=>e.defaultedQueryOptions.queryHash);return[i,e=>this.#h(e??i,t,s),()=>this.#p(i,r)]}#p(e,t){return t.map((r,i)=>{let s=e[i];return r.defaultedQueryOptions.notifyOnChangeProps?s:r.observer.trackResult(s,e=>{t.forEach(t=>{t.observer.trackProp(e)})})})}#h(e,t,r){if(t){let i=this.#l,s=void 0!==r&&void 0!==i&&(i.length!==r.length||r.some((e,t)=>e!==i[t]));return(!this.#n||this.#t!==this.#o||s||t!==this.#a)&&(this.#a=t,this.#o=this.#t,void 0!==r&&(this.#l=r),this.#n=(0,A.replaceEqualDeep)(this.#n,t(e))),this.#n}return e}#u(e){let t=new Map;
1this.#s.forEach(e=>{let r=e.options.queryHash;if(!r)return;let i=t.get(r);i?i.push(e):t.set(r,[e])});let r=[];return e.forEach(e=>{let i=this.#e.defaultQueryOptions(e),s=t.get(i.queryHash)?.shift()??new C.QueryObserver(this.#e,i);r.push({defaultedQueryOptions:i,observer:s})}),r}#c(e,t){let r=this.#s.indexOf(e);if(-1!==r){var i;let e;this.#t=(i=this.#t,(e=i.slice(0))[r]=t,e),this.#m()}}#m(){if(this.hasListeners()){let e=this.#n,t=this.#p(this.#t,this.#d);e!==this.#h(t,this.#i?.combine)&&T.notifyManager.batch(()=>{this.listeners.forEach(e=>{e(this.#t)})})}}},z=e.i(912598),B=e.i(381384),O=e.i(673664),F=e.i(427001),V=e.i(254440);let $={"formula-one-2026":[{id:"f1-2026-bahrain",topicId:"formula-one",title:"Bahrain Grand Prix",subtitle:"Round 1 · Formula 1",start:"2026-03-06",end:"2026-03-08",city:"Sakhir",country:"BH",tag:"Season opener",url:"https://www.formula1.com/en/racing/2026/bahrain.html",accent:"red",emoji:"🏁"},{id:"f1-2026-saudi",topicId:"formula-one",title:"Saudi Arabian Grand Prix",subtitle:"Round 2 · Formula 1",start:"2026-03-13",end:"2026-03-15",city:"Jeddah",country:"SA",tag:"Night race",url:"https://www.formula1.com/en/racing/2026/saudi-arabia.html",accent:"red",emoji:"🌙"},{id:"f1-2026-australia",topicId:"formula-one",title:"Australian Grand Prix",subtitle:"Round 3 · Formula 1",start:"2026-03-27",end:"2026-03-29",city:"Melbourne",country:"AU",url:"https://www.formula1.com/en/racing/2026/australia.html",accent:"red",emoji:"🦘"},{id:"f1-2026-japan",topicId:"formula-one",title:"Japanese Grand Prix",subtitle:"Round 4 · Formula 1",start:"2026-04-10",end:"2026-04-12",city:"Suzuka",country:"JP",url:"https://www.formula1.com/en/racing/2026/japan.html",accent:"red",emoji:"🇯🇵"},{id:"f1-2026-china",topicId:"formula-one",title:"Chinese Grand Prix",subtitle:"Round 5 · Formula 1",start:"2026-04-17",end:"2026-04-19",city:"Shanghai",country:"CN",url:"https://www.formula1.com/en/racing/2026/china.html",accent:"red",emoji:"🐉"},{id:"f1-2026-miami",topicId:"formula-one",title:"Miami Grand Prix",subtitle:"Round 6 · Formula 1",start:"2026-05-01",end:"2026-05-03",city:"Miami",country:"US",tag:"Race weekend",url:"https://www.formula1.com/en/racing/2026/miami.html",accent:"red",emoji:"🌴"},{id:"f1-2026-emilia-romagna",topicId:"formula-one",title:"Emilia Romagna Grand Prix",subtitle:"Round 7 · Formula 1",start:"2026-05-22",end:"2026-05-24",city:"Imola",country:"IT",url:"https://www.formula1.com/en/racing/2026/emili
1a-romagna.html",accent:"red",emoji:"🇮🇹"},{id:"f1-2026-monaco",topicId:"formula-one",title:"Monaco Grand Prix",subtitle:"Round 8 · Formula 1",start:"2026-06-05",end:"2026-06-07",city:"Monte Carlo",country:"MC",tag:"Crown jewel",url:"https://www.formula1.com/en/racing/2026/monaco.html",accent:"red",emoji:"👑"},{id:"f1-2026-spain",topicId:"formula-one",title:"Spanish Grand Prix",subtitle:"Round 9 · Formula 1",start:"2026-06-12",end:"2026-06-14",city:"Madrid",country:"ES",tag:"New venue",url:"https://www.formula1.com/en/racing/2026/spain.html",accent:"red",emoji:"🇪🇸"},{id:"f1-2026-canada",topicId:"formula-one",title:"Canadian Grand Prix",subtitle:"Round 10 · Formula 1",start:"2026-06-26",end:"2026-06-28",city:"Montréal",country:"CA",url:"https://www.formula1.com/en/racing/2026/canada.html",accent:"red",emoji:"🍁"},{id:"f1-2026-austria",topicId:"formula-one",title:"Austrian Grand Prix",subtitle:"Round 11 · Formula 1",start:"2026-07-10",end:"2026-07-12",city:"Spielberg",country:"AT",url:"https://www.formula1.com/en/racing/2026/austria.html",accent:"red",emoji:"🏔️"},{id:"f1-2026-britain",topicId:"formula-one",title:"British Grand Prix",subtitle:"Round 12 · Formula 1",start:"2026-07-24",end:"2026-07-26",city:"Silverstone",country:"GB",tag:"Crown jewel",url:"https://www.formula1.com/en/racing/2026/great-britain.html",accent:"red",emoji:"🇬🇧"},{id:"f1-2026-hungary",topicId:"formula-one",title:"Hungarian Grand Prix",subtitle:"Round 13 · Formula 1",start:"2026-08-21",end:"2026-08-23",city:"Budapest",country:"HU",url:"https://www.formula1.com/en/racing/2026/hungary.html",accent:"red",emoji:"🌶️"},{id:"f1-2026-netherlands",topicId:"formula-one",title:"Dutch Grand Prix",subtitle:"Round 14 · Formula 1",start:"2026-08-28",end:"2026-08-30",city:"Zandvoort",country:"NL",url:"https://www.formula1.com/en/racing/2026/netherlands.html",accent:"red",emoji:"🟧"},{id:"f1-2026-italy",topicId:"formula-one",title:"Italian Grand Prix",subtitle:"Round 15 · Formula 1",start:"2026-09-04",end:"2026-09-06",city:"Monza",country:"IT",tag:"Crown jewel",url:"https://www.formula1.com/en/racing/2026/italy.html",accent:"red",emoji:"🏎️"},{id:"f1-2026-azerbaijan",topicId:"formula-one",title:"Azerbaijan Grand Prix",subtitle:"Round 16 · Formula 1",start:"2026-09-25",end:"2026-09-27",city:"Baku",country:"AZ",url:"https://www.formula1.com/en/racing/2026/azerbaijan.html",accent:"red",emoji:"🌃"},{id:"f1-2026-singapore",topicId:"formula-one",title:"Singapore Grand Prix",subtitle:"Round 17 · Formula 1",start:"2026-10-09",end:"2026-10-11",city:"Singapore",country:"SG",tag:"Night race",url:"https://www.formula1.com/en/racing/2026/singapore.html",accent:"red",emoji:"🌃"},{id:"f1-2026-usa",topicId:"formula-one",title:"United States Grand Prix",subtitle:"Round 18 · Formula 1",start:"2026-10-23",end:"2026-10-25",city:"Austin",country:"US",url:"https://www.formula1.com/en/racing/2026/united-states.html",accent:"red",emoji:"🤠"},{id:"f1-2026-mexico",topicId:"formula-one",title:"Mexico City Grand Prix",subtitle:"Round 19 · Formula 1",start:"2026-10-30",end:"2026-11-01",city:"Mexico City",country:"MX",url:"https://www.formula1.com/en/racing/2026/mexico.html",accent:"red",emoji:"🌮"},{id:"f1-2026-brazil",topicId:"formula-one",title:"São Paulo Grand Prix",subtitle:"Round 20 · Formula 1",start:"2026-11-06",end:"2026-11-08",city:"São Paulo",country:"BR",tag:"Sprint",url:"https://www.formula1.com/en/racing/2026/brazil.html",accent:"red",emoji:"🇧🇷"},{id:"f1-2026-las-vegas",topicId:"formula-one",title:"Las Vegas Grand Prix",subtitle:"Round 21 · Formula 1",start:"2026-11-20",end:"2026-11-22",city:"Las Vegas",country:"US",tag:"Night race",url:"https://www.formula1.com/en/racing/2026/las-vegas.html",accent:"red",emoji:"🎰"},{id:"f1-2026-qatar",topicId:"formula-one",title:"Qatar Grand Prix",subtitle:"Round 22 · Formula 1",start:"2026-12-04",end:"2026-12-06",city:"Lusail",country:"QA",url:"https://www.formula1.com/en/racing/2026/qatar.html",accent:"red",emoji:"🌅"},{id:"f1-2026-abu-dhabi",topicId:"formula-one",title:"Abu Dhabi Grand Prix",subtitle:"Round 23 · Formula 1 · Season finale",start:"2026-12-11",end:"2026-12-13",city:"Abu Dhabi",country:"AE",tag:"Season finale",url:"https://www.formula1.com/en/racing/2026/abu-dhabi.html",accent:"red",emoji:"🏆"}],"marathons-eu-2026":[{id:"marathon-2026-paris",topicId:"marathons",title:"Schneider Electric Marathon de Paris",subtitle:"42.195 km · Marathon",start:"2026-04-12",city:"Paris",country:"FR",tag:"World Marathon Major qualifier",url:"https://www.schneiderelectricparismarathon.com/",accent:"emerald",emoji:"🥐"},{id:"marathon-2026-london",topicId:"marathons",title:"TCS London Marathon",subtitle:"42.195 km · World Marathon Major",start:"2026-04-26",city:"London",country:"GB",tag:"World Marathon Major",url:"https://www.tcslondonmarathon.com/",accent:"emerald",emoji:"🇬🇧"},{id:"marathon-2026-hamburg",topicId:"marathons",title:"Haspa Marathon Hamburg",subtitle:"42.195 km · Germany",start:"2026-04-26",city:"Hamburg",country:"DE",tag:"Local · Hamburg",url:"https://www.haspa-marathon-hamburg.de/",accent:"emerald",emoji:"⚓"}
1,{id:"marathon-2026-koeln",topicId:"marathons",title:"Generali Köln Marathon",subtitle:"42.195 km · Germany",start:"2026-10-04",city:"Cologne",country:"DE",tag:"Local · Cologne",url:"https://www.koeln-marathon.de/",accent:"emerald",emoji:"🍻"},{id:"marathon-2026-berlin",topicId:"marathons",title:"BMW BERLIN-MARATHON",subtitle:"42.195 km · World Marathon Major",start:"2026-09-27",city:"Berlin",country:"DE",tag:"World record course",url:"https://www.bmw-berlin-marathon.com/",accent:"emerald",emoji:"🐻"},{id:"marathon-2026-amsterdam",topicId:"marathons",title:"TCS Amsterdam Marathon",subtitle:"42.195 km · Netherlands",start:"2026-10-18",city:"Amsterdam",country:"NL",url:"https://www.tcsamsterdammarathon.nl/",accent:"emerald",emoji:"🚲"},{id:"marathon-2026-valencia",topicId:"marathons",title:"Valencia Marathon Trinidad Alfonso",subtitle:"42.195 km · Spain",start:"2026-12-06",city:"Valencia",country:"ES",tag:"Fast course",url:"https://www.valenciaciudaddelrunning.com/marathon/",accent:"emerald",emoji:"🍊"}],"hamburg-citywide":[{id:"hh-2026-hafengeburtstag",topicId:"hamburg-citywide",title:"Hafengeburtstag Hamburg",subtitle:"Harbour anniversary · 837 years",start:"2026-05-08",end:"2026-05-10",city:"Hamburg",country:"DE",tag:"Biggest port festival worldwide",url:"https://www.hamburg.de/hafengeburtstag/",accent:"teal",emoji:"⚓"},{id:"hh-2026-schlagermove",topicId:"hamburg-citywide",title:"Schlagermove",subtitle:"Reeperbahn street parade",start:"2026-07-11",city:"Hamburg",country:"DE",tag:"Costumes & floats",url:"https://www.schlagermove.de/",accent:"teal",emoji:"🎶"},{id:"hh-2026-cruise-days",topicId:"hamburg-citywide",title:"Hamburg Cruise Days",subtitle:"Cruise ship parade + harbour show",start:"2026-09-04",end:"2026-09-06",city:"Hamburg",country:"DE",url:"https://www.hamburgcruisedays.de/",accent:"teal",emoji:"🚢"},{id:"hh-2026-reeperbahn-festival",topicId:"hamburg-citywide",title:"Reeperbahn Festival",subtitle:"Music · Arts · Conference",start:"2026-09-23",end:"2026-09-26",city:"Hamburg",country:"DE",tag:"Europe's biggest club festival",url:"https://www.reeperbahnfestival.com/",accent:"teal",emoji:"🎸"},{id:"hh-2026-filmfest",topicId:"hamburg-citywide",title:"Filmfest Hamburg",subtitle:"International film festival",start:"2026-10-01",end:"2026-10-10",city:"Hamburg",country:"DE",url:"https://www.filmfesthamburg.de/",accent:"teal",emoji:"🎬"},{id:"hh-2026-dom-summer",topicId:"hamburg-citywide",title:"Hamburger Sommer-DOM",subtitle:"Northern Germany's biggest funfair",start:"2026-07-24",end:"2026-08-23",city:"Hamburg",country:"DE",tag:"Friday fireworks",url:"https://www.hamburg.de/dom/",accent:"teal",emoji:"🎡"}]};function _(e){let t=$[e]??[],r=Date.now();return t.filter(e=>{let t=new Date(e.end??e.start).getTime();return Number.isFinite(t)&&t>=r}).sort((e,t)=>new Date(e.start).getTime()-new Date(t.start).getTime())}let H={sakhir:{lat:26.0325,lng:50.5106},jeddah:{lat:21.4858,lng:39.1925},melbourne:{lat:-37.8485,lng:144.9685},suzuka:{lat:34.8431,lng:136.5414},shanghai:{lat:31.3389,lng:121.2197},miami:{lat:25.9581,lng:-80.2389},imola:{lat:44.3439,lng:11.7167},"monte carlo":{lat:43.7347,lng:7.4206},madrid:{lat:40.4168,lng:-3.7038},montréal:{lat:45.5048,lng:-73.5228},montreal:{lat:45.5048,lng:-73.5228},spielberg:{lat:47.2197,lng:14.7647},silverstone:{lat:52.0786,lng:-1.0169},budapest:{lat:47.5839,lng:19.2511},zandvoort:{lat:52.3888,lng:4.5408},monza:{lat:45.6156,lng:9.2811},baku:{lat:40.3725,lng:49.8533},singapore:{lat:1.2914,lng:103.864},austin:{lat:30.1328,lng:-97.6411},"mexico city":{lat:19.4042,lng:-99.0907},"são paulo":{lat:-23.7036,lng:-46.6997},"sao paulo":{lat:-23.7036,lng:-46.6997},"las vegas":{lat:36.1147,lng:-115.1728},lusail:{lat:25.49,lng:51.4542},"abu dhabi":{lat:24.4672,lng:54.6031},paris:{lat:48.8566,lng:2.3522},london:{lat:51.5074,lng:-.1278},hamburg:{lat:53.5511,lng:9.9937},cologne:{lat:50.9375,lng:6.9603},berlin:{lat:52.52,lng:13.405},amsterdam:{lat:52.3676,lng:4.9041},valencia:{lat:39.4699,lng:-.3763},ibiza:{lat:38.95,lng:1.43},barcelona:{lat:41.3851,lng:2.1734},atlanta:{lat:33.749,lng:-84.388}};var U=e.i(95187);let G=(0,U.createServerReference)("4067fba84462323f9e7251704e1ebec0bcb76239fc",U.callServer,void 0,U.findSourceMapURL,"fetchTopicEvents"),W="for-you:section-order:v1",q="partymate:for-you-order-updated";function Y(){return"u">typeof localStorage}function Q(){if(!Y())return[];try{let e=localStorage.getItem(W);if(!e)return[];let t=JSON.parse(e);return Array.isArray(t)?t.filter(e=>"string"==typeof e):[]}catch{return[]}}function X(e){if(Y())try{localStorage.setItem(W,JSON.stringify(e)),window.dispatchEvent(new Event(q))}catch{}}var K=e.i(606406),Z=e.i(145645),J=e.i(618566);let ee=(0,l.default)("settings-2",[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);function et(e){let t=e.start_date??e.date;return t?new Date(t).getTime():NaN}function er(e){return e.predicted_popularity_heat??-1}var ei=e.i(71829),es=e.i(603409);function en(e,t){for(let r of t){let t=e[r];if("string"==typeof t&&t.trim())return t}return null}function ea(e){let t=e.toUpperCase().replace(/[\s-]/g,"_");return t in ei.GENRE_LABELS?t:null}function eo(e){return ei.GENRE_LABELS[e]??e}var el=e.i(107233);let ed=(0,l.default)("user-round",[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}
1],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]]);var ec=e.i(522016),eu=e.i(19050);let em=(0,U.createServerReference)("6061a6afedb5f0f3eb2e05ad0ae1a0ed0b0ae18833",U.callServer,void 0,U.findSourceMapURL,"getEventsPublic");var eh=e.i(647163),ep=e.i(652217);function ef({onOpenPicker:e}){let[t,r]=(0,s.useState)([]);(0,s.useEffect)(()=>{let e=()=>{let e=(0,es.getLocalOnboarding)();r(e?.hosts??[])};e();let t=t=>{t.key===es.ONBOARDING_KEY&&e()};return window.addEventListener("storage",t),()=>window.removeEventListener("storage",t)},[]);let a=t.filter(e=>!e.category||"People"===e.category).slice(0,24),o=a.map(e=>e.id),{data:l=new Set}=(0,n.useQuery)({queryKey:["for-you-artist-events",o.join(",")],queryFn:async()=>{if(0===o.length)return new Set;let e=new Date().toISOString(),t=new Date(Date.now()+5184e6).toISOString();try{let{events:r}=await em({p_start_date_after:e,p_start_date_before:t,p_page_ids:o},100),i=new Set;for(let e of r??[]){let t=e.hosts;if(t)for(let e of t)"number"==typeof e?.id&&i.add(e.id)}return i}catch{return new Set}},enabled:o.length>0,staleTime:6e5}),d=(0,s.useMemo)(()=>l,[l]);return 0===a.length?(0,i.jsxs)("section",{children:[(0,i.jsx)(ex,{subtitle:"Quick access to your artists"}),(0,i.jsx)("div",{className:"mt-4",children:(0,i.jsxs)("button",{type:"button",onClick:e,className:"group inline-flex items-center gap-3 rounded-2xl border border-dashed border-divider bg-card px-4 py-3 text-left transition-all hover:-translate-y-px hover:border-foreground
1/60",children:[(0,i.jsx)("span",{className:"flex size-14 items-center justify-center rounded-full border border-divider bg-muted text-muted-foreground",children:(0,i.jsx)(ed,{className:"size-6",strokeWidth:1.5})}),(0,i.jsxs)("span",{className:"flex flex-col",children:[(0,i.jsx)("span",{className:"text-sm font-semibold text-foreground",children:"Add your artists"}),(0,i.jsx)("span",{className:"text-xs text-muted-foreground",children:"Pick a few favourites — we’ll match events to them."})]}),(0,i.jsx)("span",{className:"ml-3 inline-flex size-8 shrink-0 items-center justify-center rounded-full border border-divider text-muted-foreground transition-colors group-hover:border-foreground group-hover:text-foreground",children:(0,i.jsx)(el.Plus,{className:"size-4"})})]})})]}):(0,i.jsxs)("section",{children:[(0,i.jsx)(ex,{subtitle:`${a.length} artists \xb7 tap to see their events`}),(0,i.jsx)("div",{className:"mt-4",children:(0,i.jsxs)(ep.HScrollRow,{gap:"gap-4",snap:!1,children:[a.map(e=>{let t=d.has(e.id);return(0,i.jsx)(ep.HScrollItem,{className:"w-[88px] flex flex-col items-center text-center",children:(0,i.jsxs)(ec.default,{href:`/artists/${e.id}`,className:"group/avatar block","aria-label":`${e.name}${t?" — upcoming events":""}`,children:[(0,i.jsx)("span",{className:(0,eh.cn)("block rounded-full p-[3px] transition-transform group-hover/avatar:-translate-y-px",t?"bg-gradient-to-tr from-lime via-lime/70 to-lime/40":"bg-divider"),children:(0,i.jsx)(eu.PageAvatar,{src:e.logo_url,name:e.name,shape:"round",size:"lg",className:"size-[72px] border-2 border-background bg-background"})}),(0,i.jsx)("span",{className:"mt-2 line-clamp-1 block text-xs font-medium text-foreground",children:e.name}),t&&(0,i.jsx)("span",{className:"text-[10px] font-medium text-lime-700 dark:text-lime-400",children:"events ahead"})]})},e.id)}),e&&(0,i.jsx)(ep.HScrollItem,{className:"w-[88px] flex flex-col items-center text-center",children:(0,i.jsxs)("button",{type:"button",onClick:e,className:"group/add block","aria-label":"Add more artists",children:[(0,i.jsx)("span",{className:"block rounded-full bg-divider p-[3px]",children:(0,i.jsx)("span",{className:"flex size-[72px] items-center justify-center rounded-full border-2 border-background bg-muted text-muted-foreground transition-colors group-hover/add:bg-foreground
1/10 group-hover/add:text-foreground",children:(0,i.jsx)(el.Plus,{className:"size-6"})})}),(0,i.jsx)("span",{className:"mt-2 block text-xs font-medium text-muted-foreground",children:"Add more"})]})})]})})]})}function ex({subtitle:e}){return(0,i.jsxs)("div",{className:"px-0.5",children:[(0,i.jsx)("h2",{className:"text-xl font-semibold tracking-tight text-foreground md:text-2xl",children:"Your artists"}),(0,i.jsx)("p",{className:"mt-0.5 text-sm text-muted-foreground",children:e})]})}var eg=e.i(390445);function ey({affinity:e,city:t,userProfile:r}){let{data:s}=(0,Z.useUser)(),{data:a,isLoading:o}=(0,n.useQuery)({queryKey:["for-you-affinity",e.label,t??"",r?"anchor":"anon"],queryFn:async()=>{let i={p_start_date_after:new Date().toISOString(),p_start_date_before:new Date(Date.now()+3888e6).toISOString()};return t&&(i.p_city=t),e.filter.genres&&e.filter.genres.length>0&&(i.p_genres=e.filter.genres),e.filter.tags&&e.filter.tags.length>0&&(i.p_tags=e.filter.tags),e.filter.pageIds&&e.filter.pageIds.length>0&&(i.p_page_ids=e.filter.pageIds),r&&Object.keys(r).length>0&&(i.p_user_profile=r,i.p_sort_by="personalization"),(await em(i,24)).events.slice(0,12)},staleTime:3e5}),l=a??[];return o||0!==l.length?(0,i.jsxs)("section",{children:[(0,i.jsxs)("div",{className:"px-0.5",children:[(0,i.jsx)("span",{className:"inline-flex items-center gap-1.5 rounded-full border border-violet-500/40 bg-violet-500/10 px-2 py-0.5 text-[10px] font-semibold tracking-[0.14em] text-violet-700 uppercase dark:text-violet-300",children:"For you"}),(0,i.jsx)("h2",{className:"mt-1.5 truncate text-xl font-semibold tracking-tight text-foreground md:text-2xl",children:e.label}),l.length>0&&(0,i.jsxs)("p",{className:"mt-0.5 text-sm text-muted-foreground",children:[l.length," ",1===l.length?"event":"events"," ahead"]})]}),l.length>0&&(0,i.jsx)("div",{className:"mt-5",children:(0,i.jsx)(ep.HScrollRow,{children:l.map(e=>(0,i.jsx)(ep.HScrollItem,{className:"basis-[44%] sm:basis-[28%] md:basis-[20%] lg:basis-[15%]",children:(0,i.jsx)(eg.MmwEventCard,{event:e,user:s??null,followedHostIds:[],showHeat:!0})},e.id))})})]}):null}let eb=(0,l.default)("radar",[["path",{d:"M19.07 4.93A10 10 0 0 0 6.99 3.34",key:"z3du51"}],["path",{d:"M4 6h.01",key:"oypzma"}],["path",{d:"M2.29 9.62A10 10 0 1 0 21.31 8.35",key:"qzzz0"}],["path",{d:"M16.24 7.76A6 6 0 1 0 8.23 16.67",key:"1yjesh"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M17.99 11.66A6 6 0 0 1 15.77 16.67",key:"1u2y91"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"m13.41 10.59 5.66-5.66",key:"mhq4k0"}]]),ev=(0,U.createServerReference)("4062baeb56e2909a84e5181541d5d45fe077a74a2c",U.callServer,void 0,U.findSourceMapURL,"getHeadliners");function ew({city:e,userProfile:t}){let{data:r}=(0,Z.useUser)(),a=!!t,[o,l]=(0,s.useState)([]);(0,s.useEffect)(()=>{let e=()=>{let e=(0,es.getLocalOnboarding)();l(e?.hostIds??[])};e();let t=t=>{t.key===es.ONBOARDING_KEY&&e()};return window.addEventListener("storage",t),()=>window.removeEventListener("storage",t)},[]);let d=o.join(","),{data:c=[]}=(0,n.useQuery)({queryKey:["for-you-headliners",e??"",a?"anchor":"anon",d],queryFn:()=>ev({city:e,userProfile:t,followedHostIds:o}),enabled:!!e,staleTime:6e5});return 0===c.length?null:(0,i.jsxs)("section",{children:[(0,i.jsxs)("div",{className:"flex items-end justify-between gap-4 px-0.5",children:[(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsxs)("span",{className:"inline-flex items-center gap-1.5 rounded-full border border-orange-500/40 bg-orange-500/10 px-2 py-0.5 text-[10px] font-semibold tracking-[0.14em] text-orange-700 uppercase dark:text-orange-300",children:[(0,i.jsx)(eb,{className:"size-3",strokeWidth:2.2}),"On your radar"]}),(0,i.jsxs)("h2",{className:"mt-1.5 truncate text-xl font-semibold tracking-tight text-foreground md:text-2xl",children:["Headliners coming to ",e??"your city"]}),(0,i.jsxs)("p",{className:"mt-1 text-sm text-muted-foreground",children:[c.length," ",1===c.length?"act":"acts"," matching your taste · sorted by date"]})]}),e&&(0,i.jsx)(ec.default,{href:`/cities/${e.toLowerCase()}/events`,className:"hidden shrink-0 items-center gap-1.5 rounded-full border border-divider bg-card px-3.5 py-2 text-sm font-medium text-foreground transition-all hover:border-foreground hover:-translate-y-
1px md:inline-flex",children:"Show all"})]}),(0,i.jsx)("div",{className:"mt-5",children:(0,i.jsx)(ep.HScrollRow,{children:c.map(e=>(0,i.jsx)(ep.HScrollItem,{className:"basis-[44%] sm:basis-[28%] md:basis-[20%] lg:basis-[15%]",children:(0,i.jsx)(ej,{event:e,user:r??null})},e.id))})})]})}function ej({event:e,user:t}){let r=(e.predicted_popularity_heat??0)>=88;return(0,i.jsxs)("div",{className:"relative",children:[(0,i.jsxs)("span",{className:(0,eh.cn)("pointer-events-none absolute left-3 top-3 z-10 inline-flex items-center gap-1 rounded-full px-2 py-1 text-[10px] font-bold tracking-wide shadow-sm backdrop-blur-md",r?"bg-orange-500/95 text-orange-50":"bg-white/85 text-ink"),children:[(0,i.jsx)(o.Flame,{className:"size-3",strokeWidth:2.4}),r?"On fire":"Big act"]}),(0,i.jsx)(eg.MmwEventCard,{event:e,user:t,followedHostIds:[]})]})}var ek=e.i(401851),eN=e.i(972520);let eS=(0,l.default)("calendar-heart",[["path",{d:"M12.127 22H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v5.125",key:"vxdnp4"}],["path",{d:"M14.62 18.8A2.25 2.25 0 1 1 18 15.836a2.25 2.25 0 1 1 3.38 2.966l-2.626 2.856a.998.998 0 0 1-1.507 0z",key:"15cy7q"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 2v4",key:"1cmpym"}]]),eM=(0,U.createServerReference)("409fa3db75354d88d2359909fdc3afe4b22e6703bd",U.callServer,void 0,U.findSourceMapURL,"getActiveOccasion");function eE({city:e,userProfile:t}){let{data:r}=(0,Z.useUser)(),a=!!t,{data:o}=(0,n.useQuery)({queryKey:["for-you-active-occasion",e??""],queryFn:()=>eM(e),staleTime:36e5}),{data:l=[]}=(0,n.useQuery)({queryKey:["for-you-occasion-events",o?.slug??"",o?.year??"",e??"",a?"anchor":"anon"],queryFn:async()=>{if(!o)return[];let e={p_start_date_after:`${o.start_date}T00:00:00.000Z`,p_start_date_before:`${o.end_date}T23:59:59.999Z`};o.city&&(e.p_city=o.city),t&&Object.keys(t).length>0&&(e.p_user_profile=t,e.p_sort_by="personalization");try{return((await em(e,36)).events??[]).filter(e=>(e.personalization?.score??0)>=60)}catch{return[]}},enabled:!!o,staleTime:6e5}),d=l.slice(0,12),c=(0,s.useMemo)(()=>{if(!o)return null;if("holiday"===o.type){let e=(o.city??"").toLowerCase();return e?`/cities/${e}/this-week`:null}return`/occasions/${o.slug}/${o.year}/events`},[o]);if(!o||0===d.length)return null;let u=function(e,t){try{let r=new Date(e),i=new Date(t);if(r.toDateString()===i.toDateString())return(0,ek.format)(r,"EEE, d MMM");if(r.getMonth()===i.getMonth())return`${(0,ek.format)(r,"d")}–${(0,ek.format)(i,"d MMM")}`;return`${(0,ek.format)(r,"d MMM")} – ${(0,ek.format)(i,"d MMM")}`}catch{return""}}(o.start_date,o.end_date),m="holiday"===o.type?"amber":"rose";return(0,i.jsxs)("section",{children:[(0,i.jsxs)("div",{className:"flex items-end justify-between gap-4 px-0.5",children:[(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsxs)("span",{className:"amber"===m?"inline-flex items-center gap-1.5 rounded-full border border-amber-500/40 bg-amber-500/10 px-2 py-0.5 text-[10px] font-semibold tracking-[0.14em] text-amber-700 uppercase dark:text-amber-300":"inline-flex items-center gap-1.5 rounded-full border border-rose-500/40 bg-rose-500/10 px-2 py-0.5 text-[10px] font-semibold tracking-[0.14em] text-rose-700 uppercase dark:text-rose-300",children:["amber"===m?(0,i.jsx)(eS,{className:"size-3"}):(0,i.jsx)(p.Sparkles,{className:"size-3"}),"holiday"===o.type?"Holiday":"Occasion"," · ",u]}),(0,i.jsx)("h2",{className:"mt-1.5 truncate text-xl font-semibold tracking-tight text-foreground md:text-2xl",children:o.name}),(0,i.jsxs)("p",{className:"mt-1 text-sm text-muted-foreground",children:[d.length," ",1===d.length?"pick":"picks"," for you · 60%+ match"]})]}),c&&(0,i.jsxs)(ec.default,{href:c,className:"hidden shrink-0 items-center gap-1.5 rounded-full border border-divider bg-card px-3.5 py-2 text-sm font-medium text-foreground transition-all hover:border-foreground hover:-translate-y-px md:inline-flex",children:["Show all",(0,i.jsx)(eN.ArrowRight,{className:"size-4"})]})]}),(0,i.jsx)("div",{className:"mt-5",children:(0,i.jsx)(ep.HScrollRow,{children:d.map(e=>(0,i.jsx)(ep.HScrollItem,{className:"basis-[60%] sm:basis-[38%] md:basis-[28%] lg:basis-[22%]",children:(0,i.jsx)(eg.MmwEventCard,{event:e,user:r??null,followedHostIds:[]})},e.id))})}),c&&(0,i.jsx)("div",{className:"mt-3 px-0.5 md:hidden",children:(0,i.jsxs)(ec.default,{href:c,className:"inline-flex items-center gap-1.5 text-sm font-medium text-foreground",children:["Show all ",o.name," events",(0,i.jsx)(eN.ArrowRight,{className:"size-3.5"})]})})]})}var eD=e.i(971757),eP=e.i(297589),eT=e.i(112213);function eC({anchorLat:t,anchorLng:r,anchorCity:a,userProfile:o}){let l=(0,s.useRef)(null),d=(0,s.useRef)(null),c=(0,s.useRef)(new Map),u=(0,s.useRef)(null),[m,h]=(0,s.use
1State)(!1),[p,f]=(0,s.useState)(null),x=(0,s.useMemo)(()=>({after:new Date().toISOString(),before:new Date(Date.now()+7776e6).toISOString()}),[]),{data:g,isLoading:y}=(0,n.useQuery)({queryKey:["for-you-short-trip",t,r,o?"anchor":"anon"],queryFn:()=>(0,eP.getShortTripEvents)({latitude:t,longitude:r,startAfter:x.after,startBefore:x.before,userProfile:o??null}),staleTime:3e5}),b=(0,s.useMemo)(()=>(0,eT.groupEventsByDestination)(g?.events??[]),[g]),v=(0,s.useMemo)(()=>b.slice().sort((e,t)=>t.topCoolness!==e.topCoolness?t.topCoolness-e.topCoolness:t.eventCount-e.eventCount).slice(0,8),[b]);(0,s.useEffect)(()=>{let i=!1,s="pk.eyJ1IjoibmlrbGFzYWkiLCJhIjoiY21vZTd5OGxzMGVvbDJyczI0amNicGVhNSJ9.0IlxC5yvSL-70kOGKIuTXg\n";if(!l.current||!s)return;(async()=>{let n=(await e.A(52498)).default;if(i)return;await e.A(98650),n.accessToken=s;let a=new n.Map({container:l.current,style:"mapbox://styles/mapbox/dark-v11",center:[r,t],zoom:3.2,projection:{name:"mercator"},attributionControl:!1});d.current=a,a.on("load",()=>{i||h(!0)})})();let n=c.current;return()=>{i=!0;let e=d.current;e?.remove?.(),d.current=null,n.clear(),u.current=null,h(!1)}},[t,r]),(0,s.useEffect)(()=>{if(!m)return;let i=d.current;if(!i)return;let s=!1;return(async()=>{let n=(await e.A(52498)).default;if(s)return;c.current.forEach(e=>e.remove()),c.current.clear(),v.forEach(e=>{let t=e.id===p,r=22+1.6*Math.min(e.eventCount,6),s=e.topCoolness>=80?"#FE4F30":e.topCoolness>=65?"#B6E300":"#7BC74D",a=document.createElement("button");a.type="button",a.setAttribute("aria-label",`${e.name} — ${e.eventCount} events`),a.style.cssText=[`width:${r}px`,`height:${r}px`,"border-radius:9999px",`background:${s}`,"border:2px solid rgba(0,0,0,0.85);display:flex;align-items:center;justify-content:center;color:rgba(0,0,0,0.85);font-weight:700;font-size:10px;line-height:1;cursor:pointer;transition:transform 160ms ease, box-shadow 160ms ease",t?"box-shadow:0 0 0 3px rgba(255,255,255,0.45), 0 0 22px 8px rgba(254, 79, 48,0.55);transform:scale(1.2);":"box-shadow:0 0 0 2px rgba(255,255,255,0.18), 0 2px 6px rgba(0,0,0,0.6);"].join(";"),e.eventCount>1&&(a.textContent=String(e.eventCount)),a.addEventListener("click",()=>f(e.id));let o=new n.Marker(a).setLngLat([e.longitude,e.latitude]).addTo(i);c.current.set(e.id,o)}),u.current&&(u.current.remove(),u.current=null);let a=document.createElement("div");a.style.cssText="width:14px;height:14px;border-radius:9999px;border:2px solid #FE4F30;background:rgba(254, 79, 48,0.25);box-shadow:0 0 14px rgba(254, 79, 48,0.65);pointer-events:none;",u.current=new n.Marker(a).setLngLat([r,t]).addTo(i);let o=v.filter(e=>{var i,s,n;return 5e3>=(i=t,s=r,n=e.latitude,12742*Math.asin(Math.sqrt(Math.sin((n-i)*Math.PI/180/2)**2+Math.sin((e.longitude-s)*Math.PI/180/2)**2*Math.cos(i*Math.PI/180)*Math.cos(n*Math.PI/180))))});if(0===o.length)i.flyTo({center:[r,t],zoom:3.2,duration:500});else{let e=new n.LngLatBounds;e.extend([r,t]),o.forEach(t=>e.extend([t.longitude,t.latitude])),i.fitBounds(e,{padding:56,maxZoom:5.4,duration:500})}})(),()=>{s=!0}},[v,p,m,t,r]);let w=(0,s.useMemo)(()=>v.find(e=>e.id===p)??null,[v,p]),j=w??v[0]??null;return y||0!==v.length?(0,i.jsxs)("section",{children:[(0,i.jsxs)("div",{className:"flex items-end justify-between gap-4 px-0.5",children:[(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsxs)("span",{className:"inline-flex items-center gap-1.5 rounded-full border border-cyan-500/40 bg-cyan-500/10 px-2 py-0.5 text-[10px] font-semibold tracking-[0.14em] text-cyan-700 uppercase dark:text-cyan-300",children:[(0,i.jsx)(eD.Plane,{className:"size-3",strokeWidth:2.2}),"Short trips"]}),(0,i.jsx)("h2",{className:"mt-1.5 text-xl font-semibold tracking-tight text-foreground md:text-2xl",children:"Worth flying for in the next 90 days"}),(0,i.jsxs)("p",{className:"mt-1 text-sm text-muted-foreground",children:[v.length," ",1===v.length?"destination":"destinations"," ","from"," ",(0,i.jsx)("span",{className:"font-medium text-foreground",children:a??"your area"})]})]}),(0,i.jsxs)(ec.default,{href:"/short-trip",className:"hidden shrink-0 items-center gap-1.5 rounded-full border border-divider bg-card px-3.5 py-2 text-sm font-medium text-foreground transition-all hover:border-foreground hover:-translate-y-
1px md:inline-flex",children:["Open full map",(0,i.jsx)(eN.ArrowRight,{className:"size-4"})]})]}),(0,i.jsx)("div",{className:"mt-5 overflow-hidden rounded-2xl border border-divider bg-[#0A0A0F] shadow-sm",children:(0,i.jsxs)("div",{className:"relative",children:[(0,i.jsx)("div",{ref:l,className:"h-[280px] w-full md:h-[360px]","aria-label":"Map of nearby short-trip destinations",role:"region"}),j&&(0,i.jsx)(eR,{dest:j,onClose:()=>f(null),isActive:!!w})]})}),(0,i.jsx)("div",{className:"mt-3 px-0.5 md:hidden",children:(0,i.jsxs)(ec.default,{href:"/short-trip",className:"inline-flex items-center gap-1.5 text-sm font-medium text-foreground",children:["Open the full short-trip map",(0,i.jsx)(eN.ArrowRight,{className:"size-3.5"})]})})]}):null}function eR({dest:e,onClose:t,isActive:r}){let s=e.events[0];return(0,i.jsx)("div",{className:"pointer-events-none absolute inset-x-3 bottom-3 md:inset-x-4 md:bottom-4",children:(0,i.jsxs)("div",{className:"pointer-events-auto inline-flex max-w-md flex-wrap items-center gap-3 rounded-xl border border-white/15 bg-black/70 px-3 py-2 text-white shadow-lg backdrop-blur-md",children:[(0,i.jsxs)("span",{className:"inline-flex items-center gap-2",children:[(0,i.jsx)("span",{className:"size-2 rounded-full bg-lime"}),(0,i.jsx)("span",{className:"text-sm font-semibold",children:e.name})]}),(0,i.jsxs)("span",{className:"text-[11px] text-white/60",children:[e.eventCount," ",1===e.eventCount?"event":"events"," · coolness"," ",Math.round(e.topCoolness)]}),s&&(0,i.jsxs)(ec.default,{href:`/events/${s.slug}`,className:"ml-1 inline-flex items-center gap-1 rounded-full bg-white px-3 py-1 text-[12px] font-semibold text-ink",children:["Top pick",(0,i.jsx)(eN.ArrowRight,{className:"size-3"})]}),r&&(0,i.jsx)("button",{type:"button",onClick:t,className:"ml-1 text-[11px] text-white/60 hover:text-white",children:"Clear"})]})})}var eA=e.i(531278),eI=e.i(653339),eL=e.i(222976),ez=e.i(369600);function eB(){let[e,t]=(0,s.useState)(!1),[r,n]=(0,s.useState)(!1),[a,o]=(0,s.useState)(null),[l,d]=(0,s.use
1State)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(eL.TastePickerDialog,{open:e,onOpenChange:t,onSubmitted:()=>{d(!0)}}),(0,i.jsxs)("div",{className:"absolute inset-0 z-10 flex items-start justify-center px-4 pb-12 pt-16 sm:pt-24 md:pt-32",role:"dialog","aria-modal":"true","aria-labelledby":"for-you-gate-title",children:[(0,i.jsx)("div",{"aria-hidden":!0,className:"absolute inset-0 bg-gradient-to-b from-background/80 via-background/70 to-background/95"}),(0,i.jsxs)("div",{className:"relative w-full max-w-md rounded-2xl border border-divider bg-card/95 p-6 shadow-xl ring-1 ring-black/5 backdrop-blur-md dark:border-border md:p-8",children:[(0,i.jsxs)("div",{className:"flex items-center gap-2",children:[(0,i.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full bg-violet-500/10 px-2 py-0.5 text-[10px] font-semibold tracking-[0.18em] uppercase text-violet-600 ring-1 ring-violet-500/30 dark:text-violet-300",children:[(0,i.jsx)(p.Sparkles,{className:"size-3","aria-hidden":!0}),"For you"]}),l&&(0,i.jsx)(eA.Loader2,{className:"size-4 animate-spin text-muted-foreground"})]}),(0,i.jsx)("h2",{id:"for-you-gate-title",className:"mt-3 text-2xl font-semibold leading-tight tracking-tight text-foreground md:text-3xl",children:l?"Building your dashboard…":"Make this dashboard yours"}),(0,i.jsx)("p",{className:"mt-2 text-sm leading-relaxed text-muted-foreground",children:l?"We're scoring events against your picks. A few seconds and your feed will be ready.":"Connect Spotify to instantly tune Top Picks, Monthly Gems and the rest to your taste — or pick a few favourites manually. No account needed for the manual flow."}),!l&&(0,i.jsxs)("div",{className:"mt-5 flex flex-col gap-2.5",children:[(0,i.jsxs)("button",{type:"button",onClick:()=>{o(null),n(!0);try{(0,ez.startSpotifyConnect)({returnTo:"/for-you"})}catch(t){n(!1);let e=t instanceof Error?t.message:"Spotify connect failed.";o(e.includes("NEXT_PUBLIC_SPOTIFY_CLIENT_ID")?"Spotify connect isn't configured on this build. Pick favourites manually below — same result.":e)}},disabled:r,className:"inline-flex items-center justify-center gap-2 rounded-full bg-[#1DB954] px-5 py-3 text-sm font-semibold text-white shadow-sm transition-all hover:bg-[#1ed760] disabled:cursor-wait disabled:opacity-80",children:[(0,i.jsx)(eO,{className:"size-5"}),r?"Opening Spotify…":"Connect Spotify (recommended)"]}),a&&(0,i.jsx)("p",{className:"rounded-lg border border-amber-500/40 bg-amber-500/10 px-3 py-2 text-[12px] leading-snug text-amber-700 dark:text-amber-300",children:a}),(0,i.jsxs)("button",{type:"button",onClick:()=>t(!0),className:"inline-flex items-center justify-center gap-2 rounded-full border border-divider bg-transparent px-5 py-2.5 text-sm font-medium text-foreground transition-colors hover:border-foreground hover:bg-card",children:[(0,i.jsx)(eI.Music,{className:"size-4","aria-hidden":!0}),"Pick a few favourites"]}),(0,i.jsx)("p",{className:"mt-1 text-center text-[11px] text-muted-foreground",children:"Picks save locally. Sign in later to keep them across devices."}),(0,i.jsxs)("div",{className:"mt-1 flex flex-wrap items-center justify-center gap-1.5 text-[11px] text-muted-foreground",children:[(0,i.jsx)("span",{children:"Or demo:"}),(0,i.jsx)(ec.default,{href:"/for-you-demo/niklas",className:"rounded-full border border-divider bg-card px-2 py-0.5 font-medium text-foreground transition-colors hover:border-foreground",children:"Niklas · EDM"}),(0,i.jsx)(ec.default,{href:"/for-you-demo/sophie",className:"rounded-full border border-divider bg-card px-2 py-0.5 font-medium text-foreground transition-colors hover:border-foreground",children:"Sophie · Pop"})]})]})]})]})]})}function eO({className:e}){return(0,i.jsx)("svg",{viewBox:"0 0 168 168",xmlns:"http://www.w3.org/2000/svg",className:e,"aria-hidden":!0,children:(0,i.jsx)("path",{fill:"currentColor",d:"M84 0a84 84 0 1 0 0 168A84 84 0 0 0 84 0Zm38.5 121.2a5.2 5.2 0 0 1-7.2 1.7c-19.7-12-44.5-14.7-73.6-8a5.2 5.2 0 0 1-2.3-10.2c31.9-7.3 59.4-4.2 81.4 9.3a5.2 5.2 0 0 1 1.7 7.2Zm10.3-22.9a6.5 6.5 0 0 1-8.9 2.1c-22.6-13.9-57-17.9-83.7-9.8a6.5 6.5 0 1 1-3.8-12.5c30.6-9.3 68.5-4.8 94.3 11a6.5 6.5 0 0 1 2.1 8.9V99Zm.9-23.8c-27-16-71.6-17.5-97.3-9.7a7.8 7.8 0 1 1-4.5-15c29.6-9 78.9-7.3 109.9 11.2a7.8 7.8 0 1 1-8.1 13.4Z"})})}var eF=e.i(664659),eV=e.i(346897);function e$({anchorCity:e,totalEvents:t,onCityClick:r}){let{data:s}=(0,Z.useUser)(),n=s?.account?.name?.split(" ")?.[0]??null;return n?(0,i.jsxs)("header",{children:[(0,i.jsxs)("span",{className:"inline-flex items-center gap-2 rounded-full border border-lime/40 bg-lime/10 px-3 py-1 text-xs font-medium text-foreground",children:[(0,i.jsxs)("span",{className:"relative flex size-1.5",children:[(0,i.jsx)("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-lime opacity-75"}),(0,i.jsx)("span",{className:"relative inline-flex size-1.5 rounded-full bg-lime"})]}),(0,i.jsx)(p.Sparkles,{className:"size-3.5"}),"Your event dashboard"]}),(0,i.jsxs)("h1",{className:"mt-4 text-4xl font-semibold leading-[1.02] tracking-tighter text-foreground md:text-5xl",children:["For you, ",n]}),(0,i.jsxs)("p",{className:"mt-3 flex flex-wrap items-center gap-x-3 gap-y-1 text-sm text-muted-foreground",children:[(0,i.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,i.jsx)(eV.MapPin,{className:"size-3.5"}),e]}),t>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("span",{"aria-hidden":!0,
1className:"size-0.5 rounded-full bg-muted-foreground/60"}),(0,i.jsxs)("span",{children:[t," events this week"]})]})]})]}):(0,i.jsx)("header",{className:"flex items-center gap-2",children:(0,i.jsxs)("button",{type:"button",onClick:r,className:"inline-flex items-center gap-2 text-3xl font-bold tracking-tight text-foreground transition-colors hover:text-foreground/80 md:text-4xl",children:[e,(0,i.jsx)(eF.ChevronDown,{className:"size-6 text-muted-foreground",strokeWidth:2})]})})}var e_=e.i(363178),eH=e.i(778917),eU=e.i(37727);let eG=[{id:"all",label:"All upcoming",days:1/0},{id:"1w",label:"Next 7 days",days:7},{id:"2w",label:"Next 2 weeks",days:14},{id:"1m",label:"Next 30 days",days:30},{id:"3m",label:"Next 3 months",days:90}];function eW({pins:t,anchorLat:r,anchorLng:n}){let a=(0,s.useRef)(null),o=(0,s.useRef)(null),l=(0,s.useRef)(new Map),d=(0,s.useRef)(null),[c,u]=(0,s.useState)(!1),[m,h]=(0,s.useState)(null),[p,f]=(0,s.useState)(eG[2]),{resolvedTheme:x}=(0,e_.useTheme)(),g="light"===x?"mapbox://styles/mapbox/light-v11":"mapbox://styles/mapbox/dark-v11",y=(0,s.useMemo)(()=>{if(!Number.isFinite(p.days))return t;let e=Date.now()+24*p.days*36e5;return t.filter(t=>{let r=new Date(t.start).getTime();return Number.isFinite(r)&&r<=e})},[t,p]),b=(0,s.useMemo)(()=>y.find(e=>e.id===m)??null,[y,m]);return(0,s.useEffect)(()=>{let t=!1,i="pk.eyJ1IjoibmlrbGFzYWkiLCJhIjoiY21vZTd5OGxzMGVvbDJyczI0amNicGVhNSJ9.0IlxC5yvSL-70kOGKIuTXg\n";if(!a.current||!i)return;(async()=>{let s=(await e.A(52498)).default;if(t)return;await e.A(98650),s.accessToken=i;let l=new s.Map({container:a.current,style:g,center:[n,r],zoom:3.2,projection:{name:"mercator"},attributionControl:!1});o.current=l,l.on("load",()=>{t||u(!0)})})();let s=l.current;return()=>{t=!0;let e=o.current;e?.remove?.(),o.current=null,s.clear(),u(!1)}},[r,n]),(0,s.useEffect)(()=>{if(!c)return;let t=o.current;if(!t)return;let i=!1;return(async()=>{let s=(await e.A(52498)).default;if(i)return;l.current.forEach(e=>e.remove()),l.current.clear(),y.forEach(e=>{let r=w[e.accent]??w.lime,i=document.createElement("button");i.type="button",i.setAttribute("aria-label",e.title),i.style.cssText=["width:22px;height:22px;border-radius:9999px",`background:${r.pin}`,"border:2px solid rgba(255,255,255,0.92);cursor:pointer;transition:transform 160ms ease;box-shadow:0 2px 6px rgba(0,0,0,0.45)",e.id===m?"transform:scale(1.4); box-shadow:0 0 0 3px rgba(255,255,255,0.6), 0 0 22px 6px "+r.pin+"aa;":""].join(";"),i.addEventListener("click",()=>h(e.id));let n=new s.Marker(i).setLngLat([e.lng,e.lat]).addTo(t);l.current.set(e.id,n)}),d.current&&(d.current.remove(),d.current=null);let a=document.createElement("div");if(a.style.cssText="width:14px;height:14px;border-radius:9999px;border:2px solid #FE4F30;background:rgba(254, 79, 48,0.25);box-shadow:0 0 14px rgba(254, 79, 48,0.65);pointer-events:none;",d.current=new s.Marker(a).setLngLat([n,r]).addTo(t),y.length>0){let e=new s.LngLatBounds;e.extend([n,r]),y.forEach(t=>e.extend([t.lng,t.lat])),t.fitBounds(e,{padding:80,maxZoom:7,duration:600})}})(),()=>{i=!0}},[y,c,m,r,n]),(0,s.useEffect)(()=>{if(!c)return;let e=o.current;e&&e.setStyle(g)},[g,c]),(0,i.jsxs)("div",{className:"relative overflow-hidden rounded-2xl border border-divider bg-card",children:[(0,i.jsx)("div",{ref:a,className:"h-[68vh] w-full","aria-label":"Map of your subscribed events",role:"region"}),(0,i.jsx)("div",{className:"pointer-events-none absolute inset-x-0 top-4 flex justify-center",children:(0,i.jsx)("div",{className:"pointer-events-auto flex flex-wrap items-center gap-1 rounded-full border border-divider bg-page/90 px-1.5 py-1 shadow-sm backdrop-blur-md",children:eG.map(e=>(0,i.jsx)("button",{type:"button",onClick:()=>f(e),className:(0,eh.cn)("rounded-full px-3 py-1.5 text-xs font-medium transition-colors",p.id===e.id?"bg-foreground text-background":"text-muted-foreground hover:text-foreground"),children:e.label},e.id))})}),(0,i.jsxs)("div",{className:"pointer-events-none absolute bottom-4 left-4 inline-flex items-center gap-1.5 rounded-full bg-page/90 px-3 py-1.5 text-xs font-medium text-foreground shadow-sm backdrop-blur-md",children:[(0,i.jsx)(eV.MapPin,{className:"size-3.5"}),y.length," ",1===y.length?"event":"events"]}),b&&(0,i.jsx)(eq,{pin:b,onClose:()=>h(null)})]})}function eq({pin:e,onClose:t}){let r=w[e.accent]??w.lime,s=(()=>{try{return(0,ek.format)(new Date(e.start),"EEE, d MMM").toUpperCase()}catch{return""}})();return(0,i.jsxs)("div",{className:"absolute inset-x-4 bottom-4 max-w-md rounded-xl border border-divider bg-page/95 p-4 shadow-xl backdrop-blur-md md:bottom-6 md:right-6 md:left-auto",children:[(0,i.jsxs)("div",{className:"flex items-start gap-3",children:[(0,i.jsx)("span",{className:(0,eh.cn)("mt-0.5 size-2.5 shrink-0 rounded-full",r.dot),"aria-hidden":!0}),(0,i.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,i.jsx)("p",{className:"text-[10px] font-semibold tracking-[0.14em] text-muted-foreground uppercase",children:e.topicLabel}),(0,i.jsx)("h3",{className:"mt-0.5 line-clamp-2 text-sm font-semibold leading-snug text-foreground",children:e.title}),(0,i.jsxs)("div",{className:"mt-1.5 flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-muted-foreground",children:[s&&(0,i.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,i.jsx)(a.Calendar,{className:"size-3"}),s]}),(0,i.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,i.jsx)(eV.MapPin,{className:"size-3"}),e.city]})]})]}),(0,i.jsx)("button",{"aria-label":"Close detail",type:"button",onClick:t,className:"flex size-7 shrink-0 items-center justify-center rounded-full border border-divider bg-card text-muted-foreground transition-colors hover:border-foreground hover:text-foreground",children:(0,i.jsx)(eU.X,{className:"size-3.5"})})]}),e.href&&(0,i.jsx)("div",{className:"mt-3 flex items-center gap-2",children:e.href.startsWith("http")?(0,i.jsxs)("a",{href:e.href,rel:"noopener noreferrer",target:"_blank",className:"inline-flex flex-1 items-center justify-center gap-1.5 rounded-full bg-foreground px-4 py-2 text-xs font-semibold text-background",children:["View details",(0,i.jsx)(eH.ExternalLink,{className:"size-3"})]}):(0,i.jsx)(ec.default,{href:e.href,className:"inline-flex flex-1 items-center justify-center gap-1.5 rounded-full bg-foreground px-4 py-2 text-xs font-semibold text-background",children:"Open event"})})]})}var eY=e.i(24708),eQ=e.i(55545),eX=e.i(455024),eK=e.i(418196),eZ=e.i(99151),eJ=e.i(845110),e0=e.i(40058),e1=e.i(234662);let e2=(0,U.createServerReference)("0045933d66ba078e325d9cffc1a2cc4284857ad3dc",U.callServer,void 0,U.findSourceMapURL,"getFriendActivity"),e5={saved:"saved",booked:"booked",going:"is going to"};function e6({enabled:e=!0}){let{data:t=[]}=(0,n.useQuery)({queryKey:["for-you-friend-activity"],queryFn:()=>e2(),enabled:e,staleTime:12e4});return e&&0!==t.length?(0,i.jsxs)("section",{children:[(0,i.jsx)("h2",{className:"text-xl font-semibold tracking-tight text-foreground md:text-2xl",children:"Your Friends"}),(0,i.jsx)("ul",{className:"mt-4 divide-y divide-divider rounded-2xl border border-divider bg-card",children:t.map(e=>(0,i.jsx)("li",{className:"px-4 py-3",children:(0,i.jsxs)(ec.default,{href:`/events/${e.eventSlug}`,className:"flex items-center gap-3 transition-opacity hover:opacity-80",children:[(0,i.jsx)("span",{className:"flex size-10 shrink-0 items-center justify-center rounded-full bg-foreground
1/10 text-sm font-semibold text-foreground",children:e.friendInitial}),(0,i.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,i.jsxs)("p",{className:"line-clamp-1 text-sm text-foreground",children:[(0,i.jsx)("span",{className:"font-semibold",children:e.friendName})," ",(0,i.jsx)("span",{className:"text-muted-foreground",children:e5[e.kind]})," ",(0,i.jsx)("span",{className:"font-medium",children:e.eventName})]}),(0,i.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:function(e){try{var t,r;return t=new Date(e),r={addSuffix:!0},function(e,t,r){let i,s=(0,eX.getDefaultOptions)(),n=r?.locale??s.locale??eQ.defaultLocale,a=(0,e0.compareAsc)(e,t);if(isNaN(a))throw RangeError("Invalid time value");let o=Object.assign({},r,{addSuffix:r?.addSuffix,comparison:a}),[l,d]=(0,eJ.normalizeDates)(r?.in,...a>0?[t,e]:[e,t]),c=(0,eK.getRoundingMethod)(r?.roundingMethod??"round"),u=d.getTime()-l.getTime(),m=u/e1.millisecondsInMinute,h=(u-((0,eZ.getTimezoneOffsetInMilliseconds)(d)-(0,eZ.getTimezoneOffsetInMilliseconds)(l)))/e1.millisecondsInMinute,p=r?.unit;if("second"===(i=p||(m<1?"second":m<60?"minute":m<e1.minutesInDay?"hour":h<e1.minutesInMonth?"day":h<e1.minutesInYear?"month":"year"))){let e=c(u/1e3);return n.formatDistance("xSeconds",e,o)}if("minute"===i){let e=c(m);return n.formatDistance("xMinutes",e,o)}if("hour"===i){let e=c(m/60);return n.formatDistance("xHours",e,o)}if("day"===i){let e=c(h/e1.minutesInDay);return n.formatDistance("xDays",e,o)}if("month"===i){let e=c(h/e1.minutesInMonth);return 12===e&&"month"!==p?n.formatDistance("xYears",1,o):n.formatDistance("xMonths",e,o)}else{let e=c(h/e1.minutesInYear);return n.formatDistance("xYears",e,o)}}(t,(0,eY.constructNow)(t),r)}catch{return""}}(e.when)})]})]})},e.id))})]}):null}var e3=e.i(343926);function e4({event:e,hasAnchor:t}){let r,s,n,a=(r=[],s=e.personalization?.score??0,n=er(e),t&&s>=80?r.push("Recommended"):t&&s>=60&&r.push("Good match"),n>=85?r.push("Trending"):n>=70&&r.push("Hot ticket"),0===r.length&&r.push("Editor's pick"),r.slice(0,2)),o=function(e){let t=e.start_date??e.date,r=e.end_date;if(!t)return"";try{let e=new Date(t);if(r){let t=new Date(r);if(e.toDateString()!==t.toDateString()){if(e.getMonth()===t.getMonth())return`${(0,ek.format)(e,"d")}–${(0,ek.format)(t,"d MMM")}`;return`${(0,ek.format)(e,"d MMM")} – ${(0,ek.format)(t,"d MMM")}`}}return(0,ek.format)(e,"EEE, d MMM")}catch{return""}}(e),l=[e.place?.name,e.place?.city].filter(Boolean).join(" · ");return(0,i.jsx)(ec.default,{href:`/events/${e.slug}`,className:"group relative block overflow-hidden rounded-3xl bg-ink ring-1 ring-black/[0.06] dark:ring-white/[0.06]",children:(0,i.jsxs)("div",{className:"relative aspect-[16/9] w-full md:aspect-[21/9]",children:[(0,i.jsx)(e3.MainAsset,{alt:e.name??"Featured event",className:"size-full transition-transform duration-500 ease-out group-hover:scale-[1.025]",event:e,size:"hero",preferSquareForImages:!1}),(0,i.jsx)("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 bg-gradient-to-t from-black/85 via-black/35 to-transparent"}),(0,i.jsx)("div",{className:"absolute left-5 top-5 flex flex-wrap items-center gap-1.5",children:a.map(e=>(0,i.jsxs)("span",{className:(0,eh.cn)("inline-flex items-center gap-1 rounded-full px-2.5 py-1 text-[10px] font-semibold tracking-[0.14em] uppercase backdrop-blur-md","Recommended"===e?"bg-lime/95 text-lime-text":"bg-white/85 text-ink"),children:["Recommended"===e&&(0,i.jsx)(p.Sparkles,{className:"size-3"}),e]},e))}),(0,i.jsxs)("div",{className:"absolute inset-x-5 bottom-5 flex items-end justify-between gap-4 md:inset-x-8 md:bottom-7",children:[(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsx)("h2",{className:"line-clamp-2 text-2xl font-semibold leading-tight tracking-tight text-white drop-shadow-sm md:text-4xl",children:e.name}),(0,i.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-x-2.5 gap-y-1 text-sm text-white/85 md:text-base",children:[o&&(0,i.jsx)("span",{children:o}),o&&l&&(0,i.jsx)("span",{"aria-hidden":!0,className:"size-1 rounded-full bg-white/55"}),l&&(0,i.jsx)("span",{className:"truncate",children:l})]})]}),(0,i.jsxs)("span",{className:(0,eh.cn)("hidden shrink-0 items-center gap-2 rounded-full bg-white px-5 py-2.5 text-sm font-semibold text-ink shadow-sm transition-all md:inline-flex","group-hover:-translate-y-
1px group-hover:shadow-md"),children:["View event",(0,i.jsx)(eN.ArrowRight,{className:"size-4 transition-transform duration-200 group-hover:translate-x-0.5"})]})]})]})})}let e8=(0,l.default)("gem",[["path",{d:"M10.5 3 8 9l4 13 4-13-2.5-6",key:"b3dvk1"}],["path",{d:"M17 3a2 2 0 0 1 1.6.8l3 4a2 2 0 0 1 .013 2.382l-7.99 10.986a2 2 0 0 1-3.247 0l-7.99-10.986A2 2 0 0 1 2.4 7.8l2.998-3.997A2 2 0 0 1 7 3z",key:"7w4byz"}],["path",{d:"M2 9h20",key:"16fsjt"}]]);function e7({city:e,userProfile:t}){let{data:r}=(0,Z.useUser)(),a=!!t,{data:o=[]}=(0,n.useQuery)({queryKey:["for-you-next-30-days",e??"",a?"anchor":"anon"],queryFn:async()=>{let r=new Date().toISOString(),i=new Date(Date.now()+2592e6).toISOString();try{let s={p_start_date_after:r,p_start_date_before:i};return e&&(s.p_city=e),t&&Object.keys(t).length>0?(s.p_user_profile=t,s.p_sort_by="personalization"):s.p_predicted_popularity_heat_greater_than=70,(await em(s,24)).events.slice().sort((e,t)=>e9(e)-e9(t)).slice(0,12)}catch{return[]}},staleTime:6e5}),l=(0,s.useMemo)(()=>0===o.length?"":`${o.length} ${1===o.length?"pick":"picks"} \xb7 sorted by date`,[o.length]);return 0===o.length?null:(0,i.jsxs)("section",{className:"mt-4",children:[(0,i.jsxs)("div",{className:"px-0.5",children:[(0,i.jsx)("h2",{className:"text-2xl font-semibold tracking-tight text-foreground md:text-3xl",children:"Your picks in the next 30 days"}),(0,i.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:l})]}),(0,i.jsx)("div",{className:"mt-5",children:(0,i.jsx)(ep.HScrollRow,{children:o.map(e=>(0,i.jsx)(ep.HScrollItem,{className:"basis-[44%] sm:basis-[28%] md:basis-[20%] lg:basis-[15%]",children:(0,i.jsxs)("div",{className:"relative",children:[(0,i.jsxs)("span",{className:"pointer-events-none absolute left-3 top-3 z-10 inline-flex items-center gap-1 rounded-full bg-amber-500/95 px-2 py-1 text-[10px] font-bold tracking-wide text-amber-950 shadow-sm backdrop-blur-md",children:[(0,i.jsx)(e8,{className:"size-3",strokeWidth:2.4}),"Gem"]}),(0,i.jsx)(eg.MmwEventCard,{event:e,user:r??null,followedHostIds:[]})]})},e.id))})})]})}function e9(e){let t=e.start_date??e.date;return t?new Date(t).getTime():1/0}function te({className:e}){let[t,r]=(0,s.useState)(!1),[n,a]=(0,s.useState)(null),[o,l]=(0,s.useState)(!1);return(0,i.jsxs)("div",{className:(0,eh.cn)("relative overflow-hidden rounded-2xl border border-violet-500/30 bg-gradient-to-br from-violet-500/10 via-card to-card p-5 md:p-6",e),children:[(0,i.jsxs)("div",{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[(0,i.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,i.jsxs)("span",{className:"inline-flex items-center gap-1.5 rounded-full bg-violet-500/15 px-2 py-0.5 text-[10px] font-semibold tracking-[0.16em] text-violet-700 uppercase dark:text-violet-300",children:[(0,i.jsx)(p.Sparkles,{className:"size-3"}),"Make it yours"]}),(0,i.jsx)("h3",{className:"mt-2 text-lg font-semibold tracking-tight text-foreground md:text-xl",children:"Tell us what you like — your dashboard adapts instantly"}),(0,i.jsxs)("p",{className:"mt-1 text-sm leading-relaxed text-muted-foreground",children:["Sync Spotify or pick a few favourites and"," ",(0,i.jsx)("span",{className:"font-medium text-foreground",children:"Top Picks"}),","," ",(0,i.jsx)("span",{className:"font-medium text-foreground",children:"Monthly Gems"})," ","and the rest will start matching your taste. No account needed."]})]}),(0,i.jsxs)("div",{className:"flex shrink-0 flex-col gap-2 sm:flex-row md:flex-col lg:flex-row",children:[(0,i.jsxs)("button",{type:"button",onClick:()=>{a(null),l(!0);try{(0,ez.startSpotifyConnect)({returnTo:"/for-you"})}catch(t){l(!1);let e=t instanceof Error?t.message:"Spotify connect failed.";a(e.includes("NEXT_PUBLIC_SPOTIFY_CLIENT_ID")?"Spotify connect isn't configured on this build — pick favourites manually instead.":e)}},disabled:o,className:(0,eh.cn)("inline-flex items-center justify-center gap-2 rounded-full bg-[#1DB954] px-4 py-2.5 text-sm font-semibold text-white shadow-sm transition-all hover:bg-[#1ed760]",o&&"cursor-wait opacity-80"),children:[(0,i.jsx)(tt,{className:"size-4"}),o?"Opening Spotify…":"Connect Spotify"]}),(0,i.jsxs)("button",{type:"button",onClick:()=>r(!0),className:"inline-flex items-center justify-center gap-2 rounded-full border border-divider bg-transparent px-4 py-2.5 text-sm font-medium text-foreground transition-colors hover:border-foreground",children:[(0,i.jsx)(eI.Music,{className:"size-4"}),"Pick a few favourites"]})]})]}),n&&(0,i.jsx)("p",{className:"mt-3 rounded-lg border border-amber-500/40 bg-amber-500/10 px-3 py-2 text-[12px] leading-snug text-amber-700 dark:text-amber-300",children:n}),(0,i.jsxs)("div",{className:"mt-3 flex flex-wrap items-center gap-1.5 text-[11px] text-muted-foreground",children:[(0,i.jsx)("span",{children:"Or try a demo profile:"}),(0,i.jsx)(ec.default,{href:"/for-you-demo/niklas",className:"rounded-full border border-divider bg-card px-2 py-0.5 font-medium text-foreground transition-colors hover:border-foreground",children:"Niklas · EDM"}),(0,i.jsx)(ec.default,{href:"/for-you-demo/sophie",className:"rounded-full border border-divider bg-card px-2 py-0.5 font-medium text-foreground transition-colors hover:border-foreground",children:"Sophie · Pop"})]}),(0,i.jsx)(eL.TastePickerDialog,{open:t,onOpenChange:r,onSubmitted:()=>r(!1)})]})}function tt({className:e}){return(0,i.jsx)("svg",{viewBox:"0 0 168 168",xmlns:"http://www.w3.org/2000/svg",className:e,"aria-hidden":!0,
1children:(0,i.jsx)("path",{fill:"currentColor",d:"M84 0a84 84 0 1 0 0 168A84 84 0 0 0 84 0Zm38.5 121.2a5.2 5.2 0 0 1-7.2 1.7c-19.7-12-44.5-14.7-73.6-8a5.2 5.2 0 0 1-2.3-10.2c31.9-7.3 59.4-4.2 81.4 9.3a5.2 5.2 0 0 1 1.7 7.2Zm10.3-22.9a6.5 6.5 0 0 1-8.9 2.1c-22.6-13.9-57-17.9-83.7-9.8a6.5 6.5 0 1 1-3.8-12.5c30.6-9.3 68.5-4.8 94.3 11a6.5 6.5 0 0 1 2.1 8.9V99Zm.9-23.8c-27-16-71.6-17.5-97.3-9.7a7.8 7.8 0 1 1-4.5-15c29.6-9 78.9-7.3 109.9 11.2a7.8 7.8 0 1 1-8.1 13.4Z"})})}var tr=e.i(550516),ti=e.i(980797),ts=e.i(399219),ts=ts,tn=e.i(394908);let ta=(0,l.default)("ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]),to=(0,U.createServerReference)("70897506517446178a6cd96f87d237db7d6b8a8732",U.callServer,void 0,U.findSourceMapURL,"getMarkedDaysInRange");var tl=e.i(595727),td=e.i(611316);function tc({selectedDay:e,onSelect:t,events:r,markedDays:n}){let a=(0,s.useMemo)(()=>{let e=[],t=new Date;t.setHours(0,0,0,0);for(let r=0;r<7;r++)e.push((0,tl.addDays)(t,r));return e},[]),o=(0,s.useMemo)(()=>{let e=new Set;for(let t of r){let r=t.start_date??t.date;if(!r)continue;let i=new Date(r);Number.isFinite(i.getTime())&&e.add(tu(i))}return e},[r]),l=(0,s.useMemo)(()=>{let e=new Map;for(let t of n??[])e.has(t.date)&&("holiday"!==t.kind||e.get(t.date)?.kind==="holiday")||e.set(t.date,t);return e},[n]);return(0,i.jsx)("div",{role:"tablist","aria-label":"Browse by day",className:"flex w-full flex-wrap gap-2 sm:flex-nowrap",children:a.map(r=>{var s;let n=(0,tr.isSameDay)(r,e),a=tu(r),d=o.has(a),c=l.get(a),u=c?.kind==="holiday"?"bg-amber-500":c?.kind==="occasion"?"bg-rose-500":null;return(0,i.jsxs)("button",{role:"tab","aria-selected":n,type:"button",onClick:()=>t(r),title:c?.label,className:(0,eh.cn)("relative flex h-[88px] flex-1 flex-col items-center justify-center gap-1 overflow-hidden rounded-xl border px-3 pt-3 pb-2 transition-all min-w-[64px]",n?"border-lime bg-lime text-lime-text shadow-sm":"border-divider bg-card text-foreground hover:-translate-y-px hover:border-foreground
1/60"),children:[u&&(0,i.jsx)("span",{"aria-hidden":!0,className:(0,eh.cn)("absolute inset-x-0 top-0 h-[3px]",u)}),(0,i.jsx)("span",{className:(0,eh.cn)("text-[10px] font-semibold tracking-[0.16em] uppercase",n?"text-lime-text/80":"text-muted-foreground"),children:(s=r,(0,ti.isToday)(s)?"Today":(0,td.isTomorrow)(s)?"Tom":(0,ek.format)(s,"EEE"))}),(0,i.jsx)("span",{className:(0,eh.cn)("text-base font-semibold tabular-nums",n?"text-lime-text":"text-foreground"),children:(0,ek.format)(r,"d")}),c&&c.showLabel?(0,i.jsx)("span",{className:(0,eh.cn)("line-clamp-1 max-w-full px-1 text-[9px] font-medium uppercase tracking-wide","holiday"===c.kind?n?"text-lime-text/80":"text-amber-700 dark:text-amber-300":n?"text-lime-text/80":"text-rose-700 dark:text-rose-300"),children:c.label}):(0,i.jsx)("span",{"aria-hidden":!0,className:(0,eh.cn)("size-1 rounded-full transition-opacity",d||c?n?"bg-lime-text/80 opacity-100":c?.kind==="holiday"?"bg-amber-500 opacity-80":c?.kind==="occasion"?"bg-rose-500 opacity-80":"bg-foreground opacity-80":"opacity-0")})]},r.toISOString())})})}function tu(e){let t=e.getFullYear(),r=String(e.getMonth()+1).padStart(2,"0"),i=String(e.getDate()).padStart(2,"0");return`${t}-${r}-${i}`}function tm({occasion:e,forDay:t,citySlug:r}){var s;let n,a,o,l=e.year&&e.slug?`/occasions/${e.slug}/${e.year}/events`:r?`/cities/${r}/this-week`:null,d=Math.max(1,tp(e.startDate,e.endDate)+1),c=Math.max(1,tp(e.startDate,(n=(s=t).getFullYear(),a=String(s.getMonth()+1).padStart(2,"0"),o=String(s.getDate()).padStart(2,"0"),`${n}-${a}-${o}`))+1),u=1===d?th(e.startDate,e.endDate):`Day ${c} of ${d} \xb7 ${th(e.startDate,e.endDate)}`;return(0,i.jsxs)("article",{className:"relative overflow-hidden rounded-2xl border border-rose-500/30 bg-gradient-to-br from-rose-500/12 via-card to-card p-4",children:[(0,i.jsxs)("div",{className:"flex items-start gap-4",children:[(0,i.jsx)("span",{className:"inline-flex size-12 shrink-0 items-center justify-center rounded-2xl bg-rose-500/15 text-rose-700 dark:text-rose-300",children:(0,i.jsx)(p.Sparkles,{className:"size-5",strokeWidth:2})}),(0,i.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,i.jsx)("span",{className:"inline-flex items-center gap-1.5 rounded-full bg-rose-500/15 px-2 py-0.5 text-[10px] font-semibold tracking-[0.14em] text-rose-700 uppercase dark:text-rose-300",children:"Citywide event"}),(0,i.jsx)("h3",{className:"mt-1.5 truncate text-base font-semibold text-foreground md:text-lg",children:e.label}),(0,i.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:u})]}),l&&(0,i.jsxs)(ec.default,{href:l,className:"hidden shrink-0 items-center gap-1.5 self-start rounded-full border border-divider bg-card px-3 py-1.5 text-xs font-medium text-foreground transition-colors hover:border-foreground sm:inline-flex","aria-label":`See all ${e.label} events`,children:["See all",(0,i.jsx)(eN.ArrowRight,{className:"size-3.5"})]})]}),l&&(0,i.jsx)("div",{className:"mt-3 sm:hidden",children:(0,i.jsxs)(ec.default,{href:l,className:"inline-flex items-center gap-1.5 text-xs font-medium text-rose-700 dark:text-rose-300",children:["See all ",e.label," events",(0,i.jsx)(eN.ArrowRight,{className:"size-3.5"})]})})]})}function th(e,t){try{let r=new Date(e),i=new Date(t);if(r.toDateString()===i.toDateString())return(0,ek.format)(r,"EEE, d MMM");if(r.getMonth()===i.getMonth())return`${(0,ek.format)(r,"d")}–${(0,ek.format)(i,"d MMM")}`;return`${(0,ek.format)(r,"d MMM")} – ${(0,ek.format)(i,"d MMM")}`}catch{return""}}function tp(e,t){let r=new Date(`${e}T00:00:00Z`).getTime(),i=new Date(`${t}T00:00:00Z`).getTime();return Number.isFinite(r)&&Number.isFinite(i)?Math.round((i-r)/864e5):0}var tf=e.i(790597),tx=e.i(648150),tg=e.i(878441),ty=e.i(448297),tb=e.i(922809),tv=e.i(371419),tw=e.i(952771),tj=e.i(244632),tk=e.i(829601);function tN({event:e,user:t}){let r,{ref:n}=(0,tx.useEventImpression)(e.id,"discovery"),{isSaved:a,toggleSave:o}=(0,tg.useEventInteraction)({eventId:e.id,initialSaved:e.user_interactions?.saved??!1,onSaveToggle:e=>e?(0,tb.hapticTrigger)("success"):(0,tb.hapticTrigger)("light")}
1),[l,d]=(0,s.useState)(!1),c=(0,s.useRef)(null),u=(0,ty.usePostLoginRefresh)(),m=t?.isAnonymous??!0,h=e.personalization?.score??0,p=function(e){let t=e.personalization?.tags;if(Array.isArray(t)&&t.length>0){let e=t.slice(0,3).map(e=>e.replace(/_/g," ").toLowerCase().replace(/\b\w/g,e=>e.toUpperCase())).join(" · ");return`Matches your ${e}`}let r=e.hosts?.[0];return r?.name?`Hosted by ${r.name}`:null}(e),f=(0,s.useCallback)(t=>{if(t.preventDefault(),t.stopPropagation(),m){c.current="save",(0,tv.setPendingAction)({type:"save",eventId:e.id,eventName:e.name}),d(!0);return}o()},[e.id,e.name,m,o]),x=(0,s.useCallback)(async()=>{await u(),"save"===c.current&&(o(),c.current=null)},[u,o]),g=[(r=e.place,[r?.name,r?.city].filter(Boolean).join(" • ")),(()=>{let t=e.start_date;if(!t)return null;try{return(0,ek.format)(new Date(t),"HH:mm")}catch{return null}})()].filter(Boolean).join(" • ");return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(ec.default,{ref:n,href:`/events/${e.slug}`,onClick:()=>{(0,tj.setEventPreview)(e.slug,e),(0,tw.trackEvent)("event_card_click",{event_id:e.id,event_slug:e.slug,event_name:e.name,surface:"for-you-reasoning"})},className:"group flex items-stretch gap-3 rounded-2xl border border-divider bg-card p-3 transition-all hover:border-foreground
1/60 hover:-translate-y-px",children:[(0,i.jsx)("div",{className:"size-[90px] shrink-0 overflow-hidden rounded-xl ring-1 ring-black/[0.04] dark:ring-white/[0.06]",children:(0,i.jsx)(e3.MainAsset,{alt:e.name??"Event",className:"size-full",event:e,size:"thumbnail",preferSquareForImages:!0})}),(0,i.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col justify-between py-1",children:[h>=40&&(0,i.jsxs)("span",{className:"text-[11px] font-semibold tracking-wide text-lime-700 dark:text-lime-300",children:[Math.round(h),"% match"]}),(0,i.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,i.jsx)("h3",{className:"line-clamp-1 text-sm font-semibold text-foreground md:text-base",children:e.name}),g&&(0,i.jsx)("p",{className:"mt-0.5 line-clamp-1 text-xs text-muted-foreground",children:g})]}),p&&(0,i.jsxs)("p",{className:"line-clamp-1 text-[11px] text-muted-foreground",children:[(0,i.jsx)("span",{className:"mr-1 inline-block size-1 rounded-full bg-lime align-middle"}),p]})]}),(0,i.jsx)("button",{"aria-label":a?"Unsave event":"Save event","aria-pressed":a,type:"button",onClick:f,className:(0,eh.cn)("flex size-9 shrink-0 items-center justify-center rounded-full border transition-all",a?"border-lime bg-lime text-lime-text":"border-divider bg-transparent text-muted-foreground hover:border-foreground hover:text-foreground"),children:(0,i.jsx)(tf.Heart,{className:(0,eh.cn)("size-4",a&&"fill-current"),strokeWidth:2})})]}),(0,i.jsx)(tk.LoginModal,{anonymousUserId:t?.id,open:l,onLoginSuccess:x,onOpenChange:d})]})}function tS({events:e,city:t}){let{data:r}=(0,Z.useUser)(),[a,o]=(0,s.useState)(()=>{let e=new Date;return e.setHours(0,0,0,0),e}
1),[l,d]=(0,s.useState)(!1);(0,s.useEffect)(()=>{d(!1)},[a]);let c=(0,s.useMemo)(()=>{let e=new Date;e.setHours(0,0,0,0);let t=new Date(e);return t.setDate(e.getDate()+7-1),{startISO:tE(e),endISO:tE(t)}},[]),{data:u=[]}=(0,n.useQuery)({queryKey:["for-you-marked-days",t??"",c.startISO,c.endISO],queryFn:()=>to(t??null,c.startISO,c.endISO),enabled:!!t,staleTime:36e5}),{matched:m,unmatched:h,totalForDay:p}=(0,s.useMemo)(()=>{let t=e.filter(e=>{let t=e.start_date??e.date;if(!t)return!1;let r=new Date(t);return Number.isFinite(r.getTime())&&(0,tr.isSameDay)(r,a)}),r=(e,t)=>(t.personalization?.score??0)-(e.personalization?.score??0);return{matched:t.filter(e=>(e.personalization?.score??0)>=60).sort(r),unmatched:t.filter(e=>(e.personalization?.score??0)<60).sort(r),totalForDay:t.length}},[e,a]),f=(0,s.useMemo)(()=>{let e=tE(a);return u.filter(t=>"occasion"===t.kind&&t.date===e)},[u,a]),x=(0,s.useMemo)(()=>{let e=tE(a);return u.find(t=>t.date===e)??null},[u,a]),g=(0,ti.isToday)(a)?"Today":`This ${(0,ek.format)(a,"EEEE")}`,y=t?t.toLowerCase():null;if(0===e.length&&0===f.length)return null;let b=l?[...m,...h].slice(0,24):m.slice(0,6),v=l?Math.max(0,m.length+h.length-b.length):h.length,w=0===m.length?p>0?`0 strong matches \xb7 ${p} other`:"Empty":h.length>0?`${m.length} of ${p} (60%+ match)`:`${m.length} ${1===m.length?"event":"events"}`;return(0,i.jsxs)("section",{children:[(0,i.jsx)("div",{className:"mb-4 flex items-end justify-between gap-4 px-0.5",children:(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsx)("h2",{className:"text-xl font-semibold tracking-tight text-foreground md:text-2xl",children:"Your event calendar"}),(0,i.jsx)("p",{className:"mt-0.5 text-sm text-muted-foreground",children:"Tap a day to see what fits — sorted by how well it matches you."})]})}),(0,i.jsx)(tc,{selectedDay:a,onSelect:o,events:e,markedDays:u}),(0,i.jsx)("div",{className:"mt-6 px-0.5",children:(0,i.jsxs)("h3",{className:"text-base font-semibold tracking-tight text-foreground",children:[g,x&&(0,i.jsxs)("span",{className:"ml-1.5 text-sm font-normal text-muted-foreground",children:["(",x.label,")"]}),(0,i.jsxs)("span",{className:"ml-2 text-sm font-normal text-muted-foreground",children:["· ",w]})]})}),(0,i.jsxs)("div",{className:"mt-3 flex flex-col gap-2",children:[f.map(e=>(0,i.jsx)(tm,{occasion:e,forDay:a,citySlug:y},`${e.slug}-${e.year}-${e.date}`)),b.length>0?(0,i.jsxs)(i.Fragment,{children:[b.map(e=>(0,i.jsx)(tN,{event:e,user:r??null},e.id)),!l&&h.length>0&&(0,i.jsx)("button",{type:"button",onClick:()=>d(!0),className:"group flex items-center justify-between gap-3 rounded-2xl border border-dashed border-divider bg-card/40 px-4 py-3 text-left text-sm transition-colors hover:border-foreground
1/60",children:(0,i.jsxs)("span",{className:"flex items-center gap-3",children:[(0,i.jsx)("span",{className:"inline-flex size-10 shrink-0 items-center justify-center rounded-full bg-muted text-muted-foreground",children:(0,i.jsx)(ta,{className:"size-5",strokeWidth:2})}),(0,i.jsxs)("span",{className:"flex flex-col",children:[(0,i.jsxs)("span",{className:"font-semibold text-foreground",children:["Show ",h.length," more"]}),(0,i.jsx)("span",{className:"text-xs text-muted-foreground",children:"Below your 60% match floor — inline, no navigation"})]})]})}),l&&(0,i.jsxs)("button",{type:"button",onClick:()=>d(!1),className:"inline-flex items-center justify-center gap-1.5 rounded-full border border-divider bg-card px-4 py-2 text-xs font-medium text-muted-foreground transition-colors hover:border-foreground hover:text-foreground self-end",children:[(0,i.jsx)(ts.default,{className:"size-3.5"}),"Hide low-match events",v>0&&` (+${v} clipped)`]})]}):(0,i.jsx)(tM,{totalForDay:p,citySlug:y,day:a,onShowAll:()=>d(!0)})]})]})}function tM({totalForDay:e,citySlug:t,day:r,onShowAll:s}){let n=t?`/cities/${t}/best-clubs`:"/venues";return(0,i.jsxs)("div",{className:"rounded-2xl border border-dashed border-divider bg-card/40 px-4 py-6 text-center",children:[(0,i.jsxs)("p",{className:"text-sm font-semibold text-foreground",children:["Nothing worth going out for you on ",(0,ek.format)(r,"EEEE"),"."]}),(0,i.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:e>0?`There ${1===e?"is":"are"} ${e} other ${1===e?"event":"events"} this day — they just don't clear your 60% match floor.`:`Quiet ${(0,ek.format)(r,"EEEE")}, looks like.`}),(0,i.jsxs)("div",{className:"mt-4 flex flex-wrap items-center justify-center gap-2",children:[(0,i.jsxs)(ec.default,{href:n,className:"inline-flex items-center gap-1.5 rounded-full bg-foreground px-4 py-2 text-xs font-semibold text-background",children:[(0,i.jsx)(tn.Compass,{className:"size-3.5"}),"Explore bars instead"]}),e>0&&(0,i.jsx)("button",{type:"button",onClick:s,className:"inline-flex items-center gap-1.5 rounded-full border border-divider bg-transparent px-4 py-2 text-xs font-medium text-foreground transition-colors hover:border-foreground",children:"See the rest anyway"})]})]})}function tE(e){let t=e.getFullYear(),r=String(e.getMonth()+1).padStart(2,"0"),i=String(e.getDate()).padStart(2,"0");return`${t}-${r}-${i}`}e.s([],842959),e.i(842959);var tD=e.i(965566);let tP=(0,s.createContext)(null);var tT=e.i(154505),tC=e.i(907051),tR=e.i(223070),tA=e.i(142098),tI=e.i(260830),tL=e.i(130162),tz=e.i(287022);function tB(e){return[e("x"),e("y")]}var tO=e.i(153689),tF=e.i(27677),tV=e.i(980538),t$=e.i(939011),t_=e.i(100706),tH=e.i(282774),tU=e.i(439676),tG=e.i(265091);function tW(e){return e.max-e.min}function tq(e,t,r,i=.5){e.origin=i,e.originPoint=(0,t_.mixNumber)(t.min,t.max,e.origin),e.scale=tW(r)/tW(t),e.translate=(0,t_.mixNumber)(r.min,r.max,e.origin)-e.originPoint,(e.scale>=.9999&&e.scale<=1.0001||isNaN(e.scale))&&(e.scale=1),(e.translate>=-.01&&e.translate<=.01||isNaN(e.translate))&&(e.translate=0)}function tY(e,t,r,i){tq(e.x,t.x,r.x,i?i.originX:void 0),tq(e.y,t.y,r.y,i?i.originY:void 0)}function tQ(e,t,r,i=0){e.min=(i?(0,t_.mixNumber)(r.min,r.max,i):r.min)+t.min,e.max=e.min+tW(t)}function tX(e,t,r,i=0){let s=i?(0,t_.mixNumber)(r.min,r.max,i):r.min;e.min=t.min-s,e.max=e.min+tW(t)}function tK(e,t,r,i){tX(e.x,t.x,r.x,i?.x),tX(e.y,t.y,r.y,i?.y)}var tZ=e.i(889026),tJ=e.i(749652);let t0=new WeakMap,t1=(e,t,r)=>(i,s)=>s&&s[0]?s[0][e+"Size"]:(0,tZ.isSVGElement)(i)&&"getBBox"in i?i.getBBox()[t]:i[r],t2=t1("inline","width","offsetWidth"),t5=t1("block","height","offsetHeight");function t6({target:e,borderBoxSize:t}){t0.get(e)?.forEach(r=>{r(e,{get width(){return t2(e,t)},get height(){return t5(e,t)}})})}function t3(e){e.forEach(t6)}let t4=new Set;function t8(e,i){let s;return"function"==typeof e?(t4.add(e),r||(r=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};t4.forEach(t=>t(e))},window.addEventListener("resize",r)),()=>{t4.delete(e),t4.size||"function"!=typeof r||(window.removeEventListener("resize",r),r=void 0)}):(!t&&"u">typeof ResizeObserver&&(t=new ResizeObserver(t3)),(s=(0,tJ.resolveElements)(e)).forEac
1h(e=>{let r=t0.get(e);r||(r=new Set,t0.set(e,r)),r.add(i),t?.observe(e)}),()=>{s.forEach(e=>{let r=t0.get(e);r?.delete(i),r?.size||t?.unobserve(e)})})}var t7=e.i(919880),t9=e.i(665536);function re(e,t,r,i){return(0,tH.addDomEvent)(e,t,(0,t9.addPointerInfo)(r),i)}let rt=({current:e})=>e?e.ownerDocument.defaultView:null;var rr=e.i(325522),ri=e.i(341327),rs=e.i(738638),rn=e.i(763074);let ra=(e,t)=>Math.abs(e-t),ro=new Set(["auto","scroll"]);class rl{constructor(e,t,{transformPagePoint:r,contextWindow:i=window,dragSnapToOrigin:s=!1,distanceThreshold:n=3,element:a}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{var e,t;if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=rd(this.lastRawMoveEventInfo,this.transformPagePoint));let r=ru(this.lastMoveEventInfo,this.history),i=null!==this.startEvent,s=(e=r.offset,t={x:0,y:0},Math.sqrt(ra(e.x,t.x)**2+ra(e.y,t.y)**2)>=this.distanceThreshold);if(!i&&!s)return;let{point:n}=r,{timestamp:a}=tz.frameData;this.history.push({...n,timestamp:a});let{onStart:o,onMove:l}=this.handlers;
1i||(o&&o(this.lastMoveEvent,r),this.startEvent=this.lastMoveEvent),l&&l(this.lastMoveEvent,r)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=rd(t,this.transformPagePoint),tz.frame.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();let{onEnd:r,onSessionEnd:i,resumeAnimation:s}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&s&&s(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let n=ru("pointercancel"===e.type?this.lastMoveEventInfo:rd(t,this.transformPagePoint),this.history);this.startEvent&&r&&r(e,n),i&&i(e,n)},!(0,ri.isPrimaryPointer)(e))return;this.dragSnapToOrigin=s,this.handlers=t,this.transformPagePoint=r,this.distanceThreshold=n,this.contextWindow=i||window;const o=rd((0,t9.extractEventInfo)(e),this.transformPagePoint),{point:l}=o,{timestamp:d}=tz.frameData;this.history=[{...l,timestamp:d}];const{onSessionStart:c}=t;c&&c(e,ru(o,this.history)),this.removeListeners=(0,rs.pipe)(re(this.contextWindow,"pointermove",this.handlePointerMove),re(this.contextWindow,"pointerup",this.handlePointerUp),re(this.contextWindow,"pointercancel",this.handlePointerUp)),a&&this.startScrollTracking(a)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(ro.has(e.overflowX)||ro.has(e.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let r=e===window,i=r?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},s={x:i.x-t.x,y:i.y-t.y};(0!==s.x||0!==s.y)&&(r?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=s.x,this.lastMoveEventInfo.point.y+=s.y):this.history.length>0&&(this.history[0].x-=s.x,this.history[0].y-=s.y),this.scrollPositions.set(e,i),tz.frame.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),(0,tz.cancelFrame)(this.updatePoint)}}function rd(e,t){return t?{point:t(e.point)}:e}function rc(e,t){return{x:e.x-t.x,y:e.y-t.y}}function ru({point:e},t){return{point:e,delta:rc(e,rm(t)),offset:rc(e,t[0]),velocity:function(e){if(e.length<2)return{x:0,y:0};let t=e.length-1,r=null,i=rm(e);for(;t>=0&&(r=e[t],!(i.timestamp-r.timestamp>(0,rn.secondsToMilliseconds)(.1)));)t--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>2*(0,rn.secondsToMilliseconds)(.1)&&(r=e[1]);let s=(0,rn.millisecondsToSeconds)(i.timestamp-r.timestamp);if(0===s)return{x:0,y:0};let n={x:(i.x-r.x)/s,y:(i.y-r.y)/s};return n.x===1/0&&(n.x=0),n.y===1/0&&(n.y=0),n}(t)}}function rm(e){return e[e.length-1]}var rh=e.i(783920),rp=e.i(476959);function rf(e,t,r){return{min:void 0!==t?e.min+t:void 0,max:void 0!==r?e.max+r-(e.max-e.min):void 0}}function rx(e,t){let r=t.min-e.min,i=t.max-e.max;return t.max-t.min<e.max-e.min&&([r,i]=[i,r]),{min:r,max:i}}function rg(e,t,r){return{min:ry(e,t),max:ry(e,r)}}function ry(e,t){return"number"==typeof e?e:e[t]||0}let rb=new WeakMap;class rv{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=(0,tL.createBox)(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:r}={}){let{presenceContext:i}=this.visualElement;if(i&&!1===i.isPresent)return;let s=e=>{t&&this.snapToCursor((0,t9.extractEventInfo)(e).point),this.stopAnimation()},n=(e,t)=>{let{drag:r,dragPropagation:i,onDragStart:s}=this.getProps();if(r&&!i&&(this.openDragLock&&this.openDragLock(),this.openDragLock=function(e){if("x"===e||"y"===e)if(tU.isDragging[e])return null;else return tU.isDragging[e]=!0,()=>{tU.isDragging[e]=!1};return tU.isDragging.x||tU.isDragging.y?null:(tU.isDragging.x=tU.isDragging.y=!0,()=>{tU.isDragging.x=tU.isDragging.y=!1})}(r),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),tB(e=>{let t=this.getAxisMotionValue(e).get()||0;if(tG.percent.test(t)){let{projection:r}=this.visualElement;if(r&&r.layout){let i=r.layout.layoutBox[e];i&&(t=tW(i)*(parseFloat(t)/100))}}this.originPoint[e]=t}),s&&tz.frame.update(()=>s(e,t),!1,!0),(0,tV.addValueToWillChange)(this.visualElement,"transform");let{animationState:n}=this.visualElement;n&&n.setActive("whileDrag",!0)},a=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:r,dragDirectionLock:i,onDirectionLock:s,onDrag:n}=this.getProps();if(!r&&!this.openDragLock)return;let{offset:a}=t;if(i&&null===this.currentDirection){this.currentDirection=function(e,t=10){let r=null;return Math.abs(e.y)>t?r="y":Math.abs(e.x)>t&&(r="x"),r}(a),null!==this.currentDirection&&s&&s(this.currentDirection);return}this.updateAxis("x",t.point,a),this.updateAxis("y",t.point,a),this.visualElement.render(),n&&tz.frame.update(()=>n(e,t),!1,!0)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},l=()=>{let{dragSnapToOrigin:e}=this.getProps();(e||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:d}=this.getProps();this.panSession=new rl(e,{onSessionStart:s,onStart:n,onMove:a,onSessionEnd:o,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:d,distanceThreshold:r,contextWindow:rt(this.visualElement),element:this.visualElement.current})}stop(e,t){let r=e||this.latestPointerEvent,i=t||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!i||!r)return;let{velocity:n}=i;this.startAnimation(n);let{onDragEnd:a}=this.getProps();a&&tz.frame.postRender(()=>a(r,i))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,t,r){let{drag:i}=this.getProps();if(!r||!rj(e,i,this.currentDirection))return;let s=this.getAxisMotionValue(e),n=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(n=function(e,{min:t,max:r},i){return void 0!==t&&e<t?e=i?(0,t_.mixNumber)(t,e,i.min):Math.max(e,t):void 0!==r&&e>r&&(e=i?(0,t_.mixNumber)(r,e,i.max):Math.min(e,r)),e}(n,this.constraints[e],this.elastic[e])),s.set(n)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,i=this.constraints;e&&(0,rr.isRefObject)(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&r?this.constraints=function(e,{top:t,left:r,bottom:i,right:s}){return{x:rf(e.x,r,s),y:rf(e.y,t,i)}}(r.layoutBox,e):this.constraints=!1,this.elastic=function(e=.35){return!1===e?e=0:!0===e&&(e=.35),{x:rg(e,"left","right"),y:rg(e,"top","bottom")}}(t),i!==this.constraints&&!(0,rr.isRefObject)(e)&&r&&this.constraints&&!this.hasMutatedConstraints&&tB(e=>{var t,i;let s;!1!==this.constraints&&this.getAxisMotionValue(e)&&(this.constraints[e]=(t=r.layoutBox[e],i=this.constraints[e],s={},void 0!==i.min&&(s.min=i.min-t.min),void 0!==i.max&&(s.max=i.max-t.min),s))})}resolveRefConstraints(){var e;let{dragConstraints:t,onMeasureDragConstraints:r}=this.getProps();if(!t||!(0,rr.isRefObject)(t))return!1;let i=t.current;(0,tD.invariant)(null!==i,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");let{projection:s}=this.visualElement;if(!s||!s.layout)return!1;let n=(0,tO.measurePageBox)(i,s.root,this.visualElement.getTransformPagePoint()),a=(e=s.layout.layoutBox,{x:rx(e.x,n.x),y:rx(e.y,n.y)});if(r){let e=r((0,tF.convertBoxToBoundingBox)(a));this.hasMutatedConstraints=!!e,e&&(a=(0,tF.convertBoundingBoxToBox)(e))}return a}startAnimation(e){let{drag:t,dragMomentum:r,dragElastic:i,dragTransition:s,dragSnapToOrigin:n,onDragTransitionEnd:a}=this.getProps(),o=this.constraints||{};return Promise.all(tB(a=>
1{if(!rj(a,t,this.currentDirection))return;let l=o&&o[a]||{};(!0===n||n===a)&&(l={min:0,max:0});let d={type:"inertia",velocity:r?e[a]:0,bounceStiffness:i?200:1e6,bounceDamping:i?40:1e7,timeConstant:750,restDelta:1,restSpeed:10,...s,...l};return this.startAxisValueAnimation(a,d)})).then(a)}startAxisValueAnimation(e,t){let r=this.getAxisMotionValue(e);return(0,tV.addValueToWillChange)(this.visualElement,e),r.start((0,t$.animateMotionValue)(e,r,0,t,this.visualElement,!1))}stopAnimation(){tB(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`,r=this.visualElement.getProps();return r[t]||this.visualElement.getValue(e,(r.initial?r.initial[e]:void 0)||0)}snapToCursor(e){tB(t=>{let{drag:r}=this.getProps();if(!rj(t,r,this.currentDirection))return;let{projection:i}=this.visualElement,s=this.getAxisMotionValue(t);if(i&&i.layout){let{min:r,max:n}=i.layout.layoutBox[t],a=s.get()||0;s.set(e[t]-(0,t_.mixNumber)(r,n,.5)+a)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:r}=this.visualElement;if(!(0,rr.isRefObject)(t)||!r||!this.constraints)return;this.stopAnimation();let i={x:0,y:0};tB(e=>{let t=this.getAxisMotionValue(e);if(t&&!1!==this.constraints){var r,s;let n,a,o,l=t.get();i[e]=(r={min:l,max:l},s=this.constraints[e],n=.5,a=tW(r),(o=tW(s))>a?n=(0,rh.progress)(s.min,s.max-a,r.min):a>o&&(n=(0,rh.progress)(r.min,r.max-o,s.min)),(0,rp.clamp)(0,1,n))}});let{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.constraints=!1,this.resolveConstraints(),tB(t=>{if(!rj(t,e,null))return;let r=this.getAxisMotionValue(t),{min:s,max:n}=this.constraints[t];r.set((0,t_.mixNumber)(s,n,i[t]))}),this.visualElement.render()}addListeners(){let e;if(!this.visualElement.current)return;rb.set(this.visualElement,this);let t=this.visualElement.current,r=re(t,"pointerdown",e=>{let{drag:r,dragListener:i=!0}=this.getProps(),s=e.target,n=s!==t&&(0,t7.isElementTextInput)(s);r&&i&&!n&&this.start(e)}),i=()=>{var r,i,s;let n,a,{dragConstraints:o}=this.getProps();(0,rr.isRefObject)(o)&&o.current&&(this.constraints=this.resolveRefConstraints(),e||(r=t,i=o.current,n=t8(r,rw(s=()=>this.scalePositionWithinConstraints())),a=t8(i,rw(s)),e=()=>{n(),a()}))},{projection:s}=this.visualElement,n=s.addEventListener("measure",i);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),tz.frame.read(i);let a=(0,tH.addDomEvent)(window,"resize",()=>this.scalePositionWithinConstraints()),o=s.addEventListener("didUpdate",({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(tB(t=>{let r=this.getAxisMotionValue(t);r&&(this.originPoint[t]+=e[t].translate,r.set(r.get()+e[t].translate))}),this.visualElement.render())});return()=>{a(),r(),n(),o&&o(),e&&e()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:n=.35,dragMomentum:a=!0}=e;return{...e,drag:t,dragDirectionLock:r,dragPropagation:i,dragConstraints:s,dragElastic:n,dragMomentum:a}}}function rw(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function rj(e,t,r){return(!0===t||t===e)&&(null===r||r===e)}class rk extends tA.Feature{constructor(e){super(e),this.removeGroupControls=tI.noop,this.removeListeners=tI.noop,this.controls=new rv(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||tI.noop}update(){let{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}var rN=tA;let rS=e=>(t,r)=>{e&&tz.frame.update(()=>e(t,r),!1,!0)};class rM extends rN.Feature{constructor(){super(...arguments),this.removePointerDownListener=tI.noop}onPointerDown(e){this.session=new rl(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:rt(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:rS(e),onStart:rS(t),onMove:rS(r),onEnd:(e,t)=>{delete this.session,i&&tz.frame.postRender(()=>i(e,t))}}}mount(){this.removePointerDownListener=re(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let rE={hasAnimatedSinceResize:!0,hasEverUpdated:!1};var rD=e.i(560140),rP=s,rT=e.i(464978),rC=e.i(231178),rR=e.i(104035);let rA=!1;class rI extends rP.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:r,layoutId:i}=this.props,{projection:s}=e;s&&(t.group&&t.group.add(s),r&&r.register&&i&&r.register(s),rA&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),rE.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:r,drag:i,isPresent:s}=this.props,{projection:n}=r;return n&&(n.isPresent=s,e.layoutDependency!==t&&n.setOptions({...n.options,layoutDependency:t}),rA=!0,i||e.layoutDependency!==t||void 0===t||e.isPresent!==s?n.willUpdate():this.safeToRemove(),e.isPresent!==s&&(s?n.promote():n.relegate()||tz.frame.postRender(()=>{let e=n.getStack();e&&e.members.length||this.safeToRemove()}))),null}componentDidUpdate(){let{visualElement:e,layoutAnchor:t}=this.props,{projection:r}=e;r&&(r.options.layoutAnchor=t,r.root.didUpdate(),rD.microtask.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:r}=this.props,{projection:i}=e;rA=!0,i&&(i.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}}function rL(e){let[t,r]=(0,rT.usePresence)(),s=(0,rP.useContext)(rC.LayoutGroupContext);return(0,i.jsx)(rI,{...e,layoutGroup:s,switchLayoutGroup:(0,rP.useContext)(rR.SwitchLayoutGroupContext),isPresent:t,safeToRemove:r})}var rz=e.i(570596),rB=e.i(768705),rO=e.i(716896),rF=e.i(987333),rV=e.i(496173),r$=e.i(924463),r_=e.i(504169),rH=e.i(880248),rU=e.i(83633
11),rG=e.i(486427),rW=e.i(733871),rq=e.i(791559);let rY=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],rQ=rY.length,rX=e=>"string"==typeof e?parseFloat(e):e,rK=e=>"number"==typeof e||tG.px.test(e);function rZ(e,t){return void 0!==e[t]?e[t]:e.borderRadius}let rJ=r1(0,.5,rq.circOut),r0=r1(.5,.95,tI.noop);function r1(e,t,r){return i=>i<e?0:i>t?1:r((0,rh.progress)(e,t,i))}function r2(e,t){e.min=t.min,e.max=t.max}function r5(e,t){r2(e.x,t.x),r2(e.y,t.y)}function r6(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var r3=e.i(135636);function r4(e,t,r,i,s){return e-=t,e=(0,r3.scalePoint)(e,1/r,i),void 0!==s&&(e=(0,r3.scalePoint)(e,1/s,i)),e}function r8(e,t,[r,i,s],n,a){!function(e,t=0,r=1,i=.5,s,n=e,a=e){if(tG.percent.test(t)&&(t=parseFloat(t),t=(0,t_.mixNumber)(a.min,a.max,t/100)-a.min),"number"!=typeof t)return;let o=(0,t_.mixNumber)(n.min,n.max,i);e===n&&(o-=t),e.min=r4(e.min,t,r,o,s),e.max=r4(e.max,t,r,o,s)}(e,t[r],t[i],t[s],t.scale,n,a)}let r7=["x","scaleX","originX"],r9=["y","scaleY","originY"];function ie(e,t,r,i){r8(e.x,t,r7,r?r.x:void 0,i?i.x:void 0),r8(e.y,t,r9,r?r.y:void 0,i?i.y:void 0)}function it(e){return 0===e.translate&&1===e.scale}function ir(e){return it(e.x)&&it(e.y)}function ii(e,t){return e.min===t.min&&e.max===t.max}function is(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function ia(e,t){return is(e.x,t.x)&&is(e.y,t.y)}function io(e){return tW(e.x)/tW(e.y)}function il(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}var id=e.i(133887);class ic{constructor(){this.members=[]}add(e){(0,id.addUniqueItem)(this.members,e);for(let t=this.members.length-1;t>=0;t--){let r=this.members[t];if(r===e||r===this.lead||r===this.prevLead)continue;let i=r.instance;i&&!1!==i.isConnected||r.snapshot||((0,id.removeItem)(this.members,r),r.unmount())}e.scheduleRender()}remove(e){if((0,id.removeItem)(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){let e=this.members[t];if(!1!==e.isPresent&&e.instance?.isConnected!==!1)return this.promote(e),!0}return!1}promote(e,t){let r=this.lead;if(e!==r&&(this.prevLead=r,this.lead=e,e.show(),r)){r.updateSnapshot(),e.scheduleRender();let{layoutDependency:i}=r.options,{layoutDependency:s}=e.options;(void 0===i||i!==s)&&(e.resumeFrom=r,t&&(r.preserveOpacity=!0),r.snapshot&&(e.snapshot=r.snapshot,e.snapshot.latestValues=r.animationValues||r.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),!1===e.options.crossfade&&r.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}}let iu=(e,t)=>e.depth-t.depth;class im{constructor(){this.children=[],this.isDirty=!1}add(e){(0,id.addUniqueItem)(this.children,e),this.isDirty=!0}remove(e){(0,id.removeItem)(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(iu),this.isDirty=!1,this.children.forEach(e)}}var ih=e.i(177777);let ip={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},ix=["","X","Y","Z"],ig=0;function iy(e,t,r,i){let{latestValues:s}=t;s[e]&&(r[e]=s[e],t.setStaticValue(e,0),i&&(i[e]=0))}function ib({attachResizeListener:e,defaultParent:t,measureScroll:r,checkIsScrollRoot:i,resetTransform:s}){return class{constructor(e={},r=t?.()){this.id=ig++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,rH.statsBuffer.value&&(ip.nodes=ip.calculatedTargetDeltas=ip.calculatedProjections=0),this.nodes.forEac
1h(ij),this.nodes.forEach(iC),this.nodes.forEach(iR),this.nodes.forEach(ik),rH.statsBuffer.addProjectionMetrics&&rH.statsBuffer.addProjectionMetrics(ip)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=r?r.root||r:this,this.path=r?[...r.path,r]:[],this.parent=r,this.depth=r?r.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new im)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new rz.SubscriptionManager),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){let r=this.eventHandlers.get(e);r&&r.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=(0,tZ.isSVGElement)(t)&&!(0,rU.isSVGSVGElement)(t),this.instance=t;let{layoutId:r,layout:i,visualElement:s}=this.options;if(s&&!s.current&&s.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(i||r)&&(this.isLayoutDirty=!0),e){let r,i=0,s=()=>this.root.updateBlockedByResize=!1;tz.frame.read(()=>{i=window.innerWidth}),e(t,()=>{let e=window.innerWidth;if(e!==i){let t,n;i=e,this.root.updateBlockedByResize=!0,r&&r(),t=rV.time.now(),n=({timestamp:e})=>{let r=e-t;r>=250&&((0,tz.cancelFrame)(n),s(r-250))},tz.frame.setup(n,!0),r=()=>(0,tz.cancelFrame)(n),rE.hasAnimatedSinceResize&&(rE.hasAnimatedSinceResize=!1,this.nodes.forEach(iT))}})}r&&this.root.registerSharedNode(r,this),!1!==this.options.animate&&s&&(r||i)&&this.addEventListener("didUpdate",({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:r,layout:i})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let n=this.options.transition||s.getDefaultTransition()||iO,{onLayoutAnimationStart:a,onLayoutAnimationComplete:o}=s.getProps(),l=!this.targetLayout||!ia(this.targetLayout,i),d=!t&&r;if(this.options.layoutRoot||this.resumeFrom||d||t&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...(0,rF.getValueTransition)(n,"layout"),onPlay:a,onComplete:o};(s.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,d)}else t||iT(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=i})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),(0,tz.cancelFrame)(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){!this.isUpdateBlocked()&&(this.isUpdating=!0,this.nodes&&this.nodes.forEach(iA),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&function e(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;let{visualElement:r}=t.options;if(!r)return;let i=(0,rO.getOptimisedAppearId)(r);if(window.MotionHasOptimisedAnimation(i,"transform")){let{layout:e,layoutId:r}=t.options;window.MotionCancelOptimisedAnimation(i,"transform",tz.frame,!(e||r))}let{parent:s}=t;s&&!s.hasCheckedOptimisedAppear&&e(s)}(this),this.root.isUpdating||this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,("string"==typeof t.latestValues.x||"string"==typeof t.latestValues.y)&&(t.isLayoutDirty=!0),t.updateScroll("snapshot"),t.options.layoutRoot&&t.willUpdate(!1)}let{layoutId:t,layout:r}=this.options;if(void 0===t&&!r)return;let i=this.getTransformTemplate();this.prevTransformTemplateValue=i?i(this.latestValues,""):void 0,this.updateSnapshot(),e&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){let e=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),e&&this.nodes.forEac
1h(iM),this.nodes.forEach(iS);return}if(this.animationId<=this.animationCommitId)return void this.nodes.forEach(iE);this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(iD),this.nodes.forEach(iP),this.nodes.forEach(iv),this.nodes.forEach(iw)):this.nodes.forEach(iE),this.clearAllSnapshots();let e=rV.time.now();tz.frameData.delta=(0,rp.clamp)(0,1e3/60,e-tz.frameData.timestamp),tz.frameData.timestamp=e,tz.frameData.isProcessing=!0,tz.frameSteps.update.process(tz.frameData),tz.frameSteps.preRender.process(tz.frameData),tz.frameSteps.render.process(tz.frameData),tz.frameData.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,rD.microtask.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(iN),this.sharedNodes.forEach(iI)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,tz.frame.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){tz.frame.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||tW(this.snapshot.measuredBox.x)||tW(this.snapshot.measuredBox.y)||(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=(0,tL.createBox)()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);let{visualElement:t}=this.options;t&&t.notify("LayoutMeasure",this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e="measure"){let t=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&this.instance){let t=i(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:r(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!s)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!ir(this.projectionDelta),r=this.getTransformTemplate(),i=r?r(this.latestValues,""):void 0,n=i!==this.prevTransformTemplateValue;e&&this.instance&&(t||(0,ih.hasTransform)(this.latestValues)||n)&&(s(this.instance,i),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){var t;let r=this.measurePageBox(),i=this.removeElementScroll(r);return e&&(i=this.removeTransform(i)),i$((t=i).x),i$(t.y),{animationId:this.root.animationId,measuredBox:r,layoutBox:i,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return(0,tL.createBox)();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(iH))){let{scroll:e}=this.root;e&&((0,r3.translateAxis)(t.x,e.offset.x),(0,r3.translateAxis)(t.y,e.offset.y))}return t}removeElementScroll(e){let t=(0,tL.createBox)();if(r5(t,e),this.scroll?.wasRoot)return t;for(let r=0;r<this.path.length;r++){let i=this.path[r],{scroll:s,options:n}=i;i!==this.root&&s&&n.layoutScroll&&(s.wasRoot&&r5(t,e),(0,r3.translateAxis)(t.x,s.offset.x),(0,r3.translateAxis)(t.y,s.offset.y))}return t}applyTransform(e,t=!1,r){let i=r||(0,tL.createBox)();r5(i,e);for(let e=0;e<this.path.length;e++){let r=this.path[e];!t&&r.options.layoutScroll&&r.scroll&&r!==r.root&&((0,r3.translateAxis)(i.x,-r.scroll.offset.x),(0,r3.translateAxis)(i.y,-r.scroll.offset.y)),(0,ih.hasTransform)(r.latestValues)&&(0,r3.transformBox)(i,r.latestValues,r.layout?.layoutBox)}return(0,ih.hasTransform)(this.latestValues)&&(0,r3.transformBox)(i,this.latestValues,this.layout?.layoutBox),i}removeTransform(e){let t=(0,tL.createBox)();r5(t,e);for(let e=0;e<this.path.length;e++){let r,i=this.path[e];(0,ih.hasTransform)(i.latestValues)&&(i.instance&&((0,ih.hasScale)(i.latestValues)&&i.updateSnapshot(),r5(r=(0,tL.createBox)(),i.measurePageBox())),ie(t,i.latestValues,i.snapshot?.layoutBox,r))}return(0,ih.hasTransform)(this.latestValues)&&ie(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:void 0===e.crossfade||e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==tz.frameData.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=t.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=t.
1isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=t.isSharedProjectionDirty);let r=!!this.resumingFrom||this!==t;if(!(e||r&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:i,layoutId:s}=this.options;if(!this.layout||!(i||s))return;this.resolvedRelativeTargetAt=tz.frameData.timestamp;let n=this.getClosestProjectingParent();if(n&&this.linkedParentVersion!==n.layoutVersion&&!n.options.layoutRoot&&this.removeRelativeTarget(),this.targetDelta||this.relativeTarget||(!1!==this.options.layoutAnchor&&n&&n.layout?this.createRelativeTarget(n,this.layout.layoutBox,n.layout.layoutBox):this.removeRelativeTarget()),this.relativeTarget||this.targetDelta){if(this.target||(this.target=(0,tL.createBox)(),this.targetWithTransforms=(0,tL.createBox)()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target){var a,o,l,d;this.forceRelativeParentToResolveTarget(),a=this.target,o=this.relativeTarget,l=this.relativeParent.target,d=this.options.layoutAnchor||void 0,tQ(a.x,o.x,l.x,d?.x),tQ(a.y,o.y,l.y,d?.y)}else this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):r5(this.target,this.layout.layoutBox),(0,r3.applyBoxDelta)(this.target,this.targetDelta)):r5(this.target,this.layout.layoutBox);this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,!1!==this.options.layoutAnchor&&n&&!!n.resumingFrom==!!this.resumingFrom&&!n.options.layoutScroll&&n.target&&1!==this.animationProgress?this.createRelativeTarget(n,this.target,n.target):this.relativeParent=this.relativeTarget=void 0),rH.statsBuffer.value&&ip.calculatedTargetDeltas++}}getClosestProjectingParent(){if(!(!this.parent||(0,ih.hasScale)(this.parent.latestValues)||(0,ih.has2DTranslate)(this.parent.latestValues)))if(this.parent.isProjecting())return this.parent;else return this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,r){this.relativeParent=e,this.linkedParentVersion=e.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=(0,tL.createBox)(),this.relativeTargetOrigin=(0,tL.createBox)(),tK(this.relativeTargetOrigin,t,r,this.options.layoutAnchor||void 0),r5(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,r=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(r=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(r=!1),this.resolvedRelativeTargetAt===tz.frameData.timestamp&&(r=!1),r)return;let{layout:i,layoutId:s}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(i||s))return;r5(this.layoutCorrected,this.layout.layoutBox);let n=this.treeScale.x,a=this.treeScale.y;(0,r3.applyTreeDeltas)(this.layoutCorrected,this.treeScale,this.path,t),e.layout&&!e.target&&(1!==this.treeScale.x||1!==this.treeScale.y)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=(0,tL.createBox)());let{target:o}=e;if(!o){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}this.projectionDelta&&this.prevProjectionDelta?(r6(this.prevProjectionDelta.x,this.projectionDelta.x),r6(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),tY(this.projectionDelta,this.layoutCorrected,o,this.latestValues),this.treeScale.x===n&&this.treeScale.y===a&&il(this.projectionDelta.x,this.prevProjectionDelta.x)&&il(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",o)),rH.statsBuffer.value&&ip.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){if(this.options.visualElement?.scheduleRender(),e){let e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=(0,tL.createDelta)(),this.projectionDelta=(0,tL.createDelta)(),this.projectionDeltaWithTransform=(0,tL.createDelta)()}setAnimationOrigin(e,t=!1){let r,i=this.snapshot,s=i?i.latestValues:{},n={...this.latestValues},a=(0,tL.createDelta)();this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let o=(0,tL.createBox)(),l=(i?i.source:void 0)!==(this.layout?this.layout.source:void 0),d=this.getStack(),c=!d||d.members.length<=1,u=!!(l&&!c&&!0===this.options.crossfade&&!this.path.some(iB));this.animationProgress=0,this.mixTargetDelta=t=>{let i=t/1e3;if(iL(a.x,e.x,i),iL(a.y,e.y,i),this.setTargetDelta(a),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout){var d,m,h,p,f,x;tK(o,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),h=this.relativeTarget,p=this.relativeTargetOrigin,f=o,x=i,iz(h.x,p.x,f.x,x),iz(h.y,p.y,f.y,x),r&&(d=this.relativeTarget,m=r,ii(d.x,m.x)&&ii(d.y,m.y))&&(this.isProjectionDirty=!1),r||(r=(0,tL.createBox)()),r5(r,this.relativeTarget)}l&&(this.animationValues=n,function(e,t,r,i,s,n){s?(e.opacity=(0,t_.mixNumber)(0,r.opacity??1,rJ(i)),e.opacityExit=(0,t_.mixNumber)(t.o
1pacity??1,0,r0(i))):n&&(e.opacity=(0,t_.mixNumber)(t.opacity??1,r.opacity??1,i));for(let s=0;s<rQ;s++){let n=rY[s],a=rZ(t,n),o=rZ(r,n);(void 0!==a||void 0!==o)&&(a||(a=0),o||(o=0),0===a||0===o||rK(a)===rK(o)?(e[n]=Math.max((0,t_.mixNumber)(rX(a),rX(o),i),0),(tG.percent.test(o)||tG.percent.test(a))&&(e[n]+="%")):e[n]=o)}(t.rotate||r.rotate)&&(e.rotate=(0,t_.mixNumber)(t.rotate||0,r.rotate||0,i))}(n,s,this.latestValues,i,u,c)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=i},this.mixTargetDelta(1e3*!!this.options.layoutRoot)}startAnimation(e){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&((0,tz.cancelFrame)(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=tz.frame.update(()=>{rE.hasAnimatedSinceResize=!0,r_.activeAnimations.layout++,this.motionValue||(this.motionValue=(0,rG.motionValue)(0)),this.motionValue.jump(0,!1),this.currentAnimation=(0,rB.animateSingleValue)(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onStop:()=>{r_.activeAnimations.layout--},onComplete:()=>{r_.activeAnimations.layout--,e.onComplete&&e.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,target:r,layout:i,latestValues:s}=e;if(t&&r&&i){if(this!==e&&this.layout&&i&&i_(this.options.animationType,this.layout.layoutBox,i.layoutBox)){r=this.target||(0,tL.createBox)();let t=tW(this.layout.layoutBox.x);r.x.min=e.target.x.min,r.x.max=r.x.min+t;let i=tW(this.layout.layoutBox.y);r.y.min=e.target.y.min,r.y.max=r.y.min+i}r5(t,r),(0,r3.transformBox)(t,s),tY(this.projectionDeltaWithTransform,this.layoutCorrected,t,s)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new ic),this.sharedNodes.get(e).add(t);let r=t.options.initialPromotionConfig;t.promote({transition:r?r.transition:void 0,preserveFollowOpacity:r&&r.shouldPreserveFollowOpacity?r.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return!e||e.lead===this}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:r}={}){let i=this.getStack();i&&i.promote(this,r),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return!!e&&e.relegate(this)}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:r}=e;if((r.z||r.rotate||r.rotateX||r.rotateY||r.rotateZ||r.skewX||r.skewY)&&(t=!0),!t)return;let i={};r.z&&iy("z",e,i,this.animationValues);for(let t=0;t<ix.length;t++)iy(`rotate${ix[t]}`,e,i,this.animationValues),iy(`skew${ix[t]}`,e,i,this.animationValues);for(let t in e.render(),i)e.setStaticValue(t,i[t]),this.animationValues&&(this.animationValues[t]=i[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;if(!this.isVisible){e.visibility="hidden";return}let r=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility="",e.opacity="",e.pointerEvents=(0,rW.resolveMotionValue)(t?.pointerEvents)||"",e.transform=r?r(this.latestValues,""):"none";return}let i=this.getLead();if(!this.projectionDelta||!this.layout||!i.target){this.options.layoutId&&(e.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,e.pointerEvents=(0,rW.resolveMotionValue)(t?.pointerEvents)||""),this.hasProjected&&!(0,ih.hasTransform)(this.latestValues)&&(e.transform=r?r({},""):"none",this.hasProjected=!1);return}e.visibility="";let s=i.animationValues||i.latestValues;this.applyTransformsToTarget();let n=function(e,t,r){let i="",s=e.x.translate/t.x,n=e.y.translate/t.y,a=r?.z||0;if((s||n||a)&&(i=`translate3d(${s}px, ${n}px, ${a}px) `),(1!==t.x||1!==t.y)&&(i+=`scale(${1/t.x}, ${1/t.y}) `),r){let{transformPerspective:e,rotate:t,rotateX:s,rotateY:n,skewX:a,skewY:o}=r;e&&(i=`perspective(${e}px) ${i}`),t&&(i+=`rotate(${t}deg) `),s&&(i+=`rotateX(${s}deg) `),n&&(i+=`rotateY(${n}deg) `),a&&(i+=`skewX(${a}deg) `),o&&(i+=`skewY(${o}deg) `)}let o=e.x.scale*t.x,l=e.y.scale*t.y;return(1!==o||1!==l)&&(i+=`scale(${o}, ${l})`),i||"none"}(this.projectionDeltaWithTransform,this.treeScale,s);r&&(n=r(s,n)),e.transform=n;let{x:a,y:o}=this.projectionDelta;for(let t in e.transformOrigin=`${100*a.origin}% ${100*o.origin}% 0`,i.animationValues?e.opacity=i===this?s.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:s.opacityExit:e.opacity=i===this?void 0!==s.opacity?s.opacity:"":void 0!==s.opacityExit?s.opacityExit:0,r$.scaleCorrectors){if
1(void 0===s[t])continue;let{correct:r,applyTo:a,isCSSVariable:o}=r$.scaleCorrectors[t],l="none"===n?s[t]:r(s[t],i);if(a){let t=a.length;for(let r=0;r<t;r++)e[a[r]]=l}else o?this.options.visualElement.renderState.vars[t]=l:e[t]=l}this.options.layoutId&&(e.pointerEvents=i===this?(0,rW.resolveMotionValue)(t?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(iS),this.root.sharedNodes.clear()}}}function iv(e){e.updateLayout()}function iw(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){let{layoutBox:r,measuredBox:i}=e.layout,{animationType:s}=e.options,n=t.source!==e.layout.source;if("size"===s)tB(e=>{let i=n?t.measuredBox[e]:t.layoutBox[e],s=tW(i);i.min=r[e].min,i.max=i.min+s});else if("x"===s||"y"===s){let e="x"===s?"y":"x";r2(n?t.measuredBox[e]:t.layoutBox[e],r[e])}else i_(s,t.layoutBox,r)&&tB(i=>{let s=n?t.measuredBox[i]:t.layoutBox[i],a=tW(r[i]);s.max=s.min+a,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[i].max=e.relativeTarget[i].min+a)});let a=(0,tL.createDelta)();tY(a,r,t.layoutBox);let o=(0,tL.createDelta)();n?tY(o,e.applyTransform(i,!0),t.measuredBox):tY(o,r,t.layoutBox);let l=!ir(a),d=!1;if(!e.resumeFrom){let i=e.getClosestProjectingParent();if(i&&!i.resumeFrom){let{snapshot:s,layout:n}=i;if(s&&n){let a=e.options.layoutAnchor||void 0,o=(0,tL.createBox)();tK(o,t.layoutBox,s.layoutBox,a);let l=(0,tL.createBox)();tK(l,r,n.layoutBox,a),ia(o,l)||(d=!0),i.options.layoutRoot&&(e.relativeTarget=l,e.relativeTargetOrigin=o,e.relativeParent=i)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:o,layoutDelta:a,hasLayoutChanged:l,hasRelativeLayoutChanged:d})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function ij(e){rH.statsBuffer.value&&ip.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function ik(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function iN(e){e.clearSnapshot()}function iS(e){e.clearMeasurements()}function iM(e){e.isLayoutDirty=!0,e.updateLayout()}function iE(e){e.isLayoutDirty=!1}function iD(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function iP(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function iT(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function iC(e){e.resolveTargetDelta()}function iR(e){e.calcProjection()}function iA(e){e.resetSkewAndRotation()}function iI(e){e.removeLeadSnapshot()}function iL(e,t,r){e.translate=(0,t_.mixNumber)(t.translate,0,r),e.scale=(0,t_.mixNumber)(t.scale,1,r),e.origin=t.origin,e.originPoint=t.originPoint}function iz(e,t,r,i){e.min=(0,t_.mixNumber)(t.min,r.min,i),e.max=(0,t_.mixNumber)(t.max,r.max,i)}function iB(e){return e.animationValues&&void 0!==e.animationValues.opacityExit}let iO={duration:.45,ease:[.4,0,.1,1]},iF=e=>"u">typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),iV=iF("applewebkit/")&&!iF("chrome/")?Math.round:tI.noop;function i$(e){e.min=iV(e.min),e.max=iV(e.max)}function i_(e,t,r){return"position"===e||"preserve-aspect"===e&&!(.2>=Math.abs(io(t)-io(r)))}function iH(e){return e!==e.root&&e.scroll?.wasRoot}let iU=ib({attachResizeListener:(e,t)=>(0,tH.addDomEvent)(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),iG={current:void 0},iW=ib({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!iG.current){let e=new iU({});e.mount(window),e.setOptions({layoutScroll:!0}),iG.current=e}return iG.current},resetTransform:(e,t)=>
1{e.style.transform=void 0!==t?t:"none"},checkIsScrollRoot:e=>"fixed"===window.getComputedStyle(e).position});var iq=e.i(708149);let iY={...tR.animations,...iq.gestureAnimations,pan:{Feature:rM},drag:{Feature:rk,ProjectionNode:iW,MeasureLayout:rL},layout:{ProjectionNode:iW,MeasureLayout:rL}},iQ=(0,tC.createMotionProxy)(iY,tT.createDomVisualElement);var iX=e.i(947414);let iK=(0,s.forwardRef)(function({children:e,as:t="ul",axis:r="y",onReorder:n,values:a,...o},l){let d=(0,iX.useConstant)(()=>iQ[t]),c=[],u=(0,s.useRef)(!1),m=(0,s.useRef)(null);(0,tD.invariant)(!!a,"Reorder.Group must be provided a values prop","reorder-values"),(0,s.useEffect)(()=>{u.current=!1});let h={overflowAnchor:"none",...o.style};return(0,i.jsx)(d,{...o,style:h,ref:e=>{m.current=e,"function"==typeof l?l(e):l&&(l.current=e)},ignoreStrict:!0,children:(0,i.jsx)(tP.Provider,{value:{axis:r,groupRef:m,registerItem:(e,t)=>{let i=c.findIndex(t=>e===t.value);-1!==i?c[i].layout=t[r]:c.push({value:e,layout:t[r]}),c.sort(iZ)},updateOrder:(e,t,r)=>{if(u.current)return;let i=function(e,t,r,i){if(!i)return e;let s=e.findIndex(e=>e.value===t);if(-1===s)return e;let n=i>0?1:-1,a=e[s+n];if(!a)return e;let o=e[s],l=a.layout,d=(0,t_.mixNumber)(l.min,l.max,.5);return 1===n&&o.layout.max+r>d||-1===n&&o.layout.min+r<d?(0,id.moveItem)(e,s,s+n):e}(c,e,t,r);if(c!==i){u.current=!0;let e=[...a];for(let t=0;t<i.length;t++)if(c[t].value!==i[t].value){let r=a.indexOf(c[t].value),s=a.indexOf(i[t].value);-1!==r&&-1!==s&&([e[r],e[s]]=[e[s],e[r]]);break}n(e)}}},children:e})})});function iZ(e,t){return e.layout.min-t.layout.min}var iJ=e.i(83411),i0=e.i(887652),i1=e.i(895420);let i2=new Set(["auto","scroll"]),i5=new WeakMap,i6=new WeakMap,i3=null;function i4(e,t){let r=e?.parentElement;for(;r;){if(function(e,t){let r=getComputedStyle(e),i="x"===t?r.overflowX:r.overflowY,s=e===document.body||e===document.documentElement;return i2.has(i)||s}(r,t))return r;r=r.parentElement}return null}function i8(e,t=0){return(0,iJ.isMotionValue)(e)?e:(0,i0.useMotionValue)(t)}let i7=(0,s.forwardRef)(function({children:e,style:t={},value:r,as:n="li",onDrag:a,onDragEnd:o,layout:l=!0,...d},c){let u=(0,iX.useConstant)(()=>iQ[n]),m=(0,s.useContext)(tP),h={x:i8(t.x),y:i8(t.y)},p=(0,i1.useTransform)([h.x,h.y],([e,t])=>e||t?1:"unset");(0,tD.invariant)(!!m,"Reorder.Item must be a child of Reorder.Group","reorder-item-child");let{axis:f,registerItem:x,updateOrder:g,groupRef:y}=m;return(0,i.jsx)(u,{drag:f,...d,dragSnapToOrigin:!0,style:{...t,x:h.x,y:h.y,zIndex:p},layout:l,onDrag:(e,t)=>{let{velocity:i,point:s}=t;g(r,h[f].get(),i[f]),function(e,t,r,i){if(!e)return;i3=e;let s=i4(e,r);if(!s)return;let{amount:n,edge:a}=function(e,t,r){let i=t.getBoundingClientRect(),s="x"===r?Math.max(0,i.left):Math.max(0,i.top),n="x"===r?Math.min(window.innerWidth,i.right):Math.min(window.innerHeight,i.bottom),a=e-s,o=n-e;if(a<50){let e=1-a/50;return{amount:-25*e*e,edge:"start"}}if(o<50){let e=1-o/50;return{amount:25*e*e,edge:"end"}}return{amount:0,edge:null}}(t-("x"===r?window.scrollX:window.scrollY),s,r);if(null===a){i6.delete(s),i5.delete(s);return}let o=i6.get(s),l=s===document.body||s===document.documentElement;if(o!==a){if(!("start"===a&&i<0||"end"===a&&i>0))return;i6.set(s,a);let e="x"===r?s.scrollWidth-(l?window.innerWidth:s.clientWidth):s.scrollHeight-(l?window.innerHeight:s.clientHeight);i5.set(s,e)}if(n>0){let e=i5.get(s);if(("x"===r?l?window.scrollX:s.scrollLeft:l?window.scrollY:s.scrollTop)>=e)return}"x"===r?l?window.scrollBy({left:n}):s.scrollLeft+=n:l?window.scrollBy({top:n}):s.scrollTop+=n}(y.current,s[f],f,i[f]),a&&a(e,t)},onDragEnd:(e,t)=>{if(i3){let e=i4(i3,"y");e&&(i6.delete(e),i5.delete(e));let t=i4(i3,"x");t&&t!==e&&(i6.delete(t),i5.delete(t)),i3=null}o&&o(e,t)},onLayoutMeasure:e=>{x(r,e)},ref:c,ignoreStrict:!0,children:e})});e.s(["Group",0,iK,"Item",0,i7],540025);var i9=e.i(540025),i9=i9;let se=(0,l.default)("grip-vertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);var st=e.i(852917);function sr({open:e,onOpenChange:t,entries:r,onCommit:n}
1){let[a,o]=(0,s.useState)(()=>r.map(e=>e.id));(0,s.useEffect)(()=>{o(e=>{let t=new Set(r.map(e=>e.id)),i=e.filter(e=>t.has(e)),s=r.map(e=>e.id).filter(e=>!i.includes(e));return[...i,...s]})},[r]);let l=Object.fromEntries(r.map(e=>[e.id,e])),d=e=>{e||n(a),t(e)};return(0,i.jsx)(st.Sheet,{open:e,onOpenChange:d,children:(0,i.jsxs)(st.SheetContent,{side:"right",showCloseButton:!1,className:"flex max-w-md flex-col gap-0 bg-page p-0",children:[(0,i.jsx)(st.SheetHeader,{className:"border-b border-divider p-5",children:(0,i.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsx)(st.SheetTitle,{className:"text-xl font-semibold tracking-tight text-foreground",children:"Reorder sections"}),(0,i.jsx)(st.SheetDescription,{children:"Drag any section to a new position. Your dashboard reorders the moment you close this panel."})]}),(0,i.jsx)("button",{"aria-label":"Close",type:"button",className:"flex size-9 shrink-0 items-center justify-center rounded-full border border-divider bg-card text-muted-foreground transition-colors hover:border-foreground hover:text-foreground",onClick:()=>d(!1),children:(0,i.jsx)(eU.X,{className:"size-4"})})]})}),(0,i.jsx)("div",{className:"flex-1 overflow-y-auto px-5 py-5",children:(0,i.jsx)(i9.Group,{axis:"y",values:a,onReorder:o,className:"flex flex-col gap-2",children:a.map((e,t)=>{let r=l[e];if(!r)return null;let s=(e=>{if(e.icon||e.accent)return e;let t=b(e.id);return t?{...e,icon:t.icon,accent:t.accent}:e})(r),n=s.icon,a=s.accent?w[s.accent]:null;return(0,i.jsxs)(i9.Item,{value:e,className:"flex items-center gap-3 rounded-xl border border-divider bg-card px-3 py-2.5",whileDrag:{scale:1.02,zIndex:10},children:[(0,i.jsx)("span",{className:"flex size-6 cursor-grab items-center justify-center text-muted-foreground active:cursor-grabbing",children:(0,i.jsx)(se,{className:"size-4"})}),n?(0,i.jsx)("span",{className:(0,eh.cn)("inline-flex size-8 shrink-0 items-center justify-center rounded-full",a?.chip??"bg-muted text-muted-foreground"),children:(0,i.jsx)(n,{className:"size-4",strokeWidth:2})}):(0,i.jsx)("span",{className:"inline-flex size-8 shrink-0 items-center justify-center rounded-full bg-muted text-[11px] font-semibold text-muted-foreground",children:t+1}),(0,i.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,i.jsx)("p",{className:"truncate text-sm font-semibold text-foreground",children:r.label}),r.hint&&(0,i.jsx)("p",{className:"truncate text-[11px] text-muted-foreground",children:r.hint})]}),(0,i.jsxs)("span",{className:"shrink-0 text-[11px] font-medium text-muted-foreground tabular-nums",children:["#",t+1]})]},e)})})})]})})}function si({subscriptionIds:e,onUnsubscribe:t,onAddClick:r}){return(0,i.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[e.map(e=>{let r=b(e);if(!r)return null;let s=w[r.accent]??w.lime,n=r.icon;return(0,i.jsxs)("span",{className:(0,eh.cn)("inline-flex items-center gap-1.5 rounded-full border py-1.5 pl-3 pr-1 text-sm font-medium",s.chip),children:[(0,i.jsx)(n,{className:"size-3.5",strokeWidth:2}),r.label,(0,i.jsx)("button",{"aria-label":`Unsubscribe from ${r.label}`,className:"ml-0.5 flex size-5 items-center justify-center rounded-full transition-colors hover:bg-foreground
1/10",type:"button",onClick:()=>t(e),children:(0,i.jsx)(eU.X,{className:"size-3"})})]},e)}),(0,i.jsxs)("button",{type:"button",className:"inline-flex items-center gap-1.5 rounded-full border border-dashed border-divider bg-transparent px-3 py-1.5 text-sm font-medium text-muted-foreground transition-all hover:-translate-y-px hover:border-foreground hover:text-foreground",onClick:r,children:[(0,i.jsx)(el.Plus,{className:"size-3.5"}),0===e.length?"Add topics":"Add more"]})]})}function ss({suggestion:e,onSubscribe:t,onDismiss:r}){let{topic:s,reason:n}=e,a=w[s.accent]??w.lime,o=s.icon;return(0,i.jsxs)("div",{className:(0,eh.cn)("relative flex flex-col gap-3 rounded-2xl border p-5 md:flex-row md:items-center md:gap-4","border-divider bg-card"),children:[(0,i.jsx)("span",{className:(0,eh.cn)("inline-flex size-11 shrink-0 items-center justify-center rounded-full",a.chip),children:(0,i.jsx)(o,{className:"size-5",strokeWidth:2})}),(0,i.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,i.jsxs)("div",{className:"flex items-center gap-1.5 text-[10px] font-semibold tracking-[0.16em] text-muted-foreground uppercase",children:[(0,i.jsx)(p.Sparkles,{className:"size-3"}),"Suggested for you"]}),(0,i.jsx)("p",{className:"mt-1 text-sm font-medium leading-snug text-foreground md:text-base",children:n}),(0,i.jsxs)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:["Add"," ",(0,i.jsx)("span",{className:"font-semibold text-foreground",children:s.label})," ","to your dashboard","curated"===s.kind&&" — editorial picks","."]})]}),(0,i.jsxs)("div",{className:"flex shrink-0 items-center gap-2 md:gap-2.5",children:[(0,i.jsxs)("button",{type:"button",onClick:t,className:"inline-flex items-center gap-1.5 rounded-full bg-foreground px-4 py-2 text-sm font-semibold text-background transition-all hover:-translate-y-px",children:["Add ",s.label]}),(0,i.jsx)("button",{type:"button","aria-label":"Dismiss suggestion",onClick:r,className:"flex size-9 items-center justify-center rounded-full border border-divider bg-transparent text-muted-foreground transition-colors hover:border-foreground hover:text-foreground",children:(0,i.jsx)(eU.X,{className:"size-4"})})]})]})}var sn=e.i(643531),sa=e.i(555436);let so=["nightlife","sports","lifestyle","citywide","culture"];function sl({open:e,onOpenChange:t,subscribedIds:r,onToggle:n}){let[a,o]=(0,s.useState)(""),l=(0,s.useMemo)(()=>new Set(r),[r]),d=(0,s.useMemo)(()=>{let e=a.trim().toLowerCase(),t={nightlife:[],sports:[],lifestyle:[],citywide:[],culture:[]};for(let r of g)(!e||r.label.toLowerCase().includes(e)||r.blurb.toLowerCase().includes(e))&&t[r.megaCategory].push(r);return t},[a]);return(0,i.jsx)(st.Sheet,{open:e,onOpenChange:t,children:(0,i.jsxs)(st.SheetContent,{side:"bottom",showCloseButton:!1,className:"flex max-h-[88vh] flex-col rounded-t-2xl bg-page p-0",children:[(0,i.jsxs)(st.SheetHeader,{className:"border-b border-divider p-5",children:[(0,i.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsx)(st.SheetTitle,{className:"text-xl font-semibold tracking-tight text-foreground",children:"Build your For You"}),(0,i.jsx)(st.SheetDescription,{children:"Subscribe to topics that matter to you. Your dashboard updates instantly."})]}),(0,i.jsx)("button",{"aria-label":"Close",type:"button",className:"flex size-9 shrink-0 items-center justify-center rounded-full border border-divider bg-card text-muted-foreground transition-colors hover:border-foreground hover:text-foreground",onClick:()=>t(!1),children:(0,i.jsx)(eU.X,{className:"size-4"})})]}),(0,i.jsxs)("div",{className:"mt-4 flex items-center gap-2 rounded-full border border-divider bg-card px-3 py-2",children:[(0,i.jsx)(sa.Search,{className:"size-4 text-muted-foreground"}),(0,i.jsx)("input",{type:"text",placeholder:"Search topics (e.g. techno, F1, marathon)",value:a,onChange:e=>o(e.target.value),className:"min-w-0 flex-1 bg-transparent text-sm text-foreground placeholder:text-muted-foreground focus:outline-none"})]})]}),(0,i.jsxs)("div",{className:"flex-1 overflow-y-auto px-5 py-5",children:[so.map(e=>{let t=d[e];if(0===t.length)return null;let r=j[e];return(0,i.jsxs)("section",{className:"mb-7 last:mb-0",children:[(0,i.jsxs)("div",{className:"mb-3 flex items-center gap-2",children:[(0,i.jsx)(r,{className:"size-4 text-muted-foreground",strokeWidth:1.5}),(0,i.jsx)("h3",{className:"text-[11px] font-semibold tracking-[0.16em] text-muted-foreground uppercase",children:v[e]})]}),(0,i.jsx)("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:t.map(e=>{let t=l.has(e.id),r=w[e.accent]??w.lime,s=e.icon;return(0,i.jsxs)("button",{type:"button",onClick:()=>n(e.id),className:(0,eh.cn)("group flex items-start gap-3 rounded-xl border p-4 text-left transition-all hover:-translate-y-
1px",t?"border-foreground bg-foreground/5":"border-divider bg-card hover:border-foreground/60"),children:[(0,i.jsx)("div",{className:(0,eh.cn)("flex size-9 shrink-0 items-center justify-center rounded-full",r.chip),children:(0,i.jsx)(s,{className:"size-4",strokeWidth:2})}),(0,i.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,i.jsxs)("div",{className:"flex items-center gap-2",children:[(0,i.jsx)("h4",{className:"truncate text-sm font-semibold text-foreground",children:e.label}),"curated"===e.kind&&(0,i.jsx)("span",{className:"shrink-0 rounded-full bg-muted px-1.5 py-px text-[9px] font-semibold tracking-wider uppercase text-muted-foreground",children:"Curated"})]}),(0,i.jsx)("p",{className:"mt-0.5 line-clamp-2 text-xs text-muted-foreground",children:e.blurb})]}),(0,i.jsx)("span",{className:(0,eh.cn)("flex size-6 shrink-0 items-center justify-center rounded-full border transition-all",t?"border-foreground bg-foreground text-background":"border-divider bg-transparent text-transparent group-hover:border-foreground/60"),"aria-hidden":!0,children:(0,i.jsx)(sn.Check,{className:"size-3.5",strokeWidth:3})})]},e.id)})})]},e)}),so.every(e=>0===d[e].length)&&(0,i.jsxs)("p",{className:"py-12 text-center text-sm text-muted-foreground",children:["No topics match “",a,"”."]})]})]})})}var sd=e.i(671428),sc=e.i(115057);function su({event:e,matchScore:t}){let r=w[e.accent]??w.lime,s=function(e,t){try{let r=new Date(e);if(!t)return(0,ek.format)(r,"d MMM").toUpperCase();let i=new Date(t);if(r.getMonth()===i.getMonth())return`${(0,ek.format)(r,"d")}–${(0,ek.format)(i,"d MMM")}`.toUpperCase();return`${(0,ek.format)(r,"d MMM")} – ${(0,ek.format)(i,"d MMM")}`.toUpperCase()}catch{return""}}(e.start,e.end),n=(0,i.jsxs)("div",{className:"flex flex-col gap-2.5",children:[(0,i.jsxs)("div",{className:(0,eh.cn)("pm-surface-pressable relative block aspect-[9/16] w-full overflow-hidden rounded-xl ring-1 ring-black/[0.04] dark:ring-white/[0.06]"),style:{backgroundImage:`linear-gradient(155deg, ${r.pin}26, ${r.pin}55 60%, ${r.pin}88)`,backgroundColor:r.pin},children:[(0,i.jsx)("div",{"aria-hidden":!0,className:"absolute inset-0 opacity-60",style:{background:`radial-gradient(circle at 50% 38%, ${r.pin}cc 0%, transparent 60%)`}}),e.tag&&(0,i.jsx)("div",{className:"absolute left-2 top-2 inline-flex items-center gap-1 rounded-full bg-black/35 px-2 py-0.5 text-[10px] font-semibold tracking-wide text-white backdrop-blur-md",children:e.tag}),e.emoji&&(0,i.jsx)("div",{className:"absolute inset-x-0 top-[28%] flex items-center justify-center text-[64px] leading-none drop-shadow-sm","aria-hidden":!0,children:e.emoji}),(0,i.jsx)("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-x-0 bottom-0 h-24 bg-gradient-to-t from-black/65 via-black/15 to-transparent"}),s&&(0,i.jsx)("div",{className:"pointer-events-none absolute bottom-2 left-2 inline-flex items-center gap-1 rounded-full bg-white/85 px-2 py-1 text-[10px] font-semibold tracking-wide text-ink shadow-sm backdrop-blur-md tabular-nums",children:s}),void 0!==t&&t>=60&&(0,i.jsxs)("div",{className:"pointer-events-none absolute right-2 bottom-2 inline-flex items-center gap-1 rounded-full bg-lime/95 px-2 py-1 text-[10px] font-bold tracking-wide text-lime-text shadow-sm backdrop-blur-md tabular-nums",children:[(0,i.jsx)("span",{className:"size-1.5 rounded-full bg-lime-text/80"}),t,"% match"]})]}),(0,i.jsxs)("div",{className:"flex flex-col gap-1.5 px-0.5 md:gap-2",children:[(0,i.jsx)("h3",{className:"line-clamp-2 text-sm leading-[1.2] font-medium text-ink md:text-base",children:e.title}),(0,i.jsxs)("div",{className:"flex items-center gap-1.5 text-xs text-ink-muted",children:[(0,i.jsx)("span",{className:"truncate",children:e.subt
1itle}),(0,i.jsx)("span",{"aria-hidden":!0,className:"size-0.5 rounded-full bg-ink-muted/60"}),(0,i.jsxs)("span",{className:"inline-flex shrink-0 items-center gap-0.5",children:[(0,i.jsx)(eV.MapPin,{className:"size-3",strokeWidth:2}),e.city]})]})]})]});return e.url?(0,i.jsxs)("a",{href:e.url,rel:"noopener noreferrer",target:"_blank",className:"group relative block",children:[n,(0,i.jsx)("span",{"aria-hidden":!0,className:"absolute right-2 top-2 hidden size-7 items-center justify-center rounded-full bg-white/85 text-ink shadow-sm opacity-0 transition-opacity duration-200 group-hover:opacity-100 md:flex",children:(0,i.jsx)(sc.ArrowUpRight,{className:"size-3.5",strokeWidth:2.4})})]}):n}let sm="basis-[44%] sm:basis-[28%] md:basis-[20%] lg:basis-[15%]";function sh({topic:e,seedEvents:t,city:r,emphasized:a=!1,subscribedIds:o=[],userProfile:l=null}){let{data:d}=(0,Z.useUser)(),c=w[e.accent]??w.lime,u=e.icon,m=!t&&"native"===e.kind,{data:h,isLoading:p}=(0,n.useQuery)({queryKey:["for-you-section",e.id,r??"",l?"anchor":"anon"],queryFn:()=>G({topicId:e.id,city:r,userProfile:l}),enabled:m,staleTime:3e5}),f=t??h?.events??[],x=(0,s.useMemo)(()=>"curated"!==e.kind?[]:_(e.curatedId).slice(0,12).map(t=>({event:t,matchScore:function({topic:e,subscribedTopicIds:t,city:r,eventCity:i}){let s=60;for(let r of({"formula-one":["rooftop-pool","festivals"],marathons:["hamburg-citywide","rooftop-pool"],"hamburg-citywide":["nightlife-this-week","live-music"]})[e.id]??[])t.includes(r)&&(s+=8);return r&&i&&i.toLowerCase()===r.toLowerCase()&&(s+=12),"global"!==e.scope||r&&r===i||(s=Math.min(s,78)),Math.max(0,Math.min(100,Math.round(s)))}({topic:e,subscribedTopicIds:o,city:r,eventCity:t.city})})),[e,o,r]),g="curated"===e.kind?x.length>0:f.length>0,y="curated"===e.kind?x.length:f.length;return(0,i.jsxs)("section",{className:"group/section",children:[(0,i.jsxs)("div",{className:"px-0.5",children:[(0,i.jsxs)("div",{className:"flex items-center gap-2",children:[(0,i.jsxs)("span",{className:(0,eh.cn)("inline-flex items-center gap-1.5 rounded-full border px-2 py-0.5 text-[10px] font-semibold tracking-[0.14em] uppercase",c.chip),children:[(0,i.jsx)(u,{className:"size-3",strokeWidth:2}),e.megaCategory]}),"curated"===e.kind&&(0,i.jsx)("span",{className:"rounded-full bg-muted px-2 py-0.5 text-[9px] font-semibold tracking-wider uppercase text-muted-foreground",children:"Curated"})]}),(0,i.jsx)("h2",{className:(0,eh.cn)("mt-1.5 truncate font-semibold tracking-tight text-foreground",a?"text-2xl md:text-3xl":"text-xl md:text-2xl"),children:e.label}),e.blurb&&(0,i.jsxs)("p",{className:"mt-1 line-clamp-1 text-sm text-muted-foreground",children:[e.blurb,y>0&&` \xb7 ${y} events`]})]}),p&&(0,i.jsx)("div",{className:"mt-5 grid grid-cols-2 gap-4 sm:grid-cols-3 md:grid-cols-4",children:Array.from({length:4}).map((e,t)=>(0,i.jsx)(sd.Skeleton,{className:"aspect-[9/16] w-full rounded-xl"},t))}),!p&&g&&(0,i.jsx)("div",{className:"mt-5",children:(0,i.jsx)(ep.HScrollRow,{children:"curated"===e.kind?x.map(({event:e,matchScore:t})=>(0,i.jsx)(ep.HScrollItem,{className:sm,children:(0,i.jsx)(su,{event:e,matchScore:t})},e.id)):f.map(e=>(0,i.jsx)(ep.HScrollItem,{className:sm,children:(0,i.jsx)(eg.MmwEventCard,{event:e,user:d??null,followedHostIds:[],showHeat:!0})},e.id))})}),!p&&!g&&(0,i.jsx)("div",{className:(0,eh.cn)("mt-5 flex flex-col items-center justify-center gap-1 rounded-2xl border border-dashed py-10 text-center text-sm","border-divider/70 text-muted-foreground"),children:"curated"===e.kind?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("span",{className:"font-medium text-foreground",children:[e.label," content arriving soon"]}),(0,i.jsx)("span",{className:"text-xs",children:"Editorial picks for this topic load next."})]}):(0,i.jsx)("span",{children:"No upcoming events yet — we’ll fill this row as it gets closer."})})]})}var sp=e.i(607486);function sf({onOpenPicker:e}){let[t,r]=(0,s.useState)([]);(0,s.useEffect)(()=>{let e=()=>{let e=(0,es.getLocalOnboarding)();r(e?.hosts??[])};e();let t=t=>{t.key===es.ONBOARDING_KEY&&e()};return window.addEventListener("storage",t),()=>window.removeEventListener("storage",t)},[]);let n=t.filter(e=>"Venue"===e.category||"Organizer"===e.category||"Promoter"===e.category).slice(0,24);return 0===n.length?(0,i.jsxs)("section",{children:[(0,i.jsx)(sx,{subtitle:"Quick access to your venues and organizers"}),(0,i.jsx)("div",{className:"mt-4",children:(0,i.jsxs)("button",{type:"button",onClick:e,className:"group inline-flex items-center gap-3 rounded-2xl border border-dashed border-divider bg-card px-4 py-3 text-left transition-all hover:-translate-y-
1px hover:border-foreground/60",children:[(0,i.jsx)("span",{className:"flex size-14 items-center justify-center rounded-2xl border border-divider bg-muted text-muted-foreground",children:(0,i.jsx)(sp.Building2,{className:"size-6",strokeWidth:1.5})}),(0,i.jsxs)("span",{className:"flex flex-col",children:[(0,i.jsx)("span",{className:"text-sm font-semibold text-foreground",children:"Add venues & organizers"}),(0,i.jsx)("span",{className:"text-xs text-muted-foreground",children:"Pick a few — we’ll surface their lineups in your feed."})]}),(0,i.jsx)("span",{className:"ml-3 inline-flex size-8 shrink-0 items-center justify-center rounded-full border border-divider text-muted-foreground transition-colors group-hover:border-foreground group-hover:text-foreground",children:(0,i.jsx)(el.Plus,{className:"size-4"})})]})})]}):(0,i.jsxs)("section",{children:[(0,i.jsx)(sx,{subtitle:`${n.length} places \xb7 jump in`}),(0,i.jsx)("div",{className:"mt-4",children:(0,i.jsxs)(ep.HScrollRow,{gap:"gap-4",snap:!1,children:[n.map(e=>{let t="Venue"===e.category?`/venues/${e.id}`:`/artists/${e.id}`;return(0,i.jsx)(ep.HScrollItem,{className:"w-[88px] flex flex-col items-center text-center",children:(0,i.jsxs)(ec.default,{href:t,className:"group/tile block","aria-label":e.name,children:[(0,i.jsx)(eu.PageAvatar,{src:e.logo_url,name:e.name,shape:"square",size:"lg",className:"size-[72px] rounded-2xl border border-divider bg-muted transition-transform group-hover/tile:-translate-y-px"}),(0,i.jsx)("span",{className:"mt-2 line-clamp-1 block text-xs font-medium text-foreground",children:e.name}),(0,i.jsx)("span",{className:"text-[10px] font-medium text-muted-foreground capitalize",children:e.category?.toLowerCase()??"place"})]})},e.id)}),e&&(0,i.jsx)(ep.HScrollItem,{className:"w-[88px] flex flex-col items-center text-center",children:(0,i.jsxs)("button",{type:"button",onClick:e,className:"group/add block","aria-label":"Add more venues",children:[(0,i.jsx)("span",{className:"flex size-[72px] items-center justify-center rounded-2xl border border-dashed border-divider bg-muted text-muted-foreground transition-colors group-hover/add:border-foreground group-hover/add:text-foreground",children:(0,i.jsx)(el.Plus,{className:"size-6"})}),(0,i.jsx)("span",{className:"mt-2 block text-xs font-medium text-muted-foreground",children:"Add more"})]})})]})})]})}function sx({subtitle:e}){return(0,i.jsxs)("div",{className:"px-0.5",children:[(0,i.jsx)("h2",{className:"text-xl font-semibold tracking-tight text-foreground md:text-2xl",children:"Your venues & organizers"}),(0,i.jsx)("p",{className:"mt-0.5 text-sm text-muted-foreground",children:e})]})}var sg=e.i(370956);let sy=(0,l.default)("map",[["path",{d:"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",key:"169xi5"}],["path",{d:"M15 5.764v15",key:"1pn4in"}],["path",{d:"M9 3.236v15",key:"1uimfh"}]]);function sb({mode:e,onChange:t}){return(0,i.jsxs)("div",{role:"tablist","aria-label":"View mode",className:"inline-flex items-center rounded-full border border-divider bg-card p-1",children:[(0,i.jsxs)("button",{role:"tab","aria-selected":"list"===e,type:"button",onClick:()=>t("list"),className:(0,eh.cn)("inline-flex items-center gap-1.5 rounded-full px-3 py-1.5 text-xs font-medium transition-colors","list"===e?"bg-foreground text-background":"text-muted-foreground hover:text-foreground"),children:[(0,i.jsx)(sg.List,{className:"size-3.5"}),"List"]}),(0,i.jsxs)("button",{role:"tab","aria-selected":"map"===e,type:"button",onClick:()=>t("map"),className:(0,eh.cn)("inline-flex items-center gap-1.5 rounded-full px-3 py-1.5 text-xs font-medium transition-colors","map"===e?"bg-foreground text-background":"text-muted-foreground hover:text-foreground"),children:[(0,i.jsx)(sy,{className:"size-3.5"}),"Map"]})]})}let sv="for-you:dismissed-suggestions:v1";e.s(["ForYouClient",0,function({anchorCity:e,anchorLat:t,anchorLng:r,coolKidsSeed:a}){let o,l,d,c,u,m,{subscriptions:h,effectiveIds:p,unsubscribe:f,subscribe:x,toggle:g}
1=function(){let[e,t]=(0,s.useState)(null);(0,s.useEffect)(()=>{t(E());let e=()=>t(E());return window.addEventListener(N,e),window.addEventListener("storage",e),()=>{window.removeEventListener(N,e),window.removeEventListener("storage",e)}},[]);let r=(0,s.useCallback)(e=>{S.has(e)&&t(t=>{let r=t??E();if(r.includes(e))return r;let i=[...r,e];return D(i),i})},[]),i=(0,s.useCallback)(e=>{t(t=>{let r=t??E();if(!r.includes(e))return r;let i=r.filter(t=>t!==e);return D(i),i})},[]),n=(0,s.useCallback)(e=>{S.has(e)&&t(t=>{let r=t??E(),i=r.includes(e)?r.filter(t=>t!==e):[...r,e];return D(i),i})},[]),a=(0,s.useCallback)(e=>{let r=e.filter(e=>S.has(e));t(r),D(r)},[]),o=(0,s.useCallback)(t=>(e??[]).includes(t),[e]),l=(e?.length??0)>0,d=(0,s.useMemo)(()=>{if(null==e)return y;let t=new Set,r=[];for(let e of y)t.has(e)||(r.push(e),t.add(e));for(let i of e)t.has(i)||(r.push(i),t.add(i));return r},[e]);return{subscriptions:e,subscribe:r,unsubscribe:i,toggle:n,isSubscribed:o,setAll:a,hasAny:l,effectiveIds:d}}(),{order:v,setOrder:w}=function(){let[e,t]=(0,s.useState)(null);return(0,s.useEffect)(()=>{t(Q());let e=()=>t(Q());return window.addEventListener(q,e),window.addEventListener("storage",e),()=>{window.removeEventListener(q,e),window.removeEventListener("storage",e)}},[]),{order:e,setOrder:(0,s.useCallback)(e=>{t(e),X(e)},[]),reset:(0,s.useCallback)(()=>{t([]),X([])},[])}}(),{data:j}=(0,Z.useUser)(),k=j?.isAnonymous??!0,M=(0,K.useAnonymousAnchor)(),R=k?M:null,[I,$]=(0,s.useState)(!1);(0,s.useEffect)(()=>{$(!0)},[]),o=(0,J.usePathname)(),(0,s.useEffect)(()=>{var e;let t,r=(t=document.getElementById("main-content"))?t.querySelector(".overflow-y-auto"):null;if(!r)return;let i=(e=o,`pm.scroll.discovery.${e}`),s=window.requestAnimationFrame(()=>{try{let e=sessionStorage.getItem(i);if(!e)return;let t=Number(e);Number.isFinite(t)&&t>0&&r.scrollTo({top:t,behavior:"instant"})}catch{}}),n=r.scrollTop,a=!1,l=()=>{n=r.scrollTop,a||(a=!0,window.requestAnimationFrame(()=>{a=!1;try{sessionStorage.setItem(i,String(n))}catch{}}))},d=()=>{try{sessionStorage.setItem(i,String(r.scrollTop))}catch{}};return r.addEventListener("scroll",l,{passive:!0}),window.addEventListener("beforeunload",d),window.addEventListener("pagehide",d),()=>{window.cancelAnimationFrame(s),r.removeEventListener("scroll",l),window.removeEventListener("beforeunload",d),window.removeEventListener("pagehide",d);try{sessionStorage.setItem(i,String(r.scrollTop))}catch{}}},[o]);let U=I&&k&&!M,[W,Y]=(0,s.useState)(!1),[ei,el]=(0,s.useState)("list"),[ed,ec]=(0,s.useState)(!1),[eu,em]=(0,s.useState)(()=>new Set);(0,s.useEffect)(()=>{em(function(){try{let e=localStorage.getItem(sv);if(!e)return new Set;let t=JSON.parse(e);return Array.isArray(t)?new Set(t.filter(e=>"string"==typeof e)):new Set}catch{return new Set}}())},[]);let eh=h??[],ep=(0,s.useMemo)(()=>null==h?[]:(function(e){let t=[],r=new Set(e.subscribedIds);for(let i of P){if(t.length>=2)break;if(r.has(i.topicId))continue;let s=b(i.topicId);if(!s)continue;let n=i.match(e);n&&(t.push({topic:s,reason:n,insertAtSectionIndex:i.insertAtSectionIndex}),r.add(i.topicId))}return t})({subscribedIds:p,city:e}).filter(e=>!eu.has(e.topic.id)),[h,p,e,eu]),ex=(0,s.useCallback)(e=>{em(t=>{let r=new Set(t);r.add(e);try{localStorage.setItem(sv,JSON.stringify(Array.from(r)))}catch{}return r})},[]),eg=(0,s.useMemo)(()=>{let e=new Map;for(let t of ep){let r=e.get(t.insertAtSectionIndex)??[];r.push(t),e.set(t.insertAtSectionIndex,r)}return e},[ep]),eb=(0,s.useMemo)(()=>({"nightlife-this-week":a}),[a]),ev=R?"anchor":"anon",{data:ej}=(0,n.useQuery)({queryKey:["for-you-section","nightlife-this-week",e,ev],queryFn:()=>G({topicId:"nightlife-this-week",city:e,userProfile:R}),enabled:!!R,staleTime:3e5}),ek=(0,s.useMemo)(()=>{let e=ej?.events??[];return e.length>0?e:a},[ej,a]),eN=(0,s.useMemo)(()=>(function({events:e,hasAnchor:t}){if(!e||0===e.length)return null;let r=new Date;r.setHours(0,0,0,0);let i=r.getTime(),s=i+36288e5,n=e.filter(e=>{let t=et(e);return Number.isFinite(t)&&t>=i&&t<=s});if(0===n.length)return null;let a=n.slice().sort((e,r)=>{if(t){let t=e.personalization?.score??-1,i=r.personalization?.score??-1;if(t!==i)return i-t}let i=er(e),s=er(r);return i!==s?s-i:et(e)-et(r)})[0];return a||null})({events:ek,hasAnchor:!!R}
1),[ek,R]),eS=(0,s.useMemo)(()=>eN?ek.filter(e=>e.id!==eN.id):ek,[ek,eN]),eM=(0,s.useMemo)(()=>(function(e){if(e){let t=en(e,["top_genre","primary_genre"]);if(t){let e=ea(t);if(e)return{label:`Because you love ${eo(e)}`,filter:{genres:[e]}}}for(let t of function(e,t){for(let r of t){let t=e[r];if(Array.isArray(t))return t.filter(e=>"string"==typeof e)}return[]}(e,["genres","preferred_genres"])){let e=ea(t);if(e)return{label:`Because you love ${eo(e)}`,filter:{genres:[e]}}}let r=en(e,["top_host_name","top_artist"]),i=function(e,t){for(let r of t){let t=e[r];if("number"==typeof t&&Number.isFinite(t))return t}return null}(e,["top_host_id","top_page_id"]);if(r&&i)return{label:`More like ${r}`,filter:{pageIds:[i]}}}let t=(0,es.getLocalOnboarding)();if(t&&t.hosts.length>0){let e=t.hosts[0];return{label:`More like ${e.name}`,filter:{pageIds:[e.id]}}}return null})(R),[R]),eD=(d=(l=p.map(e=>b(e)).filter(e=>!!e)).filter(e=>"native"===e.kind),c=R?"anchor":"anon",m=(u=function({queries:e,...t}){let r=(0,z.useQueryClient)(void 0),i=(0,B.useIsRestoring)(),n=(0,O.useQueryErrorResetBoundary)(),a=s.useMemo(()=>e.map(e=>{let t=r.defaultQueryOptions(e);return t._optimisticResults=i?"isRestoring":"optimistic",t}),[e,r,i]);a.forEach(e=>{(0,V.ensureSuspenseTimers)(e);let t=r.getQueryCache().get(e.queryHash);(0,F.ensurePreventErrorBoundaryRetry)(e,n,t)}),(0,F.useClearResetErrorBoundary)(n);let[o]=s.useState(()=>new L(r,a,t)),[l,d,c]=o.getOptimisticResult(a,t.combine),u=!i&&!1!==t.subscribed;s.useSyncExternalStore(s.useCallback(e=>u?o.subscribe(T.notifyManager.batchCalls(e)):A.noop,[o,u]),()=>o.getCurrentResult(),()=>o.getCurrentResult()),s.useEffect(()=>{o.setQueries(a,t)},[a,t,o]);let m=l.some((e,t)=>(0,V.shouldSuspend)(a[t],e))?l.flatMap((e,t)=>{let i=a[t];if(i&&(0,V.shouldSuspend)(i,e)){let e=new C.QueryObserver(r,i);return(0,V.fetchOptimistic)(i,e,n)}return[]}):[];if(m.length>0)throw Promise.all(m);let h=l.find((e,t)=>{let i=a[t];return i&&(0,F.getHasError)({result:e,errorResetBoundary:n,throwOnError:i.throwOnError,query:r.getQueryCache().get(i.queryHash),suspense:i.suspense})});if(h?.error)throw h.error;return d(c())}({queries:d.map(t=>({queryKey:["for-you-section",t.id,e??"",c],queryFn:()=>G({topicId:t.id,city:e,userProfile:R}),enabled:!eb?.[t.id],staleTime:3e5}))})).map(e=>e.data?.events.length??0).join(","),(0,s.useMemo)(()=>{let e=[];for(let r of(d.forEach((t,r)=>{for(let i of eb?.[t.id]??u[r]?.data?.events??[]){let r=i.place;if(!r||"number"!=typeof r.latitude||"number"!=typeof r.longitude)continue;let s=i.start_date??i.date??"";e.push({id:`native:${i.id}`,title:i.name??t.label,topicId:t.id,topicLabel:t.label,accent:t.accent,lat:r.latitude,lng:r.longitude,city:r.city??t.label,start:s,href:`/events/${i.slug}`})}}),l))if("curated"===r.kind)for(let i of _(r.curatedId)){var t;let s=(t=i.city)?H[t.toLowerCase()]??null:null;s&&e.push({id:`curated:${i.id}`,title:i.title,topicId:r.id,topicLabel:r.label,accent:r.accent,lat:s.lat,lng:s.lng,city:i.city,start:i.start,href:i.url})}return e},[l,eb,m,d])),eP=(0,s.useMemo)(()=>{let e=[],t=new Set(y),r=p.filter(e=>t.has(e)),i=p.filter(e=>!t.has(e));return e.push(...r.map(e=>`topic:${e}`)),e.push("editorial:headliners"),e.push("editorial:reasoning-list"),e.push("editorial:next-occasion"),e.push(...i.map(e=>`topic:${e}`)),e.push("editorial:next-30-days"),eM&&e.push("editorial:because-you-love"),e.push("editorial:short-trip-map"),e.push("editorial:artists-row"),e.push("editorial:venues-row"),e},[p,eM]),eT=(0,s.useMemo)(()=>(function(e,t){if(!t||0===t.length)return e;let r=new Set(e),i=new Set,s=[];for(let e of t)r.has(e)&&!i.has(e)&&(s.push(e),i.add(e));for(let t of e)i.has(t)||(s.push(t),i.add(t));return s})(eP,v),[eP,v]),eR=(0,s.useMemo)(()=>{let e=[];for(let t of eT)if(t.startsWith("topic:")){let r=b(t.slice(6));if(!r)continue;e.push({id:t,label:r.label,accent:r.accent,icon:r.icon,hint:r.blurb})}else"editorial:next-occasion"===t?e.push({id:t,label:"This week's occasion",hint:"Holiday or citywide moment"}):"editorial:headliners"===t?e.push({id:t,label:"Headliners on your radar",hint:"Big acts in your genres"}):"editorial:reasoning-list"===t?e.push({id:t,label:"Your event calendar",hint:"Day-picker and matching list"}):"editorial:next-30-days"===t?e.push({id:t,label:"Your picks in the next 30 days",hint:"Highest-scored picks one month ahead"}):"editorial:short-trip-map"===t?e.push({id:t,label:"Worth flying for",hint:"Short-trip map · next 90 days"}):"editorial:because-you-love"===t&&eM?e.push({id:t,label:eM.label,hint:"Anchored to your taste"}):"editorial:artists-row"===t?e.push({id:t,label:"Your artists",hint:"Quick-access avatars"}):"editorial:venues-row"===t&&e.push({id:t,label:"Your venues & organizers",hint:"Rounded tiles"});return e},[eT,eM]);return(0,i.jsxs)("div",{className:"relative mx-auto w-full max-w-6xl px-4 pt-8 pb-24 md:pt-10",children:[(0,i.jsxs)("div",{className:U?"pointer-events-none select-none blur-[6px]":void 0,"aria-hidden":U,children:[(0,i.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[(0,i.jsx)(e$,{anchorCity:e,totalEvents:a.length}),(0,i.jsx)("div",{className:"mt-2 md:mt-6",children:(0,i.jsx)(sb,{mode:ei,onChange:el})})]}
1),eN&&"list"===ei&&(0,i.jsx)("div",{className:"mt-8",children:(0,i.jsx)(e4,{event:eN,hasAnchor:!!R})}),!R&&!U&&"list"===ei&&(0,i.jsx)("div",{className:"mt-6",children:(0,i.jsx)(te,{})}),(0,i.jsxs)("div",{className:"mt-8 flex flex-wrap items-center gap-2",children:[(0,i.jsx)(si,{subscriptionIds:eh,onUnsubscribe:f,onAddClick:()=>Y(!0)}),(0,i.jsxs)("button",{type:"button",onClick:()=>ec(!0),className:"inline-flex items-center gap-1.5 rounded-full border border-divider bg-card px-3 py-1.5 text-sm font-medium text-muted-foreground transition-all hover:-translate-y-px hover:border-foreground hover:text-foreground","aria-label":"Reorder sections",children:[(0,i.jsx)(ee,{className:"size-3.5"}),"Reorder"]})]}),"map"===ei?(0,i.jsx)("div",{className:"mt-10",children:(0,i.jsx)(eW,{pins:eD,anchorLat:t,anchorLng:r})}):(0,i.jsxs)("div",{className:"mt-10 flex flex-col gap-12",children:[eT.map((s,n)=>{let o=eg.get(n)??[],l=((s,n)=>{if(s.startsWith("topic:")){let t=b(s.slice(6));if(!t)return null;let r=t.isDefault?a:void 0;return(0,i.jsx)(sh,{topic:t,seedEvents:r,city:e,emphasized:0===n,subscribedIds:p,userProfile:R})}return"editorial:next-occasion"===s?(0,i.jsx)(eE,{city:e,userProfile:R}):"editorial:headliners"===s?(0,i.jsx)(ew,{city:e,userProfile:R}):"editorial:reasoning-list"===s?(0,i.jsx)(tS,{events:eS,city:e}):"editorial:next-30-days"===s?(0,i.jsx)(e7,{city:e,userProfile:R}):"editorial:because-you-love"===s&&eM?(0,i.jsx)(ey,{affinity:eM,city:e,userProfile:R}):"editorial:short-trip-map"===s?(0,i.jsx)(eC,{anchorLat:t,anchorLng:r,anchorCity:e,userProfile:R}):"editorial:artists-row"===s?(0,i.jsx)(ef,{onOpenPicker:()=>Y(!0)}):"editorial:venues-row"===s?(0,i.jsx)(sf,{onOpenPicker:()=>Y(!0)}):null})(s,n);return l?(0,i.jsxs)("div",{className:"flex flex-col gap-8",children:[o.map(e=>(0,i.jsx)(ss,{suggestion:e,onSubscribe:()=>x(e.topic.id),onDismiss:()=>ex(e.topic.id)},e.topic.id)),l]},s):null}),Array.from(eg.entries()).filter(([e])=>e>=eT.length).flatMap(([,e])=>e).map(e=>(0,i.jsx)(ss,{suggestion:e,onSubscribe:()=>x(e.topic.id),onDismiss:()=>ex(e.topic.id)},`trailing-${e.topic.id}`)),(0,i.jsx)(e6,{enabled:!k})]}
1),(0,i.jsx)(sr,{open:ed,onOpenChange:ec,entries:eR,onCommit:e=>w(e)}),(0,i.jsx)(sl,{open:W,onOpenChange:Y,subscribedIds:eh,onToggle:g})]}),U&&(0,i.jsx)(eB,{})]})}],755366)}]);

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.