1import{h as z,w as Q,o as ie,k as i,q as t,K as L,P as B,l as m,I,F as Z,a9 as ee,t as k,n as f,r as y,j as r,H as W,v as _,x as P,D as ae,c as D,a3 as ue,a4 as de,p as te,m as F,B as M,a_ as ve,ap as ce}from"./carousel-17pKdu0m.js";import{b as me,u as pe,a as be,_ as ge,c as fe,d as J,p as ye,e as xe,g as he,f as ke,i as Ee}from"./AdminEventGroupPanel.vue_vue_type_script_setup_true_lang-6jgazTSB.js";import{I as q,d as we}from"./index-4XjfWIcv.js";import{i as ne,_ as Ue,a as Se,l as se,b as Ae}from"./eventDateTime-CJJo8Vdc.js";import{m as Ce}from"./EventInstanceCardList.vue_vue_type_script_setup_true_lang-DBP1t4R3.js";import{E as Ie}from"./EventImageUploader-CpOZVXxr.js";import{e as Te,i as re}from"./bandcampEmbed-CACcggC5.js";import{a as _e}from"./adminPublishErrors-DmSJHjkh.js";import"./Modal.vue_vue_type_script_setup_true_lang-BxSGcOB2.js";import"./adminApi-DISswjOO.js";import"./VenueCreateOverlay.vue_vue_type_script_setup_true_lang-CoIAqhdm.js";import"./Select-DeV2PktU.js";import"./Textarea-CqiCyB-q.js";import"./Chip-DRRGzEuE.js";import"./platformConfig-BtlD4skZ.js";import"./ticketPricePreview-C5qTmxoF.js";import"./useImageUpload-DtLbtEEG.js";import"./useImageEditor-B7p-9wN6.js";const $e={class:"flex flex-col h-full min-h-0"},De={class:"relative mb-3 shrink-0"},Pe={class:"flex flex-row flex-nowrap items-stretch gap-1.5 bg-white border border-gray-200 shadow-sm p-1.5 rounded-2xl shrink-0 overflow-x-auto mb-3",role:"tablist","aria-label":"Events nach Kategorie filtern"},Ne=["aria-selected","onClick"],Le={class:"flex-1 overflow-y-auto -mx-1 px-1 min-h-0"},Ve={key:0,class:"space-y-2"},Be={key:1,class:"text-sm text-red-600 bg-red-50 border border-red-100 rounded-lg p-3"},Oe={key:2,class:"text-center text-gray-400 italic text-sm py-12"},Re={key:3,class:"space-y-2"},ze=["onClick"],Ge={class:"flex items-start justify-between gap-2"},Fe={class:"font-bold text-gray-900 truncate min-w-0"},Me={class:"flex items-center gap-1 shrink-0"},He={key:0,class:"px-2 py-0.5 rounded text-[10px] font-bold bg-violet-100 text-violet-700"},Ye={class:"flex flex-wrap items-center gap-2 mt-1 text-xs text-gray-500"},We={key:0,class:"text-amber-600"},Ke={key:1,class:"text-emerald-600 font-medium"},je={key:2,class:"text-violet-600 font-medium"},qe={class:"truncate min-w-0"},Je={class:"text-[10px] font-mono text-gray-300 mt-0.5 truncate"},Qe={key:0,class:"shrink-0 flex items-center justify-between gap-2 pt-3 mt-2 border-t border-gray-100 text-xs text-gray-500"},Xe={class:"flex items-center gap-1"},Ze=["disabled"],et={class:"px-2 tabular-nums whitespace-nowrap"},tt=["disabled"],nt=50,st=z({__name:"AdminEventSearchPanel",props:{selectedId:{}},emits:["select"],setup(d,{expose:b,emit:u}){const w=d,x=u,a=[{value:"all",label:"Alle"},{value:"published",label:"Published"},{value:"draft",label:"Draft"},{value:"secret",label:"Secret"},{value:"payw",label:"PAYW"},{value:"free",label:"Free"},{value:"sold_out",label:"Sold Out"},{value:"canceled",label:"Cancelled"},{value:"postponed",label:"Postponed"}],g=y(""),v=y("all"),e=y([]),h=y(!1),A=y(null),U=y(1),T=y(1),$=y(0);let N=null;async function E(){h.value=!0,A.value=null;try{const S=await me({page:U.value,limit:nt,q:g.value.trim()||void 0,filter:v.value});e.value=S.items,$.value=S.total,T.value=S.totalPages,U.value=S.page}catch(S){A.value=S?.message||"Events konnten nicht geladen werden",e.value=[],$.value=0,T.value=1}finally{h.value=!1}}function V(S){v.value!==S&&(v.value=S,U.value=1,E())}function G(){U.value<=1||h.value||(U.value--,E())}function O(){U.value>=T.value||h.value||(U.value++,E())}Q(g,()=>{N&&clearTimeout(N),N=window.setTimeout(()=>{U.value=1,E()},350)});function s(){E()}b({refreshResults:s}),ie(()=>{E()});function n(S){switch(S){case"PUBLISHED":return"bg-emerald-100 text-emerald-700";case"DRAFT":return"bg-gray-100 text-gray-600";case"PENDING_REVIEW":return"bg-amber-100 text-amber-700";case"SOLD_OUT":return"bg-indigo-100 text-indigo-700";case"CANCELED":return"bg-red-100 text-red-700";case"POSTPONED":return"bg-orange-100 text-orange-700";default:return"bg-gray-100 text-gray-600"}}function l(S){if(!S)return"â";try{return new Date(S).toLocaleDateString("de-DE",{day:"2-digit",month:"2-digit",year:"numeric"})}catch{return"â"}}function R(S){return S.status!=="DRAFT"?null:S.draftSavedAt?"User-Entwurf":"Technisch"}return(S,H)=>(r(),i("div",$e,[t("div",De,[L(t("input",{"onUpdate:modelValue":H[0]||(H[0]=p=>g.value=p),type:"search",enterkeyhint:"search",placeholder:"Event suchen (Name oder ID)â¦","aria-label":"Events durchsuchen",class:"pl-10 pr-4 py-2.5 border border-gray-300 rounded-lg focus:ring-2 focus:ring-rose-500 outline-none w-full shadow-sm text-sm"},null,512),[[B,g.value]]),m(I,{name:"search",size:"sm",class:"absolute left-3 top-1/2 -translate-y-1/2 text-gray-400 pointer-events-none"})]),t("div",Pe,[(r(),i(Z,null,ee(a,p=>t("button",{key:p.value,type:"button",role:"tab","aria-selected":v.value===p.value,class:W(["flex flex-initial min-w-0 items-center justify-center px-3 py-2 rounded-xl font-bold text-xs transition-all whitespace-nowrap shrink-0",v.value===p.value?"bg-black text-white shadow-md":"text-gray-500 hover:bg-gray-100 hover:text-black"]),onClick:Y=>V(p.value)},k(p.label),11,Ne)),64))]),t("div",Le,[h.value?(r(),i("div",Ve,[(r(),i(Z,null,ee(5,p=>t("div",{key:"sk"+p,class:"h-16 bg-gray-100 rounded-lg animate-pulse"})),64))])):A.value?(r(),i("div",Be,k(A.value),1)):e.value.length===0?(r(),i("div",Oe," Keine Events gefunden. ")):(r(),i("ul",Re,[(r(!0),i(Z,null,ee(e.value,p=>(r(),i("li",{key:p.id,class:W(["border rounded-lg p-3 cursor-pointer transition-colors",p.id===w.selectedId?"border-rose-400 bg-rose-50/60 ring-1 ring-rose-200":"border-gray-200 hover:border-rose-300 hover:bg-rose-50/30"]),onClick:Y=>x("select",p.id)},[t("div",Ge,[t("div",Fe,k(p.title),1),t("div",Me,[p.eventGroupType?(r(),i("span",He,k(p.eventGroupType),1)):f("",!0),t("span",{class:W(["px-2 py-0.5 rounded text-[10px] font-bold",n(
1p.status)])},k(p.status),3)])]),t("div",Ye,[t("span",null,k(l(p.startAt)),1),p.visibility==="SECRET"?(r(),i("span",We,[m(I,{name:"eye",class:"inline w-3 h-3 mb-0.5"}),H[1]||(H[1]=_(" Secret ",-1))])):f("",!0),p.isFree?(r(),i("span",Ke,"Free")):f("",!0),p.hasPayw?(r(),i("span",je,"PAYW")):f("",!0),R(p)?(r(),i("span",{key:3,class:W(["text-gray-500 font-medium",p.draftSavedAt?"text-blue-600":"text-gray-400"])},k(R(p)),3)):f("",!0),t("span",qe,[m(I,{name:"user",class:"inline w-3 h-3 mb-0.5"}),_(" "+k(p.hostName||"Kein Host"),1)])]),t("div",Je,k(p.id),1)],10,ze))),128))]))]),!h.value&&!A.value&&(e.value.length>0||$.value>0)?(r(),i("div",Qe,[t("span",null,k($.value)+" Events",1),t("div",Xe,[t("button",{type:"button",class:"px-2.5 py-1.5 rounded-lg border border-gray-200 bg-white hover:bg-gray-50 disabled:opacity-40 disabled:cursor-not-allowed font-medium",disabled:U.value<=1,onClick:G}," â ",8,Ze),t("span",et,k(U.value)+" / "+k(T.value),1),t("button",{type:"button",class:"px-2.5 py-1.5 rounded-lg border border-gray-200 bg-white hover:bg-gray-50 disabled:opacity-40 disabled:cursor-not-allowed font-medium",disabled:U.value>=T.value,onClick:O}," â ",8,tt)])])):f("",!0)]))}}),at={class:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 bg-white border border-gray-200 rounded-xl p-4 shadow-sm"},lt={class:"min-w-0"},rt={class:"flex items-center gap-2 flex-wrap"},ot={class:"text-xl font-bold text-gray-900 truncate"},it={key:0,class:"px-2 py-0.5 rounded text-xs font-bold bg-amber-100 text-amber-700"},ut={key:1,class:"px-2 py-0.5 rounded text-xs font-bold bg-rose-100 text-rose-700"},dt={key:2,class:"px-2 py-0.5 rounded text-xs font-bold bg-orange-100 text-orange-700"},vt={key:3,class:"px-2 py-0.5 rounded text-xs font-bold bg-violet-100 text-violet-700"},ct=["disabled"],mt={class:"truncate"},pt={class:"text-xs font-mono text-gray-400 shrink-0"},bt=z({__name:"AdminEventHostBar",props:{event:{}},setup(d){const b=d,u=ae(),w=D(()=>b.event.host?.publicDisplayName||b.event.host?.name||b.event.promoterName||"Kein Host zugewiesen"),x=D(()=>de(b.event)),a=D(()=>ue(b.event.ticketTypes)?.mode==="PAY_AS_YOU_WISH"),g=D(()=>x.value&&b.event.rescueStatus==="ACTIVE"&&!a.value);function v(h){switch(h){case"PUBLISHED":return"bg-emerald-100 text-emerald-700";case"DRAFT":return"bg-gray-100 text-gray-600";case"PENDING_REVIEW":return"bg-amber-100 text-amber-700";case"SOLD_OUT":return"bg-indigo-100 text-indigo-700";case"CANCELED":return"bg-red-100 text-red-700";case"POSTPONED":return"bg-orange-100 text-orange-700";default:return"bg-gray-100 text-gray-600"}}function e(){b.event.hostId&&u.push({name:"adminPromoterDetail",params:{id:b.event.hostId}})}return(h,A)=>(r(),i("div",at,[t("div",lt,[t("div",rt,[t("h2",ot,k(d.event.title),1),t("span",{class:W(["px-2 py-0.5 rounded text-xs font-bold",v(d.event.status)])},k(d.event.status),3),d.event.visibility==="SECRET"?(r(),i("span",it,[m(I,{name:"eye",class:"inline w-3 h-3 mb-0.5"}),A[0]||(A[0]=_(" Versteckt ",-1))])):f("",!0),a.value?(r(),i("span",ut," ADMIN PAYW ")):g.value?(r(),i("span",dt," RESCUE PAYW ")):f("",!0),d.event.eventGroup?(r(),i("span",vt,k(d.event.eventGroup.type),1)):f("",!0)]),t("button",{class:"mt-1 text-sm text-gray-500 hover:text-rose-600 flex items-center gap-1.5 transition-colors cursor-pointer",disabled:!d.event.hostId,onClick:e},[m(I,{name:"user",size:"sm"}),t("span",mt,k(w.value),1),d.event.hostId?(r(),P(I,{key:0,name:"chevron-right",size:"sm"})):f("",!0)],8,ct)]),t("div",pt,k(d.event.id),1)]))}}),gt={class:"flex flex-wrap gap-2"},ft=["href"],yt=z({__name:"AdminEventQuickLinks",props:{event:{}},setup(d){const b=d,u=ae(),w=D(()=>`${window.location.origin}/event/${b.event.slug||b.event.id}`),x=D(()=>b.event.rescueStatus&&b.event.rescueStatus!=="NONE"&&b.event.rescueStatus!=="SETTLED");function a(){b.event.hostId&&u.push({name:"adminPromoterDetail",params:{id:b.event.hostId}})}function g(){u.push({name:"adminRescues"})}return(v,e)=>(r(),i("div",gt,[t("a",{href:w.value,target:"_blank",rel:"noopener",class:"inline-flex items-center gap-1.5 text-sm px-3 py-1.5 rounded-lg border border-gray-200 text-gray-600 hover:border-rose-300 hover:text-rose-600 transition-colors"},[m(I,{name:"external-link",size:"sm"}),e[0]||(e[0]=_(" Ãffentliche Seite ",-1))],8,ft),d.event.hostId?(r(),i("button",{key:0,t
1ype:"button",class:"inline-flex items-center gap-1.5 text-sm px-3 py-1.5 rounded-lg border border-gray-200 text-gray-600 hover:border-rose-300 hover:text-rose-600 transition-colors cursor-pointer",onClick:a},[m(I,{name:"user",size:"sm"}),e[1]||(e[1]=_(" Host-Profil ",-1))])):f("",!0),x.value?(r(),i("button",{key:1,type:"button",class:"inline-flex items-center gap-1.5 text-sm px-3 py-1.5 rounded-lg border border-orange-200 text-orange-700 hover:bg-orange-50 transition-colors cursor-pointer",onClick:g},[m(I,{name:"life-buoy",size:"sm"}),e[2]||(e[2]=_(" Rescue Center ",-1))])):f("",!0)]))}}),xt={class:"space-y-3"},ht={key:0,class:"text-sm text-red-600 bg-red-50 border border-red-100 rounded-lg p-3"},kt={class:"flex justify-end"},Et={key:0},wt={key:1},Ut=z({__name:"AdminEventTicketEditor",props:{event:{}},emits:["updated"],setup(d,{emit:b}){const u=d,w=b,x=fe(),a=y(!1),g=y(null),v=D(()=>u.event.hostId??null),{boxOfficeEnabled:e}=pe(v),h=D(()=>u.event.startAt?ne(u.event.startAt):""),A=D(()=>{const E=[u.event.startAt?ne(u.event.startAt):"",u.event.endAt?ne(u.event.endAt):""].filter(Boolean);return Ce(E)||h.value});Q(()=>u.event,E=>{x.hydrateFromEvent(E),g.value=null},{immediate:!0});async function U(){const E=x.validate({eventDateYmd:h.value,customCalendarMaxYmd:A.value});if(E)return g.value=E,null;a.value=!0,g.value=null;try{const V=x.buildTicketConfig(),G=x.buildExternalLinks(),O=x.buildCapacityTotal(),s=x.effectiveTaxCategory.value,n={ticketConfig:V,isFree:x.isFree.value,...O!=null?{capacityTotal:O}:{},...G!==void 0?{externalLinks:G}:{},...s?{ticketTaxCategory:s}:{}},l=await J(u.event.id,n);return w("updated",l),l.id}catch(V){return g.value=V?.message||"Tickets konnten nicht gespeichert werden",null}finally{a.value=!1}}const{loadingTierId:T,openForTier:$}=be({ensureSaved:U,source:"edit",onError:E=>{g.value=E}});function N(E){$(E)}return(E,V)=>(r(),i("div",xt,[g.value?(r(),i("div",ht,k(g.value),1)):f("",!0),m(ge,{tickets:te(x),"box-office-enabled":te(e),"event-date-ymd":h.value,"custom-calendar-max-ymd":A.value,"event-id":d.event.id,"show-errors":"","guestlist-loading-id":te(T),onOpenGuestlist:N},null,8,["tickets","box-office-enabled","event-date-ymd","custom-calendar-max-ymd","event-id","guestlist-loading-id"]),t("div",kt,[m(M,{variant:"primary",disabled:a.value,onClick:U},{default:F(()=>[a.value?(r(),i("span",Et,"Speichereâ¦")):(r(),i("span",wt,"Tickets speichern"))]),_:1},8,["disabled"])])]))}}),St={class:"bg-white border border-gray-200 rounded-xl p-4 shadow-sm"},At={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},Ct={class:"md:col-span-2"},It={class:"md:col-span-2"},Tt={class:"md:col-span-2"},_t={class:"md:col-span-2 pt-2 border-t border-gray-100 space-y-4"},$t={class:"flex justify-end mt-4"},Dt=z({__name:"AdminEventDetailsForm",props:{event:{},saving:{type:Boolean}},emits:["save"],setup(d,{emit:b}){const u=d,w=b,x=y(null),a=y(null),g=y(!1),v=y(null),e=ce({title:"",description:"",heroImageUrl:"",startAt:"",endAt:"",salesStartsAt:"",visibility:"PUBLIC",priceLabel:"",venueId:"",venueName:"",city:"",instagramUrl:"",facebookUrl:"",websiteUrl:"",youtubeUrl:"",spotifyUrl:"",bandcampEmbedUrl:""});function h(s){if(!s)return"";const n=new Date(s);if(isNaN(n.getTime()))return"";const l=R=>String(R).padStart(2,"0");return`${n.getFullYear()}-${l(n.getMonth()+1)}-${l(n.getDate())}T${l(n.getHours())}:${l(n.getMinutes())}`}function A(s){if(!s)return;const n=new Date(s);if(!isNaN(n.getTime()))return n.toISOString()}function U(s){return s.venueId?.trim()?{venueId:s.venueId,venueName:s.venueName??"",city:s.city??"",addressLine1:s.venueAddressLine1??null,postalCode:s.venuePostalCode??null,countryCode:s.venueCountryCode??null,lat:s.lat??0,lng:s.lng??0}:null}function T(s){e.title=s.title??"",e.description=s.description??"",e.heroImageUrl=s.heroImageUrl??s.coverUrl??"",e.startAt=h(s.startAt),e.endAt=h(s.endAt),e.salesStartsAt=h(s.salesStartsAt),e.visibility=s.visibility==="SECRET"?"SECRET":"PUBLIC",e.priceLabel=s.priceLabel??"",e.venueId=s.venueId??"",e.venueName=s.venueName??"",e.city=s.city??"",v.value=U(s),e.instagramUrl=s.instagramUrl??"",e.facebookUrl=s.facebookUrl??"",e.websiteUrl=s.websiteUrl??"",e.youtubeUrl=s.youtubeUrl??"",e.spotifyUrl=s.spotifyUrl??"",e.bandcampEmbedUrl=s.bandcampEmbedUrl??"",x.value=s.startAt??null,a.value=s.endAt??null}Q(()=>u.event,s=>T(s),{immediate:!0});function $(s){v.value=s,e.venueId=s.venueId,e.venueName=s.venueName,e.city=s.city}function N(){v.value=null,e.venueId="",e.venueName="",e.city=""}function E(s){e.venueName=s,s.trim()||(e.city=""),e.venueId&&(e.venueId="",v.value=null)}function V(s){const n=s.trim();if(!n)return;const l=Te(n);if(l&&re(l))return l;if(re(n))return n}function G(){const s={title:e.title.trim(),description:e.description,visibility:e.visibility,priceLabel:e.priceLabel||void 0,venueId:e.venueId||void 0,venueName:e.venueName||void 0,city:e.city||void 0,instagramUrl:e.instagramUrl||void 0,facebookUrl:e.facebookUrl||void 0,websiteUrl:e.websiteUrl||void 0,heroImageUrl:e.heroImageUrl.trim()||void 0,youtubeUrl:e.youtubeUrl.trim()||void 0,spotifyUrl:e.spotifyUrl.trim()||void 0,bandcampEmbedUrl:V(e.bandcampEmbedUrl)},n=A(e.startAt);n&&n!==x.value&&(s.startAt=n);const l=A(e.endAt);l&&l!==a.value&&(s.endAt=l);const R=A(e.salesStartsAt);return R&&(s.salesStartsAt=R),s}function O(){w("save",G())}return(s,n)=>(r(),i("section",St,[n[28]||(n[28]=t("h3",{class:"text-sm font-bold text-gray-700 mb-4 uppercase tracking-wide"}," Eckdaten ",-1)),t("div",At,[t("div",Ct,[n[15]||(n[15]=t("label",{class:"block text-xs font-bold text-gray-600 mb-1"},"Titel",-1)),L(t("input",{"onUpdate:modelValue":n[0]||(n[0]=l=>e.title=l),type:"text",class:"w-full border border-gray-300 rounded-lg px-3 py-2 outline-none focus:ring-2 focus:ring-rose-500"},null,512),[[B,e.title]])]),t("div",It,[n[16]||(n[16]=t("label",{class:"block text-xs font-bold text-gray-600 mb-1"},"Beschreibung",-1)),L(t("textarea",{"onUpdate:modelValue":n[1]||(n[1]=l=>e.description=l),rows:"4",class:"w-full border border-gray-300 rounded-lg px-3 py-2 outline-none focus:ring-2 focus:ring-rose-500 resize-y"},null,512),[[B,e.description]])]),t("div",Tt,[m(Ue,{selected:v.value,"draft
1-name":e.venueName,"creation-flow":"admin-form-first","onUpdate:draftName":E,onSelect:$,onClear:N},null,8,["selected","draft-name"])]),t("div",null,[n[17]||(n[17]=t("label",{class:"block text-xs font-bold text-gray-600 mb-1"},"Start",-1)),L(t("input",{"onUpdate:modelValue":n[2]||(n[2]=l=>e.startAt=l),type:"datetime-local",class:"w-full border border-gray-300 rounded-lg px-3 py-2 outline-none focus:ring-2 focus:ring-rose-500"},null,512),[[B,e.startAt]])]),t("div",null,[n[18]||(n[18]=t("label",{class:"block text-xs font-bold text-gray-600 mb-1"},"Ende",-1)),L(t("input",{"onUpdate:modelValue":n[3]||(n[3]=l=>e.endAt=l),type:"datetime-local",class:"w-full border border-gray-300 rounded-lg px-3 py-2 outline-none focus:ring-2 focus:ring-rose-500"},null,512),[[B,e.endAt]])]),t("div",null,[n[19]||(n[19]=t("label",{class:"block text-xs font-bold text-gray-600 mb-1"},"Verkaufsstart",-1)),L(t("input",{"onUpdate:modelValue":n[4]||(n[4]=l=>e.salesStartsAt=l),type:"datetime-local",class:"w-full border border-gray-300 rounded-lg px-3 py-2 outline-none focus:ring-2 focus:ring-rose-500"},null,512),[[B,e.salesStartsAt]])]),t("div",null,[n[21]||(n[21]=t("label",{class:"block text-xs font-bold text-gray-600 mb-1"},"Sichtbarkeit",-1)),L(t("select",{"onUpdate:modelValue":n[5]||(n[5]=l=>e.visibility=l),class:"w-full border border-gray-300 rounded-lg px-3 py-2 outline-none focus:ring-2 focus:ring-rose-500 bg-white"},[...n[20]||(n[20]=[t("option",{value:"PUBLIC"},"Ãffentlich",-1),t("option",{value:"SECRET"},"Versteckt (Secret Link)",-1)])],512),[[ve,e.visibility]])]),t("div",null,[n[22]||(n[22]=t("label",{class:"block text-xs font-bold text-gray-600 mb-1"},"Preis-Label",-1)),L(t("input",{"onUpdate:modelValue":n[6]||(n[6]=l=>e.priceLabel=l),type:"text",placeholder:"z.B. ab 15 â¬",class:"w-full border border-gray-300 rounded-lg px-3 py-2 outline-none focus:ring-2 focus:ring-rose-500"},null,512),[[B,e.priceLabel]])]),t("div",null,[n[23]||(n[23]=t("label",{class:"block text-xs font-bold text-gray-600 mb-1"},"Instagram",-1)),L(t("input",{"onUpdate:modelValue":n[7]||(n[7]=l=>e.instagramUrl=l),type:"url",class:"w-full border border-gray-300 rounded-lg px-3 py-2 outline-none focus:ring-2 focus:ring-rose-500"},null,512),[[B,e.instagramUrl]])]),t("div",null,[n[24]||(n[24]=t("label",{class:"block text-xs font-bold text-gray-600 mb-1"},"Facebook",-1)),L(t("input",{"onUpdate:modelValue":n[8]||(n[8]=l=>e.facebookUrl=l),type:"url",class:"w-full border border-gray-300 rounded-lg px-3 py-2 outline-none focus:ring-2 focus:ring-rose-500"},null,512),[[B,e.facebookUrl]])]),t("div",null,[n[25]||(n[25]=t("label",{class:"block text-xs font-bold text-gray-600 mb-1"},"Website",-1)),L(t("input",{"onUpdate:modelValue":n[9]||(n[9]=l=>e.websiteUrl=l),type:"url",class:"w-full border border-gray-300 rounded-lg px-3 py-2 outline-none focus:ring-2 focus:ring-rose-500"},null,512),[[B,e.websiteUrl]])]),t("div",_t,[t("div",null,[n[26]||(n[26]=t("label",{class:"block text-xs font-bold text-gray-600 mb-2"},"Cover-Bild",-1)),m(Ie,{modelValue:e.heroImageUrl,"onUpdate:modelValue":n[10]||(n[10]=l=>e.heroImageUrl=l),onUploading:n[11]||(n[11]=l=>g.value=l)},null,8,["modelValue"])]),m(Se,{youtube:e.youtubeUrl,"onUpdate:youtube":n[12]||(n[12]=l=>e.youtubeUrl=l),spotify:e.spotifyUrl,"onUpdate:spotify":n[13]||(n[13]=l=>e.spotifyUrl=l),bandcamp:e.bandcampEmbedUrl,"onUpdate:bandcamp":n[14]||(n[14]=l=>e.bandcampEmbedUrl=l),"focus-variant":"secondary"},null,8,["youtube","spotify","bandcamp"])])]),t("div",$t,[m(M,{variant:"primary",disabled:d.saving||g.value,onClick:O},{default:F(()=>[...n[27]||(n[27]=[_(" Eckdaten speichern ",-1)])]),_:1},8,["disabled"])])]))}}),Pt={class:"bg-white border border-gray-200 rounded-xl p-4 shadow-sm"},Nt={class:"flex flex-wrap gap-2 items-center"},Lt={key:1,class:"text-xs text-gray-500"},Vt=z({__name:"AdminEventPublishBar",props:{event:{},saving:{type:Boolean}},emits:["published","error"],setup(d,{emit:b}){const u=d,w=b;async function x(){try{const a=await ye(u.event);w("published",a)}catch(a){w("error",_e(a,"Veröffentlichen fehlgeschlagen"))}}return(a,g)=>(r(),i("section",Pt,[g[0]||(g[0]=t("h3",{class:"text-sm font-bold text-gray-700 mb-3 uppercase tracking-wide"}," Veröffentlichen ",-1)),t("div",Nt,[d.event.status!=="PUBLISHED"&&d.event.status!=="SOLD_OUT"?(r(),P(M,{key:0,variant:"primary",disabled:d.saving,onClick:x},{default:F(()=>[m(I,{name:"check",size:"sm",class:"mr-1"}),_(" "+k(d.event.eventGroupRole==="MASTER"||d.event.eventGroup?.type==="TOUR"?"Tour/Gruppe veröffentlichen":"Veröffentlichen"),1)]),_:1},8,["disabled"])):f("",!0),d.event.eventGroupRole==="MASTER"?(r(),i("p",Lt," Publiziert alle Termine der Gruppe (Server-Preflight inkl. Bootstrap). ")):f("",!0)])]))}}
1),Bt={class:"text-sm text-violet-800 bg-violet-50 border border-violet-100 rounded-xl p-4 flex items-start gap-2"},Ot={class:"text-violet-700 mt-1"},Rt={key:0},zt=z({__name:"AdminEventChildContextBanner",props:{event:{}},setup(d){return(b,u)=>(r(),i("div",Bt,[m(I,{name:"info",size:"sm",class:"shrink-0 mt-0.5"}),t("div",null,[u[2]||(u[2]=t("p",{class:"font-semibold"},"Tour-/Gruppen-Termin",-1)),t("p",Ot,[u[0]||(u[0]=_(" Dies ist ein einzelner Termin ",-1)),d.event.eventGroup?.name?(r(),i("span",Rt,"der Tour â"+k(d.event.eventGroup.name)+"â",1)):f("",!0),u[1]||(u[1]=_(". Du kannst Details und Tickets hier bearbeiten. Die Termin-Ãbersicht findest du am Master-Event der Gruppe. ",-1))])])]))}}),Gt={class:"h-full"},Ft={key:0,class:"space-y-4"},Mt={key:1,class:"text-sm text-red-600 bg-red-50 border border-red-100 rounded-xl p-4"},Ht={key:2,class:"space-y-5 pb-20"},Yt={key:0,class:"text-sm text-red-600 bg-red-50 border border-red-100 rounded-lg p-3"},Wt={key:1,class:"text-sm text-emerald-700 bg-emerald-50 border border-emerald-100 rounded-lg p-3 flex items-center gap-2"},Kt={class:"bg-white border border-gray-200 rounded-xl p-4 shadow-sm"},jt={class:"grid grid-cols-1 sm:grid-cols-2 gap-3 mb-3"},qt={class:"flex flex-wrap gap-2"},Jt=["disabled"],Qt=z({__name:"AdminEventWorkbench",props:{eventId:{}},emits:["changed"],setup(d,{emit:b}){const u=d,w=b,{confirm:x}=we(),a=y(null),g=y(!1),v=y(!1),e=y(null),h=y(null),A=y(""),U=y(""),T=y(""),$=y(""),N=y(null),E=D(()=>a.value!=null&&Ee(a.value)),V=D(()=>a.value!=null&&a.value.eventGroupRole!=="CHILD"),G=D(()=>a.value?.eventGroupRole==="CHILD"),O=D(()=>{if(!T.value||!$.value)return!1;const c=se(T.value,$.value);return!!c&&c!==N.value});function s(c){const{date:o,time:C}=Ae(c.startAt);T.value=o,$.value=C,N.value=se(o,C)??c.startAt??null}async function n(){g.value=!0,e.value=null;try{const c=await he(u.eventId);a.value=c,s(c)}catch(c){e.value=c?.message||"Event konnte nicht geladen werden",a.value=null}finally{g.value=!1}}Q(()=>u.eventId,()=>n(),{immediate:!0});function l(c){h.value=c,window.setTimeout(()=>{h.value===c&&(h.value=null)},3e3)}async function R(c){if(a.value){v.value=!0,e.value=null;try{const o=await J(a.value.id,c);a.value=o,s(o),l("Ãnderungen gespeichert."),w("changed")}catch(o){e.value=o?.message||"Speichern fehlgeschlagen"}finally{v.value=!1}}}async function S(c){if(a.value){v.value=!0,e.value=null;try{const o=await J(a.value.id,{visibility:c});a.value=o,l(c==="SECRET"?"Event versteckt.":"Event sichtbar."),w("changed")}catch(o){e.value=o?.message||"Sichtbarkeit konnte nicht geändert werden"}finally{v.value=!1}}}function H(c){a.value=c,s(c),l("Event veröffentlicht."),w("changed")}function p(c){e.value=c}async function Y(c){if(!a.value)return;let o="Status ändern?",C="Diese Aktion kann nicht rückgängig gemacht werden.",K="Bestätigen",le="default";if(c==="POSTPONED"?(o="Event verschieben?",C=`Das Event wird auf âverschobenâ gesetzt und auf den ${T.value} um ${$.value} Uhr terminiert. Gruppen-Termine bleiben unverändert.`,K="Verschieben"):c==="CANCELED"?(o="Event beenden?",C="Das Event wird abgesagt. Käufer werden ggf. erstattet. Gruppen-Termine bleiben unverändert.",K="Beenden",le="danger"):c==="PUBLISHED"&&(o="Event wieder öffnen?",C="Das ausverkaufte Event wird wieder veröffentlicht. Kapazität ggf. vorher erhöhen.",K="Wieder öffnen"),!!await x({title:o,message:C,confirmLabel:K,cancelLabel:"Abbrechen",type:le})){v.value=!0,e.value=null;try{if(c==="POSTPONED"&&O.value){const X=se(T.value,$.value);X&&X!==N.value&&await J(a.value.id,{startAt:X,skipGroupPropagation:!0})}const j=await ke(a.value.id,c,A.value.trim()||void 0,U.value.trim()||void 0);a.value=j,s(j),A.value="",U.value="",l("Status geändert."),w("changed")}catch(j){e.value=j?.message||"Statusänderung fehlgeschlagen"}finally{v.value=!1}}}function oe(c){a.value=c,l("Tickets aktualisiert."),w("changed")}return(c,o)=>(r(),i("div",Gt,[g.value?(r(),i("div",Ft,[...o[9]||(o[9]=[t("div",{class:"h-20 bg-gray-100 rounded-xl animate-pulse"},null,-1),t("div",{class:"h-64 bg-gray-100 rounded-xl animate-pulse"},null,-1)])])):e.value&&!a.value?(r(),i("div",Mt,k(e.value),1)):a.value?(r(),i("div",Ht,[m(bt,{event:a.value},null,8,["event"]),m(yt,{event:a.value},null,8,["event"]),e.value?(r(),i("div",Yt,k(e.value),1)):f("",!0),h.value?(r(),i("div",Wt,[m(I,{name:"check",size:"sm"}),_(" "+k(h.value),1)])):f("",!0),m(Vt,{event:a.value,saving:v.value,onPublished:H,onError:p},null,8,["event","saving"]),G.value?(r(),P(zt,{key:2,event:a.value},null,8,["event"])):f("",!0),E.value?(r(),P(xe,{key:3,"master-id":a.value.id,"master-title":a.value.title,"master-event":a.value,onMasterUpdated:n,onError:p},null,8,["master-id","master-title","master-event"])):f("",!0),t("section",Kt,[o[15]||(o[15]=t("h3",{class:"text-sm font-bold text-gray-700 mb-3 uppercase tracking-wide"}," Status-Aktionen ",-1)),t("div",jt,[m(q,{modelValue:A.value,"onUpdate:modelValue":o[0]||(o[0]=C=>A.value=C),label:"Status-Nachricht (optional)",placeholder:"Info für Besucher bei Absage/Verschiebung"},null,8,["modelValue"]),m(q,{modelValue:U.value,"onUpdate:modelValue":o[1]||(o[1]=C=>U.value=C),label:"Kontakt-E-Mail (optional)",placeholder:"[email protected]",type:"email"},null,8,["modelValue"]),a.value.status!=="POSTPONED"&&a.value.status!=="CANCELED"?(r(),P(q,{key:0,modelValue:T.value,"onUpdate:modelValue":o[2]||(o[2]=C=>T.value=C),type:"date",label:"Neues Datum (für Verschiebung)"},null,8,["modelValue"])):f("",!0),a.value.status!=="POSTPONED"&&a.value.status!=="CANCELED"?(r(),P(q,{key:1,modelValue:$.value,"onUpdate:modelValue":o[3]||(o[3]=C=>$.value=C),type:"time",label:"Neue Uhrzeit (für Verschiebung)"},null,8,["modelValue"])):f("",!0)]),t("div",qt,[a.value.status==="SOLD_OUT"?(r(),P(M,{key:0,variant:"primary",disabled:v.value,onClick:o[4]||(o[4]=C=>Y("PUBLISHED"))},{default:F(()=>[m(I,{name:"check",size:"sm",class:"mr-1"}),o[10]||(o[10]=_(" Wieder öffnen ",-1))]),_:1},8,["disabled"])):f("",!0),a.value.visibility!=="SECRET"?(r(),P(M,{key:1,variant:"default",disabled:v.value,onClick:o[5]||(o[5]=C=>S("SECRET"))},{default:F(()=>[m(I,{name:"eye",size:"sm",class:"mr-1"}),o[11]||(o[11]=_(" Verstecken ",-1))]),_:1},8,["disabled"])):(r(),P(M,{key:2,variant:"default",disabled:v.value,onClick:o[6]||(o[6]=C=>S("PUBLIC"))},{default:F(()=>[m(I,{name:"globe",size:"sm",class:"mr-1"}),o[12]||(o[12]=_(" Sichtbar machen ",-1))]),_:1},8,["disabled"])),a.value.status!=="POSTPONED"&&a.value.status!=="CANCELED"?(r(),P(M,{key:3,variant:"default",disabled:v.value||!O.value,onClick:o[7]||(o[7]=C=>Y("POSTPONED"))},{default:F(()=>[m(I,{name:"calendar-clock",size:"sm",class:"mr-1"}),o[13]||(o[13]=_(" Verschieben ",-1))]),_:1},8,["disabled"])):f("",!0),a.value.status!=="CANCELED"?(r(),i("button",{key:4,type:"button",class:"inline-flex items-center px-4 py-2 rounded-lg bg-red-600 text-white text-sm font-bold hover:bg-red-700 disabled:opacity-50 disabled:cursor-not-allowed transition-colors cursor-pointer",disabled:v.value,onClick:o[8]||(o[8]=C=>Y("CANCELED"))},[m(I,{name:"trash",size:"sm",class:"mr-1"}),o[14]||(o[14]=_(" Beenden ",-1))],8,Jt)):f("",!0)])]),m(Dt,{event:a.value,saving:v.value,onSave:R},null,8,["event","saving"]),V.value?(r(),P(Ut,{key:4,event:a.value,onUpdated:oe},null,8,["event"])):f("",!0)])):f("",!0)]))}}),Xt={class:"max-w-7xl mx-auto pb-10"},Zt={class:"flex flex-col sm:flex-row sm:items-center justify-between mb-6 gap-4"},en={class:"grid grid-cols-1 lg:grid-cols-[360px_1fr] gap-6 items-start"},tn={class:"bg-white border border-gray-200 rounded-xl shadow-sm p-4 lg:sticky lg:top-4 h-[calc(100vh-8rem)] flex flex-col"},nn={key:0,class:"bg-white border border-dashed border-gray-300 rounded-xl p-12 text-center text-gray-400"},wn=z({__name:"AdminEvents",setup(d){const b=ae(),u=y(null),w=y(null);function x(v){u.value=v}function a(){w.value?.refreshResults()}function g(){b.push({name:"adminEventCreate"})}return(v,e)=>(r(),i("div",Xt,[t("div",Zt,[e[1]||(e[1]=t("div",null,[t("h1",{class:"text-2xl font-bold text-gray-900"},"Events"),t("p",{class:"text-gray-500"}," Jedes Event der Plattform suchen, bearbeiten und steuern. ")],-1)),m(M,{variant:"primary",onClick:g},{default:F(()=>[m(I,{name:"plus",size:"sm",class:"mr-1"}),e[0]||(e[0]=_(" Event erstellen ",-1))]),_:1})]),t("div",en,[t("div",tn,[m(st,{ref_key:"searchPanelRef",ref:w,"selected-id":u.value,onSelect:x},null,8,["selected-id"])]),t("div",null,[u.value?(r(),P(Qt,{key:u.value,"event-id":u.value,onChanged:a},null,8,["event-id"])):(r(),i("div",nn,[m(I,{name:"ticket",size:"lg",class:"mx-auto mb-3 opacity-40"}),e[2]||(e[2]=t("p",{class:"font-medium"},"Kein Event ausgewählt",-1)),e[3]||(e[3]=t("p",{class:"text-sm"}," Wähle links ein Event aus der Liste oder suche danach. ",-1))]))])])]))}});
1export{wn 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.