PageSourceSearch

https://con-finder.com/assets/Kalender-CfM_bhlj.js

js con-finder.com collected 2026-10-04 08:02:18 UTC 14,032 bytes, 11 lines download raw bytes

1import{c as re,t as xe,a as H,u as se,b as ge,r as i,B as U,s as $,f as M,d as E,j as t,e as D,g as X,M as ne,I as he,X as F,h as A,C as q,i as fe,H as pe,k as ye,S as be,E as je,F as Ne}from"./index-BdGhoCE_.js";import{C as we}from"./ConventionMap-C9hR4V6j.js";import{g as ve,h as Q}from"./geo-CCR173yC.js";import{a as I}from"./addDays-Bz2eEtDM.js";import{C as De}from"./chevron-left-B9dG90E6.js";import{C as Se}from"./chevron-right-BSIC9pE3.js";/**
2 * @license lucide-react v0.462.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const ke=re("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/**
7 * @license lucide-react v0.462.0 - ISC
8 *
9 * This source code is licensed under the ISC license.
10 * See the LICENSE file in the root directory of this source tree.
11 */const ee=re("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 ae(o,c){const m=xe(o);if(isNaN(c))return H(o,NaN);if(!c)return m;const s=m.getDate(),h=H(o,m.getTime());h.setMonth(m.getMonth()+c+1,0);const a=h.getDate();return s>=a?h:(m.setFullYear(h.getFullYear(),h.getMonth(),s),m)}function oe(o,c){const m=c*7;return I(o,m)}function Ce(o,c){return ae(o,-c)}function Me(o,c){return oe(o,-c)}const Ee=["Anime & Manga","Comic","Cosplay","Gaming","Mittelalter","Festival","LARP / Pen & Paper","Science Fiction","Horror","Fantasy","TradingCards","Japan","TV/Film/Serien","Nerd/Geek","Idol/Kpop","Steampunk","Retro","J-Rave","Party"],te=[25,50,100,200,300,400,500],S="kalender-filters",Fe=()=>{try{const o=sessionStorage.getItem(S);if(o)return JSON.parse(o)}catch{}return null},ze=()=>{const{conventions:o,loading:c}=se(),[m]=ge(),s=i.useMemo(()=>Fe(),[]),h=m.get("view"),[a,le]=i.useState(()=>h||(s==null?void 0:s.viewMode)||"year"),[l,L]=i.useState(()=>h?new Date:s!=null&&s.currentDate?new Date(s.currentDate):new Date),[u,z]=i.useState(()=>(s==null?void 0:s.categories)||[]),[x,k]=i.useState(()=>(s==null?void 0:s.states)||[]);i.useEffect(()=>{var r,n;if(s){((r=s.categories)!=null&&r.length||(n=s.states)!=null&&n.length||s.plz)&&O(!0);return}const e=m.get("state");e&&U.includes(e)&&(k([e]),O(!0))},[]);const[p,P]=i.useState(()=>(s==null?void 0:s.plz)||""),[g,R]=i.useState(()=>(s==null?void 0:s.radius)||100),[d,N]=i.useState(()=>(s==null?void 0:s.plzCoords)||null),[T,K]=i.useState(!1),[B,j]=i.useState(""),[w,O]=i.useState(()=>(s==null?void 0:s.filtersOpen)||!1);i.useEffect(()=>{const e={viewMode:a,currentDate:l.toISOString(),categories:u,states:x,plz:p,radius:g,plzCoords:d,filtersOpen:w};sessionStorage.setItem(S,JSON.stringify(e))},[a,l,u,x,p,g,d,w]);const Z=e=>{z(r=>r.includes(e)?r.filter(n=>n!==e):[...r,e])},G=e=>{k(r=>r.includes(e)?r.filter(n=>n!==e):[...r,e])},V=i.useCallback(async()=>{if(p.length!==5){j("Bitte gib eine gültige 5-stellige PLZ ein."),N(null);return}K(!0),j("");const e=await ve(p);e?(N(e),j("")):(N(null),j("PLZ nicht gefunden.")),K(!1)},[p]),J=()=>{P(""),N(null),j("")},C=new Date().getFullYear(),_=a==="year"?l.getFullYear()>C:a==="month"?l.getFullYear()>C||l.getFullYear()===C&&l.getMonth()>0:$(l,{weekStartsOn:1})>=new Date(C,0,1),ie=()=>{_&&L(e=>a==="year"?new Date(e.getFullYear()-1,e.getMonth(),1):a==="month"?Ce(e,1):Me(e,1))},de=()=>{L(e=>a==="year"?new Date(e.getFullYear()+1,e.getMonth(),1):a==="month"?ae(e,1):oe(e,1))},v=u.length+x.length+(d?1:0),Y=o.flatMap(e=>{const r=[{...e,displayStartDate:e.startDate,displayEndDate:e.endDate}];for(const n of e.extraDates)r.push({...e,displayStartDate:n.startDate,displayEndDate:n.endDate});return r}).filter(e=>{const r=new Date(e.displayStartDate),n=new Date(e.displayEndDate);let y=!1;if(a==="year"){const f=new Date(l.getFullYear(),0,1),b=new Date(l.getFullYear(),11,31);y=r<=b&&n>=f}else if(a==="month"){const f=new Date(l.getFullYear(),l.getMonth(),1),b=new Date(l.getFullYear(),l.getMonth()+1,0);y=r<=b&&n>=f}else{const f=$(l,{weekStartsOn:1}
11),b=I(f,6);y=r<=b&&n>=f}return!(!y||u.length>0&&!e.category.some(b=>u.includes(b))||x.length>0&&!x.includes(e.state)||d&&Q(d.lat,d.lng,e.lat,e.lng)>g)}),ce=a==="year"?`${l.getFullYear()}`:a==="month"?M(l,"MMMM yyyy",{locale:E}):(()=>{const e=$(l,{weekStartsOn:1}),r=I(e,6);return`${M(e,"d. MMM",{locale:E})} – ${M(r,"d. MMM yyyy",{locale:E})}`})(),me=a==="year"?Y.sort((e,r)=>new Date(e.displayStartDate).getTime()-new Date(r.displayStartDate).getTime()).reduce((e,r)=>{const n=new Date(r.displayStartDate).getMonth();return e[n]||(e[n]=[]),e[n].push(r),e},{}):{},ue=[{mode:"year",label:"Jahr"},{mode:"month",label:"Monat"},{mode:"week",label:"Woche"},{mode:"map",label:"Karte",icon:t.jsx(ee,{className:"h-3.5 w-3.5"})}],W=i.useMemo(()=>o.filter(e=>u.length>0&&!e.category.some(n=>u.includes(n))||x.length>0&&!x.includes(e.state)||d&&Q(d.lat,d.lng,e.lat,e.lng)>g?!1:e.lat!==0&&e.lng!==0),[o,u,x,d,g]);return c?t.jsx("div",{className:"flex justify-center py-12",children:t.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"})}):t.jsxs("div",{children:[t.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4 mb-4",children:[a!=="map"?t.jsxs("div",{className:"flex items-center justify-center gap-3 w-full sm:w-auto",children:[t.jsx(D,{variant:"outline",size:"icon",onClick:ie,disabled:!_,className:"border-border hover:border-primary disabled:opacity-40",children:t.jsx(De,{className:"h-4 w-4"})}),t.jsx("h2",{className:"font-display text-lg md:text-2xl tracking-wide text-foreground flex-1 md:min-w-[260px] text-center capitalize",children:ce}),t.jsx(D,{variant:"outline",size:"icon",onClick:de,className:"border-border hover:border-primary",children:t.jsx(Se,{className:"h-4 w-4"})})]}):t.jsxs("div",{className:"flex items-center gap-2 w-full sm:w-auto",children:[t.jsx(ee,{className:"h-5 w-5 text-primary"}),t.jsx("h2",{className:"font-display text-lg md:text-2xl tracking-wide text-foreground",children:"Kartenansicht"}),t.jsxs("span",{className:"text-sm text-muted-foreground ml-2",children:[W.length," Conventions"]})]}),t.jsxs("div",{className:"flex items-center gap-3 w-full sm:w-auto justify-between sm:justify-end flex-wrap",children:[t.jsxs(D,{variant:"outline",size:"sm",onClick:()=>O(e=>!e),className:`gap-2 border-border hover:bg-primary/10 hover:text-primary hover:border-primary ${w?"border-primary bg-primary/10 text-primary":""}`,children:[t.jsx(ke,{className:"h-4 w-4"}),"Filter",v>0&&t.jsx("span",{className:"ml-1 rounded-full bg-primary text-primary-foreground text-xs w-5 h-5 flex items-center justify-center",children:v})]}),v>0&&t.jsx("button",{onClick:()=>{z([]),k([]),P(""),N(null),j(""),sessionStorage.removeItem(S)},className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:"Zurücksetzen"}),t.jsx("div",{className:"flex w-full sm:w-auto rounded-lg border border-border overflow-hidden order-first sm:order-none divide-x divide-border",children:ue.map(e=>t.jsxs("button",{onClick:()=>le(e.mode),className:`flex-1 sm:flex-none px-4 py-2 text-sm font-medium transition-colors flex items-center justify-center gap-1.5 ${a===e.mode?"bg-primary text-primary-foreground":"bg-card text-muted-foreground hover:text-foreground"}`,children:[e.icon&&e.icon,e.label]},e.mode))})]})]}),w&&t.jsxs("div",{className:"rounded-lg border border-border bg-card p-5 mb-6 space-y-5",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-sm font-medium text-foreground mb-2",children:"Kategorie"}),t.jsxs("div",{className:"flex flex-wrap gap-2",children:[Ee.map(e=>{const r=u.includes(e);return t.jsx("button",{onClick:()=>Z(e),className:`px-3 py-1.5 text-sm rounded-md border transition-colors ${r?`${X[e]} border-transparent`:"border-border bg-background text-muted-foreground hover:text-foreground hover:border-primary/50"}`,children:e},e)}),u.length>0&&t.jsx("button",{onClick:()=>{z([]),sessionStorage.removeItem(S)},className:"px-2 py-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors",children:"Alle zurücksetzen"})]})]}),t.jsxs("div",{children:[t.jsx("p",{className:"text-sm font-medium text-foreground mb-2",children:"Bundesland"}),t.jsxs("div",{className:"flex flex-wrap gap-2",children:[U.map(e=>{const r=x.includes(e);return t.jsx("button",{onClick:()=>G(e),className:`px-3 py-1.5 text-sm rounded-md border transition-colors ${r?"bg-primary text-primary-foreground border-transparent":"border-border bg-background text-muted-foreground hover:text-foreground hover:border-primary/50"}`,children:e},e)}),x.length>0&&t.jsx("button",{onClick:()=>{k([]),sessionStorage.removeItem(S)},className:"px-2 py-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors",children:"Alle zurücksetzen"})]})]}),t.jsxs("div",{children:[t.jsx("p",{className:"text-sm font-medium text-foreground mb-2",children:"Entfernung"}),t.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-end gap-3",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(ne,{className:"h-4 w-4 text-primary shrink-0"}),t.jsx(he,{placeholder:"PLZ eingeben",value:p,onChange:e=>P(e.target.value.replace(/\D/g,"").slice(0,5)),className:"w-32",onKeyDown:e=>e.key==="Enter"&&V()}),t.jsx(D,{size:"sm",onClick:V,disabled:T,className:"bg-primary text-primary-foreground hover:bg-primary/90",children:T?"...":"Suchen"}),d&&t.jsx(D,{variant:"ghost",size:"icon",onClick:J,className:"h-8 w-8",children:t.jsx(F,{className:"h-4 w-4"})})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"text-sm text-muted-foreground",children:"Radius:"}),t.jsx("div",{className:"hidden sm:flex rounded-lg border border-border overflow-hidden",children:te.map(e=>t.jsxs("button",{onClick:()=>R(e),className:`px-3 py-1.5 text-xs font-medium transition-colors ${g===e?"bg-primary text-primary-foreground":"bg-background text-muted-foreground hover:text-foreground"}`,children:[e," km"]},e))}),t.jsx("select",{value:g,onChange:e=>R(Number(e.target.value)),className:"sm:hidden rounded-lg border border-border bg-background text-foreground text-sm px-3 py-1.5",children:te.map(e=>t.jsxs("option",{value:e,children:[e," km"]},e))})]})]}),B&&t.jsx("p",{className:"text-sm text-destructive mt-2",children:B}),d&&t.jsxs("p",{className:"text-sm text-muted-foreground mt-2",children:["Zeige Conventions im Umkreis von ",g," km"]})]})]}),v>0&&!w&&t.jsxs("div",{className:"flex flex-wrap items-center gap-2 mb-4",children:[u.map(e=>t.jsxs(A,{className:`${X[e]} cursor-pointer gap-1`,onClick:()=>Z(e),children:[e,t.jsx(F,{className:"h-3 w-3"})]},e)),x.map(e=>t.jsxs(A,{className:"bg-primary/80 text-primary-foreground cursor-pointer gap-1",onClick:()=>G(e),children:[e,t.jsx(F,{className:"h-3 w-3"})]},e)),d&&t.jsxs(A,{className:"bg-muted text-foreground cursor-pointer gap-1",onClick:J,children:["PLZ ",p," · ",g," km",t.jsx(F,{className:"h-3 w-3"})]})]}),a==="map"?t.jsx("div",{className:"rounded-lg border border-border overflow-hidden",style:{height:"70vh"}
11,children:t.jsx(we,{conventions:W})}):Y.length>0?a==="year"?t.jsx("div",{className:"space-y-10",children:Object.entries(me).map(([e,r])=>t.jsxs("div",{children:[t.jsx("h3",{className:"font-display text-xl tracking-wide text-foreground mb-4 capitalize",children:M(new Date(l.getFullYear(),Number(e),1),"MMMM",{locale:E})}),t.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:r.map((n,y)=>t.jsx(q,{convention:n,displayStartDate:n.displayStartDate,displayEndDate:n.displayEndDate,index:y},`${n.id}-${n.displayStartDate}-${y}`))})]},e))}):t.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:Y.sort((e,r)=>new Date(e.displayStartDate).getTime()-new Date(r.displayStartDate).getTime()).map((e,r)=>t.jsx(q,{convention:e,displayStartDate:e.displayStartDate,displayEndDate:e.displayEndDate,index:r},`${e.id}-${e.displayStartDate}-${r}`))}):t.jsxs("div",{className:"flex flex-col items-center justify-center rounded-lg border border-dashed border-border py-16 px-6",children:[t.jsx("p",{className:"font-display text-xl text-muted-foreground",children:"Keine Conventions gefunden"}),t.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:v>0?"Versuche andere Filter oder einen anderen Zeitraum.":"Navigiere zu einem anderen Zeitraum, um Events zu finden."})]})]})},Re=()=>{fe("Convention-Kalender & ConMap Deutschland");const{conventions:o}=se();return t.jsxs("div",{className:"min-h-screen flex flex-col bg-background",children:[t.jsx(pe,{}),t.jsxs("main",{className:"flex-1",children:[t.jsx("section",{className:"relative bg-gradient-to-b from-primary/10 to-background py-8 md:py-16",children:t.jsxs("div",{className:"container mx-auto px-4 text-center max-w-3xl",children:[t.jsxs("h1",{className:"text-3xl md:text-5xl font-bold text-foreground mb-4",children:["Convention-",t.jsx("span",{className:"text-primary",children:"Kalender"})]}),t.jsx("p",{className:"text-lg text-muted-foreground mb-6",children:"Deine Convention Map für Deutschland – alle Comic-Cons, Anime- und Gaming-Events auf einen Blick."}),t.jsxs("div",{className:"flex flex-wrap justify-center gap-4 text-sm text-muted-foreground",children:[t.jsxs("span",{className:"flex items-center gap-1.5",children:[t.jsx(ne,{className:"h-4 w-4 text-primary"}),o.length," Conventions"]}),t.jsxs("span",{className:"flex items-center gap-1.5",children:[t.jsx(ye,{className:"h-4 w-4 text-primary"}),"Laufend aktualisiert"]}),t.jsxs("span",{className:"flex items-center gap-1.5",children:[t.jsx(be,{className:"h-4 w-4 text-primary"}),"Deutschlandweit"]})]})]})}),t.jsx("div",{className:"container mx-auto px-4 py-6",children:t.jsx(ze,{})}),t.jsx("div",{className:"container mx-auto px-4",children:t.jsx(je,{})})]}),t.jsx(Ne,{})]})};export{Re as default};

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.