PageSourceSearch

https://otowah.com/_next/static/chunks/151-75035b3f66e17b93.js

js otowah.com collected 2026-10-02 16:03:35 UTC 51,444 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[151],{7151:function(e,t,r){r.r(t),r.d(t,{default:function(){return B}});var n=r(5893),l=r(7294),i=r(3935),a=r(2475),s=r(5510),o=r(3860),d=r(988),u=r(5371),c=r(9564),m=r(4302),p=r(4126),g=r(5317),h=r(7343);function x(e,t){var r,n;let l="string"==typeof(r=null==t?void 0:t.image)&&r.startsWith("data:image/"),i=(n=null==t?void 0:t.audioLink,(0,c.Am)(n).length);return{active:!0,mode:e,stage:"preparing",startedAt:Date.now(),estimatedMs:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Math.max(0,Number(e.bandcampUrlCount)||0),r=!!e.hasImageUpload,n=2200;return r&&(n+=4500),n+=11e3*t,t>0?n+=1500:n+=800,n}({hasImageUpload:l,bandcampUrlCount:i}),hasImageUpload:l,bandcampTotal:i,bandcampIndex:0,bandcampArtistName:"",bandcampUrl:""}}function v(e){return t=>t?{...t,...e,active:!1!==e.active}:t}function f(e){if(!e)return"";let t="edit"===e.mode;return"complete"===e.stage?t?"Event updated":"Event posted":"error"===e.stage?t?"Could not update event":"Could not post event":t?"Updating your event":"Posting your event"}function b(e){let{progress:t}=e,[r,i]=(0,l.useState)(()=>Date.now());if((0,l.useEffect)(()=>{if(!(null==t?void 0:t.active)||"complete"===t.stage||"error"===t.stage)return;let e=setInterval(()=>i(Date.now()),400);return()=>clearInterval(e)},[null==t?void 0:t.active,null==t?void 0:t.stage]),!(null==t?void 0:t.active))return null;let a=function(e){if(!e)return 0;if("complete"===e.stage)return 100;let t=0,r=e.bandcampTotal>0?68:0;if("preparing"===e.stage)return 4;if("uploading_image"===e.stage)return 12;if("saving_event"===e.stage)return e.hasImageUpload?22:18;if("bandcamp_sync"===e.stage||"bandcamp_link"===e.stage||"bandcamp_scrape"===e.stage){let n=e.hasImageUpload?24:20,l=Math.max(0,e.bandcampIndex),i=r/Math.max(1,e.bandcampTotal);return t=n+i*l,"bandcamp_scrape"===e.stage?t+=.45*i:"bandcamp_link"===e.stage&&(t+=.2*i),Math.min(92,Math.round(t))}return"linking_artists"===e.stage?96:t}(t),s=r-t.startedAt,o=Math.max(0,t.estimatedMs-s),d="complete"!==t.stage&&"error"!==t.stage&&t.estimatedMs>0,u="error"===t.stage,c="complete"===t.stage;return(0,n.jsx)("div",{className:"fixed inset-0 z-[250] flex items-center justify-center bg-black/92 px-4 py-8 sm:px-6",role:"alertdialog","aria-modal":"true","aria-busy":!c&&!u,"aria-live":"polite","aria-label":f(t),children:(0,n.jsx)("div",{className:"w-full max-w-md rounded-3xl border border-white/10 bg-[#141414] px-6 py-8 shadow-2xl sm:px-8",children:(0,n.jsxs)("div",{className:"flex flex-col items-center text-center",children:[c||u?null:(0,n.jsx)("div",{className:"mb-5 h-12 w-12 rounded-full border-2 border-white/15 border-t-[var(--vivace-neon-green,#6ee7b7)] animate-spin","aria-hidden":!0}),c?(0,n.jsx)("div",{className:"mb-5 flex h-12 w-12 items-center justify-center rounded-full bg-emerald-500/15 text-emerald-300","aria-hidden":!0,children:(0,n.jsx)("svg",{className:"h-7 w-7",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}):null,u?(0,n.jsx)("div",{className:"mb-5 flex h-12 w-12 items-center justify-center rounded-full bg-red-500/15 text-red-300","aria-hidden":!0,children:(0,n.jsx)("svg",{className:"h-7 w-7",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})}):null,(0,n.jsx)("h2",{className:"text-xl font-semibold tracking-tight text-white",children:f(t)}),(0,n.jsx)("p",{className:"mt-2 text-sm leading-relaxed text-white/65",children:function(e){if(!e)return"";let{stage:t,bandcampIndex:r,bandcampTotal:n,bandcampArtistName:l}=e,i=n>0?" (".concat(r||1," of ").concat(n,")"):"";switch(t){case"preparing":return"Getting everything ready…";case"uploading_image":return"Uploading your event poster to Otowah…";case"saving_event":return"edit"===e.mode?"Saving changes to the live events database…":"Publishing your event to the live guide…";case"bandcamp_sync":return n>0?"Syncing ".concat(n," Bandcamp link").concat(1===n?"":"s"," with our artist catalog…"):"Finalising artist links…";case"bandcamp_link":return"Linking existing Bandcamp release".concat(i,"…");case"bandcamp_scrape":{let e=String(l||"").trim();if(e)return"Fetching ".concat(e," from Bandcamp").concat(i," — artwork, album details, and artist profile…");return"Fetching artist & album from Bandcamp".concat(i,"…")}case"linking_artists":return"Connecting artists on the bill…";case"complete":return"All done — your event is live.";case"error":return String(e.errorMessage||"").trim()||"Something went wrong. You can close this and try again.";default:return"Working…"}}(t)}),c||u?null:(0,n.jsxs)("div",{className:"mt-6 w-full space-y-2",children:[(0,n.jsx)("div",{className:"h-2 overflow-hidden rounded-full bg-white/10",children:(0,n.jsx)("div",{className:"h-full rounded-full transition-[width] duration-500 ease-out",style:{width:"".concat(a,"%"),backgroundColor:"var(--vivace-neon-green,#6ee7b7)"}})}),(0,n.jsxs)("div",{className:"flex items-center justify-between text-xs text-white/45",children:[(0,n.jsxs)("span",{children:[a,"%"]}),d?(0,n.jsxs)("span",{children:["About ",function(e){let t=Math.max(0,Math.ceil(e/1e3));if(t<8)return"a few seconds";if(t<45)return"~".concat(t," sec");let r=Math.ceil(t/60);return 1===r?"~1 min":"~".concat(r," min")}(o)," left"]}):null]})]}),!(t.bandcampTotal>0)||c||u?null:(0,n.jsx)("p",{className:"mt-4 text-xs text-white/40",children:"New Bandcamp links take longer — we fetch artist photos, album art, and release details for each one."})]})})})}var w=r(6805),y=r(8946);function S(e){if(null==e)return null;if("number"==typeof e)return Number.isNaN(e)?null:e;if("string"==typeof e){let t=Number(e);if(!Number.isNaN(t)&&""!==e.trim())return t;let r=new Date(e).getTime();return Number.isNaN(r)?null:r}if("object"==typeof e){var t;if("function"==typeof e.toMillis)try{let t=e.toMillis();return Number.isNaN(Number(t))?null:Number(t)}catch(e){return null}let r=null!==(t=e.seconds)&&void 0!==t?t:e._seconds;if("number"==typeof r)return 1e3*r}return null}function k(e){let t=String(e||"").trim();if(!t)return null;let r=new Date("".concat(t,"T00:00:00")).getTime();return Number.isNaN(r)?null:r}function N(e){var t;let r=String(null!==(t=e.releaseTitle)&&void 0!==t?t:"").trim(),n=(0,c.Si)(e.releaseArtworkThumbUrl,e.releaseArtworkUrl);return r||n?{title:r,art:n}:null}function j(e,t){var r,n,l;let i=String(null!==(r=e.bandcampStatus)&&void 0!==r?r:"").trim();if("pending"===i||"linked"===i||"artist_only"===i||"skipped"===i)return i;let a=String(null!==(n=e.name)&&void 0!==n?n:"").trim(),s=(0,c.BE)(a),o=s&&t.some(e=>{var t,r;let n=String(null!==(r=null!==(t=null==e?void 0:e.newLink)&&void 0!==t?t:null==e?void 0:e.link)&&void 0!==r?r:"").trim();return(0,c.BE)(null==e?void 0:e.artistName)===s&&n.length>0}),d=String(null!==(l=e.artistId)&&void 0!==l?l:"").trim();return d&&o?"linked":d?"artist_only":o?"linked":"skipped"}function A(e,t){var r;let n=(0,c.BE)(t);if(!n)return"";let l=(Array.isArray(e)?e:[]).find(e=>(0,c.BE)(null==e?void 0:e.artistName)===n);return String(null!==(r=null==l?void 0:l.newLink)&&void 0!==r?r:"").trim()}function C(e){return/\/(album|track)\//i.test(String(e||""))}function L(e){var t,r;if(!e||"object"!=typeof e)return null;let n=(0,m.e1)(e),l=String(null!==(t=e.title)&&void 0!==t?t:"").trim(),i=(0,c.kz)(e);return n||l||i?{releaseId:String(null!==(r=e.id)&&void 0!==r?r:"").trim(),listenUrl:n,releaseTitle:l,releaseArtworkThumbUrl:i}:null}async function I(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=String(e||"").trim();if(!r)return null;try{let e=await (0,m.rd)(r,40);return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=Array.isArray(e)?e.filter(Boolean):[];if(0===r.length)return null;let n=String(t||"").trim().toLowerCase();if(n){let e=r.find(e=>{let t=(0,m.e1)(e).toLowerCase();return t&&(t===n||n.includes(t)||t.includes(n))});if(e)return L(e)}let l=r.filter(c.Sx);return L(l.filter(e=>"album"===String(e.itemType||"").toLowerCase())[0]||l[0]||r[0])}(e,t)}catch(e){return null}}function M(e){return String(e||"").toLowerCase().replace(/[^a-z0-9]+/g,"")}let R="19:00",T="22:00";function _(e,t,r){let n=String((null==e?void 0:e.artistId)||"").trim();if(t&&n&&t===n)return!0;let l=M(null==e?void 0:e.name);return!!(r&&l&&r===l)}let E=["12","01","02","03","04","05","06","07","08","09","10","11"],U=["00","05","10","15","20","25","30","35","40","45","50","55"];function P(e){let t=String(e||"").trim();if(!/^\d{2}:\d{2}$/.test(t))return{hour:"12",minute:"00",period:"AM"};let[r,n]=t.split(":"),l=Number(r),i=U.includes(n)?n:"00",a=l>=12?"PM":"AM";return 0==(l%=12)&&(l=12),{hour:String(l).padStart(2,"0"),minute:i,period:a}}function F(e,t,r){let n=Number(e);Number.isNaN(n)&&(n=12);let l=U.includes(String(t))?String(t):"00",i="PM"===String(r||"AM").toUpperCase()?"PM":"AM";return 12===n?n="AM"===i?0:12:"PM"===i&&(n+=12),"".concat(String(n).padStart(2,"0"),":").concat(l)}function D(e){let t=String(null!=e?e:"").trim();if(!t)return"";let r=(e,t)=>{let r=Number(e),n=Number(t);if(Number.isNaN(r)||Number.isNaN(n))return"";let l=Math.max(0,Math.min(59,n)),i=U.reduce((e,t)=>
1Math.abs(Number(t)-l)<Math.abs(Number(e)-l)?t:e,"00");return"".concat(String(Math.max(0,Math.min(23,r))).padStart(2,"0"),":").concat(i)};if(/^\d{2}:\d{2}$/.test(t)){let[e,n]=t.split(":");return r(e,n)}let n=new Date(t);if(!Number.isNaN(n.getTime()))return r(n.getHours(),n.getMinutes());let l=t.match(/^(\d{1,2}):(\d{2})(?::\d{2})?$/);return l?r(l[1],l[2]):""}function B(e){var t,r;let{open:m,onClose:f,venue:L,venueId:B,initialDraft:O,onPreparedPayload:z,isEditing:G=!1,existingEvent:V=null,allowVenueDetailsEdit:Z=!1,createSource:H="manual",variant:$="full",pageArtist:W=null}=e,Y="shrink-0 inline-flex items-center justify-center h-[42px] w-[42px] rounded-xl border border-[var(--vivace-neon-blue,#55ffe1)]/50 text-[20px] leading-none font-bold text-black shadow-[0_0_0_1px_rgba(0,0,0,0.2)] hover:opacity-90 active:scale-[0.98] transition",K=(0,l.useId)(),q=(0,l.useRef)(null),J=(0,s.TL)(),Q=(0,s.CG)(e=>{var t,r,n;return null!==(n=null===(r=e.auth)||void 0===r?void 0:null===(t=r.user)||void 0===t?void 0:t.uid)&&void 0!==n?n:null}),[X,ee]=(0,l.useState)(!1),[et,er]=(0,l.useState)(null),[en,el]=(0,l.useState)(""),[ei,ea]=(0,l.useState)(""),[es,eo]=(0,l.useState)(""),[ed,eu]=(0,l.useState)("TBD"),[ec,em]=(0,l.useState)(""),[ep,eg]=(0,l.useState)(""),[eh,ex]=(0,l.useState)([]),[ev,ef]=(0,l.useState)(""),[eb,ew]=(0,l.useState)(!1),[ey,eS]=(0,l.useState)(!1),[ek,eN]=(0,l.useState)(!0),[ej,eA]=(0,l.useState)(!1),[eC,eL]=(0,l.useState)([]),[eI,eM]=(0,l.useState)([]),eR=(0,l.useRef)([]);(0,l.useEffect)(()=>{eR.current=eI},[eI]);let eT=(e,t)=>{let r=(0,c.BE)(t);return r?e.findIndex(e=>(0,c.BE)(e.artistName)===r):-1},[e_,eE]=(0,l.useState)(""),[eU,eP]=(0,l.useState)(""),[eF,eD]=(0,l.useState)({}),[eB,eO]=(0,l.useState)(null),[ez,eG]=(0,l.useState)(""),[eV,eZ]=(0,l.useState)([]),[eH,e$]=(0,l.useState)(!1),[eW,eY]=(0,l.useState)(null),[eK,eq]=(0,l.useState)(null),[eJ,eQ]=(0,l.useState)([]),[eX,e0]=(0,l.useState)(!1),e5=(0,l.useRef)(!1),e1=(0,l.useRef)(!1),e2=(0,l.useRef)(null),[e4,e3]=(0,l.useState)(null);(0,l.useEffect)(()=>{var e,t,r,n,l,i,a,s,o,d,u,p,h,x,v,f,b,w;if(!m)return;let k=!1;e1.current=!1;let E=V||O;el((null==E?void 0:null===(e=E.form)||void 0===e?void 0:e.title)||(null==E?void 0:E.title)||""),ea((null==E?void 0:null===(t=E.form)||void 0===t?void 0:t.description)||(null==E?void 0:E.description)||""),eo((null==E?void 0:null===(r=E.form)||void 0===r?void 0:r.ticketing)||(null==E?void 0:E.ticketing)||""),eu((null==E?void 0:E.doorPrice)!=null&&(null==E?void 0:E.doorPrice)!==""?String(E.doorPrice):(null==E?void 0:null===(n=E.form)||void 0===n?void 0:n.doorPrice)!=null&&(null==E?void 0:null===(l=E.form)||void 0===l?void 0:l.doorPrice)!==""?String(E.form.doorPrice):"TBD"),ew((null==E?void 0:E.allAges)===!0||(null==E?void 0:null===(i=E.form)||void 0===i?void 0:i.allAges)===!0),eS((null==E?void 0:E.freeEntry)===!0||(null==E?void 0:E.isAccessibleForFree)===!0||(null==E?void 0:null===(a=E.form)||void 0===a?void 0:a.freeEntry)===!0);let U=null==E?void 0:E.hideSetListTimes,P=null==E?void 0:null===(s=E.form)||void 0===s?void 0:s.hideSetListTimes;eN(!0===U||!0===P||null==U&&null==P),em(function(e){if(!e)return"";let t=String(e).trim();if(!t)return"";if(/^\d{4}-\d{2}-\d{2}$/.test(t))return t;let r=S(t);if(null==r)return t;let n=new Date(r),l=e=>String(e).padStart(2,"0");return"".concat(n.getFullYear(),"-").concat(l(n.getMonth()+1),"-").concat(l(n.getDate()))}(function(e){let t=S(e);if(null==t)return"";let r=new Date(t);if(Number.isNaN(r.getTime()))return"";let n=e=>String(e).padStart(2,"0");return"".concat(r.getFullYear(),"-").concat(n(r.getMonth()+1),"-").concat(n(r.getDate()),"T").concat(n(r.getHours()),":").concat(n(r.getMinutes()))}((null==E?void 0:E.startDate)!=null?E.startDate:(null==E?void 0:E.date)!=null?E.date:null))),eg("string"==typeof(null==E?void 0:E.image)?E.image:""),ex((Array.isArray(null==E?void 0:E.tags)?E.tags:Array.isArray(null==E?void 0:null===(o=E.form)||void 0===o?void 0:o.tags)?E.form.tags:[]).map(e=>String(e).trim()).filter(Boolean)),eA((null==E?void 0:E.notLiveMusicEvent)===!0||(null==E?void 0:null===(d=E.form)||void 0===d?void 0:d.notLiveMusicEvent)===!0);let F=(0,c.dR)(null==E?void 0:E.audioLink),B=Array.isArray(null==E?void 0:E.artistList)?E.artistList.map(e=>{var t,r,n,l,i;if(!e)return null;if("string"==typeof e){let t=String(e).trim();return t?{setListRowId:(0,g.MD)(),name:t,bandcampStatus:j({name:t},F)}:null}let a=String(null!==(t=e.name)&&void 0!==t?t:"").trim();if(!a)return null;let s=D(e.time),o=String(null!==(r=e.artistId)&&void 0!==r?r:"").trim(),d={setListRowId:(0,g.MD)(),name:a,typedName:a,bandcampStatus:j(e,F)};
1s&&(d.time=s),o&&(d.artistId=o);let u=String(null!==(n=e.releaseTitle)&&void 0!==n?n:"").trim(),c=String(null!==(l=e.releaseArtworkThumbUrl)&&void 0!==l?l:"").trim(),m=String(null!==(i=e.releaseId)&&void 0!==i?i:"").trim();return u&&(d.releaseTitle=u),c&&(d.releaseArtworkThumbUrl=c),m&&(d.releaseId=m),d}).filter(Boolean):[],z="setlist"===$?function(e,t){if(!t||"object"!=typeof t)return e;let r=String(t.id||"").trim(),n=(0,y.kd)(t);if(!n||"Artist"===n)return e;let l=M(n);return e.some(e=>_(e,r,l))?e.map(e=>{if(!_(e,r,l))return e;let t={...e,time:function(e){let t=String(e||"").trim();return t&&t!==R?t:T}(e.time)};return r&&!String((null==e?void 0:e.artistId)||"").trim()&&(t.artistId=r),t}):[{setListRowId:(0,g.MD)(),name:n,typedName:n,...r?{artistId:r}:{},time:T,bandcampStatus:r?"artist_only":"pending"},...e]}(B,W):B;eL(z),eM(F),eE(""),eP(""),eD({}),eO(null),ef("");let G=String((null==L?void 0:L.name)||"").trim(),Z=String((null==L?void 0:L.address)||(null==L?void 0:null===(u=L.location)||void 0===u?void 0:u.address)||(null==L?void 0:L.venueAddress)||"").trim(),H=String((null==E?void 0:E.venueName)||(null==E?void 0:null===(p=E.location)||void 0===p?void 0:p.name)||G).trim(),Y=String((null==E?void 0:E.venueAddress)||(null==E?void 0:E.address)||(null==E?void 0:null===(x=E.location)||void 0===x?void 0:null===(h=x.address)||void 0===h?void 0:h.streetAddress)||Z).trim();eG(H||Y||G||""),eZ([]),e$(!1),eY(null),eQ([]),e0(!1),e3(null),e5.current=!1;let K=null!==(f=null==E?void 0:E.venueCoords)&&void 0!==f?f:null,q=null!==(b=null==E?void 0:E.locationGeo)&&void 0!==b?b:null,J="number"==typeof(null==K?void 0:K.lat)?K.lat:"number"==typeof(null==q?void 0:q.latitude)?q.latitude:null,Q="number"==typeof(null==K?void 0:K.lng)?K.lng:"number"==typeof(null==q?void 0:q.longitude)?q.longitude:null,X=(null==E?void 0:null===(v=E.location)||void 0===v?void 0:v.address)||{},ee=String(X.addressLocality||"").trim(),et=String(X.addressRegion||"").trim(),er=String((null==E?void 0:E.venueAddress)||X.streetAddress||Y||"").trim(),en=function(e){let t=String(e||"").trim().toUpperCase();return/^[A-Z]{2}$/.test(t)?t:"AUSTRALIA"===t?"AU":""}(X.addressCountry);if(null!=J&&null!=Q&&er&&ee&&et&&en){let e=String(H||(null==E?void 0:E.venueName)||(null==E?void 0:null===(w=E.location)||void 0===w?void 0:w.name)||er.split(",")[0]||"").trim()||ee;eq({placeId:null,formattedAddress:er,displayVenueName:e,lat:J,lng:Q,city:ee,state:et,country:en})}else eq(null);let ei=z.filter(e=>String(e.artistId||"").trim()&&!N(e));return ei.length>0&&(async()=>{let e=new Map,t=new Map;await Promise.all(ei.map(async r=>{let n=String(r.artistId||"").trim(),l=String(r.name||"").trim(),i=A(F,l),a=await I(n,i);a&&(e.set(String(r.setListRowId||""),a),a.listenUrl&&l&&!C(i)&&t.set(l,a.listenUrl))})),k||0===e.size||(eL(t=>t.map(t=>{let r=e.get(String(t.setListRowId||""));return r?{...t,bandcampStatus:r.listenUrl?"linked":t.bandcampStatus,releaseId:r.releaseId,releaseTitle:r.releaseTitle,releaseArtworkThumbUrl:r.releaseArtworkThumbUrl}:t})),0!==t.size&&eM(e=>{let r=[...e];for(let[e,n]of t){let t=r.findIndex(t=>(0,c.BE)(t.artistName)===(0,c.BE)(e));t>=0?r[t]={artistName:e,newLink:n}:r=[...r,{artistName:e,newLink:n}]}return eR.current=r,r}))})(),()=>{k=!0}},[m,O,null==V?void 0:V.id,$,W]),(0,l.useEffect)(()=>{if(!m||!Z)return;let e=String(ez||"").trim();if(eK&&e===String(eK.formattedAddress||"").trim()||e.length<2){eZ([]),e$(!1);return}let t=!1,r=setTimeout(()=>{e$(!0),(async()=>{let r=await (0,u.Po)(e);t||(eZ(r),e$(!1))})()},180);return()=>{t=!0,clearTimeout(r)}},[m,Z,ez,eK]),(0,l.useEffect)(()=>{if(!m||!Z||null!=eW)return;if(e5.current){e5.current=!1;return}let e=String(ez||"").trim();if(eK&&e===String(eK.formattedAddress||"").trim()||e.length<3){eQ([]),e0(!1);return}let t=!1,r=setTimeout(()=>{e0(!0),(async()=>{try{let r=new URLSearchParams({input:e}),n=await fetch("/api/places/autocomplete?".concat(r.toString())),l=await n.json().catch(()=>({}));if(t)return;if(!n.ok){eQ([]),503!==n.status||"string"!=typeof(null==l?void 0:l.error)||e1.current||(e1.current=!0,J((0,o.CF)({message:"Address suggestions need a Google Places API key on the server (ADDRESS_SEARCH_GOOGLE_API_KEY / GOOGLE_MAPS_API_KEY, Places enabled).",type:"error"})));return}let i=l.predictions||[];eQ(i)}catch(e){t||eQ([])}finally{t||e0(!1)}})()},260);return()=>{t=!0,clearTimeout(r)}},[m,Z,eW,ez,eK,J]);let e9=null!=eW,e6=!!eK&&""!==String(ez||"").trim()&&String(ez||"").trim()===String(eK.formattedAddress||"").trim(),e7=m&&Z&&!e9&&!e6&&(eV.length>0||eJ.length>0||eH||eX);if((0,w.L)(()=>
1{if(!e7||!e2.current){e3(null);return}let e=()=>{let e=e2.current;if(!e)return;let t=e.getBoundingClientRect(),r=Math.max(120,window.innerHeight-t.bottom-24);e3({top:t.bottom+6,left:t.left,width:Math.max(280,t.width),maxHeight:Math.min(340,r)})};return e(),window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e)}},[e7,ez,eV.length,eJ.length,eH,eX]),!m)return null;let e8=String((null==eW?void 0:eW.name)||(null==eK?void 0:eK.displayVenueName)||ez||(null==L?void 0:L.name)||"One-off Venue").trim()||"One-off venue",te=G||V?"edit":"create",tt="setlist"===$,tr=tt?String((null==V?void 0:null===(t=V.form)||void 0===t?void 0:t.title)||(null==V?void 0:V.title)||(null==V?void 0:V.venueName)||"").trim():e8,tn=async e=>{e5.current=!0,eZ([]),e$(!1),eQ([]),e0(!0);try{let t=new URLSearchParams({placeId:e}),r=await fetch("/api/places/details?".concat(t.toString())),n=await r.json().catch(()=>({}));if(!r.ok){J((0,o.CF)({message:"string"==typeof(null==n?void 0:n.error)?n.error:"Address lookup failed.",type:"error"})),eq(null);return}let l="number"==typeof n.latitude?n.latitude:null,i="number"==typeof n.longitude?n.longitude:null,a=String(n.city||n.locality||"").trim(),s=String(n.state||"").trim(),d=String(n.country||"").trim(),u=String(n.formattedAddress||"").trim();if(!u){J((0,o.CF)({message:"Incomplete address returned — pick another suggestion.",type:"error"})),eq(null);return}if(null==l||null==i){J((0,o.CF)({message:"That place has no coordinates — choose another suggestion.",type:"error"})),eq(null);return}if(!d||!s||!a){J((0,o.CF)({message:"Address needs suburb/city, state and country — try another suggestion.",type:"error"})),eq(null);return}if(!/^[A-Z]{2}$/i.test(d)){J((0,o.CF)({message:"Could not resolve a country code — try another suggestion.",type:"error"})),eq(null);return}let c=d.toUpperCase(),m=String(n.placeDisplayName||n.name||"").trim()||u.split(",")[0].trim()||a;eG(u),eq({placeId:String(n.placeId||e||""),formattedAddress:u,displayVenueName:m,lat:l,lng:i,city:a,state:s,country:c}),eZ([]),e$(!1),eQ([])}catch(e){console.error("[eventForm] place details:",e),J((0,o.CF)({message:"Could not load that address.",type:"error"})),eq(null)}finally{e0(!1)}},tl=Z&&e4&&e7&&"undefined"!=typeof document?(0,i.createPortal)((0,n.jsxs)("div",{role:"listbox","aria-label":"Venue and address suggestions",className:"fixed z-[220] overflow-y-auto rounded-xl border border-white/10 bg-[#1a1a1a] shadow-2xl",style:{top:e4.top,left:e4.left,width:e4.width,maxHeight:e4.maxHeight},children:[eH?(0,n.jsx)("div",{className:"flex items-center border-b border-white/5 px-3 py-2.5",children:(0,n.jsx)(a.Z,{label:"Searching Otowah Registered Venues…"})}):null,eV.length>0?(0,n.jsx)("div",{className:"sticky top-0 z-[1] border-b border-white/10 bg-[#232323] px-3 py-1.5 text-[10px] font-semibold uppercase tracking-wide text-[var(--vivace-neon-blue,#55ffe1)]",children:"Otowah Registered Venues"}):null,eV.map(e=>(0,n.jsxs)("button",{type:"button",role:"option",onMouseDown:e=>e.preventDefault(),onClick:()=>{eY(e),eG(e.name||""),eq(null),eZ([]),eQ([])},className:"block w-full border-0 border-b border-white/5 px-3 py-2.5 text-left hover:bg-white/5",children:[(0,n.jsx)("p",{className:"text-sm font-medium text-white",children:e.name}),!0===e.venueInactiveListed?(0,n.jsx)("p",{className:"text-[11px] font-medium text-amber-300/95 mt-0.5",children:"Inactive on Otowah — you can still attach this event"}):null,(0,n.jsx)("p",{className:"text-xs text-white/55",children:e.address||"No address on file"})]},e.id)),(eV.length>0||eH)&&(eJ.length>0||eX)?(0,n.jsx)("div",{className:"h-px shrink-0 bg-white/15","aria-hidden":!0}):null,eJ.length>0||eX?(0,n.jsxs)("div",{className:"sticky top-0 z-[1] space-y-1 border-b border-white/10 bg-[#232323] px-3 py-2 text-[10px] text-white/55",children:[(0,n.jsx)("span",{className:"block font-semibold uppercase leading-snug tracking-wide",children:"Temporary venue (Google) — tap to verify"}),(0,n.jsx)("span",{className:"block text-[11px] font-normal normal-case tracking-normal leading-relaxed text-white/42",children:"For this event only—not a permanent Otowah venue. Register the venue on Otowah when it exists in the directory."})]}):null,eX&&0===eJ.length?(0,n.jsx)("div",{className:"flex items-center border-b border-white/5 px-3 py-2.5",children:(0,n.jsx)(a.Z,{label:"Loading venue suggestions…"})}):null,eJ.map(e=>(0,n.jsxs)("button",{type:"button",role:"option",onMouseDown:e=>e.preventDefault(),onClick:()=>void tn(e.placeId),className:"block w-full border-0 border-b border-white/5 px-3 py-2.5 text-left hover:bg-white/5",children:[(0,n.jsx)("p",{className:"text-sm font-medium text-white",children:e.mainText||e.description}),e.secondaryText?(0,n.jsx)("p",{className:"text-xs text-white/50",children:e.secondaryText}):null]},e.placeId))]}),document.body):null,ti=()=>{var e;null===(e=q.current)||void 0===e||e.click()},ta=!Z||e9||!!eK&&"number"==typeof eK.lat&&"number"==typeof eK.lng&&/^[A-Z]{2}$/.test(String(eK.country||"").trim().toUpperCase())&&String(eK.state||"").trim().length>
10&&String(eK.city||"").trim().length>0,ts="setlist"===$?eC.length>0:String(en||"").trim().length>0&&null!=k(ec)&&String(ep||"").trim().length>0&&ta,to=async()=>{let e;if("setlist"===$){if(0===eC.length){J((0,o.CF)({message:"Add at least one act to the set list.",type:"error"}));return}let e=(0,c.dR)(eR.current);ee(!0),er(x("edit",{audioLink:e}));let t=e=>{try{er(v(e))}catch(e){console.warn("[eventForm] progress update failed:",(null==e?void 0:e.message)||e)}};try{await Promise.resolve(null==z?void 0:z({artistList:eC,audioLink:e,hideSetListTimes:ek},{reportProgress:t})),t({stage:"complete"}),await new Promise(e=>setTimeout(e,450)),er(null),null==f||f()}catch(e){throw console.error("[eventForm] set-list save failed:",e),t({stage:"error",errorMessage:e instanceof Error?e.message:"Could not save set list."}),await new Promise(e=>setTimeout(e,2200)),er(null),e}finally{ee(!1)}return}let t=String(en||"").trim(),r=k(ec),n=String(ep||"").trim();if(!t){J((0,o.CF)({message:"Add an event title.",type:"error"}));return}if(null==r){J((0,o.CF)({message:"Pick an event date.",type:"error"}));return}if(!n){J((0,o.CF)({message:"Add an event image.",type:"error"}));return}if(Z&&!e9&&!(eK&&"number"==typeof eK.lat&&"number"==typeof eK.lng&&/^[A-Z]{2}$/.test(String(eK.country||"").trim().toUpperCase())&&String(eK.state||"").trim().length>0&&String(eK.city||"").trim().length>0)){J((0,o.CF)({message:"Pick an Otowah venue from the list or tap a Google address (list appears near the bottom of your screen — scroll there if you don’t see it).",type:"error"}));return}let l=String((null==eW?void 0:eW.name)||(null==eK?void 0:eK.displayVenueName)||String(ez||"").trim().split(",")[0].trim()||"").trim(),i=String((null==eW?void 0:eW.address)||(null==eK?void 0:eK.formattedAddress)||"").trim(),a=(null==eW?void 0:eW.location)||{},s=(null==eW?void 0:eW.coords)||{},u="number"==typeof s.lat?s.lat:"number"==typeof a.latitude?a.latitude:null,m="number"==typeof s.lng?s.lng:"number"==typeof a.longitude?a.longitude:null;if(Z||!L){if(eW){var p,g;e={...L||{},id:eW.id,active:eW.active,capacity:eW.capacity,country:eW.country||"",state:eW.state||"",coords:null!=u&&null!=m?{lat:Number(u),lng:Number(m)}:(null==L?void 0:L.coords)||null,name:eW.name||l||(null==L?void 0:L.name)||"One-off venue",address:eW.address||i||(null==L?void 0:L.address)||(null==L?void 0:null===(p=L.location)||void 0===p?void 0:p.address)||"",location:{...(null==L?void 0:L.location)||{},...eW.location||{},address:eW.address||i||(null==L?void 0:null===(g=L.location)||void 0===g?void 0:g.address)||(null==L?void 0:L.address)||""}}}else e={...L||{},name:l||(null==L?void 0:L.name)||"One-off venue",address:eK.formattedAddress,country:eK.country,state:eK.state,coords:{lat:eK.lat,lng:eK.lng},location:{...(null==L?void 0:L.location)||{},address:eK.formattedAddress,city:eK.city,state:eK.state,country:eK.country,latitude:eK.lat,longitude:eK.lng}}}else e=L;let h=(null==eW?void 0:eW.id)||(Z||!B?function(e,t){let r=String(e||"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,40),n=String(t||"anon").trim().replace(/[^a-zA-Z0-9_-]/g,"").slice(0,24);return"external_".concat(r||"one-off","_").concat(n||"anon")}(l||(null==e?void 0:e.name),Q):B),b=String((null==V?void 0:V.source)||"").trim(),w="edit"===te?b||H||"manual":Z?eW?"manual":"manual_no_venue":H,y=(0,d.h)({title:en,description:ei,ticketing:es,doorPrice:ed,startDateMs:r,image:ep,tags:eh,allAges:eb,freeEntry:ey,hideSetListTimes:ek,notLiveMusicEvent:ej,artistList:eC,audioLink:(0,c.dR)(eR.current),source:w,reviewed:!0,venue:e,venueId:h,uid:Q});ee(!0),er(x("edit"===te?"edit":"create",{image:ep,audioLink:(0,c.dR)(eR.current)}));let S=e=>{try{er(v(e))}catch(e){console.warn("[eventForm] progress update failed:",(null==e?void 0:e.message)||e)}};try{await Promise.resolve(null==z?void 0:z(y,{reportProgress:S})),S({stage:"complete"}),await new Promise(e=>setTimeout(e,450)),er(null),null==f||f()}catch(e){throw console.error("[eventForm] save/update failed:",e),S({stage:"error",errorMessage:e instanceof Error?e.message:"Could not save event."}),await new Promise(e=>setTimeout(e,2200)),er(null),e}finally{ee(!1)}},td=()=>{let e=String(ev||"").trim();if(e){if(eh.some(t=>t.toLowerCase()===e.toLowerCase())){ef("");return}ex([...eh,e]),ef("")}},tu=e=>{ex(eh.filter(t=>t!==e))},tc=(e,t)=>{let r=String(e||"").trim();r&&eL(e=>e.map(e=>String(e.setListRowId||"")===r?{...e,...t}:e))},tm=(e,t)=>
1{let r=String(t||"").trim();eM(t=>{let n;let l=eT(t,e);if(r)l>=0?(n=[...t])[l]={artistName:e,newLink:r}:n=[...t,{artistName:e,newLink:r}];else{if(l<0)return t;n=t.filter(t=>(0,c.BE)(t.artistName)!==(0,c.BE)(e))}return eR.current=n,n})},tp=(e,t,r)=>{e&&r&&(tc(e,{bandcampStatus:r.listenUrl?"linked":"artist_only",releaseId:r.releaseId,releaseTitle:r.releaseTitle,releaseArtworkThumbUrl:r.releaseArtworkThumbUrl}),r.listenUrl&&t&&!C(A(eR.current,t))&&tm(t,r.listenUrl))},tg=function(e){var t;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"artist",n=String((null==e?void 0:e.setListRowId)||"").trim();if(!n)return;let l=String((null==e?void 0:e.name)||"").trim(),i=String((null==e?void 0:e.typedName)||(null==e?void 0:e.name)||"").trim(),a=String((null==e?void 0:e.artistId)||"").trim(),s=null===(t=eF[n])||void 0===t?void 0:t.selectedArtist,o=!!N(e),d=s||(a?{key:"otowah:".concat(a),source:"otowah",name:l,location:"",thumbUrl:"",firestoreArtistId:a,score:1}:void 0);eO({setListRowId:n,step:("album"===r||o)&&d?"album":"artist",typedName:i,actName:l,...d?{selectedArtist:d}:{}})},th=()=>{let e=String(e_||"").trim();if(!e){J((0,o.CF)({message:"Enter an act name.",type:"info"}));return}if(eC.some(t=>String(t.name||"").toLowerCase()===e.toLowerCase())){J((0,o.CF)({message:'"'.concat(e,'" is already on the set list.'),type:"info"})),eE(""),eP("");return}let t=D(String(eU||"").trim())||R,r=(0,g.MD)(),n={setListRowId:r,name:e,typedName:e,time:t,bandcampStatus:"pending"};eL(e=>[...e,n]),eh.some(t=>t.toLowerCase()===e.toLowerCase())||ex([...eh,e]),eE(""),eP(""),eO({setListRowId:r,step:"artist",typedName:e,actName:e})},tx=e=>{let t=String(e||"").trim(),r=eC.find(e=>String(e.setListRowId||"")===t),n=String((null==r?void 0:r.name)||"").trim();eL(eC.filter(e=>String(e.setListRowId||"")!==t)),n&&eM(e=>e.filter(e=>(0,c.BE)(e.artistName)!==(0,c.BE)(n))),eD(e=>{if(!t||!e[t])return e;let r={...e};return delete r[t],r}),(null==eB?void 0:eB.setListRowId)===t&&eO(null)},tv=(e,t,r)=>{let n=String(e||"").trim(),l=eC.find(e=>String(e.setListRowId||"")===n);if(!l)return;let i=String(l.name||"").trim(),a=String(t||"").trim(),s=String(r||"").trim();if(a&&(eL(eC.map(e=>{var t;if(String(e.setListRowId||"")!==n)return e;let r=String(null!==(t=e.artistId)&&void 0!==t?t:"").trim(),l={...e,name:a,...s?{time:s}:{}};return r&&(l.artistId=r),l})),i!==a)){eM(e=>e.map(e=>(0,c.BE)(e.artistName)===(0,c.BE)(i)?{...e,artistName:a}:e));let e=eh.filter(e=>e!==i);e.some(e=>e.toLowerCase()===a.toLowerCase())||e.push(a),ex(e)}},tf=[...eC].sort((e,t)=>{let r=String((null==e?void 0:e.time)||"").trim(),n=String((null==t?void 0:t.time)||"").trim();return r||n?r?n?n.localeCompare(r):-1:1:0}),tb=!!e_.trim(),tw=(null==eB?void 0:eB.selectedArtist)||((null==eB?void 0:eB.setListRowId)?null===(r=eF[eB.setListRowId])||void 0===r?void 0:r.selectedArtist:null)||null,ty=()=>{X||null==f||f()};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(b,{progress:et}),(0,n.jsxs)("div",{className:"fixed inset-0 z-[110] flex items-center justify-center p-4 sm:p-6",role:"dialog","aria-modal":"true","aria-labelledby":K,children:[(0,n.jsx)("button",{type:"button",className:"absolute inset-0 bg-black/80 border-0 cursor-default","aria-label":"Close",onClick:ty}),(0,n.jsxs)("div",{className:"relative w-full max-w-2xl max-h-[92vh] overflow-y-auto rounded-2xl border border-white/10 shadow-2xl",style:{backgroundColor:"#141414"},onClick:e=>e.stopPropagation(),children:[(0,n.jsxs)("div",{className:"sticky top-0 z-10 flex items-start justify-between gap-3 px-5 pt-5 pb-3 border-b border-white/10 bg-[#141414]",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h2",{id:K,className:"text-xl font-semibold text-white tracking-tight",children:tt?"Set list":"edit"===te?"Edit event":"New event"}),(0,n.jsx)("p",{className:"text-sm text-white/55 mt-0.5",children:tr})]}),(0,n.jsx)("button",{type:"button",onClick:ty,disabled:X,className:"shrink-0 rounded-full p-2 text-white/70 hover:bg-white/10 hover:text-white transition-colors disabled:opacity-40 disabled:cursor-not-allowed","aria-label":"Close form",children:(0,n.jsx)("svg",{className:"w-5 h-5",viewBox:"0 0 24 24",fill:"
1currentColor",children:(0,n.jsx)("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})})})]}),(0,n.jsxs)("div",{className:"px-5 py-5 space-y-5",children:[tt?(0,n.jsx)("p",{className:"text-sm text-white/55 leading-relaxed",children:"Add the set list for this event and link each artist. That confirms this band is on the bill and helps the other acts find the gig too."}):(0,n.jsxs)(n.Fragment,{children:[Z?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("label",{className:"block space-y-1.5",children:[(0,n.jsxs)("span",{className:"text-xs font-medium text-white/55 uppercase tracking-wide",children:["Venue / address"," ",e9?"(Otowah venue selected)":"— Otowah or Google suggestion"]}),(0,n.jsxs)("div",{ref:e2,className:"relative",children:[(0,n.jsx)("input",{type:"text",value:ez,onChange:e=>{eG(e.target.value),eY(null),eq(null)},"aria-busy":eH||eX,className:"w-full rounded-xl bg-black/40 border border-white/10 py-2.5 text-sm text-white placeholder:text-white/35 focus:outline-none focus:ring-2 focus:ring-[var(--vivace-neon-blue,#55ffe1)]/50 ".concat(eH||eX?"pl-3 pr-[7.75rem] sm:pr-52":"px-3"),placeholder:"Venue name, suburb, street, or postcode…",autoComplete:"off"}),eH||eX?(0,n.jsx)("div",{className:"pointer-events-none absolute right-2.5 top-1/2 -translate-y-1/2",children:(0,n.jsx)(a.Z,{compact:!0,label:eH&&eX?"Searching venues & maps…":eH?"Searching venues…":"Loading addresses…"})}):eK&&String(eK.formattedAddress||"").trim()===String(ez||"").trim()?(0,n.jsx)("span",{className:"pointer-events-none absolute right-3 top-1/2 -translate-y-1/2 text-[11px] text-[var(--vivace-neon-green,#a7fa41)]/85",children:"Verified (temporary)"}):null]}),(0,n.jsxs)("p",{className:"text-xs text-white/45 leading-relaxed",children:["Look up Otowah Registered Venues first, including inactive ones (they appear with a label). If you don't see a match, pick a Google address to post a"," ",(0,n.jsx)("span",{className:"text-white/60",children:"one-off event"})," at that location. Tap a row in the floating list below the field."]})]}),tl]}):null,ep?(0,n.jsxs)("button",{type:"button",onClick:ti,className:"w-full rounded-xl overflow-hidden border border-white/10 bg-black/40 aspect-[16/9] max-h-56 relative group text-left",children:[(0,n.jsx)("img",{src:ep,alt:"",className:"w-full h-full object-cover"}),(0,n.jsx)("span",{className:"absolute bottom-2 right-2 rounded-full bg-black/70 px-3 py-1 text-xs text-white/90 group-hover:bg-black/80",children:"Change image"})]}):(0,n.jsx)("button",{type:"button",onClick:ti,className:"w-full rounded-xl border border-dashed border-white/25 bg-black/30 px-4 py-8 text-sm text-white/70 hover:bg-black/40",children:(0,n.jsxs)("span",{className:"flex flex-col items-center justify-center gap-2",children:[(0,n.jsxs)("svg",{className:"h-7 w-7 text-white/45",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,n.jsx)("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2",ry:"2"}),(0,n.jsx)("circle",{cx:"9",cy:"10",r:"1.6"}),(0,n.jsx)("path",{d:"M21 15l-4.5-4.5L7 20"})]}),(0,n.jsx)("span",{children:"Add image"})]})}),(0,n.jsx)("input",{ref:q,type:"file",accept:"image/*",onChange:e=>{var t;let r=null===(t=e.target.files)||void 0===t?void 0:t[0];if(!r)return;let n=new FileReader;n.onload=()=>{"string"==typeof n.result&&eg(n.result)},n.readAsDataURL(r),e.target.value=""},className:"hidden"}),(0,n.jsxs)("label",{className:"block space-y-1.5",children:[(0,n.jsx)("span",{className:"text-xs font-medium text-white/55 uppercase tracking-wide",children:"Title"}),(0,n.jsx)("input",{type:"text",value:en,onChange:e=>el(e.target.value),className:"w-full rounded-xl bg-black/40 border border-white/10 px-3 py-2.5 text-sm text-white placeholder:text-white/35 focus:outline-none focus:ring-2 focus:ring-[var(--vivace-neon-blue,#55ffe1)]/50",placeholder:"Event name"})]}),(0,n.jsxs)("label",{className:"block space-y-1.5",children:[(0,n.jsx)("span",{className:"text-xs font-medium text-white/55 uppercase tracking-wide",children:"Date & time"}),(0,n.jsx)("input",{type:"date",value:ec,onChange:e=>em(e.target.value),className:"w-full rounded-xl bg-black/40 border border-white/10 px-3 py-2.5 text-sm text-white [color-scheme:dark] focus:outline-none focus:ring-2 focus:ring-[var(--vivace-neon-blue,#55ffe1)]/50 [&::-webkit-calendar-picker-indicator]:cursor-pointer [&::-webkit-calendar-picker-indicator]:opacity-95 [&::-webkit-calendar-picker-indicator]:[filter:invert(72%)_brightness(1.1)] [&::-moz-calendar-picker-indicator]:cursor-pointer [&::-moz-calendar-picker-indicator]:opacity-95 [&::-moz-calendar-picker-indicator]:[filter:invert(72%)_brightness(1.1)]"})]}),(0,n.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,n.jsxs)("label",{className:"block space-y-1.5",children:[(0,n.jsx)("span",{className:"text-xs font-medium text-white/55 uppercase tracking-wide",children:"Door price"}),(0,n.jsx)("input",{type:"text",value:ed,onChange:e=>eu(e.target.value),className:"w-full rounded-xl bg-black/40 border border-white/10 px-3 py-2.5 text-sm text-white placeholder:text-white/35 focus:outline-none focus:ring-2 focus:ring-[var(--vivace-neon-blue,#55ffe1)]/50",placeholder:"TBD"})]}),(0,n.jsxs)("label",{className:"block space-y-1.5",children:[(0,n.jsx)("span",{className:"text-xs font-medium text-white/55 uppercase tracking-wide",children:"Ticketing URL"}),(0,n.jsx)("input",{type:"url",value:es,onChange:e=>eo(e.target.value),className:"w-full rounded-xl bg-black/40 border border-white/10 px-3 py-2.5 text-sm text-white placeholder:text-white/35 focus:outline-none focus:ring-2 focus:ring-[var(--vivace-neon-blue,#55ffe1)]/50",placeholder:"https://…",autoCapitalize:"none"})]})]}),(0,n.jsxs)("label",{className:"block space-y-1.5",children:[(0,n.jsx)("span",{className:"text-xs font-medium text-white/55 uppercase tracking-wide",children:"Description"}),(0,n.jsx)("textarea",{value:ei,onChange:e=>ea(e.target.value),rows:6,className:"w-full rounded-xl bg-black/40 border border-white/10 px-3 py-2.5 text-sm text-white placeholder:text-white/35 focus:outline-none focus:ring-2 focus:ring-[var(--vivace-neon-blue,#55ffe1)]/50 resize-y min-h-[120px]",placeholder:"Tell people about the show…"})]})]}),(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{className:"text-xs font-medium text-white/55 uppercase tracking-wide",children:"Set List"}),(0,n.jsxs)("p",{className:"mt-1.5 text-xs text-white/45 leading-relaxed",children:["Optional set time per act. Use Bandcamp album or track URLs only (",(0,n.jsx)("span",{className:"text-white/55",children:"…/album/… or …/track/…"}),") — the page needs playable audio. Press + to add; edit or remove in the list below."]})]}),(0,n.jsxs)("div",{className:"rounded-xl border border-[var(--vivace-neon-blue,#55ffe1)]/35 bg-black/45 p-3 shadow-[inset_0_1px_0_0_rgba(255,255,255,0.06)] space-y-2",children:[(0,n.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-[var(--vivace-neon-blue,#55ffe1)]/90",children:"Add an act"}),(0,n.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-[auto_minmax(0,1fr)_auto]",children:[(0,n.jsx)("div",{className:"rounded-xl bg-black/40 border border-white/10 px-2 py-1.5 flex items-center gap-1.5 w-fit max-w-full sm:max-w-none",children:(()=>{let e=P(eU||R);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("select",{value:e.hour,onCh
1ange:t=>eP(F(t.target.value,e.minute,e.period)),className:"bg-transparent text-sm text-white focus:outline-none",children:E.map(e=>(0,n.jsx)("option",{value:e,children:e},e))}),(0,n.jsx)("span",{className:"text-white/60 text-xs",children:":"}),(0,n.jsx)("select",{value:e.minute,onChange:t=>eP(F(e.hour,t.target.value,e.period)),className:"bg-transparent text-sm text-white focus:outline-none",children:U.map(e=>(0,n.jsx)("option",{value:e,children:e},e))}),(0,n.jsxs)("select",{value:e.period,onChange:t=>eP(F(e.hour,e.minute,t.target.value)),className:"bg-transparent text-sm text-white focus:outline-none",children:[(0,n.jsx)("option",{value:"AM",children:"AM"}),(0,n.jsx)("option",{value:"PM",children:"PM"})]})]})})()}),(0,n.jsx)("input",{type:"text",value:e_,onChange:e=>eE(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),th())},className:"rounded-xl bg-black/40 border border-white/10 px-3 py-2.5 text-sm text-white placeholder:text-white/35 focus:outline-none focus:ring-2 focus:ring-[var(--vivace-neon-blue,#55ffe1)]/50",placeholder:"Artist / act name"}),(0,n.jsx)("button",{type:"button",onClick:th,disabled:!tb,className:"".concat(Y," justify-self-end sm:justify-self-auto disabled:opacity-60 disabled:cursor-not-allowed"),style:{backgroundColor:tb?"var(--vivace-neon-blue,#55ffe1)":"rgba(255,255,255,0.25)"},"aria-label":"Add artist to set list",children:"+"})]}),(0,n.jsx)("p",{className:"text-[10px] text-white/35 leading-snug pl-0.5",children:"After you add an act, we'll search Otowah and Bandcamp so you can link music — or skip to keep the name only."})]}),eC.length>0?(0,n.jsxs)("div",{className:"space-y-2.5 pt-2 border-t border-white/12",children:[(0,n.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-white/60",children:"saved set list"}),(0,n.jsx)("div",{className:"space-y-2",children:tf.map(e=>{let t=String(e.setListRowId||"").trim()||e.name,r=e.bandcampStatus||j(e,eI),l=function(e){switch(e){case"linked":return"text-emerald-300/90 border-emerald-400/35 bg-emerald-950/30";case"artist_only":return"text-sky-300/90 border-sky-400/35 bg-sky-950/30";case"skipped":return"text-white/45 border-white/15 bg-white/[0.03]";default:return"text-amber-200/90 border-amber-400/35 bg-amber-950/25"}}(r),i=N(e);return(0,n.jsxs)("div",{className:"rounded-xl border border-white/[0.14] bg-white/[0.04] px-3 py-2.5 shadow-[inset_0_1px_0_0_rgba(255,255,255,0.05)] border-l-[3px] border-l-white/25",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,n.jsxs)("div",{className:"min-w-0 flex-1 grid grid-cols-1 sm:grid-cols-[auto_minmax(0,1fr)] gap-2",children:[(()=>{let t=P(e.time||R);return(0,n.jsxs)("div",{className:"rounded-lg bg-black/35 border border-white/10 px-2 py-1.5 flex items-center gap-1.5 w-fit max-w-full sm:max-w-none",children:[(0,n.jsx)("select",{value:t.hour,onChange:r=>tv(e.setListRowId,e.name,F(r.target.value,t.minute,t.period)),className:"bg-transparent text-sm text-white focus:outline-none",children:E.map(e=>(0,n.jsx)("option",{value:e,children:e},e))}),(0,n.jsx)("span",{className:"text-white/60 text-xs",children:":"}),(0,n.jsx)("select",{value:t.minute,onChange:r=>tv(e.setListRowId,e.name,F(t.hour,r.target.value,t.period)),className:"bg-transparent text-sm text-white focus:outline-none",children:U.map(e=>(0,n.jsx)("option",{value:e,children:e},e))}),(0,n.jsxs)("select",{value:t.period,onChange:r=>tv(e.setListRowId,e.name,F(t.hour,t.minute,r.target.value)),className:"bg-transparent text-sm text-white focus:outline-none",children:[(0,n.jsx)("option",{value:"AM",children:"AM"}),(0,n.jsx)("option",{value:"PM",children:"PM"})]})]})})(),(0,n.jsx)("input",{type:"text",value:e.name,onChange:t=>tv(e.setListRowId,t.target.value,e.time||R),className:"rounded-lg bg-black/35 border border-white/10 px-2.5 py-2 text-sm text-white placeholder:text-white/35 focus:outline-none focus:ring-2 focus:ring-[var(--vivace-neon-blue,#55ffe1)]/50",placeholder:"Artist name"})]}),(0,n.jsx)("button",{type:"button",onClick:()=>tx(e.setListRowId),className:"text-xs text-white/70 hover:text-white","aria-label":"Remove ".concat(e.name),children:"x"})]}),(0,n.jsxs)("div",{className:"mt-2 flex items-center justify-between gap-2",children:[(0,n.jsx)("button",{type:"button",onClick:()=>tg(e,"artist"),className:"font-medium transition hover:opacity-90 ".concat(i?"inline-flex items-center gap-2 max-w-[min(100%,18rem)] pl-1.5 pr-3 py-1.5 text-xs rounded-lg bg-white/10 text-white/85":"text-[11px] px-2.5 py-1 rounded-full border ".concat(l)),children:i?(0,n.jsxs)(n.Fragment,{children:[i.art?(0,n.jsx)("span",{className:"h-10 w-10 shrink-0 rounded-md overflow-hidden bg-black/25",children:(0,n.jsx)(p.Z,{url:i.art,className:"h-full w-full object-cover",hidePlaceholder:!0})}):null,i.title?(0,n.jsx)("span",{className:"truncate text-left",children:i.title}):null]}):function(e){switch(e){case"linked":return"Album linked";case"artist_only":return"Artist only";case"skipped":return"Skipped";default:return"Add Music Link"}}(r)}),"pending"===r?(0,n.jsx)("span",{className:"text-[10px] text-white/40",children:"Optional — tap to add a link"}):null]})]},t)})})]}):null]}),tt?null:(0,n.jsxs)("label",{className:"block space-y-1.5",children:[(0,n.jsx)("span",{className:"text-xs font-medium text-white/55 uppercase tracking-wide",children:"Tags"}),(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("input",{type:"text",value:ev,onChange:e=>ef(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),td())},className:"flex-1 rounded-xl bg-black/40 border border-white/10 px-3 py-2.5 text-sm text-white placeholder:text-white/35 focus:outline-none focus:ring-2 focus:ring-[var(--vivace-neon-blue,#55ffe1)]/50",placeholder:"Add a tag"}),(0,n.jsx)("button",{type:"button",onClick:td,disabled:!ev.trim(),className:"".concat(Y," disabled:opacity-60 disabled:cursor-not-allowed"),style:{backgroundColor:ev.trim()?"var(--vivace-neon-blue,#55ffe1)":"rgba(255,255,255,0.25)"},"aria-label":"Add tag",children:"+"})]}),eh.length>0?(0,n.jsx)("div",{className:"pt-2 flex flex-wrap gap-2",children:eh.map(e=>(0,n.jsxs)("span",{className:"inline-flex items-center gap-1.5 rounded-full border border-white/15 bg-black/35 px-3 py-1.5 text-xs text-white/90",children:[e,(0,n.jsx)("button",{type:"button",onClick:()=>tu(e),className:"text-white/65 hover:text-white text-xs leading-none","aria-label":"Remove ".concat(e),children:"x"})]},e))}):null]}),tt?null:(0,n.jsx)("p",{className:"text-xs text-white/40 pt-1",children:"Artists, tags, and publishing will hook up here next. Form state is local for now — close when you're done drafting."}),(0,n.jsxs)("div",{className:"space-y-2 pt-1",children:[(0,n.jsx)("p",{className:"text-xs font-medium text-white/55 uppercase tracking-wide",children:"Options"}),tt?null:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("label",{className:"flex items-center justify-between rounded-xl border border-white/10 bg-black/25 px-3 py-2.5",children:[(0,n.jsx)("span",{className:"text-sm text-white/85",children:"All Ages Show"}),(0,n.jsx)("input",{type:"checkbox",checked:eb,onChange:e=>
1ew(e.target.checked),className:"h-4 w-4 rounded border border-white/40 bg-black accent-black"})]}),(0,n.jsxs)("label",{className:"flex items-center justify-between rounded-xl border border-white/10 bg-black/25 px-3 py-2.5",children:[(0,n.jsx)("span",{className:"text-sm text-white/85",children:"Free Entry"}),(0,n.jsx)("input",{type:"checkbox",checked:ey,onChange:e=>{let t=e.target.checked;eS(t),t&&eu("0")},className:"h-4 w-4 rounded border border-white/40 bg-black accent-black"})]})]}),(0,n.jsxs)("label",{className:"flex items-center justify-between rounded-xl border border-white/10 bg-black/25 px-3 py-2.5",children:[(0,n.jsx)("span",{className:"text-sm text-white/85",children:"Hide Set List Time"}),(0,n.jsx)("input",{type:"checkbox",checked:ek,onChange:e=>eN(e.target.checked),className:"h-4 w-4 rounded border border-white/40 bg-black accent-black"})]}),tt?null:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("label",{className:"flex items-center justify-between rounded-xl border border-white/10 bg-black/25 px-3 py-2.5",children:[(0,n.jsx)("span",{className:"text-sm text-white/85",children:"Not Live Music Event"}),(0,n.jsx)("input",{type:"checkbox",checked:ej,onChange:e=>eA(e.target.checked),className:"h-4 w-4 rounded border border-white/40 bg-black accent-black"})]}),(0,n.jsx)("p",{className:"text-xs text-white/50 px-1 -mt-1",children:"Use this for non-music venue events like comedy, bingo, trivia, karaoke, or community nights."})]})]}),(0,n.jsx)("div",{className:"flex flex-col items-end gap-1.5 pt-2",children:(0,n.jsx)("button",{type:"button",onClick:()=>void to(),disabled:X||!ts,className:"rounded-full px-5 py-2.5 text-sm font-semibold text-black disabled:opacity-50 disabled:cursor-not-allowed",style:{backgroundColor:"var(--vivace-neon-green,#6ee7b7)"},children:X?"Saving…":tt?"Save set list":"edit"===te?"Update event":"Save event"})})]})]}),(0,n.jsx)(h.Z,{open:!!eB,actName:(null==eB?void 0:eB.actName)||"",typedName:(null==eB?void 0:eB.typedName)||"",step:(null==eB?void 0:eB.step)||"artist",selectedArtist:tw,initialSearch:(null==eB?void 0:eB.setListRowId)&&eF[eB.setListRowId]||null,onClose:()=>eO(null),onSkipEntirely:()=>{let e=String((null==eB?void 0:eB.setListRowId)||"").trim();e&&tc(e,{bandcampStatus:"skipped"}),eO(null)},onArtistConfirmed:(e,t)=>{var r,n;let l=String((null==eB?void 0:eB.setListRowId)||"").trim();if(!l)return;eD(r=>({...r,[l]:{...t,selectedArtist:e}}));let i=String(null!==(r=e.releaseAlbumUrl)&&void 0!==r?r:"").trim(),a=eC.find(e=>String(e.setListRowId||"")===l),s=String((null==a?void 0:a.name)||"").trim(),o=String(null!==(n=e.firestoreArtistId)&&void 0!==n?n:"").trim();if(e.manualAlbumPaste&&i){tc(l,{bandcampStatus:"linked",...o?{artistId:o}:{},releaseId:String(e.releaseFirestoreId||"").trim(),releaseTitle:String(e.releaseAlbumTitle||"").trim(),releaseArtworkThumbUrl:String(e.thumbUrl||"").trim()}),s&&tm(s,i),eO(null);return}if(o){tc(l,{artistId:o}),(async()=>{let t=A(eR.current,s),r=await I(o,t);if(null==eB||!eB.setListRowId||String(eB.setListRowId)===l){if(r){tp(l,s,r),eO(null);return}eO(t=>t&&String(t.setListRowId||"")===l?{...t,step:"album",selectedArtist:e}:t)}})();return}eO(t=>t?{...t,step:"album",selectedArtist:e}:null)},onAlbumConfirmed:e=>{var t;let{releaseId:r,listenUrl:n,releaseTitle:l,releaseArtworkThumbUrl:i}=e,a=String((null==eB?void 0:eB.setListRowId)||"").trim(),s=null==eB?void 0:eB.selectedArtist,o=eC.find(e=>String(e.setListRowId||"")===a),d=String((null==o?void 0:o.name)||"").trim();if(!a||!s||!d){eO(null);return}let u=String(null!==(t=s.firestoreArtistId)&&void 0!==t?t:"").trim();tc(a,{bandcampStatus:"linked",...u?{artistId:u}:{},releaseId:String(r||"").trim(),releaseTitle:String(l||"").trim(),releaseArtworkThumbUrl:String(i||"").trim()}),n&&tm(d,n),eO(null)},onSkipAlbum:()=>{var e;let t=String((null==eB?void 0:eB.setListRowId)||"").trim(),r=null==eB?void 0:eB.selectedArtist,n=eC.find(e=>String(e.setListRowId||"")===t),l=String((null==n?void 0:n.name)||"").trim();if(!t||!r||!l){eO(null);return}let i=String(null!==(e=r.firestoreArtistId)&&void 0!==e?e:"").trim(),a=function(e){var t,r,n;if(e.labelHostedRelease){let r=String(null!==(t=e.releaseAlbumUrl)&&void 0!==t?t:"").trim();if(r)return r}let l=String(null!==(r=e.profileUrl)&&void 0!==r?r:"").trim();if(l)return l;let i=String(null!==(n=e.bandcampSubdomain)&&void 0!==n?n:"").trim();return i?"https://".concat(i,".bandcamp.com"):""}(r);tc(t,{bandcampStatus:"artist_only",releaseId:"",releaseTitle:"",releaseArtworkThumbUrl:"",...i?{artistId:i}:{}}),a&&tm(l,a),eO(null)}})]})]})}}}]);

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.