(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,38036,e=>{"use strict";var t=e.i(54858);let s="auth_token";function r(){return localStorage.getItem(s)}function a(e){localStorage.setItem(s,e)}function n(){localStorage.removeItem(s)}function i(){return null!==r()}async function l(e){let s=await (0,t.apiRequest)("/auth/login",{method:"POST",body:JSON.stringify(e)});return a(s.token),s}function o(){n()}e.s(["getToken",()=>r,"isAuthenticated",()=>i,"login",()=>l,"logout",()=>o,"removeToken",()=>n,"setToken",()=>a])},54858,e=>{"use strict";let t="http://localhost:3000";async function s(e,r={}){let a=`${t}${e}`,n=await fetch(a,{...r,headers:{"Content-Type":"application/json",...r.headers}}),i=await n.json();if(!n.ok)throw Error(i.error||"Request failed");return i}async function r(s,a={},n){let{getToken:i,removeToken:l}=await e.A(48323),o=i();if(!o)throw n&&n(),Error("Authentication required");let c=`${t}${s}`,d=await fetch(c,{...a,headers:{"Content-Type":"application/json",Authorization:`Bearer ${o}`,...a.headers}}),u=await d.json();if(401===d.status)throw l(),n&&n(),Error(u.error||"Authentication failed");if(!d.ok)throw Error(u.error||"Request failed");return u}e.s(["apiRequest",()=>s,"authenticatedRequest",()=>r])},18566,(e,t,s)=>{t.exports=e.r(76562)},32910,e=>{"use strict";var t=e.i(43476),s=e.i(71645),r=e.i(18566),a=e.i(38036),n=e.i(54858);function i(){let e=(0,r.useRouter)(),i=(0,r.useParams)().id,[l,o]=(0,s.useState)(!1),[c,d]=(0,s.useState)(null),[u,h]=(0,s.useState)(null),[m,x]=(0,s.useState)(!0),[b,g]=(0,s.useState)(null);(0,s.useEffect)(()=>{(o(!0),(0,a.isAuthenticated)())?f():e.push("/login")},[e,i]);let f=async()=>{try{x(!0);let t=await (0,n.authenticatedRequest)(`/events/${i}`,{method:"GET"},()=>{e.push("/login")});d(t);try{let t=await (0,n.authenticatedRequest)(`/albums/${i}`,{method:"GET"},()=>{e.push("/login")});h(t)}catch(e){console.error("Failed to fetch album:",e)}}catch(t){t instanceof Error&&"Authentication required"===t.message?e.push("/login"):g(t instanceof Error?t.message:"Failed to load data")}finally{x(!1)}};return l&&(0,a.isAuthenticated)()?m?(0,t.jsx)("div",{className:"min-h-screen flex items-center justify-center",children:(0,t.jsx)("div",{className:"text-gray-600",children:"Loading..."})}):b||!c?(0,t.jsx)("div",{className:"min-h-screen p-8",children:(0,t.jsxs)("div",{className:"max-w-4xl mx-auto",children:[(0,t.jsx)("div",{className:"text-red-600 mb-4",children:b||"Event not found"}),(0,t.jsx)("button",{onClick:()=>e.push(`/events/${i}`),className:"px-4 py-2 border border-gray-300 rounded-md hover:bg-gray-50",children:"Back to Event"})]})}):(0,t.jsx)("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center p-8",children:(0,t.jsxs)("div",{className:"max-w-2xl w-full bg-white rounded-lg shadow-sm border border-gray-200 p-8",children:[(0,t.jsxs)("div",{className:"text-center mb-8",children:[(0,t.jsx)("div",{className:"text-4xl mb-4",children:"✓"}),(0,t.jsx)("h1",{className:"text-2xl font-semibold text-gray-900 mb-2",children:"Album Sent to Print"}),(0,t.jsx)("p",{className:"text-gray-600",children:"Your album has been successfully submitted for printing."})]}),(0,t.jsxs)("div",{className:"space-y-6 mb-8",children:[u&&(0,t.jsxs)("div",{className:"border-b border-gray-200 pb-4",children:[(0,t.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Album"}),(0,t.jsx)("p",{className:"text-gray-900",children:u.title})]}),(0,t.jsxs)("div",{className:"border-b border-gray-200 pb-4",children:[(0,t.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Event"}),(0,t.jsx)("p",{className:"text-gray-900",children:c.title})]}),(0,t.jsxs)("div",{className:"border-b border-gray-200 pb-4",children:[(0,t.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Print Status"}),(0,t.jsx)("p",{className:"text-gray-900",children:"sent_to_print"===c.status?"Sent to Print":c.status.charAt(0).toUpperCase()+c.status.slice(1)})]}),(0,t.jsx)("div",{className:"bg-gray-50 border border-gray-200 rounded-md p-4",children:(0,t.jsxs)("p",{className:"text-sm text-gray-700",children:[(0,t.jsx)("strong",{children:"This album is locked."})," No further edits can be made."]})})]}),(0,t.jsx)("div",{className:"flex justify-center",children:(0,t.jsx)("button",{onClick:()=>e.push(`/events/${i}`),className:"px-4 py-2 border border-gray-300 rounded-md hover:bg-gray-50",children:"Back to Event"})})]})}):null}e.s(["default",()=>i])},48323,e=>{e.v(e=>Promise.resolve().then(()=>e(38036)))}]);