PageSourceSearch

https://www.celebrationparknaples.com/assets/availability-CNxCorwU.js

js celebrationparknaples.com collected 2026-10-04 08:18:42 UTC 9,279 bytes, 1 lines download raw bytes

1import{fq as t,eP as e,Q as u,b9 as $,d5 as f,a4 as Y,a2 as Q,al as _,am as z,as as P,an as M,ap as J,b6 as V,cs as W,ao as G,dJ as K,fg as X}from"./index-6xrb6uNF.js";import{P as Z}from"./PortalHeader-DLp0adF3.js";import{P as ee,a as se}from"./PortalPerformances-DUW9QOE8.js";import{a as te,m as j,s as ae}from"./errors-ZpDf2buL.js";import{f as r}from"./calendar-hub-ui-Bg5D4haT.js";import{C as L}from"./calendar-days-DOZMYjb1.js";import{H as re}from"./history-BEhqAf1k.js";import"./usePortal-D5j1lSQA.js";import"./artist-identity-BJ9ChCnv.js";import"./key-round-Dsll--yu.js";import"./PortalLink-d7Ho-ZnJ.js";const ne={pending:"bg-brand-orange/15 text-brand-orange",approved:"bg-brand-green/15 text-brand-green",rejected:"bg-destructive/10 text-destructive"};function N(n){try{return K(X(`${n}T12:00:00`),"MMM d EEE").toUpperCase()}catch{return n}}function ge(){const[n,v]=t.useState([]),[w,y]=t.useState([]),[S,O]=t.useState(null),[B,i]=t.useState(!0),[l,k]=t.useState(null),[A,R]=t.useState(null),[a,I]=t.useState(null),[F,d]=t.useState(!1),[o,T]=t.useState(!1),[q,C]=t.useState(null),[D,x]=t.useState(null),[H,p]=t.useState(!1),[h,b]=t.useState(""),E=t.useMemo(()=>n.filter(s=>s.state==="Available"||s.state==="Requested"||s.state==="Approved"||s.state==="Rejected"),[n]),g=t.useCallback(async()=>{i(!0),k(null),R(null);const s=await te();if(!s.ok){if(s.error==="UNAUTHENTICATED"||s.error==="FORBIDDEN"){k(j(s.error)),v([]),y([]),i(!1);return}R(j(s.error)),i(!1);return}O(s.artistDisplayName),v(s.slots),y(s.ownRequests),i(!1)},[]);t.useEffect(()=>{g()},[g]);const U=async()=>{if(!a)return;T(!0),x(null);const s=h.trim(),c=await ae({data:{availabilitySlotId:a.availabilitySlotId,artistMessage:s.length>0?s:null}});if(T(!1),!c.ok){x(j(c.error));return}p(!0),C("Request submitted. This does not reserve the date."),await g(),window.setTimeout(()=>{p(!1),d(!1),b(""),C(null)},1800)};return e.jsxs(e.Fragment,{children:[e.jsx(Z,{activePath:"/portal/availability",title:"Available Dates",subtitle:S?`Published dates for ${S}. Requesting a date does not confirm a performance.`:"Browse published performance dates and submit a request."}),e.jsx(ee,{className:"mb-6"}),q?e.jsx("p",{className:"mb-4 rounded-lg bg-brand-green/10 px-3 py-2 text-sm font-medium text-brand-green",role:"status",children:q}):null,l?e.jsxs("section",{className:"mb-6 rounded-2xl border border-brand-orange/30 bg-white/95 p-5 shadow-card sm:p-6",children:[e.jsx("h2",{className:"font-display text-lg uppercase tracking-wide text-brand-green",children:"Sign in required"}),e.jsxs("p",{className:"mt-2 text-sm text-muted-foreground",children:["Published availability is only available to authenticated approved artists."," ",l]}),e.jsx(u,{asChild:!0,className:"mt-4 bg-[#234A38] hover:bg-[#234A38]/90",children:e.jsx($,{to:"/portal/login",children:"Sign in to Artist Portal"})})]}):null,A?e.jsx("p",{className:"mb-4 rounded-lg bg-red-50 px-3 py-2 text-sm text-red-800",role:"alert",children:A}):null,e.jsxs("div",{className:"grid gap-6 lg:grid-cols-2 lg:gap-8",children:[e.jsxs("section",{className:"rounded-2xl border border-white/60 bg-white/95 p-5 shadow-card backdrop-blur-sm sm:p-6",children:[e.jsxs("div",{className:"mb-5 flex items-center gap-3",children:[e.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-lg bg-brand-green/10",children:e.jsx(L,{className:"h-5 w-5 text-brand-green"})}),e.jsx("h2",{className:"font-display text-lg uppercase tracking-wide text-brand-green",children:"Open Dates"})]}),B?e.jsx("p",{className:"text-sm text-muted-foreground",role:"status",children:"Loading published availability…"}):l?e.jsx("p",{className:"text-sm text-muted-foreground",children:"Sign in to view published dates."}):E.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"No published availability dates right now. Check back after the park publishes new dates."}):e.jsx("ul",{className:"space-y-3",children:E.map(s=>{const c=s.state==="Requested",m=s.state==="Available";return e.jsxs("li",{className:"flex flex-col gap-3 rounded-xl border border-border/60 bg-brand-cream/30 p-4 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"flex h-12 w-12 shrink-0 items-center justify-center rounded-lg bg-white shadow-sm",children:e.jsx(L,{className:"h-5 w-5 text-brand-green"})}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-foreground",children:N(s.eventDate)}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:[r(s.startTime),"–",r(s.endTime)]})]})]}),e.jsxs("div",{className:"flex items-center gap-3 sm:shrink-0",children:[e.jsx("span",{className:f("rounded-full border px-2.5 py-1 text-[10px] font-semibold uppercase tracking-wider",c?"border-brand-orange/20 bg-brand-orange/10 text-brand-orange":"border-brand-green/20 bg-brand-green/10 text-brand-green"),children:s.state}),e.jsx(u,{size:"sm",variant:m?"default":"outline",disabled:!m||!!l,className:f(m&&"bg-brand-orange hover:bg-brand-orange/90"),onClick:()=>{I(s),x(null),p(!1),b(""),d(!0)},children:m?"Request this date":s.state})]})]},s.availabilitySlotId)})})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("section",{className:"rounded-2xl border border-white/60 bg-white/95 p-5 shadow-card backdrop-blur-sm sm:p-6",children:[e.jsxs("div",{className:"mb-4 flex items-center gap-3",children:[e.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-lg bg-brand-orange/10",children:e.jsx(re,{className:"h-5 w-5 text-brand-orange"})}),e.jsx("h2",{className:"font-display text-lg uppercase tracking-wide text-brand-green",children:"Your Requests"})]}),w.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"No requests submitted yet."}):e.jsx("ul",{className:"space-y-3",children:w.map(s=>e.jsxs("li",{className:"flex items-center justify-between gap-3 rounded-lg border border-border/60 px-3 py-2.5",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-sm font-medium",children:N(s.eventDate)}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[r(s.startTime),"–",r(s.endTime)]}),s.artistMessage?e.jsx("p",{className:"mt-1 line-clamp-2 text-xs text-muted-foreground",children:s.artistMessage}):null]}),e.jsx("span",{className:f("shrink-0 rounded-full px-2 py-0.5 text-[10px] font-semibold uppercase",ne[s.status]),children:s.status})]},s.id))})]}),e.jsx("section",{className:"rounded-2xl border border-white/60 bg-brand-green-deep p-5 text-white shadow-card sm:p-6",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(Y,{className:"mt-0.5 h-5 w-5 shrink-0 text-brand-orange"}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-display text-base uppercase tracking-wide",children:"About requests"}),e.jsx("p",{className:"mt-2 text-sm leading-relaxed text-white/70",children:"Requesting a date does not reserve it or confirm a performance. Multiple artists may request the same published date."})]})]})}),e.jsx("section",{className:"rounded-2xl border border-white/60 bg-white/95 p-5 shadow-card backdrop-blur-sm sm:p-6",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(Q,{className:"mt-0.5 h-5 w-5 shrink-0 text-brand-green"}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-display text-base uppercase tracking-wide text-brand-green",children:"How It Works"}),e.jsxs("ol",{className:"mt-3 space-y-2 text-sm leading-relaxed text-muted-foreground",children:[e.jsx("li",{children:"1. Browse published dates and tap Request this date."}),e.jsx("li",{children:"2. Your request stays pending until managers review it later."}),e.jsx("li",{children:"3. The date remains available for other approved artists."})]})]})]})}),e.jsx(se,{limit:3,title:"Upcoming Performances"})]})]}),e.jsx(_,{open:F,onOpenChange:d,children:e.jsx(z,{className:"sm:max-w-md",children:H?e.jsxs("div",{className:"py-6 text-center",children:[e.jsx(P,{className:"font-display uppercase tracking-wide text-brand-green",children:"Request Submitted"}),e.jsx(M,{className:"mt-2",children:"Your request is pending. This does not reserve the date or create a performance."})]}):e.jsxs(e.Fragment,{children:[e.jsxs(J,{children:[e.jsx(P,{className:"font-display uppercase tracking-wide text-brand-green",children:"Request this date"}),e.jsx(M,{children:a?`${N(a.eventDate)} · ${r(a.startTime)}–${r(a.endTime)}`:"Confirm your request."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(V,{htmlFor:"artist-message",children:"Performance details or message"}),e.jsx(W,{id:"artist-message",value:h,onChange:s=>b(s.target.value.slice(0,2e3)),placeholder:"Optional — share context about the performance. Managers can edit this later.",rows:3,maxLength:2e3,disabled:o}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[h.length,"/2000"]})]}),D?e.jsx("p",{className:"rounded-lg bg-red-50 px-3 py-2 text-sm text-red-800",role:"alert",children:D}):null,e.jsxs(G,{children:[e.jsx(u,{type:"button",variant:"outline",onClick:()=>d(!1),disabled:o,children:"Cancel"}),e.jsx(u,{type:"button",className:"bg-brand-orange hover:bg-brand-orange/90",disabled:o||!a,onClick:()=>{U()},children:o?"Submitting…":"Request this date"})]})]})})})]})}export{ge as component};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.