@seatlayer/js 0.86.3 → 0.86.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var Xl=Object.create;var Si=Object.defineProperty;var Zl=Object.getOwnPropertyDescriptor;var Ql=Object.getOwnPropertyNames;var Jl=Object.getPrototypeOf,ec=Object.prototype.hasOwnProperty;var Ro=i=>{throw TypeError(i)};var tc=(i,e,t)=>()=>{if(t)throw t[0];try{return i&&(e=i(i=0)),e}catch(n){throw t=[n],n}};var Io=(i,e)=>{for(var t in e)Si(i,t,{get:e[t],enumerable:!0})},Oo=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Ql(e))!ec.call(i,o)&&o!==t&&Si(i,o,{get:()=>e[o],enumerable:!(n=Zl(e,o))||n.enumerable});return i};var _o=(i,e,t)=>(t=i!=null?Xl(Jl(i)):{},Oo(e||!i||!i.__esModule?Si(t,"default",{value:i,enumerable:!0}):t,i)),ic=i=>Oo(Si({},"__esModule",{value:!0}),i);var Mn=(i,e,t)=>e.has(i)||Ro("Cannot "+t);var m=(i,e,t)=>(Mn(i,e,"read from private field"),t?t.call(i):e.get(i)),P=(i,e,t)=>e.has(i)?Ro("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),k=(i,e,t,n)=>(Mn(i,e,"write to private field"),n?n.call(i,t):e.set(i,t),t),S=(i,e,t)=>(Mn(i,e,"access private method"),t);var $o={};Io($o,{errorCopy:()=>Hn,mountCheckout:()=>bc,unavailableCopy:()=>zo});function uc(i,e){try{window.sessionStorage.setItem(hc,JSON.stringify({orderId:i,...e?{eventKey:e}:{},storedAt:Date.now()}))}catch{}}function fc(){if(typeof document>"u"||document.getElementById(Vo))return;let i=document.createElement("style");i.id=Vo,i.textContent=mc,document.head.appendChild(i)}function zo(i,e){let t=`${e} ${e===1?"seat is":"seats are"} held for a limited time.`;return i==="payments_off_for_event"?{title:"This event isn\u2019t sold online",body:`${t} The organiser isn\u2019t taking payment for this event here.`,detail:"Nothing has been charged. Check where you found this event for how to get tickets."}:i==="unavailable_for_event"?{title:"This event isn\u2019t taking payment yet",body:`${t} Online payment is not switched on for this event.`,detail:"Nothing has been charged. If you were sent here to pay, let the organiser know \u2014 only they can turn payment on for this event."}:{title:"Finish in the ticketing checkout",body:`${t} Payment for this event is taken elsewhere.`,detail:"Nothing has been charged. Continue in the checkout on this page to pay for your seats."}}function Hn(i){switch(i){case"gateway_not_connected":case"payments_not_enabled_for_event":return"This event is not taking online payments. Contact the organiser to buy these seats.";case"provider_mismatch":return"This event\u2019s payment setup changed while you were choosing. Nothing was charged \u2014 please try again.";case"hold_not_active":case"hold_not_found":return"Your seats were released before checkout started. Nothing was charged \u2014 please pick again.";case"checkout_already_started":return"A payment for these seats is already in progress. Finish that one, or wait for it to time out before starting again.";case"event_closed":return"Sales for this event have closed.";case"insufficient_hosted_credits":return"Ticket sales are temporarily paused while the organiser updates their SeatLayer balance. Nothing was charged \u2014 please try again later or contact the organiser.";case"gateway_currency_mismatch":case"unsupported_currency":case"mixed_currency_hold":case"price_unusable":return"These seats cannot be checked out right now because of a pricing configuration problem. Nothing was charged \u2014 please contact the organiser.";case"rate_limited":return"Too many attempts. Wait a moment and try again.";default:return"We could not start the payment. Nothing was charged \u2014 please try again."}}function gc(){let i=window.Razorpay;return i?Promise.resolve(i):new Promise((e,t)=>{let n=document.querySelector(`script[src="${Fo}"]`),o=n??document.createElement("script"),s=()=>{let r=window.Razorpay;r?e(r):t(new Error("razorpay_unavailable"))};o.addEventListener("load",s,{once:!0}),o.addEventListener("error",()=>t(new Error("razorpay_script_failed")),{once:!0}),!n&&(o.src=Fo,o.async=!0,document.head.appendChild(o))})}function F(i,e,t){let n=document.createElement(i);return e&&(n.className=e),t!==void 0&&(n.textContent=t),n}function bc(i){fc();let e=!0,t=!1,n=F("div","sl-hco");n.setAttribute("role","dialog"),n.setAttribute("aria-modal","true");let o=F("div","sl-hco-card");n.appendChild(o);let s=()=>{e=!1,n.remove(),document.removeEventListener("keydown",a,!0)},r=()=>{s(),i.onCancel()};function a(V){V.key!=="Escape"||!n.isConnected||(V.stopPropagation(),V.preventDefault(),r())}document.addEventListener("keydown",a,!0);let l=F("h2","sl-hco-title","Checkout"),c=`sl-hco-t-${Math.random().toString(36).slice(2,8)}`;l.id=c,n.setAttribute("aria-labelledby",c);let d=(...V)=>{o.replaceChildren(l,...V)},p=V=>{if(!e)return;let Z=F("p","sl-hco-status sl-hco-error",V);Z.setAttribute("role","alert");let M=F("button","sl-hco-back","Back to seats");M.type="button",M.addEventListener("click",r),d(Z,M)},u=V=>{if(!e)return;let Z=F("p","sl-hco-status",V);Z.setAttribute("role","status"),d(Z)},h=async V=>{u("Payment received \u2014 confirming your seats\u2026");let Z=Date.now()+9e4;for(;e&&Date.now()<Z;){try{let M=await i.orderStatus(V);if(!e)return;if(M.status==="confirmed"){t=!0,l.textContent="Your tickets are confirmed";let yt=F("p","sl-hco-status",`${M.seatCount} ${M.seatCount===1?"seat":"seats"} confirmed. Your tickets \u2014 with their door QR codes \u2014 are in your email.`),Qe=F("dl","sl-hco-receipt"),Xt=(M.tickets??[]).map(vt=>vt.label);Xt.length&&Qe.append(F("dt",void 0,"Seats"),F("dd",void 0,Xt.join(", "))),Qe.append(F("dt",void 0,"Paid"),F("dd",void 0,`${M.amountFormatted} ${M.currency}`),F("dt",void 0,"Order"),F("dd","sl-hco-ref",M.orderId));let xi=F("button","sl-hco-back","Close");if(xi.type="button",xi.addEventListener("click",r),M.ticketUrl){let vt=F("a","sl-hco-tickets","View tickets & QR codes");vt.href=M.ticketUrl,vt.target="_blank",vt.rel="noreferrer",d(yt,Qe,vt,xi)}else d(yt,Qe,xi);i.onConfirmed(M);return}if(M.status==="failed"||M.status==="expired"){p(M.status==="expired"?"Your seats were released before payment completed. Nothing was charged \u2014 please pick again.":"The payment did not complete. If you were charged, it has been refunded automatically.");return}}catch{}await new Promise(M=>setTimeout(M,2e3))}!e||t||p("Still confirming with the payment provider. If your payment went through, your tickets will arrive by email shortly \u2014 you do not need to pay again.")};if(i.state.kind==="unavailable"){let V=zo(i.state.reason,i.state.seatCount);l.textContent=V.title;let Z=F("p","sl-hco-label","Seats held"),M=F("button","sl-hco-back","Back to seat map");return M.type="button",M.addEventListener("click",r),o.replaceChildren(Z,l,F("p","sl-hco-status",V.body),F("p","sl-hco-note",V.detail),M),i.root.appendChild(n),M.focus(),{destroy:s}}if(i.state.kind==="resume")return i.root.appendChild(n),h(i.state.orderId),{destroy:s};let{order:y,provider:g}=i.state,T=F("div","sl-hco-summary"),w=F("div","sl-hco-seats");for(let V of y.labels)w.appendChild(F("span","sl-hco-seat",V));let v=i.formatMoney(y.total,y.currency),A=F("div","sl-hco-total");A.append(F("span",void 0,"Total"),F("strong",void 0,v)),T.append(w,A);let D=F("form","sl-hco-form"),K=F("label","sl-hco-label","Email \u2014 your tickets go here"),f=F("input","sl-hco-input");f.type="email",f.required=!0,f.autocomplete="email",f.placeholder="you@example.com",f.id=`${c}-email`,K.htmlFor=f.id;let L=F("label","sl-hco-label","Name (optional)"),N=F("input","sl-hco-input");N.type="text",N.autocomplete="name",N.placeholder="Your name",N.id=`${c}-name`,L.htmlFor=N.id;let R=F("button","sl-hco-pay",`Pay ${v}`);R.type="submit",R.disabled=!0;let O=F("button","sl-hco-back","Back to seats");O.type="button",O.addEventListener("click",r);let C=new Date(y.expiresAt).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),_=F("p","sl-hco-note",`Your seats are held until ${C}. Payment is handled by ${g==="razorpay"?"Razorpay":"Stripe"} \u2014 we never see your card details.`),U=F("p","sl-hco-note");U.append("The event organizer and SeatLayer use your email to issue and manage your tickets. ");let G=F("a",void 0,"Privacy Policy");G.href="https://seatlayer.io/privacy/",G.target="_blank",G.rel="noreferrer",U.appendChild(G);let de=()=>/.+@.+\..+/.test(f.value.trim());f.addEventListener("input",()=>{R.disabled=!de()});let ge=async()=>{u("Opening secure payment\u2026");try{let V=await i.startSession({holdId:y.holdId,buyerEmail:f.value.trim(),...N.value.trim()?{buyerName:N.value.trim()}:{}});if(!e)return;if(V.redirectUrl){uc(V.orderId,i.eventKey),u("Taking you to secure payment\u2026"),window.location.assign(V.redirectUrl);return}if(V.clientPayload){let Z=V.clientPayload,M=await gc();if(!e)return;u("Waiting for payment\u2026"),new M({key:Z.key,order_id:Z.orderId,amount:Z.amount,currency:Z.currency,name:Z.name,prefill:Z.prefill,handler:()=>{h(V.orderId)},modal:{ondismiss:()=>{e&&X()}}}).open();return}p(Hn("gateway_unavailable"))}catch(V){i.onError?.(V),p(Hn(V?.code))}};D.addEventListener("submit",V=>{V.preventDefault(),de()&&ge()}),D.append(K,f,L,N,U,R,O,_);let X=()=>{l.textContent="Checkout",d(T,D),R.disabled=!de()};return X(),i.root.appendChild(n),f.focus(),{destroy:s}}var Fo,Vo,hc,mc,jo=tc(()=>{"use strict";Fo="https://checkout.razorpay.com/v1/checkout.js",Vo="seatlayer-checkout-style",hc="@seatlayer/pending-checkout/v1";mc=`
1
+ "use strict";var Zl=Object.create;var Si=Object.defineProperty;var Ql=Object.getOwnPropertyDescriptor;var Jl=Object.getOwnPropertyNames;var ec=Object.getPrototypeOf,tc=Object.prototype.hasOwnProperty;var Ro=i=>{throw TypeError(i)};var ic=(i,e,t)=>()=>{if(t)throw t[0];try{return i&&(e=i(i=0)),e}catch(n){throw t=[n],n}};var Io=(i,e)=>{for(var t in e)Si(i,t,{get:e[t],enumerable:!0})},Oo=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Jl(e))!tc.call(i,o)&&o!==t&&Si(i,o,{get:()=>e[o],enumerable:!(n=Ql(e,o))||n.enumerable});return i};var _o=(i,e,t)=>(t=i!=null?Zl(ec(i)):{},Oo(e||!i||!i.__esModule?Si(t,"default",{value:i,enumerable:!0}):t,i)),nc=i=>Oo(Si({},"__esModule",{value:!0}),i);var Mn=(i,e,t)=>e.has(i)||Ro("Cannot "+t);var m=(i,e,t)=>(Mn(i,e,"read from private field"),t?t.call(i):e.get(i)),P=(i,e,t)=>e.has(i)?Ro("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),k=(i,e,t,n)=>(Mn(i,e,"write to private field"),n?n.call(i,t):e.set(i,t),t),S=(i,e,t)=>(Mn(i,e,"access private method"),t);var $o={};Io($o,{errorCopy:()=>Hn,mountCheckout:()=>yc,unavailableCopy:()=>zo});function mc(i,e){try{window.sessionStorage.setItem(uc,JSON.stringify({orderId:i,...e?{eventKey:e}:{},storedAt:Date.now()}))}catch{}}function gc(){if(typeof document>"u"||document.getElementById(Vo))return;let i=document.createElement("style");i.id=Vo,i.textContent=fc,document.head.appendChild(i)}function zo(i,e){let t=`${e} ${e===1?"seat is":"seats are"} held for a limited time.`;return i==="payments_off_for_event"?{title:"This event isn\u2019t sold online",body:`${t} The organiser isn\u2019t taking payment for this event here.`,detail:"Nothing has been charged. Check where you found this event for how to get tickets."}:i==="unavailable_for_event"?{title:"This event isn\u2019t taking payment yet",body:`${t} Online payment is not switched on for this event.`,detail:"Nothing has been charged. If you were sent here to pay, let the organiser know \u2014 only they can turn payment on for this event."}:{title:"Finish in the ticketing checkout",body:`${t} Payment for this event is taken elsewhere.`,detail:"Nothing has been charged. Continue in the checkout on this page to pay for your seats."}}function Hn(i){switch(i){case"gateway_not_connected":case"payments_not_enabled_for_event":return"This event is not taking online payments. Contact the organiser to buy these seats.";case"provider_mismatch":return"This event\u2019s payment setup changed while you were choosing. Nothing was charged \u2014 please try again.";case"hold_not_active":case"hold_not_found":return"Your seats were released before checkout started. Nothing was charged \u2014 please pick again.";case"checkout_already_started":return"A payment for these seats is already in progress. Finish that one, or wait for it to time out before starting again.";case"event_closed":return"Sales for this event have closed.";case"insufficient_hosted_credits":return"Ticket sales are temporarily paused while the organiser updates their SeatLayer balance. Nothing was charged \u2014 please try again later or contact the organiser.";case"gateway_currency_mismatch":case"unsupported_currency":case"mixed_currency_hold":case"price_unusable":return"These seats cannot be checked out right now because of a pricing configuration problem. Nothing was charged \u2014 please contact the organiser.";case"rate_limited":return"Too many attempts. Wait a moment and try again.";default:return"We could not start the payment. Nothing was charged \u2014 please try again."}}function bc(){let i=window.Razorpay;return i?Promise.resolve(i):new Promise((e,t)=>{let n=document.querySelector(`script[src="${Fo}"]`),o=n??document.createElement("script"),s=()=>{let r=window.Razorpay;r?e(r):t(new Error("razorpay_unavailable"))};o.addEventListener("load",s,{once:!0}),o.addEventListener("error",()=>t(new Error("razorpay_script_failed")),{once:!0}),!n&&(o.src=Fo,o.async=!0,document.head.appendChild(o))})}function F(i,e,t){let n=document.createElement(i);return e&&(n.className=e),t!==void 0&&(n.textContent=t),n}function yc(i){gc();let e=!0,t=!1,n=F("div","sl-hco");n.setAttribute("role","dialog"),n.setAttribute("aria-modal","true");let o=F("div","sl-hco-card");n.appendChild(o);let s=()=>{e=!1,n.remove(),document.removeEventListener("keydown",a,!0)},r=()=>{s(),i.onCancel()};function a(V){V.key!=="Escape"||!n.isConnected||(V.stopPropagation(),V.preventDefault(),r())}document.addEventListener("keydown",a,!0);let l=F("h2","sl-hco-title","Checkout"),c=`sl-hco-t-${Math.random().toString(36).slice(2,8)}`;l.id=c,n.setAttribute("aria-labelledby",c);let d=(...V)=>{o.replaceChildren(l,...V)},p=V=>{if(!e)return;let Z=F("p","sl-hco-status sl-hco-error",V);Z.setAttribute("role","alert");let M=F("button","sl-hco-back","Back to seats");M.type="button",M.addEventListener("click",r),d(Z,M)},u=V=>{if(!e)return;let Z=F("p","sl-hco-status",V);Z.setAttribute("role","status"),d(Z)},h=async V=>{u("Payment received \u2014 confirming your seats\u2026");let Z=Date.now()+9e4;for(;e&&Date.now()<Z;){try{let M=await i.orderStatus(V);if(!e)return;if(M.status==="confirmed"){t=!0,l.textContent="Your tickets are confirmed";let yt=F("p","sl-hco-status",`${M.seatCount} ${M.seatCount===1?"seat":"seats"} confirmed. Your tickets \u2014 with their door QR codes \u2014 are in your email.`),Qe=F("dl","sl-hco-receipt"),Xt=(M.tickets??[]).map(vt=>vt.label);Xt.length&&Qe.append(F("dt",void 0,"Seats"),F("dd",void 0,Xt.join(", "))),Qe.append(F("dt",void 0,"Paid"),F("dd",void 0,`${M.amountFormatted} ${M.currency}`),F("dt",void 0,"Order"),F("dd","sl-hco-ref",M.orderId));let xi=F("button","sl-hco-back","Close");if(xi.type="button",xi.addEventListener("click",r),M.ticketUrl){let vt=F("a","sl-hco-tickets","View tickets & QR codes");vt.href=M.ticketUrl,vt.target="_blank",vt.rel="noreferrer",d(yt,Qe,vt,xi)}else d(yt,Qe,xi);i.onConfirmed(M);return}if(M.status==="failed"||M.status==="expired"){p(M.status==="expired"?"Your seats were released before payment completed. Nothing was charged \u2014 please pick again.":"The payment did not complete. If you were charged, it has been refunded automatically.");return}}catch{}await new Promise(M=>setTimeout(M,2e3))}!e||t||p("Still confirming with the payment provider. If your payment went through, your tickets will arrive by email shortly \u2014 you do not need to pay again.")};if(i.state.kind==="unavailable"){let V=zo(i.state.reason,i.state.seatCount);l.textContent=V.title;let Z=F("p","sl-hco-label","Seats held"),M=F("button","sl-hco-back","Back to seat map");return M.type="button",M.addEventListener("click",r),o.replaceChildren(Z,l,F("p","sl-hco-status",V.body),F("p","sl-hco-note",V.detail),M),i.root.appendChild(n),M.focus(),{destroy:s}}if(i.state.kind==="resume")return i.root.appendChild(n),h(i.state.orderId),{destroy:s};let{order:y,provider:f}=i.state,T=F("div","sl-hco-summary"),w=F("div","sl-hco-seats");for(let V of y.labels)w.appendChild(F("span","sl-hco-seat",V));let v=i.formatMoney(y.total,y.currency),A=F("div","sl-hco-total");A.append(F("span",void 0,"Total"),F("strong",void 0,v)),T.append(w,A);let D=F("form","sl-hco-form"),K=F("label","sl-hco-label","Email \u2014 your tickets go here"),g=F("input","sl-hco-input");g.type="email",g.required=!0,g.autocomplete="email",g.placeholder="you@example.com",g.id=`${c}-email`,K.htmlFor=g.id;let L=F("label","sl-hco-label","Name (optional)"),N=F("input","sl-hco-input");N.type="text",N.autocomplete="name",N.placeholder="Your name",N.id=`${c}-name`,L.htmlFor=N.id;let R=F("button","sl-hco-pay",`Pay ${v}`);R.type="submit",R.disabled=!0;let O=F("button","sl-hco-back","Back to seats");O.type="button",O.addEventListener("click",r);let C=new Date(y.expiresAt).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),_=F("p","sl-hco-note",`Your seats are held until ${C}. Payment is handled by ${f==="razorpay"?"Razorpay":"Stripe"} \u2014 we never see your card details.`),U=F("p","sl-hco-note");U.append("The event organizer and SeatLayer use your email to issue and manage your tickets. ");let G=F("a",void 0,"Privacy Policy");G.href="https://seatlayer.io/privacy/",G.target="_blank",G.rel="noreferrer",U.appendChild(G);let de=()=>/.+@.+\..+/.test(g.value.trim());g.addEventListener("input",()=>{R.disabled=!de()});let ge=async()=>{u("Opening secure payment\u2026");try{let V=await i.startSession({holdId:y.holdId,buyerEmail:g.value.trim(),...N.value.trim()?{buyerName:N.value.trim()}:{}});if(!e)return;if(V.redirectUrl){mc(V.orderId,i.eventKey),u("Taking you to secure payment\u2026"),window.location.assign(V.redirectUrl);return}if(V.clientPayload){let Z=V.clientPayload,M=await bc();if(!e)return;u("Waiting for payment\u2026"),new M({key:Z.key,order_id:Z.orderId,amount:Z.amount,currency:Z.currency,name:Z.name,prefill:Z.prefill,handler:()=>{h(V.orderId)},modal:{ondismiss:()=>{e&&X()}}}).open();return}p(Hn("gateway_unavailable"))}catch(V){i.onError?.(V),p(Hn(V?.code))}};D.addEventListener("submit",V=>{V.preventDefault(),de()&&ge()}),D.append(K,g,L,N,U,R,O,_);let X=()=>{l.textContent="Checkout",d(T,D),R.disabled=!de()};return X(),i.root.appendChild(n),g.focus(),{destroy:s}}var Fo,Vo,uc,fc,jo=ic(()=>{"use strict";Fo="https://checkout.razorpay.com/v1/checkout.js",Vo="seatlayer-checkout-style",uc="@seatlayer/pending-checkout/v1";fc=`
2
2
  /* The card is centred, but max-height:100% lets a long form reach the bottom
3
3
  edge \u2014 and on the hosted buyer page that edge is the phone's edge, with the
4
4
  Pay button last in the scroll. Reserve the home-indicator gutter here too.
@@ -38,7 +38,7 @@
38
38
  .sl-hco-tickets{display:block;width:100%;margin-top:14px;padding:12px;font:inherit;font-size:15px;
39
39
  font-weight:650;text-align:center;text-decoration:none;color:var(--sl-accent-ink);
40
40
  background:var(--sl-accent);border-radius:calc(var(--sl-radius) * .55)}
41
- `});var gh={};Io(gh,{ApiError:()=>j,BuyerAccessContext:()=>me,BuyerAccessUnavailableError:()=>re,BuyerRealtimeClient:()=>Ee,EmbeddedDesigner:()=>on,PerformanceGroupDestroyedError:()=>J,PerformanceGroupPicker:()=>Cn,SEATING_CHART_CALLBACK_PROPS:()=>Zn,SEATING_CHART_HANDLE_METHODS:()=>Wn,SEATING_CHART_IDENTITY_PROPS:()=>Yn,SEATING_CHART_VALUE_PROPS:()=>Xn,SeasonApiError:()=>z,SeasonPicker:()=>Ln,SeasonPublicSessionRefused:()=>ui,SeasonRecoveryTimeoutError:()=>gi,SeatPicker:()=>Ke,SeatingChart:()=>nn,attachPickerFrame:()=>Yl,bindSeatingChartHandle:()=>sr,buildSeatingChartOptions:()=>rr,createBuyerAccessContext:()=>Ht,createControllerSink:()=>wt,parseTicketOfferAvailability:()=>rn,shortOperationReference:()=>Vt,ticketOfferPrices:()=>an});module.exports=ic(gh);var $=require("@seatlayer/core");var Je="seatlayer.v1";function nc(i){let e=typeof i.default=="string"?i.default:"free",t={};if(i.seats&&typeof i.seats=="object")for(let[n,o]of Object.entries(i.seats))typeof o=="string"&&o!==e&&(t[n]=o);return{default:e,exceptions:t}}function oc(i,e){if(!i||i.default!==e.default)return null;let t=[];for(let[n,o]of Object.entries(e.exceptions))i.exceptions[n]!==o&&t.push({label:n,status:o});for(let n of Object.keys(i.exceptions))n in e.exceptions||t.push({label:n,status:e.default});return t}function sc(i,e){for(let t of e)t.status===i.default?delete i.exceptions[t.label]:i.exceptions[t.label]=t.status}function No(i){if(/(?:^|[?&#])(?:token|access_token|bearer|authorization|ticket|tkt|bse)=/i.test(i))throw new Error("seatlayer: refusing to open a socket with a credential in the URL");if(/\bbse_[A-Za-z0-9._-]+/.test(i))throw new Error("seatlayer: refusing to open a socket with a credential in the URL")}var Ee=class{constructor(e){this.ws=null;this.stopped=!0;this.attempt=0;this.reconnectTimer=null;this.pingTimer=null;this.pongTimer=null;this.resumeTimer=null;this.projection=null;this.version=null;this.v1=!1;this.useQueryMarker=!1;this.hidden=null;this.closedSections=null;this.opts=e,No(e.url)}get protocol(){return this.ws?this.v1?"v1":"legacy":null}get snapshotVersion(){return this.version}start(){this.stopped&&(this.stopped=!1,this.connect())}stop(){this.stopped=!0,this.clearTimers();let e=this.ws;if(this.ws=null,e){e.onopen=null,e.onmessage=null,e.onclose=null,e.onerror=null;try{e.close()}catch{}}}restart(){this.stop(),this.projection=null,this.version=null,this.attempt=0,this.start()}async connect(){if(this.stopped)return;let e=[Je];if(this.opts.mintTicket){let s;try{s=await this.opts.mintTicket()}catch(r){this.reportIfAccessError(r),this.scheduleReconnect();return}if(this.stopped)return;s?.protocols?.length?(e=[...s.protocols],e.includes(Je)||e.unshift(Je)):s?.ticket&&(e=[Je,`tkt.${s.ticket}`])}let t=this.version!==null;t&&e.push(`sv.${this.version}`);let n=this.useQueryMarker?`${this.opts.url}${this.opts.url.includes("?")?"&":"?"}pv=1`:this.opts.url;No(n);let o;try{o=(this.opts.socketFactory??((r,a)=>new WebSocket(r,a)))(n,e)}catch{this.scheduleReconnect();return}this.ws=o,o.onopen=()=>{this.ws===o&&(this.attempt=0,this.v1=o.protocol===Je,this.v1||(this.useQueryMarker=!0),this.startKeepalive(o),t?this.resumeTimer=setTimeout(()=>{this.resumeTimer=null,this.opts.sink.resync()},5e3):this.resumeTimer=setTimeout(()=>{this.resumeTimer=null,this.opts.sink.resync({reason:"connect"})},5e3))},o.onmessage=s=>{if(this.ws!==o)return;let r;try{r=JSON.parse(typeof s.data=="string"?s.data:"")}catch{return}!r||typeof r!="object"||this.handleFrame(r)},o.onclose=s=>{if(this.ws===o){if(this.ws=null,this.clearTimers(),s?.code===4401){if(s.reason==="access_expired"){this.scheduleReconnect();return}this.stopped=!0,this.opts.onAccessUnavailable?.({reason:"revoked",code:"access_revoked",retryable:!1});return}this.scheduleReconnect()}},o.onerror=()=>{try{o.close()}catch{}}}handleFrame(e){let t=typeof e.type=="string"?e.type:"";if(e.protocol===1&&(this.v1=!0),typeof e.snapshotVersion=="number"&&(this.version=e.snapshotVersion),t==="pong"){this.clearPongTimer();return}if(Array.isArray(e.hidden)||Array.isArray(e.closed)){let n=Array.isArray(e.hidden)?e.hidden:[],o=Array.isArray(e.closed)?e.closed:[],s=n.join("\0"),r=o.join("\0");(s!==this.hidden||r!==this.closedSections)&&(this.hidden=s,this.closedSections=r,this.opts.sink.onSections?.(n,o,{withInventory:t==="snapshot"||!!e.seats}))}if(t!=="hidden"){if(t==="presence"){this.opts.sink.onPresence?.({shoppingSessions:Number(e.shoppingSessions)||0,activeHolds:Number(e.activeHolds)||0});return}if(t!=="allocation"){if(t==="snapshot"||!t&&e.seats){this.answered();let n=nc(e),o=oc(this.projection,n);this.projection=n,o===null?this.opts.sink.applyProjection?this.opts.sink.applyProjection(n):this.opts.sink.resync():o.length&&this.opts.sink.applyStatuses(o);return}if(t==="delta"&&Array.isArray(e.changes)){this.answered();let n=e.changes.filter(o=>typeof o?.label=="string"&&typeof o?.status=="string").map(o=>({label:o.label,status:o.status}));if(!n.length)return;this.projection&&sc(this.projection,n),this.opts.sink.applyStatuses(n)}}}}answered(){this.resumeTimer&&(clearTimeout(this.resumeTimer),this.resumeTimer=null)}reportIfAccessError(e){let t=e?.reason;e?.name==="BuyerAccessUnavailableError"&&(this.stopped=!0,this.opts.onAccessUnavailable?.({reason:t??"invalid",code:e.code,status:e.status,retryable:t==="paused"}))}startKeepalive(e){this.pingTimer=setInterval(()=>{if(this.ws===e){try{e.send(JSON.stringify({type:"ping"}))}catch{return}this.clearPongTimer(),this.pongTimer=setTimeout(()=>{this.pongTimer=null;try{e.close()}catch{}},1e4)}},25e3)}scheduleReconnect(){if(this.stopped||this.reconnectTimer)return;let e=Math.min(this.attempt++,5),t=Math.min(1e3*2**e,15e3),n=Math.random()*t;this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},n)}clearPongTimer(){this.pongTimer&&(clearTimeout(this.pongTimer),this.pongTimer=null)}clearTimers(){this.pingTimer&&clearInterval(this.pingTimer),this.pingTimer=null,this.clearPongTimer(),this.reconnectTimer&&clearTimeout(this.reconnectTimer),this.reconnectTimer=null,this.resumeTimer&&clearTimeout(this.resumeTimer),this.resumeTimer=null}};function rc(i){return i==="blocked"?"not_for_sale":i==="held"||i==="booked"||i==="free"||i==="not_for_sale"?i:"free"}function wt(i,e={}){let t=n=>{let o=i.tableSelection(n);if(o)return o.physicalSeatIds;let s=i.idForLabel(n);return s?[s]:[]};return{applyStatuses(n){let o=new Set([...i.currentHold()?.labels??[],...e.ownLabels?.()??[]]),s={free:[],held:[],booked:[],not_for_sale:[]},r=[],a=[],l=new Map(i.getSelection().map(c=>[c.label,c.id]));for(let c of n){let d=t(c.label);if(!d.length)continue;let p=rc(c.status);if(s[p].push(...d),e.flashOnLiveChange&&p!=="free"&&!o.has(c.label)&&d.some(u=>i.getStatus(u)==="free")){let u=p==="held"?"#f4b740":"#f43f5e";for(let h of d)r.push({id:h,color:u})}p!=="free"&&!o.has(c.label)&&l.has(c.label)&&a.push(c.label)}for(let c of["free","held","booked","not_for_sale"])s[c].length&&i.setStatus(s[c],c);for(let c of r)i.flashSeat(c.id,c.color);if(a.length){let c=a.flatMap(p=>t(p));c.length&&i.deselect(c);let d=n.some(p=>p.status==="blocked"&&a.includes(p.label));e.onSelectedObjectUnavailable?.(a,d?"ineligible":"taken")}e.onStatusChange?.()},...i.applyProjection?{applyProjection:n=>{i.applyProjection(n)}}:{},async resync(n){await(i.resync?i.resync(n):i.refresh())},onSections(n,o,s){s?.withInventory||(i.resync?i.resync({reason:"frame"}):i.refresh()),e.onSections?.(n,o,s)}}}var j=class extends Error{constructor(e,t,n,o,s,r){super(t),this.name="ApiError",this.status=e,this.code=n,this.conflicts=o,this.reason=s,this.retryAfterS=r}},Do=10,Bo=1;function ki(i,e){let t=(i??"").trim();if(t){let n=Number(t);if(Number.isFinite(n)&&n>=0)return Math.ceil(n);let o=Date.parse(t);if(Number.isFinite(o))return Math.max(0,Math.ceil((o-Date.now())/1e3))}if(typeof e=="number"&&Number.isFinite(e)&&e>=0)return Math.ceil(e)}var ac={seat_conflict:"taken",conflict:"taken",channel_assignment_conflict:"ineligible",allocation_exhausted:"exhausted"},Ve=class{constructor(e,t={}){this.base=e;this.viewerId=typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`viewer_${Math.random().toString(36).slice(2)}${Date.now().toString(36)}`;this.access=t.access,this.onObjectUnavailable=t.onObjectUnavailable;let n=t.referral?.trim();this.referral=n?n.slice(0,120):void 0}get accessScoped(){return!!this.access?.configured}async request(e,t={},n={}){let o=t.method??"GET",s={},r;t.body!==void 0&&(s["Content-Type"]="application/json",r=JSON.stringify(t.body));let a=await this.access?.authorization(n.auth?"unauthorized":"initial");a&&(s.Authorization=a);let l=o==="GET"||e.endsWith("/hold/resume")?new AbortController:null,c=l?setTimeout(()=>l.abort(),4e4):null,d,p;try{d=await fetch(`${this.base}${e}`,{method:o,headers:s,body:r,credentials:"omit",...l?{signal:l.signal}:{}}),p=(d.headers.get("content-type")??"").includes("application/json")?await d.json().catch(h=>{if(l?.signal.aborted)throw h;return null}):null}finally{c!==null&&clearTimeout(c)}if(!d.ok){let u=p,h=u?.code??u?.error;if(this.access?.configured&&(d.status===401||d.status===403||d.status===422)&&await this.access.handleFailure(d.status,h)&&!n.auth)return this.request(e,t,{...n,auth:!0});if(d.status===409){let g=h?ac[h]:void 0,T=u?.conflicts?.map(w=>w.label)??t.labels??[];g&&this.onObjectUnavailable?.({labels:T,reason:g,code:h})}let y;if(d.status===429&&(y=ki(d.headers.get("Retry-After"),u?.retryAfterSeconds)??Bo,o==="GET"&&!n.rateLimit&&y<=Do))return await new Promise(g=>setTimeout(g,y*1e3)),this.request(e,t,{...n,rateLimit:!0});throw new j(d.status,u?.error??`request_failed_${d.status}`,h,u?.conflicts,u?.reason,y)}return p}async requestBlob(e,t={}){let n={},o=await this.access?.authorization(t.auth?"unauthorized":"initial");o&&(n.Authorization=o);let s=await fetch(`${this.base}${e}`,{method:"GET",headers:n,credentials:"omit"});if(s.ok)return s.blob();let a=(s.headers.get("content-type")??"").includes("application/json")?await s.json().catch(()=>null):null,l=a?.code??a?.error;if(this.access?.configured&&(s.status===401||s.status===403||s.status===422)&&await this.access.handleFailure(s.status,l)&&!t.auth)return this.requestBlob(e,{...t,auth:!0});let c;if(s.status===429&&(c=ki(s.headers.get("Retry-After"),a?.retryAfterSeconds)??Bo,!t.rateLimit&&c<=Do))return await new Promise(d=>setTimeout(d,c*1e3)),this.requestBlob(e,{...t,rateLimit:!0});throw new j(s.status,a?.error??`request_failed_${s.status}`,l,void 0,void 0,c)}chart(e){return this.request(`/pub/events/${encodeURIComponent(e)}/chart`)}eventConfiguration(e){return this.request(`/pub/events/${encodeURIComponent(e)}/event-configuration`)}reportViewEvidence(e,t){return this.request(`/pub/events/${encodeURIComponent(e)}/view-evidence-reports`,{method:"POST",body:{seatId:t.seatId,...t.evidenceId?{evidenceId:t.evidenceId}:{},...t.message?{message:t.message}:{}}})}asset(e,t){return/^[a-zA-Z0-9._-]+$/.test(t)?this.requestBlob(`/pub/events/${encodeURIComponent(e)}/assets/${encodeURIComponent(t)}`):Promise.reject(new j(404,"not_found","not_found"))}objects(e){return this.request(`/pub/events/${encodeURIComponent(e)}/objects?compact=1`)}hold(e,t,n,o){return this.request(`/pub/events/${encodeURIComponent(e)}/hold`,{method:"POST",body:{selections:t,...n?{ttlMs:n}:{},...o?{replaceHoldId:o}:{},...this.referral?{referral:this.referral}:{}},labels:t.map(s=>s.label)})}bestAvailable(e,t,n,o,s){return this.request(`/pub/events/${encodeURIComponent(e)}/best-available`,{method:"POST",body:{qty:t,...n?{categoryKey:n}:{},...o?{zoneId:o}:{},...s?{ttlMs:s}:{},...this.referral?{referral:this.referral}:{}}})}resume(e,t){return this.request(`/pub/events/${encodeURIComponent(e)}/hold/resume`,{method:"POST",body:{holdId:t}})}release(e,t,n){return this.request(`/pub/events/${encodeURIComponent(e)}/release`,{method:"POST",body:{labels:t,holdId:n}})}extend(e,t,n){return this.request(`/pub/events/${encodeURIComponent(e)}/extend`,{method:"POST",body:{holdId:t,...n?{ttlMs:n}:{}}})}paymentOptions(e){return this.request(`/pub/events/${encodeURIComponent(e)}/payment-options`)}availability(e,t=!1){return this.request(`/pub/events/${encodeURIComponent(e)}/availability${t?"?live=1":""}`)}startCheckout(e,t){return this.request(`/pub/events/${encodeURIComponent(e)}/checkout`,{method:"POST",body:t})}orderStatus(e){return this.request(`/pub/orders/${encodeURIComponent(e)}/status`)}subscribeTicket(e){return this.request(`/pub/events/${encodeURIComponent(e)}/subscribe-tickets`,{method:"POST",body:{}})}subscribeUrl(e){let t=this.base.replace(/^http/,"ws"),n=new URLSearchParams({surface:"picker",viewerId:this.viewerId});return`${t}/pub/events/${encodeURIComponent(e)}/subscribe?${n}`}socketUrl(e){return this.accessScoped?"":this.subscribeUrl(e)}socketProtocols(e){return this.accessScoped?[]:[Je]}createRealtime(e,t){return this.accessScoped?null:new Ee({url:this.subscribeUrl(e),sink:t})}};var oe=require("@seatlayer/core");var Ct=require("@seatlayer/core");var pe=require("@seatlayer/core"),Zo=require("@seatlayer/core/core/seatConfidence");var Go=require("@seatlayer/core"),Uo=require("@seatlayer/core/core/cdnAsset");var lc=/^data:image\/(?:png|jpe?g|webp|gif|avif);base64,[a-z0-9+/]+={0,2}$/i,cc=/[\s"'<>`\\]/;function dc(i){return i.startsWith("//")?!1:i.startsWith("/")||i.startsWith("./")||i.startsWith("../")}function pc(){try{let i=typeof location>"u"?"":location.origin;return i&&i!=="null"?i:null}catch{return null}}function xt(i){if(typeof i!="string"||!i||i.length>2e6||i!==i.trim())return!1;if(i.startsWith("data:"))return lc.test(i);if(cc.test(i))return!1;let e=pc();if(dc(i)){if(!e)return!1;try{let t=new URL(i,e);return t.origin===e&&!t.username&&!t.password}catch{return!1}}try{let t=new URL(i);return t.username||t.password?!1:t.protocol==="https:"||e!=null&&t.origin===e}catch{return!1}}var yc=require("@seatlayer/core/core/cdnAsset");function b(i,e){let t=(0,Go.t)(i);return t===i?e:t}function et(){return globalThis.matchMedia?.("(pointer: coarse)").matches??!1?b("picker.dragToLookTouch","Drag to look \xB7 pinch to zoom \xB7 tap \u2715 to close"):b("picker.dragToLookMouse","Drag to look \xB7 pinch or scroll to zoom \xB7 Esc to close")}function Ti(){return{rotate:b("picker.dragToRotateVenue","Drag to rotate the venue"),move:b("picker.dragToMoveVenue","Drag to move the venue"),zoomIn:b("picker.zoomIn","Zoom in"),zoomOut:b("picker.zoomOut","Zoom out"),fitView:b("picker.fitWholeVenue","Show whole venue")}}function qo(i,e){let t=e?i.toLocaleUpperCase(e):i.toLocaleUpperCase(),n=e?i.toLocaleLowerCase(e):i.toLocaleLowerCase();if(i!==t||t===n)return i;let o=[...n][0]??"";return(e?o.toLocaleUpperCase(e):o.toLocaleUpperCase())+n.slice(o.length)}function Ko(i){if(typeof i=="string"){let e=document.querySelector(i);if(!e)throw new Error(`seatmap: container "${i}" not found`);return e}if(!(i instanceof HTMLElement))throw new Error("seatmap: container must be a CSS selector or an HTMLElement");return i}function B(i){return String(i??"").replace(/[&<>"']/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[e])}function Wo(i,e,t){let n=e.find(s=>xt(s))??null;if(i.replaceChildren(),!n)return i.textContent=t.slice(0,1).toUpperCase(),null;let o=document.createElement("img");return o.alt="",o.referrerPolicy="no-referrer",o.src=n,i.appendChild(o),n}var St=null;function Ei(){if(St!==null)return St;try{if(typeof document>"u")return St=!1;St=!!document.createElement("canvas").getContext("webgl2")}catch{St=!1}return St}function Rn(i){return(0,Uo.cdnAssetUrl)(i)}var Zt=null;function Qt(){return Zt||(Zt=(typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?import(Rn("seatlayer-view3d.mjs")):import("@seatlayer/core/view3d")).catch(e=>{throw Zt=null,e}),Zt)}function Ci(){(typeof navigator>"u"?void 0:navigator.connection)?.saveData||Qt().catch(()=>{})}async function Ai(){return typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?import(Rn("seatlayer-panorama.mjs")):import("@seatlayer/core")}async function Pi(){return typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?import(Rn("seatlayer-checkout.mjs")):Promise.resolve().then(()=>(jo(),$o))}function Yo(i){return i==="unavailable_for_event"||i==="payments_off_for_event"?i:"not_configured"}function Li(i,e,t){let n={month:"short",day:"numeric",hour:"numeric",minute:"2-digit"},o=new Date(i);if(e)try{return o.toLocaleString(t,{...n,timeZone:e})}catch{}return o.toLocaleString(t,n)}function In(i){return String(i??"\u2014").replace(/[&<>"]/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[e])}function E(i){return String(i??"").replace(/[&<>"]/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[e])}function On(i){return i?(0,pe.seatNoteRowModel)(i).map(e=>({...e,title:b(e.titleKey,e.titleFallback)})):[]}function Qo(i){return On(i).map(e=>e.title)}function tt(i,e={}){let t=On(i);if(!t.length)return"";let n=e.compact?15:17,o=t.map(s=>`<div class="sl-note sl-note-${E(s.tone)}"><span class="sl-note-i">${(0,pe.seatTypeIconSvg)(s.icon,{size:n})}</span><span class="sl-note-t"><b>${E(s.title)}</b>`+(s.note?`<span class="sl-note-n">${E(s.note)}</span>`:"")+"</span></div>").join("");return`<div class="sl-notes${e.compact?" compact":""}">${o}</div>`}function Jo(i){return On(i).map(e=>{let t=E(e.note?`${e.title}: ${e.note}`:e.title);return`<span class="sl-cx-mark sl-cx-mark-${E(e.tone)}" role="img" aria-label="${t}" title="${t}">${(0,pe.seatTypeIconSvg)(e.icon,{size:13})}</span>`}).join("")}function Mi(i){let e=[];return i?.restrictedView&&e.push(b("picker.restrictedView","Restricted view")),i?.obstructedView&&e.push(b("picker.obstructedView","Obstructed view")),e}function _n(i,e){if(!i)return"";let t=e?b("picker.viewFromThisSeat","View from this seat"):b("picker.seeItIn3d","See it in 3D"),n=e?b("picker.viewFromHere","View from here"):t;return`<button type="button" class="sl-confirm-3d" aria-label="${t}"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2l9 5v10l-9 5-9-5V7z"/><path d="M12 12l9-5M12 12v10M12 12L3 7"/></svg><span>${n}</span></button>`}function es(i,e){if(!e)return"";let t=e,n=t.includes(i.id),o=n?t.length>1?b("picker.openComparison","Open comparison"):b("picker.savedForComparison","Saved for comparison"):t.length?b("picker.compareWithSaved","Compare with saved"):b("picker.saveToCompare","Save to compare");return`<button type="button" class="sl-confirm-compare"${n&&t.length===1?" disabled":""}><span aria-hidden="true">\u21C4</span><span>${E(o)}</span></button>`}function ts(i,e,t){if(!t)return"";let n=(0,Zo.seatConfidenceDisclosure)(i.confidenceEvidence),o=n.modeledTarget??n.reality;return`<button type="button" class="sl-confirm-confidence" aria-label="Open seat confidence passport for ${E(i.displayLabel??i.label)}"><span><em>${E(e)}</em><strong>${E(n.headline)}</strong><small>${E(o)}</small></span><b>Passport</b></button>`}function Q(i){let e=i?.rowLabel,t=i?.sectionLabel;if(!e||!t)return e;for(let n of["-"," ","\xB7","/","_"]){let o=`${t}${n}`;if(e.startsWith(o)&&e.length>o.length)return e.slice(o.length)}return(0,pe.compactRowLabel)(e,t)}function vc(i){switch(i){case"paused":return{title:b("picker.accessPausedTitle","These seats are on hold right now"),body:b("picker.accessPausedBody","The organizer has paused this selection. Try again in a few minutes."),action:b("picker.accessRetry","Try again")};case"revoked":return{title:b("picker.accessRevokedTitle","This access link is no longer active"),body:b("picker.accessRevokedBody","Ask whoever sent you here for a new link to keep booking these seats."),action:b("picker.accessRefresh","Refresh")};case"no_token":case"provider_failed":return{title:b("picker.accessExpiredTitle","The seat map timed out"),body:b("picker.accessExpiredBody","Any seats you\u2019re holding stay held. Refresh to see what\u2019s available now."),action:b("picker.accessRefresh","Refresh")};default:return{title:b("picker.accessInvalidTitle","We couldn\u2019t verify your access"),body:b("picker.accessInvalidBody","You can still book anything shown as available. Contact whoever sent you here for access to the rest."),action:b("picker.accessRefresh","Refresh")}}}var wc=6;function is(i,e,t){let n=In;return[i?.sectionLabel?`<div class="sl-confirm-field sl-confirm-sec${i.sectionLabel.length>wc?" sl-confirm-sec-long":""}"><span class="sl-confirm-key">${b("picker.section","Section")}</span><span class="sl-confirm-value">${n(i.sectionLabel)}</span></div>`:"",i?.rowLabel||i?.objectType==="booth"?`<div class="sl-confirm-field"><span class="sl-confirm-key">${n(t)}</span><span class="sl-confirm-value">${n(Q(i)??i?.displayLabel??e)}</span></div>`:"",i?.objectType!=="booth"?`<div class="sl-confirm-field"><span class="sl-confirm-key">${b("picker.seat","Seat")}</span><span class="sl-confirm-value">${n(i?.seatNumber??i?.displayLabel??e)}</span></div>`:""].filter(Boolean).join("")}function ns(i,e,t){let n=In,o=i?.objectType==="booth",s=i?.objectType==="table"&&!!i?.bookingMode,r=o||s||!i?.seatNumber,a=i?.sectionLabel??(r?void 0:i?.displayLabel),l=s?`${b("picker.guests","Guests")} ${i?.bookingMode==="variable"?`${i?.minOccupancy}\u2013${i?.maxOccupancy}`:i?.capacity}`:void 0,d=(r?[l,a?i?.rowLabel??i?.displayLabel:void 0]:[i?.rowLabel?`${t} ${Q(i)??""}`.trim():void 0,`${b("picker.seat","Seat")} ${i?.seatNumber??e}`]).filter(Boolean).join(" \xB7 ");return(a?`<span class="sl-confirm-place">${n(a)}</span>`:"")+(d?`<span class="sl-confirm-pos">${a?" \xB7 ":""}${n(d)}</span>`:"")+(a||d?"":`<span class="sl-confirm-pos">${n(e)}</span>`)}function os(i,e){if(!i)return"";let t=e?b("picker.viewFromThisSeat","View from this seat"):b("picker.seeItIn3d","See it in 3D");return`<button type="button" class="sl-confirm-pill sl-confirm-3dpill" aria-label="${t}" title="${t}"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2l9 5v10l-9 5-9-5V7z"/><path d="M12 12l9-5M12 12v10M12 12L3 7"/></svg><span aria-hidden="true">3D</span></button>`}function ss(i,e){if(!i||e)return"";let t=b("picker.seeItIn3d","See it in 3D");return`<button type="button" class="sl-confirm-3drow" aria-label="${t}" title="${t}"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2l9 5v10l-9 5-9-5V7z"/><path d="M12 12l9-5M12 12v10M12 12L3 7"/></svg><span aria-hidden="true">3D</span></button>`}function Xo(i){return i.buyerMessage?.trim()||(i.restriction==="companion"?b("picker.companionRequiresWheelchair","Requires the adjacent wheelchair place"):void 0)}function rs(i,e,t){let n=In;if(i.length>1)return`<fieldset class="sl-confirm-tiers"><legend>${b("picker.ticketType","Ticket type")}</legend>`+i.map(r=>{let a=Xo(r);return`<button type="button" class="sl-confirm-tier" data-confirm-tier="${n(r.id)}" aria-pressed="${r.id===e}"><span class="sl-confirm-tier-copy"><span class="sl-confirm-tier-name">${n(r.name)}</span>`+(a?`<small class="sl-confirm-tier-note">${n(a)}</small>`:"")+`</span><span class="sl-confirm-tier-price">${n(t(r))}</span></button>`}).join("")+"</fieldset>";let o=i[0],s=o?Xo(o):void 0;return s?`<p class="sl-confirm-tier-note">${n(s)}</p>`:""}function as(i){return'<div class="sl-confirm-grid">'+i.identityFields+`</div><div class="sl-confirm-cat"><span class="sl-confirm-cat-name">${E(i.categoryLabel)}</span>`+(i.priceLabel?`<span class="sl-confirm-price">${E(i.priceLabel)}</span>`:"")+'</div><div class="sl-confirm-id">'+i.marker+`<span class="sl-confirm-dot" style="background:${E(i.categoryColor)}" aria-hidden="true"></span><span class="sl-sr">${E(i.categoryLabel)}</span><span class="sl-confirm-who">`+i.identity+"</span>"+(i.priceLabel?`<span class="sl-confirm-idprice">${E(i.priceLabel)}</span>`:"")+'</div><div class="sl-confirm-body">'+i.commercial+i.tierChoices+i.groupDates+i.wheelchair+(i.thumb||i.see3dPill?`<div class="sl-confirm-strip">${i.thumb}<span class="sl-confirm-pills">${i.see3dPill}</span></div>`:"")+i.inspect+'<div class="sl-confirm-row">'+(i.see3dRow??"")+`<button type="button" class="sl-confirm-cancel">${E(i.cancelLabel)}</button><button type="button" class="sl-confirm-add"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M5 12.5l4 4L19 7"/></svg><span class="sl-confirm-add-t">${E(i.selectLabel)}</span></button></div></div>`}function ls(i,e){let t=B,{variable:n}=e;return`<section class="sl-table-dialog" role="dialog" aria-modal="true" aria-labelledby="sl-table-title" aria-describedby="sl-table-copy"><div class="sl-table-head"><div class="sl-table-eyebrow">${t(n?(0,pe.t)("picker.flexiblePartyTypeWord",{typeWord:e.typeWord}):(0,pe.t)("picker.wholeTypeWord",{typeWord:e.typeWord}))}</div><h2 class="sl-table-title" id="sl-table-title">${t(i.displayLabel??i.label)}</h2><p class="sl-table-copy" id="sl-table-copy">${t(n?b("picker.chooseGuestsCopy","Choose how many guests will sit together. This table is held exclusively for your party."):(0,pe.t)("picker.allPlacesBookedTogether",{count:i.capacity}))}</p></div><div class="sl-table-body"><div class="sl-table-summary"><span>${t(e.categoryLabel)}</span>`+(e.suppressPricing?"":`<b data-table-unit>${t((0,pe.t)("picker.perGuestPrice",{price:e.unitPrice}))}</b>`)+`<span class="muted">${t(b("picker.tableCapacity","Table capacity"))}</span><span>${t((0,pe.t)("picker.guestsCount",{count:i.capacity}))}</span>`+(e.suppressPricing?"":`<span class="muted">${t(b("picker.total","Total"))}</span><b data-table-total></b>`)+"</div>"+(n?`<label class="sl-table-qtylabel" id="sl-table-qty-label">${t(b("picker.numberOfGuests","Number of guests"))}</label><div class="sl-table-stepper" role="group" aria-labelledby="sl-table-qty-label"><button type="button" data-table-step="-1" aria-label="${t(b("picker.fewerGuests","Fewer guests"))}">\u2212</button><output aria-live="polite" data-table-qty>${i.quantity}</output><button type="button" data-table-step="1" aria-label="${t(b("picker.moreGuests","More guests"))}">+</button></div><div class="sl-table-range">${t((0,pe.t)("picker.chooseMinMaxGuests",{min:i.minOccupancy,max:i.maxOccupancy}))}</div>`:`<input type="hidden" data-table-qty value="${i.capacity}">`)+`<div class="sl-table-actions"><button type="button" class="sl-table-cancel">${t((0,pe.t)("common.cancel"))}</button><button type="button" class="sl-table-confirm">${t(e.held?b("picker.updateTable","Update table"):n?b("picker.selectTable","Select table"):b("picker.selectWholeTable","Select whole table"))}</button></div></div></section>`}function cs(i,e){let t=vc(i),n=document.createElement("div");n.className="sl-interrupt sl-access",n.setAttribute("role","status"),n.setAttribute("aria-live","polite");let o=document.createElement("div");o.className="sl-interrupt-card";let s=document.createElement("div");s.className="sl-interrupt-title",s.textContent=t.title;let r=document.createElement("div");r.className="sl-interrupt-body",r.textContent=t.body,o.append(s,r);let a=document.createElement("div");a.className="sl-interrupt-actions";let l=document.createElement("button");l.type="button",l.className="sl-interrupt-act";let c=document.createElement("span");c.className="sl-interrupt-act-icon",c.setAttribute("aria-hidden","true"),c.textContent="\u21BB";let d=document.createElement("span");return d.textContent=t.action,l.append(c,d),l.addEventListener("click",async()=>{n.classList.add("is-reloading"),l.disabled=!0;try{await e()}catch{}finally{n.isConnected&&(n.classList.remove("is-reloading"),l.disabled=!1)}}),a.appendChild(l),o.appendChild(a),n.appendChild(o),n}function ds(i,e){return`<div class="sl-a11yhead"><span class="sl-a11yhead-t">${E(i)}</span><button type="button" class="sl-a11yclose" data-a11y-close aria-label="${B(e)}"><svg viewBox="0 0 24 24" aria-hidden="true"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg></button></div>`}function ps(i){return i.map(e=>{let t=`<button type="button" role="switch" class="sl-a11yrow${e.className?` ${e.className}`:""}${e.on?" on":""}" data-a11y-row="${E(e.key)}" aria-checked="${e.on}" aria-pressed="${e.on}"`+(e.disabled?' disabled aria-disabled="true"':"")+`><span class="sl-a11yrow-i" aria-hidden="true">${e.iconHtml}</span><span class="sl-a11yrow-t"><span class="sl-a11yrow-l">${E(e.label)}</span></span>`+(e.count?`<span class="sl-a11yrow-c">${E(e.count)}</span>`:"")+'<span class="sl-a11yrow-s" aria-hidden="true"></span></button>';return e.note?`<div class="sl-a11yrow-w">${t}${kt({id:`sl-info-${B(e.key.replace(/[^A-Za-z0-9]+/g,"-"))}`,label:e.note,text:E(e.note)})}</div>`:t}).join("")}function kt(i){return`<span class="sl-info"${i.wrapRef?` data-ref="${B(i.wrapRef)}"`:""}><button type="button" class="sl-info-btn" data-sl-info aria-label="${B(i.label)}" aria-describedby="${B(i.id)}" aria-expanded="false"><svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="12" r="9"/><path d="M12 11v5"/><path d="M12 8h.01"/></svg></button><span class="sl-info-pop" role="tooltip" id="${B(i.id)}"${i.ref?` data-ref="${B(i.ref)}"`:""}>${i.text}</span></span>`}var Ii=require("@seatlayer/core/core/color");function Re(i){if(!i)return null;let e=i.trim().toLowerCase();if(e==="white")return{r:255,g:255,b:255};if(e==="black")return{r:0,g:0,b:0};let t=/^#([0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i.exec(e)?.[1];if(t){let o=t.length<=4?[...t].map(s=>`${s}${s}`).join(""):t;return{r:Number.parseInt(o.slice(0,2),16),g:Number.parseInt(o.slice(2,4),16),b:Number.parseInt(o.slice(4,6),16)}}let n=/^rgba?\(\s*([\d.]+)[,\s]+([\d.]+)[,\s]+([\d.]+)(?:\s*[,/]\s*[\d.]+%?)?\s*\)$/i.exec(e);return n?{r:Math.max(0,Math.min(255,Number(n[1]))),g:Math.max(0,Math.min(255,Number(n[2]))),b:Math.max(0,Math.min(255,Number(n[3])))}:null}function Hi(i){return(0,Ii.relativeLuminance255)([i.r,i.g,i.b])}function Se(i,e){let t=Re(i),n=Re(e);if(!t||!n)return null;let o=Math.max(Hi(t),Hi(n)),s=Math.min(Hi(t),Hi(n));return(o+.05)/(s+.05)}function it(i,e="#172033",t="#eef1f8"){return(Se(e,i)??0)>=(Se(t,i)??0)?e:t}function xc(i){return(0,Ii.rgb255ToHex)(i.r,i.g,i.b)}function Nn(i,e,t){let n=Re(i),o=Re(e);if(!n||!o)return null;let s=Math.max(0,Math.min(1,t));return xc({r:n.r*s+o.r*(1-s),g:n.g*s+o.g*(1-s),b:n.b*s+o.b*(1-s)})}var Ri="#d8a425",Sc=.18;function hs(i,e){let t=Nn(Ri,e,Sc)??e;if((Se(Ri,t)??0)>=4.5)return Ri;for(let n=.15;n<=1;n+=.05){let o=Nn(Ri,i,1-n);if(o&&(Se(o,t)??0)>=4.5)return o}return it(t)}function us(i,e,t,n){if((Se(i,t)??4.5)>=4.5&&(Se(i,n)??4.5)>=4.5)return i;if(!Re(i)||!Re(e))return e;for(let o=.15;o<=1;o+=.05){let s=Nn(i,e,1-o);if(s&&(Se(s,t)??0)>=4.5&&(Se(s,n)??0)>=4.5)return s}return e}function ms(i){return{"--sl-chrome":i?"#d6dce6":"#556278","--sl-chrome-line":i?"rgba(23,32,51,.55)":"rgba(233,238,247,.55)"}}var fs=["--sl-bg","--sl-surface","--sl-text","--sl-muted","--sl-line","--sl-accent-text","--sl-warn-text","--sl-chrome","--sl-chrome-line"];function gs(i,e){let t=e??i["--sl-bg"],n=Re(t)?it(t)==="#172033":!1,o=Re(i["--sl-bg"])?it(i["--sl-bg"])==="#172033":!1;if(n===o)return null;let s=n?"#ffffff":"#1a2234",r=it(t),a=i["--sl-accent"];return{"--sl-bg":t,"--sl-surface":s,"--sl-text":r,"--sl-muted":n?"#667085":"#a5aec2","--sl-line":n?"rgba(23,32,51,.16)":"rgba(165,174,194,.24)","--sl-accent-text":us(a,r,t,s),...ms(n),"--sl-warn-text":hs(r,s)}}var bs={light:{background:"#ffffff",surface:"#f6f7fb",text:"#172033",muted:"#667085",line:"rgba(23,32,51,.16)",map:"#e9edf4"},dark:{background:"#0f1522",surface:"#1a2234",text:"#eef1f8",muted:"#a5aec2",line:"rgba(165,174,194,.24)",map:"#0f1522"}};function kc(){try{return window.matchMedia?.("(prefers-color-scheme: dark)").matches===!0}catch{return!1}}function Jt(i){if(i)return i==="auto"?kc()?"dark":"light":i}function Tt(i,e=i?.mode){if(i?.map)return i.map;let t=Jt(e);return t?{background:bs[t].map}:null}function Oi(i){let e;try{e=window.matchMedia?.("(prefers-color-scheme: dark)")}catch{return()=>{}}if(!e)return()=>{};let t=n=>i(n.matches);return typeof e.addEventListener=="function"?e.addEventListener("change",t):e.addListener?.(t),()=>{typeof e.removeEventListener=="function"?e.removeEventListener("change",t):e.removeListener?.(t)}}function Et(i,e,t){let n=t?bs[t]:null,o=e?.background??n?.background??i?.background??"#0f1522",s=Re(o)?it(o)==="#172033":!1,r=e?.surface??n?.surface??(s?"#ffffff":"#1a2234"),a=e?.accent??i?.accent??"#f4b740",l=i?.accentInk,c=e?.accentInk??(l&&(Se(l,a)??4.5)>=4.5?l:it(a,"#1a1200","#ffffff")),d=n?void 0:i?.textColor,p=e?.text??n?.text??(d&&(Se(d,o)??4.5)>=4.5&&(Se(d,r)??4.5)>=4.5?d:it(o));return{"--sl-accent":a,"--sl-accent-ink":c,"--sl-accent-text":us(a,p,o,r),"--sl-warn-text":hs(p,r),"--sl-bg":o,"--sl-surface":r,"--sl-text":p,"--sl-muted":e?.muted??n?.muted??(s?"#667085":"#a5aec2"),"--sl-line":e?.line??n?.line??(s?"rgba(23,32,51,.16)":"rgba(165,174,194,.24)"),...ms(s),"--sl-scrim-ink":s?"rgba(16,22,36,1)":"rgba(4,7,13,1)","--sl-font":e?.fontFamily??i?.fontFamily??"-apple-system,BlinkMacSystemFont,'Segoe UI',Inter,sans-serif","--sl-radius":`${e?.radius??14}px`}}function Tc(){return`<svg class="sl-boot-venue" viewBox="0 0 200 140" preserveAspectRatio="xMidYMid meet" aria-hidden="true" focusable="false"><g class="sl-boot-shells">${["M20 92a80 52 0 0 1 160 0v14a94 62 0 0 0-160 0z","M32 74a68 42 0 0 1 136 0v12a80 50 0 0 0-136 0z","M46 58a54 32 0 0 1 108 0v10a64 38 0 0 0-108 0z"].map(e=>`<path d="${e}" />`).join("")}</g><rect class="sl-boot-stage" x="62" y="16" width="76" height="16" rx="4" /></svg>`}function ys(i,e,t){let n=document.createElement("div");n.className="sl-picker",n.tabIndex=-1,n.lang=(0,Ct.getLocale)(),n.dir=(0,Ct.localeDirection)(),i.appendChild(n),Object.entries(Et(void 0,t)).forEach(([s,r])=>n.style.setProperty(s,r)),n.innerHTML=`
41
+ `});var bh={};Io(bh,{ApiError:()=>j,BuyerAccessContext:()=>me,BuyerAccessUnavailableError:()=>re,BuyerRealtimeClient:()=>Ee,EmbeddedDesigner:()=>on,PerformanceGroupDestroyedError:()=>J,PerformanceGroupPicker:()=>Cn,SEATING_CHART_CALLBACK_PROPS:()=>Zn,SEATING_CHART_HANDLE_METHODS:()=>Wn,SEATING_CHART_IDENTITY_PROPS:()=>Yn,SEATING_CHART_VALUE_PROPS:()=>Xn,SeasonApiError:()=>z,SeasonPicker:()=>Ln,SeasonPublicSessionRefused:()=>ui,SeasonRecoveryTimeoutError:()=>gi,SeatPicker:()=>Ke,SeatingChart:()=>nn,attachPickerFrame:()=>Xl,bindSeatingChartHandle:()=>sr,buildSeatingChartOptions:()=>rr,createBuyerAccessContext:()=>Ht,createControllerSink:()=>wt,parseTicketOfferAvailability:()=>rn,shortOperationReference:()=>Vt,ticketOfferPrices:()=>an});module.exports=nc(bh);var $=require("@seatlayer/core");var Je="seatlayer.v1";function oc(i){let e=typeof i.default=="string"?i.default:"free",t={};if(i.seats&&typeof i.seats=="object")for(let[n,o]of Object.entries(i.seats))typeof o=="string"&&o!==e&&(t[n]=o);return{default:e,exceptions:t}}function sc(i,e){if(!i||i.default!==e.default)return null;let t=[];for(let[n,o]of Object.entries(e.exceptions))i.exceptions[n]!==o&&t.push({label:n,status:o});for(let n of Object.keys(i.exceptions))n in e.exceptions||t.push({label:n,status:e.default});return t}function rc(i,e){for(let t of e)t.status===i.default?delete i.exceptions[t.label]:i.exceptions[t.label]=t.status}function No(i){if(/(?:^|[?&#])(?:token|access_token|bearer|authorization|ticket|tkt|bse)=/i.test(i))throw new Error("seatlayer: refusing to open a socket with a credential in the URL");if(/\bbse_[A-Za-z0-9._-]+/.test(i))throw new Error("seatlayer: refusing to open a socket with a credential in the URL")}var Ee=class{constructor(e){this.ws=null;this.stopped=!0;this.attempt=0;this.reconnectTimer=null;this.pingTimer=null;this.pongTimer=null;this.resumeTimer=null;this.projection=null;this.version=null;this.v1=!1;this.useQueryMarker=!1;this.hidden=null;this.closedSections=null;this.opts=e,No(e.url)}get protocol(){return this.ws?this.v1?"v1":"legacy":null}get snapshotVersion(){return this.version}start(){this.stopped&&(this.stopped=!1,this.connect())}stop(){this.stopped=!0,this.clearTimers();let e=this.ws;if(this.ws=null,e){e.onopen=null,e.onmessage=null,e.onclose=null,e.onerror=null;try{e.close()}catch{}}}restart(){this.stop(),this.projection=null,this.version=null,this.attempt=0,this.start()}async connect(){if(this.stopped)return;let e=[Je];if(this.opts.mintTicket){let s;try{s=await this.opts.mintTicket()}catch(r){this.reportIfAccessError(r),this.scheduleReconnect();return}if(this.stopped)return;s?.protocols?.length?(e=[...s.protocols],e.includes(Je)||e.unshift(Je)):s?.ticket&&(e=[Je,`tkt.${s.ticket}`])}let t=this.version!==null;t&&e.push(`sv.${this.version}`);let n=this.useQueryMarker?`${this.opts.url}${this.opts.url.includes("?")?"&":"?"}pv=1`:this.opts.url;No(n);let o;try{o=(this.opts.socketFactory??((r,a)=>new WebSocket(r,a)))(n,e)}catch{this.scheduleReconnect();return}this.ws=o,o.onopen=()=>{this.ws===o&&(this.attempt=0,this.v1=o.protocol===Je,this.v1||(this.useQueryMarker=!0),this.startKeepalive(o),t?this.resumeTimer=setTimeout(()=>{this.resumeTimer=null,this.opts.sink.resync()},5e3):this.resumeTimer=setTimeout(()=>{this.resumeTimer=null,this.opts.sink.resync({reason:"connect"})},5e3))},o.onmessage=s=>{if(this.ws!==o)return;let r;try{r=JSON.parse(typeof s.data=="string"?s.data:"")}catch{return}!r||typeof r!="object"||this.handleFrame(r)},o.onclose=s=>{if(this.ws===o){if(this.ws=null,this.clearTimers(),s?.code===4401){if(s.reason==="access_expired"){this.scheduleReconnect();return}this.stopped=!0,this.opts.onAccessUnavailable?.({reason:"revoked",code:"access_revoked",retryable:!1});return}this.scheduleReconnect()}},o.onerror=()=>{try{o.close()}catch{}}}handleFrame(e){let t=typeof e.type=="string"?e.type:"";if(e.protocol===1&&(this.v1=!0),typeof e.snapshotVersion=="number"&&(this.version=e.snapshotVersion),t==="pong"){this.clearPongTimer();return}if(Array.isArray(e.hidden)||Array.isArray(e.closed)){let n=Array.isArray(e.hidden)?e.hidden:[],o=Array.isArray(e.closed)?e.closed:[],s=n.join("\0"),r=o.join("\0");(s!==this.hidden||r!==this.closedSections)&&(this.hidden=s,this.closedSections=r,this.opts.sink.onSections?.(n,o,{withInventory:t==="snapshot"||!!e.seats}))}if(t!=="hidden"){if(t==="presence"){this.opts.sink.onPresence?.({shoppingSessions:Number(e.shoppingSessions)||0,activeHolds:Number(e.activeHolds)||0});return}if(t!=="allocation"){if(t==="snapshot"||!t&&e.seats){this.answered();let n=oc(e),o=sc(this.projection,n);this.projection=n,o===null?this.opts.sink.applyProjection?this.opts.sink.applyProjection(n):this.opts.sink.resync():o.length&&this.opts.sink.applyStatuses(o);return}if(t==="delta"&&Array.isArray(e.changes)){this.answered();let n=e.changes.filter(o=>typeof o?.label=="string"&&typeof o?.status=="string").map(o=>({label:o.label,status:o.status}));if(!n.length)return;this.projection&&rc(this.projection,n),this.opts.sink.applyStatuses(n)}}}}answered(){this.resumeTimer&&(clearTimeout(this.resumeTimer),this.resumeTimer=null)}reportIfAccessError(e){let t=e?.reason;e?.name==="BuyerAccessUnavailableError"&&(this.stopped=!0,this.opts.onAccessUnavailable?.({reason:t??"invalid",code:e.code,status:e.status,retryable:t==="paused"}))}startKeepalive(e){this.pingTimer=setInterval(()=>{if(this.ws===e){try{e.send(JSON.stringify({type:"ping"}))}catch{return}this.clearPongTimer(),this.pongTimer=setTimeout(()=>{this.pongTimer=null;try{e.close()}catch{}},1e4)}},25e3)}scheduleReconnect(){if(this.stopped||this.reconnectTimer)return;let e=Math.min(this.attempt++,5),t=Math.min(1e3*2**e,15e3),n=Math.random()*t;this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},n)}clearPongTimer(){this.pongTimer&&(clearTimeout(this.pongTimer),this.pongTimer=null)}clearTimers(){this.pingTimer&&clearInterval(this.pingTimer),this.pingTimer=null,this.clearPongTimer(),this.reconnectTimer&&clearTimeout(this.reconnectTimer),this.reconnectTimer=null,this.resumeTimer&&clearTimeout(this.resumeTimer),this.resumeTimer=null}};function ac(i){return i==="blocked"?"not_for_sale":i==="held"||i==="booked"||i==="free"||i==="not_for_sale"?i:"free"}function wt(i,e={}){let t=n=>{let o=i.tableSelection(n);if(o)return o.physicalSeatIds;let s=i.idForLabel(n);return s?[s]:[]};return{applyStatuses(n){let o=new Set([...i.currentHold()?.labels??[],...e.ownLabels?.()??[]]),s={free:[],held:[],booked:[],not_for_sale:[]},r=[],a=[],l=new Map(i.getSelection().map(c=>[c.label,c.id]));for(let c of n){let d=t(c.label);if(!d.length)continue;let p=ac(c.status);if(s[p].push(...d),e.flashOnLiveChange&&p!=="free"&&!o.has(c.label)&&d.some(u=>i.getStatus(u)==="free")){let u=p==="held"?"#f4b740":"#f43f5e";for(let h of d)r.push({id:h,color:u})}p!=="free"&&!o.has(c.label)&&l.has(c.label)&&a.push(c.label)}for(let c of["free","held","booked","not_for_sale"])s[c].length&&i.setStatus(s[c],c);for(let c of r)i.flashSeat(c.id,c.color);if(a.length){let c=a.flatMap(p=>t(p));c.length&&i.deselect(c);let d=n.some(p=>p.status==="blocked"&&a.includes(p.label));e.onSelectedObjectUnavailable?.(a,d?"ineligible":"taken")}e.onStatusChange?.()},...i.applyProjection?{applyProjection:n=>{i.applyProjection(n)}}:{},async resync(n){await(i.resync?i.resync(n):i.refresh())},onSections(n,o,s){s?.withInventory||(i.resync?i.resync({reason:"frame"}):i.refresh()),e.onSections?.(n,o,s)}}}var j=class extends Error{constructor(e,t,n,o,s,r){super(t),this.name="ApiError",this.status=e,this.code=n,this.conflicts=o,this.reason=s,this.retryAfterS=r}},Do=10,Bo=1;function ki(i,e){let t=(i??"").trim();if(t){let n=Number(t);if(Number.isFinite(n)&&n>=0)return Math.ceil(n);let o=Date.parse(t);if(Number.isFinite(o))return Math.max(0,Math.ceil((o-Date.now())/1e3))}if(typeof e=="number"&&Number.isFinite(e)&&e>=0)return Math.ceil(e)}var lc={seat_conflict:"taken",conflict:"taken",channel_assignment_conflict:"ineligible",allocation_exhausted:"exhausted"},Ve=class{constructor(e,t={}){this.base=e;this.viewerId=typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`viewer_${Math.random().toString(36).slice(2)}${Date.now().toString(36)}`;this.access=t.access,this.onObjectUnavailable=t.onObjectUnavailable;let n=t.referral?.trim();this.referral=n?n.slice(0,120):void 0}get accessScoped(){return!!this.access?.configured}async request(e,t={},n={}){let o=t.method??"GET",s={},r;t.body!==void 0&&(s["Content-Type"]="application/json",r=JSON.stringify(t.body));let a=await this.access?.authorization(n.auth?"unauthorized":"initial");a&&(s.Authorization=a);let l=o==="GET"||e.endsWith("/hold/resume")?new AbortController:null,c=l?setTimeout(()=>l.abort(),4e4):null,d,p;try{d=await fetch(`${this.base}${e}`,{method:o,headers:s,body:r,credentials:"omit",...l?{signal:l.signal}:{}}),p=(d.headers.get("content-type")??"").includes("application/json")?await d.json().catch(h=>{if(l?.signal.aborted)throw h;return null}):null}finally{c!==null&&clearTimeout(c)}if(!d.ok){let u=p,h=u?.code??u?.error;if(this.access?.configured&&(d.status===401||d.status===403||d.status===422)&&await this.access.handleFailure(d.status,h)&&!n.auth)return this.request(e,t,{...n,auth:!0});if(d.status===409){let f=h?lc[h]:void 0,T=u?.conflicts?.map(w=>w.label)??t.labels??[];f&&this.onObjectUnavailable?.({labels:T,reason:f,code:h})}let y;if(d.status===429&&(y=ki(d.headers.get("Retry-After"),u?.retryAfterSeconds)??Bo,o==="GET"&&!n.rateLimit&&y<=Do))return await new Promise(f=>setTimeout(f,y*1e3)),this.request(e,t,{...n,rateLimit:!0});throw new j(d.status,u?.error??`request_failed_${d.status}`,h,u?.conflicts,u?.reason,y)}return p}async requestBlob(e,t={}){let n={},o=await this.access?.authorization(t.auth?"unauthorized":"initial");o&&(n.Authorization=o);let s=await fetch(`${this.base}${e}`,{method:"GET",headers:n,credentials:"omit"});if(s.ok)return s.blob();let a=(s.headers.get("content-type")??"").includes("application/json")?await s.json().catch(()=>null):null,l=a?.code??a?.error;if(this.access?.configured&&(s.status===401||s.status===403||s.status===422)&&await this.access.handleFailure(s.status,l)&&!t.auth)return this.requestBlob(e,{...t,auth:!0});let c;if(s.status===429&&(c=ki(s.headers.get("Retry-After"),a?.retryAfterSeconds)??Bo,!t.rateLimit&&c<=Do))return await new Promise(d=>setTimeout(d,c*1e3)),this.requestBlob(e,{...t,rateLimit:!0});throw new j(s.status,a?.error??`request_failed_${s.status}`,l,void 0,void 0,c)}chart(e){return this.request(`/pub/events/${encodeURIComponent(e)}/chart`)}eventConfiguration(e){return this.request(`/pub/events/${encodeURIComponent(e)}/event-configuration`)}reportViewEvidence(e,t){return this.request(`/pub/events/${encodeURIComponent(e)}/view-evidence-reports`,{method:"POST",body:{seatId:t.seatId,...t.evidenceId?{evidenceId:t.evidenceId}:{},...t.message?{message:t.message}:{}}})}asset(e,t){return/^[a-zA-Z0-9._-]+$/.test(t)?this.requestBlob(`/pub/events/${encodeURIComponent(e)}/assets/${encodeURIComponent(t)}`):Promise.reject(new j(404,"not_found","not_found"))}objects(e){return this.request(`/pub/events/${encodeURIComponent(e)}/objects?compact=1`)}hold(e,t,n,o){return this.request(`/pub/events/${encodeURIComponent(e)}/hold`,{method:"POST",body:{selections:t,...n?{ttlMs:n}:{},...o?{replaceHoldId:o}:{},...this.referral?{referral:this.referral}:{}},labels:t.map(s=>s.label)})}bestAvailable(e,t,n,o,s){return this.request(`/pub/events/${encodeURIComponent(e)}/best-available`,{method:"POST",body:{qty:t,...n?{categoryKey:n}:{},...o?{zoneId:o}:{},...s?{ttlMs:s}:{},...this.referral?{referral:this.referral}:{}}})}resume(e,t){return this.request(`/pub/events/${encodeURIComponent(e)}/hold/resume`,{method:"POST",body:{holdId:t}})}release(e,t,n){return this.request(`/pub/events/${encodeURIComponent(e)}/release`,{method:"POST",body:{labels:t,holdId:n}})}extend(e,t,n){return this.request(`/pub/events/${encodeURIComponent(e)}/extend`,{method:"POST",body:{holdId:t,...n?{ttlMs:n}:{}}})}paymentOptions(e){return this.request(`/pub/events/${encodeURIComponent(e)}/payment-options`)}availability(e,t=!1){return this.request(`/pub/events/${encodeURIComponent(e)}/availability${t?"?live=1":""}`)}startCheckout(e,t){return this.request(`/pub/events/${encodeURIComponent(e)}/checkout`,{method:"POST",body:t})}orderStatus(e){return this.request(`/pub/orders/${encodeURIComponent(e)}/status`)}subscribeTicket(e){return this.request(`/pub/events/${encodeURIComponent(e)}/subscribe-tickets`,{method:"POST",body:{}})}subscribeUrl(e){let t=this.base.replace(/^http/,"ws"),n=new URLSearchParams({surface:"picker",viewerId:this.viewerId});return`${t}/pub/events/${encodeURIComponent(e)}/subscribe?${n}`}socketUrl(e){return this.accessScoped?"":this.subscribeUrl(e)}socketProtocols(e){return this.accessScoped?[]:[Je]}createRealtime(e,t){return this.accessScoped?null:new Ee({url:this.subscribeUrl(e),sink:t})}};var oe=require("@seatlayer/core");var Ct=require("@seatlayer/core");var pe=require("@seatlayer/core"),Zo=require("@seatlayer/core/core/seatConfidence");var Go=require("@seatlayer/core"),Uo=require("@seatlayer/core/core/cdnAsset");var cc=/^data:image\/(?:png|jpe?g|webp|gif|avif);base64,[a-z0-9+/]+={0,2}$/i,dc=/[\s"'<>`\\]/;function pc(i){return i.startsWith("//")?!1:i.startsWith("/")||i.startsWith("./")||i.startsWith("../")}function hc(){try{let i=typeof location>"u"?"":location.origin;return i&&i!=="null"?i:null}catch{return null}}function xt(i){if(typeof i!="string"||!i||i.length>2e6||i!==i.trim())return!1;if(i.startsWith("data:"))return cc.test(i);if(dc.test(i))return!1;let e=hc();if(pc(i)){if(!e)return!1;try{let t=new URL(i,e);return t.origin===e&&!t.username&&!t.password}catch{return!1}}try{let t=new URL(i);return t.username||t.password?!1:t.protocol==="https:"||e!=null&&t.origin===e}catch{return!1}}var vc=require("@seatlayer/core/core/cdnAsset");function b(i,e){let t=(0,Go.t)(i);return t===i?e:t}function et(){return globalThis.matchMedia?.("(pointer: coarse)").matches??!1?b("picker.dragToLookTouch","Drag to look \xB7 pinch to zoom \xB7 tap \u2715 to close"):b("picker.dragToLookMouse","Drag to look \xB7 pinch or scroll to zoom \xB7 Esc to close")}function Ti(){return{rotate:b("picker.dragToRotateVenue","Drag to rotate the venue"),move:b("picker.dragToMoveVenue","Drag to move the venue"),zoomIn:b("picker.zoomIn","Zoom in"),zoomOut:b("picker.zoomOut","Zoom out"),fitView:b("picker.fitWholeVenue","Show whole venue")}}function qo(i,e){let t=e?i.toLocaleUpperCase(e):i.toLocaleUpperCase(),n=e?i.toLocaleLowerCase(e):i.toLocaleLowerCase();if(i!==t||t===n)return i;let o=[...n][0]??"";return(e?o.toLocaleUpperCase(e):o.toLocaleUpperCase())+n.slice(o.length)}function Ko(i){if(typeof i=="string"){let e=document.querySelector(i);if(!e)throw new Error(`seatmap: container "${i}" not found`);return e}if(!(i instanceof HTMLElement))throw new Error("seatmap: container must be a CSS selector or an HTMLElement");return i}function B(i){return String(i??"").replace(/[&<>"']/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[e])}function Wo(i,e,t){let n=e.find(s=>xt(s))??null;if(i.replaceChildren(),!n)return i.textContent=t.slice(0,1).toUpperCase(),null;let o=document.createElement("img");return o.alt="",o.referrerPolicy="no-referrer",o.src=n,i.appendChild(o),n}var St=null;function Ei(){if(St!==null)return St;try{if(typeof document>"u")return St=!1;St=!!document.createElement("canvas").getContext("webgl2")}catch{St=!1}return St}function Rn(i){return(0,Uo.cdnAssetUrl)(i)}var Zt=null;function Qt(){return Zt||(Zt=(typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?import(Rn("seatlayer-view3d.mjs")):import("@seatlayer/core/view3d")).catch(e=>{throw Zt=null,e}),Zt)}function Ci(){(typeof navigator>"u"?void 0:navigator.connection)?.saveData||Qt().catch(()=>{})}async function Ai(){return typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?import(Rn("seatlayer-panorama.mjs")):import("@seatlayer/core")}async function Pi(){return typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?import(Rn("seatlayer-checkout.mjs")):Promise.resolve().then(()=>(jo(),$o))}function Yo(i){return i==="unavailable_for_event"||i==="payments_off_for_event"?i:"not_configured"}function Li(i,e,t){let n={month:"short",day:"numeric",hour:"numeric",minute:"2-digit"},o=new Date(i);if(e)try{return o.toLocaleString(t,{...n,timeZone:e})}catch{}return o.toLocaleString(t,n)}function In(i){return String(i??"\u2014").replace(/[&<>"]/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[e])}function E(i){return String(i??"").replace(/[&<>"]/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[e])}function On(i){return i?(0,pe.seatNoteRowModel)(i).map(e=>({...e,title:b(e.titleKey,e.titleFallback)})):[]}function Qo(i){return On(i).map(e=>e.title)}function tt(i,e={}){let t=On(i);if(!t.length)return"";let n=e.compact?15:17,o=t.map(s=>`<div class="sl-note sl-note-${E(s.tone)}"><span class="sl-note-i">${(0,pe.seatTypeIconSvg)(s.icon,{size:n})}</span><span class="sl-note-t"><b>${E(s.title)}</b>`+(s.note?`<span class="sl-note-n">${E(s.note)}</span>`:"")+"</span></div>").join("");return`<div class="sl-notes${e.compact?" compact":""}">${o}</div>`}function Jo(i){return On(i).map(e=>{let t=E(e.note?`${e.title}: ${e.note}`:e.title);return`<span class="sl-cx-mark sl-cx-mark-${E(e.tone)}" role="img" aria-label="${t}" title="${t}">${(0,pe.seatTypeIconSvg)(e.icon,{size:13})}</span>`}).join("")}function Mi(i){let e=[];return i?.restrictedView&&e.push(b("picker.restrictedView","Restricted view")),i?.obstructedView&&e.push(b("picker.obstructedView","Obstructed view")),e}function _n(i,e){if(!i)return"";let t=e?b("picker.viewFromThisSeat","View from this seat"):b("picker.seeItIn3d","See it in 3D"),n=e?b("picker.viewFromHere","View from here"):t;return`<button type="button" class="sl-confirm-3d" aria-label="${t}"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2l9 5v10l-9 5-9-5V7z"/><path d="M12 12l9-5M12 12v10M12 12L3 7"/></svg><span>${n}</span></button>`}function es(i,e){if(!e)return"";let t=e,n=t.includes(i.id),o=n?t.length>1?b("picker.openComparison","Open comparison"):b("picker.savedForComparison","Saved for comparison"):t.length?b("picker.compareWithSaved","Compare with saved"):b("picker.saveToCompare","Save to compare");return`<button type="button" class="sl-confirm-compare"${n&&t.length===1?" disabled":""}><span aria-hidden="true">\u21C4</span><span>${E(o)}</span></button>`}function ts(i,e,t){if(!t)return"";let n=(0,Zo.seatConfidenceDisclosure)(i.confidenceEvidence),o=n.modeledTarget??n.reality;return`<button type="button" class="sl-confirm-confidence" aria-label="Open seat confidence passport for ${E(i.displayLabel??i.label)}"><span><em>${E(e)}</em><strong>${E(n.headline)}</strong><small>${E(o)}</small></span><b>Passport</b></button>`}function Q(i){let e=i?.rowLabel,t=i?.sectionLabel;if(!e||!t)return e;for(let n of["-"," ","\xB7","/","_"]){let o=`${t}${n}`;if(e.startsWith(o)&&e.length>o.length)return e.slice(o.length)}return(0,pe.compactRowLabel)(e,t)}function wc(i){switch(i){case"paused":return{title:b("picker.accessPausedTitle","These seats are on hold right now"),body:b("picker.accessPausedBody","The organizer has paused this selection. Try again in a few minutes."),action:b("picker.accessRetry","Try again")};case"revoked":return{title:b("picker.accessRevokedTitle","This access link is no longer active"),body:b("picker.accessRevokedBody","Ask whoever sent you here for a new link to keep booking these seats."),action:b("picker.accessRefresh","Refresh")};case"no_token":case"provider_failed":return{title:b("picker.accessExpiredTitle","The seat map timed out"),body:b("picker.accessExpiredBody","Any seats you\u2019re holding stay held. Refresh to see what\u2019s available now."),action:b("picker.accessRefresh","Refresh")};default:return{title:b("picker.accessInvalidTitle","We couldn\u2019t verify your access"),body:b("picker.accessInvalidBody","You can still book anything shown as available. Contact whoever sent you here for access to the rest."),action:b("picker.accessRefresh","Refresh")}}}var xc=6;function is(i,e,t){let n=In;return[i?.sectionLabel?`<div class="sl-confirm-field sl-confirm-sec${i.sectionLabel.length>xc?" sl-confirm-sec-long":""}"><span class="sl-confirm-key">${b("picker.section","Section")}</span><span class="sl-confirm-value">${n(i.sectionLabel)}</span></div>`:"",i?.rowLabel||i?.objectType==="booth"?`<div class="sl-confirm-field"><span class="sl-confirm-key">${n(t)}</span><span class="sl-confirm-value">${n(Q(i)??i?.displayLabel??e)}</span></div>`:"",i?.objectType!=="booth"?`<div class="sl-confirm-field"><span class="sl-confirm-key">${b("picker.seat","Seat")}</span><span class="sl-confirm-value">${n(i?.seatNumber??i?.displayLabel??e)}</span></div>`:""].filter(Boolean).join("")}function ns(i,e,t){let n=In,o=i?.objectType==="booth",s=i?.objectType==="table"&&!!i?.bookingMode,r=o||s||!i?.seatNumber,a=i?.sectionLabel??(r?void 0:i?.displayLabel),l=s?`${b("picker.guests","Guests")} ${i?.bookingMode==="variable"?`${i?.minOccupancy}\u2013${i?.maxOccupancy}`:i?.capacity}`:void 0,d=(r?[l,a?i?.rowLabel??i?.displayLabel:void 0]:[i?.rowLabel?`${t} ${Q(i)??""}`.trim():void 0,`${b("picker.seat","Seat")} ${i?.seatNumber??e}`]).filter(Boolean).join(" \xB7 ");return(a?`<span class="sl-confirm-place">${n(a)}</span>`:"")+(d?`<span class="sl-confirm-pos">${a?" \xB7 ":""}${n(d)}</span>`:"")+(a||d?"":`<span class="sl-confirm-pos">${n(e)}</span>`)}function os(i,e){if(!i)return"";let t=e?b("picker.viewFromThisSeat","View from this seat"):b("picker.seeItIn3d","See it in 3D");return`<button type="button" class="sl-confirm-pill sl-confirm-3dpill" aria-label="${t}" title="${t}"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2l9 5v10l-9 5-9-5V7z"/><path d="M12 12l9-5M12 12v10M12 12L3 7"/></svg><span aria-hidden="true">3D</span></button>`}function ss(i,e){if(!i||e)return"";let t=b("picker.seeItIn3d","See it in 3D");return`<button type="button" class="sl-confirm-3drow" aria-label="${t}" title="${t}"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2l9 5v10l-9 5-9-5V7z"/><path d="M12 12l9-5M12 12v10M12 12L3 7"/></svg><span aria-hidden="true">3D</span></button>`}function Xo(i){return i.buyerMessage?.trim()||(i.restriction==="companion"?b("picker.companionRequiresWheelchair","Requires the adjacent wheelchair place"):void 0)}function rs(i,e,t){let n=In;if(i.length>1)return`<fieldset class="sl-confirm-tiers"><legend>${b("picker.ticketType","Ticket type")}</legend>`+i.map(r=>{let a=Xo(r);return`<button type="button" class="sl-confirm-tier" data-confirm-tier="${n(r.id)}" aria-pressed="${r.id===e}"><span class="sl-confirm-tier-copy"><span class="sl-confirm-tier-name">${n(r.name)}</span>`+(a?`<small class="sl-confirm-tier-note">${n(a)}</small>`:"")+`</span><span class="sl-confirm-tier-price">${n(t(r))}</span></button>`}).join("")+"</fieldset>";let o=i[0],s=o?Xo(o):void 0;return s?`<p class="sl-confirm-tier-note">${n(s)}</p>`:""}function as(i){return'<div class="sl-confirm-grid">'+i.identityFields+`</div><div class="sl-confirm-cat"><span class="sl-confirm-cat-name">${E(i.categoryLabel)}</span>`+(i.priceLabel?`<span class="sl-confirm-price">${E(i.priceLabel)}</span>`:"")+'</div><div class="sl-confirm-id">'+i.marker+`<span class="sl-confirm-dot" style="background:${E(i.categoryColor)}" aria-hidden="true"></span><span class="sl-sr">${E(i.categoryLabel)}</span><span class="sl-confirm-who">`+i.identity+"</span>"+(i.priceLabel?`<span class="sl-confirm-idprice">${E(i.priceLabel)}</span>`:"")+'</div><div class="sl-confirm-body">'+i.commercial+i.tierChoices+i.groupDates+i.wheelchair+(i.thumb||i.see3dPill?`<div class="sl-confirm-strip">${i.thumb}<span class="sl-confirm-pills">${i.see3dPill}</span></div>`:"")+i.inspect+'<div class="sl-confirm-row">'+(i.see3dRow??"")+`<button type="button" class="sl-confirm-cancel">${E(i.cancelLabel)}</button><button type="button" class="sl-confirm-add"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M5 12.5l4 4L19 7"/></svg><span class="sl-confirm-add-t">${E(i.selectLabel)}</span></button></div></div>`}function ls(i,e){let t=B,{variable:n}=e;return`<section class="sl-table-dialog" role="dialog" aria-modal="true" aria-labelledby="sl-table-title" aria-describedby="sl-table-copy"><div class="sl-table-head"><div class="sl-table-eyebrow">${t(n?(0,pe.t)("picker.flexiblePartyTypeWord",{typeWord:e.typeWord}):(0,pe.t)("picker.wholeTypeWord",{typeWord:e.typeWord}))}</div><h2 class="sl-table-title" id="sl-table-title">${t(i.displayLabel??i.label)}</h2><p class="sl-table-copy" id="sl-table-copy">${t(n?b("picker.chooseGuestsCopy","Choose how many guests will sit together. This table is held exclusively for your party."):(0,pe.t)("picker.allPlacesBookedTogether",{count:i.capacity}))}</p></div><div class="sl-table-body"><div class="sl-table-summary"><span>${t(e.categoryLabel)}</span>`+(e.suppressPricing?"":`<b data-table-unit>${t((0,pe.t)("picker.perGuestPrice",{price:e.unitPrice}))}</b>`)+`<span class="muted">${t(b("picker.tableCapacity","Table capacity"))}</span><span>${t((0,pe.t)("picker.guestsCount",{count:i.capacity}))}</span>`+(e.suppressPricing?"":`<span class="muted">${t(b("picker.total","Total"))}</span><b data-table-total></b>`)+"</div>"+(n?`<label class="sl-table-qtylabel" id="sl-table-qty-label">${t(b("picker.numberOfGuests","Number of guests"))}</label><div class="sl-table-stepper" role="group" aria-labelledby="sl-table-qty-label"><button type="button" data-table-step="-1" aria-label="${t(b("picker.fewerGuests","Fewer guests"))}">\u2212</button><output aria-live="polite" data-table-qty>${i.quantity}</output><button type="button" data-table-step="1" aria-label="${t(b("picker.moreGuests","More guests"))}">+</button></div><div class="sl-table-range">${t((0,pe.t)("picker.chooseMinMaxGuests",{min:i.minOccupancy,max:i.maxOccupancy}))}</div>`:`<input type="hidden" data-table-qty value="${i.capacity}">`)+`<div class="sl-table-actions"><button type="button" class="sl-table-cancel">${t((0,pe.t)("common.cancel"))}</button><button type="button" class="sl-table-confirm">${t(e.held?b("picker.updateTable","Update table"):n?b("picker.selectTable","Select table"):b("picker.selectWholeTable","Select whole table"))}</button></div></div></section>`}function cs(i,e){let t=wc(i),n=document.createElement("div");n.className="sl-interrupt sl-access",n.setAttribute("role","status"),n.setAttribute("aria-live","polite");let o=document.createElement("div");o.className="sl-interrupt-card";let s=document.createElement("div");s.className="sl-interrupt-title",s.textContent=t.title;let r=document.createElement("div");r.className="sl-interrupt-body",r.textContent=t.body,o.append(s,r);let a=document.createElement("div");a.className="sl-interrupt-actions";let l=document.createElement("button");l.type="button",l.className="sl-interrupt-act";let c=document.createElement("span");c.className="sl-interrupt-act-icon",c.setAttribute("aria-hidden","true"),c.textContent="\u21BB";let d=document.createElement("span");return d.textContent=t.action,l.append(c,d),l.addEventListener("click",async()=>{n.classList.add("is-reloading"),l.disabled=!0;try{await e()}catch{}finally{n.isConnected&&(n.classList.remove("is-reloading"),l.disabled=!1)}}),a.appendChild(l),o.appendChild(a),n.appendChild(o),n}function ds(i,e){return`<div class="sl-a11yhead"><span class="sl-a11yhead-t">${E(i)}</span><button type="button" class="sl-a11yclose" data-a11y-close aria-label="${B(e)}"><svg viewBox="0 0 24 24" aria-hidden="true"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg></button></div>`}function ps(i){return i.map(e=>{let t=`<button type="button" role="switch" class="sl-a11yrow${e.className?` ${e.className}`:""}${e.on?" on":""}" data-a11y-row="${E(e.key)}" aria-checked="${e.on}" aria-pressed="${e.on}"`+(e.disabled?' disabled aria-disabled="true"':"")+`><span class="sl-a11yrow-i" aria-hidden="true">${e.iconHtml}</span><span class="sl-a11yrow-t"><span class="sl-a11yrow-l">${E(e.label)}</span></span>`+(e.count?`<span class="sl-a11yrow-c">${E(e.count)}</span>`:"")+'<span class="sl-a11yrow-s" aria-hidden="true"></span></button>';return e.note?`<div class="sl-a11yrow-w">${t}${kt({id:`sl-info-${B(e.key.replace(/[^A-Za-z0-9]+/g,"-"))}`,label:e.note,text:E(e.note)})}</div>`:t}).join("")}function kt(i){return`<span class="sl-info"${i.wrapRef?` data-ref="${B(i.wrapRef)}"`:""}><button type="button" class="sl-info-btn" data-sl-info aria-label="${B(i.label)}" aria-describedby="${B(i.id)}" aria-expanded="false"><svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="12" r="9"/><path d="M12 11v5"/><path d="M12 8h.01"/></svg></button><span class="sl-info-pop" role="tooltip" id="${B(i.id)}"${i.ref?` data-ref="${B(i.ref)}"`:""}>${i.text}</span></span>`}var Ii=require("@seatlayer/core/core/color");function Re(i){if(!i)return null;let e=i.trim().toLowerCase();if(e==="white")return{r:255,g:255,b:255};if(e==="black")return{r:0,g:0,b:0};let t=/^#([0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i.exec(e)?.[1];if(t){let o=t.length<=4?[...t].map(s=>`${s}${s}`).join(""):t;return{r:Number.parseInt(o.slice(0,2),16),g:Number.parseInt(o.slice(2,4),16),b:Number.parseInt(o.slice(4,6),16)}}let n=/^rgba?\(\s*([\d.]+)[,\s]+([\d.]+)[,\s]+([\d.]+)(?:\s*[,/]\s*[\d.]+%?)?\s*\)$/i.exec(e);return n?{r:Math.max(0,Math.min(255,Number(n[1]))),g:Math.max(0,Math.min(255,Number(n[2]))),b:Math.max(0,Math.min(255,Number(n[3])))}:null}function Hi(i){return(0,Ii.relativeLuminance255)([i.r,i.g,i.b])}function Se(i,e){let t=Re(i),n=Re(e);if(!t||!n)return null;let o=Math.max(Hi(t),Hi(n)),s=Math.min(Hi(t),Hi(n));return(o+.05)/(s+.05)}function it(i,e="#172033",t="#eef1f8"){return(Se(e,i)??0)>=(Se(t,i)??0)?e:t}function Sc(i){return(0,Ii.rgb255ToHex)(i.r,i.g,i.b)}function Nn(i,e,t){let n=Re(i),o=Re(e);if(!n||!o)return null;let s=Math.max(0,Math.min(1,t));return Sc({r:n.r*s+o.r*(1-s),g:n.g*s+o.g*(1-s),b:n.b*s+o.b*(1-s)})}var Ri="#d8a425",kc=.18;function hs(i,e){let t=Nn(Ri,e,kc)??e;if((Se(Ri,t)??0)>=4.5)return Ri;for(let n=.15;n<=1;n+=.05){let o=Nn(Ri,i,1-n);if(o&&(Se(o,t)??0)>=4.5)return o}return it(t)}function us(i,e,t,n){if((Se(i,t)??4.5)>=4.5&&(Se(i,n)??4.5)>=4.5)return i;if(!Re(i)||!Re(e))return e;for(let o=.15;o<=1;o+=.05){let s=Nn(i,e,1-o);if(s&&(Se(s,t)??0)>=4.5&&(Se(s,n)??0)>=4.5)return s}return e}function ms(i){return{"--sl-chrome":i?"#d6dce6":"#556278","--sl-chrome-line":i?"rgba(23,32,51,.55)":"rgba(233,238,247,.55)"}}var fs=["--sl-bg","--sl-surface","--sl-text","--sl-muted","--sl-line","--sl-accent-text","--sl-warn-text","--sl-chrome","--sl-chrome-line"];function gs(i,e){let t=e??i["--sl-bg"],n=Re(t)?it(t)==="#172033":!1,o=Re(i["--sl-bg"])?it(i["--sl-bg"])==="#172033":!1;if(n===o)return null;let s=n?"#ffffff":"#1a2234",r=it(t),a=i["--sl-accent"];return{"--sl-bg":t,"--sl-surface":s,"--sl-text":r,"--sl-muted":n?"#667085":"#a5aec2","--sl-line":n?"rgba(23,32,51,.16)":"rgba(165,174,194,.24)","--sl-accent-text":us(a,r,t,s),...ms(n),"--sl-warn-text":hs(r,s)}}var bs={light:{background:"#ffffff",surface:"#f6f7fb",text:"#172033",muted:"#667085",line:"rgba(23,32,51,.16)",map:"#e9edf4"},dark:{background:"#0f1522",surface:"#1a2234",text:"#eef1f8",muted:"#a5aec2",line:"rgba(165,174,194,.24)",map:"#0f1522"}};function Tc(){try{return window.matchMedia?.("(prefers-color-scheme: dark)").matches===!0}catch{return!1}}function Jt(i){if(i)return i==="auto"?Tc()?"dark":"light":i}function Tt(i,e=i?.mode){if(i?.map)return i.map;let t=Jt(e);return t?{background:bs[t].map}:null}function Oi(i){let e;try{e=window.matchMedia?.("(prefers-color-scheme: dark)")}catch{return()=>{}}if(!e)return()=>{};let t=n=>i(n.matches);return typeof e.addEventListener=="function"?e.addEventListener("change",t):e.addListener?.(t),()=>{typeof e.removeEventListener=="function"?e.removeEventListener("change",t):e.removeListener?.(t)}}function Et(i,e,t){let n=t?bs[t]:null,o=e?.background??n?.background??i?.background??"#0f1522",s=Re(o)?it(o)==="#172033":!1,r=e?.surface??n?.surface??(s?"#ffffff":"#1a2234"),a=e?.accent??i?.accent??"#f4b740",l=i?.accentInk,c=e?.accentInk??(l&&(Se(l,a)??4.5)>=4.5?l:it(a,"#1a1200","#ffffff")),d=n?void 0:i?.textColor,p=e?.text??n?.text??(d&&(Se(d,o)??4.5)>=4.5&&(Se(d,r)??4.5)>=4.5?d:it(o));return{"--sl-accent":a,"--sl-accent-ink":c,"--sl-accent-text":us(a,p,o,r),"--sl-warn-text":hs(p,r),"--sl-bg":o,"--sl-surface":r,"--sl-text":p,"--sl-muted":e?.muted??n?.muted??(s?"#667085":"#a5aec2"),"--sl-line":e?.line??n?.line??(s?"rgba(23,32,51,.16)":"rgba(165,174,194,.24)"),...ms(s),"--sl-scrim-ink":s?"rgba(16,22,36,1)":"rgba(4,7,13,1)","--sl-font":e?.fontFamily??i?.fontFamily??"-apple-system,BlinkMacSystemFont,'Segoe UI',Inter,sans-serif","--sl-radius":`${e?.radius??14}px`}}function Ec(){return`<svg class="sl-boot-venue" viewBox="0 0 200 140" preserveAspectRatio="xMidYMid meet" aria-hidden="true" focusable="false"><g class="sl-boot-shells">${["M20 92a80 52 0 0 1 160 0v14a94 62 0 0 0-160 0z","M32 74a68 42 0 0 1 136 0v12a80 50 0 0 0-136 0z","M46 58a54 32 0 0 1 108 0v10a64 38 0 0 0-108 0z"].map(e=>`<path d="${e}" />`).join("")}</g><rect class="sl-boot-stage" x="62" y="16" width="76" height="16" rx="4" /></svg>`}function ys(i,e,t){let n=document.createElement("div");n.className="sl-picker",n.tabIndex=-1,n.lang=(0,Ct.getLocale)(),n.dir=(0,Ct.localeDirection)(),i.appendChild(n),Object.entries(Et(void 0,t)).forEach(([s,r])=>n.style.setProperty(s,r)),n.innerHTML=`
42
42
  <div class="sl-head">
43
43
  <div class="sl-logo" data-ref="logo"></div>
44
44
  <div class="sl-head-info" data-ref="headInfo">
@@ -89,7 +89,7 @@
89
89
  </div>
90
90
  <div class="sl-boot" data-ref="boot">
91
91
  <div class="sl-boot-bar" aria-hidden="true"></div>
92
- ${Tc()}
92
+ ${Ec()}
93
93
  <span class="sl-boot-say" role="status" aria-live="polite" data-sl-t="picker.loadingSeatMap">${e("picker.loadingSeatMap","Loading seat map\u2026")}</span>
94
94
  </div>
95
95
  <div class="sl-toast" data-ref="toast" role="status" aria-live="polite"></div>
@@ -115,7 +115,7 @@
115
115
  <button type="button" class="sl-cta" data-ref="cta" disabled></button>
116
116
  </div>
117
117
  </div>
118
- </div>`;let o={};return n.querySelectorAll("[data-ref]").forEach(s=>{o[s.dataset.ref]=s}),{root:n,mapHost:o.map,els:o}}function vs(i){let e=(t,n)=>{for(let o of i.querySelectorAll(`[${t}]`)){let s=o.getAttribute(t);if(!s)continue;let r=(0,Ct.t)(s);r!==s&&n(o,r)}};e("data-sl-t",(t,n)=>{t.textContent=n}),e("data-sl-a",(t,n)=>{t.setAttribute("aria-label",n)}),e("data-sl-ti",(t,n)=>{t.setAttribute("title",n)})}function _i(i,e){let t=(0,oe.resolveLocale)(i),n=oe.TRANSLATED_LOCALES.includes(t)?t:"en";return e&&(0,oe.setStringOverrides)(e),{locale:n,direction:(0,oe.localeDirection)(n),ready:(0,oe.loadLocale)(i)}}function Ni(i,e,t){i.lang=e.locale,i.dir=e.direction,e.ready.then(t)}function ws(i,e){if(!i)return null;let t=(e.languages??[]).map(o=>(0,oe.resolveLocale)(o)).filter((o,s,r)=>r.indexOf(o)===s);if(t.length<2)return null;let n=document.createElement("select");n.className="sl-langsel",n.setAttribute("aria-label",e.label);for(let o of t){let s=document.createElement("option");s.value=o,s.textContent=oe.LOCALE_NAMES[o]??o,s.selected=o===(0,oe.getLocale)(),n.appendChild(s)}return n.addEventListener("change",()=>e.onChange(n.value)),i.appendChild(n),n}function xs(i,e){e.root.lang=i,e.root.dir=(0,oe.localeDirection)(i),vs(e.root);for(let n of e.painters)try{n()}catch{}e.refreshMapCopy();let t=e.languageSelect;t&&t.value!==i&&(t.value=i)}function At(i,e,t,n=45e3){return new Promise(o=>{if(e.aborted){o({outcome:"cancelled"});return}let s=!1,r=d=>{s||(s=!0,clearTimeout(l),clearTimeout(c),e.removeEventListener("abort",a),o(d))},a=()=>r({outcome:"cancelled"}),l=setTimeout(()=>{s||t()},8e3),c=setTimeout(()=>r({outcome:"timeout"}),n);e.addEventListener("abort",a,{once:!0}),Promise.resolve().then(()=>s?void 0:i()).then(d=>{s||r({outcome:"loaded",value:d})},d=>r({outcome:"error",error:d}))})}var re=class extends Error{constructor(e){super(`buyer_access_unavailable:${e.reason}`),this.name="BuyerAccessUnavailableError",this.reason=e.reason,this.code=e.code,this.status=e.status}},Ec=new Set(["buyer_access_expired"]),Cc=new Set(["paused","provider_failed","channel_denied","sales_not_open"]);function Ac(i,e){switch(e){case"buyer_access_invalid":return"invalid";case"buyer_access_revoked":return"revoked";case"buyer_access_origin_mismatch":return"origin_mismatch";case"buyer_access_event_mismatch":return"event_mismatch";case"buyer_access_group_mismatch":return"group_mismatch";case"buyer_access_mode_mismatch":return"mode_mismatch";case"buyer_access_environment_mismatch":return"environment_mismatch";case"channel_access_denied":return"channel_denied";case"channel_paused":return"paused";case"invalid_channel_scope":return"invalid_scope";case"audience_not_public":return"audience_not_public";case"sales_not_open":return"sales_not_open";case"origin_not_allowed":return"origin_not_allowed";default:break}return i===401?"invalid":null}function Pc(i,e){return i===401&&!!e&&Ec.has(e)}var Lc=3e4,he,ue,Pt,Lt,ei,ze,$e,Ie,Mt,ti,ii,ni,ot,se,Dn,Di,nt,me=class{constructor(e){P(this,se);P(this,he,null);P(this,ue,0);P(this,Pt,null);P(this,Lt);P(this,ei);P(this,ze,null);P(this,$e,null);P(this,Ie,null);P(this,Mt,null);P(this,ti);P(this,ii);P(this,ni,!1);P(this,ot);if(k(this,Lt,e.provider),k(this,ei,e.skewMs??Lc),k(this,ti,e.onExpired),k(this,ii,e.onUnavailable),e.token){let t=typeof e.token=="string"?{token:e.token}:e.token;S(this,se,Dn).call(this,t)}k(this,ni,!!m(this,Lt)||!!m(this,he))}get configured(){return m(this,ni)}onRenewed(e){k(this,ot,e)}get unavailable(){return m(this,Ie)}get hasToken(){return!!m(this,he)&&(m(this,ue)===0||m(this,ue)>Date.now())}get expiresAt(){return m(this,ue)}async authorization(e="initial"){if(!this.configured)return null;if(m(this,Ie))throw new re(m(this,Ie));let t=Date.now();if(!m(this,he)||m(this,ue)>0&&m(this,ue)-m(this,ei)<=t){let o=!!m(this,he)&&m(this,ue)>0&&m(this,ue)<=t,s=m(this,he)?o?"expired":"expiring":e,r=await S(this,se,Di).call(this,s);if(!r)throw new re(m(this,Ie)??m(this,Mt)??S(this,se,nt).call(this,"provider_failed"));return`Bearer ${r}`}return`Bearer ${m(this,he)}`}async handleFailure(e,t){var o;if(!this.configured)return!1;if(Pc(e,t)){k(this,he,null),k(this,ue,0);let s=await S(this,se,Di).call(this,"unauthorized",t);return(o=m(this,ti))==null||o.call(this,{reason:"unauthorized",code:t,refreshed:!!s}),!!s}let n=Ac(e,t);return n&&S(this,se,nt).call(this,n,t,e),!1}async refresh(e="manual"){return k(this,Ie,null),k(this,Mt,null),k(this,he,null),k(this,ue,0),!!await S(this,se,Di).call(this,e)}clear(){m(this,$e)?.abort(),k(this,$e,null),k(this,he,null),k(this,Pt,null),k(this,ue,0),k(this,ze,null),k(this,ot,void 0)}toJSON(){return{configured:this.configured,hasToken:this.hasToken}}toString(){return"[BuyerAccessContext redacted]"}};he=new WeakMap,ue=new WeakMap,Pt=new WeakMap,Lt=new WeakMap,ei=new WeakMap,ze=new WeakMap,$e=new WeakMap,Ie=new WeakMap,Mt=new WeakMap,ti=new WeakMap,ii=new WeakMap,ni=new WeakMap,ot=new WeakMap,se=new WeakSet,Dn=function(e){return!e||typeof e.token!="string"||!e.token?null:(k(this,Pt,e.token),k(this,he,e.token),k(this,ue,typeof e.expiresAt=="number"?e.expiresAt:0),m(this,he))},Di=function(e,t){if(m(this,ze))return m(this,ze);let n=m(this,Lt);if(!n)return S(this,se,nt).call(this,"no_token",t),Promise.resolve(null);let o=m(this,Pt),s=new AbortController;k(this,$e,s);let r=(async()=>{try{let a=await At(()=>Promise.resolve(n({reason:e})),s.signal,()=>{},4e4);if(s.signal.aborted||a.outcome==="cancelled")return null;if(a.outcome!=="loaded")return S(this,se,nt).call(this,"provider_failed",t),null;let l=a.value,c=S(this,se,Dn).call(this,l);if(!c)return S(this,se,nt).call(this,"provider_failed",t),null;if(o&&o!==c&&m(this,ot))try{await m(this,ot).call(this,{previousToken:o,token:c,reason:e})}catch{}return s.signal.aborted?null:c}catch{return S(this,se,nt).call(this,"provider_failed",t),null}finally{m(this,$e)===s&&(k(this,ze,null),k(this,$e,null))}})();return k(this,ze,r),r},nt=function(e,t,n){var s;let o={reason:e,code:t,status:n,retryable:e==="paused"||e==="channel_denied"||e==="sales_not_open"};return k(this,Mt,o),Cc.has(e)||(k(this,Ie,o),k(this,he,null),k(this,ue,0)),(s=m(this,ii))==null||s.call(this,o),o};function Ht(i,e={}){return!i.buyerAccessTokenProvider&&!i.buyerAccessToken?null:new me({provider:i.buyerAccessTokenProvider,token:i.buyerAccessToken,...e})}var Mc=3e4;function Hc(i){if(!i||typeof i!="object"||Array.isArray(i))return!1;let e=i;return typeof e.token=="string"&&e.token.startsWith("bse_")&&typeof e.expiresAt=="number"&&Number.isFinite(e.expiresAt)&&e.expiresAt>Date.now()&&!!e.event&&typeof e.event=="object"&&!!e.doc&&typeof e.doc=="object"&&!!e.objects&&typeof e.objects=="object"&&!Array.isArray(e.objects)&&!!e.objects.seats&&typeof e.objects.seats=="object"}var Bn=class{constructor(e,t,n){this.base=e;this.event=t;this.publicKey=n;this.value=null;this.inflight=null}async load(e=!1){if(e&&(this.value=null),this.value&&this.value.expiresAt-Mc>Date.now())return this.value;if(this.inflight)return this.inflight;let t=(async()=>{let n=new AbortController,o=setTimeout(()=>n.abort(),4e4);try{let s=await fetch(`${this.base}/pub/events/${encodeURIComponent(this.event)}/bootstrap`,{method:"POST",body:JSON.stringify({publicKey:this.publicKey}),credentials:"omit",signal:n.signal}),r=await s.json().catch(()=>null);if(!s.ok){let a=s.status===429?ki(s.headers.get("Retry-After"),r?.retryAfterSeconds):void 0;throw new j(s.status,r?.error??`request_failed_${s.status}`,r?.code??r?.error,void 0,void 0,a)}if(!Hc(r))throw new j(502,"invalid_bootstrap_response","invalid_bootstrap_response");return this.value=r,r}finally{clearTimeout(o)}})();this.inflight=t;try{return await t}finally{this.inflight===t&&(this.inflight=null)}}async token(e){let t=e==="expiring"||e==="expired"||e==="unauthorized"||e==="manual",n=await this.load(t);return{token:n.token,expiresAt:n.expiresAt}}},Fn=class extends Ve{constructor(t,n,o,s,r){super(t,{...r,access:s});this.event=n;this.loader=o;this.bootstrapAccess=s;this.initialChartDelivered=!1;this.initialObjectsDelivered=!1}assertEvent(t){if(t!==this.event)throw new j(404,"not_found","not_found")}async bundle(t){return this.assertEvent(t),await this.bootstrapAccess.authorization("initial"),this.loader.load()}async chart(t){if(this.assertEvent(t),this.initialChartDelivered)return super.chart(t);let n=await this.bundle(t);return this.initialChartDelivered=!0,{event:n.event,doc:n.doc,chartDelivery:n.chartDelivery}}async objects(t){if(this.assertEvent(t),this.initialObjectsDelivered)return super.objects(t);let n=await this.bundle(t);return this.initialObjectsDelivered=!0,n.objects}};function Bi(i){let e=new Bn(i.base,i.event,i.publicKey),t=new me({provider:({reason:n})=>e.token(n),...i.accessHooks});return{access:t,api:new Fn(i.base,i.event,e,t,i.apiOptions??{})}}var te=require("@seatlayer/core");var ee={enter:260,exit:180,spring:320,flight:500,stagger:30,crossfade:120,collapse:150,rung:200,reducedFade:120,easeEnter:"cubic-bezier(.2,.8,.2,1)",easeExit:"cubic-bezier(.4,0,1,1)",easeSpring:"cubic-bezier(.34,1.56,.64,1)"};var Rc=`.sl-picker,.sl-modal-scrim,.sl-mo-host{--sl-dur-enter:${ee.enter}ms;--sl-dur-exit:${ee.exit}ms;--sl-dur-spring:${ee.spring}ms;--sl-dur-flight:${ee.flight}ms;--sl-dur-stagger:${ee.stagger}ms;--sl-dur-xfade:${ee.crossfade}ms;--sl-dur-collapse:${ee.collapse}ms;--sl-dur-rung:${ee.rung}ms;--sl-ease-enter:${ee.easeEnter};--sl-ease-exit:${ee.easeExit};--sl-ease-spring:${ee.easeSpring};--sl-mo-ox:50%;--sl-mo-oy:50%}`,Ic=`@media (prefers-reduced-motion:reduce){.sl-picker,.sl-modal-scrim,.sl-mo-host{--sl-dur-enter:0ms;--sl-dur-exit:0ms;--sl-dur-spring:0ms;--sl-dur-flight:0ms;--sl-dur-stagger:0ms;--sl-dur-collapse:0ms;--sl-dur-rung:0ms;--sl-dur-xfade:${ee.reducedFade}ms}.sl-mo-in,.sl-mo-out,.sl-mo-slide-up,.sl-mo-slide-down,.sl-mo-spring,.sl-mo-rise,.sl-mo-zoom,.sl-mo-scrim,.sl-mo-stagger > *{animation-name:slMoFade;animation-duration:${ee.reducedFade}ms;animation-delay:0ms}.sl-mo-hint,.sl-mo-rotate-in,.sl-mo-fly,.sl-mo-collapse{animation:none}.sl-confirm-add-invite,.sl-confirm-add-invite::after{animation:none}.sl-mo-indicator{transition:none}}`,Ss=Rc+`
118
+ </div>`;let o={};return n.querySelectorAll("[data-ref]").forEach(s=>{o[s.dataset.ref]=s}),{root:n,mapHost:o.map,els:o}}function vs(i){let e=(t,n)=>{for(let o of i.querySelectorAll(`[${t}]`)){let s=o.getAttribute(t);if(!s)continue;let r=(0,Ct.t)(s);r!==s&&n(o,r)}};e("data-sl-t",(t,n)=>{t.textContent=n}),e("data-sl-a",(t,n)=>{t.setAttribute("aria-label",n)}),e("data-sl-ti",(t,n)=>{t.setAttribute("title",n)})}function _i(i,e){let t=(0,oe.resolveLocale)(i),n=oe.TRANSLATED_LOCALES.includes(t)?t:"en";return e&&(0,oe.setStringOverrides)(e),{locale:n,direction:(0,oe.localeDirection)(n),ready:(0,oe.loadLocale)(i)}}function Ni(i,e,t){i.lang=e.locale,i.dir=e.direction,e.ready.then(t)}function ws(i,e){if(!i)return null;let t=(e.languages??[]).map(o=>(0,oe.resolveLocale)(o)).filter((o,s,r)=>r.indexOf(o)===s);if(t.length<2)return null;let n=document.createElement("select");n.className="sl-langsel",n.setAttribute("aria-label",e.label);for(let o of t){let s=document.createElement("option");s.value=o,s.textContent=oe.LOCALE_NAMES[o]??o,s.selected=o===(0,oe.getLocale)(),n.appendChild(s)}return n.addEventListener("change",()=>e.onChange(n.value)),i.appendChild(n),n}function xs(i,e){e.root.lang=i,e.root.dir=(0,oe.localeDirection)(i),vs(e.root);for(let n of e.painters)try{n()}catch{}e.refreshMapCopy();let t=e.languageSelect;t&&t.value!==i&&(t.value=i)}function At(i,e,t,n=45e3){return new Promise(o=>{if(e.aborted){o({outcome:"cancelled"});return}let s=!1,r=d=>{s||(s=!0,clearTimeout(l),clearTimeout(c),e.removeEventListener("abort",a),o(d))},a=()=>r({outcome:"cancelled"}),l=setTimeout(()=>{s||t()},8e3),c=setTimeout(()=>r({outcome:"timeout"}),n);e.addEventListener("abort",a,{once:!0}),Promise.resolve().then(()=>s?void 0:i()).then(d=>{s||r({outcome:"loaded",value:d})},d=>r({outcome:"error",error:d}))})}var re=class extends Error{constructor(e){super(`buyer_access_unavailable:${e.reason}`),this.name="BuyerAccessUnavailableError",this.reason=e.reason,this.code=e.code,this.status=e.status}},Cc=new Set(["buyer_access_expired"]),Ac=new Set(["paused","provider_failed","channel_denied","sales_not_open"]);function Pc(i,e){switch(e){case"buyer_access_invalid":return"invalid";case"buyer_access_revoked":return"revoked";case"buyer_access_origin_mismatch":return"origin_mismatch";case"buyer_access_event_mismatch":return"event_mismatch";case"buyer_access_group_mismatch":return"group_mismatch";case"buyer_access_mode_mismatch":return"mode_mismatch";case"buyer_access_environment_mismatch":return"environment_mismatch";case"channel_access_denied":return"channel_denied";case"channel_paused":return"paused";case"invalid_channel_scope":return"invalid_scope";case"audience_not_public":return"audience_not_public";case"sales_not_open":return"sales_not_open";case"origin_not_allowed":return"origin_not_allowed";default:break}return i===401?"invalid":null}function Lc(i,e){return i===401&&!!e&&Cc.has(e)}var Mc=3e4,he,ue,Pt,Lt,ei,ze,$e,Ie,Mt,ti,ii,ni,ot,se,Dn,Di,nt,me=class{constructor(e){P(this,se);P(this,he,null);P(this,ue,0);P(this,Pt,null);P(this,Lt);P(this,ei);P(this,ze,null);P(this,$e,null);P(this,Ie,null);P(this,Mt,null);P(this,ti);P(this,ii);P(this,ni,!1);P(this,ot);if(k(this,Lt,e.provider),k(this,ei,e.skewMs??Mc),k(this,ti,e.onExpired),k(this,ii,e.onUnavailable),e.token){let t=typeof e.token=="string"?{token:e.token}:e.token;S(this,se,Dn).call(this,t)}k(this,ni,!!m(this,Lt)||!!m(this,he))}get configured(){return m(this,ni)}onRenewed(e){k(this,ot,e)}get unavailable(){return m(this,Ie)}get hasToken(){return!!m(this,he)&&(m(this,ue)===0||m(this,ue)>Date.now())}get expiresAt(){return m(this,ue)}async authorization(e="initial"){if(!this.configured)return null;if(m(this,Ie))throw new re(m(this,Ie));let t=Date.now();if(!m(this,he)||m(this,ue)>0&&m(this,ue)-m(this,ei)<=t){let o=!!m(this,he)&&m(this,ue)>0&&m(this,ue)<=t,s=m(this,he)?o?"expired":"expiring":e,r=await S(this,se,Di).call(this,s);if(!r)throw new re(m(this,Ie)??m(this,Mt)??S(this,se,nt).call(this,"provider_failed"));return`Bearer ${r}`}return`Bearer ${m(this,he)}`}async handleFailure(e,t){var o;if(!this.configured)return!1;if(Lc(e,t)){k(this,he,null),k(this,ue,0);let s=await S(this,se,Di).call(this,"unauthorized",t);return(o=m(this,ti))==null||o.call(this,{reason:"unauthorized",code:t,refreshed:!!s}),!!s}let n=Pc(e,t);return n&&S(this,se,nt).call(this,n,t,e),!1}async refresh(e="manual"){return k(this,Ie,null),k(this,Mt,null),k(this,he,null),k(this,ue,0),!!await S(this,se,Di).call(this,e)}clear(){m(this,$e)?.abort(),k(this,$e,null),k(this,he,null),k(this,Pt,null),k(this,ue,0),k(this,ze,null),k(this,ot,void 0)}toJSON(){return{configured:this.configured,hasToken:this.hasToken}}toString(){return"[BuyerAccessContext redacted]"}};he=new WeakMap,ue=new WeakMap,Pt=new WeakMap,Lt=new WeakMap,ei=new WeakMap,ze=new WeakMap,$e=new WeakMap,Ie=new WeakMap,Mt=new WeakMap,ti=new WeakMap,ii=new WeakMap,ni=new WeakMap,ot=new WeakMap,se=new WeakSet,Dn=function(e){return!e||typeof e.token!="string"||!e.token?null:(k(this,Pt,e.token),k(this,he,e.token),k(this,ue,typeof e.expiresAt=="number"?e.expiresAt:0),m(this,he))},Di=function(e,t){if(m(this,ze))return m(this,ze);let n=m(this,Lt);if(!n)return S(this,se,nt).call(this,"no_token",t),Promise.resolve(null);let o=m(this,Pt),s=new AbortController;k(this,$e,s);let r=(async()=>{try{let a=await At(()=>Promise.resolve(n({reason:e})),s.signal,()=>{},4e4);if(s.signal.aborted||a.outcome==="cancelled")return null;if(a.outcome!=="loaded")return S(this,se,nt).call(this,"provider_failed",t),null;let l=a.value,c=S(this,se,Dn).call(this,l);if(!c)return S(this,se,nt).call(this,"provider_failed",t),null;if(o&&o!==c&&m(this,ot))try{await m(this,ot).call(this,{previousToken:o,token:c,reason:e})}catch{}return s.signal.aborted?null:c}catch{return S(this,se,nt).call(this,"provider_failed",t),null}finally{m(this,$e)===s&&(k(this,ze,null),k(this,$e,null))}})();return k(this,ze,r),r},nt=function(e,t,n){var s;let o={reason:e,code:t,status:n,retryable:e==="paused"||e==="channel_denied"||e==="sales_not_open"};return k(this,Mt,o),Ac.has(e)||(k(this,Ie,o),k(this,he,null),k(this,ue,0)),(s=m(this,ii))==null||s.call(this,o),o};function Ht(i,e={}){return!i.buyerAccessTokenProvider&&!i.buyerAccessToken?null:new me({provider:i.buyerAccessTokenProvider,token:i.buyerAccessToken,...e})}var Hc=3e4;function Rc(i){if(!i||typeof i!="object"||Array.isArray(i))return!1;let e=i;return typeof e.token=="string"&&e.token.startsWith("bse_")&&typeof e.expiresAt=="number"&&Number.isFinite(e.expiresAt)&&e.expiresAt>Date.now()&&!!e.event&&typeof e.event=="object"&&!!e.doc&&typeof e.doc=="object"&&!!e.objects&&typeof e.objects=="object"&&!Array.isArray(e.objects)&&!!e.objects.seats&&typeof e.objects.seats=="object"}var Bn=class{constructor(e,t,n){this.base=e;this.event=t;this.publicKey=n;this.value=null;this.inflight=null}async load(e=!1){if(e&&(this.value=null),this.value&&this.value.expiresAt-Hc>Date.now())return this.value;if(this.inflight)return this.inflight;let t=(async()=>{let n=new AbortController,o=setTimeout(()=>n.abort(),4e4);try{let s=await fetch(`${this.base}/pub/events/${encodeURIComponent(this.event)}/bootstrap`,{method:"POST",body:JSON.stringify({publicKey:this.publicKey}),credentials:"omit",signal:n.signal}),r=await s.json().catch(()=>null);if(!s.ok){let a=s.status===429?ki(s.headers.get("Retry-After"),r?.retryAfterSeconds):void 0;throw new j(s.status,r?.error??`request_failed_${s.status}`,r?.code??r?.error,void 0,void 0,a)}if(!Rc(r))throw new j(502,"invalid_bootstrap_response","invalid_bootstrap_response");return this.value=r,r}finally{clearTimeout(o)}})();this.inflight=t;try{return await t}finally{this.inflight===t&&(this.inflight=null)}}async token(e){let t=e==="expiring"||e==="expired"||e==="unauthorized"||e==="manual",n=await this.load(t);return{token:n.token,expiresAt:n.expiresAt}}},Fn=class extends Ve{constructor(t,n,o,s,r){super(t,{...r,access:s});this.event=n;this.loader=o;this.bootstrapAccess=s;this.initialChartDelivered=!1;this.initialObjectsDelivered=!1}assertEvent(t){if(t!==this.event)throw new j(404,"not_found","not_found")}async bundle(t){return this.assertEvent(t),await this.bootstrapAccess.authorization("initial"),this.loader.load()}async chart(t){if(this.assertEvent(t),this.initialChartDelivered)return super.chart(t);let n=await this.bundle(t);return this.initialChartDelivered=!0,{event:n.event,doc:n.doc,chartDelivery:n.chartDelivery}}async objects(t){if(this.assertEvent(t),this.initialObjectsDelivered)return super.objects(t);let n=await this.bundle(t);return this.initialObjectsDelivered=!0,n.objects}};function Bi(i){let e=new Bn(i.base,i.event,i.publicKey),t=new me({provider:({reason:n})=>e.token(n),...i.accessHooks});return{access:t,api:new Fn(i.base,i.event,e,t,i.apiOptions??{})}}var te=require("@seatlayer/core");var ee={enter:260,exit:180,spring:320,flight:500,stagger:30,crossfade:120,collapse:150,rung:200,reducedFade:120,easeEnter:"cubic-bezier(.2,.8,.2,1)",easeExit:"cubic-bezier(.4,0,1,1)",easeSpring:"cubic-bezier(.34,1.56,.64,1)"};var Ic=`.sl-picker,.sl-modal-scrim,.sl-mo-host{--sl-dur-enter:${ee.enter}ms;--sl-dur-exit:${ee.exit}ms;--sl-dur-spring:${ee.spring}ms;--sl-dur-flight:${ee.flight}ms;--sl-dur-stagger:${ee.stagger}ms;--sl-dur-xfade:${ee.crossfade}ms;--sl-dur-collapse:${ee.collapse}ms;--sl-dur-rung:${ee.rung}ms;--sl-ease-enter:${ee.easeEnter};--sl-ease-exit:${ee.easeExit};--sl-ease-spring:${ee.easeSpring};--sl-mo-ox:50%;--sl-mo-oy:50%}`,Oc=`@media (prefers-reduced-motion:reduce){.sl-picker,.sl-modal-scrim,.sl-mo-host{--sl-dur-enter:0ms;--sl-dur-exit:0ms;--sl-dur-spring:0ms;--sl-dur-flight:0ms;--sl-dur-stagger:0ms;--sl-dur-collapse:0ms;--sl-dur-rung:0ms;--sl-dur-xfade:${ee.reducedFade}ms}.sl-mo-in,.sl-mo-out,.sl-mo-slide-up,.sl-mo-slide-down,.sl-mo-spring,.sl-mo-rise,.sl-mo-zoom,.sl-mo-scrim,.sl-mo-stagger > *{animation-name:slMoFade;animation-duration:${ee.reducedFade}ms;animation-delay:0ms}.sl-mo-hint,.sl-mo-rotate-in,.sl-mo-fly,.sl-mo-collapse{animation:none}.sl-confirm-add-invite,.sl-confirm-add-invite::after{animation:none}.sl-mo-indicator{transition:none}}`,Ss=Ic+`
119
119
  /* Anchored open/close. The translate is 8px TOWARD the anchor, which is what
120
120
  makes the card look attached to the seat rather than dropped on the map. */
121
121
  .sl-mo-in{transform-origin:var(--sl-mo-ox) var(--sl-mo-oy);
@@ -182,7 +182,7 @@
182
182
  @keyframes slMoZoom{from{opacity:0;transform:scale(1.02)}to{opacity:1;transform:none}}
183
183
  .sl-mo-rotate-in{animation:slMoSpin var(--sl-dur-spring) var(--sl-ease-spring) 1 both}
184
184
  @keyframes slMoSpin{from{opacity:0;transform:rotate(-140deg) scale(.8)}to{opacity:1;transform:none}}
185
- `+Ic;function Fi(){try{return window.matchMedia?.("(prefers-reduced-motion: reduce)").matches===!0}catch{return!1}}function Vn(i,e){if(!e){i.style.removeProperty("--sl-mo-ox"),i.style.removeProperty("--sl-mo-oy");return}Vi(i,e,i.getBoundingClientRect())}function Vi(i,e,t){let n=t.width||1,o=t.height||1,s=r=>Math.max(0,Math.min(100,r));i.style.setProperty("--sl-mo-ox",`${s((e.x-t.left)/n*100).toFixed(1)}%`),i.style.setProperty("--sl-mo-oy",`${s((e.y-t.top)/o*100).toFixed(1)}%`)}function ks(i,e,t){let n=i.getBoundingClientRect(),o=t.getBoundingClientRect();Vi(i,e,{left:n.left-o.left,top:n.top-o.top,width:n.width,height:n.height})}function Ts(i,e){i.classList.remove("sl-mo-out"),e!==void 0&&Vn(i,e),i.classList.remove("sl-mo-in"),i.offsetWidth,i.classList.add("sl-mo-in")}function Es(i){i.classList.add("sl-mo-stagger");let e=0;for(let t of Array.from(i.children))t.style.setProperty("--sl-mo-i",String(e)),e+=1}function zi(i,e,t={className:"sl-mo-out",duration:ee.exit}){let n=()=>{o||(o=!0,!(typeof window>"u")&&(clearTimeout(s),i.removeEventListener("animationend",n),e?e():i.remove()))},o=!1;i.classList.remove("sl-mo-in","sl-mo-slide-up","sl-mo-spring","sl-mo-zoom","sl-mo-rise"),i.classList.add(t.className),i.addEventListener("animationend",n);let s=setTimeout(n,Fi()?0:t.duration+60)}var Fh={className:"sl-mo-slide-down",duration:ee.exit};function Cs(i){if(Fi())return i.onArrive?.(),null;let e=document.createElement("div");e.className="sl-mo-fly sl-mo-host",e.setAttribute("aria-hidden","true"),e.textContent=i.label??"",e.style.left=`${i.from.x}px`,e.style.top=`${i.from.y}px`,e.style.background=i.color??"var(--sl-accent,#6e7bff)",e.style.color=i.ink??"#fff",e.style.setProperty("--sl-fly-dx",`${Math.round(i.to.x-i.from.x)}px`),e.style.setProperty("--sl-fly-dy",`${Math.round(i.to.y-i.from.y)}px`),document.body.appendChild(e);let t=!1,n=()=>{t||(t=!0,window.clearTimeout(o),e.remove(),i.onArrive?.())};e.addEventListener("animationend",n);let o=window.setTimeout(n,ee.flight+80);return e}var q=i=>String(i??"").replace(/[&<>"']/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[e]);function Rt(i,e){let t=0;for(let n of i.get(e)?.values()??[])t+=n;return t}function As(i){let e=[];for(let[t,n]of i)for(let[o,s]of n)s>0&&e.push({areaId:t,tierId:o,qty:s});return e}function Ps(i){let e=new Map;for(let t of i.keys())e.set(t,Rt(i,t));return e}function oi(i,e,t,n){let o=i.get(e)??new Map;n>0?o.set(t,n):o.delete(t),o.size?i.set(e,o):i.delete(e)}function Ls(i){let e=new Map;for(let t of i)t.objectType!=="ga"||!t.objectId||e.set(t.objectId,(e.get(t.objectId)??0)+(t.quantity??1));return e}function je(i,e){let t=Ls(e),n=0;for(let o of i.keys())n+=Math.max(0,Rt(i,o)-(t.get(o)??0));return n}function Ms(i,e,t){let n=Ls(t),o=0;for(let s of e){let r=i.gaQty.get(s.id);if(!r)continue;let a=n.get(s.id)??0;for(let[l,c]of r){let d=Math.max(0,c-a);a=Math.max(0,a-c),o+=d*i.paidPrice(s.categoryKey,l,Oc(s,l),s.id)}}return o}function Oc(i,e){return e?i.tiers?.find(t=>t.id===e)?.price??i.price:i.price}function Hs(i){let e=[],t=new Map;for(let n of i){if(n.objectType!=="ga"||!n.objectId){e.push({...n,labels:[n.label]});continue}let o=`${n.objectId}\0${n.tierId??""}`,s=t.get(o);if(s){s.quantity=(s.quantity??0)+(n.quantity??1),s.labels.push(n.label);continue}let r={...n,quantity:n.quantity??1,labels:[n.label]};t.set(o,r),e.push(r)}return e}function Rs(i,e,t){let n=new Set(t);for(let o of e)o.objectType==="ga"&&o.objectId&&n.has(o.label)&&oi(i,o.objectId,o.tierId??null,0)}function $n(i,e){if(i.objectType!=="ga")return i.label;let t=e.find(n=>n.id===i.objectId);return t?.displayLabel??t?.label??i.label}function _c(i){let e=new Map;for(let t of i){if(t.objectType!=="ga"||!t.objectId)continue;let n=`${t.objectId}\0${t.tierId??""}`;e.set(n,(e.get(n)??0)+(t.quantity??1))}return e}function $i(i){let e=i.tiers??[];return e.length>1?e.map(t=>({id:t.id,label:t.name||t.id,price:t.price})):[{id:null,label:i.displayType??(0,te.t)("picker.generalAdmission"),price:i.price}]}function Is(i,e){let t=i.totalTicketCount()-Rt(i.gaQty,e.id);return Math.max(0,Math.min(e.available,i.maxTickets-t))}function jn(i,e,t,n){if(Ce(i,!1),i.salesClosed){i.toast(i.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}let o=$i(e),s=i.gaQty.get(e.id),r=Rt(i.gaQty,e.id)>0,a=Is(i,e);if(a<=0&&!r){i.toast(e.available>0?(0,te.t)("picker.maxTicketsForOrder",{count:i.maxTickets}):i.tf("picker.soldOutTitle","Sold out"),"warning");return}if(i.onGAPromptHook){let u={};for(let[y,g]of s??[])u[y??""]=g;if(i.onGAPromptHook({area:e,selected:u,min:0,max:a,tiers:o,confirm:y=>{Fc(i,e,o,y,a)},cancel:()=>Ce(i)})===!0)return}let l=new Map;for(let u of o)l.set(u.id,s?.get(u.id)??0);!r&&a>0&&l.set(o[0].id,1);let c={area:e,tiers:o,draft:l,max:a,reopened:r},d=i.root?.dataset.layout==="narrow",p=document.createElement("div");p.className=d?"sl-ga-scrim sl-mo-scrim":"sl-ga-pop-layer",p.innerHTML=Nc(i,c,d),i.root?.appendChild(p),i.gaPromptEl=p,i.gaPromptReturnFocus=n??document.activeElement,d||Vc(i,p,t),i.reducedMotion()&&(p.dataset.motion="reduced"),_s(i,c),Dc(i,p,c),requestAnimationFrame(()=>p.querySelector('[data-ga-step="1"]')?.focus())}function Nc(i,e,t){let{area:n,tiers:o}=e,s=o.length>1,r=n.displayLabel??n.label,a=o.map(l=>`<div class="sl-ga-prompt-row" data-ga-tier="${q(l.id??"")}"><div class="sl-ga-prompt-label"><span>${q(s?l.label:i.tf("picker.gaChooseTickets","How many tickets?"))}</span>`+(s?`<small>${q(i.money(i.paidPrice(n.categoryKey,l.id,l.price,n.id)))}</small>`:"")+`</div><div class="sl-ga-stepper" role="group" aria-label="${q(s?l.label:r)}"><button type="button" data-ga-step="-1" aria-label="${q(i.tf("picker.fewer","Fewer"))}">\u2212</button><output data-ga-qty aria-live="polite">0</output><button type="button" data-ga-step="1" aria-label="${q(i.tf("picker.more","More"))}">+</button></div></div>`).join("");return`<section class="${t?"sl-ga-sheet":"sl-ga-pop"}" role="dialog" aria-modal="true" aria-label="${q((0,te.t)("picker.gaChooseForArea",{area:r}))}"><div class="sl-ga-prompt-head"><div class="sl-ga-prompt-eyebrow">${q(n.displayType??i.tf("picker.generalAdmission","General admission"))}</div><h2 class="sl-ga-prompt-title">${q(r)}</h2><p class="sl-ga-prompt-sub" data-ga-sub></p><button type="button" class="sl-ga-prompt-close" data-ga-cancel aria-label="${q((0,te.t)("common.close"))}">\xD7</button></div><div class="sl-ga-prompt-body">${a}`+(o.length>1?`<div class="sl-ga-prompt-total"><span>${q(i.tf("picker.total","Total"))}</span><b data-ga-total></b></div>`:"")+'<p class="sl-ga-prompt-hint" data-ga-hint></p></div><div class="sl-ga-prompt-actions">'+(e.reopened?`<button type="button" class="sl-ga-prompt-remove" data-ga-remove>${q(i.tf("picker.gaRemove","Remove"))}</button>`:`<button type="button" class="sl-ga-prompt-remove" data-ga-cancel>${q((0,te.t)("common.cancel"))}</button>`)+'<button type="button" class="sl-ga-prompt-confirm" data-ga-confirm></button></div></section>'}function Gn(i){let e=0;for(let t of i.draft.values())e+=t;return e}function Os(i,e){let t=0;for(let n of e.tiers)t+=(e.draft.get(n.id)??0)*i.paidPrice(e.area.categoryKey,n.id,n.price,e.area.id);return t}function _s(i,e){let t=i.gaPromptEl;if(!t)return;let n=Gn(e),o=Os(i,e);t.querySelectorAll("[data-ga-tier]").forEach(c=>{let d=c.dataset.gaTier?c.dataset.gaTier:null,p=e.draft.get(d)??0,u=c.querySelector("[data-ga-qty]");u&&(u.value=String(p)),c.querySelectorAll("[data-ga-step]").forEach(h=>{h.disabled=Number(h.dataset.gaStep)<0?p<=0:n>=e.max})});let s=t.querySelector("[data-ga-sub]");s&&(s.textContent=`${i.money(i.paidPrice(e.area.categoryKey,e.tiers[0].id,e.tiers[0].price,e.area.id))} \xB7 ${(0,te.tCount)("picker.leftCount",e.area.available)}`);let r=t.querySelector("[data-ga-total]");r&&(r.textContent=i.money(o));let a=t.querySelector("[data-ga-hint]");a&&(a.textContent=n>=e.max&&e.max>0?e.area.available<=e.max?(0,te.tCount)("picker.leftCount",e.area.available):(0,te.t)("picker.maxTicketsForOrder",{count:i.maxTickets}):"");let l=t.querySelector("[data-ga-confirm]");l&&(l.textContent=e.reopened?(0,te.tCount)("picker.gaUpdate",n,{count:n}):(0,te.tCount)("picker.gaAdd",n,{count:n,price:i.money(o)}),l.disabled=n<=0&&!e.reopened)}function Dc(i,e,t){e.querySelectorAll("[data-ga-step]").forEach(n=>{n.addEventListener("click",()=>{let o=n.closest("[data-ga-tier]");if(!o)return;let s=o.dataset.gaTier?o.dataset.gaTier:null,r=Number(n.dataset.gaStep),a=t.draft.get(s)??0,l=t.max-Gn(t);t.draft.set(s,Math.max(0,a+(r>0?Math.min(1,l):-1))),_s(i,t)})}),e.querySelectorAll("[data-ga-cancel]").forEach(n=>n.addEventListener("click",()=>Ce(i))),e.querySelector("[data-ga-remove]")?.addEventListener("click",()=>{i.gaQty.delete(t.area.id),Ce(i),i.syncTray(),zn(i,(0,te.t)("picker.gaRemoved",{area:t.area.displayLabel??t.area.label}))}),e.querySelector("[data-ga-confirm]")?.addEventListener("click",()=>{Bc(i,t)}),e.addEventListener("mousedown",n=>{n.target===e&&Ce(i)}),e.addEventListener("keydown",n=>{if(n.key==="Escape"){n.stopPropagation(),Ce(i);return}if(n.key!=="Tab")return;let o=[...e.querySelectorAll('button:not(:disabled),[tabindex]:not([tabindex="-1"])')];if(!o.length)return;let s=o[0],r=o[o.length-1];n.shiftKey&&document.activeElement===s?(n.preventDefault(),r.focus()):!n.shiftKey&&document.activeElement===r&&(n.preventDefault(),s.focus())})}function Bc(i,e){let t=Gn(e),n=Os(i,e);for(let s of e.tiers)oi(i.gaQty,e.area.id,s.id,e.draft.get(s.id)??0);Ce(i),i.syncTray();let o=e.area.displayLabel??e.area.label;t>0?zn(i,(0,te.tCount)("picker.gaAdded",t,{count:t,area:o,price:i.money(n)})):zn(i,(0,te.t)("picker.gaRemoved",{area:o}))}function Fc(i,e,t,n,o){if(typeof n=="number")oi(i.gaQty,e.id,t[0].id,Math.max(0,Math.min(o,Math.floor(n))));else{i.gaQty.delete(e.id);let s=o;for(let r of t){let a=Math.max(0,Math.floor(n[r.id??""]??0)),l=Math.min(a,s);s-=l,oi(i.gaQty,e.id,r.id,l)}}i.syncTray()}function Ce(i,e=!0){let t=i.gaPromptReturnFocus;i.gaPromptEl&&zi(i.gaPromptEl),i.gaPromptEl=null,i.gaPromptReturnFocus=null,e&&t&&requestAnimationFrame(()=>(t.isConnected?t:i.root)?.focus())}function Vc(i,e,t){let n=i.root,o=e.querySelector(".sl-ga-pop");if(!n||!o||!t)return;let s=n.getBoundingClientRect(),r=t.x-s.left,a=t.y-s.top;e.style.setProperty("--sl-ga-anchor-x",`${r}px`),e.style.setProperty("--sl-ga-anchor-y",`${a}px`),requestAnimationFrame(()=>{let l=o.offsetWidth||260,c=o.offsetHeight||220,d=Math.max(8,Math.min(s.width-l-8,r-l/2)),p=a-c-14,u=p>=8?p:Math.min(s.height-c-8,a+14);o.style.left=`${d}px`,o.style.top=`${Math.max(8,u)}px`,o.dataset.side=p>=8?"above":"below",o.style.setProperty("--sl-ga-arrow-x",`${Math.max(12,Math.min(l-12,r-d))}px`)})}function zn(i,e){i.srEl&&(i.srEl.textContent=e)}function Ns(i,e,t=[]){let n=[],o=_c(t);for(let r of e){let a=i.gaQty.get(r.id);if(!a)continue;let l=$i(r);for(let c of l){let d=(a.get(c.id)??0)-(o.get(`${r.id}\0${c.id??""}`)??0);if(d<=0)continue;let p=i.paidPrice(r.categoryKey,c.id,c.price,r.id);n.push(`<div class="sl-ga" data-ga="${q(r.id)}" data-ga-row-tier="${q(c.id??"")}"><div class="sl-ga-info"><div class="sl-ga-name">${q(r.displayLabel??r.label)}</div><div class="sl-ga-sub">${q(l.length>1?c.label:r.displayType??i.tf("picker.generalAdmission","General admission"))} \xB7 ${q(i.money(p))} \xB7 ${q((0,te.tCount)("picker.leftCount",r.available))}</div></div><div class="sl-ga-qty"><button type="button" data-d="-1" aria-label="${q(i.tf("picker.fewer","Fewer"))}">\u2212</button><span>${d}</span><button type="button" data-d="1" aria-label="${q(i.tf("picker.more","More"))}">+</button></div></div>`)}}let s=e.filter(r=>Rt(i.gaQty,r.id)<=0&&!t.some(a=>a.objectId===r.id));return s.length&&n.push(`<div class="sl-ga-areas" data-ga-areas><button type="button" class="sl-ga-areas-toggle" data-ga-areas-toggle aria-expanded="${i.gaAreasExpanded}"><span>${q(i.tf("picker.gaAreasHeading","Areas"))}</span><small>${s.length}</small></button>`+(i.gaAreasExpanded?`<div class="sl-ga-areas-list">${s.map(r=>`<button type="button" class="sl-ga-area-open" data-ga-open="${q(r.id)}"${r.available<=0?" disabled":""}><span class="name">${q(r.displayLabel??r.label)}<small>${q(r.displayType??i.tf("picker.generalAdmission","General admission"))}</small></span><span class="meta">${q(i.money(i.paidPrice(r.categoryKey,null,r.price,r.id)))} \xB7 ${q(r.available>0?(0,te.tCount)("picker.leftCount",r.available):i.tf("picker.soldOutTitle","Sold out"))}</span></button>`).join("")}</div>`:"")+"</div>"),n.join("")}function Ds(i,e,t){e.querySelectorAll(".sl-ga .sl-ga-qty button").forEach(n=>{n.addEventListener("click",()=>{let o=n.closest(".sl-ga");if(!o?.dataset.ga)return;let s=t.find(c=>c.id===o.dataset.ga);if(!s)return;let r=o.dataset.gaRowTier?o.dataset.gaRowTier:null,a=Number(n.dataset.d),l=i.gaQty.get(s.id)?.get(r)??0;if(a>0&&Is(i,s)-Rt(i.gaQty,s.id)<=0){i.toast((0,te.t)("picker.maxTicketsForOrder",{count:i.maxTickets}),"warning");return}oi(i.gaQty,s.id,r,Math.max(0,l+a)),i.syncTray()})}),e.querySelector("[data-ga-areas-toggle]")?.addEventListener("click",()=>{i.gaAreasExpanded=!i.gaAreasExpanded,i.syncTray()}),e.querySelectorAll("[data-ga-open]").forEach(n=>{n.addEventListener("click",()=>{let o=t.find(s=>s.id===n.dataset.gaOpen);o&&jn(i,o,null,n)})})}var ji='<svg viewBox="0 0 64 56" width="12" height="11" fill="none" aria-hidden="true" focusable="false" style="display:block"><path d="M4 13 Q16 6 29 7 L28.5 17 Q17 16.5 7 22 Z" fill="#f4b740"/><path d="M4 13 Q16 6 29 7 L28.5 17 Q17 16.5 7 22 Z" fill="#f4b740" transform="translate(64 0) scale(-1 1)"/><path d="M8 28 Q18 22 28.6 23 L28.2 32 Q18 28.5 10 36 Z" fill="#fcf7ee"/><path d="M8 28 Q18 22 28.6 23 L28.2 32 Q18 28.5 10 36 Z" fill="#fcf7ee" transform="translate(64 0) scale(-1 1)"/><path d="M11 41 Q19 35 28.2 36 L27.8 45 Q19.5 42 13.5 49 Z" fill="#fcf7ee"/><path d="M11 41 Q19 35 28.2 36 L27.8 45 Q19.5 42 13.5 49 Z" fill="#fcf7ee" transform="translate(64 0) scale(-1 1)"/></svg>';var zc=/^[a-zA-Z0-9._-]+$/;function Un(i){let e;try{e=new URL(i,"https://seatlayer.invalid")}catch{return null}if(e.search||e.hash)return null;let t=/^\/pub\/events\/([^/]+)\/assets\/([^/]+)$/.exec(e.pathname);if(!t)return null;try{let n=decodeURIComponent(t[1]),o=decodeURIComponent(t[2]);return!n||!zc.test(o)?null:{eventKey:n,asset:o}}catch{return null}}function $c(i){try{return/^\/pub\/events\/[^/]+\/assets(?:\/|$)/.test(new URL(i,"https://seatlayer.invalid").pathname)}catch{return!1}}var It=class{constructor(e,t){this.eventKey=e;this.load=t;this.pending=new Map;this.created=new Set;this.disposed=!1}resolve(e){let t=Un(e);if(!t)return Promise.resolve($c(e)||!xt(e)?null:e);if(t.eventKey!==this.eventKey||!this.load||this.disposed)return Promise.resolve(null);let n=this.pending.get(e);if(n)return n;let o=this.load(this.eventKey,t.asset).then(s=>{let r=URL.createObjectURL(s);return this.disposed?(URL.revokeObjectURL(r),null):(this.created.add(r),r)}).catch(s=>{throw this.pending.delete(e),s});return this.pending.set(e,o),o}dispose(){if(!this.disposed){this.disposed=!0;for(let e of this.created)URL.revokeObjectURL(e);this.created.clear(),this.pending.clear()}}};var st=require("@seatlayer/core"),Wi=require("@seatlayer/core/view3d/crossfade/panorama");var Bs=`
185
+ `+Oc;function Fi(){try{return window.matchMedia?.("(prefers-reduced-motion: reduce)").matches===!0}catch{return!1}}function Vn(i,e){if(!e){i.style.removeProperty("--sl-mo-ox"),i.style.removeProperty("--sl-mo-oy");return}Vi(i,e,i.getBoundingClientRect())}function Vi(i,e,t){let n=t.width||1,o=t.height||1,s=r=>Math.max(0,Math.min(100,r));i.style.setProperty("--sl-mo-ox",`${s((e.x-t.left)/n*100).toFixed(1)}%`),i.style.setProperty("--sl-mo-oy",`${s((e.y-t.top)/o*100).toFixed(1)}%`)}function ks(i,e,t){let n=i.getBoundingClientRect(),o=t.getBoundingClientRect();Vi(i,e,{left:n.left-o.left,top:n.top-o.top,width:n.width,height:n.height})}function Ts(i,e){i.classList.remove("sl-mo-out"),e!==void 0&&Vn(i,e),i.classList.remove("sl-mo-in"),i.offsetWidth,i.classList.add("sl-mo-in")}function Es(i){i.classList.add("sl-mo-stagger");let e=0;for(let t of Array.from(i.children))t.style.setProperty("--sl-mo-i",String(e)),e+=1}function zi(i,e,t={className:"sl-mo-out",duration:ee.exit}){let n=()=>{o||(o=!0,!(typeof window>"u")&&(clearTimeout(s),i.removeEventListener("animationend",n),e?e():i.remove()))},o=!1;i.classList.remove("sl-mo-in","sl-mo-slide-up","sl-mo-spring","sl-mo-zoom","sl-mo-rise"),i.classList.add(t.className),i.addEventListener("animationend",n);let s=setTimeout(n,Fi()?0:t.duration+60)}var Vh={className:"sl-mo-slide-down",duration:ee.exit};function Cs(i){if(Fi())return i.onArrive?.(),null;let e=document.createElement("div");e.className="sl-mo-fly sl-mo-host",e.setAttribute("aria-hidden","true"),e.textContent=i.label??"",e.style.left=`${i.from.x}px`,e.style.top=`${i.from.y}px`,e.style.background=i.color??"var(--sl-accent,#6e7bff)",e.style.color=i.ink??"#fff",e.style.setProperty("--sl-fly-dx",`${Math.round(i.to.x-i.from.x)}px`),e.style.setProperty("--sl-fly-dy",`${Math.round(i.to.y-i.from.y)}px`),document.body.appendChild(e);let t=!1,n=()=>{t||(t=!0,window.clearTimeout(o),e.remove(),i.onArrive?.())};e.addEventListener("animationend",n);let o=window.setTimeout(n,ee.flight+80);return e}var q=i=>String(i??"").replace(/[&<>"']/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[e]);function Rt(i,e){let t=0;for(let n of i.get(e)?.values()??[])t+=n;return t}function As(i){let e=[];for(let[t,n]of i)for(let[o,s]of n)s>0&&e.push({areaId:t,tierId:o,qty:s});return e}function Ps(i){let e=new Map;for(let t of i.keys())e.set(t,Rt(i,t));return e}function oi(i,e,t,n){let o=i.get(e)??new Map;n>0?o.set(t,n):o.delete(t),o.size?i.set(e,o):i.delete(e)}function Ls(i){let e=new Map;for(let t of i)t.objectType!=="ga"||!t.objectId||e.set(t.objectId,(e.get(t.objectId)??0)+(t.quantity??1));return e}function je(i,e){let t=Ls(e),n=0;for(let o of i.keys())n+=Math.max(0,Rt(i,o)-(t.get(o)??0));return n}function Ms(i,e,t){let n=Ls(t),o=0;for(let s of e){let r=i.gaQty.get(s.id);if(!r)continue;let a=n.get(s.id)??0;for(let[l,c]of r){let d=Math.max(0,c-a);a=Math.max(0,a-c),o+=d*i.paidPrice(s.categoryKey,l,_c(s,l),s.id)}}return o}function _c(i,e){return e?i.tiers?.find(t=>t.id===e)?.price??i.price:i.price}function Hs(i){let e=[],t=new Map;for(let n of i){if(n.objectType!=="ga"||!n.objectId){e.push({...n,labels:[n.label]});continue}let o=`${n.objectId}\0${n.tierId??""}`,s=t.get(o);if(s){s.quantity=(s.quantity??0)+(n.quantity??1),s.labels.push(n.label);continue}let r={...n,quantity:n.quantity??1,labels:[n.label]};t.set(o,r),e.push(r)}return e}function Rs(i,e,t){let n=new Set(t);for(let o of e)o.objectType==="ga"&&o.objectId&&n.has(o.label)&&oi(i,o.objectId,o.tierId??null,0)}function $n(i,e){if(i.objectType!=="ga")return i.label;let t=e.find(n=>n.id===i.objectId);return t?.displayLabel??t?.label??i.label}function Nc(i){let e=new Map;for(let t of i){if(t.objectType!=="ga"||!t.objectId)continue;let n=`${t.objectId}\0${t.tierId??""}`;e.set(n,(e.get(n)??0)+(t.quantity??1))}return e}function $i(i){let e=i.tiers??[];return e.length>1?e.map(t=>({id:t.id,label:t.name||t.id,price:t.price})):[{id:null,label:i.displayType??(0,te.t)("picker.generalAdmission"),price:i.price}]}function Is(i,e){let t=i.totalTicketCount()-Rt(i.gaQty,e.id);return Math.max(0,Math.min(e.available,i.maxTickets-t))}function jn(i,e,t,n){if(Ce(i,!1),i.salesClosed){i.toast(i.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}let o=$i(e),s=i.gaQty.get(e.id),r=Rt(i.gaQty,e.id)>0,a=Is(i,e);if(a<=0&&!r){i.toast(e.available>0?(0,te.t)("picker.maxTicketsForOrder",{count:i.maxTickets}):i.tf("picker.soldOutTitle","Sold out"),"warning");return}if(i.onGAPromptHook){let u={};for(let[y,f]of s??[])u[y??""]=f;if(i.onGAPromptHook({area:e,selected:u,min:0,max:a,tiers:o,confirm:y=>{Vc(i,e,o,y,a)},cancel:()=>Ce(i)})===!0)return}let l=new Map;for(let u of o)l.set(u.id,s?.get(u.id)??0);!r&&a>0&&l.set(o[0].id,1);let c={area:e,tiers:o,draft:l,max:a,reopened:r},d=i.root?.dataset.layout==="narrow",p=document.createElement("div");p.className=d?"sl-ga-scrim sl-mo-scrim":"sl-ga-pop-layer",p.innerHTML=Dc(i,c,d),i.root?.appendChild(p),i.gaPromptEl=p,i.gaPromptReturnFocus=n??document.activeElement,d||zc(i,p,t),i.reducedMotion()&&(p.dataset.motion="reduced"),_s(i,c),Bc(i,p,c),requestAnimationFrame(()=>p.querySelector('[data-ga-step="1"]')?.focus())}function Dc(i,e,t){let{area:n,tiers:o}=e,s=o.length>1,r=n.displayLabel??n.label,a=o.map(l=>`<div class="sl-ga-prompt-row" data-ga-tier="${q(l.id??"")}"><div class="sl-ga-prompt-label"><span>${q(s?l.label:i.tf("picker.gaChooseTickets","How many tickets?"))}</span>`+(s?`<small>${q(i.money(i.paidPrice(n.categoryKey,l.id,l.price,n.id)))}</small>`:"")+`</div><div class="sl-ga-stepper" role="group" aria-label="${q(s?l.label:r)}"><button type="button" data-ga-step="-1" aria-label="${q(i.tf("picker.fewer","Fewer"))}">\u2212</button><output data-ga-qty aria-live="polite">0</output><button type="button" data-ga-step="1" aria-label="${q(i.tf("picker.more","More"))}">+</button></div></div>`).join("");return`<section class="${t?"sl-ga-sheet":"sl-ga-pop"}" role="dialog" aria-modal="true" aria-label="${q((0,te.t)("picker.gaChooseForArea",{area:r}))}"><div class="sl-ga-prompt-head"><div class="sl-ga-prompt-eyebrow">${q(n.displayType??i.tf("picker.generalAdmission","General admission"))}</div><h2 class="sl-ga-prompt-title">${q(r)}</h2><p class="sl-ga-prompt-sub" data-ga-sub></p><button type="button" class="sl-ga-prompt-close" data-ga-cancel aria-label="${q((0,te.t)("common.close"))}">\xD7</button></div><div class="sl-ga-prompt-body">${a}`+(o.length>1?`<div class="sl-ga-prompt-total"><span>${q(i.tf("picker.total","Total"))}</span><b data-ga-total></b></div>`:"")+'<p class="sl-ga-prompt-hint" data-ga-hint></p></div><div class="sl-ga-prompt-actions">'+(e.reopened?`<button type="button" class="sl-ga-prompt-remove" data-ga-remove>${q(i.tf("picker.gaRemove","Remove"))}</button>`:`<button type="button" class="sl-ga-prompt-remove" data-ga-cancel>${q((0,te.t)("common.cancel"))}</button>`)+'<button type="button" class="sl-ga-prompt-confirm" data-ga-confirm></button></div></section>'}function Gn(i){let e=0;for(let t of i.draft.values())e+=t;return e}function Os(i,e){let t=0;for(let n of e.tiers)t+=(e.draft.get(n.id)??0)*i.paidPrice(e.area.categoryKey,n.id,n.price,e.area.id);return t}function _s(i,e){let t=i.gaPromptEl;if(!t)return;let n=Gn(e),o=Os(i,e);t.querySelectorAll("[data-ga-tier]").forEach(c=>{let d=c.dataset.gaTier?c.dataset.gaTier:null,p=e.draft.get(d)??0,u=c.querySelector("[data-ga-qty]");u&&(u.value=String(p)),c.querySelectorAll("[data-ga-step]").forEach(h=>{h.disabled=Number(h.dataset.gaStep)<0?p<=0:n>=e.max})});let s=t.querySelector("[data-ga-sub]");s&&(s.textContent=`${i.money(i.paidPrice(e.area.categoryKey,e.tiers[0].id,e.tiers[0].price,e.area.id))} \xB7 ${(0,te.tCount)("picker.leftCount",e.area.available)}`);let r=t.querySelector("[data-ga-total]");r&&(r.textContent=i.money(o));let a=t.querySelector("[data-ga-hint]");a&&(a.textContent=n>=e.max&&e.max>0?e.area.available<=e.max?(0,te.tCount)("picker.leftCount",e.area.available):(0,te.t)("picker.maxTicketsForOrder",{count:i.maxTickets}):"");let l=t.querySelector("[data-ga-confirm]");l&&(l.textContent=e.reopened?(0,te.tCount)("picker.gaUpdate",n,{count:n}):(0,te.tCount)("picker.gaAdd",n,{count:n,price:i.money(o)}),l.disabled=n<=0&&!e.reopened)}function Bc(i,e,t){e.querySelectorAll("[data-ga-step]").forEach(n=>{n.addEventListener("click",()=>{let o=n.closest("[data-ga-tier]");if(!o)return;let s=o.dataset.gaTier?o.dataset.gaTier:null,r=Number(n.dataset.gaStep),a=t.draft.get(s)??0,l=t.max-Gn(t);t.draft.set(s,Math.max(0,a+(r>0?Math.min(1,l):-1))),_s(i,t)})}),e.querySelectorAll("[data-ga-cancel]").forEach(n=>n.addEventListener("click",()=>Ce(i))),e.querySelector("[data-ga-remove]")?.addEventListener("click",()=>{i.gaQty.delete(t.area.id),Ce(i),i.syncTray(),zn(i,(0,te.t)("picker.gaRemoved",{area:t.area.displayLabel??t.area.label}))}),e.querySelector("[data-ga-confirm]")?.addEventListener("click",()=>{Fc(i,t)}),e.addEventListener("mousedown",n=>{n.target===e&&Ce(i)}),e.addEventListener("keydown",n=>{if(n.key==="Escape"){n.stopPropagation(),Ce(i);return}if(n.key!=="Tab")return;let o=[...e.querySelectorAll('button:not(:disabled),[tabindex]:not([tabindex="-1"])')];if(!o.length)return;let s=o[0],r=o[o.length-1];n.shiftKey&&document.activeElement===s?(n.preventDefault(),r.focus()):!n.shiftKey&&document.activeElement===r&&(n.preventDefault(),s.focus())})}function Fc(i,e){let t=Gn(e),n=Os(i,e);for(let s of e.tiers)oi(i.gaQty,e.area.id,s.id,e.draft.get(s.id)??0);Ce(i),i.syncTray();let o=e.area.displayLabel??e.area.label;t>0?zn(i,(0,te.tCount)("picker.gaAdded",t,{count:t,area:o,price:i.money(n)})):zn(i,(0,te.t)("picker.gaRemoved",{area:o}))}function Vc(i,e,t,n,o){if(typeof n=="number")oi(i.gaQty,e.id,t[0].id,Math.max(0,Math.min(o,Math.floor(n))));else{i.gaQty.delete(e.id);let s=o;for(let r of t){let a=Math.max(0,Math.floor(n[r.id??""]??0)),l=Math.min(a,s);s-=l,oi(i.gaQty,e.id,r.id,l)}}i.syncTray()}function Ce(i,e=!0){let t=i.gaPromptReturnFocus;i.gaPromptEl&&zi(i.gaPromptEl),i.gaPromptEl=null,i.gaPromptReturnFocus=null,e&&t&&requestAnimationFrame(()=>(t.isConnected?t:i.root)?.focus())}function zc(i,e,t){let n=i.root,o=e.querySelector(".sl-ga-pop");if(!n||!o||!t)return;let s=n.getBoundingClientRect(),r=t.x-s.left,a=t.y-s.top;e.style.setProperty("--sl-ga-anchor-x",`${r}px`),e.style.setProperty("--sl-ga-anchor-y",`${a}px`),requestAnimationFrame(()=>{let l=o.offsetWidth||260,c=o.offsetHeight||220,d=Math.max(8,Math.min(s.width-l-8,r-l/2)),p=a-c-14,u=p>=8?p:Math.min(s.height-c-8,a+14);o.style.left=`${d}px`,o.style.top=`${Math.max(8,u)}px`,o.dataset.side=p>=8?"above":"below",o.style.setProperty("--sl-ga-arrow-x",`${Math.max(12,Math.min(l-12,r-d))}px`)})}function zn(i,e){i.srEl&&(i.srEl.textContent=e)}function Ns(i,e,t=[]){let n=[],o=Nc(t);for(let r of e){let a=i.gaQty.get(r.id);if(!a)continue;let l=$i(r);for(let c of l){let d=(a.get(c.id)??0)-(o.get(`${r.id}\0${c.id??""}`)??0);if(d<=0)continue;let p=i.paidPrice(r.categoryKey,c.id,c.price,r.id);n.push(`<div class="sl-ga" data-ga="${q(r.id)}" data-ga-row-tier="${q(c.id??"")}"><div class="sl-ga-info"><div class="sl-ga-name">${q(r.displayLabel??r.label)}</div><div class="sl-ga-sub">${q(l.length>1?c.label:r.displayType??i.tf("picker.generalAdmission","General admission"))} \xB7 ${q(i.money(p))} \xB7 ${q((0,te.tCount)("picker.leftCount",r.available))}</div></div><div class="sl-ga-qty"><button type="button" data-d="-1" aria-label="${q(i.tf("picker.fewer","Fewer"))}">\u2212</button><span>${d}</span><button type="button" data-d="1" aria-label="${q(i.tf("picker.more","More"))}">+</button></div></div>`)}}let s=e.filter(r=>Rt(i.gaQty,r.id)<=0&&!t.some(a=>a.objectId===r.id));return s.length&&n.push(`<div class="sl-ga-areas" data-ga-areas><button type="button" class="sl-ga-areas-toggle" data-ga-areas-toggle aria-expanded="${i.gaAreasExpanded}"><span>${q(i.tf("picker.gaAreasHeading","Areas"))}</span><small>${s.length}</small></button>`+(i.gaAreasExpanded?`<div class="sl-ga-areas-list">${s.map(r=>`<button type="button" class="sl-ga-area-open" data-ga-open="${q(r.id)}"${r.available<=0?" disabled":""}><span class="name">${q(r.displayLabel??r.label)}<small>${q(r.displayType??i.tf("picker.generalAdmission","General admission"))}</small></span><span class="meta">${q(i.money(i.paidPrice(r.categoryKey,null,r.price,r.id)))} \xB7 ${q(r.available>0?(0,te.tCount)("picker.leftCount",r.available):i.tf("picker.soldOutTitle","Sold out"))}</span></button>`).join("")}</div>`:"")+"</div>"),n.join("")}function Ds(i,e,t){e.querySelectorAll(".sl-ga .sl-ga-qty button").forEach(n=>{n.addEventListener("click",()=>{let o=n.closest(".sl-ga");if(!o?.dataset.ga)return;let s=t.find(c=>c.id===o.dataset.ga);if(!s)return;let r=o.dataset.gaRowTier?o.dataset.gaRowTier:null,a=Number(n.dataset.d),l=i.gaQty.get(s.id)?.get(r)??0;if(a>0&&Is(i,s)-Rt(i.gaQty,s.id)<=0){i.toast((0,te.t)("picker.maxTicketsForOrder",{count:i.maxTickets}),"warning");return}oi(i.gaQty,s.id,r,Math.max(0,l+a)),i.syncTray()})}),e.querySelector("[data-ga-areas-toggle]")?.addEventListener("click",()=>{i.gaAreasExpanded=!i.gaAreasExpanded,i.syncTray()}),e.querySelectorAll("[data-ga-open]").forEach(n=>{n.addEventListener("click",()=>{let o=t.find(s=>s.id===n.dataset.gaOpen);o&&jn(i,o,null,n)})})}var ji='<svg viewBox="0 0 64 56" width="12" height="11" fill="none" aria-hidden="true" focusable="false" style="display:block"><path d="M4 13 Q16 6 29 7 L28.5 17 Q17 16.5 7 22 Z" fill="#f4b740"/><path d="M4 13 Q16 6 29 7 L28.5 17 Q17 16.5 7 22 Z" fill="#f4b740" transform="translate(64 0) scale(-1 1)"/><path d="M8 28 Q18 22 28.6 23 L28.2 32 Q18 28.5 10 36 Z" fill="#fcf7ee"/><path d="M8 28 Q18 22 28.6 23 L28.2 32 Q18 28.5 10 36 Z" fill="#fcf7ee" transform="translate(64 0) scale(-1 1)"/><path d="M11 41 Q19 35 28.2 36 L27.8 45 Q19.5 42 13.5 49 Z" fill="#fcf7ee"/><path d="M11 41 Q19 35 28.2 36 L27.8 45 Q19.5 42 13.5 49 Z" fill="#fcf7ee" transform="translate(64 0) scale(-1 1)"/></svg>';var $c=/^[a-zA-Z0-9._-]+$/;function Un(i){let e;try{e=new URL(i,"https://seatlayer.invalid")}catch{return null}if(e.search||e.hash)return null;let t=/^\/pub\/events\/([^/]+)\/assets\/([^/]+)$/.exec(e.pathname);if(!t)return null;try{let n=decodeURIComponent(t[1]),o=decodeURIComponent(t[2]);return!n||!$c.test(o)?null:{eventKey:n,asset:o}}catch{return null}}function jc(i){try{return/^\/pub\/events\/[^/]+\/assets(?:\/|$)/.test(new URL(i,"https://seatlayer.invalid").pathname)}catch{return!1}}var It=class{constructor(e,t){this.eventKey=e;this.load=t;this.pending=new Map;this.created=new Set;this.disposed=!1}resolve(e){let t=Un(e);if(!t)return Promise.resolve(jc(e)||!xt(e)?null:e);if(t.eventKey!==this.eventKey||!this.load||this.disposed)return Promise.resolve(null);let n=this.pending.get(e);if(n)return n;let o=this.load(this.eventKey,t.asset).then(s=>{let r=URL.createObjectURL(s);return this.disposed?(URL.revokeObjectURL(r),null):(this.created.add(r),r)}).catch(s=>{throw this.pending.delete(e),s});return this.pending.set(e,o),o}dispose(){if(!this.disposed){this.disposed=!0;for(let e of this.created)URL.revokeObjectURL(e);this.created.clear(),this.pending.clear()}}};var st=require("@seatlayer/core"),Wi=require("@seatlayer/core/view3d/crossfade/panorama");var Bs=`
186
186
  /* confirm card: a candidate is not in the tray until Select. Map gestures and
187
187
  floating chrome pause while the card owns focus, keeping the camera stable. */
188
188
  .sl-picker[data-confirming="true"] .sl-map-host>:not(.sl-confirm){pointer-events:none}
@@ -1569,7 +1569,7 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default;text-decoration-color:t
1569
1569
  .sl-picker .sl-fitpill.sl-fit-p2,.sl-picker .sl-fitpill.sl-fit-p3{font-size:11.5px}
1570
1570
  .sl-picker .sl-fitpill.sl-fit-p3{white-space:normal;text-align:center;
1571
1571
  padding-top:6px;padding-bottom:6px;line-height:1.2}
1572
- `;var Gs="seatlayer-picker-style",jc=`
1572
+ `;var Gs="seatlayer-picker-style",Gc=`
1573
1573
  .sl-picker{position:relative;display:flex;flex-direction:column;width:100%;height:100%;min-height:420px;overflow:hidden;
1574
1574
  background:var(--sl-bg);color:var(--sl-text);font-family:var(--sl-font);border-radius:var(--sl-radius);
1575
1575
  /* iOS INFLATES FIXED-PX TYPE IN A HOST LAYOUT IT DECIDES IS TOO NARROW, and
@@ -3215,7 +3215,7 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default;text-decoration-color:t
3215
3215
  box-shadow:0 0 0 1.5px var(--sl-accent-ink)}
3216
3216
 
3217
3217
  /* modal host */
3218
- .sl-modal-scrim{position:fixed;inset:0;z-index:2147483000;background:rgba(5,7,12,.66);display:flex;align-items:center;justify-content:center;padding:18px}
3218
+ .sl-modal-scrim{position:fixed;inset:0;box-sizing:border-box;z-index:2147483000;background:rgba(5,7,12,.66);display:flex;align-items:center;justify-content:center;padding:18px}
3219
3219
  /* The frame clips to its own radius and the picker inside is squared against
3220
3220
  it, so nothing of the scrim shows at the corners. It still carries a ground
3221
3221
  of its own for the moment before the picker has painted \u2014 the picker's, via
@@ -3226,9 +3226,13 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default;text-decoration-color:t
3226
3226
  (14px) inside it leaves a sliver of scrim showing at each corner, which
3227
3227
  reads as a rendering fault rather than as a rounded card. One owner of the
3228
3228
  corners, and it is the frame. */
3229
- .sl-modal-frame > .sl-picker{border-radius:0}
3229
+ .sl-modal-frame > .sl-picker{border-radius:0;min-height:0}
3230
+ /* A landscape phone or keyboard can leave less room than the wide panel's
3231
+ fixed sections. Let those sections scroll while keeping its action visible. */
3232
+ .sl-modal-frame .sl-picker[data-layout="wide"] .sl-side{overflow-y:auto}
3233
+ .sl-modal-frame .sl-picker[data-layout="wide"] .sl-foot{position:sticky;bottom:0}
3230
3234
  @media(max-width:640px){.sl-modal-scrim{padding:0}.sl-modal-frame{width:100%;height:100%;border-radius:0}}
3231
- `;function Ot(){if(document.getElementById(Gs))return;let i=document.createElement("style");i.id=Gs,i.textContent=jc+$s+zs+Bs+js+Vs+Fs+Ss,document.head.appendChild(i)}async function Gi(i,e){let t=i.overlay.productionElements;if(!t?.some(o=>o.contentImageUrl))return i;let n=await Promise.all(t.map(async o=>{if(!o.contentImageUrl)return o;try{let s=await e(o.contentImageUrl);if(!s){let{contentImageUrl:r,...a}=o;return a}return{...o,runtimeContentImageUrl:s}}catch{let{contentImageUrl:s,...r}=o;return r}}));return{...i,overlay:{...i.overlay,productionElements:n}}}async function Ui(i,e){if(i)try{let t=await e(i);return t?await(await fetch(t)).arrayBuffer():void 0}catch{return}}var Ge=require("@seatlayer/core/view/panoramaDelivery");function qi(i){let{root:e,source:t,caption:n,real:o,closeLabel:s,dragHint:r,viewFromSeatLabel:a,real360Label:l,previewLabel:c,resolveAsset:d,onClose:p}=i,u=i.chrome??{},h=document.createElement("div");h.className="sl-view sl-mo-zoom",h.setAttribute("role","dialog"),h.setAttribute("aria-label",a),h.innerHTML='<div class="sl-view-head"><span class="sl-view-title"></span><span class="sl-view-cap"></span><button type="button" class="sl-view-x"><svg viewBox="0 0 24 24"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg></button></div><div class="sl-view-pano"><span class="sl-view-badge"></span><span class="sl-view-hint"></span></div>';let y=M=>h.querySelector(M)?.remove();u.title===!1?y(".sl-view-title"):h.querySelector(".sl-view-title").textContent=a,u.caption===!1?y(".sl-view-cap"):h.querySelector(".sl-view-cap").textContent=n,h.querySelector(".sl-view-x").setAttribute("aria-label",s),u.badge===!1?y(".sl-view-badge"):h.querySelector(".sl-view-badge").textContent=o?l:c,h.querySelector(".sl-view-hint").textContent=r,e.appendChild(h);let g=h.querySelector(".sl-view-pano"),T=(0,Ge.planPanoramaDelivery)(t,(0,Ge.browserPanoramaConstraints)()),w=new AbortController;g.style.backgroundImage=`url(${JSON.stringify(T.initialUrl)})`;let v=()=>{};T.upgradeUrl&&(v=(0,Ge.schedulePanoramaUpgrade)(()=>{d(T.upgradeUrl).then(M=>!M||w.signal.aborted?null:(0,Ge.loadPanoramaImage)(M,w.signal).then(()=>M)).then(M=>{!M||!h.isConnected||w.signal.aborted||(g.style.backgroundImage=`url(${JSON.stringify(M)})`)}).catch(()=>{})}));let A=70,D=35,K=1,f=g.clientHeight||1,L=g.clientWidth||1,N=-(f*(180/A)*2/2-L/2),R=0,O=()=>{let M=g.clientHeight||1,yt=M*(180/A)*K,Qe=Math.max(0,yt-M),Xt=Math.min(Qe/2,D/180*yt);R=Math.min(Xt,Math.max(-Xt,R)),g.style.backgroundSize=`auto ${yt}px`,g.style.backgroundPosition=`${N}px ${R-Qe/2}px`};O();let C=!1,_=0,U=0,G=M=>{C=!0,_=M.clientX,U=M.clientY,g.classList.add("drag"),g.setPointerCapture?.(M.pointerId)},de=M=>{C&&(N+=M.clientX-_,R+=M.clientY-U,_=M.clientX,U=M.clientY,O())},ge=M=>{C=!1,g.classList.remove("drag"),g.releasePointerCapture?.(M.pointerId)},X=M=>{M.preventDefault(),K=Math.min(2.4,Math.max(1,K+(M.deltaY<0?.12:-.12))),O()};g.addEventListener("pointerdown",G),g.addEventListener("pointermove",de),g.addEventListener("pointerup",ge),g.addEventListener("pointercancel",ge),g.addEventListener("wheel",X,{passive:!1});let V=h.querySelector(".sl-view-x");V.addEventListener("click",p);let Z=M=>{M.key==="Escape"&&(M.stopPropagation(),p())};return h.addEventListener("keydown",Z),V.focus(),{element:h,dispose(){v(),w.abort(),g.removeEventListener("pointerdown",G),g.removeEventListener("pointermove",de),g.removeEventListener("pointerup",ge),g.removeEventListener("pointercancel",ge),g.removeEventListener("wheel",X),h.removeEventListener("keydown",Z),V.removeEventListener("click",p)}}}function Gc(i,e){if(!e)return{targetSeatId:null,previousSeatId:null,nextSeatId:null};let t=i.find(s=>s.id===e);if(!t?.rowId)return{targetSeatId:e,previousSeatId:null,nextSeatId:null};let n=i.filter(s=>s.rowId===t.rowId),o=n.findIndex(s=>s.id===e);return{targetSeatId:e,previousSeatId:o>0?n[o-1].id:null,nextSeatId:o>=0&&o+1<n.length?n[o+1].id:null}}var Us=6e4,Ki=class{constructor(e){this.buyerView_="map";this.targetSeatId_=null;this.focusedSectionId_=null;this.navigationMode_="orbit";this.overlay=null;this.handle=null;this.generation=0;this.seatViewGeneration=0;this.seatViewElement=null;this.seatViewDispose=null;this.options=e}get buyerView(){return this.buyerView_}get targetSeatId(){return this.targetSeatId_}get focusedSectionId(){return this.focusedSectionId_}get seatPosition(){return Gc(this.options.seats(),this.targetSeatId_)}get navigationMode(){return this.navigationMode_}canOffer3D(){return this.options.enable3D?this.handle&&this.overlay?!0:!this.options.doc()||!Ei()?!1:this.options.seats().length<=this.max3DSeats():!1}canOfferSeatView(){return this.options.enableSeatView?this.options.seats().some(e=>!!e.viewUrl)?!0:this.hasStage():!1}async setBuyerView(e,t={}){if(e==="map"){this.exit3D();return}if(!this.canOffer3D())throw new Error("venue_3d_unavailable");if(this.buyerView_==="venue3d"&&this.handle){t.flyToSeatId?(this.targetSeatId_=t.flyToSeatId,this.focusedSectionId_=this.findSeat(t.flyToSeatId)?.sectionId??null,this.options.onViewChange(this.buyerView_,this.targetSeatId_),await this.handle.flyToSeat(t.flyToSeatId)):t.resetView&&this.handle.focusOverview();return}if(this.handle&&this.overlay){await this.restore3D(t);return}await this.enter3D(t.flyToSeatId)}async openSeatView(e){if(!this.canOfferSeatView())throw new Error("seat_view_unavailable");let t=this.findSeat(e),n=this.options.host(),o=this.options.doc();if(!t||!n||!o)throw new Error("seat_view_unavailable");let s=++this.seatViewGeneration,r,a,l=!1;if(t.viewUrl){let y=t.viewMeta?.previewUrl,g=!!y&&y!==t.viewUrl,T=g?await this.options.resolveAsset(y):null,w=g?t.viewUrl:await this.options.resolveAsset(t.viewUrl);if(s!==this.seatViewGeneration||!w||g&&!T)return;r={url:w,...T?{previewUrl:T}:{},...g?{resolveUrl:this.options.resolveAsset}:{},...t.viewMeta?.sourceWidth!==void 0?{sourceWidth:t.viewMeta.sourceWidth}:{},...t.viewMeta?.sourceHeight!==void 0?{sourceHeight:t.viewMeta.sourceHeight}:{},...t.viewMeta?.previewWidth!==void 0?{previewWidth:t.viewMeta.previewWidth}:{},...t.viewMeta?.previewHeight!==void 0?{previewHeight:t.viewMeta.previewHeight}:{},...t.viewMeta?.variants?.length?{variants:t.viewMeta.variants}:{},...t.viewMeta?.coverage?{coverage:t.viewMeta.coverage}:{},...t.viewMeta?.capturedAt?{capturedAt:t.viewMeta.capturedAt}:{},...t.viewMeta?.sourceLabel?{sourceLabel:t.viewMeta.sourceLabel}:{}},a=(0,Wi.seatViewDisclosure)(r),l=(0,Wi.isAuthoredSeatView)(r)}else{if(!this.hasStage())throw new Error("seat_view_unavailable");let{generateSeatPanorama:y}=await Ai();if(s!==this.seatViewGeneration)return;let g=o.floors?.find(v=>v.objects.some(A=>A.type==="row"&&A.id===t.rowId)),T=t.focalPoint??g?.focalPoint??o.focalPoint,w=y(t,T,[...this.options.seats()]);r={url:w.url,generated:!0},a=(0,st.t)("picker.illustrationCaption",{m:w.distanceM})}if(s!==this.seatViewGeneration)return;this.closeSeatView(!1),this.prepareHostTheme(n,o),Ot();let c=this.options.chrome??{},d=et(),p=(0,st.t)("picker.viewFromSeat",{label:t.displayLabel||t.label}),u=l?(0,st.t)("picker.real360"):(0,st.t)("picker.preview"),h=qi({root:n,source:r,caption:a,real:l,closeLabel:b("picker.close","Close"),dragHint:d,viewFromSeatLabel:p,real360Label:(0,st.t)("picker.real360"),previewLabel:(0,st.t)("picker.preview"),chrome:{title:c.seatViewTitle,caption:c.seatViewCaption,badge:c.seatViewBadge},resolveAsset:this.options.resolveAsset,onClose:()=>this.closeSeatView(!0,!0)});this.seatViewElement=h.element,this.seatViewDispose=h.dispose,this.options.onSeatViewChange?.({seatId:t.id,title:p,caption:a,badge:u,real:l,generated:!!r.generated,dragHint:d})}pushLiveState(){this.handle&&(this.handle.setAvailability(this.options.seats().map(e=>({seatId:e.id,state:this.seatState(e)}))),this.handle.setSelection(this.options.selection().map(e=>e.id)))}focusOverview(){return this.buyerView_!=="venue3d"||!this.handle?!1:(this.handle.focusOverview(),!0)}focusSection(e){return this.buyerView_==="venue3d"?this.handle?.focusSection(e)??!1:!1}focusFloor(e){let t=this.options.doc();if(this.buyerView_!=="venue3d"||!this.handle||!t?.floors?.length)return!1;let n=t.floors.findIndex(o=>o.id===e);return n>=0&&this.handle.focusFloor(n)}zoomIn(){return this.buyerView_!=="venue3d"||!this.handle?!1:(this.handle.zoomIn(),!0)}zoomOut(){return this.buyerView_!=="venue3d"||!this.handle?!1:(this.handle.zoomOut(),!0)}setNavigationMode(e){return this.navigationMode_=e,this.buyerView_!=="venue3d"||!this.handle?!1:(this.handle.setNavigationMode(e),this.options.onViewChange(this.buyerView_,this.targetSeatId_),!0)}destroy(){this.generation+=1,this.closeSeatView(!0,!1);try{this.handle?.dispose()}catch{}this.handle=null,this.overlay?.remove(),this.overlay=null,this.buyerView_="map",this.targetSeatId_=null,this.focusedSectionId_=null}max3DSeats(){let e=this.options.max3DSeats;if(typeof e=="number"&&e>0)return e;let t=globalThis.navigator;return(t?.hardwareConcurrency??8)<=4||(t?.deviceMemory??8)<=4||(globalThis.matchMedia?.("(pointer: coarse)").matches??!1)?Us/2:Us}async enter3D(e){let t=this.options.host(),n=this.options.doc();if(!t||!n||this.overlay)throw new Error("venue_3d_unavailable");Ot(),this.prepareHostTheme(t,n);let o=document.createElement("div");o.className="sl-view3d",o.setAttribute("role","group"),o.setAttribute("aria-label",b("picker.interactive3dVenueView","Interactive 3D venue view")),Object.assign(o.style,{position:"absolute",inset:"0",zIndex:"4",opacity:"0",touchAction:"none",transition:this.reducedMotion()?"none":"opacity 260ms cubic-bezier(.2,.8,.2,1)",background:"radial-gradient(120% 120% at 50% 0%,#191f28 0%,#0d1014 70%)"});let s=document.createElement("div");s.className="sl-view3d-loading",s.setAttribute("role","status"),s.setAttribute("aria-live","polite"),s.textContent=b("picker.loading3d","Building the 3D venue\u2026"),o.appendChild(s),t.appendChild(o),this.overlay=o;let r=++this.generation;if(this.reducedMotion()?o.style.opacity="1":requestAnimationFrame(()=>{o.style.opacity="1"}),await this.nextPaint(),!(r!==this.generation||this.overlay!==o))try{let[a,l]=await Promise.all([Qt(),this.options.loadEventConfiguration()]),c=l?await Gi(l,this.options.resolveAsset):null,d=await Ui(n.theme?.venue3d?.shellAssetUrl,this.options.resolveAsset);if(r!==this.generation||this.overlay!==o)return;let p={doc:n,seats:[...this.options.seats()],...c?{eventConfigurationId:c.id,eventConfiguration:c}:{},...d?{registeredShellGlb:d}:{}};s.textContent=b("picker.building3d","Building venue geometry\u2026");let u=await a.prepareVenue3D(p);if(r!==this.generation||this.overlay!==o)return;let h=this.options.chrome??{},y=a.mountVenue3D(o,{...p,prepared:u},{portraitOverviewCrop:!0,arriveAtSeatEye:!0,lookAroundHint:et(),navLabels:Ti(),...h.view3dCaption===!1||h.view3dSeatStepper===!1||h.view3dControlDock===!1?{chrome:{caption:h.view3dCaption!==!1,seatStepper:h.view3dSeatStepper!==!1,controlDock:h.view3dControlDock!==!1}}:{},seatViewActionLabel:g=>this.findSeat(g)?.viewUrl?b("picker.openAuthored360","Open venue 360\xB0"):b("picker.lookAroundLive3d","Look around in live 3D"),onSeatPick:g=>this.toggleSeat(g),onSeatInspect:g=>this.toggleSeat(g),onViewTargetChange:g=>{this.targetSeatId_=g,g&&(this.focusedSectionId_=this.findSeat(g)?.sectionId??null),this.options.onViewChange("venue3d",g)},onSectionFocusChange:g=>{this.focusedSectionId_=g,this.options.onViewChange("venue3d",this.targetSeatId_)},...this.options.enableSeatView?{getSeatView:g=>this.seatViewFor3D(g)}:{}});if(r!==this.generation||this.overlay!==o){y.dispose();return}this.handle=y,this.buyerView_="venue3d",this.targetSeatId_=e??null,this.focusedSectionId_=e?this.findSeat(e)?.sectionId??null:null,y.setNavigationMode(this.navigationMode_),requestAnimationFrame(()=>s.remove()),this.pushLiveState(),this.options.onViewChange("venue3d",this.targetSeatId_),e&&await y.flyToSeat(e)}catch(a){if(r!==this.generation)return;throw this.options.onError?.(a),this.remove3DOverlay(!1),a}}exit3D(){this.buyerView_==="map"&&!this.overlay||(this.generation+=1,this.buyerView_="map",this.targetSeatId_=null,this.focusedSectionId_=null,this.remove3DOverlay(!0,!!this.handle),this.options.onViewChange("map",null))}remove3DOverlay(e,t=!1){let n=this.handle,o=this.overlay;if(this.options.restoreMap(),t&&n&&o){o.style.pointerEvents="none";let s=()=>{this.buyerView_!=="map"||this.overlay!==o||(o.style.visibility="hidden",this.options.restoreMap())};!e||this.reducedMotion()?(o.style.opacity="0",s()):(requestAnimationFrame(()=>{o.style.opacity="0"}),setTimeout(s,280));return}if(this.handle=null,this.overlay=null,!o){try{n?.dispose()}catch{}this.options.restoreMap();return}if(!e||this.reducedMotion()){try{n?.dispose()}catch{}o.remove(),this.options.restoreMap();return}o.style.pointerEvents="none",requestAnimationFrame(()=>{o.style.opacity="0"}),setTimeout(()=>{try{n?.dispose()}catch{}o.remove(),this.options.restoreMap()},280)}async restore3D(e){let t=this.overlay,n=this.handle;if(!t||!n)throw new Error("venue_3d_unavailable");this.buyerView_="venue3d",this.targetSeatId_=e.flyToSeatId??null,this.focusedSectionId_=e.flyToSeatId?this.findSeat(e.flyToSeatId)?.sectionId??null:null,t.style.visibility="visible",t.style.pointerEvents="auto",this.reducedMotion()?t.style.opacity="1":requestAnimationFrame(()=>{t.style.opacity="1"}),n.resize(),n.setNavigationMode(this.navigationMode_),this.pushLiveState(),this.options.onViewChange("venue3d",this.targetSeatId_),e.flyToSeatId?await n.flyToSeat(e.flyToSeatId):e.resetView&&n.focusOverview()}nextPaint(){return this.reducedMotion()||typeof requestAnimationFrame!="function"?Promise.resolve():new Promise(e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))})}toggleSeat(e){if(!this.findSeat(e))return;this.options.selection().some(o=>o.id===e)?this.options.deselect(e):this.options.status(e)==="free"&&this.options.select(e),this.pushLiveState()}seatState(e){switch(this.options.status(e.id)){case"held":return"held";case"booked":return"sold";case"not_for_sale":return"dimmed";default:return"available"}}async seatViewFor3D(e){let t=this.findSeat(e);if(!t)throw new Error("seat_view_unavailable");if(t.viewUrl){let n=t.viewMeta?.previewUrl,o=!!n&&n!==t.viewUrl,s=o?await this.options.resolveAsset(n):null,r=o?t.viewUrl:await this.options.resolveAsset(t.viewUrl);if(!r||o&&!s)throw new Error("seat_view_unavailable");return{url:r,...s?{previewUrl:s}:{},...o?{resolveUrl:this.options.resolveAsset}:{},...t.viewMeta?.variants?.length?{variants:t.viewMeta.variants}:{},...t.viewMeta?.initialBearingDeg!==void 0?{initialBearingDeg:t.viewMeta.initialBearingDeg}:{},...t.viewMeta?.initialPitchDeg!==void 0?{initialPitchDeg:t.viewMeta.initialPitchDeg}:{},...t.viewMeta?.coverage?{coverage:t.viewMeta.coverage}:{},...t.viewMeta?.capturedAt?{capturedAt:t.viewMeta.capturedAt}:{},...t.viewMeta?.sourceLabel?{sourceLabel:t.viewMeta.sourceLabel}:{}}}return{url:"",generated:!0,mediaKind:"model",coverage:"exact-seat",sourceLabel:b("picker.chartDerivedModel","Chart-derived model")}}closeSeatView(e=!0,t=!1){e&&(this.seatViewGeneration+=1);let n=this.seatViewElement;if(this.seatViewDispose?.(),this.seatViewDispose=null,this.seatViewElement=null,!!n){if(this.options.onSeatViewChange?.(null),!t||this.reducedMotion()){n.remove();return}n.classList.add("is-leaving"),setTimeout(()=>n.remove(),190)}}findSeat(e){return this.options.seats().find(t=>t.id===e||t.label===e)}hasStage(){let e=this.options.doc();return e?(e.floors?.flatMap(n=>n.objects)??e.objects).some(n=>n.type==="shape"&&(n.role==="stage"||!!n.stageKind)):!1}prepareHostTheme(e,t){getComputedStyle(e).position==="static"&&(e.style.position="relative");let n=t.theme;e.style.setProperty("--sl-bg",n?.background??"#f6f7fb"),e.style.setProperty("--sl-surface","#ffffff"),e.style.setProperty("--sl-text",n?.textColor??"#10162a"),e.style.setProperty("--sl-muted","#697386"),e.style.setProperty("--sl-line","#d9deea"),e.style.setProperty("--sl-accent",n?.accent??"#ef4056"),e.style.setProperty("--sl-accent-ink",n?.accentInk??"#ffffff")}reducedMotion(){return globalThis.matchMedia?.("(prefers-reduced-motion: reduce)").matches??!1}};var Uc={host:"web",platform:"web",bundle:"",protocol:0,chromeOwner:"web"},qc={...Uc},Yi=null,qs=null;function Kc(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():0}function Wc(){let i=e=>Math.max(0,Math.round(e*100)/100);return{bootMs:i(Kc()),documentMs:Yi==null?0:i(Yi),handshakeMs:Yi==null||qs==null?0:i(qs-Yi)}}function Ks(){let{host:i,platform:e,bundle:t,protocol:n,chromeOwner:o}=qc,s=Wc();return{host:i,platform:e,...t?{bundle:t}:{},...n?{protocol:n}:{},chromeOwner:o,bootMs:s.bootMs,documentMs:s.documentMs,handshakeMs:s.handshakeMs}}var Ws=new Set;function Oe(i){return Ws.has(i)?"repeat":"cold"}function Xi(i){let e=Oe(i);return Ws.add(i),e}function be(i){return typeof i=="number"&&Number.isFinite(i)&&i>=0?Math.round(i):0}function Yc(){return typeof location>"u"?!1:/^(localhost|127\.0\.0\.1|\[::1\])$/i.test(location.hostname)}function Xc(i){if(!/^[A-Za-z0-9_-]{1,80}$/.test(i.event))return null;let e=i.performanceProfile??{};return{event:i.event,scope:i.scope,surface:i.surface,outcome:i.outcome,stage:i.stage?.slice(0,32)??"",ms:be(i.ms),api:be(e.loadChartAndStatuses)||be(e.loadChart),scene:be(e.buildScene),panel:be(e.buildBuyerControls),paint:be(e.firstPaint),normalize:be(e.normalizeBuyerModel),renderer:be(e.createRenderer),seats:be(i.seats),floors:be(i.floors),view:i.view??"map",load:i.load??Oe(i.event),transport:i.transport??"pubapi",chartBytes:be(i.chartDelivery?.bytes),chartCache:i.chartDelivery?.cache??"",...Ks(),availabilityMs:be(e.loadStatuses)}}var Zc=new Set;function Ae(i){let e=Xc(i);if(e){for(let t of Zc)try{t(e)}catch{}typeof fetch>"u"||Yc()||fetch(`${i.apiBase.replace(/\/+$/,"")}/pub/telemetry/chart-load`,{method:"POST",headers:{"Content-Type":"application/json","X-SeatLayer-Client":"1"},body:JSON.stringify(e),credentials:"omit",keepalive:!0}).catch(()=>{})}}function Zi(i){if(!i)return null;let e=i.getBoundingClientRect();return e.width>0&&e.height>0?e:null}function Qc(i){return Zi(i.foot?.querySelector(".sl-total"))??Zi(i.tray)??Zi(i.sheetHead)}function Kn(i,e,t,n,o){let s=i,r=s.map;if(!r||!e){o?.();return}let a=r.getBoundingClientRect(),l={x:a.left+e.x,y:a.top+e.y},c=t.displayLabel??t.label,d=n?.find(u=>u.key===t.categoryKey)?.color,p=()=>{let u=Qc(s);if(!u){o?.();return}Cs({from:l,to:{x:u.left+u.width/2,y:u.top+u.height/2},label:c,color:d,onArrive:o})};s.sheetHead&&Zi(s.sheetHead)?requestAnimationFrame(p):p()}var qn=60,Jc=650;function Ys(i,e){if(!e.length||i.focusSeats?.(e.map(o=>o.id)))return;let t=e.find(o=>o.sectionId)?.sectionId;if(!t)return;let n=e.filter(o=>o.sectionId===t);i.focus(t,{x:n.reduce((o,s)=>o+s.x,0)/n.length,y:n.reduce((o,s)=>o+s.y,0)/n.length})}function Xs(i,e){let t=!Fi();Ys({focusSeats:n=>i.focusSeats?.(n,{animate:t})===!0,focus:(n,o)=>i.focusSection(n,o)},(e?.items??[]).filter(n=>n.objectType!=="ga").slice(0,10).map(n=>i.seatByLabel(n.label)).filter(n=>!!n))}function Zs(i,e){if(!e.length)return;let t=i.reducedMotion===!0;t||e.forEach((r,a)=>{i.schedule(()=>i.pop(r.id),a*qn)});let n=t?0:e.length*qn,o=e.find(r=>r.sectionId)?.sectionId;if(i.schedule(()=>Ys(i,e),n),t)return;let s=n+(i.focusSeats||o?Jc:0);e.forEach((r,a)=>{i.schedule(()=>Kn(i.regions,i.screenPoint(r),r,i.categories),s+a*qn)})}function ed(i,e,t){for(let n of i)if(e>=n.x&&t>=n.y&&e<=n.x+n.w&&t<=n.y+n.h)return!0;return!1}var Qi=class{constructor(){this.rects=[];this.host=null;this.pointers=new Set;this.touches=new Set;this.mouseDown=!1;this.onPointerDown=e=>{this.inside(e.clientX,e.clientY)&&(this.pointers.add(e.pointerId),this.swallow(e))};this.onPointerFollow=e=>{this.pointers.has(e.pointerId)&&this.swallow(e)};this.onPointerEnd=e=>{this.pointers.delete(e.pointerId)&&this.swallow(e)};this.onTouchStart=e=>{let t=this.changed(e);if(!t.length)return;let n=!0;for(let o of t)this.inside(o.clientX,o.clientY)?this.touches.add(o.identifier):n=!1;n&&this.swallow(e)};this.onTouchFollow=e=>{let t=this.changed(e);t.length&&t.every(n=>this.touches.has(n.identifier))&&this.swallow(e)};this.onTouchEnd=e=>{let t=this.changed(e);if(!t.length)return;let n=t.every(o=>this.touches.has(o.identifier));for(let o of t)this.touches.delete(o.identifier);n&&this.swallow(e)};this.onMouseDown=e=>{this.inside(e.clientX,e.clientY)&&(this.mouseDown=!0,this.swallow(e))};this.onMouseFollow=e=>{this.mouseDown&&this.swallow(e)};this.onMouseUp=e=>{this.mouseDown&&(this.mouseDown=!1,this.swallow(e))};this.onClick=e=>{this.inside(e.clientX,e.clientY)&&this.swallow(e)}}set(e){this.rects=e.map(t=>({x:t.x,y:t.y,w:t.w,h:t.h})),this.rects.length||(this.pointers.clear(),this.touches.clear(),this.mouseDown=!1)}get(){return this.rects}attach(e){if(this.host===e)return;this.detach(),this.host=e;let t={capture:!0,passive:!1};e.addEventListener("pointerdown",this.onPointerDown,t),e.addEventListener("pointermove",this.onPointerFollow,t),e.addEventListener("pointerup",this.onPointerEnd,t),e.addEventListener("pointercancel",this.onPointerEnd,t),e.addEventListener("touchstart",this.onTouchStart,t),e.addEventListener("touchmove",this.onTouchFollow,t),e.addEventListener("touchend",this.onTouchEnd,t),e.addEventListener("touchcancel",this.onTouchEnd,t),e.addEventListener("mousedown",this.onMouseDown,t),e.addEventListener("mousemove",this.onMouseFollow,t),e.addEventListener("mouseup",this.onMouseUp,t),e.addEventListener("click",this.onClick,t),e.addEventListener("dblclick",this.onClick,t)}detach(){let e=this.host;if(!e)return;let t={capture:!0};e.removeEventListener("pointerdown",this.onPointerDown,t),e.removeEventListener("pointermove",this.onPointerFollow,t),e.removeEventListener("pointerup",this.onPointerEnd,t),e.removeEventListener("pointercancel",this.onPointerEnd,t),e.removeEventListener("touchstart",this.onTouchStart,t),e.removeEventListener("touchmove",this.onTouchFollow,t),e.removeEventListener("touchend",this.onTouchEnd,t),e.removeEventListener("touchcancel",this.onTouchEnd,t),e.removeEventListener("mousedown",this.onMouseDown,t),e.removeEventListener("mousemove",this.onMouseFollow,t),e.removeEventListener("mouseup",this.onMouseUp,t),e.removeEventListener("click",this.onClick,t),e.removeEventListener("dblclick",this.onClick,t),this.host=null,this.pointers.clear(),this.touches.clear(),this.mouseDown=!1}inside(e,t){if(!this.rects.length||!this.host)return!1;let n=this.host.getBoundingClientRect();return ed(this.rects,e-n.left,t-n.top)}swallow(e){e.stopImmediatePropagation(),e.stopPropagation(),e.cancelable&&e.preventDefault()}changed(e){let t=e.changedTouches;return t?Array.from(t):[]}},Qs=.48,td=8;function id(i,e,t,n=Qs){let o=Math.max(0,t.top),s=e.height-Math.max(0,t.bottom);if(!(s>o))return 0;let r=Number.isFinite(n)?Math.min(1,Math.max(0,n)):Qs,a=o+(s-o)*r-i;return Math.abs(a)<=td?0:Math.round(a)}function Js(i,e,t={}){let n=i.gestureCount();if(t.gestures!==void 0&&t.gestures!==n)return{dy:0,gestures:n};let o=i.seatPoint(e);if(!o)return{dy:0,gestures:n};let s=id(o.y,{height:i.mapHeight()},i.insets(),t.fraction);return s?{dy:i.panScreenBy({x:0,y:s},t.animate!==!1)?s:0,gestures:n}:{dy:0,gestures:n}}var si=class i{constructor(e,t=null){this.seams=e;this.watch=null;this.mode=t,this.watchMode()}themeMode(){return this.mode}setThemeMode(e,t){let n=t!==void 0&&"mapTheme"in t;e===this.mode&&!n||(n&&this.seams.setHostMapTheme(t.mapTheme??void 0),this.mode=e,this.watchMode(),this.applyThemeMode())}static groundFor(e){return Tt(null,e)}applyThemeMode(){let e=this.seams.mapTheme()??i.groundFor(this.mode);this.seams.applyMapTheme(e??null)&&this.seams.changed()}watchMode(){this.watch?.(),this.watch=null,this.mode==="auto"&&(this.watch=Oi(()=>this.applyThemeMode()))}setViewportInsets(e){this.seams.applyViewportInsets(e),this.seams.changed()}viewportInsets(){return this.seams.readViewportInsets()}dispose(){this.watch?.(),this.watch=null}};var tr=require("@seatlayer/core"),ir=require("@seatlayer/core/core/seatConfidence");var er=require("@seatlayer/core");function _t(i){let e=i.viewMeta?.previewUrl??i.viewUrl;return e&&(Un(e)||xt(e))?e:null}function en(i){if(!i)return!1;let e=i.floors?.length?i.floors.map(t=>t.objects??[]):[i.objects??[]];for(let t of e)for(let n of t)if(n.type==="shape"&&(n.role==="stage"||n.stageKind))return!0;return!1}var nd=512,Ji=new Map;function tn(i,e){if(!e)return null;let t=`${i.id}|${Math.round(e.x)},${Math.round(e.y)}`,n=Ji.get(t);if(n!==void 0)return n;let o=null;try{o=(0,er.generateSeatThumb)(i,e).distanceM??null}catch{o=null}return Ji.size>=nd&&Ji.clear(),Ji.set(t,o),o}function ri(i){return i.getFocusedSection()!==null||i.seatsRevealed()}function od(i){let e=i.atVenueFit?.(),t=i.canZoomIn?.();return{...typeof e=="boolean"?{atVenueFit:e}:{},...typeof t=="boolean"?{canZoomIn:t}:{}}}function sd(i,e){return{accessibilityFilter:i.length>0,limitedViewFilter:e.some(t=>t.commercial?.restrictedView||t.commercial?.obstructedView)}}function rd(i,e,t,n){for(let o of e){if(o.count<=0)continue;let s=i.accessibilitySpread?.([o.key]);for(let r of s?.sections??[]){let a=t.get(r.id)??n.get(r.id);if(!a||r.free<=0)continue;let l=a.accessibleFree??(a.accessibleFree={});l[o.key]=r.free}}}function nr(i,e,t){let n=i.doc,o=n?.theme??{},s=i.categoryAvailability(),r=i.getGAAreas(),a=i.getFloors(),l=i.getExpandedSeats(),c=i.getAccessNeeds(),d=sd(c,l),p=e.seatPosition,u=p.targetSeatId?i.seatDetails(p.targetSeatId):null,h=new Map(l.map(v=>[v.id,v])),y=en(n),g=n?.floors?.flatMap(v=>v.objects)??n?.objects??[],T=new Map,w=new Map;for(let v of g){if(v.type!=="section")continue;let A={id:v.id,label:v.label,...v.displayLabel?{displayLabel:v.displayLabel}:{},...v.zone?{zoneId:v.zone}:{}};T.set(v.id,A);let D=v.logicalSectionId??v.id;w.has(D)||w.set(D,A)}return rd(i,c,T,w),{event:{key:t.event,name:t.eventInfo?.name??n?.name??t.event,venue:t.eventInfo?.venue??null,startsAt:t.eventInfo?.startsAt??null,timezone:t.eventInfo?.timezone??null,currency:t.eventInfo?.currency??t.currency??"USD",locale:(0,tr.getLocale)()||t.eventLocale,posterUrl:t.eventInfo?.posterUrl??null,mode:t.mode_??"live",salesClosed:t.eventInfo?.salesClosed??!1},branding:{...o.accent?{accent:o.accent}:{},...o.accentInk?{accentInk:o.accentInk}:{},...o.background?{background:o.background}:{},...o.textColor?{textColor:o.textColor}:{},...o.brandName?{brandName:o.brandName}:{},...o.logoUrl?{logoUrl:o.logoUrl}:{},attributionRequired:!o.hideBadge},features:{ga:r.length>0,tiers:!!n?.categories.some(v=>v.tiers?.length),floors:a.length>1,zones:!!n?.zones?.length,sections:T.size>0,bestAvailable:!0,...d,venue3d:e.canOffer3D(),seatView:e.canOfferSeatView()},catalog:{categories:(n?.categories??[]).filter(v=>!v.notForSale).map(v=>({key:v.key,label:v.label,color:v.color,price:v.price??v.tiers?.[0]?.price??0,available:s[v.key]??0,...Object.prototype.hasOwnProperty.call(s,v.key)?{free:s[v.key]}:{},tiers:(v.tiers??[]).map(A=>({id:A.id,name:A.name,price:A.price,...A.currency?{currency:A.currency}:{}}))})),zones:(n?.zones??[]).map(v=>({id:v.id,label:v.label,...v.color?{color:v.color}:{}})),sections:[...T.values()],gaAreas:r,bestAvailableZones:i.getBestAvailableZones()},map:{floors:a,activeFloorId:i.getActiveFloorId()||a[0]?.id||null,floorMode:i.isFloorOverview()?"all":"single",floorLabelStyle:i.getRenderer()?.getFloorLabelStyle?.()??"number",rung:i.getRung(),canZoomOut:ri(i)||t.focusedSection_!==null,...od(i),focusedSectionId:i.getFocusedSection(),focusedSection:t.focusedSection_,viewMode:i.getViewMode(),buyerView:e.buyerView,view3dTargetSeatId:p.targetSeatId,view3dTargetSeat:u,view3dPreviousSeatId:p.previousSeatId,view3dNextSeatId:p.nextSeatId,view3dFocusedSectionId:e.focusedSectionId,view3dNavigationMode:e.navigationMode,colorblindSafe:t.colorblindSafe_,viewportInsets:i.getViewportInsets(),categoryFilter:t.categoryFilter_?[...t.categoryFilter_]:null,accessibilityFilter:t.accessibilityFilter_?[...t.accessibilityFilter_]:null,hideLimitedView:t.hideLimitedView_,accessNeeds:c},selection:{seats:i.getSelection().map(v=>{let A=h.get(v.id);if(!A)return v;let D=i.worldToScreen({x:A.x,y:A.y}),K=_t(A),f=y?tn(A,A.focalPoint??n?.focalPoint):null;return{...v,screenPoint:{x:D.x,y:D.y},...K?{seatViewThumb:{reference:K,kind:"real"}}:{},...f!=null?{sightlineMetres:f}:{},...A.confidenceEvidence?{seatViewConfidence:(0,ir.seatConfidenceDisclosure)(A.confidenceEvidence)}:{}}}),validity:i.getSelectionValidity(),maxSelection:t.maxSelection_},access:{...t.accessState_}}}var ad="https://api.seatlayer.io",or=10;function ld(i){if(typeof i=="string"){let e=document.querySelector(i);if(!e)throw new Error(`seatmap: container "${i}" not found`);return e}if(!(i instanceof HTMLElement))throw new Error("seatmap: container must be a CSS selector or an HTMLElement");return i}var nn=class{constructor(e){this.mount=null;this.hostEl=null;this.interactionEnabled_=!0;this.eventLocale=null;this.localeGeneration=0;this.languageSelect=null;this.rendered=!1;this.mode_=null;this.eventInfo=null;this.categoryFilter_=null;this.accessibilityFilter_=null;this.hideLimitedView_=!1;this.focusedSection_=null;this.lastReportedViewRung_=null;this.lastReportedCanZoomOut_=!1;this.tipEl=null;this.tipPos={x:0,y:0};this.onTipMove=null;this.blockedRegions=null;this.realtime=null;this.holdingLabels=new Set;if(!e||typeof e!="object")throw new Error("seatmap: options object is required");if(!e.container)throw new Error("seatmap: `container` is required");if(!e.event||typeof e.event!="string")throw new Error("seatmap: `event` key is required");this.opts=e,this.maxSelection_=e.maxSelection??or,this.colorblindSafe_=e.colorblindSafe??!1;let t=!!(e.buyerAccessTokenProvider||e.buyerAccessToken||e.publicKey);this.accessState_={configured:t,status:t?"ready":"public"},this.publicKey=e.publicKey;let n={onExpired:a=>{this.accessState_={configured:!0,status:a.refreshed?"ready":"expired"},this.opts.onAccessExpired?.(a),this.notifyMapStateChange()},onUnavailable:a=>{this.accessState_={configured:!0,status:"unavailable",reason:a.reason},this.opts.onAccessUnavailable?.(a),this.notifyMapStateChange()}},o=(e.apiBase??ad).replace(/\/+$/,"");this.apiBase=o;let s=e.publicKey&&!e.buyerAccessTokenProvider&&!e.buyerAccessToken?Bi({base:o,event:e.event,publicKey:e.publicKey,accessHooks:n,apiOptions:{onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)}}):null;this.access=s?.access??Ht(e,n);let r=s?.api??new Ve(o,{access:this.access??void 0,onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)});this.api=r,this.controller=new $.PickerController({transport:r,eventKey:e.event,maxSelection:this.maxSelection_,selectedObjects:e.selectedObjects,selectableObjects:e.selectableObjects,numberOfPlacesToSelect:e.numberOfPlacesToSelect,selectionValidators:e.selectionValidators,currency:e.currency,onSelectionChange:a=>{this.immersive?.pushLiveState(),this.opts.onSelectionChange?.(a)},onSelectionValidityChange:a=>this.opts.onSelectionValidityChange?.(a),onSelectionValid:a=>this.opts.onSelectionValid?.(a),onSelectionInvalid:a=>this.opts.onSelectionInvalid?.(a),onDeselect:a=>{this.controller.currentHold()?.labels.includes(a.label)&&this.controller.releaseLabels([a.label])},retapKeepsSelection:!0,onSeatRetap:a=>this.opts.onSeatRetap?.(a),onSelectionLimit:a=>this.opts.onSelectionLimit?.(a),onHold:a=>this.opts.onHold?.({holdId:a.holdId,expiresAt:a.expiresAt,seats:a.seats,items:a.items}),onHoldRestored:a=>this.opts.onHoldRestored?.({holdId:a.holdId,expiresAt:a.expiresAt,seats:a.seats,items:a.items}),onHoldExpired:()=>this.opts.onHoldExpired?.(),onGAClick:a=>{let l=this.controller.getGAAreas().find(c=>c.id===a);l&&(this.opts.onGAClick?.(l),this.opts.onGAPrompt?.({area:l,selected:{},min:0,max:Math.max(0,Math.min(l.available,(this.opts.maxSelection??or)-this.controller.getSelection().length)),tiers:$i(l),confirm:c=>{let d=typeof c=="number"?c:Object.values(c).reduce((p,u)=>p+u,0);this.holdGA(l.id,d)},cancel:()=>{}}))},onError:a=>this.opts.onError?.(a),onDeckTap:a=>{this.opts.onDeckTap?.(a),this.notifyMapStateChange()},onHint:a=>this.opts.onHint?.(a),onSectionFocus:a=>{this.focusedSection_=a,this.opts.onSectionFocus?.(a),this.notifyMapStateChange()},onViewChange:()=>this.handleViewChange(),onStatusChange:()=>{this.immersive?.pushLiveState(),this.opts.onStatusChange?.()},onSalesClosed:()=>{this.eventInfo&&(this.eventInfo.salesClosed=!0),this.opts.onSalesClosed?.()},flashOnLiveChange:!0,onSeatHover:a=>{this.opts.onSeatHover?.(a),this.opts.seatTooltip!==!1&&this.updateTooltip(a)},colorblindSafe:e.colorblindSafe,mapTheme:e.mapTheme??si.groundFor(e.theme?.mode)??null}),this.hostSurface=new si({mapTheme:()=>this.opts.mapTheme,setHostMapTheme:a=>{this.opts.mapTheme=a},applyMapTheme:a=>this.controller.setMapTheme(a),applyViewportInsets:a=>this.controller.setViewportInsets(a),readViewportInsets:()=>this.controller.getViewportInsets(),changed:()=>this.notifyMapStateChange()},e.theme?.mode??null),this.buyerAssetUrls=new It(e.event,(a,l)=>r.asset(a,l)),this.immersive=new Ki({host:()=>this.hostEl,doc:()=>this.controller.doc,seats:()=>this.controller.getExpandedSeats(),selection:()=>this.controller.getSelection(),status:a=>this.controller.getStatus(a),select:a=>this.controller.select([a]),deselect:a=>this.controller.deselect([a]),loadEventConfiguration:()=>this.controller.loadEventConfiguration(),resolveAsset:a=>this.buyerAssetUrls.resolve(a),enable3D:e.enable3D!==!1,enableSeatView:e.enableSeatView!==!1,max3DSeats:e.max3DSeats,...e.chrome?{chrome:e.chrome}:{},restoreMap:()=>this.controller.refitCurrentView(),onViewChange:(a,l)=>{this.opts.onBuyerViewChange?.({view:a,...l?{seatId:l}:{}}),this.notifyMapStateChange()},onSeatViewChange:a=>this.opts.onSeatViewChange?.(a),onError:a=>this.opts.onError?.(a)}),this.lastReportedViewRung_=this.controller.getRung(),this.lastReportedCanZoomOut_=ri(this.controller)}handleViewChange(){this.opts.onViewChange?.();let e=this.controller.getRung(),t=ri(this.controller);e===this.lastReportedViewRung_&&t===this.lastReportedCanZoomOut_||(this.lastReportedViewRung_=e,this.lastReportedCanZoomOut_=t,this.opts.onMapStateChange?.())}notifyMapStateChange(){this.lastReportedViewRung_=this.controller.getRung(),this.lastReportedCanZoomOut_=ri(this.controller),this.opts.onMapStateChange?.()}async render(){if(this.rendered)return this;let e=performance.now();this.rendered=!0;let t=_i(this.opts.locale,this.opts.messages),n=this.localeGeneration+=1,o=(0,$.getLocale)();this.mount=ld(this.opts.container);let s=document.createElement("div");s.style.width="100%",s.style.height="100%",s.style.position="relative",this.mount.appendChild(s),this.hostEl=s,this.blockedRegions?.attach(s),Ni(s,t,a=>{a!==o&&this.applyActiveLocale(a,n)}),this.applyInteractionState();let r=await this.controller.render(s);if(!r)return Ae({apiBase:this.apiBase,event:this.opts.event,scope:"event",surface:"seating_chart",outcome:"failure",stage:"load_chart",ms:performance.now()-e,load:Oe(this.opts.event),transport:"pubapi"}),this.rendered=!1,this.opts.errorDisplay!=="none"&&this.showLoadFailure(s),this;if(this.eventLocale=r.locale??null,!this.opts.locale&&this.eventLocale&&this.setLocale(this.eventLocale),this.buildLanguageSwitcher(s),this.controller.setViewMode(this.opts.initialView??"flat"),this.opts.floorLabelStyle&&this.setFloorLabelStyle(this.opts.floorLabelStyle),this.startRealtime(),this.mode_=r.mode==="test"?"test":"live",this.eventInfo={name:r.eventName,venue:r.venue??null,startsAt:r.startsAt??null,timezone:r.timezone??null,currency:r.currency??this.opts.currency??"USD",posterUrl:r.posterUrl??null,salesClosed:r.salesClosed},this.opts.seatTooltip!==!1){let a=document.createElement("div");a.setAttribute("role","tooltip"),a.style.cssText='position:absolute;z-index:7;pointer-events:none;display:none;max-width:240px;background:#10162a;color:#fff;border-radius:10px;padding:9px 12px;font:500 12px/1.45 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;box-shadow:0 10px 30px -10px rgba(0,0,0,.5);',s.appendChild(a),this.tipEl=a,this.onTipMove=l=>{let c=s.getBoundingClientRect();this.tipPos={x:l.clientX-c.left,y:l.clientY-c.top},this.tipEl&&this.tipEl.style.display!=="none"&&this.placeTooltip()},s.addEventListener("mousemove",this.onTipMove)}if(r.mode==="test"&&this.opts.showTestModeIndicator!==!1){s.style.overflow="hidden";let a=document.createElement("div");a.dataset.slI18n="testMode",a.textContent=(0,$.t)("picker.testMode"),a.setAttribute("aria-label",(0,$.t)("picker.testMode")),a.style.cssText="position:absolute;top:18px;right:-34px;z-index:6;transform:rotate(45deg);width:140px;text-align:center;padding:4px 0;background:#f4b740;color:#1a1200;font:800 10.5px/1.4 -apple-system,BlinkMacSystemFont,sans-serif;letter-spacing:.12em;box-shadow:0 2px 8px rgba(0,0,0,.25);pointer-events:none;",s.appendChild(a)}return this.buildBadge(s),Ae({apiBase:this.apiBase,event:this.opts.event,scope:"event",surface:"seating_chart",outcome:"success",ms:performance.now()-e,performanceProfile:r.performanceProfile,chartDelivery:r.chartDelivery,seats:this.controller.getExpandedSeats().length,floors:this.controller.getFloors().length,view:"map",load:Xi(this.opts.event),transport:"pubapi"}),this}buildBadge(e){if(this.controller.doc?.theme?.hideBadge)return;let t=document.createElement("a");t.dataset.slI18n="badge",t.href="https://seatlayer.io",t.target="_blank",t.rel="noopener noreferrer",t.setAttribute("aria-label",(0,$.t)("picker.poweredBy")),t.style.cssText='position:absolute;bottom:10px;right:12px;z-index:5;display:inline-flex;align-items:center;gap:6px;padding:5px 9px;border-radius:999px;background:rgba(255,255,255,.92);color:#4a5163;text-decoration:none;font:600 11px/1 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;letter-spacing:.02em;box-shadow:0 2px 8px rgba(0,0,0,.12);';let n=document.createElement("span");n.setAttribute("aria-hidden","true"),n.style.cssText="width:16px;height:16px;border-radius:4px;flex:none;display:flex;align-items:center;justify-content:center;background:#0c1220;color:#fcf7ee",n.innerHTML=ji;let o=document.createElement("span");o.textContent=(0,$.t)("picker.poweredBy"),t.append(n,o),e.appendChild(t)}placeTooltip(){if(!this.tipEl||!this.hostEl)return;let e=this.hostEl.clientWidth,t=this.tipEl.offsetWidth,n=this.tipEl.offsetHeight,o=this.tipPos.x+14,s=this.tipPos.y-n-12;o+t>e-8&&(o=this.tipPos.x-t-14),s<8&&(s=this.tipPos.y+18),this.tipEl.style.left=`${Math.max(8,o)}px`,this.tipEl.style.top=`${Math.max(8,s)}px`}updateTooltip(e){if(!this.tipEl)return;if(!e){this.tipEl.style.display="none";return}let t=(0,$.formatMoney)(e.price,e.currency,{...Number.isInteger(e.price)?{minimumFractionDigits:0,maximumFractionDigits:0}:{},locale:this.opts.locale,fallback:(l,c)=>`${l} ${c}`}),n=document.createElement("div");n.style.cssText="font-weight:700;font-size:13px",n.textContent=e.label;let o=document.createElement("div");o.style.cssText="display:flex;align-items:center;gap:6px;margin-top:4px;color:#c7cddc";let s=document.createElement("span");s.style.cssText="width:9px;height:9px;border-radius:50%;flex:none",s.style.background=e.categoryColor;let r=document.createElement("span");r.textContent=e.categoryLabel;let a=document.createElement("span");if(a.style.cssText="margin-left:auto;font-weight:700;color:#fff",a.textContent=t,o.append(s,r,a),this.tipEl.replaceChildren(n,o),e.status!=="free"){let l=document.createElement("div");l.style.cssText="margin-top:5px;font-size:10.5px;letter-spacing:.08em;text-transform:uppercase;color:#fca5a5;font-weight:700",l.textContent=e.status==="held"?(0,$.t)("map.statusHeld"):(0,$.t)("map.statusTaken"),this.tipEl.appendChild(l)}this.tipEl.style.display="block",this.placeTooltip()}buildLanguageSwitcher(e){let t=(this.opts.languages??[]).map(o=>(0,$.resolveLocale)(o)).filter((o,s,r)=>r.indexOf(o)===s);if(t.length<2)return;let n=document.createElement("select");n.setAttribute("aria-label",(0,$.t)("picker.preferredTicketType")),n.style.cssText='position:absolute;bottom:10px;left:12px;z-index:5;appearance:none;padding:5px 9px;border-radius:999px;border:0;cursor:pointer;background:rgba(255,255,255,.92);color:#4a5163;font:600 11px/1 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;box-shadow:0 2px 8px rgba(0,0,0,.12);';for(let o of t){let s=document.createElement("option");s.value=o,s.textContent=$.LOCALE_NAMES[o]??o,s.selected=o===(0,$.getLocale)(),n.appendChild(s)}n.addEventListener("change",()=>{this.setLocale(n.value)}),e.appendChild(n),this.languageSelect=n}async setLocale(e){let t=(0,$.getLocale)(),n=this.localeGeneration+=1,o=await(0,$.loadLocale)(e);return this.opts.messages&&(0,$.setStringOverrides)(this.opts.messages),o===t||this.applyActiveLocale(o,n),o}applyActiveLocale(e,t){if(t!==this.localeGeneration)return;let n=this.hostEl;if(n){n.lang=e,n.dir=(0,$.localeDirection)(e);for(let o of n.querySelectorAll("[data-sl-i18n]"))if(o.dataset.slI18n==="testMode")o.textContent=(0,$.t)("picker.testMode"),o.setAttribute("aria-label",(0,$.t)("picker.testMode"));else if(o.dataset.slI18n==="badge"){o.setAttribute("aria-label",(0,$.t)("picker.poweredBy"));let s=o.querySelector("span:last-child");s&&(s.textContent=(0,$.t)("picker.poweredBy"))}this.languageSelect&&this.languageSelect.value!==e&&(this.languageSelect.value=e),this.controller.refreshMapCopy()}}getMode(){return this.mode_}getPickerState(){return nr(this.controller,this.immersive,{event:this.opts.event,currency:this.opts.currency,mode_:this.mode_,eventInfo:this.eventInfo,eventLocale:this.eventLocale,focusedSection_:this.focusedSection_,colorblindSafe_:this.colorblindSafe_,categoryFilter_:this.categoryFilter_,accessibilityFilter_:this.accessibilityFilter_,hideLimitedView_:this.hideLimitedView_,maxSelection_:this.maxSelection_,accessState_:this.accessState_})}getCategoryAvailability(){return this.controller.categoryAvailability()}getBestAvailableZones(){return this.controller.getBestAvailableZones()}getActiveFloorId(){return this.controller.getActiveFloorId()||null}getRung(){return this.controller.getRung()}getFocusedSection(){return this.controller.getFocusedSection()}focusSection(e){if(this.immersive.buyerView==="venue3d"&&this.immersive.focusSection(e)){this.notifyMapStateChange();return}this.controller.focusSection(e),this.notifyMapStateChange()}overview(){if(this.immersive.focusOverview()){this.notifyMapStateChange();return}this.controller.overview(),this.notifyMapStateChange()}setRung(e){this.controller.setRung(e),this.notifyMapStateChange()}setCategoryFilter(e,t=!1){this.categoryFilter_=e?[...e]:null,this.controller.setCategoryFilter(e),t&&this.controller.focusCategoryFilter(e),this.notifyMapStateChange()}setAccessibilityFilter(e){this.accessibilityFilter_=e?[...e]:null,this.controller.setAccessibilityFilter(e),this.notifyMapStateChange(),e?.length&&this.focusAccessibilityFilter()}focusAccessibilityFilter(){this.controller.focusAccessibilityFilter?.(),this.notifyMapStateChange()}focusNextAccessibleSection(e){let t=this.controller.focusNextAccessibleSection?.(e)??null;return t&&this.notifyMapStateChange(),t}setCommercialLimitedFilter(e){this.hideLimitedView_=e,this.controller.setCommercialLimitedFilter(e),this.notifyMapStateChange()}getSelection(){return this.controller.getSelection()}selectObjects(e){let t=this.controller.select(e);return this.immersive.pushLiveState(),t}deselectObjects(e){this.controller.deselect(e),this.immersive.pushLiveState()}clearSelection(){this.controller.clearSelection(),this.immersive.pushLiveState()}selectCategories(e){return this.controller.selectCategories(e)}deselectCategories(e){this.controller.deselectCategories(e)}setSelectableObjects(e){this.controller.setSelectableObjects(e)}setMaxSelection(e){this.maxSelection_=e,this.controller.setMaxSelection(e),this.notifyMapStateChange()}getSelectionValidity(){return this.controller.getSelectionValidity()}async hold(e={}){try{return await this.holdOrThrow(e)}catch(t){return this.opts.onError?.(t),null}}async holdOrThrow(e={}){let t=this.controller.getSelectionValidity();if(t&&!t.isValid){let n=t.violations.includes("numberOfPlacesToSelect");throw Object.assign(new Error(n?`seatmap: select exactly ${t.required} places before holding`:"seatmap: adjust the ticket selection before holding"),{code:n?"selection_count_mismatch":"selection_invalid",selection:t})}this.holdingLabels=new Set(this.controller.getSelection().map(n=>n.label));try{let n=await this.controller.hold(void 0,e.ttlMs);return n?{holdId:n.holdId,expiresAt:n.expiresAt,seats:n.seats,items:n.items}:null}finally{this.holdingLabels.clear()}}async resumeHold(e){try{return await this.resumeHoldOrThrow(e)}catch(t){return this.opts.onError?.(t),null}}async resumeHoldOrThrow(e){let t=await this.controller.resumeHold(e);return t?{holdId:t.holdId,expiresAt:t.expiresAt,seats:t.seats,items:t.items}:null}async extendHold(e){try{let t=await this.controller.extendHold(e);return t?{holdId:t.holdId,expiresAt:t.expiresAt,seats:t.seats,items:t.items}:null}catch(t){return this.opts.onError?.(t),null}}getCurrentHold(){let e=this.controller.currentHold();return e?{holdId:e.holdId,expiresAt:e.expiresAt,seats:e.seats,items:e.items}:null}getGAAreas(){return this.controller.getGAAreas()}async holdGA(e,t,n={}){try{return await this.holdGAOrThrow(e,t,n)}catch(o){return this.opts.onError?.(o),null}}async holdGAOrThrow(e,t,n={}){let o=await this.controller.holdGA(e,t,n);return o?{holdId:o.holdId,expiresAt:o.expiresAt,seats:o.seats,items:o.items}:null}async bestAvailable(e,t,n={}){try{return await this.bestAvailableOrThrow(e,t,n)}catch(o){return this.opts.onError?.(o),null}}async bestAvailableOrThrow(e,t,n={}){let o=await this.controller.bestAvailable(e,t,n);return Xs(this.controller,o),o?{holdId:o.holdId,expiresAt:o.expiresAt,labels:o.labels,seats:o.seats,items:o.items,...n.zoneId?{zoneId:n.zoneId}:{}}:null}setSeatTier(e,t){this.controller.setSeatTier(e,t)}setTableQuantity(e,t){return this.controller.setTableQuantity(e,t)}async replaceTableQuantity(e,t,n){try{return await this.replaceTableQuantityOrThrow(e,t,n)}catch(o){return this.opts.onError?.(o),null}}async replaceTableQuantityOrThrow(e,t,n){let o=await this.controller.replaceTableQuantity(e,t,n);return o?{holdId:o.holdId,expiresAt:o.expiresAt,seats:o.seats,items:o.items}:null}getFloors(){return this.controller.getFloors()}setFloor(e){if(this.immersive.buyerView==="venue3d"&&e!=="all"&&this.immersive.focusFloor(e)){this.notifyMapStateChange();return}if(this.controller.getFloors().length<=1){console.warn("seatmap: setFloor() ignored \u2014 this chart has a single floor");return}e==="all"?this.controller.setFloorOverview(!0):this.controller.setFloor(e),this.notifyMapStateChange()}setFloorLabelStyle(e){this.controller.getRenderer()?.setFloorLabelStyle?.(e),this.notifyMapStateChange()}setSectionFocusDim(e){this.controller.setSectionFocusDim(e)}setSelectionFocus(e){this.controller.setSelectionFocus(e)}setBlockedRegions(e){if(!this.blockedRegions){if(!e.length)return;this.blockedRegions=new Qi,this.hostEl&&this.blockedRegions.attach(this.hostEl)}this.blockedRegions.set(e)}getBlockedRegions(){return this.blockedRegions?.get()??[]}frameSeat(e,t={}){let n=this.controller.getRenderer();return Js({seatPoint:o=>{let s=this.controller.getExpandedSeats().find(r=>r.id===o);return s?this.controller.worldToScreen({x:s.x,y:s.y}):null},mapHeight:()=>this.hostEl?.clientHeight??0,insets:()=>this.controller.getViewportInsets(),gestureCount:()=>n?.getCameraGestureCount?.()??0,panScreenBy:(o,s)=>n?.panScreenBy?(n.panScreenBy(o,{animate:s}),!0):!1},e,t)}setColorblindSafe(e){this.colorblindSafe_=e,this.controller.setColorblindSafe(e),this.notifyMapStateChange()}setViewMode(e){this.controller.setViewMode(e),this.notifyMapStateChange()}getViewMode(){return this.controller.getViewMode()}zoomIn(){this.immersive.zoomIn()||(this.controller.zoomIn(),this.notifyMapStateChange())}zoomOut(){this.immersive.zoomOut()||(this.controller.zoomOut(),this.notifyMapStateChange())}zoomToFit(){this.immersive.focusOverview()||(this.controller.zoomToFit(),this.notifyMapStateChange())}setThemeMode(e,t){this.hostSurface.setThemeMode(e,t)}getThemeMode(){return this.hostSurface.themeMode()}setViewportInsets(e){this.hostSurface.setViewportInsets(e)}getViewportInsets(){return this.hostSurface.viewportInsets()}setBuyerView(e,t){return this.immersive.setBuyerView(e,t)}getBuyerView(){return this.immersive.buyerView}openSeatView(e){return this.immersive.openSeatView(e)}setVenue3DNavigationMode(e){if(!this.immersive.setNavigationMode(e))throw new Error("venue_3d_not_active")}setInteractionEnabled(e){this.interactionEnabled_=e,this.applyInteractionState()}applyInteractionState(){let e=this.hostEl;e&&(e.style.pointerEvents=this.interactionEnabled_?"":"none",e.toggleAttribute("inert",!this.interactionEnabled_),this.interactionEnabled_?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden","true"))}async release(){await this.controller.release()}async releaseLabels(e){return this.controller.releaseLabels(e)}startRealtime(){!this.access?.configured||this.realtime||(this.realtime=new Ee({url:this.api.subscribeUrl(this.opts.event),mintTicket:()=>this.api.subscribeTicket(this.opts.event),onAccessUnavailable:e=>this.opts.onAccessUnavailable?.(e),sink:wt(this.controller,{flashOnLiveChange:!0,ownLabels:()=>this.holdingLabels,onStatusChange:()=>{this.immersive.pushLiveState(),this.opts.onStatusChange?.()},onSelectedObjectUnavailable:(e,t)=>this.opts.onSelectedObjectUnavailable?.({labels:e,reason:t})})}),this.realtime.start())}async refreshAvailability(){let e=await this.controller.refreshAvailability();return this.immersive.pushLiveState(),this.opts.onStatusChange?.(),e.lost.length&&this.opts.onSelectedObjectUnavailable?.({labels:e.lost,reason:"taken"}),this.notifyMapStateChange(),e}async refreshAccess(){if(!this.access?.configured)return!1;let e=await this.access.refresh("manual");return e&&(this.accessState_={configured:!0,status:"ready"},await this.controller.refresh(),this.realtime?.restart(),this.realtime||this.startRealtime()),this.notifyMapStateChange(),e}showLoadFailure(e){let t=document.createElement("div");t.setAttribute("role","status"),t.style.cssText='display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;width:100%;height:100%;min-height:180px;box-sizing:border-box;padding:24px;text-align:center;font:500 14px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#3b4256;';let n=document.createElement("div");n.textContent="The seat map didn\u2019t load.",t.appendChild(n);let o=document.createElement("button");o.type="button",o.textContent="Try again",o.style.cssText="appearance:none;border:1px solid #c9cede;background:#fff;color:#10162a;border-radius:8px;padding:8px 16px;font:600 13px/1 inherit;cursor:pointer;",o.addEventListener("click",()=>{this.destroy(),this.render().catch(s=>this.opts.onError?.(s))}),t.appendChild(o),e.appendChild(t)}destroy(){this.blockedRegions?.detach(),this.hostSurface.dispose(),this.immersive.destroy(),this.buyerAssetUrls.dispose(),this.realtime?.stop(),this.realtime=null,this.access?.clear(),this.hostEl&&this.onTipMove&&this.hostEl.removeEventListener("mousemove",this.onTipMove),this.tipEl=null,this.onTipMove=null,this.languageSelect=null,this.controller.destroy(),this.hostEl&&this.hostEl.parentNode&&this.hostEl.parentNode.removeChild(this.hostEl),this.hostEl=null,this.mount=null,this.rendered=!1,this.mode_=null,this.eventInfo=null,this.focusedSection_=null}};var Wn=["hold","resumeHold","getCurrentHold","getGAAreas","holdGA","bestAvailable","release","releaseLabels","getSelection","selectObjects","deselectObjects","clearSelection","selectCategories","deselectCategories","setSelectableObjects","setMaxSelection","getSelectionValidity","setSeatTier","getFloors","setFloor","setColorblindSafe","zoomIn","zoomOut","zoomToFit","refreshAccess"],cd={hold:()=>Promise.resolve(null),resumeHold:()=>Promise.resolve(null),getCurrentHold:()=>null,getGAAreas:()=>[],holdGA:()=>Promise.resolve(null),bestAvailable:()=>Promise.resolve(null),release:()=>Promise.resolve(),releaseLabels:()=>Promise.resolve(!1),getSelection:()=>[],selectObjects:()=>[],deselectObjects:()=>{},clearSelection:()=>{},selectCategories:()=>[],deselectCategories:()=>{},setSelectableObjects:()=>{},setMaxSelection:()=>{},getSelectionValidity:()=>null,setSeatTier:()=>{},getFloors:()=>[],setFloor:()=>{},setColorblindSafe:()=>{},zoomIn:()=>{},zoomOut:()=>{},zoomToFit:()=>{},refreshAccess:()=>Promise.resolve(!1)};function sr(i){let e={};for(let t of Wn)e[t]=(...n)=>{let o=i();return o?o[t](...n):cd[t]()};return e}var Yn=["event","apiBase","maxSelection","numberOfPlacesToSelect","selectionValidators","publicKey","locale","currency","colorblindSafe","initialView","errorDisplay"],Xn=[...Yn,"selectedObjects","selectableObjects","messages","seatTooltip","buyerAccessTokenProvider","buyerAccessToken"],Zn=["onSelectionChange","onSelectionValidityChange","onSelectionValid","onSelectionInvalid","onSelectionLimit","onHold","onHoldRestored","onHoldExpired","onGAClick","onGAPrompt","onError","onDeckTap","onHint","onSeatHover","onAccessExpired","onAccessUnavailable","onSelectedObjectUnavailable"];function rr(i,e,t){let n={container:i};for(let o of Xn)n[o]=e[o];for(let o of Zn)n[o]=t[o];return n}var dd=new Set(["seatlayer.designer.ready","seatlayer.designer.saved","seatlayer.designer.published","seatlayer.designer.close","seatlayer.designer.error"]),pd=2e4,hd=480,ud=180*1e3,md=900*1e3,fd=.8,gd=30*1e3,bd=1e5,yd=4,vd=50;function Qn(i){if(typeof i!="string")return i;let e=document.querySelector(i);if(!e)throw new Error(`EmbeddedDesigner container not found: ${i}`);return e}function wd(i){let e=(i??"").toLowerCase();return e.includes("expire")||e.includes("revoke")||e==="401"?"expired":e.includes("mismatch")?"mismatch":e.includes("timeout")?"timeout":"load"}var xd={expired:{title:"This design session expired",body:"For your security, editing sessions are short-lived. Start a fresh one to keep designing."},mismatch:{title:"This editor doesn't match this chart",body:"The session that loaded belongs to a different chart or workspace. Reopen the designer to continue."},timeout:{title:"The designer is taking too long",body:"It did not finish loading in time. This is usually a slow connection \u2014 try again."},load:{title:"We couldn't load the designer",body:"Something went wrong while opening the editor. Please try again."}},on=class{constructor(e){this.frame=null;this.designerOrigin="";this.overlay=null;this.timeoutTimer=null;this.renewTimer=null;this.autoRecoverUsed=!1;this.phase="loading";this.identityEstablished=!1;this.restoreContainerPosition=null;this.pinned=!1;this.frameStyleBeforeFs=null;this.docOverflowBeforeFs=null;this.bodyOverflowBeforeFs=null;this.fsKeyHandler=null;this.lastAutoHeight="";this.fillRaf=null;this.reprobeRaf=null;this.fillListening=!1;this.containerEl=null;this.fillMode=null;this.resizeObs=null;this.scheduleFill=()=>{this.fillRaf===null&&(this.fillRaf=requestAnimationFrame(()=>{this.fillRaf=null,this.applyFill()}))};this.scheduleReprobe=()=>{this.reprobeRaf===null&&(this.reprobeRaf=requestAnimationFrame(()=>{this.reprobeRaf=null,!this.pinned&&(this.fillMode=this.detectFillMode(),this.syncContainerObserver(),this.applyFill())}))};this.handleMessage=e=>{if(!this.frame||e.origin!==this.designerOrigin||e.source!==this.frame.contentWindow||!e.data||typeof e.data!="object")return;let t=e.data;if(t.type==="seatlayer.designer.handshake"&&typeof t.nonce=="string"&&t.nonce.length<=128){this.frame.contentWindow?.postMessage({type:"seatlayer.designer.parent",nonce:t.nonce},this.designerOrigin);return}if(t.type==="seatlayer.designer.resize"){!this.fillEnabled()&&this.autoResizeEnabled()&&typeof t.px=="number"&&Number.isFinite(t.px)&&t.px>0&&(this.lastAutoHeight=`${Math.round(t.px)}px`,this.pinned||this.setFrameHeight(this.lastAutoHeight));return}if(t.type==="seatlayer.designer.fullscreen"){t.on===!0?this.pinFullscreen():t.on===!1&&this.unpinFullscreen();return}if(typeof t.type!="string"||!dd.has(t.type))return;let n={type:t.type,chartId:typeof t.chartId=="string"?t.chartId:void 0,workspaceId:typeof t.workspaceId=="string"?t.workspaceId:void 0,expiresAt:typeof t.expiresAt=="number"?t.expiresAt:void 0,code:typeof t.code=="string"?t.code:void 0,message:typeof t.message=="string"?t.message:void 0,meta:t.meta,fatal:typeof t.fatal=="boolean"?t.fatal:void 0,action:typeof t.action=="string"?t.action:void 0},o=this.identityEstablished||n.type==="seatlayer.designer.ready"||n.type==="seatlayer.designer.saved"||n.type==="seatlayer.designer.published"||n.type==="seatlayer.designer.close",s=this.options.expectedChartId!==void 0&&n.chartId!==this.options.expectedChartId&&(o||n.chartId!==void 0),r=this.options.expectedWorkspaceId!==void 0&&n.workspaceId!==this.options.expectedWorkspaceId&&(o||n.workspaceId!==void 0);if(s||r){this.showError("mismatch");return}switch(n.type){case"seatlayer.designer.ready":this.identityEstablished=!0,this.sessionExpiresAt=n.expiresAt,this.phase="ready",this.clearTimeoutTimer(),this.removeOverlay(),this.autoRecoverUsed=!1,this.scheduleRenewal(n.expiresAt),this.options.onReady?.(n);break;case"seatlayer.designer.saved":this.options.onSaved?.(n);break;case"seatlayer.designer.published":this.options.onPublished?.(n);break;case"seatlayer.designer.close":this.options.onClose?.(n);break;case"seatlayer.designer.error":{let a=wd(n.code);if(a==="expired"&&this.autoRenewEnabled()&&!this.autoRecoverUsed){this.autoRecoverUsed=!0,this.clearRenewTimer(),this.options.onRequestRelaunch();return}(typeof n.fatal=="boolean"?n.fatal:a!=="load"||this.phase!=="ready")&&this.showError(a),this.options.onError?.(n);break}}};this.options=e}mount(){this.destroy();let e=new URL(this.options.designerUrl,window.location.href);if(e.protocol!=="https:"&&e.hostname!=="localhost"&&e.hostname!=="127.0.0.1")throw new Error("EmbeddedDesigner requires an HTTPS designerUrl outside local development.");this.designerOrigin=e.origin;let t=document.createElement("iframe");t.title=this.options.title??"Venue chart Designer",t.allow=this.options.allow??"fullscreen; clipboard-write",t.referrerPolicy=this.options.referrerPolicy??"origin",t.src=e.toString(),t.style.setProperty("width","100%","important"),t.style.setProperty("height",typeof this.options.height=="number"?`${this.options.height}px`:"100%","important"),t.style.border="0",Object.assign(t.style,this.options.style),this.options.className&&(t.className=this.options.className);let n=Qn(this.options.container);if(this.containerEl=n,window.addEventListener("message",this.handleMessage),n.append(t),this.frame=t,this.fillEnabled()&&this.startFill(),this.phase="loading",this.loadingStateEnabled()){this.ensureContainerPositioned(n),this.renderOverlay(n,"loading");let o=this.options.loadingTimeoutMs??pd;o>0&&Number.isFinite(o)&&(this.timeoutTimer=setTimeout(()=>{this.phase==="loading"&&this.showError("timeout")},o))}return t}setDesignerUrl(e){return this.options={...this.options,designerUrl:e},this.mount()}getIframe(){return this.frame}setSizing(e,t){this.options={...this.options,height:e,minHeight:t},this.frame&&(this.stopFill(),this.lastAutoHeight="",this.fillEnabled()?(this.pinned||this.setFrameHeight("100%"),this.startFill()):this.pinned||this.setFrameHeight(`${e}px`))}setRelaunchPolicy(e,t){this.options={...this.options,onRequestRelaunch:e,autoRenewSession:t},this.clearRenewTimer(),this.phase==="ready"&&this.scheduleRenewal(this.sessionExpiresAt)}destroy(){window.removeEventListener("message",this.handleMessage),this.stopFill(),this.unpinFullscreen(),this.clearTimeoutTimer(),this.clearRenewTimer(),this.removeOverlay(),this.restoreContainerStyle(),this.frame?.remove(),this.frame=null,this.containerEl=null,this.fillMode=null,this.designerOrigin="",this.phase="loading",this.identityEstablished=!1,this.sessionExpiresAt=void 0,this.lastAutoHeight=""}loadingStateEnabled(){return this.options.showLoadingState!==!1}autoResizeEnabled(){return this.options.autoResize!==!1}fillEnabled(){return typeof this.options.height!="number"}setFrameHeight(e){this.frame?.style.setProperty("height",e,"important")}detectFillMode(){let e=this.containerEl,t=this.frame;if(this.pinned||!e||!t)return this.fillMode??"viewport";let n=()=>e.getBoundingClientRect().height,o=t.style.getPropertyValue("height"),s=t.style.getPropertyPriority("height");t.style.setProperty("height","0px","important");let r=n();t.style.setProperty("height",`${bd}px`,"important");let a=n();return o?t.style.setProperty("height",o,s):t.style.removeProperty("height"),!(a-r>yd)&&r>=vd?"container":"viewport"}applyFill(){if(!this.frame||this.pinned)return;let e=this.options.minHeight??hd;if(this.fillMode==="container"&&this.containerEl){let o=Math.max(e,Math.round(this.containerEl.getBoundingClientRect().height));this.setFrameHeight(`${o}px`);return}let t=this.frame.getBoundingClientRect().top,n=Math.max(e,Math.round(window.innerHeight-t));this.setFrameHeight(`${n}px`)}syncContainerObserver(){let e=this.fillMode==="container"&&!!this.containerEl&&typeof ResizeObserver<"u";e&&!this.resizeObs?(this.resizeObs=new ResizeObserver(()=>this.scheduleFill()),this.resizeObs.observe(this.containerEl)):!e&&this.resizeObs&&(this.resizeObs.disconnect(),this.resizeObs=null)}startFill(){this.fillMode=this.detectFillMode(),this.syncContainerObserver(),this.applyFill(),!this.fillListening&&(this.fillListening=!0,window.addEventListener("resize",this.scheduleReprobe),window.addEventListener("orientationchange",this.scheduleReprobe),window.addEventListener("scroll",this.scheduleFill,{passive:!0}))}stopFill(){this.fillRaf!==null&&(cancelAnimationFrame(this.fillRaf),this.fillRaf=null),this.reprobeRaf!==null&&(cancelAnimationFrame(this.reprobeRaf),this.reprobeRaf=null),this.resizeObs&&(this.resizeObs.disconnect(),this.resizeObs=null),this.fillListening&&(this.fillListening=!1,window.removeEventListener("resize",this.scheduleReprobe),window.removeEventListener("orientationchange",this.scheduleReprobe),window.removeEventListener("scroll",this.scheduleFill))}pinFullscreen(){if(this.pinned||!this.frame)return;this.pinned=!0,this.frameStyleBeforeFs=this.frame.getAttribute("style");let e={position:"fixed",top:"0",right:"0",bottom:"0",left:"0",width:"100vw",height:"100vh",margin:"0",border:"0","z-index":"2147483000",background:"#101625"};for(let[n,o]of Object.entries(e))this.frame.style.setProperty(n,o,"important");let t=document.documentElement;this.docOverflowBeforeFs=t.style.overflow,t.style.overflow="hidden",document.body&&(this.bodyOverflowBeforeFs=document.body.style.overflow,document.body.style.overflow="hidden"),this.fsKeyHandler=n=>{n.key==="Escape"&&this.unpinFullscreen()},window.addEventListener("keydown",this.fsKeyHandler)}unpinFullscreen(){this.pinned&&(this.pinned=!1,this.frame&&(this.frameStyleBeforeFs===null?this.frame.removeAttribute("style"):this.frame.setAttribute("style",this.frameStyleBeforeFs),this.fillEnabled()?this.applyFill():this.autoResizeEnabled()&&this.lastAutoHeight?this.setFrameHeight(this.lastAutoHeight):typeof this.options.height=="number"&&this.setFrameHeight(`${this.options.height}px`)),this.frameStyleBeforeFs=null,this.docOverflowBeforeFs!==null&&(document.documentElement.style.overflow=this.docOverflowBeforeFs,this.docOverflowBeforeFs=null),this.bodyOverflowBeforeFs!==null&&document.body&&(document.body.style.overflow=this.bodyOverflowBeforeFs,this.bodyOverflowBeforeFs=null),this.fsKeyHandler&&(window.removeEventListener("keydown",this.fsKeyHandler),this.fsKeyHandler=null))}clearTimeoutTimer(){this.timeoutTimer!==null&&(clearTimeout(this.timeoutTimer),this.timeoutTimer=null)}autoRenewEnabled(){return!!this.options.onRequestRelaunch&&this.options.autoRenewSession!==!1}clearRenewTimer(){this.renewTimer!==null&&(clearTimeout(this.renewTimer),this.renewTimer=null)}scheduleRenewal(e){if(this.clearRenewTimer(),!this.autoRenewEnabled()||typeof e!="number"||!Number.isFinite(e))return;let t=e-Date.now();if(t<=0)return;let n=t<md?t*fd:t-ud,o=Math.max(gd,n);this.renewTimer=setTimeout(()=>{this.renewTimer=null,this.autoRenewEnabled()&&this.options.onRequestRelaunch()},o)}ensureContainerPositioned(e){getComputedStyle(e).position==="static"&&(this.restoreContainerPosition=e.style.position,e.style.position="relative")}restoreContainerStyle(){if(this.restoreContainerPosition!==null){try{Qn(this.options.container).style.position=this.restoreContainerPosition}catch{}this.restoreContainerPosition=null}}removeOverlay(){this.overlay?.remove(),this.overlay=null}showError(e){if(this.phase="error",this.clearTimeoutTimer(),!this.loadingStateEnabled())return;let t;try{t=Qn(this.options.container)}catch{return}this.renderOverlay(t,"error",e)}handleTryAgain(){if(this.options.onRequestRelaunch){this.options.onRequestRelaunch();return}this.mount()}renderOverlay(e,t,n){this.removeOverlay();let o=document.createElement("div");o.setAttribute("data-seatlayer-designer-overlay",t),o.setAttribute("role",t==="error"?"alert":"status"),o.setAttribute("aria-live","polite"),Object.assign(o.style,{position:"absolute",inset:"0",display:"flex",alignItems:"center",justifyContent:"center",background:"#101625",color:"#e6ebf5",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif',zIndex:"2",overflow:"hidden"}),t==="loading"?this.buildSkeleton(o):this.buildErrorCard(o,n??"load"),e.append(o),this.overlay=o}buildSkeleton(e){let t=document.createElement("style");t.textContent=`
3235
+ `;function Ot(){if(document.getElementById(Gs))return;let i=document.createElement("style");i.id=Gs,i.textContent=Gc+$s+zs+Bs+js+Vs+Fs+Ss,document.head.appendChild(i)}async function Gi(i,e){let t=i.overlay.productionElements;if(!t?.some(o=>o.contentImageUrl))return i;let n=await Promise.all(t.map(async o=>{if(!o.contentImageUrl)return o;try{let s=await e(o.contentImageUrl);if(!s){let{contentImageUrl:r,...a}=o;return a}return{...o,runtimeContentImageUrl:s}}catch{let{contentImageUrl:s,...r}=o;return r}}));return{...i,overlay:{...i.overlay,productionElements:n}}}async function Ui(i,e){if(i)try{let t=await e(i);return t?await(await fetch(t)).arrayBuffer():void 0}catch{return}}var Ge=require("@seatlayer/core/view/panoramaDelivery");function qi(i){let{root:e,source:t,caption:n,real:o,closeLabel:s,dragHint:r,viewFromSeatLabel:a,real360Label:l,previewLabel:c,resolveAsset:d,onClose:p}=i,u=i.chrome??{},h=document.createElement("div");h.className="sl-view sl-mo-zoom",h.setAttribute("role","dialog"),h.setAttribute("aria-label",a),h.innerHTML='<div class="sl-view-head"><span class="sl-view-title"></span><span class="sl-view-cap"></span><button type="button" class="sl-view-x"><svg viewBox="0 0 24 24"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg></button></div><div class="sl-view-pano"><span class="sl-view-badge"></span><span class="sl-view-hint"></span></div>';let y=M=>h.querySelector(M)?.remove();u.title===!1?y(".sl-view-title"):h.querySelector(".sl-view-title").textContent=a,u.caption===!1?y(".sl-view-cap"):h.querySelector(".sl-view-cap").textContent=n,h.querySelector(".sl-view-x").setAttribute("aria-label",s),u.badge===!1?y(".sl-view-badge"):h.querySelector(".sl-view-badge").textContent=o?l:c,h.querySelector(".sl-view-hint").textContent=r,e.appendChild(h);let f=h.querySelector(".sl-view-pano"),T=(0,Ge.planPanoramaDelivery)(t,(0,Ge.browserPanoramaConstraints)()),w=new AbortController;f.style.backgroundImage=`url(${JSON.stringify(T.initialUrl)})`;let v=()=>{};T.upgradeUrl&&(v=(0,Ge.schedulePanoramaUpgrade)(()=>{d(T.upgradeUrl).then(M=>!M||w.signal.aborted?null:(0,Ge.loadPanoramaImage)(M,w.signal).then(()=>M)).then(M=>{!M||!h.isConnected||w.signal.aborted||(f.style.backgroundImage=`url(${JSON.stringify(M)})`)}).catch(()=>{})}));let A=70,D=35,K=1,g=f.clientHeight||1,L=f.clientWidth||1,N=-(g*(180/A)*2/2-L/2),R=0,O=()=>{let M=f.clientHeight||1,yt=M*(180/A)*K,Qe=Math.max(0,yt-M),Xt=Math.min(Qe/2,D/180*yt);R=Math.min(Xt,Math.max(-Xt,R)),f.style.backgroundSize=`auto ${yt}px`,f.style.backgroundPosition=`${N}px ${R-Qe/2}px`};O();let C=!1,_=0,U=0,G=M=>{C=!0,_=M.clientX,U=M.clientY,f.classList.add("drag"),f.setPointerCapture?.(M.pointerId)},de=M=>{C&&(N+=M.clientX-_,R+=M.clientY-U,_=M.clientX,U=M.clientY,O())},ge=M=>{C=!1,f.classList.remove("drag"),f.releasePointerCapture?.(M.pointerId)},X=M=>{M.preventDefault(),K=Math.min(2.4,Math.max(1,K+(M.deltaY<0?.12:-.12))),O()};f.addEventListener("pointerdown",G),f.addEventListener("pointermove",de),f.addEventListener("pointerup",ge),f.addEventListener("pointercancel",ge),f.addEventListener("wheel",X,{passive:!1});let V=h.querySelector(".sl-view-x");V.addEventListener("click",p);let Z=M=>{M.key==="Escape"&&(M.stopPropagation(),p())};return h.addEventListener("keydown",Z),V.focus(),{element:h,dispose(){v(),w.abort(),f.removeEventListener("pointerdown",G),f.removeEventListener("pointermove",de),f.removeEventListener("pointerup",ge),f.removeEventListener("pointercancel",ge),f.removeEventListener("wheel",X),h.removeEventListener("keydown",Z),V.removeEventListener("click",p)}}}function Uc(i,e){if(!e)return{targetSeatId:null,previousSeatId:null,nextSeatId:null};let t=i.find(s=>s.id===e);if(!t?.rowId)return{targetSeatId:e,previousSeatId:null,nextSeatId:null};let n=i.filter(s=>s.rowId===t.rowId),o=n.findIndex(s=>s.id===e);return{targetSeatId:e,previousSeatId:o>0?n[o-1].id:null,nextSeatId:o>=0&&o+1<n.length?n[o+1].id:null}}var Us=6e4,Ki=class{constructor(e){this.buyerView_="map";this.targetSeatId_=null;this.focusedSectionId_=null;this.navigationMode_="orbit";this.overlay=null;this.handle=null;this.generation=0;this.seatViewGeneration=0;this.seatViewElement=null;this.seatViewDispose=null;this.options=e}get buyerView(){return this.buyerView_}get targetSeatId(){return this.targetSeatId_}get focusedSectionId(){return this.focusedSectionId_}get seatPosition(){return Uc(this.options.seats(),this.targetSeatId_)}get navigationMode(){return this.navigationMode_}canOffer3D(){return this.options.enable3D?this.handle&&this.overlay?!0:!this.options.doc()||!Ei()?!1:this.options.seats().length<=this.max3DSeats():!1}canOfferSeatView(){return this.options.enableSeatView?this.options.seats().some(e=>!!e.viewUrl)?!0:this.hasStage():!1}async setBuyerView(e,t={}){if(e==="map"){this.exit3D();return}if(!this.canOffer3D())throw new Error("venue_3d_unavailable");if(this.buyerView_==="venue3d"&&this.handle){t.flyToSeatId?(this.targetSeatId_=t.flyToSeatId,this.focusedSectionId_=this.findSeat(t.flyToSeatId)?.sectionId??null,this.options.onViewChange(this.buyerView_,this.targetSeatId_),await this.handle.flyToSeat(t.flyToSeatId)):t.resetView&&this.handle.focusOverview();return}if(this.handle&&this.overlay){await this.restore3D(t);return}await this.enter3D(t.flyToSeatId)}async openSeatView(e){if(!this.canOfferSeatView())throw new Error("seat_view_unavailable");let t=this.findSeat(e),n=this.options.host(),o=this.options.doc();if(!t||!n||!o)throw new Error("seat_view_unavailable");let s=++this.seatViewGeneration,r,a,l=!1;if(t.viewUrl){let y=t.viewMeta?.previewUrl,f=!!y&&y!==t.viewUrl,T=f?await this.options.resolveAsset(y):null,w=f?t.viewUrl:await this.options.resolveAsset(t.viewUrl);if(s!==this.seatViewGeneration||!w||f&&!T)return;r={url:w,...T?{previewUrl:T}:{},...f?{resolveUrl:this.options.resolveAsset}:{},...t.viewMeta?.sourceWidth!==void 0?{sourceWidth:t.viewMeta.sourceWidth}:{},...t.viewMeta?.sourceHeight!==void 0?{sourceHeight:t.viewMeta.sourceHeight}:{},...t.viewMeta?.previewWidth!==void 0?{previewWidth:t.viewMeta.previewWidth}:{},...t.viewMeta?.previewHeight!==void 0?{previewHeight:t.viewMeta.previewHeight}:{},...t.viewMeta?.variants?.length?{variants:t.viewMeta.variants}:{},...t.viewMeta?.coverage?{coverage:t.viewMeta.coverage}:{},...t.viewMeta?.capturedAt?{capturedAt:t.viewMeta.capturedAt}:{},...t.viewMeta?.sourceLabel?{sourceLabel:t.viewMeta.sourceLabel}:{}},a=(0,Wi.seatViewDisclosure)(r),l=(0,Wi.isAuthoredSeatView)(r)}else{if(!this.hasStage())throw new Error("seat_view_unavailable");let{generateSeatPanorama:y}=await Ai();if(s!==this.seatViewGeneration)return;let f=o.floors?.find(v=>v.objects.some(A=>A.type==="row"&&A.id===t.rowId)),T=t.focalPoint??f?.focalPoint??o.focalPoint,w=y(t,T,[...this.options.seats()]);r={url:w.url,generated:!0},a=(0,st.t)("picker.illustrationCaption",{m:w.distanceM})}if(s!==this.seatViewGeneration)return;this.closeSeatView(!1),this.prepareHostTheme(n,o),Ot();let c=this.options.chrome??{},d=et(),p=(0,st.t)("picker.viewFromSeat",{label:t.displayLabel||t.label}),u=l?(0,st.t)("picker.real360"):(0,st.t)("picker.preview"),h=qi({root:n,source:r,caption:a,real:l,closeLabel:b("picker.close","Close"),dragHint:d,viewFromSeatLabel:p,real360Label:(0,st.t)("picker.real360"),previewLabel:(0,st.t)("picker.preview"),chrome:{title:c.seatViewTitle,caption:c.seatViewCaption,badge:c.seatViewBadge},resolveAsset:this.options.resolveAsset,onClose:()=>this.closeSeatView(!0,!0)});this.seatViewElement=h.element,this.seatViewDispose=h.dispose,this.options.onSeatViewChange?.({seatId:t.id,title:p,caption:a,badge:u,real:l,generated:!!r.generated,dragHint:d})}pushLiveState(){this.handle&&(this.handle.setAvailability(this.options.seats().map(e=>({seatId:e.id,state:this.seatState(e)}))),this.handle.setSelection(this.options.selection().map(e=>e.id)))}focusOverview(){return this.buyerView_!=="venue3d"||!this.handle?!1:(this.handle.focusOverview(),!0)}focusSection(e){return this.buyerView_==="venue3d"?this.handle?.focusSection(e)??!1:!1}focusFloor(e){let t=this.options.doc();if(this.buyerView_!=="venue3d"||!this.handle||!t?.floors?.length)return!1;let n=t.floors.findIndex(o=>o.id===e);return n>=0&&this.handle.focusFloor(n)}zoomIn(){return this.buyerView_!=="venue3d"||!this.handle?!1:(this.handle.zoomIn(),!0)}zoomOut(){return this.buyerView_!=="venue3d"||!this.handle?!1:(this.handle.zoomOut(),!0)}setNavigationMode(e){return this.navigationMode_=e,this.buyerView_!=="venue3d"||!this.handle?!1:(this.handle.setNavigationMode(e),this.options.onViewChange(this.buyerView_,this.targetSeatId_),!0)}destroy(){this.generation+=1,this.closeSeatView(!0,!1);try{this.handle?.dispose()}catch{}this.handle=null,this.overlay?.remove(),this.overlay=null,this.buyerView_="map",this.targetSeatId_=null,this.focusedSectionId_=null}max3DSeats(){let e=this.options.max3DSeats;if(typeof e=="number"&&e>0)return e;let t=globalThis.navigator;return(t?.hardwareConcurrency??8)<=4||(t?.deviceMemory??8)<=4||(globalThis.matchMedia?.("(pointer: coarse)").matches??!1)?Us/2:Us}async enter3D(e){let t=this.options.host(),n=this.options.doc();if(!t||!n||this.overlay)throw new Error("venue_3d_unavailable");Ot(),this.prepareHostTheme(t,n);let o=document.createElement("div");o.className="sl-view3d",o.setAttribute("role","group"),o.setAttribute("aria-label",b("picker.interactive3dVenueView","Interactive 3D venue view")),Object.assign(o.style,{position:"absolute",inset:"0",zIndex:"4",opacity:"0",touchAction:"none",transition:this.reducedMotion()?"none":"opacity 260ms cubic-bezier(.2,.8,.2,1)",background:"radial-gradient(120% 120% at 50% 0%,#191f28 0%,#0d1014 70%)"});let s=document.createElement("div");s.className="sl-view3d-loading",s.setAttribute("role","status"),s.setAttribute("aria-live","polite"),s.textContent=b("picker.loading3d","Building the 3D venue\u2026"),o.appendChild(s),t.appendChild(o),this.overlay=o;let r=++this.generation;if(this.reducedMotion()?o.style.opacity="1":requestAnimationFrame(()=>{o.style.opacity="1"}),await this.nextPaint(),!(r!==this.generation||this.overlay!==o))try{let[a,l]=await Promise.all([Qt(),this.options.loadEventConfiguration()]),c=l?await Gi(l,this.options.resolveAsset):null,d=await Ui(n.theme?.venue3d?.shellAssetUrl,this.options.resolveAsset);if(r!==this.generation||this.overlay!==o)return;let p={doc:n,seats:[...this.options.seats()],...c?{eventConfigurationId:c.id,eventConfiguration:c}:{},...d?{registeredShellGlb:d}:{}};s.textContent=b("picker.building3d","Building venue geometry\u2026");let u=await a.prepareVenue3D(p);if(r!==this.generation||this.overlay!==o)return;let h=this.options.chrome??{},y=a.mountVenue3D(o,{...p,prepared:u},{portraitOverviewCrop:!0,arriveAtSeatEye:!0,lookAroundHint:et(),navLabels:Ti(),...h.view3dCaption===!1||h.view3dSeatStepper===!1||h.view3dControlDock===!1?{chrome:{caption:h.view3dCaption!==!1,seatStepper:h.view3dSeatStepper!==!1,controlDock:h.view3dControlDock!==!1}}:{},seatViewActionLabel:f=>this.findSeat(f)?.viewUrl?b("picker.openAuthored360","Open venue 360\xB0"):b("picker.lookAroundLive3d","Look around in live 3D"),onSeatPick:f=>this.toggleSeat(f),onSeatInspect:f=>this.toggleSeat(f),onViewTargetChange:f=>{this.targetSeatId_=f,f&&(this.focusedSectionId_=this.findSeat(f)?.sectionId??null),this.options.onViewChange("venue3d",f)},onSectionFocusChange:f=>{this.focusedSectionId_=f,this.options.onViewChange("venue3d",this.targetSeatId_)},...this.options.enableSeatView?{getSeatView:f=>this.seatViewFor3D(f)}:{}});if(r!==this.generation||this.overlay!==o){y.dispose();return}this.handle=y,this.buyerView_="venue3d",this.targetSeatId_=e??null,this.focusedSectionId_=e?this.findSeat(e)?.sectionId??null:null,y.setNavigationMode(this.navigationMode_),requestAnimationFrame(()=>s.remove()),this.pushLiveState(),this.options.onViewChange("venue3d",this.targetSeatId_),e&&await y.flyToSeat(e)}catch(a){if(r!==this.generation)return;throw this.options.onError?.(a),this.remove3DOverlay(!1),a}}exit3D(){this.buyerView_==="map"&&!this.overlay||(this.generation+=1,this.buyerView_="map",this.targetSeatId_=null,this.focusedSectionId_=null,this.remove3DOverlay(!0,!!this.handle),this.options.onViewChange("map",null))}remove3DOverlay(e,t=!1){let n=this.handle,o=this.overlay;if(this.options.restoreMap(),t&&n&&o){o.style.pointerEvents="none";let s=()=>{this.buyerView_!=="map"||this.overlay!==o||(o.style.visibility="hidden",this.options.restoreMap())};!e||this.reducedMotion()?(o.style.opacity="0",s()):(requestAnimationFrame(()=>{o.style.opacity="0"}),setTimeout(s,280));return}if(this.handle=null,this.overlay=null,!o){try{n?.dispose()}catch{}this.options.restoreMap();return}if(!e||this.reducedMotion()){try{n?.dispose()}catch{}o.remove(),this.options.restoreMap();return}o.style.pointerEvents="none",requestAnimationFrame(()=>{o.style.opacity="0"}),setTimeout(()=>{try{n?.dispose()}catch{}o.remove(),this.options.restoreMap()},280)}async restore3D(e){let t=this.overlay,n=this.handle;if(!t||!n)throw new Error("venue_3d_unavailable");this.buyerView_="venue3d",this.targetSeatId_=e.flyToSeatId??null,this.focusedSectionId_=e.flyToSeatId?this.findSeat(e.flyToSeatId)?.sectionId??null:null,t.style.visibility="visible",t.style.pointerEvents="auto",this.reducedMotion()?t.style.opacity="1":requestAnimationFrame(()=>{t.style.opacity="1"}),n.resize(),n.setNavigationMode(this.navigationMode_),this.pushLiveState(),this.options.onViewChange("venue3d",this.targetSeatId_),e.flyToSeatId?await n.flyToSeat(e.flyToSeatId):e.resetView&&n.focusOverview()}nextPaint(){return this.reducedMotion()||typeof requestAnimationFrame!="function"?Promise.resolve():new Promise(e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))})}toggleSeat(e){if(!this.findSeat(e))return;this.options.selection().some(o=>o.id===e)?this.options.deselect(e):this.options.status(e)==="free"&&this.options.select(e),this.pushLiveState()}seatState(e){switch(this.options.status(e.id)){case"held":return"held";case"booked":return"sold";case"not_for_sale":return"dimmed";default:return"available"}}async seatViewFor3D(e){let t=this.findSeat(e);if(!t)throw new Error("seat_view_unavailable");if(t.viewUrl){let n=t.viewMeta?.previewUrl,o=!!n&&n!==t.viewUrl,s=o?await this.options.resolveAsset(n):null,r=o?t.viewUrl:await this.options.resolveAsset(t.viewUrl);if(!r||o&&!s)throw new Error("seat_view_unavailable");return{url:r,...s?{previewUrl:s}:{},...o?{resolveUrl:this.options.resolveAsset}:{},...t.viewMeta?.variants?.length?{variants:t.viewMeta.variants}:{},...t.viewMeta?.initialBearingDeg!==void 0?{initialBearingDeg:t.viewMeta.initialBearingDeg}:{},...t.viewMeta?.initialPitchDeg!==void 0?{initialPitchDeg:t.viewMeta.initialPitchDeg}:{},...t.viewMeta?.coverage?{coverage:t.viewMeta.coverage}:{},...t.viewMeta?.capturedAt?{capturedAt:t.viewMeta.capturedAt}:{},...t.viewMeta?.sourceLabel?{sourceLabel:t.viewMeta.sourceLabel}:{}}}return{url:"",generated:!0,mediaKind:"model",coverage:"exact-seat",sourceLabel:b("picker.chartDerivedModel","Chart-derived model")}}closeSeatView(e=!0,t=!1){e&&(this.seatViewGeneration+=1);let n=this.seatViewElement;if(this.seatViewDispose?.(),this.seatViewDispose=null,this.seatViewElement=null,!!n){if(this.options.onSeatViewChange?.(null),!t||this.reducedMotion()){n.remove();return}n.classList.add("is-leaving"),setTimeout(()=>n.remove(),190)}}findSeat(e){return this.options.seats().find(t=>t.id===e||t.label===e)}hasStage(){let e=this.options.doc();return e?(e.floors?.flatMap(n=>n.objects)??e.objects).some(n=>n.type==="shape"&&(n.role==="stage"||!!n.stageKind)):!1}prepareHostTheme(e,t){getComputedStyle(e).position==="static"&&(e.style.position="relative");let n=t.theme;e.style.setProperty("--sl-bg",n?.background??"#f6f7fb"),e.style.setProperty("--sl-surface","#ffffff"),e.style.setProperty("--sl-text",n?.textColor??"#10162a"),e.style.setProperty("--sl-muted","#697386"),e.style.setProperty("--sl-line","#d9deea"),e.style.setProperty("--sl-accent",n?.accent??"#ef4056"),e.style.setProperty("--sl-accent-ink",n?.accentInk??"#ffffff")}reducedMotion(){return globalThis.matchMedia?.("(prefers-reduced-motion: reduce)").matches??!1}};var qc={host:"web",platform:"web",bundle:"",protocol:0,chromeOwner:"web"},Kc={...qc},Yi=null,qs=null;function Wc(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():0}function Yc(){let i=e=>Math.max(0,Math.round(e*100)/100);return{bootMs:i(Wc()),documentMs:Yi==null?0:i(Yi),handshakeMs:Yi==null||qs==null?0:i(qs-Yi)}}function Ks(){let{host:i,platform:e,bundle:t,protocol:n,chromeOwner:o}=Kc,s=Yc();return{host:i,platform:e,...t?{bundle:t}:{},...n?{protocol:n}:{},chromeOwner:o,bootMs:s.bootMs,documentMs:s.documentMs,handshakeMs:s.handshakeMs}}var Ws=new Set;function Oe(i){return Ws.has(i)?"repeat":"cold"}function Xi(i){let e=Oe(i);return Ws.add(i),e}function be(i){return typeof i=="number"&&Number.isFinite(i)&&i>=0?Math.round(i):0}function Xc(){return typeof location>"u"?!1:/^(localhost|127\.0\.0\.1|\[::1\])$/i.test(location.hostname)}function Zc(i){if(!/^[A-Za-z0-9_-]{1,80}$/.test(i.event))return null;let e=i.performanceProfile??{};return{event:i.event,scope:i.scope,surface:i.surface,outcome:i.outcome,stage:i.stage?.slice(0,32)??"",ms:be(i.ms),api:be(e.loadChartAndStatuses)||be(e.loadChart),scene:be(e.buildScene),panel:be(e.buildBuyerControls),paint:be(e.firstPaint),normalize:be(e.normalizeBuyerModel),renderer:be(e.createRenderer),seats:be(i.seats),floors:be(i.floors),view:i.view??"map",load:i.load??Oe(i.event),transport:i.transport??"pubapi",chartBytes:be(i.chartDelivery?.bytes),chartCache:i.chartDelivery?.cache??"",...Ks(),availabilityMs:be(e.loadStatuses)}}var Qc=new Set;function Ae(i){let e=Zc(i);if(e){for(let t of Qc)try{t(e)}catch{}typeof fetch>"u"||Xc()||fetch(`${i.apiBase.replace(/\/+$/,"")}/pub/telemetry/chart-load`,{method:"POST",headers:{"Content-Type":"application/json","X-SeatLayer-Client":"1"},body:JSON.stringify(e),credentials:"omit",keepalive:!0}).catch(()=>{})}}function Zi(i){if(!i)return null;let e=i.getBoundingClientRect();return e.width>0&&e.height>0?e:null}function Jc(i){return Zi(i.foot?.querySelector(".sl-total"))??Zi(i.tray)??Zi(i.sheetHead)}function Kn(i,e,t,n,o){let s=i,r=s.map;if(!r||!e){o?.();return}let a=r.getBoundingClientRect(),l={x:a.left+e.x,y:a.top+e.y},c=t.displayLabel??t.label,d=n?.find(u=>u.key===t.categoryKey)?.color,p=()=>{let u=Jc(s);if(!u){o?.();return}Cs({from:l,to:{x:u.left+u.width/2,y:u.top+u.height/2},label:c,color:d,onArrive:o})};s.sheetHead&&Zi(s.sheetHead)?requestAnimationFrame(p):p()}var qn=60,ed=650;function Ys(i,e){if(!e.length||i.focusSeats?.(e.map(o=>o.id)))return;let t=e.find(o=>o.sectionId)?.sectionId;if(!t)return;let n=e.filter(o=>o.sectionId===t);i.focus(t,{x:n.reduce((o,s)=>o+s.x,0)/n.length,y:n.reduce((o,s)=>o+s.y,0)/n.length})}function Xs(i,e){let t=!Fi();Ys({focusSeats:n=>i.focusSeats?.(n,{animate:t})===!0,focus:(n,o)=>i.focusSection(n,o)},(e?.items??[]).filter(n=>n.objectType!=="ga").slice(0,10).map(n=>i.seatByLabel(n.label)).filter(n=>!!n))}function Zs(i,e){if(!e.length)return;let t=i.reducedMotion===!0;t||e.forEach((r,a)=>{i.schedule(()=>i.pop(r.id),a*qn)});let n=t?0:e.length*qn,o=e.find(r=>r.sectionId)?.sectionId;if(i.schedule(()=>Ys(i,e),n),t)return;let s=n+(i.focusSeats||o?ed:0);e.forEach((r,a)=>{i.schedule(()=>Kn(i.regions,i.screenPoint(r),r,i.categories),s+a*qn)})}function td(i,e,t){for(let n of i)if(e>=n.x&&t>=n.y&&e<=n.x+n.w&&t<=n.y+n.h)return!0;return!1}var Qi=class{constructor(){this.rects=[];this.host=null;this.pointers=new Set;this.touches=new Set;this.mouseDown=!1;this.onPointerDown=e=>{this.inside(e.clientX,e.clientY)&&(this.pointers.add(e.pointerId),this.swallow(e))};this.onPointerFollow=e=>{this.pointers.has(e.pointerId)&&this.swallow(e)};this.onPointerEnd=e=>{this.pointers.delete(e.pointerId)&&this.swallow(e)};this.onTouchStart=e=>{let t=this.changed(e);if(!t.length)return;let n=!0;for(let o of t)this.inside(o.clientX,o.clientY)?this.touches.add(o.identifier):n=!1;n&&this.swallow(e)};this.onTouchFollow=e=>{let t=this.changed(e);t.length&&t.every(n=>this.touches.has(n.identifier))&&this.swallow(e)};this.onTouchEnd=e=>{let t=this.changed(e);if(!t.length)return;let n=t.every(o=>this.touches.has(o.identifier));for(let o of t)this.touches.delete(o.identifier);n&&this.swallow(e)};this.onMouseDown=e=>{this.inside(e.clientX,e.clientY)&&(this.mouseDown=!0,this.swallow(e))};this.onMouseFollow=e=>{this.mouseDown&&this.swallow(e)};this.onMouseUp=e=>{this.mouseDown&&(this.mouseDown=!1,this.swallow(e))};this.onClick=e=>{this.inside(e.clientX,e.clientY)&&this.swallow(e)}}set(e){this.rects=e.map(t=>({x:t.x,y:t.y,w:t.w,h:t.h})),this.rects.length||(this.pointers.clear(),this.touches.clear(),this.mouseDown=!1)}get(){return this.rects}attach(e){if(this.host===e)return;this.detach(),this.host=e;let t={capture:!0,passive:!1};e.addEventListener("pointerdown",this.onPointerDown,t),e.addEventListener("pointermove",this.onPointerFollow,t),e.addEventListener("pointerup",this.onPointerEnd,t),e.addEventListener("pointercancel",this.onPointerEnd,t),e.addEventListener("touchstart",this.onTouchStart,t),e.addEventListener("touchmove",this.onTouchFollow,t),e.addEventListener("touchend",this.onTouchEnd,t),e.addEventListener("touchcancel",this.onTouchEnd,t),e.addEventListener("mousedown",this.onMouseDown,t),e.addEventListener("mousemove",this.onMouseFollow,t),e.addEventListener("mouseup",this.onMouseUp,t),e.addEventListener("click",this.onClick,t),e.addEventListener("dblclick",this.onClick,t)}detach(){let e=this.host;if(!e)return;let t={capture:!0};e.removeEventListener("pointerdown",this.onPointerDown,t),e.removeEventListener("pointermove",this.onPointerFollow,t),e.removeEventListener("pointerup",this.onPointerEnd,t),e.removeEventListener("pointercancel",this.onPointerEnd,t),e.removeEventListener("touchstart",this.onTouchStart,t),e.removeEventListener("touchmove",this.onTouchFollow,t),e.removeEventListener("touchend",this.onTouchEnd,t),e.removeEventListener("touchcancel",this.onTouchEnd,t),e.removeEventListener("mousedown",this.onMouseDown,t),e.removeEventListener("mousemove",this.onMouseFollow,t),e.removeEventListener("mouseup",this.onMouseUp,t),e.removeEventListener("click",this.onClick,t),e.removeEventListener("dblclick",this.onClick,t),this.host=null,this.pointers.clear(),this.touches.clear(),this.mouseDown=!1}inside(e,t){if(!this.rects.length||!this.host)return!1;let n=this.host.getBoundingClientRect();return td(this.rects,e-n.left,t-n.top)}swallow(e){e.stopImmediatePropagation(),e.stopPropagation(),e.cancelable&&e.preventDefault()}changed(e){let t=e.changedTouches;return t?Array.from(t):[]}},Qs=.48,id=8;function nd(i,e,t,n=Qs){let o=Math.max(0,t.top),s=e.height-Math.max(0,t.bottom);if(!(s>o))return 0;let r=Number.isFinite(n)?Math.min(1,Math.max(0,n)):Qs,a=o+(s-o)*r-i;return Math.abs(a)<=id?0:Math.round(a)}function Js(i,e,t={}){let n=i.gestureCount();if(t.gestures!==void 0&&t.gestures!==n)return{dy:0,gestures:n};let o=i.seatPoint(e);if(!o)return{dy:0,gestures:n};let s=nd(o.y,{height:i.mapHeight()},i.insets(),t.fraction);return s?{dy:i.panScreenBy({x:0,y:s},t.animate!==!1)?s:0,gestures:n}:{dy:0,gestures:n}}var si=class i{constructor(e,t=null){this.seams=e;this.watch=null;this.mode=t,this.watchMode()}themeMode(){return this.mode}setThemeMode(e,t){let n=t!==void 0&&"mapTheme"in t;e===this.mode&&!n||(n&&this.seams.setHostMapTheme(t.mapTheme??void 0),this.mode=e,this.watchMode(),this.applyThemeMode())}static groundFor(e){return Tt(null,e)}applyThemeMode(){let e=this.seams.mapTheme()??i.groundFor(this.mode);this.seams.applyMapTheme(e??null)&&this.seams.changed()}watchMode(){this.watch?.(),this.watch=null,this.mode==="auto"&&(this.watch=Oi(()=>this.applyThemeMode()))}setViewportInsets(e){this.seams.applyViewportInsets(e),this.seams.changed()}viewportInsets(){return this.seams.readViewportInsets()}dispose(){this.watch?.(),this.watch=null}};var tr=require("@seatlayer/core"),ir=require("@seatlayer/core/core/seatConfidence");var er=require("@seatlayer/core");function _t(i){let e=i.viewMeta?.previewUrl??i.viewUrl;return e&&(Un(e)||xt(e))?e:null}function en(i){if(!i)return!1;let e=i.floors?.length?i.floors.map(t=>t.objects??[]):[i.objects??[]];for(let t of e)for(let n of t)if(n.type==="shape"&&(n.role==="stage"||n.stageKind))return!0;return!1}var od=512,Ji=new Map;function tn(i,e){if(!e)return null;let t=`${i.id}|${Math.round(e.x)},${Math.round(e.y)}`,n=Ji.get(t);if(n!==void 0)return n;let o=null;try{o=(0,er.generateSeatThumb)(i,e).distanceM??null}catch{o=null}return Ji.size>=od&&Ji.clear(),Ji.set(t,o),o}function ri(i){return i.getFocusedSection()!==null||i.seatsRevealed()}function sd(i){let e=i.atVenueFit?.(),t=i.canZoomIn?.();return{...typeof e=="boolean"?{atVenueFit:e}:{},...typeof t=="boolean"?{canZoomIn:t}:{}}}function rd(i,e){return{accessibilityFilter:i.length>0,limitedViewFilter:e.some(t=>t.commercial?.restrictedView||t.commercial?.obstructedView)}}function ad(i,e,t,n){for(let o of e){if(o.count<=0)continue;let s=i.accessibilitySpread?.([o.key]);for(let r of s?.sections??[]){let a=t.get(r.id)??n.get(r.id);if(!a||r.free<=0)continue;let l=a.accessibleFree??(a.accessibleFree={});l[o.key]=r.free}}}function nr(i,e,t){let n=i.doc,o=n?.theme??{},s=i.categoryAvailability(),r=i.getGAAreas(),a=i.getFloors(),l=i.getExpandedSeats(),c=i.getAccessNeeds(),d=rd(c,l),p=e.seatPosition,u=p.targetSeatId?i.seatDetails(p.targetSeatId):null,h=new Map(l.map(v=>[v.id,v])),y=en(n),f=n?.floors?.flatMap(v=>v.objects)??n?.objects??[],T=new Map,w=new Map;for(let v of f){if(v.type!=="section")continue;let A={id:v.id,label:v.label,...v.displayLabel?{displayLabel:v.displayLabel}:{},...v.zone?{zoneId:v.zone}:{}};T.set(v.id,A);let D=v.logicalSectionId??v.id;w.has(D)||w.set(D,A)}return ad(i,c,T,w),{event:{key:t.event,name:t.eventInfo?.name??n?.name??t.event,venue:t.eventInfo?.venue??null,startsAt:t.eventInfo?.startsAt??null,timezone:t.eventInfo?.timezone??null,currency:t.eventInfo?.currency??t.currency??"USD",locale:(0,tr.getLocale)()||t.eventLocale,posterUrl:t.eventInfo?.posterUrl??null,mode:t.mode_??"live",salesClosed:t.eventInfo?.salesClosed??!1},branding:{...o.accent?{accent:o.accent}:{},...o.accentInk?{accentInk:o.accentInk}:{},...o.background?{background:o.background}:{},...o.textColor?{textColor:o.textColor}:{},...o.brandName?{brandName:o.brandName}:{},...o.logoUrl?{logoUrl:o.logoUrl}:{},attributionRequired:!o.hideBadge},features:{ga:r.length>0,tiers:!!n?.categories.some(v=>v.tiers?.length),floors:a.length>1,zones:!!n?.zones?.length,sections:T.size>0,bestAvailable:!0,...d,venue3d:e.canOffer3D(),seatView:e.canOfferSeatView()},catalog:{categories:(n?.categories??[]).filter(v=>!v.notForSale).map(v=>({key:v.key,label:v.label,color:v.color,price:v.price??v.tiers?.[0]?.price??0,available:s[v.key]??0,...Object.prototype.hasOwnProperty.call(s,v.key)?{free:s[v.key]}:{},tiers:(v.tiers??[]).map(A=>({id:A.id,name:A.name,price:A.price,...A.currency?{currency:A.currency}:{}}))})),zones:(n?.zones??[]).map(v=>({id:v.id,label:v.label,...v.color?{color:v.color}:{}})),sections:[...T.values()],gaAreas:r,bestAvailableZones:i.getBestAvailableZones()},map:{floors:a,activeFloorId:i.getActiveFloorId()||a[0]?.id||null,floorMode:i.isFloorOverview()?"all":"single",floorLabelStyle:i.getRenderer()?.getFloorLabelStyle?.()??"number",rung:i.getRung(),canZoomOut:ri(i)||t.focusedSection_!==null,...sd(i),focusedSectionId:i.getFocusedSection(),focusedSection:t.focusedSection_,viewMode:i.getViewMode(),buyerView:e.buyerView,view3dTargetSeatId:p.targetSeatId,view3dTargetSeat:u,view3dPreviousSeatId:p.previousSeatId,view3dNextSeatId:p.nextSeatId,view3dFocusedSectionId:e.focusedSectionId,view3dNavigationMode:e.navigationMode,colorblindSafe:t.colorblindSafe_,viewportInsets:i.getViewportInsets(),categoryFilter:t.categoryFilter_?[...t.categoryFilter_]:null,accessibilityFilter:t.accessibilityFilter_?[...t.accessibilityFilter_]:null,hideLimitedView:t.hideLimitedView_,accessNeeds:c},selection:{seats:i.getSelection().map(v=>{let A=h.get(v.id);if(!A)return v;let D=i.worldToScreen({x:A.x,y:A.y}),K=_t(A),g=y?tn(A,A.focalPoint??n?.focalPoint):null;return{...v,screenPoint:{x:D.x,y:D.y},...K?{seatViewThumb:{reference:K,kind:"real"}}:{},...g!=null?{sightlineMetres:g}:{},...A.confidenceEvidence?{seatViewConfidence:(0,ir.seatConfidenceDisclosure)(A.confidenceEvidence)}:{}}}),validity:i.getSelectionValidity(),maxSelection:t.maxSelection_},access:{...t.accessState_}}}var ld="https://api.seatlayer.io",or=10;function cd(i){if(typeof i=="string"){let e=document.querySelector(i);if(!e)throw new Error(`seatmap: container "${i}" not found`);return e}if(!(i instanceof HTMLElement))throw new Error("seatmap: container must be a CSS selector or an HTMLElement");return i}var nn=class{constructor(e){this.mount=null;this.hostEl=null;this.interactionEnabled_=!0;this.eventLocale=null;this.localeGeneration=0;this.languageSelect=null;this.rendered=!1;this.mode_=null;this.eventInfo=null;this.categoryFilter_=null;this.accessibilityFilter_=null;this.hideLimitedView_=!1;this.focusedSection_=null;this.lastReportedViewRung_=null;this.lastReportedCanZoomOut_=!1;this.tipEl=null;this.tipPos={x:0,y:0};this.onTipMove=null;this.blockedRegions=null;this.realtime=null;this.holdingLabels=new Set;if(!e||typeof e!="object")throw new Error("seatmap: options object is required");if(!e.container)throw new Error("seatmap: `container` is required");if(!e.event||typeof e.event!="string")throw new Error("seatmap: `event` key is required");this.opts=e,this.maxSelection_=e.maxSelection??or,this.colorblindSafe_=e.colorblindSafe??!1;let t=!!(e.buyerAccessTokenProvider||e.buyerAccessToken||e.publicKey);this.accessState_={configured:t,status:t?"ready":"public"},this.publicKey=e.publicKey;let n={onExpired:a=>{this.accessState_={configured:!0,status:a.refreshed?"ready":"expired"},this.opts.onAccessExpired?.(a),this.notifyMapStateChange()},onUnavailable:a=>{this.accessState_={configured:!0,status:"unavailable",reason:a.reason},this.opts.onAccessUnavailable?.(a),this.notifyMapStateChange()}},o=(e.apiBase??ld).replace(/\/+$/,"");this.apiBase=o;let s=e.publicKey&&!e.buyerAccessTokenProvider&&!e.buyerAccessToken?Bi({base:o,event:e.event,publicKey:e.publicKey,accessHooks:n,apiOptions:{onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)}}):null;this.access=s?.access??Ht(e,n);let r=s?.api??new Ve(o,{access:this.access??void 0,onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)});this.api=r,this.controller=new $.PickerController({transport:r,eventKey:e.event,maxSelection:this.maxSelection_,selectedObjects:e.selectedObjects,selectableObjects:e.selectableObjects,numberOfPlacesToSelect:e.numberOfPlacesToSelect,selectionValidators:e.selectionValidators,currency:e.currency,onSelectionChange:a=>{this.immersive?.pushLiveState(),this.opts.onSelectionChange?.(a)},onSelectionValidityChange:a=>this.opts.onSelectionValidityChange?.(a),onSelectionValid:a=>this.opts.onSelectionValid?.(a),onSelectionInvalid:a=>this.opts.onSelectionInvalid?.(a),onDeselect:a=>{this.controller.currentHold()?.labels.includes(a.label)&&this.controller.releaseLabels([a.label])},retapKeepsSelection:!0,onSeatRetap:a=>this.opts.onSeatRetap?.(a),onSelectionLimit:a=>this.opts.onSelectionLimit?.(a),onHold:a=>this.opts.onHold?.({holdId:a.holdId,expiresAt:a.expiresAt,seats:a.seats,items:a.items}),onHoldRestored:a=>this.opts.onHoldRestored?.({holdId:a.holdId,expiresAt:a.expiresAt,seats:a.seats,items:a.items}),onHoldExpired:()=>this.opts.onHoldExpired?.(),onGAClick:a=>{let l=this.controller.getGAAreas().find(c=>c.id===a);l&&(this.opts.onGAClick?.(l),this.opts.onGAPrompt?.({area:l,selected:{},min:0,max:Math.max(0,Math.min(l.available,(this.opts.maxSelection??or)-this.controller.getSelection().length)),tiers:$i(l),confirm:c=>{let d=typeof c=="number"?c:Object.values(c).reduce((p,u)=>p+u,0);this.holdGA(l.id,d)},cancel:()=>{}}))},onError:a=>this.opts.onError?.(a),onDeckTap:a=>{this.opts.onDeckTap?.(a),this.notifyMapStateChange()},onHint:a=>this.opts.onHint?.(a),onSectionFocus:a=>{this.focusedSection_=a,this.opts.onSectionFocus?.(a),this.notifyMapStateChange()},onViewChange:()=>this.handleViewChange(),onStatusChange:()=>{this.immersive?.pushLiveState(),this.opts.onStatusChange?.()},onSalesClosed:()=>{this.eventInfo&&(this.eventInfo.salesClosed=!0),this.opts.onSalesClosed?.()},flashOnLiveChange:!0,onSeatHover:a=>{this.opts.onSeatHover?.(a),this.opts.seatTooltip!==!1&&this.updateTooltip(a)},colorblindSafe:e.colorblindSafe,mapTheme:e.mapTheme??si.groundFor(e.theme?.mode)??null}),this.hostSurface=new si({mapTheme:()=>this.opts.mapTheme,setHostMapTheme:a=>{this.opts.mapTheme=a},applyMapTheme:a=>this.controller.setMapTheme(a),applyViewportInsets:a=>this.controller.setViewportInsets(a),readViewportInsets:()=>this.controller.getViewportInsets(),changed:()=>this.notifyMapStateChange()},e.theme?.mode??null),this.buyerAssetUrls=new It(e.event,(a,l)=>r.asset(a,l)),this.immersive=new Ki({host:()=>this.hostEl,doc:()=>this.controller.doc,seats:()=>this.controller.getExpandedSeats(),selection:()=>this.controller.getSelection(),status:a=>this.controller.getStatus(a),select:a=>this.controller.select([a]),deselect:a=>this.controller.deselect([a]),loadEventConfiguration:()=>this.controller.loadEventConfiguration(),resolveAsset:a=>this.buyerAssetUrls.resolve(a),enable3D:e.enable3D!==!1,enableSeatView:e.enableSeatView!==!1,max3DSeats:e.max3DSeats,...e.chrome?{chrome:e.chrome}:{},restoreMap:()=>this.controller.refitCurrentView(),onViewChange:(a,l)=>{this.opts.onBuyerViewChange?.({view:a,...l?{seatId:l}:{}}),this.notifyMapStateChange()},onSeatViewChange:a=>this.opts.onSeatViewChange?.(a),onError:a=>this.opts.onError?.(a)}),this.lastReportedViewRung_=this.controller.getRung(),this.lastReportedCanZoomOut_=ri(this.controller)}handleViewChange(){this.opts.onViewChange?.();let e=this.controller.getRung(),t=ri(this.controller);e===this.lastReportedViewRung_&&t===this.lastReportedCanZoomOut_||(this.lastReportedViewRung_=e,this.lastReportedCanZoomOut_=t,this.opts.onMapStateChange?.())}notifyMapStateChange(){this.lastReportedViewRung_=this.controller.getRung(),this.lastReportedCanZoomOut_=ri(this.controller),this.opts.onMapStateChange?.()}async render(){if(this.rendered)return this;let e=performance.now();this.rendered=!0;let t=_i(this.opts.locale,this.opts.messages),n=this.localeGeneration+=1,o=(0,$.getLocale)();this.mount=cd(this.opts.container);let s=document.createElement("div");s.style.width="100%",s.style.height="100%",s.style.position="relative",this.mount.appendChild(s),this.hostEl=s,this.blockedRegions?.attach(s),Ni(s,t,a=>{a!==o&&this.applyActiveLocale(a,n)}),this.applyInteractionState();let r=await this.controller.render(s);if(!r)return Ae({apiBase:this.apiBase,event:this.opts.event,scope:"event",surface:"seating_chart",outcome:"failure",stage:"load_chart",ms:performance.now()-e,load:Oe(this.opts.event),transport:"pubapi"}),this.rendered=!1,this.opts.errorDisplay!=="none"&&this.showLoadFailure(s),this;if(this.eventLocale=r.locale??null,!this.opts.locale&&this.eventLocale&&this.setLocale(this.eventLocale),this.buildLanguageSwitcher(s),this.controller.setViewMode(this.opts.initialView??"flat"),this.opts.floorLabelStyle&&this.setFloorLabelStyle(this.opts.floorLabelStyle),this.startRealtime(),this.mode_=r.mode==="test"?"test":"live",this.eventInfo={name:r.eventName,venue:r.venue??null,startsAt:r.startsAt??null,timezone:r.timezone??null,currency:r.currency??this.opts.currency??"USD",posterUrl:r.posterUrl??null,salesClosed:r.salesClosed},this.opts.seatTooltip!==!1){let a=document.createElement("div");a.setAttribute("role","tooltip"),a.style.cssText='position:absolute;z-index:7;pointer-events:none;display:none;max-width:240px;background:#10162a;color:#fff;border-radius:10px;padding:9px 12px;font:500 12px/1.45 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;box-shadow:0 10px 30px -10px rgba(0,0,0,.5);',s.appendChild(a),this.tipEl=a,this.onTipMove=l=>{let c=s.getBoundingClientRect();this.tipPos={x:l.clientX-c.left,y:l.clientY-c.top},this.tipEl&&this.tipEl.style.display!=="none"&&this.placeTooltip()},s.addEventListener("mousemove",this.onTipMove)}if(r.mode==="test"&&this.opts.showTestModeIndicator!==!1){s.style.overflow="hidden";let a=document.createElement("div");a.dataset.slI18n="testMode",a.textContent=(0,$.t)("picker.testMode"),a.setAttribute("aria-label",(0,$.t)("picker.testMode")),a.style.cssText="position:absolute;top:18px;right:-34px;z-index:6;transform:rotate(45deg);width:140px;text-align:center;padding:4px 0;background:#f4b740;color:#1a1200;font:800 10.5px/1.4 -apple-system,BlinkMacSystemFont,sans-serif;letter-spacing:.12em;box-shadow:0 2px 8px rgba(0,0,0,.25);pointer-events:none;",s.appendChild(a)}return this.buildBadge(s),Ae({apiBase:this.apiBase,event:this.opts.event,scope:"event",surface:"seating_chart",outcome:"success",ms:performance.now()-e,performanceProfile:r.performanceProfile,chartDelivery:r.chartDelivery,seats:this.controller.getExpandedSeats().length,floors:this.controller.getFloors().length,view:"map",load:Xi(this.opts.event),transport:"pubapi"}),this}buildBadge(e){if(this.controller.doc?.theme?.hideBadge)return;let t=document.createElement("a");t.dataset.slI18n="badge",t.href="https://seatlayer.io",t.target="_blank",t.rel="noopener noreferrer",t.setAttribute("aria-label",(0,$.t)("picker.poweredBy")),t.style.cssText='position:absolute;bottom:10px;right:12px;z-index:5;display:inline-flex;align-items:center;gap:6px;padding:5px 9px;border-radius:999px;background:rgba(255,255,255,.92);color:#4a5163;text-decoration:none;font:600 11px/1 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;letter-spacing:.02em;box-shadow:0 2px 8px rgba(0,0,0,.12);';let n=document.createElement("span");n.setAttribute("aria-hidden","true"),n.style.cssText="width:16px;height:16px;border-radius:4px;flex:none;display:flex;align-items:center;justify-content:center;background:#0c1220;color:#fcf7ee",n.innerHTML=ji;let o=document.createElement("span");o.textContent=(0,$.t)("picker.poweredBy"),t.append(n,o),e.appendChild(t)}placeTooltip(){if(!this.tipEl||!this.hostEl)return;let e=this.hostEl.clientWidth,t=this.tipEl.offsetWidth,n=this.tipEl.offsetHeight,o=this.tipPos.x+14,s=this.tipPos.y-n-12;o+t>e-8&&(o=this.tipPos.x-t-14),s<8&&(s=this.tipPos.y+18),this.tipEl.style.left=`${Math.max(8,o)}px`,this.tipEl.style.top=`${Math.max(8,s)}px`}updateTooltip(e){if(!this.tipEl)return;if(!e){this.tipEl.style.display="none";return}let t=(0,$.formatMoney)(e.price,e.currency,{...Number.isInteger(e.price)?{minimumFractionDigits:0,maximumFractionDigits:0}:{},locale:this.opts.locale,fallback:(l,c)=>`${l} ${c}`}),n=document.createElement("div");n.style.cssText="font-weight:700;font-size:13px",n.textContent=e.label;let o=document.createElement("div");o.style.cssText="display:flex;align-items:center;gap:6px;margin-top:4px;color:#c7cddc";let s=document.createElement("span");s.style.cssText="width:9px;height:9px;border-radius:50%;flex:none",s.style.background=e.categoryColor;let r=document.createElement("span");r.textContent=e.categoryLabel;let a=document.createElement("span");if(a.style.cssText="margin-left:auto;font-weight:700;color:#fff",a.textContent=t,o.append(s,r,a),this.tipEl.replaceChildren(n,o),e.status!=="free"){let l=document.createElement("div");l.style.cssText="margin-top:5px;font-size:10.5px;letter-spacing:.08em;text-transform:uppercase;color:#fca5a5;font-weight:700",l.textContent=e.status==="held"?(0,$.t)("map.statusHeld"):(0,$.t)("map.statusTaken"),this.tipEl.appendChild(l)}this.tipEl.style.display="block",this.placeTooltip()}buildLanguageSwitcher(e){let t=(this.opts.languages??[]).map(o=>(0,$.resolveLocale)(o)).filter((o,s,r)=>r.indexOf(o)===s);if(t.length<2)return;let n=document.createElement("select");n.setAttribute("aria-label",(0,$.t)("picker.preferredTicketType")),n.style.cssText='position:absolute;bottom:10px;left:12px;z-index:5;appearance:none;padding:5px 9px;border-radius:999px;border:0;cursor:pointer;background:rgba(255,255,255,.92);color:#4a5163;font:600 11px/1 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;box-shadow:0 2px 8px rgba(0,0,0,.12);';for(let o of t){let s=document.createElement("option");s.value=o,s.textContent=$.LOCALE_NAMES[o]??o,s.selected=o===(0,$.getLocale)(),n.appendChild(s)}n.addEventListener("change",()=>{this.setLocale(n.value)}),e.appendChild(n),this.languageSelect=n}async setLocale(e){let t=(0,$.getLocale)(),n=this.localeGeneration+=1,o=await(0,$.loadLocale)(e);return this.opts.messages&&(0,$.setStringOverrides)(this.opts.messages),o===t||this.applyActiveLocale(o,n),o}applyActiveLocale(e,t){if(t!==this.localeGeneration)return;let n=this.hostEl;if(n){n.lang=e,n.dir=(0,$.localeDirection)(e);for(let o of n.querySelectorAll("[data-sl-i18n]"))if(o.dataset.slI18n==="testMode")o.textContent=(0,$.t)("picker.testMode"),o.setAttribute("aria-label",(0,$.t)("picker.testMode"));else if(o.dataset.slI18n==="badge"){o.setAttribute("aria-label",(0,$.t)("picker.poweredBy"));let s=o.querySelector("span:last-child");s&&(s.textContent=(0,$.t)("picker.poweredBy"))}this.languageSelect&&this.languageSelect.value!==e&&(this.languageSelect.value=e),this.controller.refreshMapCopy()}}getMode(){return this.mode_}getPickerState(){return nr(this.controller,this.immersive,{event:this.opts.event,currency:this.opts.currency,mode_:this.mode_,eventInfo:this.eventInfo,eventLocale:this.eventLocale,focusedSection_:this.focusedSection_,colorblindSafe_:this.colorblindSafe_,categoryFilter_:this.categoryFilter_,accessibilityFilter_:this.accessibilityFilter_,hideLimitedView_:this.hideLimitedView_,maxSelection_:this.maxSelection_,accessState_:this.accessState_})}getCategoryAvailability(){return this.controller.categoryAvailability()}getBestAvailableZones(){return this.controller.getBestAvailableZones()}getActiveFloorId(){return this.controller.getActiveFloorId()||null}getRung(){return this.controller.getRung()}getFocusedSection(){return this.controller.getFocusedSection()}focusSection(e){if(this.immersive.buyerView==="venue3d"&&this.immersive.focusSection(e)){this.notifyMapStateChange();return}this.controller.focusSection(e),this.notifyMapStateChange()}overview(){if(this.immersive.focusOverview()){this.notifyMapStateChange();return}this.controller.overview(),this.notifyMapStateChange()}setRung(e){this.controller.setRung(e),this.notifyMapStateChange()}setCategoryFilter(e,t=!1){this.categoryFilter_=e?[...e]:null,this.controller.setCategoryFilter(e),t&&this.controller.focusCategoryFilter(e),this.notifyMapStateChange()}setAccessibilityFilter(e){this.accessibilityFilter_=e?[...e]:null,this.controller.setAccessibilityFilter(e),this.notifyMapStateChange(),e?.length&&this.focusAccessibilityFilter()}focusAccessibilityFilter(){this.controller.focusAccessibilityFilter?.(),this.notifyMapStateChange()}focusNextAccessibleSection(e){let t=this.controller.focusNextAccessibleSection?.(e)??null;return t&&this.notifyMapStateChange(),t}setCommercialLimitedFilter(e){this.hideLimitedView_=e,this.controller.setCommercialLimitedFilter(e),this.notifyMapStateChange()}getSelection(){return this.controller.getSelection()}selectObjects(e){let t=this.controller.select(e);return this.immersive.pushLiveState(),t}deselectObjects(e){this.controller.deselect(e),this.immersive.pushLiveState()}clearSelection(){this.controller.clearSelection(),this.immersive.pushLiveState()}selectCategories(e){return this.controller.selectCategories(e)}deselectCategories(e){this.controller.deselectCategories(e)}setSelectableObjects(e){this.controller.setSelectableObjects(e)}setMaxSelection(e){this.maxSelection_=e,this.controller.setMaxSelection(e),this.notifyMapStateChange()}getSelectionValidity(){return this.controller.getSelectionValidity()}async hold(e={}){try{return await this.holdOrThrow(e)}catch(t){return this.opts.onError?.(t),null}}async holdOrThrow(e={}){let t=this.controller.getSelectionValidity();if(t&&!t.isValid){let n=t.violations.includes("numberOfPlacesToSelect");throw Object.assign(new Error(n?`seatmap: select exactly ${t.required} places before holding`:"seatmap: adjust the ticket selection before holding"),{code:n?"selection_count_mismatch":"selection_invalid",selection:t})}this.holdingLabels=new Set(this.controller.getSelection().map(n=>n.label));try{let n=await this.controller.hold(void 0,e.ttlMs);return n?{holdId:n.holdId,expiresAt:n.expiresAt,seats:n.seats,items:n.items}:null}finally{this.holdingLabels.clear()}}async resumeHold(e){try{return await this.resumeHoldOrThrow(e)}catch(t){return this.opts.onError?.(t),null}}async resumeHoldOrThrow(e){let t=await this.controller.resumeHold(e);return t?{holdId:t.holdId,expiresAt:t.expiresAt,seats:t.seats,items:t.items}:null}async extendHold(e){try{let t=await this.controller.extendHold(e);return t?{holdId:t.holdId,expiresAt:t.expiresAt,seats:t.seats,items:t.items}:null}catch(t){return this.opts.onError?.(t),null}}getCurrentHold(){let e=this.controller.currentHold();return e?{holdId:e.holdId,expiresAt:e.expiresAt,seats:e.seats,items:e.items}:null}getGAAreas(){return this.controller.getGAAreas()}async holdGA(e,t,n={}){try{return await this.holdGAOrThrow(e,t,n)}catch(o){return this.opts.onError?.(o),null}}async holdGAOrThrow(e,t,n={}){let o=await this.controller.holdGA(e,t,n);return o?{holdId:o.holdId,expiresAt:o.expiresAt,seats:o.seats,items:o.items}:null}async bestAvailable(e,t,n={}){try{return await this.bestAvailableOrThrow(e,t,n)}catch(o){return this.opts.onError?.(o),null}}async bestAvailableOrThrow(e,t,n={}){let o=await this.controller.bestAvailable(e,t,n);return Xs(this.controller,o),o?{holdId:o.holdId,expiresAt:o.expiresAt,labels:o.labels,seats:o.seats,items:o.items,...n.zoneId?{zoneId:n.zoneId}:{}}:null}setSeatTier(e,t){this.controller.setSeatTier(e,t)}setTableQuantity(e,t){return this.controller.setTableQuantity(e,t)}async replaceTableQuantity(e,t,n){try{return await this.replaceTableQuantityOrThrow(e,t,n)}catch(o){return this.opts.onError?.(o),null}}async replaceTableQuantityOrThrow(e,t,n){let o=await this.controller.replaceTableQuantity(e,t,n);return o?{holdId:o.holdId,expiresAt:o.expiresAt,seats:o.seats,items:o.items}:null}getFloors(){return this.controller.getFloors()}setFloor(e){if(this.immersive.buyerView==="venue3d"&&e!=="all"&&this.immersive.focusFloor(e)){this.notifyMapStateChange();return}if(this.controller.getFloors().length<=1){console.warn("seatmap: setFloor() ignored \u2014 this chart has a single floor");return}e==="all"?this.controller.setFloorOverview(!0):this.controller.setFloor(e),this.notifyMapStateChange()}setFloorLabelStyle(e){this.controller.getRenderer()?.setFloorLabelStyle?.(e),this.notifyMapStateChange()}setSectionFocusDim(e){this.controller.setSectionFocusDim(e)}setSelectionFocus(e){this.controller.setSelectionFocus(e)}setBlockedRegions(e){if(!this.blockedRegions){if(!e.length)return;this.blockedRegions=new Qi,this.hostEl&&this.blockedRegions.attach(this.hostEl)}this.blockedRegions.set(e)}getBlockedRegions(){return this.blockedRegions?.get()??[]}frameSeat(e,t={}){let n=this.controller.getRenderer();return Js({seatPoint:o=>{let s=this.controller.getExpandedSeats().find(r=>r.id===o);return s?this.controller.worldToScreen({x:s.x,y:s.y}):null},mapHeight:()=>this.hostEl?.clientHeight??0,insets:()=>this.controller.getViewportInsets(),gestureCount:()=>n?.getCameraGestureCount?.()??0,panScreenBy:(o,s)=>n?.panScreenBy?(n.panScreenBy(o,{animate:s}),!0):!1},e,t)}setColorblindSafe(e){this.colorblindSafe_=e,this.controller.setColorblindSafe(e),this.notifyMapStateChange()}setViewMode(e){this.controller.setViewMode(e),this.notifyMapStateChange()}getViewMode(){return this.controller.getViewMode()}zoomIn(){this.immersive.zoomIn()||(this.controller.zoomIn(),this.notifyMapStateChange())}zoomOut(){this.immersive.zoomOut()||(this.controller.zoomOut(),this.notifyMapStateChange())}zoomToFit(){this.immersive.focusOverview()||(this.controller.zoomToFit(),this.notifyMapStateChange())}setThemeMode(e,t){this.hostSurface.setThemeMode(e,t)}getThemeMode(){return this.hostSurface.themeMode()}setViewportInsets(e){this.hostSurface.setViewportInsets(e)}getViewportInsets(){return this.hostSurface.viewportInsets()}setBuyerView(e,t){return this.immersive.setBuyerView(e,t)}getBuyerView(){return this.immersive.buyerView}openSeatView(e){return this.immersive.openSeatView(e)}setVenue3DNavigationMode(e){if(!this.immersive.setNavigationMode(e))throw new Error("venue_3d_not_active")}setInteractionEnabled(e){this.interactionEnabled_=e,this.applyInteractionState()}applyInteractionState(){let e=this.hostEl;e&&(e.style.pointerEvents=this.interactionEnabled_?"":"none",e.toggleAttribute("inert",!this.interactionEnabled_),this.interactionEnabled_?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden","true"))}async release(){await this.controller.release()}async releaseLabels(e){return this.controller.releaseLabels(e)}startRealtime(){!this.access?.configured||this.realtime||(this.realtime=new Ee({url:this.api.subscribeUrl(this.opts.event),mintTicket:()=>this.api.subscribeTicket(this.opts.event),onAccessUnavailable:e=>this.opts.onAccessUnavailable?.(e),sink:wt(this.controller,{flashOnLiveChange:!0,ownLabels:()=>this.holdingLabels,onStatusChange:()=>{this.immersive.pushLiveState(),this.opts.onStatusChange?.()},onSelectedObjectUnavailable:(e,t)=>this.opts.onSelectedObjectUnavailable?.({labels:e,reason:t})})}),this.realtime.start())}async refreshAvailability(){let e=await this.controller.refreshAvailability();return this.immersive.pushLiveState(),this.opts.onStatusChange?.(),e.lost.length&&this.opts.onSelectedObjectUnavailable?.({labels:e.lost,reason:"taken"}),this.notifyMapStateChange(),e}async refreshAccess(){if(!this.access?.configured)return!1;let e=await this.access.refresh("manual");return e&&(this.accessState_={configured:!0,status:"ready"},await this.controller.refresh(),this.realtime?.restart(),this.realtime||this.startRealtime()),this.notifyMapStateChange(),e}showLoadFailure(e){let t=document.createElement("div");t.setAttribute("role","status"),t.style.cssText='display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;width:100%;height:100%;min-height:180px;box-sizing:border-box;padding:24px;text-align:center;font:500 14px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#3b4256;';let n=document.createElement("div");n.textContent="The seat map didn\u2019t load.",t.appendChild(n);let o=document.createElement("button");o.type="button",o.textContent="Try again",o.style.cssText="appearance:none;border:1px solid #c9cede;background:#fff;color:#10162a;border-radius:8px;padding:8px 16px;font:600 13px/1 inherit;cursor:pointer;",o.addEventListener("click",()=>{this.destroy(),this.render().catch(s=>this.opts.onError?.(s))}),t.appendChild(o),e.appendChild(t)}destroy(){this.blockedRegions?.detach(),this.hostSurface.dispose(),this.immersive.destroy(),this.buyerAssetUrls.dispose(),this.realtime?.stop(),this.realtime=null,this.access?.clear(),this.hostEl&&this.onTipMove&&this.hostEl.removeEventListener("mousemove",this.onTipMove),this.tipEl=null,this.onTipMove=null,this.languageSelect=null,this.controller.destroy(),this.hostEl&&this.hostEl.parentNode&&this.hostEl.parentNode.removeChild(this.hostEl),this.hostEl=null,this.mount=null,this.rendered=!1,this.mode_=null,this.eventInfo=null,this.focusedSection_=null}};var Wn=["hold","resumeHold","getCurrentHold","getGAAreas","holdGA","bestAvailable","release","releaseLabels","getSelection","selectObjects","deselectObjects","clearSelection","selectCategories","deselectCategories","setSelectableObjects","setMaxSelection","getSelectionValidity","setSeatTier","getFloors","setFloor","setColorblindSafe","zoomIn","zoomOut","zoomToFit","refreshAccess"],dd={hold:()=>Promise.resolve(null),resumeHold:()=>Promise.resolve(null),getCurrentHold:()=>null,getGAAreas:()=>[],holdGA:()=>Promise.resolve(null),bestAvailable:()=>Promise.resolve(null),release:()=>Promise.resolve(),releaseLabels:()=>Promise.resolve(!1),getSelection:()=>[],selectObjects:()=>[],deselectObjects:()=>{},clearSelection:()=>{},selectCategories:()=>[],deselectCategories:()=>{},setSelectableObjects:()=>{},setMaxSelection:()=>{},getSelectionValidity:()=>null,setSeatTier:()=>{},getFloors:()=>[],setFloor:()=>{},setColorblindSafe:()=>{},zoomIn:()=>{},zoomOut:()=>{},zoomToFit:()=>{},refreshAccess:()=>Promise.resolve(!1)};function sr(i){let e={};for(let t of Wn)e[t]=(...n)=>{let o=i();return o?o[t](...n):dd[t]()};return e}var Yn=["event","apiBase","maxSelection","numberOfPlacesToSelect","selectionValidators","publicKey","locale","currency","colorblindSafe","initialView","errorDisplay"],Xn=[...Yn,"selectedObjects","selectableObjects","messages","seatTooltip","buyerAccessTokenProvider","buyerAccessToken"],Zn=["onSelectionChange","onSelectionValidityChange","onSelectionValid","onSelectionInvalid","onSelectionLimit","onHold","onHoldRestored","onHoldExpired","onGAClick","onGAPrompt","onError","onDeckTap","onHint","onSeatHover","onAccessExpired","onAccessUnavailable","onSelectedObjectUnavailable"];function rr(i,e,t){let n={container:i};for(let o of Xn)n[o]=e[o];for(let o of Zn)n[o]=t[o];return n}var pd=new Set(["seatlayer.designer.ready","seatlayer.designer.saved","seatlayer.designer.published","seatlayer.designer.close","seatlayer.designer.error"]),hd=2e4,ud=480,md=180*1e3,fd=900*1e3,gd=.8,bd=30*1e3,yd=1e5,vd=4,wd=50;function Qn(i){if(typeof i!="string")return i;let e=document.querySelector(i);if(!e)throw new Error(`EmbeddedDesigner container not found: ${i}`);return e}function xd(i){let e=(i??"").toLowerCase();return e.includes("expire")||e.includes("revoke")||e==="401"?"expired":e.includes("mismatch")?"mismatch":e.includes("timeout")?"timeout":"load"}var Sd={expired:{title:"This design session expired",body:"For your security, editing sessions are short-lived. Start a fresh one to keep designing."},mismatch:{title:"This editor doesn't match this chart",body:"The session that loaded belongs to a different chart or workspace. Reopen the designer to continue."},timeout:{title:"The designer is taking too long",body:"It did not finish loading in time. This is usually a slow connection \u2014 try again."},load:{title:"We couldn't load the designer",body:"Something went wrong while opening the editor. Please try again."}},on=class{constructor(e){this.frame=null;this.designerOrigin="";this.overlay=null;this.timeoutTimer=null;this.renewTimer=null;this.autoRecoverUsed=!1;this.phase="loading";this.identityEstablished=!1;this.restoreContainerPosition=null;this.pinned=!1;this.frameStyleBeforeFs=null;this.docOverflowBeforeFs=null;this.bodyOverflowBeforeFs=null;this.fsKeyHandler=null;this.lastAutoHeight="";this.fillRaf=null;this.reprobeRaf=null;this.fillListening=!1;this.containerEl=null;this.fillMode=null;this.resizeObs=null;this.scheduleFill=()=>{this.fillRaf===null&&(this.fillRaf=requestAnimationFrame(()=>{this.fillRaf=null,this.applyFill()}))};this.scheduleReprobe=()=>{this.reprobeRaf===null&&(this.reprobeRaf=requestAnimationFrame(()=>{this.reprobeRaf=null,!this.pinned&&(this.fillMode=this.detectFillMode(),this.syncContainerObserver(),this.applyFill())}))};this.handleMessage=e=>{if(!this.frame||e.origin!==this.designerOrigin||e.source!==this.frame.contentWindow||!e.data||typeof e.data!="object")return;let t=e.data;if(t.type==="seatlayer.designer.handshake"&&typeof t.nonce=="string"&&t.nonce.length<=128){this.frame.contentWindow?.postMessage({type:"seatlayer.designer.parent",nonce:t.nonce},this.designerOrigin);return}if(t.type==="seatlayer.designer.resize"){!this.fillEnabled()&&this.autoResizeEnabled()&&typeof t.px=="number"&&Number.isFinite(t.px)&&t.px>0&&(this.lastAutoHeight=`${Math.round(t.px)}px`,this.pinned||this.setFrameHeight(this.lastAutoHeight));return}if(t.type==="seatlayer.designer.fullscreen"){t.on===!0?this.pinFullscreen():t.on===!1&&this.unpinFullscreen();return}if(typeof t.type!="string"||!pd.has(t.type))return;let n={type:t.type,chartId:typeof t.chartId=="string"?t.chartId:void 0,workspaceId:typeof t.workspaceId=="string"?t.workspaceId:void 0,expiresAt:typeof t.expiresAt=="number"?t.expiresAt:void 0,code:typeof t.code=="string"?t.code:void 0,message:typeof t.message=="string"?t.message:void 0,meta:t.meta,fatal:typeof t.fatal=="boolean"?t.fatal:void 0,action:typeof t.action=="string"?t.action:void 0},o=this.identityEstablished||n.type==="seatlayer.designer.ready"||n.type==="seatlayer.designer.saved"||n.type==="seatlayer.designer.published"||n.type==="seatlayer.designer.close",s=this.options.expectedChartId!==void 0&&n.chartId!==this.options.expectedChartId&&(o||n.chartId!==void 0),r=this.options.expectedWorkspaceId!==void 0&&n.workspaceId!==this.options.expectedWorkspaceId&&(o||n.workspaceId!==void 0);if(s||r){this.showError("mismatch");return}switch(n.type){case"seatlayer.designer.ready":this.identityEstablished=!0,this.sessionExpiresAt=n.expiresAt,this.phase="ready",this.clearTimeoutTimer(),this.removeOverlay(),this.autoRecoverUsed=!1,this.scheduleRenewal(n.expiresAt),this.options.onReady?.(n);break;case"seatlayer.designer.saved":this.options.onSaved?.(n);break;case"seatlayer.designer.published":this.options.onPublished?.(n);break;case"seatlayer.designer.close":this.options.onClose?.(n);break;case"seatlayer.designer.error":{let a=xd(n.code);if(a==="expired"&&this.autoRenewEnabled()&&!this.autoRecoverUsed){this.autoRecoverUsed=!0,this.clearRenewTimer(),this.options.onRequestRelaunch();return}(typeof n.fatal=="boolean"?n.fatal:a!=="load"||this.phase!=="ready")&&this.showError(a),this.options.onError?.(n);break}}};this.options=e}mount(){this.destroy();let e=new URL(this.options.designerUrl,window.location.href);if(e.protocol!=="https:"&&e.hostname!=="localhost"&&e.hostname!=="127.0.0.1")throw new Error("EmbeddedDesigner requires an HTTPS designerUrl outside local development.");this.designerOrigin=e.origin;let t=document.createElement("iframe");t.title=this.options.title??"Venue chart Designer",t.allow=this.options.allow??"fullscreen; clipboard-write",t.referrerPolicy=this.options.referrerPolicy??"origin",t.src=e.toString(),t.style.setProperty("width","100%","important"),t.style.setProperty("height",typeof this.options.height=="number"?`${this.options.height}px`:"100%","important"),t.style.border="0",Object.assign(t.style,this.options.style),this.options.className&&(t.className=this.options.className);let n=Qn(this.options.container);if(this.containerEl=n,window.addEventListener("message",this.handleMessage),n.append(t),this.frame=t,this.fillEnabled()&&this.startFill(),this.phase="loading",this.loadingStateEnabled()){this.ensureContainerPositioned(n),this.renderOverlay(n,"loading");let o=this.options.loadingTimeoutMs??hd;o>0&&Number.isFinite(o)&&(this.timeoutTimer=setTimeout(()=>{this.phase==="loading"&&this.showError("timeout")},o))}return t}setDesignerUrl(e){return this.options={...this.options,designerUrl:e},this.mount()}getIframe(){return this.frame}setSizing(e,t){this.options={...this.options,height:e,minHeight:t},this.frame&&(this.stopFill(),this.lastAutoHeight="",this.fillEnabled()?(this.pinned||this.setFrameHeight("100%"),this.startFill()):this.pinned||this.setFrameHeight(`${e}px`))}setRelaunchPolicy(e,t){this.options={...this.options,onRequestRelaunch:e,autoRenewSession:t},this.clearRenewTimer(),this.phase==="ready"&&this.scheduleRenewal(this.sessionExpiresAt)}destroy(){window.removeEventListener("message",this.handleMessage),this.stopFill(),this.unpinFullscreen(),this.clearTimeoutTimer(),this.clearRenewTimer(),this.removeOverlay(),this.restoreContainerStyle(),this.frame?.remove(),this.frame=null,this.containerEl=null,this.fillMode=null,this.designerOrigin="",this.phase="loading",this.identityEstablished=!1,this.sessionExpiresAt=void 0,this.lastAutoHeight=""}loadingStateEnabled(){return this.options.showLoadingState!==!1}autoResizeEnabled(){return this.options.autoResize!==!1}fillEnabled(){return typeof this.options.height!="number"}setFrameHeight(e){this.frame?.style.setProperty("height",e,"important")}detectFillMode(){let e=this.containerEl,t=this.frame;if(this.pinned||!e||!t)return this.fillMode??"viewport";let n=()=>e.getBoundingClientRect().height,o=t.style.getPropertyValue("height"),s=t.style.getPropertyPriority("height");t.style.setProperty("height","0px","important");let r=n();t.style.setProperty("height",`${yd}px`,"important");let a=n();return o?t.style.setProperty("height",o,s):t.style.removeProperty("height"),!(a-r>vd)&&r>=wd?"container":"viewport"}applyFill(){if(!this.frame||this.pinned)return;let e=this.options.minHeight??ud;if(this.fillMode==="container"&&this.containerEl){let o=Math.max(e,Math.round(this.containerEl.getBoundingClientRect().height));this.setFrameHeight(`${o}px`);return}let t=this.frame.getBoundingClientRect().top,n=Math.max(e,Math.round(window.innerHeight-t));this.setFrameHeight(`${n}px`)}syncContainerObserver(){let e=this.fillMode==="container"&&!!this.containerEl&&typeof ResizeObserver<"u";e&&!this.resizeObs?(this.resizeObs=new ResizeObserver(()=>this.scheduleFill()),this.resizeObs.observe(this.containerEl)):!e&&this.resizeObs&&(this.resizeObs.disconnect(),this.resizeObs=null)}startFill(){this.fillMode=this.detectFillMode(),this.syncContainerObserver(),this.applyFill(),!this.fillListening&&(this.fillListening=!0,window.addEventListener("resize",this.scheduleReprobe),window.addEventListener("orientationchange",this.scheduleReprobe),window.addEventListener("scroll",this.scheduleFill,{passive:!0}))}stopFill(){this.fillRaf!==null&&(cancelAnimationFrame(this.fillRaf),this.fillRaf=null),this.reprobeRaf!==null&&(cancelAnimationFrame(this.reprobeRaf),this.reprobeRaf=null),this.resizeObs&&(this.resizeObs.disconnect(),this.resizeObs=null),this.fillListening&&(this.fillListening=!1,window.removeEventListener("resize",this.scheduleReprobe),window.removeEventListener("orientationchange",this.scheduleReprobe),window.removeEventListener("scroll",this.scheduleFill))}pinFullscreen(){if(this.pinned||!this.frame)return;this.pinned=!0,this.frameStyleBeforeFs=this.frame.getAttribute("style");let e={position:"fixed",top:"0",right:"0",bottom:"0",left:"0",width:"100vw",height:"100vh",margin:"0",border:"0","z-index":"2147483000",background:"#101625"};for(let[n,o]of Object.entries(e))this.frame.style.setProperty(n,o,"important");let t=document.documentElement;this.docOverflowBeforeFs=t.style.overflow,t.style.overflow="hidden",document.body&&(this.bodyOverflowBeforeFs=document.body.style.overflow,document.body.style.overflow="hidden"),this.fsKeyHandler=n=>{n.key==="Escape"&&this.unpinFullscreen()},window.addEventListener("keydown",this.fsKeyHandler)}unpinFullscreen(){this.pinned&&(this.pinned=!1,this.frame&&(this.frameStyleBeforeFs===null?this.frame.removeAttribute("style"):this.frame.setAttribute("style",this.frameStyleBeforeFs),this.fillEnabled()?this.applyFill():this.autoResizeEnabled()&&this.lastAutoHeight?this.setFrameHeight(this.lastAutoHeight):typeof this.options.height=="number"&&this.setFrameHeight(`${this.options.height}px`)),this.frameStyleBeforeFs=null,this.docOverflowBeforeFs!==null&&(document.documentElement.style.overflow=this.docOverflowBeforeFs,this.docOverflowBeforeFs=null),this.bodyOverflowBeforeFs!==null&&document.body&&(document.body.style.overflow=this.bodyOverflowBeforeFs,this.bodyOverflowBeforeFs=null),this.fsKeyHandler&&(window.removeEventListener("keydown",this.fsKeyHandler),this.fsKeyHandler=null))}clearTimeoutTimer(){this.timeoutTimer!==null&&(clearTimeout(this.timeoutTimer),this.timeoutTimer=null)}autoRenewEnabled(){return!!this.options.onRequestRelaunch&&this.options.autoRenewSession!==!1}clearRenewTimer(){this.renewTimer!==null&&(clearTimeout(this.renewTimer),this.renewTimer=null)}scheduleRenewal(e){if(this.clearRenewTimer(),!this.autoRenewEnabled()||typeof e!="number"||!Number.isFinite(e))return;let t=e-Date.now();if(t<=0)return;let n=t<fd?t*gd:t-md,o=Math.max(bd,n);this.renewTimer=setTimeout(()=>{this.renewTimer=null,this.autoRenewEnabled()&&this.options.onRequestRelaunch()},o)}ensureContainerPositioned(e){getComputedStyle(e).position==="static"&&(this.restoreContainerPosition=e.style.position,e.style.position="relative")}restoreContainerStyle(){if(this.restoreContainerPosition!==null){try{Qn(this.options.container).style.position=this.restoreContainerPosition}catch{}this.restoreContainerPosition=null}}removeOverlay(){this.overlay?.remove(),this.overlay=null}showError(e){if(this.phase="error",this.clearTimeoutTimer(),!this.loadingStateEnabled())return;let t;try{t=Qn(this.options.container)}catch{return}this.renderOverlay(t,"error",e)}handleTryAgain(){if(this.options.onRequestRelaunch){this.options.onRequestRelaunch();return}this.mount()}renderOverlay(e,t,n){this.removeOverlay();let o=document.createElement("div");o.setAttribute("data-seatlayer-designer-overlay",t),o.setAttribute("role",t==="error"?"alert":"status"),o.setAttribute("aria-live","polite"),Object.assign(o.style,{position:"absolute",inset:"0",display:"flex",alignItems:"center",justifyContent:"center",background:"#101625",color:"#e6ebf5",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif',zIndex:"2",overflow:"hidden"}),t==="loading"?this.buildSkeleton(o):this.buildErrorCard(o,n??"load"),e.append(o),this.overlay=o}buildSkeleton(e){let t=document.createElement("style");t.textContent=`
3232
3236
  @media (prefers-reduced-motion: no-preference) {
3233
3237
  @keyframes seatlayer-designer-shimmer {
3234
3238
  0% { background-position: -320px 0; }
@@ -3238,9 +3242,9 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default;text-decoration-color:t
3238
3242
  animation: seatlayer-designer-shimmer 1.25s ease-in-out infinite;
3239
3243
  background-size: 640px 100%;
3240
3244
  }
3241
- }`,e.append(t);let n="linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.10) 37%, rgba(255,255,255,0.04) 63%)",o=document.createElement("div");Object.assign(o.style,{position:"absolute",inset:"0",display:"flex",flexDirection:"column",padding:"16px",gap:"14px",opacity:"0.9"});let s=c=>{let d=document.createElement("div");return d.className="sl-shimmer",Object.assign(d.style,{background:n,borderRadius:"8px"}),Object.assign(d.style,c),d};o.append(s({height:"40px",width:"100%",flex:"0 0 auto"}));let r=document.createElement("div");Object.assign(r.style,{display:"flex",gap:"14px",flex:"1 1 auto",minHeight:"0"}),r.append(s({width:"220px",height:"100%",flex:"0 0 auto"})),r.append(s({flex:"1 1 auto",height:"100%"})),o.append(r),e.append(o);let a=document.createElement("div");Object.assign(a.style,{position:"relative",zIndex:"1",display:"flex",alignItems:"center",gap:"10px",padding:"10px 16px",borderRadius:"999px",background:"rgba(16, 22, 37, 0.72)",fontSize:"13px",fontWeight:"500",letterSpacing:"0.01em"});let l=document.createElement("span");l.className="sl-shimmer",Object.assign(l.style,{width:"9px",height:"9px",borderRadius:"50%",background:n,flex:"0 0 auto"}),a.append(l),a.append(document.createTextNode("Loading designer\u2026")),e.append(a)}buildErrorCard(e,t){let n=xd[t],o=document.createElement("div");Object.assign(o.style,{maxWidth:"420px",margin:"0 24px",padding:"28px",textAlign:"center",background:"rgba(255, 255, 255, 0.03)",border:"1px solid rgba(255, 255, 255, 0.08)",borderRadius:"16px",boxShadow:"0 12px 40px rgba(0, 0, 0, 0.35)"});let s=document.createElement("h2");s.textContent=n.title,Object.assign(s.style,{margin:"0 0 8px",fontSize:"17px",fontWeight:"600",color:"#f4f7ff"});let r=document.createElement("p");r.textContent=n.body,Object.assign(r.style,{margin:"0 0 20px",fontSize:"13.5px",lineHeight:"1.5",color:"#aab4c8"});let a=document.createElement("button");a.type="button",a.textContent="Try again",Object.assign(a.style,{appearance:"none",cursor:"pointer",border:"0",borderRadius:"10px",padding:"10px 22px",fontSize:"14px",fontWeight:"600",color:"#101625",background:"#7aa2ff"}),a.addEventListener("click",()=>this.handleTryAgain()),o.append(s,r,a),e.append(o)}};function ai(i,e){let t=document.createElement("div");t.className="sl-loading-state";let n=document.createElement("div");if(n.setAttribute("role",e.busy?"status":"alert"),n.setAttribute("aria-atomic","true"),e.busy){let r=document.createElement("div");r.className="sl-boot-spin",r.setAttribute("aria-hidden","true"),t.append(r)}let o=document.createElement("div");if(o.className="sl-boot-title",o.textContent=e.title,n.append(o),e.description){let r=document.createElement("p");r.className="sl-loading-description",r.textContent=e.description,n.append(r)}t.append(n);let s=null;return e.actionLabel&&(s=document.createElement("button"),s.type="button",s.className="sl-boot-retry",s.textContent=e.actionLabel,t.append(s)),i.replaceChildren(t),s}function ar(i,e){let t=new Set(["chart","objects","resume","availability"]),n=new Map;return new Proxy(Object.create(i),{get(o,s){let r=i,a=Reflect.get(r,s,r);return typeof a!="function"?a:(n.has(s)||n.set(s,t.has(String(s))?async(...l)=>{let c=await At(()=>a.apply(r,l),e,()=>{});if(c.outcome==="loaded")return c.value;if(c.outcome==="error")throw c.error;let d=new Error(c.outcome==="timeout"?"request_timeout":"request_cancelled");throw d.name=c.outcome==="timeout"?"TimeoutError":"AbortError",d}:a.bind(r)),n.get(s))}})}var H=require("@seatlayer/core"),Tn=require("@seatlayer/core/view3d/crossfade/panorama");function lr(i){return!!i&&i.clientWidth>0&&i.scrollWidth>i.clientWidth+1}function Sd(i){return i.some(e=>lr(e))}var sn="data-fit-gone",kd=12;function Jn(i,e,t=lr){if(!i)return 0;for(let n of e)i.classList.remove(n.cls);if(i.querySelectorAll(`[${sn}]`).forEach(n=>{n.removeAttribute(sn),n.hidden=!1}),i.dataset.fit="0",i.clientWidth<=0||!t(i))return 0;for(let n=0;n<e.length;n+=1){let o=e[n];n>0&&i.classList.remove(e[n-1].cls),i.classList.add(o.cls),i.dataset.fit=String(n+1);let s=o.give?o.give(i):!0;if(!t(i))return n+1;if(o.repeat&&o.give){for(let r=1;s&&r<kd;r+=1)if(s=o.give(i),!t(i))return n+1}}return e.length}function Td(i,e="[data-fit-seg]"){let t=[...i.querySelectorAll(e)].filter(n=>!n.hidden);return t.length<2?!1:cr(t[t.length-1])}function Ed(i,e){let t=i.querySelector(e);return t&&!t.hidden?cr(t):!1}function cr(i){let e=i.previousElementSibling;return e instanceof HTMLElement&&e.tagName==="I"&&(e.setAttribute(sn,""),e.hidden=!0),i.setAttribute(sn,""),i.hidden=!0,!0}function Cd(i){if(!i)return!1;let e=(i.getAttribute("aria-label")||i.textContent||"").trim();return e?(i.setAttribute("aria-label",e),i.setAttribute("title",e),!0):!1}function dr(i){if(!i)return 0;let e=i.querySelector(".sl-confirm-cancel"),t=i.querySelector(".sl-confirm-add-t");return Jn(i,[{cls:"sl-fit-track"},{cls:"sl-fit-type"},{cls:"sl-fit-icon",give:()=>Cd(e)}],()=>Sd([e,t]))}function pr(i){return Jn(i,[{cls:"sl-fit-notype",give:e=>Ed(e,"[data-fit-type]")},{cls:"sl-fit-short",give:e=>Td(e),repeat:!0}])}function hr(i){return i?(i.classList.add("sl-fitpill"),Jn(i,[{cls:"sl-fit-p1"},{cls:"sl-fit-p2"},{cls:"sl-fit-p3"}])):0}var Ad=["on-sale","low","sold-out","presale","closed"];function li(i){return i==null?null:typeof i=="number"&&Number.isFinite(i)&&i>=0?i:void 0}function mr(i){return i==null?null:typeof i=="number"&&Number.isFinite(i)&&i>=0?i:void 0}function ur(i){if(i==null)return null;if(typeof i!="object"||Array.isArray(i))return;let e=i,t=e.count,n=e.index;if(typeof n!="number"||!Number.isInteger(n)||n<1||typeof t!="number"||!Number.isInteger(t)||t<n)return;let o=e.remaining;if(o!=null&&(typeof o!="number"||!Number.isInteger(o)||o<0))return;let s={index:n,count:t,remaining:o??null};if(e.id!==void 0){if(typeof e.id!="string"||!e.id.trim())return;s.id=e.id.trim()}if(e.name!==void 0){if(typeof e.name!="string"||!e.name.trim())return;s.name=e.name.trim()}if(e.categoryKey!==void 0){if(e.categoryKey!==null&&(typeof e.categoryKey!="string"||!e.categoryKey.trim()))return;s.categoryKey=e.categoryKey==null?null:e.categoryKey.trim()}for(let r of["startsAt","endsAt"]){if(e[r]===void 0)continue;let a=mr(e[r]);if(a===void 0)return;s[r]=a}return s}function Pd(i){if(i==null)return null;if(typeof i!="object"||Array.isArray(i))return;let e=i;if(!Number.isInteger(e.assignmentVersion)||e.assignmentVersion<0||!Array.isArray(e.channels)||!Array.isArray(e.objects))return;let t=[],n=new Set;for(let r of e.channels){if(!r||typeof r!="object"||Array.isArray(r))return;let a=r,l=typeof a.channelId=="string"?a.channelId.trim():"";if(!l||n.has(l)||!Number.isInteger(a.pricingVersion)||a.pricingVersion<0||!Array.isArray(a.priceOverrides))return;let c=[],d=new Set;for(let p of a.priceOverrides){if(!p||typeof p!="object"||Array.isArray(p))return;let u=p,h=typeof u.categoryKey=="string"?u.categoryKey.trim():"",y=u.tierId===null?null:typeof u.tierId=="string"&&u.tierId.trim()?u.tierId.trim():void 0,g=li(u.price);if(!h||y===void 0||g===void 0||g===null)return;let T=`${h}\0${y??""}`;if(d.has(T))return;d.add(T),c.push({categoryKey:h,tierId:y,price:g})}n.add(l),t.push({channelId:l,pricingVersion:a.pricingVersion,priceOverrides:c})}let o=[],s=new Set;for(let r of e.objects){if(!r||typeof r!="object"||Array.isArray(r))return;let a=r,l=typeof a.label=="string"?a.label.trim():"",c=typeof a.channelId=="string"?a.channelId.trim():"";if(!l||s.has(l)||!n.has(c))return;s.add(l),o.push({label:l,channelId:c})}return{assignmentVersion:e.assignmentVersion,channels:t,objects:o}}function rn(i){if(!i||typeof i!="object"||Array.isArray(i))return null;let e=i,t=Ad.find(d=>d===e.state);if(!t)return null;let n=li(e.fromPrice),o=li(e.previousPrice);if(n===void 0||o===void 0)return null;let s=e.currency==null?null:typeof e.currency=="string"&&e.currency.trim()?e.currency.trim():void 0;if(s===void 0)return null;let r=ur(e.release);if(r===void 0)return null;let a=e.upcoming===void 0?null:ur(e.upcoming);if(a===void 0)return null;let l=[];if(e.prices!=null){if(!Array.isArray(e.prices))return null;let d=[];for(let p of e.prices){if(!p||typeof p!="object"||Array.isArray(p))return null;let u=p,h=typeof u.categoryKey=="string"?u.categoryKey.trim():"";if(!h)return null;let y=li(u.price),g=li(u.previousPrice);if(y==null||g===void 0)return null;let T={categoryKey:h,price:y,previousPrice:g};if(u.offerId!==void 0){if(typeof u.offerId!="string"||!u.offerId.trim())return null;T.offerId=u.offerId.trim()}if(u.offerName!==void 0){if(typeof u.offerName!="string"||!u.offerName.trim())return null;T.offerName=u.offerName.trim()}if(u.remaining!==void 0){if(u.remaining!==null&&(typeof u.remaining!="number"||!Number.isInteger(u.remaining)||u.remaining<0))return null;T.remaining=u.remaining==null?null:u.remaining}for(let w of["startsAt","endsAt"]){if(u[w]===void 0)continue;let v=mr(u[w]);if(v===void 0)return null;T[w]=v}d.push(T)}l=d}let c=Pd(e.channelPricing);return c===void 0?null:{state:t,fromPrice:n,previousPrice:o,currency:s,release:r,upcoming:a,prices:l,channelPricing:c}}function fr(i){return i?.changed!==!1}function gr(i,e){if(!i)return null;let t=null,n=o=>{o!=null&&o>e&&(t===null||o<t)&&(t=o)};for(let o of[i.release,i.upcoming])n(o?.startsAt),n(o?.endsAt);for(let o of i.prices)n(o.startsAt),n(o.endsAt);return t}function an(i){let e={};for(let t of i?.prices??[])e[t.categoryKey]=t.price;return e}function br(i){return i.focusedSection!==null?i.deeperThanSectionFrame===!1?"venue":"section":i.atVenueFit!==void 0?i.atVenueFit?"none":"venue":i.seatsRevealed?"venue":"none"}function yr(i,e,t=[],n=8){let o=e.reduce((r,a)=>!a||a.width<=0||a.height<=0?r:Math.max(r,a.bottom-i.top+n),0),s=t.reduce((r,a)=>!a||a.width<=0||a.height<=0?r:Math.max(r,i.bottom-a.top+n),o>0?n:0);return{top:Math.max(0,Math.ceil(o)),right:0,bottom:Math.max(0,Math.ceil(s)),left:0}}function vr(i){let e=document.createElement("div");e.className="sl-floors on",e.setAttribute("role","group"),e.setAttribute("aria-label",i.tf("picker.chooseLevel","Choose level"));let t=[{id:"",name:i.tf("picker.allLevels","All levels")},...i.floors.map(r=>({id:r.id,name:r.name}))],n=document.createElement("span");n.className="sl-floor-label",n.textContent=`${i.tf("picker.levels","Level")}:`,e.appendChild(n);let o=document.createElement("select");o.className="sl-floor-select",o.setAttribute("aria-label",i.tf("picker.chooseLevel","Choose level"));for(let r of t){let a=document.createElement("option");a.value=r.id,a.textContent=r.name,o.appendChild(a)}let s=i.tf("picker.floorHelp","All levels shows the complete venue. Choose one level to inspect and select its seats.");return o.title=s,o.addEventListener("change",()=>i.onChoose(o.value)),e.appendChild(o),e}function wr(i,e,t){if(!i)return;let n=t?"":e,o=i.querySelector(".sl-floor-select");o&&(o.value=n)}var ln=class{constructor(e){this.el=null;this.current=null;this.collapsed=!1;this.shownAt=0;this.host=e}get summary(){return this.current}adopt(e){this.current=e}get element(){return this.el}show(e){if(e&&e.id!==this.current?.id&&this.host.collapseSheet(),this.current=e,!e){this.el?.remove(),this.el=null,this.host.refreshMinimap();return}this.collapsed=this.host.controller.getRung()==="seats",this.shownAt=Date.now(),this.render(e),this.host.refreshMinimap()}render(e){this.el?.remove(),this.el=null}collapse(){!this.el||this.collapsed||!this.current||(this.collapsed=!0,this.render(this.current))}onView(){if(!(!this.el||this.collapsed||!this.current)){if(this.host.controller.getRung()==="seats"){this.collapse();return}if(Date.now()-this.shownAt<1400){this.coverage()>.25&&this.collapse();return}this.collapse()}}coverage(){let e=this.el,t=this.current,n=this.host.map();if(!e||!t||!n)return 0;let o=this.host.activeFloorObjects().find(v=>v.type==="section"&&v.id===t.id)?.outline;if(!o||o.length<3)return 0;let s=o.map(v=>this.host.controller.worldToScreen(v)),r=s.map(v=>v.x),a=s.map(v=>v.y),l=Math.min(...r),c=Math.min(...a),d=Math.max(...r)-l,p=Math.max(...a)-c;if(d<=0||p<=0)return 0;let u=n.getBoundingClientRect(),h=e.getBoundingClientRect(),y=h.left-u.left,g=h.top-u.top,T=Math.max(0,Math.min(y+h.width,l+d)-Math.max(y,l)),w=Math.max(0,Math.min(g+h.height,c+p)-Math.max(g,c));return T*w/(d*p)}};var Nt=require("@seatlayer/core"),Kr=require("@seatlayer/core/core/color");var Ue=require("@seatlayer/core");function eo(i,e,t){try{return new Intl.DateTimeFormat(e,{...t,...i.timezone?{timeZone:i.timezone}:{}}).format(new Date(i.startsAt))}catch{return new Date(i.startsAt).toLocaleString(e)}}var cn=(i,e)=>eo(i,e,{dateStyle:"medium"}),dn=(i,e)=>eo(i,e,{timeStyle:"short"}),pn=(i,e)=>eo(i,e,{weekday:"short",day:"numeric",month:"short"});function xr(i,e,t,n){return!i.length||i.length>=e?null:{summary:n,labels:i.map(o=>`${cn(o,t)} \xB7 ${dn(o,t)}`)}}function Ld(i,e){let t=new Set(e);return i.map(n=>({...n,free:!t.has(n.eventKey)}))}function Sr(i,e){let t=[...i];if(t.length<=1)return t[0]??"";try{return new Intl.ListFormat(e,{style:"long",type:"conjunction"}).format(t)}catch{return t.join(", ")}}function Md(i,e,t="",n=!1){if(!i.length)return"";let o=i.map(s=>{let r=s.free?e.free:e.blocked,a=n&&s.free?`<input class="sl-night-choice" type="checkbox" data-pg-event-key="${E(s.eventKey)}" aria-label="${E(`${s.shortDate}: ${r}`)}" checked>`:"";return`<li class="sl-night${s.free?" ok":" no"}" aria-label="${E(`${s.shortDate}: ${r}`)}">`+a+`<i class="sl-night-dot" aria-hidden="true"></i><span class="d">${E(s.shortDate)}</span><span class="st">${E(r)}</span></li>`}).join("");return`<div class="sl-tip-nights"><div class="sl-tip-nights-title">${E(e.title)}</div><ul class="sl-nightstrip">${o}</ul><p class="sl-tip-nights-note">${E(e.notAvailableOn)}</p>`+t+"</div>"}function Hd(i){return i.selectPartialLabel&&i.pinned?`<button type="button" class="sl-tip-switch" data-pg-select-partial>${E(i.selectPartialLabel)}</button>`:i.switchLabel&&i.pinned?`<button type="button" class="sl-tip-switch" data-pg-switch-mode>${E(i.switchLabel)}</button>`:i.switchLabel||i.selectPartialLabel?"":`<p class="sl-tip-advice">${E(i.advice)}</p>`}function Rd(i){return Number(i.available)+Number(i.selected)+Number(i.partial)+Number(i.unavailable)}function kr(i,e,t){if(Rd(i)<2)return"";let n=(s,r,a="")=>`<li class="sl-pg-legend-item"><i class="sl-pg-sw ${s}"${a}></i>${E(r)}</li>`,o=[];return i.available&&o.push(n("sl-pg-sw-free",e.available,` style="background:${E(t)}"`)),i.selected&&o.push(n("sl-pg-sw-sel",e.selected)),i.partial&&o.push(n("sl-pg-sw-split",e.partial,` style="--sl-pg-sw-cat:${E(t)}"`)),i.unavailable&&o.push(n("sl-pg-sw-off",e.unavailable)),`<ul class="sl-pg-legend-list" aria-label="${E(e.title)}">${o.join("")}</ul>`}function Tr(i,e){if(!i.length)return"";let t=i.map(n=>{let o=n.labels.length?n.labels.join(", "):e.empty;return`<li class="sl-pg-night-row${n.labels.length?"":" empty"}${n.active?" active":""}" role="button" tabindex="0"${n.active?' aria-current="true"':""} data-event-key="${E(n.eventKey)}"><span class="n">${E(n.name)}</span><span class="s">${E(o)}</span></li>`}).join("");return`<div class="sl-pg-nights" role="group" aria-label="${E(e.title)}"><div class="sl-pg-nights-title">${E(e.title)}</div><ul class="sl-pg-nights-list">${t}</ul></div>`}function to(i,e){if(i?.kind!=="partial"||!e?.length)return null;let t=i.data?.blockedEventKeys??[],n=Ld(e,t);return{states:n,missing:n.filter(o=>!o.free).map(o=>o.shortDate)}}function Er(i,e){return i?Md(i.states,{title:b("picker.group.partlyAvailableTitle","Free on some nights only"),free:b("picker.group.nightFree","Free"),blocked:b("picker.group.nightBlocked","Not available"),notAvailableOn:(0,Ue.t)("picker.group.notAvailableOn",{dates:Sr(i.missing,e.locale)})},Hd({switchLabel:e.switchLabel??null,selectPartialLabel:e.selectPartialLabel??null,pinned:e.pinned,advice:b("picker.group.pickSeatFreeEveryNight","Pick a seat that is free every night.")}),!!e.selectPartialLabel&&!!e.pinned):""}function Id(i,e,t,n){if(!i.length)return"";let o=new Set(e),s=new Set(t),r=i.map(a=>{let l=o.has(a.eventKey);return`<li class="sl-confirm-date${l?"":" blocked"}"><label><input type="checkbox" data-pg-confirm-event-key="${E(a.eventKey)}" aria-label="${E(`${a.shortDate}: ${l?n.available:n.unavailable}`)}"${l&&s.has(a.eventKey)?" checked":""}${l?"":" disabled"}><span class="sl-confirm-date-label">${E(a.shortDate)}</span><span class="sl-confirm-date-state">${E(l?n.available:n.unavailable)}</span></label></li>`}).join("");return`<fieldset class="sl-confirm-dates" data-pg-confirm-dates><legend>${E(n.title)}</legend><p class="sl-confirm-dates-copy">${E(n.copy)}</p><label class="sl-confirm-date-all"><input type="checkbox" data-pg-confirm-all><span>${E(n.selectAll)}</span></label><ul>${r}</ul><p class="sl-confirm-dates-summary" data-pg-confirm-summary aria-live="polite"></p></fieldset>`}function Cr(i,e,t,n){let o=e.availableEventKeys(t);return Id(i,o,e.includedEventKeys(),{title:n("picker.group.confirmDatesTitle","Choose performance dates"),copy:o.length===i.length?n("picker.group.confirmAllDatesCopy","This seat is available for all {count} dates. Keep all selected, or remove dates you do not want.").replace("{count}",String(i.length)):n("picker.group.confirmPartialDatesCopy","This seat is available for {available} of {total} dates. Choose one date or keep every available date.").replace("{available}",String(o.length)).replace("{total}",String(i.length)),selectAll:n("picker.group.confirmSelectAll","Select all available dates"),available:n("picker.group.nightFree","Available"),unavailable:n("picker.group.nightBlocked","Unavailable")})}function Ar(i){return[...i.querySelectorAll("[data-pg-confirm-event-key]")].filter(e=>e.checked&&!e.disabled).map(e=>e.dataset.pgConfirmEventKey).filter(Boolean)}function Pr(i,e,t,n){let o=[...i.querySelectorAll("[data-pg-confirm-event-key]")];if(!e||!o.length)return;let s=i.querySelector(".sl-confirm-add"),r=i.querySelector("[data-pg-confirm-all]"),a=()=>{let l=o.filter(p=>!p.disabled),c=Ar(i).length;r&&(r.checked=c===l.length,r.indeterminate=c>0&&c<l.length);let d=i.querySelector("[data-pg-confirm-summary]");d&&(d.textContent=c===l.length?t("picker.group.confirmAllSelected","All {count} available dates are selected.").replace("{count}",String(c)):t("picker.group.confirmSelectedOfAvailable","{selected} of {available} available dates selected.").replace("{selected}",String(c)).replace("{available}",String(l.length))),s.disabled=c===0,s.textContent=c?e.label(c):t("picker.group.confirmChooseOne","Choose at least 1 date"),n()};o.forEach(l=>l.addEventListener("change",a)),r?.addEventListener("change",()=>{o.filter(l=>!l.disabled).forEach(l=>{l.checked=r.checked}),a()}),a()}async function Lr(i,e,t){if(!i||!t||!i.querySelector("[data-pg-confirm-event-key]"))return!0;let n=Ar(i);if(!n.length)return!1;let o=i.querySelector(".sl-confirm-add");return o?.setAttribute("aria-busy","true"),o&&(o.disabled=!0),await t.apply(e,n)?!0:(o?.removeAttribute("aria-busy"),o?.isConnected&&(o.disabled=!1),!1)}function Mr(i,e,t){return i?(0,Ue.t)("picker.group.seatPartlyAvailable",{label:e,free:i.states.length-i.missing.length,total:i.states.length,dates:Sr(i.missing,t)}):""}function Hr(i,e){let t=i.map((n,o)=>{let s=n.state==="done"?e.done:n.state==="current"?e.current:e.upcoming;return`<li class="sl-pg-step-item" data-step="${E(n.id)}" data-state="${E(n.state)}"${n.state==="current"?' aria-current="step"':""}><span class="i" aria-hidden="true">${n.state==="done"?"\u2713":String(o+1)}</span><span class="l">${E(n.label)}</span><span class="sl-pg-sr">${E(s)}</span></li>`}).join("");return`<ol class="sl-pg-steps" aria-label="${E(e.label)}">${t}</ol>`}function io(i,e){return`<ul class="sl-pg-cards">${i.map(n=>`<li class="sl-pg-card" data-event-key="${E(n.eventKey)}"><span class="n">${E(n.name)}</span><time datetime="${E(n.iso)}"><span class="d">${E(n.date)}</span><span class="t">${E(n.time)}</span></time></li>`).join("")}</ul><p class="sl-pg-included">${E(e)}</p>`}function Rr(i){let e=i.rows.map(t=>`<li class="sl-pg-pane-row${t.labels.length?"":" empty"}" data-event-key="${E(t.eventKey)}"><span class="n">${E(t.name)}</span><span class="s">${E(t.labels.length?t.labels.join(", "):i.empty)}</span></li>`).join("");return`<div class="sl-pg-pane-title">${E(i.title)}</div><ul class="sl-pg-pane-list">${e}</ul>`+(i.note?`<p class="sl-pg-pane-note">${E(i.note)}</p>`:"")+(i.total?`<div class="sl-pg-pane-total"><span>${E(i.total.label)}</span><b>${E(i.total.amount)}</b></div>`:"")+(i.holdStatus?`<p class="sl-pg-hold-status" role="status">${E(i.holdStatus)}</p>`:"")}function Ir(i){let e=Math.max(0,i);return`${Math.floor(e/6e4)}:${String(Math.floor(e/1e3)%60).padStart(2,"0")}`}function Or(i,e){if(!i||i.seats<=0)return"";if(e==="same_seat"){let t=i.perPerformance??i.seats;return i.totalPerformances&&i.performances<i.totalPerformances?(0,Ue.tCount)("picker.group.performancesChosenOf",t,{chosen:i.performances,total:i.totalPerformances}):(0,Ue.tCount)("picker.group.seatsEveryPerformance",t)}return i.perPerformance!=null&&i.performancesChosen===i.performances?(0,Ue.tCount)("picker.group.seatsPerPerformance",i.seats,{per:i.perPerformance}):(0,Ue.tCount)("picker.group.performancesChosenOf",i.seats,{chosen:i.performancesChosen,total:i.performances})}function _r(i,e){i.querySelectorAll(".sl-pg-night-row[data-event-key]").forEach(t=>{let n=()=>e(t.dataset.eventKey);t.addEventListener("click",n),t.addEventListener("keydown",o=>{o.key!=="Enter"&&o.key!==" "||(o.preventDefault(),n())})})}var Nr=require("@seatlayer/core");function qe(i){return String(i??"\u2014").replace(/[&<>"]/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[e])}function Od(i,e){let t=i.objectType==="table"&&!!i.bookingMode,n=i.objectType==="booth",o=t||n||!i.seatNumber,s=o?i.rowLabel??i.displayLabel??i.label:i.seatNumber,r=t?`${b("picker.guests","Guests")} ${i.bookingMode==="variable"?`${i.minOccupancy}\u2013${i.maxOccupancy}`:i.capacity}`:!n&&i.rowLabel?`${e} ${Q(i)??""}`.trim():"";return`<div class="sl-tip-head"><div class="sl-tip-id"><span class="sl-tip-seat${o?" name":""}">${qe(s)}</span>`+(r?`<span class="sl-tip-row">${qe(r)}</span>`:"")+"</div>"+(i.sectionLabel?`<div class="sl-tip-sec"><span class="sl-tip-eyebrow">${b("picker.section","Section")}</span><span class="sl-tip-secname">${qe(i.sectionLabel)}</span></div>`:"")+"</div>"}function Dr(i,e){let t=i.status==="not_for_sale",n=i.mark?.kind==="partial",o=i.status==="free"||n?"":`<span class="sl-tip-tag">${t?b("picker.notAvailable","Not available"):i.status==="held"?(0,Nr.t)("map.statusHeld"):b("picker.sold","Sold")}</span>`,s=t?"":e.price,r=s?`<span class="sl-tip-amt">${qe(s)}</span>`:"",a=!s&&e.priceNote?`<div class="sl-tip-note">${qe(e.priceNote)}</div>`:"",l=tt(i,{compact:!0}),c=e.reason?`<div class="sl-tip-reason">${qe(e.reason)}</div>`:"";return'<i class="sl-tip-rail" aria-hidden="true"></i>'+Od(i,e.rowTypeWord)+`<div class="sl-tip-cat"><span class="sl-tip-dot" style="background:${qe(i.categoryColor)}"></span><span class="sl-tip-name">${qe(i.categoryLabel)}</span>`+o+r+"</div>"+a+c+l+(e.extra??"")}function Br(i,e,t,n){let o=i.x+14,s=i.y-n.height-12,r=i.y+18,a=s;o+n.width>e-8&&(o=i.x-n.width-14),s<8&&r+n.height<=t-8&&(a=r);let l=Math.max(8,t-n.height-8);return{left:Math.max(8,Math.min(o,Math.max(8,e-n.width-8))),top:Math.max(8,Math.min(a,l))}}function Fr(i,e,t,n=22){let o=Math.max(8,Math.min(i.x-t.width/2,Math.max(8,e.width-t.width-8))),s=i.y-n-t.height,r=i.y+n;return s>=8?{left:o,top:s,placement:"above"}:r+t.height<=e.height-8?{left:o,top:r,placement:"below"}:{left:o,top:Math.max(8,Math.min(s<8?r:s,Math.max(8,e.height-t.height-8))),placement:s<8?"below":"above"}}var no=14,_d=12,Nd=12,Dd=8;function Vr(i,e,t,n=_d){let o=e.height-no-t.height,s=Nd,r=o-n;if(r<=s)return{placement:"sheet",nudgeY:0};let a=(s+r)/2-i;return Math.abs(a)<=Dd?{placement:"sheet",nudgeY:0}:{placement:"sheet",nudgeY:Math.round(a)}}function zr(i,e,t,n,o=0){let s=t.width/2+12,r=Math.max(s,Math.min(e.width-s,i.x)),a=i.y+o+t.height+24<=e.height,l=i.y-o<t.height+24&&a?"below":"above",c=l==="above"?i.y-o:i.y+o,d=n&&l==="above"?Math.max(t.height+24,c):c;return{left:r,top:Math.max(8,Math.min(e.height-8,d)),placement:l}}function $r(i,e,t){let n=i.querySelector("[data-pg-select-partial]"),o=[...i.querySelectorAll("[data-pg-event-key]")],s=()=>o.filter(a=>a.checked).map(a=>a.dataset.pgEventKey).filter(Boolean),r=()=>{if(!n)return;let a=s().length;n.disabled=a===0,n.textContent=e?.(a)??n.textContent};o.forEach(a=>{a.addEventListener("change",r);let l=a.closest(".sl-night");l?.classList.add("selectable"),l?.addEventListener("click",c=>{c.target!==a&&(a.checked=!a.checked,r())})}),n?.addEventListener("click",()=>{let a=s();a.length&&t?.(a)})}function rt(i){let e=i?.displayType?.trim()||i?.rowType?.trim();return e||(i?.objectType==="table"?b("picker.table","Table"):i?.objectType==="booth"?b("picker.booth","Booth"):b("picker.row","Row"))}var Bd="sl-confirm-scrim",Fd="--sl-scrim-mask";function Vd(i){let e=Math.round(i.x),t=Math.round(i.y);return`radial-gradient(circle at ${e}px ${t}px, transparent 0 56px, #000 88px)`}function jr(i,e,t,n){let o=i??document.createElement("div");return i||(o.className=Bd),o.style.setProperty(Fd,Vd(n)),t.parentNode===e?o.nextSibling!==t&&e.insertBefore(o,t):o.parentNode!==e&&e.appendChild(o),o}function oo(i){return i?.remove(),null}var Gr={passport:!1,compare:!1},zd=360,$d=160,jd=700,Ur=450;function qr(){try{return globalThis.matchMedia?.("(pointer: coarse)").matches??!1}catch{return!1}}function Gd(i){return(0,Kr.contrastRatio)("#ffffff",i)>=3?"#ffffff":"#0b0f19"}var hn=class{constructor(e){this.el=null;this.seat=null;this.outsideTap=null;this.scrim=null;this.shownAt=0;this.lift=null;this.framing=null;this.mode="add";this.host=e}get element(){return this.el}set element(e){this.el=e}get candidate(){return this.seat}set candidate(e){this.seat=e}thumbHtml(e){let t=this.host.controller.doc;if(!t)return"";let n=_t(e)?e.viewUrl??"":"",o=en(t);if(!n&&!o)return"";let s=n?null:tn(e,e.focalPoint??t.focalPoint);if(!n&&s==null)return"";let r="";if(!n)return r;let a=B((0,Nt.t)("picker.viewFromSeat",{label:e.label})),l=B(this.host.tf("picker.viewFromHere","View from here"));return`<button type="button" class="sl-confirm-view sl-confirm-thumbwrap" aria-label="${a}"><img class="sl-confirm-thumb" alt="" /><span class="sl-confirm-thumb-badge">\u{1F52D} ${l}</span></button>`+r}show(e,t="add"){let n=this.host;this.mode=t;let o=this.seat?.id;this.el?.remove(),this.el=null,this.seat=e,n.root()?.setAttribute("data-confirming","true"),n.els().side?.toggleAttribute("inert",!0),Object.values(n.regions()).forEach(C=>C.toggleAttribute("inert",!0)),n.controller.setSelectionFocus(e.id),o&&o!==e.id&&n.controller.deselect([o]),n.hideTooltip();let s=n.controller.seatDetails(e.id),r=n.controller.doc?.categories.find(C=>C.key===e.categoryKey),a=s?.price??(r?.tiers?.length?r.tiers[0].price:r?.price),l=a!=null?n.paidPrice(e.categoryKey,s?.tierId??r?.tiers?.[0]?.id??null,a,e.label):void 0,c=is(s,e.displayLabel??e.label,rt(s)),d=s?.tiers??r?.tiers??[],p=s?.tierId??d[0]?.id,u=n.suppressPricing()?"":rs(d,p,C=>n.money(n.paidPrice(e.categoryKey,C.id,C.price,e.label))),h=n.buyerView()==="venue3d",y=n.performanceGroup()?.confirmDateSelection??void 0,g=y?n.performanceGroup()?.nights?.()??[]:[],T=y?Cr(g,y,e.id,(C,_)=>n.tf(C,_)):"";this.shownAt=performance.now();let w=document.createElement("div");w.className="sl-confirm sl-mo-in",t==="remove"&&w.classList.add("sl-confirm-removing"),T&&w.classList.add("sl-confirm-group-dates"),w.setAttribute("role","dialog"),w.setAttribute("aria-label",(0,Nt.t)("picker.confirmSeatLabel",{label:e.label}));let v=n.controller.getRenderer?.()?.categoryDisplayColor?.(e.categoryKey)??r?.color??"#6e7bff";w.style.setProperty("--sl-cat",v),w.style.setProperty("--sl-cat-ink",Gd(v));let A=String(s?.categoryLabel??r?.label??e.categoryKey),D=n.controller.categoryAvailability()[e.categoryKey],K=typeof D=="number"&&D>0?(0,Nt.tCount)("picker.leftCount",D):"",f=n.suppressPricing()?`${s?.displayLabel??e.displayLabel??e.label}`:`${s?.displayLabel??e.displayLabel??e.label} \xB7 ${l==null?n.tf("picker.priceNotSupplied","Price not supplied"):n.money(l)}`,L=Gr.passport?ts(e,f,h):"",N=Gr.compare?es(e,h?n.view3dCompareSeatIds():null):"";w.innerHTML=as({identityFields:c,identity:ns(s,e.displayLabel??e.label,rt(s)),marker:Jo({...s?.wheelchairSpaceType?{wheelchairSpaceType:s.wheelchairSpaceType}:{}}),see3dPill:os(n.canOffer3d(),h),categoryColor:v,categoryLabel:A,priceLabel:!n.suppressPricing()&&l!=null?n.money(l):"",categoryLeftLabel:K,tierChoices:u,groupDates:T,wheelchair:"",commercial:tt({...e.accessibility?.length?{accessibility:e.accessibility}:{},...s?.wheelchairSpaceType?{wheelchairSpaceType:s.wheelchairSpaceType}:{},...e.commercial?{commercial:e.commercial}:{}}),thumb:n.seatViewEnabled()&&n.buyerView()!=="venue3d"?this.thumbHtml(e):"",inspect:h?`<div class="sl-confirm-inspect-row">${L}${N}${_n(n.canOffer3d(),h)}</div>`:_n(n.canOffer3d(),h),see3dRow:ss(n.canOffer3d(),h),cancelLabel:(0,Nt.t)("common.cancel"),selectLabel:t==="remove"?n.tf("picker.removeSeat","Remove seat"):n.addSeatLabel(s?.objectType)}),t==="remove"&&w.querySelector(".sl-confirm-add svg path")?.setAttribute("d","M6 6l12 12M18 6L6 18"),n.els().map.appendChild(w),this.el=w;let R=w.querySelector(".sl-confirm-thumb"),O=R?.closest(".sl-confirm-thumbwrap")??null;if(R&&O){let C=!1,_=()=>{if(C||!O.isConnected)return;C=!0;let G=()=>{O.remove(),this.el===w&&n.reanchor()};if(n.reducedMotion()||typeof requestAnimationFrame!="function"){G();return}O.style.height=`${O.offsetHeight}px`,O.classList.add("sl-confirm-thumb-out"),requestAnimationFrame(()=>{O.style.height="0px",O.style.opacity="0"}),setTimeout(G,$d)};R.addEventListener("error",_),R.addEventListener("load",()=>{R.naturalWidth||_()});let U=e.viewMeta?.previewUrl??e.viewUrl;U?n.resolveAssetUrl(U).then(G=>{if(!(!w.isConnected||this.el!==w)){if(!G){_();return}R.src=G}}).catch(G=>{_(),n.onError(G)}):_()}n.reanchor(),this.liftSeatClearOfSheet(e),w.querySelector(".sl-confirm-view")?.addEventListener("click",()=>{n.openSeatView(e)}),w.querySelector(".sl-confirm-confidence")?.addEventListener("click",C=>{n.openSeatConfidencePassport(e,C.currentTarget instanceof HTMLElement?C.currentTarget:null)}),w.querySelector(".sl-confirm-compare")?.addEventListener("click",()=>n.saveView3dComparisonSeat(e)),w.querySelectorAll("[data-confirm-tier]").forEach(C=>{C.addEventListener("click",()=>{let _=C.dataset.confirmTier,U=d.find(de=>de.id===_);if(!U)return;n.controller.setSeatTier(e.id,U.id),w.querySelectorAll("[data-confirm-tier]").forEach(de=>{de.setAttribute("aria-pressed",String(de===C))});let G=w.querySelector(".sl-confirm-price");G&&(G.textContent=n.money(n.paidPrice(e.categoryKey,U.id,U.price,e.label))),n.reanchor()})}),w.querySelectorAll(".sl-confirm-3d,.sl-confirm-3dpill,.sl-confirm-3drow").forEach(C=>{C.addEventListener("pointerdown",Ci,{once:!0}),C.addEventListener("click",()=>{n.buyerView()==="venue3d"?(n.dismiss(),n.view3dHandle()?.flyToSeat(e.id)):(n.rememberView3dReturnSeat(e),n.dismiss(),n.enter3d(e.id))})}),Pr(w,y,(C,_)=>n.tf(C,_),()=>n.reanchor()),w.querySelector(".sl-confirm-add").addEventListener("click",()=>{if(!this.ghostActivation()){if(this.mode==="remove"){this.removeCommitted();return}this.commit()}}),w.querySelector(".sl-confirm-cancel").addEventListener("click",()=>{this.ghostActivation()||this.cancel()}),this.armOutsideTap(w),requestAnimationFrame(()=>{let C=w.querySelector(".sl-confirm-add");C?.focus(),n.liftToastOverConfirm(),n.fitTranslatedRows(),n.inviteCommit(w,C)})}liftSeatClearOfSheet(e){let t=this.host.controller.getRenderer();this.framing={gestures:t?.getCameraGestureCount?.()??0,quietUntil:0},this.frameSeatForSheet(e)}frameSeatForSheet(e){let t=this.host,n=t.root();if(!this.el||n?.dataset.layout!=="narrow"||n?.dataset.view3d==="on")return;let o=t.els().map;if(!o)return;let s=t.controller.worldToScreen({x:e.x,y:e.y}),r=t.controller.getRenderer(),a=r?.getCameraGestureCount?.()??0,{nudgeY:l}=Vr(s.y,{height:o.clientHeight},{height:this.el.offsetHeight||230}),c=this.lift&&this.lift.gestures===a?this.lift.dy:0;if(!l){this.lift=c?{dy:c,gestures:a}:null;return}let d=!t.reducedMotion();r?.panScreenBy?.({x:0,y:l},{animate:d}),this.lift={dy:c+l,gestures:a},this.framing&&(this.framing.gestures=a,this.framing.quietUntil=d?this.now()+jd:0)}reframeSeatForSheet(){let e=this.framing,t=this.seat;!e||!t||e.quietUntil&&this.now()<e.quietUntil||(this.host.controller.getRenderer()?.getCameraGestureCount?.()??e.gestures)!==e.gestures||this.frameSeatForSheet(t)}now(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}settleLift(){let e=this.lift;if(this.lift=null,this.framing=null,!e)return;let t=this.host.controller.getRenderer();(t?.getCameraGestureCount?.()??e.gestures)===e.gestures&&t?.panScreenBy?.({x:0,y:-e.dy},{animate:!this.host.reducedMotion()})}reanchor(){let e=this.host;if(!this.el||!this.seat||e.root()?.dataset.view3d==="on")return;let t=e.controller.worldToScreen({x:this.seat.x,y:this.seat.y}),n=e.els().map;if(e.root()?.dataset.layout==="narrow"){this.el.removeAttribute("data-placement"),this.el.style.removeProperty("bottom"),this.scrim=jr(this.scrim,n,this.el,t),ks(this.el,t,n),e.liftToastOverConfirm(),this.reframeSeatForSheet();return}this.scrim=oo(this.scrim);let o=n.clientWidth,s=n.clientHeight,r=this.el.offsetWidth||276,a=this.el.offsetHeight||230,l=this.el.classList.contains("sl-confirm-group-dates"),c=e.controller.seatScreenRadius()*1.5,d=zr(t,{width:o,height:s},{width:r,height:a},l,c);this.el.dataset.placement=d.placement,this.el.style.left=`${d.left}px`,this.el.style.top=`${d.top}px`,Vi(this.el,t,{left:d.left,top:d.top,width:r,height:a})}ghostActivation(){return qr()?performance.now()-this.shownAt<Ur:!1}armOutsideTap(e){this.disarmOutsideTap();let t=this.host,n=s=>{if(this.el!==e){this.disarmOutsideTap();return}let r=s.target;!r||e.contains(r)||t.els().tray?.contains(r)||this.cancel()};this.outsideTap=n;let o=t.root();setTimeout(()=>{this.outsideTap===n&&(o??document).addEventListener("pointerdown",n,!0)},qr()?Ur:0)}disarmOutsideTap(){if(!this.outsideTap)return;let e=this.outsideTap;this.outsideTap=null,(this.host.root()??document).removeEventListener("pointerdown",e,!0),document.removeEventListener("pointerdown",e,!0)}dismiss(){let e=this.host;this.disarmOutsideTap(),this.scrim=oo(this.scrim),this.settleLift(),this.el&&zi(this.el),this.el=null,this.seat=null,e.liftToastOverConfirm(),e.root()?.removeAttribute("data-confirming"),Object.values(e.regions()).forEach(t=>t.toggleAttribute("inert",!1)),e.applyPanelCollapsed(),e.controller.setSelectionFocus(null),e.syncTray()}async commit(){let e=this.host,t=this.seat;if(!t)return;let o=this.el?.querySelector(".sl-confirm-add")??null;if(o?.classList.contains("is-adding")||!await Lr(this.el,t.id,e.performanceGroup()?.confirmDateSelection??void 0))return;e.collapseSectionCard(),this.seat=null,e.syncTray(),e.syncSelectionTo3d();let s=()=>{let l=e.root()?.dataset.layout==="narrow"?this.lift:null;l&&(this.lift=null),e.dismiss();let c=e.controller.worldToScreen(t);Kn(e.els(),c,t,e.controller.doc?.categories,()=>{e.cartLanded?.(),l&&(this.lift=l,this.settleLift())})};if(!o||e.reducedMotion()){s();return}o.classList.remove("sl-confirm-add-invite"),o.classList.add("is-adding"),o.setAttribute("aria-disabled","true");let r=o.querySelector(".sl-confirm-add-t");r&&(r.textContent=e.tf("picker.added","Added")),e.scheduleMotion(s,zd)}cancel(){let e=this.host,t=this.seat;t&&(this.mode!=="remove"&&e.controller.deselect([t.id]),this.seat&&e.dismiss(),e.syncSelectionTo3d(),e.root()?.focus({preventScroll:!0}))}removeCommitted(){let e=this.host,t=this.seat;if(!t)return;let n=e.releaseHeldSeat(t);n||e.controller.deselect([t.id]),e.dismiss(),e.syncTray(),e.syncSelectionTo3d(),e.root()?.focus({preventScroll:!0})}};function Wr(i,e,t){if(!e||t||i.classList.contains("sl-confirm-removing"))return;e.classList.add("sl-confirm-add-invite");let n=()=>e.classList.remove("sl-confirm-add-invite");i.addEventListener("pointerdown",n,{once:!0}),i.addEventListener("keydown",n,{once:!0}),e.addEventListener("focus",n,{once:!0})}function Yr(i,e){return i&&i!=="seat"?e("picker.select","Select"):e("picker.addSeat","Add seat")}var Xr=require("@seatlayer/core"),Dt=require("@seatlayer/core/picker/minimapGeometry");function Ud(i){let e={inactive:0,available:1,selected:2},t=new Map;for(let o of i){let s=t.get(o.id);(!s||e[o.state]>e[s])&&t.set(o.id,o.state)}let n={selected:0,available:0,inactive:0};for(let o of t.values())n[o]+=1;return n}function qd(i,e){return i.x<=e.x&&i.y<=e.y&&i.x+i.width>=e.x+e.width&&i.y+i.height>=e.y+e.height}function Zr(i,e){let t=new so(i);return t.build(e),t}var so=class{constructor(e){this.host=e;this.miniCanvas=null;this.miniBase=null;this.miniWrap=null;this.miniToggle=null;this.miniLabel=null;this.miniTf=null;this.miniDrag=null;this.miniSuppressClick=!1;this.userClosed=!1}dispose(){this.miniToggle?.remove(),this.miniWrap?.remove(),this.miniToggle=null,this.miniWrap=null,this.miniCanvas=null,this.miniBase=null,this.miniLabel=null,this.miniTf=null,this.miniDrag=null,this.host.root()?.removeAttribute("data-minimap-open")}build(e){if(!this.host.controller.getViewport())return;let n=document.createElement("button");n.type="button",n.className="sl-minimap-toggle",n.setAttribute("aria-label",b("picker.openVenueMap","Open venue overview map")),n.setAttribute("aria-expanded","false"),n.innerHTML='<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M3 6l5-2 8 3 5-2v13l-5 2-8-3-5 2zM8 4v13M16 7v13"/></svg>',e.appendChild(n),this.miniToggle=n;let o=document.createElement("div");o.className="sl-minimap",o.setAttribute("role","group");let s=document.createElement("div");s.className="sl-minimap-bar";let r=document.createElement("span");r.className="sl-minimap-label";let a=document.createElement("span");a.className="sl-minimap-key",a.setAttribute("aria-label",b("picker.minimapStateKey","Focused, selected, available, and inactive sections")),a.innerHTML='<i class="focused" title="Focused"></i><i class="selected" title="Selected"></i><i title="Available"></i><i class="inactive" title="Inactive"></i>';let l=document.createElement("button");l.type="button",l.className="sl-minimap-close",l.setAttribute("aria-label",b("picker.closeVenueMap","Close venue overview map")),l.textContent="\xD7",s.append(r,a,l);let c=document.createElement("canvas");c.tabIndex=0,c.setAttribute("role","application"),c.setAttribute("aria-label",b("picker.venueMapInstructions","Venue overview map. Drag the viewport, click a section, or use arrow keys to pan.")),o.append(s,c),e.appendChild(o),this.miniWrap=o,this.miniLabel=r,this.miniCanvas=c;let d=document.createElement("canvas");this.miniBase=d,n.addEventListener("click",()=>{let p=this.host.root()?.dataset.minimapOpen==="true";this.userClosed=p,this.setMinimapOpen(!p)}),l.addEventListener("click",()=>{this.userClosed=!0,this.setMinimapOpen(!1)}),c.addEventListener("click",p=>{if(this.miniSuppressClick){this.miniSuppressClick=!1;return}this.minimapJump(p)}),c.addEventListener("pointerdown",p=>this.minimapPointerDown(p)),c.addEventListener("pointermove",p=>this.minimapPointerMove(p)),c.addEventListener("pointerup",p=>this.minimapPointerUp(p)),c.addEventListener("pointercancel",p=>this.minimapPointerUp(p)),c.addEventListener("keydown",p=>this.minimapKeydown(p)),this.layoutMinimap(),this.syncMinimapLabel(),this.drawMinimapStatic(),this.drawMinimapRect()}setAutoOpen(e){if(this.miniWrap){if(!e){this.userClosed=!1,this.host.root()?.dataset.minimapOpen==="true"&&this.setMinimapOpen(!1,!1);return}this.userClosed||this.host.root()?.dataset.minimapOpen==="true"||this.setMinimapOpen(!0,!1)}}setMinimapOpen(e,t=!0){this.host.root()?.setAttribute("data-minimap-open",String(e)),this.miniToggle?.setAttribute("aria-expanded",String(e)),t&&(e?this.miniCanvas?.focus():this.miniToggle?.focus())}layoutMinimap(){let e=this.miniCanvas,t=this.miniBase,n=this.host.controller.getViewport()?.bounds;if(!e||!t||!n||!(n.width>0&&n.height>0))return;let o=196,s=146,r=6,a=n.width/Math.max(1,n.height),l=o,c=Math.round(o/a);c>s&&(c=s,l=Math.round(s*a)),l=Math.max(64,l),c=Math.max(48,c);let d=Math.min(2,window.devicePixelRatio||1);e.width=Math.round(l*d),e.height=Math.round(c*d),e.style.width=`${l}px`,e.style.height=`${c}px`,t.width=e.width,t.height=e.height,this.miniTf=(0,Dt.createMinimapTransform)(n,e.width,e.height,d,r)}syncMinimapLabel(){if(!this.miniLabel||!this.miniWrap)return;let e=this.host.controller.getFloors(),t=this.host.controller.isFloorOverview()?b("picker.allFloors","All floors"):e.find(d=>d.id===this.host.controller.getActiveFloorId())?.name??b("picker.venueOverview","Venue overview"),n=this.host.controller.getMinimapSnapshot().sections,s=n.find(d=>d.active)?.label??this.host.focusedSectionLabel(),r=s?`${t} \xB7 ${s}`:t;this.miniLabel.textContent=r;let{selected:a,available:l,inactive:c}=Ud(n);this.miniWrap.setAttribute("aria-label",n.length?`${r}. ${a} selected, ${l} available, ${c} inactive sections.`:r),this.miniCanvas?.setAttribute("aria-label",n.length?`${r}. ${a} selected, ${l} available, ${c} inactive sections. ${b("picker.venueMapInstructions","The outlined region is the visible map area. Drag it, click a section, or use arrow keys to pan.")}`:`${r}. ${b("picker.venueMapInstructions","The outlined region is the visible map area. Drag it, click elsewhere, or use arrow keys to pan.")}`)}refreshMinimap(){this.miniBase&&(this.layoutMinimap(),this.syncMinimapLabel(),this.drawMinimapStatic(),this.drawMinimapRect())}drawMinimapStatic(){let e=this.miniBase,t=this.miniTf;if(!e||!t)return;let n=e.getContext("2d");if(!n)return;n.clearRect(0,0,e.width,e.height);let o=p=>p*t.scale+t.offX,s=p=>p*t.scale+t.offY,r=this.host.cssVar("--sl-line")||"rgba(139,147,167,.5)",a=this.host.cssVar("--sl-muted")||"#8b93a7",l=this.host.cssVar("--sl-accent")||"#6e7bff",c=this.host.cssVar("--sl-success")||"#22a06b",d=this.host.controller.getMinimapSnapshot();for(let p of d.sections){if(p.outline.length<3)continue;n.beginPath(),p.outline.forEach((h,y)=>y===0?n.moveTo(o(h.x),s(h.y)):n.lineTo(o(h.x),s(h.y))),n.closePath();let u=p.paint;if(n.globalAlpha=p.state==="inactive"?.5:.92,u?n.fillStyle=u.fill:(n.globalAlpha=p.state==="inactive"?.18:p.state==="selected"?.72:.34,n.fillStyle=p.state==="inactive"?a:p.state==="selected"?l:c),n.fill(),n.globalAlpha=.82,n.lineWidth=Math.max(1,t.dpr),n.strokeStyle=u?.stroke||r,n.stroke(),p.owned){n.globalAlpha=1,n.lineWidth=Math.max(2,t.dpr*1.5),n.strokeStyle=l,n.stroke();let h=p.outline.reduce((y,g)=>({x:y.x+g.x,y:y.y+g.y}),{x:0,y:0});n.beginPath(),n.arc(o(h.x/p.outline.length),s(h.y/p.outline.length),Math.max(1.5,t.dpr*1.6),0,Math.PI*2),n.fillStyle=l,n.fill(),n.beginPath(),p.outline.forEach((y,g)=>g===0?n.moveTo(o(y.x),s(y.y)):n.lineTo(o(y.x),s(y.y))),n.closePath()}p.active&&(n.globalAlpha=1,n.lineJoin="round",n.lineWidth=Math.max(4,t.dpr*3.5),n.strokeStyle=this.host.cssVar("--sl-surface")||"#fff",n.stroke(),n.lineWidth=Math.max(2,t.dpr*1.75),n.strokeStyle=l,n.stroke())}if(n.globalAlpha=1,!d.sections.length){let p=Math.max(1,t.dpr),u=this.host.controller.getRenderer?.(),h=new Map,y=g=>{let T=h.get(g);if(T)return T;let w=u?.categoryDisplayColor?.(g)||c;return h.set(g,w),w};for(let g of d.seats)n.globalAlpha=g.state==="inactive"?.22:.78,n.fillStyle=g.state==="inactive"?a:g.state==="selected"?l:y(g.categoryKey),n.beginPath(),n.arc(o(g.x),s(g.y),p,0,Math.PI*2),n.fill();n.globalAlpha=1}}drawMinimapRect(){let e=this.miniCanvas,t=this.miniBase,n=this.miniTf;if(!e||!t||!n)return;let o=e.getContext("2d");if(!o)return;o.clearRect(0,0,e.width,e.height),o.drawImage(t,0,0);let s=this.host.controller.getViewport();if(!s||qd(s.visible,s.bounds))return;let r=(0,Dt.minimapViewportPlan)(s.visible,n,e.width,e.height,Math.max(2,n.dpr*2)),a=this.host.cssVar("--sl-text")||"#12151c",l=this.host.cssVar("--sl-surface")||"#fff";o.save(),o.globalAlpha=.1,o.fillStyle=a,o.fillRect(r.raw.x,r.raw.y,r.raw.width,r.raw.height),o.globalAlpha=.9,o.lineJoin="round",o.lineWidth=Math.max(4,n.dpr*3.25),o.strokeStyle=l,o.strokeRect(r.raw.x,r.raw.y,r.raw.width,r.raw.height),o.globalAlpha=1,o.lineWidth=Math.max(2,n.dpr*1.75),o.strokeStyle=a,o.strokeRect(r.raw.x,r.raw.y,r.raw.width,r.raw.height),r.clipped&&Object.values(r.clippedEdges).some(Boolean)&&(o.setLineDash([Math.max(3,n.dpr*3),Math.max(2,n.dpr*2)]),o.strokeRect(r.clipped.x,r.clipped.y,r.clipped.width,r.clipped.height)),o.restore()}minimapWorldPoint(e){let t=this.miniCanvas,n=this.miniTf;if(!t||!n)return null;let o=t.getBoundingClientRect(),s=(e.clientX-o.left)*(t.width/Math.max(1,o.width)),r=(e.clientY-o.top)*(t.height/Math.max(1,o.height));return{...(0,Dt.minimapPointToWorld)({x:s,y:r},n),px:s,py:r}}minimapPointerDown(e){let t=this.minimapWorldPoint(e),n=this.host.controller.getViewport()?.visible;!t||!n||!(t.x>=n.x&&t.x<=n.x+n.width&&t.y>=n.y&&t.y<=n.y+n.height)||(this.miniDrag={pointerId:e.pointerId,offsetX:t.x-(n.x+n.width/2),offsetY:t.y-(n.y+n.height/2),startX:e.clientX,startY:e.clientY,moved:!1},this.miniCanvas?.setPointerCapture(e.pointerId),this.miniCanvas?.classList.add("sl-dragging"),e.preventDefault())}minimapPointerMove(e){let t=this.miniDrag;if(!t||t.pointerId!==e.pointerId)return;let n=this.minimapWorldPoint(e);n&&(!t.moved&&Math.hypot(e.clientX-t.startX,e.clientY-t.startY)>2&&(t.moved=!0,this.host.controller.clearSectionFocus()),this.host.controller.panToWorld({x:n.x-t.offsetX,y:n.y-t.offsetY}),e.preventDefault())}minimapPointerUp(e){let t=this.miniDrag;!t||t.pointerId!==e.pointerId||(this.miniSuppressClick=t.moved,this.miniDrag=null,this.miniCanvas?.classList.remove("sl-dragging"),this.miniCanvas?.hasPointerCapture(e.pointerId)&&this.miniCanvas.releasePointerCapture(e.pointerId))}minimapKeydown(e){let t=this.host.controller.getViewport()?.visible;if(!t)return;if(e.key==="Home"){this.host.controller.overview(),e.preventDefault();return}let n=e.key==="ArrowLeft"?-t.width*.2:e.key==="ArrowRight"?t.width*.2:0,o=e.key==="ArrowUp"?-t.height*.2:e.key==="ArrowDown"?t.height*.2:0;!n&&!o||(this.host.controller.clearSectionFocus(),this.host.controller.panToWorld({x:t.x+t.width/2+n,y:t.y+t.height/2+o}),e.preventDefault())}minimapJump(e){let t=this.minimapWorldPoint(e);if(t){for(let n of this.host.controller.getMinimapSnapshot().sections)if(!(n.state==="inactive"||n.outline.length<3)&&(0,Xr.pointInPolygon)(t,n.outline)){this.host.controller.focusSection(n.id);return}this.host.controller.clearSectionFocus(),this.host.controller.panToWorld(t)}}};var un=require("@seatlayer/core");var Kd=12;function Qr(i,e){let t=e.floors(),n=new Set(t.map(f=>f.label.trim().toLocaleLowerCase())),o=e.zones().filter(f=>f.seatCount>0&&!n.has(f.label.trim().toLocaleLowerCase())),s=e.sections().filter(f=>f.seatCount>0&&!n.has(f.label.trim().toLocaleLowerCase())),r=o.length>1?[]:s,a=t.length>1,l=o.length>1,c=r.length>1;if(!a&&!l&&!c)return null;let d=document.createElement("div");d.className="sl-view3d-nav";let p=null,u=document.createElement("button");u.type="button",u.className="sl-view3d-nav-toggle",u.setAttribute("aria-expanded","false");let h='<svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="12" r="9"/><path d="M15.5 8.5l-2 5-5 2 2-5z"/></svg>',y=document.createElement("span");u.innerHTML=h,u.appendChild(y);let g=()=>{for(let f of d.querySelectorAll(":scope > div")){let L=f.querySelector('[aria-pressed="true"]');!L||f.scrollWidth<=f.clientWidth||L.scrollIntoView({block:"nearest",inline:"nearest"})}},T=()=>{if(p)return p;for(let f of d.querySelectorAll(":scope > div")){let L=f.querySelector('button[aria-pressed="true"]'),N=L?.textContent?.trim();if(N&&L?.dataset.floor!=="")return N}return a&&(l||c)?b("picker.levelsAndAreas","Levels & areas"):a?b("picker.levels","Levels"):b("picker.areas","Areas")},w=f=>{d.classList.toggle("is-open",f),u.setAttribute("aria-expanded",String(f)),f&&typeof requestAnimationFrame=="function"&&requestAnimationFrame(g),y.textContent=T()};u.addEventListener("click",()=>w(!d.classList.contains("is-open"))),d.addEventListener("keydown",f=>{f.key!=="Escape"||!d.classList.contains("is-open")||(f.preventDefault(),f.stopPropagation(),w(!1),u.focus())});let v=document.createElement("button");v.type="button",v.className="sl-view3d-nav-close",v.innerHTML='<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M18 6L6 18M6 6l12 12"/></svg>';let A=b("picker.closeVenueNavigation","Close venue navigation");v.setAttribute("aria-label",A),v.title=A,v.addEventListener("click",()=>{w(!1),u.focus()}),w(!1),d.appendChild(u);let D=f=>{},K=f=>{};if(a){let f=document.createElement("div");f.setAttribute("role","group"),f.setAttribute("aria-label",b("picker.levels","Levels"));let L=[];K=O=>{L.forEach(C=>{C.setAttribute("aria-pressed",String((C.dataset.floor===""?null:Number(C.dataset.floor))===O))})};let N=O=>{e.focusFloor(O)&&(K(O),D(O))},R=(O,C)=>{let _=document.createElement("button");_.type="button",_.textContent=O,_.dataset.floor=C===null?"":String(C),_.setAttribute("aria-pressed",String(C===null)),_.addEventListener("click",()=>{N(C),w(!1)}),L.push(_),f.appendChild(_)};R(b("picker.allLevels","All levels"),null);for(let O of t)R(O.label||(0,un.t)("picker.levelNumber",{number:O.index+1}),O.index);d.appendChild(f)}if(l||c){let f=document.createElement("div");f.setAttribute("role","group"),f.setAttribute("aria-label",b("picker.areas","Areas"));let L=l?o.map(R=>({id:R.id,label:R.label||R.id,go:()=>{e.focusZone(R.id)}})):r.map(R=>({id:R.id,label:R.label||R.id,floorIndex:R.floorIndex,go:()=>{e.focusSection(R.id),Number.isFinite(R.floorIndex)&&K(R.floorIndex)}})),N=R=>{let O=l||R===null?L:L.filter(C=>C.floorIndex===void 0||C.floorIndex===R);if(f.replaceChildren(),!O.length){f.remove();return}if(f.isConnected||d.insertBefore(f,v.isConnected?v:null),!l&&O.length>Kd){let C=document.createElement("select");C.setAttribute("aria-label",b("picker.jumpToSection","Jump to section"));let _=document.createElement("option");_.value="",_.textContent=b("picker.jumpToSection","Jump to section"),C.appendChild(_);for(let U of O){let G=document.createElement("option");G.value=U.id,G.textContent=U.label,C.appendChild(G)}C.addEventListener("change",()=>{O.find(U=>U.id===C.value)?.go()}),f.appendChild(C);return}for(let C of O){let _=document.createElement("button");_.type="button",_.textContent=C.label,_.dataset.area=C.id,_.addEventListener("click",()=>{p=C.label,C.go(),w(!1)}),f.appendChild(_)}};D=N,N(null)}return d.appendChild(v),i.appendChild(d),d}var mn=class{constructor(e){this.host=e;this.chip=null}sync(){let e=this.host.overlay();if(!e||this.host.savedSeatIds().length===0){this.chip?.remove(),this.chip=null;return}let t=this.chip;if(!t){t=document.createElement("div"),t.className="sl-view3d-compare-saved",t.setAttribute("role","group"),t.setAttribute("aria-label",b("picker.savedSeatComparison","Saved seat comparison"));let s=document.createElement("button");s.type="button",s.className="main",s.addEventListener("click",()=>{this.host.savedSeatIds().length>1?this.host.openComparison():this.host.toast(b("picker.chooseAnotherToCompare","Choose another seat to compare."),"neutral")});let r=document.createElement("button");r.type="button",r.className="clear",r.textContent="\xD7",r.setAttribute("aria-label",b("picker.clearSavedSeatComparison","Clear saved seat comparison")),r.addEventListener("click",()=>this.host.clearComparison()),t.append(s,r),e.appendChild(t),this.chip=t}let n=this.host.savedSeatIds().length,o=t.querySelector(".main");o&&(o.textContent=n>1?(0,un.t)("picker.compareCount",{count:n}):b("picker.oneSeatSaved","1 seat saved"),o.setAttribute("aria-label",n>1?(0,un.t)("picker.openComparisonOfSeats",{count:n}):b("picker.oneSeatSavedChooseAnother","One seat saved; choose another to compare")))}remove(){this.chip?.remove(),this.chip=null}mainButton(){return this.chip?.querySelector(".main")??null}};function Jr(i){return!i?.querySelector('[data-ref="zfs"]')}var ea="sl:sheet-hint";function ta(i){let e=i.boot;if(!e?.isConnected)return;if(i.reducedMotion){e.remove();return}e.classList.add("is-going"),setTimeout(()=>e.remove(),200);let t=document.createElement("div");t.className="sl-shells-in",t.setAttribute("aria-hidden","true"),i.map?.appendChild(t),setTimeout(()=>t.remove(),650),i.rail?.classList.add("is-in"),i.root?.classList.add("is-arriving"),setTimeout(()=>{i.rail?.classList.remove("is-in"),i.root?.classList.remove("is-arriving"),Wd(i.root)},900)}function Wd(i){if(!i||i.dataset.layout!=="narrow")return;try{if(window.sessionStorage.getItem(ea))return;window.sessionStorage.setItem(ea,"1")}catch{}let e=i.querySelector(".sl-sheet-toggle");e&&(e.classList.add("sl-mo-hint"),e.addEventListener("animationend",()=>e.classList.remove("sl-mo-hint"),{once:!0}))}function ia(i,e){i.addEventListener("keydown",t=>{if(t.key==="Escape"){for(let n of e())if(n.open()){t.preventDefault(),t.stopPropagation(),n.close();return}}})}function fn(i){let e=i.committedSelection(),t=i.controller.getGAAreas(),n=i.hold?.items??[],o=new Set(n.map(u=>u.label)),s=Ms(i,t,n),r=je(i.gaQty,n),a=n.reduce((u,h)=>u+i.paidPrice(h.categoryKey,h.tierId,h.unitPrice,h.label)*(h.quantity??1),0),l=n.reduce((u,h)=>u+(h.quantity??1),0),c=e.filter(u=>!o.has(u.label)),d=c.reduce((u,h)=>u+i.paidPrice(h.categoryKey,h.tierId??null,h.price,h.label)*(h.quantity??1),0)+s+a,p=c.reduce((u,h)=>u+(h.quantity??1),0)+r+l;return{seats:e,freshSeats:c,gaAreas:t,heldItems:n,heldLabels:o,heldCount:l,total:d,count:p}}function gn(i,e){let t=e.tiers?.length?e.tiers[0].price:e.price;return t===void 0||!e.key?t:i.paidPrice(e.key,e.tiers?.[0]?.id??null,t)}function bn(i,e){let t=e.tiers?.length?e.tiers.map(n=>i.paidPrice(e.key,n.id??null,n.price)):e.price==null?[]:[i.paidPrice(e.key,null,e.price)];if(e.key)for(let n of i.pricesByChannel.values())for(let o of n)o.categoryKey===e.key&&t.push(o.price);return t.length?{min:Math.min(...t),max:Math.max(...t)}:void 0}var ci="seatlayer_";function Yd(){let i=globalThis;return i.document?.modelContext??i.navigator?.modelContext??null}function ye(i,e){return e?{ok:!1,reason:i,message:e}:{ok:!1,reason:i}}function Xd(i){return Array.isArray(i)?i.filter(e=>typeof e=="string"&&!!e):[]}function Zd(i,e){let t=i.event();if(!t)return ye("not_loaded","The seat map has not finished loading.");let n=i.selectionLimits();return{ok:!0,event:t,selection:{max:n.max,...n.required!=null?{required:n.required}:{}},categories:i.categories(),zones:i.zones(),hasPremiumSeats:i.hasPremiumSeats(),holdsAllowed:e}}function na(i,e){let t=o=>!!o&&o.toLowerCase()===e.toLowerCase(),n=i.find(o=>t(o.key??o.id))??i.find(o=>t(o.label));return n?.key??n?.id??null}function oa(i,e){let t=e.map(n=>i.describeSeat(n.id));return{seatIds:e.map(n=>n.id),labels:e.map(n=>n.label),section:t[0]?.section??"",row:t[0]?.row??"",seats:e.map((n,o)=>t[o]?.seat||n.label),category:t[0]?.category??e[0].categoryKey,unitPrice:e[0].price,total:e.reduce((n,o)=>n+o.price,0)}}function Qd(i,e,t){let n=new Map;for(let s of e){let r=n.get(s.rowKey);r?r.push(s):n.set(s.rowKey,[s])}let o=[];for(let s of n.values()){let r=[...s].sort((l,c)=>l.index-c.index),a=0;for(let l=1;l<=r.length;l++)if(l===r.length||r[l].index!==r[l-1].index+1||r[l].categoryKey!==r[l-1].categoryKey){for(let d=a;d+t<=l;d+=t)o.push(oa(i,r.slice(d,d+t)));a=l}}return o}function Jd(i,e,t){let n=new Map;for(let s of e){let r=n.get(s.sectionKey);r?r.push(s):n.set(s.sectionKey,[s])}let o=[];for(let s of n.values()){if(s.length<t)continue;let r=[...s].sort((a,l)=>a.price!==l.price?l.price-a.price:a.rowKey.localeCompare(l.rowKey)||a.index-l.index);o.push(oa(i,r.slice(0,t)))}return o}function ep(i,e){if(!i.event())return ye("not_loaded","The seat map has not finished loading.");let n=i.selectionLimits(),o=Math.floor(Number(e.count));if(!Number.isInteger(o)||o<1||o>n.max)return ye("bad_count",`count must be a whole number between 1 and ${n.max}.`);let s=Number.isInteger(Number(e.limit))?Math.max(1,Math.min(20,Number(e.limit))):5,r=e.together===void 0?!0:!!e.together,a=typeof e.max_price=="number"&&Number.isFinite(e.max_price)?e.max_price:null,l=typeof e.category=="string"&&e.category?e.category:null,c=typeof e.zone=="string"&&e.zone?e.zone:null,d=l?na(i.categories(),l):null;if(l&&!d)return ye("no_match",`No ticket type called "${l}".`);let p=c?na(i.zones(),c):null;if(c&&!p)return ye("no_match",`No zone called "${c}".`);let u=i.seats().filter(g=>g.available);if(!u.length)return ye("sold_out");let h=u.filter(g=>(!d||g.categoryKey===d)&&(!p||g.zoneId===p)&&(a==null||g.price<=a));if(!h.length)return ye("no_match");let y=r?Qd(i,h,o):Jd(i,h,o);return y.length?(y.sort((g,T)=>T.unitPrice!==g.unitPrice?T.unitPrice-g.unitPrice:g.row.localeCompare(T.row)||g.labels[0].localeCompare(T.labels[0])),{ok:!0,groups:y.slice(0,s),searched:{count:o,filters:{...a!=null?{max_price:a}:{},...d?{category:d}:{},...p?{zone:p}:{},together:r}}}):ye(r?"not_enough_together":"no_match")}function sa(i){return{ok:!0,...i.selection()}}function tp(i,e){let t=i.event();if(!t)return ye("not_loaded","The seat map has not finished loading.");if(t.salesClosed)return ye("event_closed","Sales are closed for this event.");let n=Xd(e.seat_ids);return n.length?(i.clearSelection(),i.selectObjects(n),sa(i)):ye("nothing_requested","Pass one or more seat ids or labels in seat_ids.")}function ip(i,e){let t=async o=>{try{return await o()}catch(s){return ye("error",s instanceof Error?s.message:String(s))}},n=[{name:`${ci}describe_event`,title:"Describe this seated event",description:"Read the event, its ticket types with live availability and prices, its zones, and how many seats this buyer may select. Call this first.",inputSchema:{type:"object",properties:{},additionalProperties:!1},annotations:{readOnlyHint:!0,untrustedContentHint:!0},execute:()=>t(()=>Zd(i,e))},{name:`${ci}find_seats`,title:"Find available seats",description:"Search the seat map for groups of available seats. Read-only: it never selects, holds or reserves anything. Returns candidate groups with their seat ids, prices and location.",inputSchema:{type:"object",properties:{count:{type:"integer",minimum:1,description:"How many seats are needed."},max_price:{type:"number",description:"Highest acceptable price per seat."},category:{type:"string",description:"Ticket type key or label to restrict the search to."},zone:{type:"string",description:"Zone id or label to restrict the search to."},together:{type:"boolean",description:"Require the seats to be side by side in one row (default true)."},limit:{type:"integer",minimum:1,maximum:20,description:"How many candidate groups to return (default 5)."}},required:["count"],additionalProperties:!1},annotations:{readOnlyHint:!0,untrustedContentHint:!0},execute:o=>t(()=>ep(i,o))},{name:`${ci}select_seats`,title:"Select seats on the map",description:"Replace the current selection with the given seats, exactly as tapping them would. The buyer sees the seats light up and the basket update. No reservation is made.",inputSchema:{type:"object",properties:{seat_ids:{type:"array",items:{type:"string"},description:"Seat ids or labels, e.g. from find_seats."}},required:["seat_ids"],additionalProperties:!1},annotations:{readOnlyHint:!1,untrustedContentHint:!0},execute:o=>t(()=>tp(i,o))},{name:`${ci}get_selection`,title:"Read the current selection",description:"Read the seats currently selected in the basket, their total, any open reservation, and whether the selection satisfies this event\u2019s rules.",inputSchema:{type:"object",properties:{},additionalProperties:!1},annotations:{readOnlyHint:!0,untrustedContentHint:!0},execute:()=>t(()=>sa(i))}];return e&&n.push({name:`${ci}hold_selection`,title:"Reserve the selected seats",description:"Reserve the currently selected seats for this buyer for a limited time, exactly as pressing the checkout button would. Confirm with the buyer before calling this.",inputSchema:{type:"object",properties:{},additionalProperties:!1},annotations:{readOnlyHint:!1,untrustedContentHint:!0},execute:()=>t(()=>i.hold())}),n}async function ra(i,e={}){let t=Yd();if(!t||typeof t.registerTool!="function")return null;let n=new AbortController,o=ip(i,!!e.holds),s=[],r=e.exposedTo?.length?[...new Set(e.exposedTo)]:void 0;try{for(let a of o)await t.registerTool(a,{signal:n.signal,...r?{exposedTo:r}:{}}),s.push(a.name)}catch(a){console.warn("seatmap: WebMCP tools could not be registered",a)}return s.length?{names:s,dispose:()=>{if(n.abort(),typeof t.unregisterTool=="function")for(let a of s)try{t.unregisterTool(a)}catch{}}}:null}async function aa(i){let e=i.opts.webMcp;if(!e||i.destroyed)return;let t=typeof e=="object"&&!!e.holds,n=typeof e=="object"?e.exposedTo:void 0;try{i.webMcp=await ra(ao(i,t),{holds:t,exposedTo:n}),i.destroyed&&ro(i)}catch(o){console.warn("seatmap: WebMCP registration failed",o)}}function ro(i){i.webMcp?.dispose(),i.webMcp=null}function ao(i,e){let t=(n,o)=>{if(Number.isInteger(n.logicalSeatIndex))return n.logicalSeatIndex;let s=n.id.lastIndexOf(":"),r=s<0?NaN:Number(n.id.slice(s+1));return Number.isFinite(r)?r:o};return{event:()=>{let n=i.renderInfo;return n?{name:n.eventName??"",venue:n.venue??null,startsAt:n.startsAt??null,timezone:n.timezone??null,currency:i.currency,salesClosed:i.salesClosed}:null},selectionLimits:()=>({max:i.maxTickets,required:i.exactTickets}),categories:()=>{let n=i.controller.categoryAvailability();return(i.controller.doc?.categories??[]).filter(o=>!o.notForSale).map(o=>{let s=bn(i,o),r=gn(i,o);return{key:o.key,label:o.label??o.key,...r===void 0?{}:{price:r},...s&&s.min!==s.max?{priceRange:s}:{},available:n[o.key]??0}})},zones:()=>i.controller.getBestAvailableZones(),hasPremiumSeats:()=>i.controller.hasPremiumSeats(),seats:()=>{let n=i.controller.getActiveFloorId(),o=[];return i.allSeats().forEach((s,r)=>{if(s.floorId&&n&&s.floorId!==n)return;let a=i.controller.getStatus(s.id)??"free",l=i.controller.doc?.categories.find(d=>d.key===s.categoryKey),c=l?.tiers?.length?l.tiers[0].price:l?.price??0;o.push({id:s.id,label:s.label,rowKey:s.logicalRowId??s.rowId,sectionKey:s.sectionId??s.rowId,index:t(s,r),categoryKey:s.categoryKey,price:i.paidPrice(s.categoryKey,l?.tiers?.[0]?.id??null,c,s.label),...s.zoneId?{zoneId:s.zoneId}:{},available:a==="free"&&!l?.notForSale})}),o},describeSeat:n=>{let o=i.controller.seatDetails(n);return o?{section:o.sectionLabel??"",row:Q(o)??"",seat:o.seatNumber??o.label,category:o.categoryLabel??o.categoryKey}:null},selection:()=>{let{freshSeats:n,total:o,count:s}=fn(i);return{seats:n.map(r=>({id:r.id,label:r.label,section:r.sectionLabel??"",row:Q(r)??"",seat:r.seatNumber??r.label,category:r.categoryKey,price:i.paidPrice(r.categoryKey,r.tierId??null,r.price,r.label)})),count:s,total:o,currency:i.currency,hold:i.hold?{id:i.hold.holdId,expiresAt:i.hold.expiresAt}:null,validity:i.getSelectionValidity()}},clearSelection:()=>i.clearSelection(),selectObjects:n=>{i.selectObjects(n)},hold:()=>e?np(i):Promise.resolve({ok:!1,reason:"not_allowed"})}}async function np(i){if(i.salesClosed)return{ok:!1,reason:"event_closed"};if(!i.totalTicketCount())return{ok:!1,reason:"nothing_selected"};let e=i.controller.getSelectionValidity(i.totalTicketCount());return e&&!e.isValid?{ok:!1,reason:"invalid_selection"}:(await i.handleCta(),i.hold?{ok:!0,hold:{id:i.hold.holdId,expiresAt:i.hold.expiresAt}}:{ok:!1,reason:"hold_failed"})}function lo(i){return{renderingTimeMillis:i.ms,performanceProfile:i.performanceProfile,seatCount:i.seatCount,objectCount:i.objectCount,sectionCount:i.sectionCount,view:i.view,eventKey:i.eventKey,chartName:i.chartName,floorCount:i.floorCount,transport:i.transport,load:i.load,metricScope:i.metricScope,operationalTelemetryReporter:"sdk"}}function la(i,e){Ae({apiBase:i.apiBase,event:i.eventKey,scope:i.metricScope,surface:i.surface,outcome:"success",ms:i.ms,performanceProfile:i.performanceProfile,chartDelivery:i.chartDelivery,seats:i.seatCount,floors:i.floorCount,view:i.view,load:i.load,transport:i.transport}),e("chart_rendered",lo(i))}var ca=require("@seatlayer/core/core/seatConfidence");function ae(i){return String(i??"").replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#39;")}function da(i){let e=(0,ca.seatConfidenceDisclosure)(i.seat.confidenceEvidence),t=i.seat.confidenceEvidence,n=e.limitations.length?`<h4>Known limits</h4><ul>${e.limitations.map(c=>`<li>${ae(c)}</li>`).join("")}</ul>`:"",o=e.modeledTarget?`<div><dt>Modeled target</dt><dd>${ae(e.modeledTarget)}</dd></div>`:"",s=t?`<div><dt>Evidence ID</dt><dd>${ae(t.evidenceId)}</dd></div><div><dt>Model version</dt><dd>${ae(t.modelVersion)}</dd></div><div><dt>Event configuration</dt><dd>${ae(t.eventConfigurationId??"Not configuration-specific")}</dd></div><div><dt>Approval</dt><dd>${ae(t.approvedByRole??"No external approval supplied")}</dd></div>`+(t.validUntil?`<div><dt>Valid until</dt><dd>${ae(t.validUntil.slice(0,10))}</dd></div>`:""):"<div><dt>Evidence ID</dt><dd>None supplied</dd></div>",r=Mi(i.seat.commercial).join(" \xB7 ")||i.restrictionFallback,a=`<div><dt>View restriction</dt><dd>${ae(r)}</dd></div>`+(i.seat.commercial?.note?`<div><dt>Organizer note</dt><dd>${ae(i.seat.commercial.note)}</dd></div>`:""),l=i.canReport?'<button type="button" data-report>Report this view</button><p data-report-status role="status" aria-live="polite"></p>':"";return`<div class="sl-view3d-passport-scrim" aria-hidden="true"></div><section class="sl-view3d-passport" role="dialog" aria-modal="true" aria-labelledby="sl-view3d-passport-title"><header><div><span>Seat confidence passport</span><strong id="sl-view3d-passport-title">${ae(i.title)}</strong></div><button type="button" data-close aria-label="Close seat confidence passport">\xD7</button></header><div class="sl-view3d-passport-summary"><strong>${ae(e.headline)}</strong><span>${ae(e.coverage)} \xB7 ${ae(e.freshness)}</span></div><dl><div><dt>Model status</dt><dd>${ae(e.model)}</dd></div><div><dt>Reality evidence</dt><dd>${ae(e.reality)}</dd></div><div><dt>Source</dt><dd>${ae(e.provenance)}</dd></div>`+a+o+s+`</dl>${n}<p class="sl-view3d-passport-note">This passport describes supplied evidence and known limits. It does not guarantee that every temporary obstruction or real-world condition is knowable before the event build.</p>`+l+"</section>"}function pa(i){return i?i.closest("[data-report]")?"report":i.closest("[data-close]")||i.classList.contains("sl-view3d-passport-scrim")?"close":null:null}function yn(i,e,t){let n=i?.querySelector("[data-report]"),o=i?.querySelector("[data-report-status]");n&&(n.disabled=e!=="failed",n.textContent=e==="received"?"Report received":"Report this view"),o&&(o.setAttribute("role",e==="failed"?"alert":"status"),o.textContent=e==="sending"?"Sending report\u2026":e==="received"?`Report received. Reference ${t??""}.`:"The report could not be sent. Please try again.")}function co(i,e,t=null){let n=i.view3dEl;if(!n)return;di(i,!1);let o=e.confidenceEvidence,s=i.controller.seatDetails(e.id),r=document.createElement("div");r.className="sl-view3d-passport-shell",r.innerHTML=da({seat:e,title:s?.displayLabel??e.displayLabel??e.label,restrictionFallback:i.tf("picker.noAuthoredRestriction","No organizer-authored restriction"),canReport:typeof i.api.reportViewEvidence=="function"});let a=[...new Set([...n.children,...[...i.els.map.children].filter(u=>u!==n)])].filter(u=>u instanceof HTMLElement),l=a.map(u=>({element:u,inert:u.inert,ariaHidden:u.getAttribute("aria-hidden")}));for(let u of a)u.inert=!0,u.setAttribute("aria-hidden","true");n.appendChild(r),n.classList.add("has-passport"),i.view3dPassportEl=r;let c=r.querySelector(".sl-view3d-passport"),d=()=>[...c.querySelectorAll('button:not(:disabled),[href],[tabindex]:not([tabindex="-1"])')],p=u=>{if(u.key==="Escape"){u.preventDefault(),u.stopPropagation(),u.stopImmediatePropagation(),di(i);return}if(u.key!=="Tab")return;let h=d();if(!h.length)return;let y=h[0],g=h[h.length-1];u.shiftKey&&document.activeElement===y?(u.preventDefault(),g.focus()):!u.shiftKey&&document.activeElement===g&&(u.preventDefault(),y.focus())};window.addEventListener("keydown",p,!0),i.view3dPassportCleanup=()=>{window.removeEventListener("keydown",p,!0);for(let g of l)g.element.inert=g.inert,g.ariaHidden===null?g.element.removeAttribute("aria-hidden"):g.element.setAttribute("aria-hidden",g.ariaHidden);let u=t?.isConnected?t:i.confirmEl?.querySelector(".sl-confirm-confidence")??i.view3dCompareEl?.querySelector("[data-passport-seat]")??null,h=u?.closest(".sl-confirm,.sl-view3d-compare");h?.isConnected&&(h.inert=!1,h.removeAttribute("aria-hidden")),r.remove(),n.classList.remove("has-passport"),i.view3dPassportEl===r&&(i.view3dPassportEl=null);let y=u??i.view3dCompareEl?.querySelector("[data-passport-seat]")??i.confirmEl?.querySelector(".sl-confirm-confidence")??i.view3dCompareChip.mainButton();(t?.isConnected?t:y)?.focus()},r.addEventListener("click",u=>{let h=pa(u.target instanceof HTMLElement?u.target:null);h==="close"&&di(i),h==="report"&&op(i,e)}),requestAnimationFrame(()=>d()[0]?.focus()),i.emit3dAnalytics("3d_confidence_passport_opened",{seatId:e.id,evidenceId:o?.evidenceId??null,eventConfigurationId:o?.eventConfigurationId??null,modelLevel:o?.modelLevel??"unverified",realityLevel:o?.realityLevel??"none"})}async function op(i,e){if(i.api.reportViewEvidence){yn(i.view3dPassportEl,"sending");try{let t=await i.api.reportViewEvidence(i.opts.event,{seatId:e.id,evidenceId:e.confidenceEvidence?.evidenceId});i.emit3dAnalytics("3d_confidence_view_reported",{seatId:e.id,evidenceId:e.confidenceEvidence?.evidenceId??null}),yn(i.view3dPassportEl,"received",t.report.id)}catch{yn(i.view3dPassportEl,"failed")}}}function di(i,e=!0){let t=i.view3dPassportCleanup;if(i.view3dPassportCleanup=null,!t){i.view3dPassportEl?.remove(),i.view3dPassportEl=null,i.view3dEl?.classList.remove("has-passport");return}e||(document.activeElement instanceof HTMLElement?document.activeElement:null)?.blur(),t(),e||i.root?.focus({preventScroll:!0})}function ha(i){let e=i.view3dEl;if(!e||i.view3dCompareSeatIds.length<2)return;at(i,!1);let t=i.view3dCompareSeatIds.map(h=>i.view3dComparisonSnapshot(h)).filter(h=>!!h);if(t.length<2){i.clearView3dComparison();return}let n=h=>E(h),o=t.some(h=>!!h.price),s=document.createElement("div");s.className="sl-view3d-compare-shell";let r=t.map((h,y)=>`<article><span>Seat ${y===0?"A":"B"}</span><strong>${n(h.label)}</strong><small>Section ${n(h.section)} \xB7 Row ${n(h.row)}</small><dl>`+(o?`<div><dt>Current price</dt><dd>${n(h.price)}</dd></div>`:"")+`<div><dt>Ticket type</dt><dd>${n(h.category)}</dd></div><div><dt>Availability</dt><dd>${n(h.availability)}</dd></div><div><dt>View source</dt><dd>${n(h.viewSource)}</dd></div><div><dt>View restriction</dt><dd>${n(h.limited)}</dd></div><div><dt>Seat confidence</dt><dd>${n(h.confidence.headline)}</dd></div><div><dt>Reality check</dt><dd>${n(h.confidence.reality)}</dd></div><div><dt>Accessibility</dt><dd>${n(h.accessibility)}</dd></div></dl><div class="sl-view3d-compare-actions"><button type="button" data-passport-seat="${n(h.seat.id)}">Passport</button><button type="button" data-view-seat="${n(h.seat.id)}">View seat</button><button type="button" class="select" data-select-seat="${n(h.seat.id)}"${h.selectable?"":" disabled"}>Select seat</button></div></article>`).join("");s.innerHTML=`<div class="sl-view3d-compare-scrim" aria-hidden="true"></div><section class="sl-view3d-compare" role="dialog" aria-modal="true" aria-labelledby="sl-view3d-compare-title"><header><div><span>Seat inspection</span><strong id="sl-view3d-compare-title">Compare disclosed attributes</strong></div><button type="button" data-close aria-label="Close seat comparison">\xD7</button></header><p class="sl-view3d-compare-note">${o?"Current price and availability":"Availability"} comes from this picker. Modeled views are chart-derived unless organizer media is labeled.</p><div class="sl-view3d-compare-grid">${r}</div></section>`;let a=document.activeElement instanceof HTMLElement?document.activeElement:null,l=[...e.children].filter(h=>h instanceof HTMLElement),c=l.map(h=>({element:h,inert:h.inert,ariaHidden:h.getAttribute("aria-hidden")}));for(let h of l)h.inert=!0,h.setAttribute("aria-hidden","true");e.appendChild(s),e.classList.add("has-comparison"),i.view3dCompareEl=s;let d=s.querySelector(".sl-view3d-compare"),p=()=>[...d.querySelectorAll('button:not(:disabled),[href],[tabindex]:not([tabindex="-1"])')],u=h=>{if(h.key==="Escape"){h.preventDefault(),at(i);return}if(h.key!=="Tab")return;let y=p();if(!y.length)return;let g=y[0],T=y[y.length-1];h.shiftKey&&document.activeElement===g?(h.preventDefault(),T.focus()):!h.shiftKey&&document.activeElement===T&&(h.preventDefault(),g.focus())};window.addEventListener("keydown",u),i.view3dCompareCleanup=()=>{window.removeEventListener("keydown",u);for(let h of c)h.element.inert=h.inert,h.ariaHidden===null?h.element.removeAttribute("aria-hidden"):h.element.setAttribute("aria-hidden",h.ariaHidden);s.remove(),e.classList.remove("has-comparison"),i.view3dCompareEl===s&&(i.view3dCompareEl=null),a?.isConnected?a.focus():i.view3dCompareChip.mainButton()?.focus()},s.querySelector("[data-close]")?.addEventListener("click",()=>at(i)),s.querySelectorAll("[data-passport-seat]").forEach(h=>h.addEventListener("click",()=>{let y=h.dataset.passportSeat,g=y?i.allSeats().find(T=>T.id===y):void 0;g&&co(i,g,h)})),s.querySelectorAll("[data-view-seat]").forEach(h=>h.addEventListener("click",()=>{let y=h.dataset.viewSeat;at(i,!1),y&&i.view3dHandle?.flyToSeat(y)})),s.querySelectorAll("[data-select-seat]").forEach(h=>h.addEventListener("click",()=>{let y=h.dataset.selectSeat;y&&sp(i,y)})),requestAnimationFrame(()=>p()[0]?.focus()),i.emit3dAnalytics("3d_comparison_opened",{seatIds:i.view3dCompareSeatIds.slice()})}function at(i,e=!0){let t=i.view3dCompareCleanup;if(i.view3dCompareCleanup=null,!t){i.view3dCompareEl?.remove(),i.view3dCompareEl=null,i.view3dEl?.classList.remove("has-comparison");return}e||(document.activeElement instanceof HTMLElement?document.activeElement:null)?.blur(),t(),e||i.root?.focus({preventScroll:!0})}function sp(i,e){if(i.salesClosed){i.toast(i.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}let t=i.allSeats().find(o=>o.id===e);if(!t)return;if(at(i,!1),!i.controller.select([e]).length){i.syncSelectionTo3d(),i.toast(i.tf("picker.seatNoLongerAvailable","That seat is no longer available."),"warning");return}i.syncSelectionTo3d(),i.showConfirm(t),i.emit3dAnalytics("3d_comparison_selected",{seatId:e})}var fa=require("@seatlayer/core/view3d/crossfade/panorama");var po=require("@seatlayer/core");var rp=900,ap=450;function lp(i){switch(i){case"seat":return b("picker.stopYourSeat","Your seat");case"row":return b("picker.stopYourRow","Your row");case"section":return b("picker.stopYourSection","Your section");default:return b("picker.stopWholeVenue","Whole venue")}}function ua(i,e){let t=document.createElement("button");t.type="button",t.className="sl-view3d-recentre sl-mo-rotate-in",t.textContent="\u25CE";let n=b("picker.recentreOnStage","Recentre on the stage");t.setAttribute("aria-label",n),t.title=n,t.addEventListener("click",()=>{e.handle()?.recentreSeatView()});let o=document.createElement("div");o.className="sl-view3d-stop",o.setAttribute("role","status"),o.setAttribute("aria-live","polite"),i.append(t,o);let s=null,r=null;return{onStopChange(a){if(s&&(clearTimeout(s),s=null),r&&(clearTimeout(r),r=null),!a){o.classList.remove("is-shown"),o.textContent="",r=setTimeout(()=>{r=null,i.classList.remove("is-seat-view")},ap);return}i.classList.add("is-seat-view"),o.textContent=lp(a),o.classList.add("is-shown"),s=setTimeout(()=>{s=null,o.classList.remove("is-shown")},rp)},dispose(){s&&(clearTimeout(s),s=null),r&&(clearTimeout(r),r=null),t.remove(),o.remove(),i.classList.remove("is-seat-view")}}}var cp=44,dp=92;function ma(i,e,t,n={}){let o=i?.sectionLabel,s=Q(i),r=pp(i,e),a=[o,s?(0,po.t)("picker.rowLabel",{label:s}):null,r?(0,po.t)("picker.seatLabel",{label:r}):null].filter(Boolean).join(" \xB7 "),l=n.maxChars??(n.narrow?cp:dp);for(let c of[t,n.shortTail??t,null]){let d=[a,c].filter(Boolean).join(" \xB7 ");if(d.length<=l||c==null)return d}return a}function pp(i,e){if(i?.seatNumber)return i.seatNumber;let t=i?.displayLabel??e,n=o=>{!o||!t.startsWith(o)||t.length<=o.length||(t=t.slice(o.length).replace(/^[\s·\-\/_]+/,""))};return n(i?.sectionLabel),n(Q(i)),t}var ga=require("@seatlayer/core/core/seatConfidence");function ba(i){return i.buyerView}function ya(i,e,t){if(e==="map"){i.exit3d();return}let n=t?.flyToSeatId;if(i.buyerView==="venue3d"){n?(i.opts.onBuyerViewChange?.({view:"venue3d",seatId:n}),i.view3dHandle?.flyToSeat(n)):t?.resetView&&i.view3dHandle?.focusOverview();return}i.enter3d(n)}function va(i,e){switch(i.controller.getStatus(e.id)){case"held":return"held";case"booked":return"sold";case"not_for_sale":return"dimmed";default:break}return i.priceBandKeys!=null&&!i.priceBandKeys.has(e.categoryKey)||i.controller.accessibilityFilterDims?.(e)||i.limitedViewFilter&&(e.commercial?.restrictedView||e.commercial?.obstructedView)?"dimmed":"available"}function wa(i){if(!i.view3dHandle)return;let e=i.allSeats().map(t=>({seatId:t.id,state:i.seatState3dFor(t)}));i.view3dHandle.setAvailability(e)}function xa(i){i.view3dHandle&&i.view3dHandle.setSelection(i.controller.getSelection().map(e=>e.id))}async function Sa(i,e){let t=i.allSeats().find(n=>n.id===e);if(!t)return null;if(t.viewUrl)try{let n=t.viewMeta?.previewUrl,o=!!n&&n!==t.viewUrl,s=o?await i.buyerAssetUrls.resolve(n):null,r=o?t.viewUrl:await i.buyerAssetUrls.resolve(t.viewUrl);return!r||o&&!s?null:{url:r,...s?{previewUrl:s}:{},...o?{resolveUrl:a=>i.buyerAssetUrls.resolve(a)}:{},...t.viewMeta?.sourceWidth!==void 0?{sourceWidth:t.viewMeta.sourceWidth}:{},...t.viewMeta?.sourceHeight!==void 0?{sourceHeight:t.viewMeta.sourceHeight}:{},...t.viewMeta?.previewWidth!==void 0?{previewWidth:t.viewMeta.previewWidth}:{},...t.viewMeta?.previewHeight!==void 0?{previewHeight:t.viewMeta.previewHeight}:{},...t.viewMeta?.variants?.length?{variants:t.viewMeta.variants}:{},...t.viewMeta?.initialBearingDeg!==void 0?{initialBearingDeg:t.viewMeta.initialBearingDeg}:{},...t.viewMeta?.initialPitchDeg!==void 0?{initialPitchDeg:t.viewMeta.initialPitchDeg}:{},...t.viewMeta?.coverage?{coverage:t.viewMeta.coverage}:{},...t.viewMeta?.capturedAt?{capturedAt:t.viewMeta.capturedAt}:{},...t.viewMeta?.sourceLabel?{sourceLabel:t.viewMeta.sourceLabel}:{}}}catch(n){return i.opts.onError?.(n),null}return{url:"",generated:!0,mediaKind:"model",coverage:"exact-seat",sourceLabel:i.tf("picker.chartDerivedModel","Chart-derived model")}}function ka(i,e){if(i.salesClosed){i.toast(i.tf("picker.salesClosedToast","Sales are closed for this event."),"warning"),i.syncSelectionTo3d();return}let t=i.allSeats().find(a=>a.id===e);if(!t)return;let n=i.controller.tableSelection(e);if(i.committedSelection().some(a=>n?a.label===n.label:a.id===e)){i.controller.deselect([e]),i.dismissConfirm(),i.syncSelectionTo3d();return}let s=i.controller.getStatus(t.id);if(s==="held"||s==="booked"||s==="not_for_sale"){i.syncSelectionTo3d();return}if(!i.controller.select([e]).length){i.syncSelectionTo3d(),i.dismissConfirm();return}if(i.opts.onBuyerViewChange?.({view:"venue3d",seatId:e}),i.flashPickedSeat(e),n){i.showTableDialog(n,!1),i.syncSelectionTo3d();return}i.opts.confirmSelection!==!1?i.showConfirm(t):i.syncTray(),i.syncSelectionTo3d()}function Ta(i,e){let t=i.allSeats().find(n=>n.id===e);return ma(i.controller.seatDetails(e),t?.displayLabel??t?.label??e,i.tf("picker.viewFromYourSeat","view from your seat"),{narrow:i.root?.dataset.layout==="narrow",shortTail:i.tf("picker.fromYourSeat","from your seat")})}function Ea(i,e){if(i.buyerView!=="venue3d")return;let t=i.view3dCompareSeatIds;t.includes(e.id)||(i.view3dCompareSeatIds=t.length===0?[e.id]:[t[0],e.id]),i.confirmSeat?.id===e.id&&(i.controller.deselect([e.id]),i.dismissConfirm(),i.syncSelectionTo3d(),i.syncTray()),i.view3dCompareChip.sync(),i.emit3dAnalytics("3d_comparison_saved",{seatId:e.id,count:i.view3dCompareSeatIds.length}),i.view3dCompareSeatIds.length>1?i.openView3dComparison():i.toast(i.tf("picker.chooseAnotherToCompare","Seat saved. Choose another seat to compare."),"success")}function Ca(i){i.closeView3dComparison(!1),i.view3dCompareSeatIds=[],i.view3dCompareChip.remove(),i.emit3dAnalytics("3d_comparison_cleared")}function Aa(i,e){let t=i.allSeats().find(y=>y.id===e);if(!t)return null;let n=i.controller.seatDetails(t.id),o=i.controller.doc?.categories.find(y=>y.key===t.categoryKey),s=n?.price??(o?.tiers?.length?o.tiers[0].price:o?.price),r=s!=null?i.paidPrice(t.categoryKey,n?.tierId??o?.tiers?.[0]?.id??null,s,t.label):void 0,a=i.controller.getStatus(t.id),l=a==="held"?i.tf("picker.temporarilyHeld","Temporarily held"):a==="booked"?i.tf("picker.sold","Sold"):a==="not_for_sale"?i.tf("picker.notForSale","Not for sale"):i.tf("picker.available","Available"),c=t.viewUrl?(0,fa.seatViewDisclosure)({url:t.viewUrl,...t.viewMeta?.coverage?{coverage:t.viewMeta.coverage}:{},...t.viewMeta?.capturedAt?{capturedAt:t.viewMeta.capturedAt}:{},...t.viewMeta?.sourceLabel?{sourceLabel:t.viewMeta.sourceLabel}:{}}):i.tf("picker.chartDerivedSeatEye","Live 3D \xB7 chart-derived seat-eye \xB7 not surveyed"),d=Mi(t.commercial).join(" \xB7 ")||i.tf("picker.noAuthoredRestriction","No organizer-authored restriction"),p=Qo({...t.accessibility?.length?{accessibility:t.accessibility}:{},...n?.wheelchairSpaceType?{wheelchairSpaceType:n.wheelchairSpaceType}:{}}),u=p.length?`${p.join(" \xB7 ")} \xB7 metadata, not access certification`:i.tf("picker.noAccessibilityMetadata","No accessibility metadata supplied"),h=(0,ga.seatConfidenceDisclosure)(t.confidenceEvidence);return{seat:t,label:n?.displayLabel??t.displayLabel??t.label,section:n?.sectionLabel??t.sectionId??"\u2014",row:Q(n)??n?.rowLabel??"\u2014",category:n?.categoryLabel??o?.label??t.categoryKey,price:i.suppressPricing||r==null?"":i.money(r),availability:l,selectable:a==null||a==="free",viewSource:c,limited:d,accessibility:u,confidence:h}}async function Pa(i,e){if(i.view3dEl||!i.canOffer3d()||!i.els.map)return;let t=i.controller.doc;if(!t)return;i.buyerView="venue3d",i.view3dTargetSeatId=null,i.opts.onBuyerViewChange?.({view:"venue3d",...e?{seatId:e}:{}}),i.root?.setAttribute("data-view3d","on"),i.dismissConfirm(),i.syncProjection(),i.syncTray();let n=document.createElement("div");n.className="sl-view3d sl-mo-zoom",n.setAttribute("role","group"),n.setAttribute("aria-label",i.tf("picker.interactive3dVenueView","Interactive 3D venue view"));let o=document.createElement("button");o.type="button",o.className="sl-view3d-back",o.innerHTML=`<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M15 18l-6-6 6-6"/></svg><span>${i.tf("picker.backToMap","Back to map")}</span>`;let s=o.querySelector("span"),r=c=>{i.view3dTargetSeatId=c;let d=!!c;n.classList.toggle("is-seat-focused",d),i.root&&(i.root.dataset.view3dSeat=d?"on":"off");let p=d?i.tf("picker.backToVenue","Back to venue"):i.tf("picker.backToMap","Back to map");s&&(s.textContent=p),o.setAttribute("aria-label",p)};if(o.addEventListener("click",()=>{if(i.view3dTargetSeatId&&i.view3dHandle){i.view3dHandle.focusOverview();return}i.exit3d()}),i.regions["top-left"]?.prepend(o),i.view3dBack=o,i.publish3dTopInset(),Jr(i.root)){let c=document.createElement("button");c.type="button",c.className="sl-view3d-fs",c.textContent="\u26F6";let d=i.tf("picker.fullScreen","Full screen");c.setAttribute("aria-label",d),c.title=d,c.setAttribute("aria-pressed",String(!!document.fullscreenElement||i.fsFallback||i.framedFs)),c.addEventListener("click",()=>i.toggleFullscreen()),n.appendChild(c)}let a=document.createElement("div");a.className="sl-view3d-loading",a.setAttribute("role","status"),a.setAttribute("aria-live","polite"),a.textContent=i.tf("picker.loading3d","Building the 3D venue\u2026"),n.appendChild(a),i.els.map.appendChild(n),i.view3dEl=n,i.view3dCompareChip.sync(),requestAnimationFrame(()=>{n.style.opacity="1"});let l=++i.view3dGen;try{let c=i.allSeats(),[d,p]=await Promise.all([Qt(),i.controller.loadEventConfiguration()]),u=p?await Gi(p,v=>i.buyerAssetUrls.resolve(v)):null,h=t.theme?.venue3d?.shellAssetUrl,y=await Ui(h,v=>i.buyerAssetUrls.resolve(v));if(l!==i.view3dGen||i.buyerView!=="venue3d"||i.view3dEl!==n)return;let g={doc:t,seats:c,...u?{eventConfigurationId:u.id,eventConfiguration:u}:{},...y?{registeredShellGlb:y}:{}};a.textContent=i.tf("picker.building3d","Building venue geometry\u2026");let T=await d.prepareVenue3D(g);if(l!==i.view3dGen||i.buyerView!=="venue3d"||i.view3dEl!==n)return;let w=d.mountVenue3D(n,{...g,prepared:T},{portraitOverviewCrop:!0,arriveAtSeatEye:!0,lookAroundHint:et(),navLabels:Ti(),seatViewActionLabel:v=>i.allSeats().find(A=>A.id===v)?.viewUrl?i.tf("picker.openAuthored360","Open venue 360\xB0"):i.tf("picker.lookAroundLive3d","Look around in live 3D"),seatViewCaption:v=>i.seatViewCaption(v),onSeatViewStopChange:v=>i.view3dSeatViewChrome?.onStopChange(v),onSeatPick:v=>i.onView3dSeatPick(v),onSeatInspect:v=>i.onView3dSeatPick(v),onSectionFocusChange:v=>{let A=n.querySelector('select[data-locator="section"]'),D=v??"";!A||A.value===D||(A.value=D,A.dispatchEvent(new Event("change")))},onViewTargetChange:v=>{n.querySelector(".sl-view3d-nav")?.classList.toggle("is-seat-focused",!!v),r(v),i.opts.onBuyerViewChange?.({view:"venue3d",...v?{seatId:v}:{}})},...i.seatViewEnabled()?{getSeatView:v=>new Promise((A,D)=>{let K=()=>{i.seatViewFor3d(v).then(L=>{L?A(L):D(new Error("seat_view_unavailable"))})},f=globalThis.requestIdleCallback;typeof f=="function"?f(K,{timeout:1500}):setTimeout(K,50)})}:{},onAnalytics:(v,A)=>i.emit3dAnalytics(v,A)});i.view3dHandle=w,i.view3dSeatViewChrome=ua(n,{handle:()=>i.view3dHandle}),requestAnimationFrame(()=>a.remove()),i.pushAvailabilityTo3d(),i.syncSelectionTo3d(),i.view3dNav=Qr(i.regions["bottom-left"]??n,w),e&&w.flyToSeat(e)}catch(c){if(l!==i.view3dGen||i.buyerView!=="venue3d"||i.view3dEl!==n)return;i.opts.onError?.(c),i.toast(i.tf("picker.unavailable3d","3D could not start. The seat map is still available."),"warning"),i.exit3d()}}function La(i){let e=i.regions["top-left"];if(!i.root||!e)return;let t=()=>{!i.root||i.root.dataset.view3d!=="on"||i.root.style.setProperty("--sl-3d-top-inset",`${Math.max(44,Math.ceil(e.offsetHeight))}px`)};t(),typeof requestAnimationFrame=="function"&&requestAnimationFrame(t)}function Ma(i){if(i.buyerView!=="venue3d"&&!i.view3dEl)return;i.view3dGen++,i.buyerView="map",i.view3dTargetSeatId=null,i.opts.onBuyerViewChange?.({view:"map"}),i.root?.removeAttribute("data-view3d"),i.closeSeatConfidencePassport(!1),i.closeView3dComparison(!1),i.view3dCompareChip.remove(),i.view3dSeatViewChrome?.dispose(),i.view3dSeatViewChrome=null,i.view3dBack?.remove(),i.view3dBack=null,i.view3dNav?.remove(),i.view3dNav=null,i.root?.removeAttribute("data-view3d-seat"),i.root?.style.removeProperty("--sl-3d-top-inset");try{i.view3dHandle?.dispose()}catch{}i.view3dHandle=null;let e=i.view3dEl;i.view3dEl=null,e&&(e.style.opacity="0",setTimeout(()=>e.remove(),320)),i.syncProjection(),i.syncTray();let t=i.view3dReturnSeat;i.view3dReturnSeat=null,t&&i.committedSelection().some(n=>n.id===t.id)&&i.opts.confirmSelection!==!1&&i.showConfirm(t)}var Ba=require("@seatlayer/core");var pi=require("@seatlayer/core");function Ha(i){return Array.isArray(i)?i.reduce((e,t)=>t.type==="minimumSelectedPlaces"?Math.max(e,t.minimum):e,0):0}function vn(i,e,t=!1){let n=i.violations[0];return n==="numberOfPlacesToSelect"?i.remaining>0?(0,pi.t)("picker.selectExactMore",{count:i.remaining}):(0,pi.t)("picker.selectExactCount",{count:i.required}):n==="minimumSelectedPlaces"?(0,pi.t)("picker.selectMinimumMore",{count:i.remaining}):t?e("picker.adjustSeatSelection","Adjust seat selection"):n==="consecutiveSeats"?e("picker.selectSeatsTogether","Choose seats together in the same row and ticket category."):(0,pi.t)("picker.orphanHint")}var hi=require("@seatlayer/core");function Ra(i){let e=Math.max(0,i),t=Math.floor(e/6e4),n=String(Math.floor(e%6e4/1e3)).padStart(2,"0");return`${t}:${n}`}function Ia(i){let e=i.performanceLabel?`<div class="sl-chip-when">${B(i.performanceLabel)}</div>`:"",t=i.performanceDates?.labels.length?`<div class="sl-chip-dates"><span class="sl-chip-dates-summary">${B(i.performanceDates.summary)}</span><span class="sl-chip-date-list">${i.performanceDates.labels.map(n=>`<span class="sl-chip-date">${B(n)}</span>`).join("")}</span></div>`:"";return e+up(i)+t}function up(i){let{d:e,area:t,label:n,objectType:o,quantity:s=1,identity:r}=i,a=A=>String(A??"\u2014").replace(/[&<>"]/g,D=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[D]),l=o==="ga"?"ga":e?.objectType??o,c=r?.displayType?.trim()||e?.displayType?.trim()||t?.displayType?.trim()||(l==="table"?b("picker.table","Table"):l==="booth"?b("picker.booth","Booth"):l==="ga"?b("picker.generalAdmission","General admission"):b("picker.row","Row")),d=r?.rowLabel??r?.displayLabel??e?.rowLabel??e?.displayLabel??t?.label??n,p=i.categoryLabel?.trim()??"",u="",h=[];l==="table"&&r?.bookingMode?(u=`${c} ${d}`,h.push([b("picker.guests","Guests"),String(s)])):l==="ga"?(u=String(t?.displayLabel??d),s>1&&h.push([b("picker.tickets","Tickets"),String(s)])):l==="booth"?(u=e?.sectionLabel??`${c} ${d}`,e?.sectionLabel&&h.push([c,String(d)])):!e?.sectionLabel&&!e?.rowLabel&&!e?.seatNumber?u=String(d):(u=e.sectionLabel??"",e.rowLabel&&h.push([c,String(Q(e)??e.rowLabel)]),e.seatNumber&&h.push([b("picker.seat","Seat"),String(e.seatNumber)]));let y=!u&&!!p,g=u||p||String(d),T=!!p&&!y&&p!==g,w=h.map(([A,D])=>`<span class="sl-chip-seg" data-fit-seg><span class="w">${a(A)}</span> <b>${a(D)}</b></span>`);T&&w.push(`<span class="sl-chip-seg" data-fit-seg data-fit-type><span class="w">${a(p)}</span></span>`);let v=[g,...h.map(([A,D])=>`${A} ${D}`),T?p:""].filter(Boolean).join(" \xB7 ");return`<div class="sl-chip-id"><span class="sl-sr">${a(v)}</span><span class="sl-chip-name" aria-hidden="true">${a(g)}</span>`+(w.length?`<span class="sl-chip-pos" aria-hidden="true">${w.join("<i>\xB7</i>")}</span>`:"")+"</div>"}function mp(i){let e=B;return` data-key="${e(i.key)}"`+(i.heldLabels.length?` data-held="${e(encodeURIComponent(i.heldLabels.join(`
3242
- `)))}"`:"")+(i.seatIds.length?` data-seat="${e(i.seatIds.join(" "))}"`:"")+(i.locateId?` data-locate="${e(i.locateId)}"`:"")}function Oa(i){let e=B;return`<div class="sl-chip${i.held?" sl-held":""}${i.fresh?" sl-enter":""}"`+mp(i)+">"+(i.held?i.stateHtml:`<span class="sl-chip-dot" style="background:${E(i.categoryColor)}" aria-hidden="true"></span>`)+`<div class="sl-chip-main">${i.identityHtml}`+(i.extrasHtml?`<div class="sl-chip-sub">${i.extrasHtml}</div>`:"")+`${i.noteHtml}</div>`+(i.amountText?`<span class="amt">${e(i.amountText)}</span>`:"")+i.railHtml+"</div>"}function ho(i,e){let t=B(i),n=e?B(e):"";return'<div class="sl-chip-rail">'+(e?`<button type="button" class="view" data-view-label="${n}" aria-label="${B((0,hi.t)("picker.viewFromSeat",{label:e}))}"><svg viewBox="0 0 24 24"><path d="M1 12s4-7 11-7 11 7 11 7-4 7-11 7S1 12 1 12z"/><circle cx="12" cy="12" r="3"/></svg></button>`:"")+`<button type="button" class="rm" aria-label="${t}"><svg viewBox="0 0 24 24"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg></button></div>`}function _a(i){return i.confirming?`<div class="sl-ba" role="alert"><div class="sl-ba-title"><span class="spark" aria-hidden="true">\u2726</span>${b("picker.replaceCurrentChoices","Replace your current choices?")}</div><div class="sl-ba-replace"><b>${(0,hi.t)("picker.willFindSeatsTogether",{count:i.quantity})}</b><span>${b("picker.manualTicketsRemovedNote","Your manually selected tickets will be removed only after a new group is secured.")}</span></div><div class="sl-ba-actions"><button type="button" data-ba-cancel>${b("picker.keepMine","Keep mine")}</button><button type="button" class="replace" data-ba-replace>${b("picker.findNewSeats","Find new seats")}</button></div></div>`:`<div class="sl-ba"><div class="sl-ba-title"><span class="sl-ba-title-t">${b("picker.findSeatsTogether","Find seats together")}</span>`+kt({id:"sl-info-best-seats",label:b("picker.aboutBestSeats","About finding seats together"),text:b("picker.closestGroupChosenInstantly","Closest available group, chosen instantly.")})+(i.offerPremium?`<button type="button" class="sl-ba-premium${i.premium?" on":""}" data-ba-premium aria-pressed="${i.premium?"true":"false"}"><span class="star" aria-hidden="true">\u2605</span>${b("picker.bestSeatsPremium","Best seats")}</button>`:"")+`</div><div class="sl-ba-qty"><button type="button" data-ba="-1" aria-label="${b("picker.fewerSeats","Fewer seats")}">\u2212</button><span>${i.quantity}</span><button type="button" data-ba="1" aria-label="${b("picker.moreSeats","More seats")}">+</button></div>`+(i.categories.length>1?`<select class="sl-ba-cat" aria-label="${B(b("picker.preferredTicketType","Preferred ticket type"))}" data-ba-cat><option value="">${B(b("picker.anyTicketType","Any ticket type"))}</option>`+i.categories.map(e=>`<option value="${B(e.key)}"${i.selectedCategory===e.key?" selected":""}>${B(e.label)}</option>`).join("")+"</select>":'<span class="sl-ba-cat" aria-hidden="true"></span>')+(i.zones.length?`<select class="sl-ba-zone" aria-label="${b("picker.preferredVenueZone","Preferred venue zone")}" data-ba-zone><option value="">${b("picker.anyVenueZone","Any venue zone")}</option>`+i.zones.map(e=>`<option value="${B(e.id)}"${i.selectedZone===e.id?" selected":""}>${B(e.label)}</option>`).join("")+"</select>":"")+`<button type="button" class="sl-ba-go${i.busy?" sl-busy":""}"${i.busy?" disabled":""}>`+(i.busy?`<span class="sl-ba-spin" aria-hidden="true"></span>${b("picker.findingBestSeats","Finding the best seats\u2026")}`:(0,hi.tCount)("picker.findBestSeatsCount",i.quantity))+"</button>"+(i.reopened?`<button type="button" class="sl-ba-back" data-ba-close>${b("picker.keepMyPicks","Keep my picks")}</button>`:"")+"</div>"}function Na(i){if(i.salesClosed&&!i.hasPicks){let e=i.whenText?`<span class="when">${B(i.whenText)}</span>`:"";return`<div class="sl-closed-note" role="status"><b>${b("picker.salesClosedPill","Sales are closed")}</b><span>${b("picker.salesClosedCopy","Ticket sales for this event have ended.")}${e}</span></div>`}return""}function Da(i){return i.hasGaAreas?i.seated?i.venue3d?b("picker.trayHintChoose3dOrStanding","Choose a seat in the 3D venue \u2014 or grab standing tickets below."):b("picker.trayHintTapOrStanding","Tap a seat on the map \u2014 or grab standing tickets below."):i.venue3d?b("picker.gaTrayHintChoose3dArea","Choose an area in the 3D venue to select tickets."):b("picker.gaTrayHintTapArea","Tap an area on the map to choose tickets."):i.groupMode==="per_performance"?b("picker.groupPerPerformanceTrayHint","Choose seats for this performance, then complete every date above."):i.groupMode?b("picker.groupTrayHint","Choose seats once \u2014 the same seats will be held for every performance."):i.venue3d?b("picker.trayHintChoose3dOrBest","Choose a seat in the 3D venue, or let us pick the best available for you."):b("picker.trayHintTapOrBest","Tap a seat on the map, or let us pick the best available for you.")}var uo=6e4,Fa=5*6e4,fp=String(Math.round(Fa/6e4));function Va(i){let e=document.createElement("div");e.className="sl-extend",e.dataset.dock="map",e.setAttribute("role","status"),e.innerHTML='<button type="button" class="sl-extend-btn" data-ref="extendBtn"></button><button type="button" class="sl-extend-x" data-ref="extendDismiss" aria-label=""><svg viewBox="0 0 16 16" width="12" height="12" aria-hidden="true" focusable="false"><path d="M3.5 3.5 12.5 12.5M12.5 3.5 3.5 12.5" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg></button>',(i.regions["bottom-center"]??i.els.map).appendChild(e),i.extendEl=e,i.els.extendBtn=e.querySelector('[data-ref="extendBtn"]'),i.els.extendDismiss=e.querySelector('[data-ref="extendDismiss"]'),i.els.extendBtn.textContent=za(i),i.els.extendDismiss.setAttribute("aria-label",i.tf("picker.close","Close")),i.els.extendBtn.addEventListener("click",()=>{i.handleExtend()}),i.els.extendDismiss.addEventListener("click",()=>{i.extendDismissed=!0,i.setExtendPrompt(!1,0)})}function za(i){return i.tf("picker.addMinutes","+{count} min").replace("{count}",fp)}function $a(i){let e=i.hold?.items??[],t=new Set(e.map(o=>o.label));return i.committedSelection().filter(o=>!t.has(o.label)).reduce((o,s)=>o+(s.quantity??1),0)+je(i.gaQty,i.hold?.items??[])}function ja(i){return(i.hold?.items??[]).reduce((e,t)=>e+(t.quantity??1),0)}function Ga(i){let e=new Set((i.hold?.items??[]).map(n=>n.label)),t=i.committedSelection().filter(n=>!e.has(n.label)).reduce((n,o)=>n+(o.quantity??1),0);return i.heldTicketCount()+t+je(i.gaQty,i.hold?.items??[])}function Ua(i){let e=new Set((i.hold?.items??[]).map(o=>o.label)),t=i.committedSelection().filter(o=>e.has(o.label)).reduce((o,s)=>o+(s.quantity??1),0),n=Math.max(0,i.maxTickets-i.heldTicketCount()-je(i.gaQty,i.hold?.items??[]));i.controller.setMaxSelection(t+n)}function qa(i,e=i.lastTrayCount,t=i.pendingSelectionCount()){let n=i.els.cta;if(!n)return;if(delete n.dataset.act,i.salesClosed){n.disabled=!0,n.textContent=i.tf("picker.salesClosedCta","Sales closed");return}if(i.ctaPhase==="holding"){n.disabled=!0,n.innerHTML=`<span class="sl-cta-spin" aria-hidden="true"></span>${i.tf("picker.securingSeats","Securing your seats\u2026")}`;return}if(i.ctaPhase==="checkout"){n.disabled=!0,n.innerHTML=`<span class="sl-cta-spin" aria-hidden="true"></span>${i.tf("picker.openingCheckout","Opening secure checkout\u2026")}`;return}let o=!i.hold&&i.performanceGroup?.selectionMode==="per_performance"?i.performanceGroup.submissionState?.():null;if(o&&!o.ready){n.disabled=!0,n.textContent=i.tf("picker.completeAllPerformances","Complete all performances ({complete}/{total})").replace("{complete}",String(o.complete)).replace("{total}",String(o.total));return}let s=i.controller.getSelectionValidity(e);if(s&&!s.isValid){n.disabled=!0,n.textContent=vn(s,(r,a)=>i.tf(r,a),!0);return}if(!e&&i.root?.dataset.layout==="narrow"&&!i.performanceGroup&&!i.hold){n.disabled=!1,n.dataset.act="find",n.textContent=i.tf("picker.findBestSeats","Find best seats");return}n.disabled=e===0,n.textContent=i.hold?t?(0,Ba.t)("picker.secureMoreAndCheckout",{count:t}):i.tf("picker.continueToCheckout","Continue to checkout"):e?i.performanceGroup?i.tf("picker.holdSeatsForAllPerformances","Hold seats for all {count} performances").replace("{count}",String(i.performanceGroup.performanceCount)):i.tf("picker.holdSeatsAndCheckout","Hold seats & checkout"):i.tf("picker.selectSeats","Select seats")}function Ka(i,e){i.ctaPhase=e,i.syncCta()}async function Wa(i,e,t){i.setCtaPhase("checkout");try{await i.checkoutHandoff(e,t)}finally{i.ctaPhase==="checkout"&&!i.bookedShown&&i.setCtaPhase("idle")}}function Ya(i){return`@seatlayer/hold/v1/${encodeURIComponent(i.apiBase)}/${encodeURIComponent(i.opts.event)}`}function Xa(i){if(i.opts.initialHoldId)return i.opts.initialHoldId;if(i.opts.restoreHold===!1||typeof window>"u")return null;try{return window.sessionStorage.getItem(i.holdStorageKey())}catch{return null}}function Za(i,e){if(!(i.opts.restoreHold===!1||typeof window>"u"))try{window.sessionStorage.setItem(i.holdStorageKey(),e.holdId)}catch{}}function Qa(i){if(!(typeof window>"u"))try{window.sessionStorage.removeItem(i.holdStorageKey())}catch{}}async function Ja(i,e,t=!1){try{let n=await i.controller.resumeHold(e);if(!n||i.destroyed)return null;let o={holdId:n.holdId,expiresAt:n.expiresAt,seats:n.seats,items:n.items};return i.hold=o,i.handedOff=!0,i.bookedShown=!1,i.ctaPhase="idle",i.startHoldTimer(o.expiresAt),i.rememberHold(o),i.syncTray(),i.emitHoldChange(),i.opts.onHoldRestored?.(o,o.seats??[],i.buildHandoff(o)),o}catch(n){let o=n?.status;if(o===404||o===409)i.forgetHold();else if(i.opts.onError?.(n),t)throw n;return null}}async function el(i){let e=i.rememberedHoldId();e&&await i.resumeHoldFromServer(e,!0)}function tl(i,e){i.stopHoldTimer(),i.holdExpiresAt=e,i.extendDismissed=!1,i.extendUsed=!1,i.hold&&i.rememberHold(i.hold);let t=i.els.hold;t.innerHTML=`<span class="sl-hold-dot" aria-hidden="true"></span><span>${i.tf("picker.held","Held")}</span><span class="sl-hold-time" data-ref="holdTime"></span>`;let n=t.querySelector('[data-ref="holdTime"]'),o=()=>{let s=Math.max(0,i.holdExpiresAt-Date.now());n&&(n.textContent=Ra(s)),t.classList.add("on"),t.classList.toggle("is-expiring",s>0&&s<=uo),i.setExtendPrompt(s>0&&s<=uo,s),(s<=0||!i.controller.currentHold())&&i.stopHoldTimer()};i.holdTimer=setInterval(o,500),o()}function il(i){i.holdTimer&&clearInterval(i.holdTimer),i.holdTimer=null,i.els.hold?.classList.remove("on","is-expiring"),i.setExtendPrompt(!1,0)}function nl(i,e,t){if(!i.extendEl)return;let n=e&&t>0&&i.root?.dataset.layout!=="narrow"&&!i.extendDismissed&&!i.extendUsed&&!!i.controller.currentHold()&&!i.bookedShown;i.extendEl.classList.toggle("on",n)}function ol(i){if(!i.holdTimer)return;let e=Math.max(0,i.holdExpiresAt-Date.now());i.setExtendPrompt(e>0&&e<=uo,e)}async function sl(i){let e=i.els.extendBtn,t=i.controller.currentHold();if(!(!t||!i.api.extend||i.extendUsed)){e.disabled=!0,e.textContent=i.tf("picker.addingEllipsis","Adding\u2026");try{let n=await i.api.extend(i.controller.key,t.holdId,Fa);if(i.controller.currentHold()?.holdId!==t.holdId)return;i.controller.setHold({holdId:t.holdId,labels:t.labels,expiresAt:n.expiresAt,items:t.items});let o=i.controller.currentHold();if(!o)return;i.hold={holdId:o.holdId,expiresAt:o.expiresAt,seats:o.seats,items:o.items},i.holdExpiresAt=o.expiresAt,i.extendUsed=!0,i.extendEl?.classList.remove("on"),i.rememberHold(i.hold),i.emitHoldChange(),i.toast(i.tf("picker.moreTimeAdded","More time added \u2014 your seats are still held."),"success")}catch(n){if(n?.reason==="extend_limit"){i.extendUsed=!0,i.setExtendPrompt(!1,0);return}i.opts.onError?.(n),i.toast(i.tf("picker.couldNotAddMoreTime","Couldn't add more time \u2014 please head to checkout now."),"warning")}finally{e.disabled=!1,e.textContent=za(i)}}}var fo=require("@seatlayer/core");function rl(i){return i?.previousPrice!=null&&i.previousPrice>i.price?i.previousPrice:null}function al(i){return bp(i)+(i.moreLabel?`<button type="button" class="sl-price-more" aria-expanded="${!i.collapsed}">${i.esc(i.moreLabel)}</button>`:"")+yp(i.status)}function bp(i){let{esc:e,money:t}=i;return i.categories.map(n=>{let o=i.priceOf(n),s=i.rangeOf(n),r=i.offerOf(n.key),a=rl(r),l=i.activeKey===n.key;return`<div class="sl-price-row${i.bandKeys!=null&&!i.bandKeys.has(n.key)?" sl-dim":""}${l?" sl-active":""}" data-cat="${e(n.key)}" role="button" tabindex="0" aria-pressed="${l}" title="${e(i.titleFor(n,l))}"><span class="sl-dot" style="--sl-cat-dot:${e(i.colorOf(n))}"></span><span class="sl-price-label">${e(n.label)}`+(r?.offerName?`<small class="sl-price-offer">${e(r.offerName)}</small>`:"")+"</span>"+(a!=null?`<span class="sl-price-was">${e(t(a))}</span>`:"")+(s!=null?`<span class="sl-price-amt">${s.min===s.max?e(t(s.min)):`${e(t(s.min))}\u2013${e(t(s.max))}`}</span>`:o!=null?`<span class="sl-price-amt">${e(t(o))}</span>`:"")+"</div>"}).join("")}function yp(i){let e=t=>t.replace(/[&<>"']/g,n=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[n]);return`<div class="sl-status-key" aria-label="${e(i.legend)}"><span class="sl-status-item"><i class="sl-status-icon unavailable" aria-hidden="true"></i>${e(i.unavailable)}</span></div>`}function mo(i){let e=Math.abs(i.scrollLeft),t=e>2,n=e+i.clientWidth<i.scrollWidth-2;return i.dataset.fadeStart=String(t),i.dataset.fadeEnd=String(n),{start:t,end:n}}function ll(i){let{esc:e,money:t}=i;return`<button type="button" class="sl-rc sl-rc-all" data-rail-all aria-pressed="${i.allActive}" title="${e(i.allWord)}"><span class="sl-rc-t">${e(i.allWord)}</span></button>`+i.categories.map(o=>{let s=i.rangeOf(o),r=i.priceOf(o),a=s?s.min===s.max?t(s.min):`${t(s.min)}+`:r!=null?t(r):null,l=Object.prototype.hasOwnProperty.call(i.left,o.key)&&i.left[o.key]<=0,c=rl(i.offerOf(o.key)),d=a?`${o.label} \u2014 ${a}${l?` (${i.soldOutWord})`:""}`:o.label;return`<button type="button" class="sl-rc" data-cat="${e(o.key)}" aria-pressed="${i.activeKey===o.key}" aria-label="${e(d)}" title="${e(d)}"${l?" disabled":""}><i class="sl-rc-dot" style="--sl-cat-dot:${e(i.colorOf(o))}"></i>`+(c!=null?`<span class="sl-rc-was">${e(t(c))}</span>`:"")+`<span class="sl-rc-t">${e(a??o.label)}</span></button>`}).join("")}function cl(i,e){let t=i.map(a=>({key:a.key,range:e.rangeOf(a)})).filter(a=>a.range!=null);if(!t.length)return[];let n=[...new Map(t.map(a=>[`${a.range.min}:${a.range.max}`,a.range])).values()].sort((a,l)=>a.min-l.min||a.max-l.max);if(n.length<=5)return n.map(a=>({id:`p${a.min}-${a.max}`,label:a.min===a.max?e.money(a.min):`${e.money(a.min)}\u2013${e.money(a.max)}`,keys:t.filter(l=>l.range.min===a.min&&l.range.max===a.max).map(l=>l.key),min:a.min,max:a.max}));let o=[...t].sort((a,l)=>a.range.min-l.range.min||a.range.max-l.range.max),s=Math.ceil(o.length/4),r=[];for(let a=0;a<o.length;a+=s){let l=o.slice(a,a+s),c=Math.min(...l.map(p=>p.range.min)),d=Math.max(...l.map(p=>p.range.max));r.push({id:`b${a}`,label:c===d?e.money(c):`${e.money(c)}\u2013${e.money(d)}`,keys:l.map(p=>p.key),min:c,max:d})}return r}function dl(i){if(i.suppressPricing||!i.els.prices||!i.els.pricesSec)return;let e=cl(i.controller.doc?.categories??[],i.legendDeps());if(e.length<2)return;let t=document.createElement("select");t.className="sl-price-select",t.setAttribute("aria-label",i.tf("picker.filterAndFocusByPrice","Filter and focus seats by price"));let n=document.createElement("option");n.value="all",n.textContent=i.tf("picker.allPrices","All prices"),t.appendChild(n);for(let o of e){let s=document.createElement("option");s.value=o.id,s.textContent=o.label,t.appendChild(s)}i.els.pricesSec.appendChild(t),i.priceSelect=t,t.addEventListener("change",()=>{i.applyPriceBand(e.find(o=>o.id===t.value)?.keys??null)})}function pl(i,e){if(i.focusedCatKey=null,i.priceBandKeys=e?new Set(e):null,i.priceSelect){let t=e?i.priceSelect.value:"all";i.priceSelect.value!==t&&(i.priceSelect.value=t)}i.controller.setCategoryFilter(e),i.controller.focusCategoryFilter(e),i.pushAvailabilityTo3d(),i.syncFloors(),i.syncRung(),i.minimap?.refreshMinimap(),i.syncPrices(),i.lastSection&&i.showSectionCard(i.lastSection)}function hl(i){return{colorOf:e=>i.controller.getRenderer()?.categoryDisplayColor?.(e.key)??e.color,rangeOf:e=>i.catPriceRange(e),priceOf:e=>i.catPrice(e),offerOf:e=>i.offerPrice(e),money:e=>i.money(e),esc:B}}function ul(i,e,t,n=i.legendDeps()){let o=i.els.railScroll,s=e.length>1;if(i.els.rail?.classList.toggle("has",s),!o)return;o.innerHTML=s?ll({...n,categories:e,left:t,activeKey:i.focusedCatKey,soldOutWord:i.tf("picker.soldOut","Sold out"),allWord:i.tf("picker.allPrices","All prices"),allActive:!i.focusedCatKey&&!i.priceBandKeys}):"";let r=e.map(a=>a.key).join("|");i.lastRailSignature!==r&&(i.lastRailSignature=r,o.scrollLeft=0),o.querySelectorAll(".sl-rc").forEach(a=>{a.addEventListener("click",()=>{if(a.hasAttribute("data-rail-all")){i.applyPriceBand(null);return}i.focusCategory(a.dataset.cat??"")})}),i.railEdgesBound||(i.railEdgesBound=!0,o.addEventListener("scroll",()=>mo(o),{passive:!0})),requestAnimationFrame(()=>mo(o))}function ml(i){let e=i.controller.doc;if(!e||!i.els.prices)return;let t=i.controller.categoryAvailability(),n=e.categories.filter(p=>!p.notForSale);i.syncSoldout(n,t);let o=i.legendDeps(),s=i.suppressPricing,r=s?{...o,priceOf:()=>{},rangeOf:()=>{},offerOf:()=>null}:o;s&&(i.els.pricesSec?.querySelector("span")?.replaceChildren(i.tf("picker.seatCategories","Seat categories")),i.els.pricesInfo?.remove()),i.syncPriceRail(n,t,r);let a=5,l=n.length-a,c=l>1&&!i.pricesExpanded,d=c?n.slice(0,a):n;i.els.prices.classList.toggle("sl-expanded",l>1&&i.pricesExpanded),i.els.prices.innerHTML=al({...r,categories:d,left:t,collapsed:c,activeKey:i.focusedCatKey,bandKeys:i.priceBandKeys,titleFor:(p,u)=>u?i.tf("picker.showAllSeats","Show all seats"):(0,fo.t)("picker.showLabelSeatsOnMap",{label:p.label}),moreLabel:l>1?c?s?i.tf("picker.showAllCategories","Show all categories"):(0,fo.t)("picker.showAllTicketTypes",{count:n.length}):i.tf("picker.showFewer","Show fewer"):null,status:{legend:i.tf("picker.seatStatusLegend","Seat status legend"),unavailable:i.tf("picker.notAvailable","Not available")}}),i.els.prices.querySelectorAll(".sl-price-row").forEach(p=>{p.addEventListener("mouseenter",()=>i.controller.getRenderer()?.setCategoryHighlight?.(p.dataset.cat??null)),p.addEventListener("mouseleave",()=>i.controller.getRenderer()?.setCategoryHighlight?.(null));let u=()=>i.focusCategory(p.dataset.cat??"");p.addEventListener("click",u),p.addEventListener("keydown",h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),u())})}),i.els.prices.querySelector(".sl-price-more")?.addEventListener("click",()=>{i.pricesExpanded=!i.pricesExpanded,i.syncPrices()})}function fl(i,e){if(!e)return;let t=i.focusedCatKey===e?null:e;i.focusedCatKey=t,i.priceBandKeys=t?new Set([t]):null;let n=i.els.pricesSec?.querySelector(".sl-price-select");n&&(n.value="all"),i.controller.setCategoryFilter(t?[t]:null),i.controller.focusCategoryFilter(t?[t]:null),i.pushAvailabilityTo3d(),i.syncFloors(),i.syncRung(),i.minimap?.refreshMinimap(),i.syncPrices(),i.lastSection&&i.showSectionCard(i.lastSection)}var Bt=require("@seatlayer/core");function ve(i,e,t){let n=(0,Bt.t)(i,t);return n&&n!==i?n:t?e.replace(/\{(\w+)\}/g,(o,s)=>s in t?String(t[s]):o):e}function wp(i){let e=(0,Bt.tCount)("picker.seatCount",i);return e.includes("picker.seatCount")?`${i} ${i===1?"seat":"seats"}`:e}function xp(i){try{let e=Intl.ListFormat;if(e)return new e(void 0,{style:"long",type:"conjunction"}).format(i)}catch{}return i.join(", ")}function Sp(i){if(i.length<2)return!1;let e=[...i].sort((t,n)=>t-n);return new Set(e).size!==e.length?!1:e[e.length-1]-e[0]===e.length-1}function kp(i){let e=i.filter(o=>o.objectType==="ga"),t=i.filter(o=>o.objectType!=="ga"),n=[];if(t.length){let o=wp(t.length),s=[...new Set(t.map(l=>l.sectionLabel).filter(Boolean))],r=[...new Set(t.map(l=>l.rowLabel).filter(Boolean))],a=t.map(l=>Number(l.seatNumber)).filter(l=>Number.isFinite(l));if(s.length===1&&r.length===1&&a.length===t.length){let l=t.length===1?ve("picker.releasedSeatPlace","Section {section}, Row {row}, Seat {seat}",{section:s[0],row:r[0],seat:String(t[0].seatNumber??"")}):Sp(a)?ve("picker.releasedSeatRange","Section {section}, Row {row}, Seats {from}\u2013{to}",{section:s[0],row:r[0],from:Math.min(...a),to:Math.max(...a)}):"";n.push(l?ve("picker.releasedPair","{first} \xB7 {second}",{first:o,second:l}):ve("picker.releasedInSection","{seats} in Section {section}",{seats:o,section:s[0]}))}else s.length===1?n.push(ve("picker.releasedInSection","{seats} in Section {section}",{seats:o,section:s[0]})):s.length>1?n.push(ve("picker.releasedInSections","{seats} in Sections {sections}",{seats:o,sections:xp(s)})):n.push(o)}for(let o of e)n.push(ve("picker.releasedGa","{quantity} \xD7 {area}",{quantity:o.quantity??1,area:o.label}));return n.length?n.reduce((o,s)=>ve("picker.releasedPair","{first} \xB7 {second}",{first:o,second:s})):""}function gl(i){if(!i)return[];let e=new Map((i.seats??[]).map(o=>[o.label,o])),t=i.items??[];return(t.length?t.map(o=>({label:o.label,objectType:o.objectType,quantity:o.quantity})):[...e.keys()].map(o=>({label:o}))).map(o=>{let s=e.get(o.label);return{label:o.label,...o.objectType?{objectType:o.objectType}:{},...o.quantity==null?{}:{quantity:o.quantity},...s?.sectionLabel?{sectionLabel:s.sectionLabel}:{},...s?.rowLabel?{rowLabel:Q(s)??s.rowLabel}:{},...s?.seatNumber?{seatNumber:s.seatNumber}:{}}})}function bl(i,e){if(!i.reducedMotion)for(let t of e.slice(0,10)){if(t.objectType==="ga")continue;let n=i.seatByLabel(t.label);!n||i.statusOf(n.id)!=="free"||i.flash(n.id,i.accent)}}function yl(i,e){if(!e.recoverable.length||!i.isConnected)return;let t=i.querySelector(".sl-hold-expired-next");t&&(e.taken.length?t.textContent=e.taken.slice(0,3).map(r=>(0,Bt.t)("picker.seatJustTakenByAnother",{label:r})).join(" "):t.remove());let n=i.querySelector(".sl-interrupt-actions"),o=n?.querySelector(".sl-interrupt-act");if(!n||!o)return;o.classList.add("sl-interrupt-act-secondary");let s=document.createElement("button");s.type="button",s.className="sl-interrupt-act sl-hold-expired-recover",s.textContent=(0,Bt.tCount)("picker.holdLapsedSelectAgain",e.recoverable.length),s.addEventListener("click",()=>e.onRecover([...e.recoverable])),n.insertBefore(s,o),i.classList.add("has-recovery"),s.focus()}function vl(i,e=[]){let t=document.createElement("div");t.className="sl-interrupt sl-hold-expired sl-mo-scrim",t.setAttribute("role","alertdialog"),t.setAttribute("aria-modal","true");let n=document.createElement("div");n.className="sl-interrupt-card sl-mo-in";let o=document.createElement("div");o.className="sl-interrupt-title",o.id="sl-hold-expired-title";let s=document.createElement("span");s.className="sl-interrupt-glyph",s.setAttribute("aria-hidden","true"),s.textContent="\u23F1";let r=document.createElement("span");r.textContent=ve("picker.holdExpiredTitle","Your seats were released"),o.append(s,r);let a=document.createElement("div");a.className="sl-interrupt-body",a.id="sl-hold-expired-body",a.textContent=ve("picker.holdExpiredBody","Your hold time ran out and the seats went back on sale."),n.append(o,a);let l=kp(e);if(l){let u=document.createElement("div");u.className="sl-interrupt-body sl-interrupt-fact sl-hold-expired-seats",u.textContent=l,n.appendChild(u)}let c=document.createElement("div");c.className="sl-interrupt-body sl-hold-expired-next",c.textContent=ve("picker.holdExpiredPickAgain","Pick your seats again to continue \u2014 they may already be taken."),n.appendChild(c),t.setAttribute("aria-labelledby",o.id),t.setAttribute("aria-describedby",a.id);let d=document.createElement("div");d.className="sl-interrupt-actions";let p=document.createElement("button");return p.type="button",p.className="sl-interrupt-act sl-hold-expired-restart",p.textContent=ve("picker.holdExpiredRestart","Choose seats again"),p.addEventListener("click",()=>i.restart()),d.appendChild(p),n.appendChild(d),t.appendChild(n),t.addEventListener("pointerdown",u=>{u.target===t&&i.restart()}),t}var _e=require("@seatlayer/core");var wl={wheelchair:"Wheelchair space",companion:"Companion seat","semi-ambulatory":"Limited mobility","designated-aisle":"Aisle / transfer","step-free":"Step-free",hearing:"Assistive listening",cart:"Live captions","sign-language":"Sign language","low-vision":"Low vision","sensory-friendly":"Sensory-friendly","plus-size":"Plus-size","lift-armrest":"Lift-up armrest"},Tp='<svg viewBox="0 0 20 20" width="17" height="17" fill="none" stroke="currentColor" stroke-width="1.45" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><circle cx="10" cy="10" r="7.5" /><path d="M10 2.5a7.5 7.5 0 0 1 0 15Z" fill="currentColor" stroke="none" /></svg>',Ep='<svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="13" cy="4.4" r="1.9"/><path d="M11 8.2v5.1h5.1"/><path d="M16.6 13.3l1.9 6.3"/><path d="M15.4 14.9a5.6 5.6 0 1 1-5.9-3.4"/></svg>',Cp=8,Ap=8,Pp=88;function Lp(i){let e=i.gap??Cp,t=i.margin??Ap,n=i.min??Pp,o=Math.max(i.boundsTop,0);return Math.max(Math.round(i.buttonTop-o-e-t),n)}var wn=class{constructor(e,t){this.active=new Set;this.deps=t,this.root=document.createElement("div"),this.root.className="sl-a11y",this.button=document.createElement("button"),this.button.type="button",this.button.className="sl-a11ybtn",this.button.setAttribute("aria-haspopup","true"),this.button.setAttribute("aria-expanded","false");let o=this.offered().length>0?t.tf("picker.accessibilityOptions","Accessibility and colour options"):t.tf("picker.displayOptions","Display options");this.button.setAttribute("aria-label",o),this.button.innerHTML=Ep,this.menu=document.createElement("div"),this.menu.className="sl-a11ymenu",this.menu.hidden=!0;for(let s of this.stored())this.offeredFree().has(s)&&this.active.add(s);if(this.menu.innerHTML=ds(o,t.tf("picker.close","Close"))+ps(this.rows()),this.root.append(this.menu,this.button),e.prepend(this.root),this.button.addEventListener("pointerdown",s=>s.stopPropagation()),this.button.addEventListener("click",s=>{s.stopPropagation(),this.open(this.menu.hidden)}),this.menu.querySelector("[data-a11y-close]")?.addEventListener("click",s=>{s.stopPropagation(),this.open(!1),this.button.focus({preventScroll:!0})}),this.menu.addEventListener("pointerdown",s=>s.stopPropagation()),this.menu.addEventListener("click",s=>s.stopPropagation()),this.menu.addEventListener("focusin",s=>{let r=s.target;r&&typeof r.scrollIntoView=="function"&&r.scrollIntoView({block:"nearest"})}),this.dismiss=()=>this.open(!1),this.escape=s=>{s.key==="Escape"&&this.open(!1)},this.reflow=()=>{this.menu.hidden||this.fit()},document.addEventListener("pointerdown",this.dismiss),document.addEventListener("keydown",this.escape),window.addEventListener("resize",this.reflow),this.promoteCounts(),this.wire(),this.active.size){this.applyFilter({focus:!1});let s=()=>this.deps.focusSeatsForFilter();typeof requestAnimationFrame=="function"?requestAnimationFrame(s):s()}}colorblindRow(){return this.menu.querySelector(".sl-cbbtn")}syncCounts(){let e=new Map(this.offered().map(({key:n,count:o})=>[n,o])),t=!1;for(let n of this.menu.querySelectorAll("[data-a11y-row]")){let o=n.dataset.a11yRow??"";if(!o.startsWith("a11y:"))continue;let s=o.slice(5),r=e.get(s);if(r===void 0)continue;let a=this.countNode(n),l=r==null?"":this.countText(r);a&&(a.textContent=l);let c=r===0;a instanceof HTMLButtonElement&&(a.disabled=c,a.setAttribute("aria-label",this.jumpLabel(s,l))),n.disabled=c,c?n.setAttribute("aria-disabled","true"):n.removeAttribute("aria-disabled"),c&&this.active.delete(s)&&(this.paint(n,!1),t=!0)}t&&this.applyFilter()}syncAccessibilityFilter(e){this.active.clear();for(let t of e??[])this.active.add(t);this.remember(e&&e.length?e:null);for(let t of this.menu.querySelectorAll("[data-a11y-row]")){let n=t.dataset.a11yRow??"";n.startsWith("a11y:")&&this.paint(t,this.active.has(n.slice(5)))}}refit(){this.menu.hidden||this.fit()}destroy(){document.removeEventListener("pointerdown",this.dismiss),document.removeEventListener("keydown",this.escape),window.removeEventListener("resize",this.reflow),this.root.remove()}fit(){this.menu.style.setProperty("--sl-a11ymenu-max",`${Lp({boundsTop:this.boundsTop(),buttonTop:this.button.getBoundingClientRect().top})}px`)}boundsTop(){let e=this.root.closest(".sl-map")??this.root.closest(".sl-picker");return e instanceof HTMLElement?e.getBoundingClientRect().top:0}open(e){if(e===!this.menu.hidden)return;if(this.button.setAttribute("aria-expanded",String(e)),!e){this.menu.hidden=!0,this.menu.classList.remove("sl-mo-in","sl-mo-stagger");return}this.menu.hidden=!1,this.fit(),this.menu.scrollTop=0;let t=this.button.getBoundingClientRect();Vn(this.menu,{x:t.left+t.width/2,y:t.top}),Es(this.menu),Ts(this.menu)}rows(){return[...this.filterRows(),...this.deps.hasLimitedView?[{key:"limited",iconHtml:(0,_e.seatTypeIconSvg)("restrictedView",{size:17}),label:this.deps.tf("picker.hideLimitedView","Hide limited-view seats"),on:this.deps.isLimitedViewHidden()}]:[],{key:"colorblind",iconHtml:Tp,className:"sl-cbbtn",label:this.deps.tf("picker.colorblindColors","Colourblind-friendly colours"),on:this.deps.isColorblindSafe()}]}offered(){let e=this.deps.needs?.();if(e)return e.map(({key:n,count:o})=>({key:n,count:o}));let t=this.deps.present;return t?_e.ACCESSIBILITY_TYPES.filter(({key:n})=>t.has(n)).map(({key:n})=>({key:n,count:null})):[]}offeredKeys(){return new Set(this.offered().map(({key:e})=>e))}offeredFree(){return new Set(this.offered().filter(({count:e})=>e!==0).map(({key:e})=>e))}filterRows(){let e=this.offeredKeys(),t=new Map(_e.ACCESSIBILITY_TYPES.map(n=>[n.key,n]));return this.offered().flatMap(({key:n,count:o})=>{let s=t.get(n);return s?[{key:`a11y:${n}`,iconHtml:(0,_e.seatTypeIconSvg)(n,{size:17}),label:this.deps.tf(`picker.accessShort.${n}`,wl[n]??s.label),...n==="wheelchair"&&e.has("companion")?{note:this.deps.tf("picker.companionSeatsNote","Companion places beside them stay selectable")}:{},...o==null?{}:{count:this.countText(o),disabled:o===0},on:this.active.has(n)}]:[]})}wire(){for(let e of this.menu.querySelectorAll("[data-sl-info]"))e.addEventListener("click",()=>{let t=e.closest(".sl-info"),n=!t?.classList.contains("open");for(let o of this.menu.querySelectorAll(".sl-info.open"))o.classList.remove("open"),o.querySelector("[data-sl-info]")?.setAttribute("aria-expanded","false");t?.classList.toggle("open",n),e.setAttribute("aria-expanded",String(n))});for(let e of this.menu.querySelectorAll("[data-a11y-row]"))e.addEventListener("click",()=>{let t=e.dataset.a11yRow??"";if(t==="colorblind"){let s=!this.deps.isColorblindSafe();this.deps.setColorblindSafe(s),this.paint(e,s);return}if(t==="limited"){let s=!this.deps.isLimitedViewHidden();this.deps.setLimitedViewHidden(s),s&&this.deps.focusSeatsForFilter(),this.paint(e,s);return}let n=t.slice(5),o=!this.active.has(n);o?this.active.add(n):this.active.delete(n),this.paint(e,o),this.applyFilter()})}promoteCounts(){if(this.deps.stepToAccessibleSection)for(let e of this.menu.querySelectorAll('[data-a11y-row^="a11y:"]')){let t=e.querySelector(".sl-a11yrow-c");if(!t)continue;let n=(e.dataset.a11yRow??"").slice(5),o=e.parentElement;o?.classList.contains("sl-a11yrow-w")||(o=document.createElement("div"),o.className="sl-a11yrow-w",e.replaceWith(o),o.appendChild(e));let s=document.createElement("button");s.type="button",s.className="sl-a11yrow-c sl-a11yjump",s.dataset.a11yJump=n,s.textContent=t.textContent,s.disabled=e.disabled,s.setAttribute("aria-label",this.jumpLabel(n,t.textContent??"")),t.remove(),e.setAttribute("aria-label",this.rowLabel(n,s.textContent??""));let r=o.querySelector(".sl-info");r?r.after(s):e.after(s),o.dataset.a11yTapThrough||(o.dataset.a11yTapThrough="true",o.addEventListener("click",a=>{a.target===o&&!e.disabled&&e.click()})),s.addEventListener("click",a=>{a.stopPropagation(),this.active.has(n)||(this.active.add(n),this.paint(e,!0),this.applyFilter({focus:!1}));let l=this.deps.stepToAccessibleSection?.(n);l&&s.setAttribute("aria-label",this.jumpLabel(n,s.textContent??"",l.label))})}}countText(e){return e>0?(0,_e.t)("picker.accessFreeCount",{count:e}):"0"}countNode(e){return e.querySelector(".sl-a11yrow-c")??e.parentElement?.querySelector(".sl-a11yrow-c")??null}typeLabel(e){let t=wl[e]??_e.ACCESSIBILITY_TYPES.find(n=>n.key===e)?.label??e;return this.deps.tf(`picker.accessShort.${e}`,t)}jumpLabel(e,t,n){return[this.deps.tf("picker.jumpToSection","Jump to section"),this.typeLabel(e),t,...n?[`${this.deps.tf("picker.section","Section")} ${n}`]:[]].filter(Boolean).join(" \xB7 ")}rowLabel(e,t){return[this.typeLabel(e),t].filter(Boolean).join(" \xB7 ")}paint(e,t){e.classList.toggle("on",t),e.setAttribute("aria-checked",String(t)),e.setAttribute("aria-pressed",String(t))}applyFilter(e={}){let t=this.active.size?[...this.active]:null;this.deps.applyAccessibilityFilter(t),this.remember(t),t&&e.focus!==!1&&this.deps.focusSeatsForFilter()}key(){let e=this.deps.chart?.();return`seatmap.a11y.filter.${this.deps.event}${e?`.${e}`:""}`}stored(){try{let e=window.sessionStorage.getItem(this.key()),t=e?JSON.parse(e):null;return Array.isArray(t)?t:[]}catch{return[]}}remember(e){try{e&&e.length?window.sessionStorage.setItem(this.key(),JSON.stringify(e)):window.sessionStorage.removeItem(this.key())}catch{}}};var xl=require("@seatlayer/core"),Mp=250;function Sl(i,e=Mp){let t=null,n=()=>{t===null&&(t=setTimeout(()=>{t=null,i()},e))},o=(0,xl.attachVisibilityCatchUp)(n),s=typeof window<"u"&&typeof window.addEventListener=="function";return s&&window.addEventListener("focus",n),()=>{t!==null&&(clearTimeout(t),t=null),o(),s&&window.removeEventListener("focus",n)}}var lt=require("@seatlayer/core");var xn=class{constructor(e){this.note=null;this.told=!1;this.deps=e}deferExpiryToast(e){this.told=!1,queueMicrotask(()=>{this.told||e()})}handle(e){if(!e.holdLapsed)return;this.told=!0;let t=(0,lt.holdRecoveryShape)(e),n=e.lapsedLabels.length,o=n-e.recoverable.length,s=t==="all"?(0,lt.tCount)("picker.holdLapsedStillFree",n):t==="partial"?(0,lt.tCount)("picker.holdLapsedSomeTaken",o):(0,lt.tCount)("picker.holdLapsedAllTaken",n);this.note={message:s,recoverable:t==="none"?[]:[...e.recoverable]},this.deps.toast(s,t==="none"?"error":"warning",t==="none"?void 0:{label:this.actionLabel(),onClick:()=>this.recover()}),this.deps.syncTray()}noteHtml(){if(!this.note)return"";let e=this.note.recoverable.length?`<button type="button" data-lapse-again>${B(this.actionLabel())}</button>`:"";return`<div class="sl-lapse-note" role="status"><span>${B(this.note.message)}</span>${e}</div>`}wire(e){e?.querySelector("[data-lapse-again]")?.addEventListener("click",()=>this.recover())}clear(){this.note&&(this.note=null,this.deps.syncTray())}actionLabel(){return(0,lt.tCount)("picker.holdLapsedSelectAgain",this.note?.recoverable.length??0)}recover(){let e=this.note?.recoverable??[];this.note=null,this.deps.syncTray(),e.length&&this.deps.reselect(e)}};var kl=Symbol("seatlayer.performance-group-picker");function Sn(i,e){return Object.defineProperty(i,kl,{configurable:!1,enumerable:!1,value:Object.freeze({...e})}),i}function Tl(i){return i[kl]??null}var El="@seatlayer/pending-checkout/v1";function Hp(i){return typeof i=="string"&&i.length<=160&&/^ord_[A-Za-z0-9_-]+$/.test(i)}function kn(i){if(typeof location>"u")return null;let e=new URLSearchParams(location.search),t=e.get("seatlayer_checkout");if(t!=="success"&&t!=="cancelled")return null;let n=null;try{let o=window.sessionStorage.getItem(El);if(o){let s=null;try{s=JSON.parse(o)}catch{}if(s&&Hp(s.orderId)){let r=Date.now()-Number(s.storedAt);if(r>=0&&r<=144e5){if(s.eventKey&&s.eventKey!==i)return null;n=s.orderId}}}window.sessionStorage.removeItem(El)}catch{}e.delete("seatlayer_checkout");try{let o=e.toString();history.replaceState(history.state,"",`${location.pathname}${o?`?${o}`:""}${location.hash}`)}catch{}return{outcome:t,orderId:n}}function Cl(i){if(!i.framed)return null;let e=i.ancestorOrigins?.length?i.ancestorOrigins[0]:null;for(let t of[e,i.referrer])if(t)try{return new URL(t).origin}catch{}return null}var Rp="https://api.seatlayer.io",Ip=10,Op=250,Al=6e4,Pl=4,_p=10,Np=40,Dp=220,go=["mini","peek","open"],Ll="seatmap.a11y.cb";function Bp(){try{if(typeof window>"u")return null;let i=window.localStorage.getItem(Ll);return i==null?null:i==="1"}catch{return null}}function Fp(i){try{window.localStorage.setItem(Ll,i?"1":"0")}catch{}}var Ke=class i{constructor(e){this.realtime=null;this.accessEl=null;this.lastSelectionValidity=null;this.root=null;this.mapHost=null;this.rendered=!1;this.destroyed=!1;this.renderInfo=null;this.webMcp=null;this.localeGeneration=0;this.els={};this.regions={};this.ro=null;this.viewportResizeHandler=null;this.holdTimer=null;this.loadAbort=null;this.transportAbort=new AbortController;this.toastTimer=null;this.offerReadInFlight=null;this.offerReadSettledAt=0;this.offerRefreshTimer=null;this.offerBoundaryTimer=null;this.offerVisibilityHandler=null;this.motionTimers=new Set;this.currency="USD";this.eventTimezone=null;this.eventWhenText=null;this.offerAvailability=null;this.channelByObject=new Map;this.pricesByChannel=new Map;this.hold=null;this.holdExpiresAt=0;this.handedOff=!1;this.bookedShown=!1;this.holdConflicted=!1;this.paymentOptions=null;this.checkoutPanel=null;this.extendEl=null;this.extendDismissed=!1;this.extendUsed=!1;this.bookedEl=null;this.holdExpiredEl=null;this.holdExpiredFresh=!1;this.holdExpiredUnits=[];this.gaQty=new Map;this.gaPromptEl=null;this.gaPromptReturnFocus=null;this.gaAreasExpanded=!1;this.lastMapPoint=null;this.tipEl=null;this.tipPos={x:0,y:0};this.tipPinned=!1;this.tipMarkedHoverLabel=null;this.lastPointerType="mouse";this.themeMode=null;this.colorSchemeStop=null;this.seatsRevealed=!1;this.seatsRevealedReport=null;this.confirmCardCache=null;this.suppressConfirmationSeatId=null;this.tableDialogEl=null;this.tableDialog=null;this.tableDialogHeld=!1;this.tableDialogReturnFocus=null;this.srEl=null;this.baQty=2;this.baCat="";this.baZone="";this.baPremium=!1;this.bestAvailableConfirm=!1;this.salesClosed=!1;this.soldOut=!1;this.soldoutEl=null;this.cbSafe=!1;this.rungsEl=null;this.projectionEl=null;this.buyerView="map";this.view3dEl=null;this.view3dHandle=null;this.view3dGen=0;this.view3dReturnSeat=null;this.view3dTargetSeatId=null;this.view3dCompareSeatIds=[];this.view3dCompareChip=new mn({overlay:()=>this.view3dEl,savedSeatIds:()=>this.view3dCompareSeatIds,openComparison:()=>this.openView3dComparison(),clearComparison:()=>this.clearView3dComparison(),toast:(e,t)=>this.toast(e,t)});this.view3dCompareEl=null;this.view3dCompareCleanup=null;this.view3dSeatViewChrome=null;this.view3dPassportEl=null;this.view3dPassportCleanup=null;this.floorsEl=null;this.arenaViewportInsets={top:0,right:0,bottom:0,left:0};this.viewEl=null;this.viewCleanup=null;this.seatViewGen=0;this.allSeatsCache=null;this.view3dBack=null;this.view3dNav=null;this.lastRailSignature="";this.priceSelect=null;this.minimap=null;this.pickerLayoutSize={width:0,height:0};this.fullscreenAffordanceSize={rootWidth:-1,rootHeight:-1,viewportWidth:-1,viewportHeight:-1};this.priceBandKeys=null;this.focusedCatKey=null;this.limitedViewFilter=!1;this.pricesExpanded=!1;this.sectionCardCache=null;this.lastTrayCount=0;this.langSel=null;this.lastTrayTotal=0;this.lastTrayKeys=new Set;this.bestAvailableBusy=!1;this.releasingLabels=new Set;this.holdingLabels=new Set;this.ctaPhase="idle";this.a11yMenu=null;this.detachAttention=null;this.lapse=new xn({toast:(e,t,n)=>this.toast(e,t,n),reselect:e=>{this.controller.select(e),this.handleCta()},syncTray:()=>this.syncTray()});this.railEdgesBound=!1;this.fsFallback=!1;this.fsChangeHandler=null;this.fsEscHandler=null;this.eventDetailsHidden=!1;this.sideCollapsed=!1;this.sideToggleEl=null;this.framedFs=!1;this.lastPostedHeight=0;this.cbEl=null;this.modalScrim=null;this.prevFocus=null;this.escHandler=null;this.closeModal=null;this.fitScheduled=!1;this.perspectiveWarned=!1;if(!e||typeof e!="object")throw new Error("seatmap: options object is required");if(!e.event||typeof e.event!="string")throw new Error("seatmap: `event` key is required");if(!e.container)throw new Error("seatmap: `container` is required (or use SeatPicker.open())");this.performanceGroup=Tl(e),this.suppressPricing=!!this.performanceGroup?.suppressPricing,this.opts={...e,confirmSelection:e.confirmSelection??!0},this.eventDetailsHidden=!!e.hideEventDetails,this.hostPricing=e.pricing,this.apiBase=(e.apiBase??Rp).replace(/\/+$/,"");let t={onExpired:a=>{this.opts.onAccessExpired?.(a),a.refreshed||this.showAccessPanel({reason:"no_token",retryable:!1})},onUnavailable:a=>{this.opts.onAccessUnavailable?.(a),this.showAccessPanel(a)}},n=!e.transport&&e.publicKey&&!e.buyerAccessTokenProvider&&!e.buyerAccessToken?Bi({base:this.apiBase,event:e.event,publicKey:e.publicKey,accessHooks:t,apiOptions:{referral:e.referral,onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)}}):null;this.access=e.transport?null:n?.access??Ht(e,t),this.pubApi=e.transport?null:n?.api??new Ve(this.apiBase,{access:this.access??void 0,referral:e.referral,onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)}),this.api=ar(e.transport??this.pubApi,this.transportAbort.signal),this.buyerAssetUrls=new It(e.event,this.api.asset?(a,l)=>this.api.asset(a,l):void 0),e.checkout==="hosted"&&!this.pubApi&&console.warn('seatlayer: checkout: "hosted" needs the widget\'s own transport \u2014 a custom `transport` owns its backend, so the picker is staying on onCheckout for this mount.'),this.checkoutMode=e.checkout==="hosted"&&this.pubApi?"hosted":"handoff";let o=e.numberOfPlacesToSelect;if(o!=null&&(!Number.isInteger(o)||o<1))throw new Error("seatmap: `numberOfPlacesToSelect` must be a positive integer");this.exactTickets=o??null;let s=Ha(e.selectionValidators);if(this.exactTickets!=null&&s>this.exactTickets)throw new Error("seatmap: `minimumSelectedPlaces.minimum` cannot exceed `numberOfPlacesToSelect`");let r=Math.max(1,Math.floor(e.maxSelection??this.exactTickets??Math.max(Ip,s)));if(this.exactTickets!=null&&r<this.exactTickets)throw new Error("seatmap: `maxSelection` cannot be lower than `numberOfPlacesToSelect`");if(e.maxSelection!=null&&r<s)throw new Error("seatmap: `maxSelection` cannot be lower than `minimumSelectedPlaces.minimum`");this.maxTickets=this.exactTickets??r,this.cbSafe=Bp()??!!e.colorblindSafe,this.controller=this.wireController(e)}get confirmEl(){return this.confirmCard.element}set confirmEl(e){this.confirmCard.element=e}get confirmSeat(){return this.confirmCard.candidate}set confirmSeat(e){this.confirmCard.candidate=e}get lastSection(){return this.sectionCard.summary}set lastSection(e){this.sectionCard.adopt(e)}deliverableViewReference(e){return _t(e)}isFramed(){return typeof window<"u"&&window.parent!==window}postToHost(e){if(!this.isFramed())return;let t=Cl({framed:!0,ancestorOrigins:window.location.ancestorOrigins,referrer:document.referrer});if(t)try{window.parent.postMessage(e,t)}catch{}}measureFramedHeight(){let e=this.root;if(!e)return 0;let t=e.clientWidth||(typeof window<"u"?window.innerWidth:0)||0;if(t<=0)return 0;let n=t<640?1.2:.62;return Math.max(420,Math.round(t*n))}reportFramedHeight(){if(!this.isFramed())return;let e=this.measureFramedHeight();e<=0||e===this.lastPostedHeight||(this.lastPostedHeight=e,this.postToHost({type:"seatlayer:height",px:e}))}toggleFullscreen(){let e=this.root;if(!e)return;!!document.fullscreenElement||this.fsFallback||this.framedFs?document.fullscreenElement?document.exitFullscreen().catch(()=>{}):this.framedFs?this.setFramedFs(!1):this.setFsFallback(!1):e.requestFullscreen?e.requestFullscreen().catch(()=>this.enterFsFallback()):this.enterFsFallback()}fillsViewport(){let e=this.root;if(!e||typeof window>"u")return!1;let t=e.getBoundingClientRect();return t.height>=window.innerHeight-Pl&&t.width>=window.innerWidth-Pl}syncFullscreenAffordance(){let e=this.els.zfs;if(!e)return;let n=!(!!document.fullscreenElement||this.fsFallback||this.framedFs)&&this.root?.dataset.layout==="narrow"&&this.fillsViewport();e.hidden=n,e.tabIndex=n?-1:0,e.setAttribute("aria-hidden",String(n))}fullscreenMeasurementChanged(e,t){let n=typeof window>"u"?0:window.innerWidth,o=typeof window>"u"?0:window.innerHeight,s=e!==this.fullscreenAffordanceSize.rootWidth||t!==this.fullscreenAffordanceSize.rootHeight||n!==this.fullscreenAffordanceSize.viewportWidth||o!==this.fullscreenAffordanceSize.viewportHeight;return this.fullscreenAffordanceSize={rootWidth:e,rootHeight:t,viewportWidth:n,viewportHeight:o},s}syncFullscreenButtons(){let e=!!document.fullscreenElement||this.fsFallback||this.framedFs,t=this.eventDetailsHidden&&!e;this.root?.setAttribute("data-event-details-hidden",String(t)),this.root?.setAttribute("data-fs",String(e)),this.els.zfs?.setAttribute("aria-pressed",String(e)),this.els.zfs?.setAttribute("title",e?this.tf("picker.exitFullScreen","Exit full screen"):this.tf("picker.fullScreen","Full screen"));let n=this.els.zfs?.querySelector(".sl-zfs-lbl");n&&(n.textContent=e?this.tf("picker.exitFullScreen","Exit full screen"):this.tf("picker.fullScreen","Full screen")),this.view3dEl?.querySelector(".sl-view3d-fs")?.setAttribute("aria-pressed",String(e)),this.syncFullscreenAffordance()}enterFsFallback(){this.isFramed()?this.setFramedFs(!0):this.setFsFallback(!0)}setFramedFs(e){this.framedFs!==e&&(this.framedFs=e,this.syncFullscreenButtons(),this.postToHost({type:"seatlayer:fullscreen",on:e,background:this.cssVar("--sl-bg")||void 0}),e&&!this.fsEscHandler?(this.fsEscHandler=t=>{t.key==="Escape"&&!document.fullscreenElement&&this.setFramedFs(!1)},window.addEventListener("keydown",this.fsEscHandler)):!e&&this.fsEscHandler&&(window.removeEventListener("keydown",this.fsEscHandler),this.fsEscHandler=null),requestAnimationFrame(()=>this.controller.refitCurrentView()))}setFsFallback(e){this.fsFallback!==e&&(this.fsFallback=e,this.root?.classList.toggle("sl-fs",e),this.syncFullscreenButtons(),e&&!this.fsEscHandler?(this.fsEscHandler=t=>{t.key==="Escape"&&!document.fullscreenElement&&this.setFsFallback(!1)},window.addEventListener("keydown",this.fsEscHandler)):!e&&this.fsEscHandler&&(window.removeEventListener("keydown",this.fsEscHandler),this.fsEscHandler=null),requestAnimationFrame(()=>this.controller.refitCurrentView()))}close(){this.closeModal?this.closeModal():this.destroy()}static async open(e){Ot();let t=document.activeElement instanceof HTMLElement?document.activeElement:null,n=document.createElement("div");n.className="sl-modal-scrim";let o=document.createElement("div");o.className="sl-modal-frame",o.style.setProperty("--sl-bg",Et(void 0,e.theme)["--sl-bg"]),o.setAttribute("role","dialog"),o.setAttribute("aria-modal","true"),o.setAttribute("aria-label",b("picker.seatSelection","Seat selection")),o.tabIndex=-1,n.appendChild(o),document.body.appendChild(n);let s=document.body.style.overflow;document.body.style.overflow="hidden";let r=new i({...e,container:o});r.modalScrim=n,r.prevFocus=t;let a=["a[href]","area[href]","button","input","select","textarea","iframe","object","embed","summary","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"[tabindex]"].join(","),l=()=>{let g=[...o.querySelectorAll('[role="dialog"][aria-modal="true"]')].filter(T=>T.isConnected&&!T.closest('[hidden], [aria-hidden="true"], [inert]'));return g[g.length-1]??o},c=(g,T)=>{let w=g;for(;w;){let v=window.getComputedStyle(w);if(w.hidden||w.getAttribute("aria-hidden")==="true"||w.hasAttribute("inert")||v.display==="none"||v.visibility==="hidden"||v.visibility==="collapse")return!0;if(w===T)return!1;w=w.parentElement}return!0},d=g=>[...g.querySelectorAll(a)].filter(T=>T.tabIndex>=0&&!T.matches(":disabled")&&!c(T,g)),p=(g,T)=>{let w=d(g),v=T?w[w.length-1]:w[0];v?v.focus({preventScroll:!0}):(g.hasAttribute("tabindex")||(g.tabIndex=-1),g.focus({preventScroll:!0}))},u=!1,h=()=>{if(u)return;u=!0,document.body.style.overflow=s,r.escHandler&&document.removeEventListener("keydown",r.escHandler),n.remove(),r.modalScrim=null;let g=r.prevFocus;r.prevFocus=null,g?.isConnected&&g.focus({preventScroll:!0});let T=()=>{r.destroy(),e.onClose?.()};r.hold&&!r.handedOff?r.release().finally(T):T()};r.closeModal=h,n.addEventListener("mousedown",g=>{g.target===n&&h()}),r.escHandler=g=>{if(g.key==="Tab"){if(g.defaultPrevented)return;let T=l(),w=d(T),v=w[0],A=w[w.length-1],D=document.activeElement;!v||!A?(g.preventDefault(),p(T,g.shiftKey)):D===T||!D||!T.contains(D)?(g.preventDefault(),(g.shiftKey?A:v).focus({preventScroll:!0})):g.shiftKey&&D===v?(g.preventDefault(),A.focus({preventScroll:!0})):!g.shiftKey&&D===A&&(g.preventDefault(),v.focus({preventScroll:!0}));return}g.key==="Escape"&&(r.tableDialog?(g.preventDefault(),r.cancelTableDialog()):r.confirmSeat?(g.preventDefault(),r.cancelConfirm()):r.bestAvailableConfirm?(g.preventDefault(),r.bestAvailableConfirm=!1,r.syncTray()):(g.preventDefault(),h()))},document.addEventListener("keydown",r.escHandler);let y=r.render();return r.els.close?.classList.add("on"),r.els.close?.addEventListener("click",h),await y,r.destroyed||p(l(),!1),r}wireController(e){return new H.PickerController({sectionPreview:!0,transport:this.api,eventKey:e.event,maxSelection:this.maxTickets,selectedObjects:e.selectedObjects,selectableObjects:e.selectableObjects,numberOfPlacesToSelect:e.numberOfPlacesToSelect,selectionValidators:e.selectionValidators,currency:e.currency,flashOnLiveChange:!0,colorblindSafe:this.cbSafe,...e.loadingReveal?{loadingReveal:e.loadingReveal}:{},mapTheme:Tt(e.theme),onSeatsRevealed:()=>{this.seatsRevealed=!0,e.onSeatsRevealed?.(),this.seatsRevealedReport?.()},onGAClick:t=>{let n=this.controller.getGAAreas().find(o=>o.id===t);n&&(this.collapseSheet(),jn(this,n,this.lastMapPoint))},onSelectionChange:()=>{this.syncTray(),this.minimap?.refreshMinimap(),this.committedSelection().length&&this.collapseSectionCard(),this.syncSelectionTo3d()},onStatusChange:(t=>{this.syncSeatMarks(),this.syncPrices(),this.a11yMenu?.syncCounts(),fr(t)&&this.scheduleOfferRefresh(!0),this.evictTakenSelections(),this.detectBooked(),this.minimap?.refreshMinimap(),this.pushAvailabilityTo3d()}),onHoldExpired:()=>{let t=this.handedOff,n=this.holdConflicted;this.holdExpiredUnits=gl(this.hold),this.hold=null,this.forgetHold(),this.handedOff=!1,this.bookedShown=!1,this.holdConflicted=!1,this.ctaPhase="idle",this.stopHoldTimer(),this.gaQty.clear(),this.lapse.deferExpiryToast(()=>{if(t||n){this.toast((0,H.t)("picker.holdExpired",void 0)||"Your hold expired \u2014 seats released. Pick again.","warning");return}this.showHoldExpired()}),this.syncTray(),this.emitHoldChange(),this.opts.onHoldExpired?.()},onAvailabilityRefresh:t=>this.lapse.handle(t),confirmSelection:this.opts.confirmSelection,onSelect:t=>{if(this.salesClosed){this.controller.deselect([t.id]),this.toast(this.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}this.controller.tableSelection(t.id)||(this.collapseSheet(),this.flashPickedSeat(t.id),this.opts.confirmSelection&&this.suppressConfirmationSeatId!==t.id&&this.showConfirm(t))},onTableSelectionRequest:t=>{if(this.salesClosed){this.controller.deselect(t.physicalSeatIds),this.toast(this.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}this.showTableDialog(t,!1)},onDeselect:t=>{if(this.controller.currentHold()?.labels.includes(t.label)){if(this.opts.confirmSelection===!1||this.salesClosed){this.removeHeldLabels([t.label]);return}if(this.confirmSeat?.id===t.id){this.dismissConfirm();return}this.showConfirm(t,"remove");return}if(this.confirmSeat?.id===t.id){this.dismissConfirm();return}if(this.tableDialog?.physicalSeatIds.includes(t.id)){this.dismissTableDialog();return}this.opts.confirmSelection===!1||this.salesClosed||this.controller.tableSelection(t.id)||(this.controller.select([t.id]),this.showConfirm(t,"remove"))},onSelectionLimit:()=>{this.toast((0,H.t)("picker.maxTicketsForOrder",{count:this.maxTickets}),"warning"),this.opts.onSelectionLimit?.(this.maxTickets)},onViewChange:()=>{this.reanchorConfirm(),this.syncRung(),this.syncProjection(),this.minimap?.drawMinimapRect(),this.sectionCardOnView()},onSectionFocus:t=>this.showSectionCard(t),onDeckTap:()=>{this.showSectionCard(null),this.syncFloors(),this.syncRung(),this.minimap?.refreshMinimap()},onFocusSeat:t=>this.announceSeat(t),onSeatHover:t=>this.updateTooltip(t),hostCardOpen:()=>this.tipPinned||!!this.confirmSeat,onHint:t=>{t&&this.toast(t)},onSalesClosed:()=>this.setSalesClosed(!0),onError:t=>this.opts.onError?.(t)})}async render(){if(this.rendered)return this;let e=performance.now(),t={},n=h=>Math.round((performance.now()-h)*100)/100;this.rendered=!0,Ot();let o=performance.now(),s=_i(this.opts.locale,this.opts.messages),r=this.localeGeneration+=1;this.checkoutMode==="hosted"&&(this.paymentOptions=this.pubApi.paymentOptions(this.opts.event));let a=performance.now(),l=Ko(this.opts.container),{root:c,els:d,mapHost:p}=ys(l,(h,y)=>this.tf(h,y),this.opts.theme);this.root=c,this.els=d,this.mapHost=p,Ni(c,s,h=>{t.loadLocale=n(o),this.destroyed||this.applyActiveLocale(h,r)}),ia(c,()=>[{open:()=>!!this.holdExpiredEl,close:()=>this.restartAfterHoldExpiry()},{open:()=>this.tipPinned,close:()=>this.unpinTooltip()},{open:()=>!!this.tableDialog,close:()=>this.cancelTableDialog()},{open:()=>!!this.confirmSeat,close:()=>this.cancelConfirm()},{open:()=>this.bestAvailableConfirm,close:()=>{this.bestAvailableConfirm=!1,this.syncTray()}}]),this.syncFullscreenButtons(),this.wireBuyerShell(c);let u=document.createElement("div");return u.style.cssText="position:absolute;inset:0",this.mapHost.appendChild(u),t.mountBuyerShell=n(a),t.skeletonPaint=n(e),this.loadAndFinishChart(u,t,n,e,c)}async loadAndFinishChart(e,t,n,o,s){this.startRealtime();let r=await this.loadChart(e,t,n);if(!r)return this.realtime?.stop(),this.realtime=null,this;t.shellsPaint=n(o);let a=performance.now();if(this.salesClosed=!!r.salesClosed||!!this.opts.readOnly,s.dataset.eventMode=r.mode==="test"?"test":"live",!this.opts.locale&&r.locale&&this.setLocale(r.locale),this.controller.setViewMode(this.normalizeInitialView(this.opts.initialView)),this.buildRegions(),this.regions["bottom-right"].appendChild(this.els.zoom),this.regions["bottom-center"].appendChild(this.els.toast),r.mode==="test"){let v=document.createElement("div");v.className="sl-testbadge",v.textContent=qo((0,H.t)("picker.testMode"),(0,H.getLocale)()),v.setAttribute("aria-label",(0,H.t)("picker.testMode")),v.title=this.tf("picker.testModeExplained","Bookings here are not real and no card is charged"),this.regions["top-left"].appendChild(v)}let l=this.controller.doc?.theme;this.themeMode=this.opts.theme?.mode??null,this.applyThemeTokens(s),this.watchThemeMode(),this.currency=r.currency??this.opts.currency??"USD",this.eventTimezone=r.timezone??null,Wo(this.els.logo,[this.opts.theme?.logoUrl,l?.logoUrl,r.posterUrl],this.opts.theme?.brandName??l?.brandName??r.eventName??"?"),this.els.name.textContent=r.eventName??"";let c=r.startsAt?Li(r.startsAt,r.timezone??null,this.opts.locale):"";this.eventWhenText=c||null,this.els.meta.textContent=[r.venue,c].filter(Boolean).join(" \xB7 "),this.syncProjection(),this.buildBadge(l);let d=!!this.controller.doc&&this.controller.getExpandedSeats().some(v=>v.commercial?.restrictedView||v.commercial?.obstructedView);this.buildAccessibilityMenu(d),this.buildLanguageSwitcher(this.els.zoom??this.regions["bottom-right"]),this.srEl=document.createElement("div"),this.srEl.className="sl-sr",this.srEl.setAttribute("aria-live","polite"),s.appendChild(this.srEl),this.buildArenaChrome(),this.buildMinimap(),this.buildPriceFilter(),this.buildExtendPrompt(),this.buildBookedOverlay(),this.buildSoldoutOverlay(),this.buildPanelToggle(),this.opts.panelCollapsed&&this.setPanelCollapsed(!0),this.dockLayoutChrome(),t.buildBuyerControls=n(a);let p=performance.now();if(!await this.restoreHoldForFirstPaint(t))return this;if(t.restoreHold=n(p),this.destroyed)return this;this.dismissSkeleton(),this.salesClosed&&this.applySalesClosed(),this.syncPrices(),this.syncTray(),this.resumeHostedOrder();let u=this.controller.doc,h=Xi(this.opts.event),y=this.performanceGroup?.surface??(this.performanceGroup?"performance_group":null),g=y??"event",T={apiBase:this.apiBase,eventKey:this.opts.event,metricScope:g,surface:y==="season"?"season_picker":y==="performance_group"?"performance_group_picker":"seat_picker",ms:n(o),performanceProfile:t,chartDelivery:r.chartDelivery,seatCount:this.allSeats().length,objectCount:u?.objects.length??0,sectionCount:u?.objects.filter(v=>v.type==="section").length??0,floorCount:this.controller.getFloors().length,chartName:u?.name,view:this.buyerView,load:h,transport:this.opts.transport?"custom":"pubapi"};la(T,(v,A)=>this.emitAnalytics(v,A));let w=r.performanceProfile;return this.seatsRevealedReport=()=>this.emitAnalytics("chart_seats_revealed",lo({...T,performanceProfile:{...T.performanceProfile,...w}})),this.seatsRevealed&&this.seatsRevealedReport(),this.renderInfo=r,await this.registerAgentTools(),this}registerAgentTools(){return aa(this)}webMcpHost(e){return ao(this,e)}wireBuyerShell(e){this.refreshOfferAvailability(!1),this.api.availability&&(this.offerVisibilityHandler=()=>{!document.hidden&&!this.destroyed&&this.refreshOfferAvailability(!1)},document.addEventListener("visibilitychange",this.offerVisibilityHandler)),this.detachAttention=Sl(()=>{this.destroyed||this.controller.refreshAvailability()}),this.observeLayout(e),this.els.zin.addEventListener("click",()=>this.controller.zoomIn()),this.els.zout.addEventListener("click",()=>this.controller.zoomOut()),this.els.zfit?.addEventListener("click",()=>this.controller.overview()),this.els.zfs.addEventListener("click",()=>this.toggleFullscreen()),this.fsChangeHandler=()=>{document.fullscreenElement||this.setFsFallback(!1),this.syncFullscreenButtons(),requestAnimationFrame(()=>this.controller.refitCurrentView())},document.addEventListener("fullscreenchange",this.fsChangeHandler);let t=this.els.sheetHead;if(t){let o=this.els.sheetToggle;this.syncSheetAffordance();let s=0,r=!1,a=!1,l=!1;o?.addEventListener("click",c=>{c.stopPropagation(),!r&&this.cycleSheet()}),t.addEventListener("pointerdown",c=>{if(c.target.closest?.(".sl-seccard")){a=!1;return}l=!!c.target.closest?.(".sl-sheet-toggle"),a=!0,r=!1,s=c.clientY,(l&&o?o:t).setPointerCapture?.(c.pointerId)}),t.addEventListener("pointermove",c=>{if(!a||r)return;let d=c.clientY-s;d<-18?(this.stepSheet(1),r=!0):d>18&&(this.stepSheet(-1),r=!0)}),t.addEventListener("pointerup",c=>{a&&!r&&!l&&Math.abs(c.clientY-s)<6&&this.cycleSheet(),a=!1,(l&&o?o:t).releasePointerCapture?.(c.pointerId),l=!1})}this.els.foot?.addEventListener("click",o=>{this.root?.dataset.layout==="narrow"&&(o.target.closest?.('.sl-chip,button,a,input,select,label,[role="button"]')||this.cycleSheet())});let n=()=>{if(this.root?.dataset.layout!=="narrow")return;let o=this.root.getAttribute("data-prices-open")==="true";this.root.setAttribute("data-prices-open",String(!o)),this.els.pricesSec?.setAttribute("aria-expanded",String(!o)),!o&&this.root.dataset.sheet!=="open"&&this.setSheetOpen(!0)};this.els.pricesSec?.addEventListener("click",o=>{o.target.closest("select,button")||n()}),this.els.pricesSec?.addEventListener("keydown",o=>{o.key!=="Enter"&&o.key!==" "||o.target.closest("select,button")||(o.preventDefault(),n())}),e.addEventListener("click",o=>{let s=o.target.closest("[data-sl-info]");if(!s||!e.contains(s))return;o.stopPropagation();let r=s.closest(".sl-info"),a=!r?.classList.contains("open");this.closeInfoPops(r),r?.classList.toggle("open",a),s.setAttribute("aria-expanded",String(a))}),e.addEventListener("pointerdown",o=>{o.target.closest(".sl-info")||this.closeInfoPops()}),this.tipEl=document.createElement("div"),this.tipEl.setAttribute("role","tooltip"),this.tipEl.className="sl-tip",this.els.map.appendChild(this.tipEl),this.els.map.addEventListener("pointerdown",o=>{this.handleMapPointerDown(o)},!0),this.els.map.addEventListener("mousemove",o=>{if(this.tipPinned)return;let s=this.els.map.getBoundingClientRect();this.tipPos={x:o.clientX-s.left,y:o.clientY-s.top},this.tipEl&&this.tipEl.style.display!=="none"&&this.placeTooltip()}),this.els.cta.addEventListener("click",()=>{this.els.cta.dataset.act==="find"?this.openBestSeatsForm():this.handleCta()})}sheetState(){let e=this.root?.dataset.sheet;return e==="mini"||e==="open"?e:"peek"}sheetHasCards(){return this.root?.getAttribute("data-has-selection")==="true"}setSheetState(e){let t=this.root;if(!t)return;let n=t.dataset.sheet;t.dataset.sheet=e==="mini"&&!this.sheetHasCards()?"peek":e,this.syncSheetAffordance(),n==="mini"&&t.dataset.sheet!=="mini"&&this.scheduleFit()}syncSheetAffordance(){let e=this.sheetState(),t=e==="open"||e==="peek"&&this.sheetHasCards(),n=this.els.sheetToggle;n?.setAttribute("aria-expanded",String(e==="open")),n?.setAttribute("aria-label",t?this.tf("picker.collapseTicketPanel","Collapse ticket panel"):this.tf("picker.openTicketPanel","Open ticket panel"))}cycleSheet(){let e=this.sheetState();e==="open"||e==="mini"?this.setSheetState("peek"):this.setSheetState(this.sheetHasCards()?"mini":"open")}stepSheet(e){let t=go.indexOf(this.sheetState()),n=Math.min(go.length-1,Math.max(0,t+e));this.setSheetState(go[n])}setSheetOpen(e){this.setSheetState(e?"open":"peek")}openBestSeatsForm(){this.setSheetOpen(!0),this.els.tray?.querySelector(".sl-ba")?.scrollIntoView({block:"nearest",behavior:this.reducedMotion()?"auto":"smooth"}),this.els.tray?.querySelector(".sl-ba-go")?.focus()}collapseSheet(){let e=this.root;!e||e.dataset.layout!=="narrow"||e.dataset.sheet!=="open"||this.setSheetState("peek")}observeLayout(e){let t=()=>{let n=e.clientWidth;if(n<=0)return;let o=e.clientHeight,s=n!==this.pickerLayoutSize.width||o!==this.pickerLayoutSize.height;this.pickerLayoutSize={width:n,height:o};let r=this.fullscreenMeasurementChanged(n,o);this.reportFramedHeight();let a=n<640?"narrow":"wide",l=o<560?"compact":"comfortable",c=e.dataset.layout!==a||e.dataset.density!==l;c&&(e.dataset.layout=a,e.dataset.density=l,this.controller.setNarrowLayout?.(a==="narrow"),queueMicrotask(()=>this.syncFitClearance()),this.controller.getRenderer()?.setSectionFocusDim?.(a!=="narrow"),a==="narrow"&&!e.dataset.sheet&&(e.dataset.sheet="peek"),this.dockLayoutChrome(),this.syncMinimapForLayout(),this.lastTrayKeys.size&&this.syncTray(),this.syncMapStepBack(),this.refreshExtendPrompt()),(r||c)&&this.syncFullscreenAffordance(),this.syncArenaViewportInsets(),s&&(this.minimap?.refreshMinimap(),this.scheduleFit())};this.ro=new ResizeObserver(t),this.ro.observe(e),this.viewportResizeHandler=()=>{this.fullscreenMeasurementChanged(e.clientWidth,e.clientHeight)&&this.syncFullscreenAffordance()},window.addEventListener("resize",this.viewportResizeHandler),t(),requestAnimationFrame(t)}async loadChart(e,t,n){let o=performance.now();this.loadAbort=new AbortController;let s=await At(()=>this.controller.render(e),this.loadAbort.signal,()=>{let a=this.els.boot.querySelector(".sl-boot-say");a&&(a.classList.add("is-visible"),a.textContent=this.tf("picker.loadingTakingLonger","The seat map is taking longer to load. Please wait\u2026"))});if(this.loadAbort=null,s.outcome==="cancelled"||this.destroyed)return null;let r=s.outcome==="loaded"?s.value:null;return r||this.controller.destroy(),t.loadChartAndStatuses=n(o),this.destroyed?null:r?(Object.assign(t,r.performanceProfile),r):(Ae({apiBase:this.apiBase,event:this.opts.event,scope:this.performanceGroup?.surface??(this.performanceGroup?"performance_group":"event"),surface:this.performanceGroup?.surface==="season"?"season_picker":this.performanceGroup?"performance_group_picker":"seat_picker",outcome:"failure",stage:s.outcome==="timeout"?"load_timeout":s.outcome==="error"?"render_error":"load_chart",ms:t.loadChartAndStatuses,performanceProfile:t,view:"map",load:Oe(this.opts.event),transport:this.opts.transport?"custom":"pubapi"}),ai(this.els.boot,{title:this.tf("picker.mapDidNotLoad","The seat map didn\u2019t load"),description:this.tf("picker.checkConnection","Check your connection and try again."),actionLabel:this.tf("picker.accessRetry","Try again")}),this.els.boot.querySelector("button").addEventListener("click",()=>{if(this.destroyed||!this.root)return;this.controller=this.wireController(this.opts),ai(this.els.boot,{title:this.tf("picker.loadingSeatMap","Loading seat map\u2026"),busy:!0});let a=performance.now();this.loadAndFinishChart(e,{},n,a,this.root)},{once:!0}),null)}async restoreHoldForFirstPaint(e){let t=[this.els.side,this.els.rail].filter(Boolean),n=t.map(o=>o.hasAttribute("inert"));t.forEach(o=>o.setAttribute("inert",""));try{for(;!this.destroyed;){let o=performance.now();try{return await this.restoreRememberedHold(),!this.destroyed}catch{if(this.destroyed)return!1;Ae({apiBase:this.apiBase,event:this.opts.event,scope:this.performanceGroup?.surface??(this.performanceGroup?"performance_group":"event"),surface:this.performanceGroup?.surface==="season"?"season_picker":this.performanceGroup?"performance_group_picker":"seat_picker",outcome:"failure",stage:"restore_hold",ms:performance.now()-o,performanceProfile:e,view:"map",load:Oe(this.opts.event),transport:this.opts.transport?"custom":"pubapi"});let r=ai(this.els.boot,{title:this.tf("picker.restoreUnavailableTitle","Unable to check saved seats"),description:this.tf("picker.restoreUnavailable","Try again to check whether your saved seats are still held."),actionLabel:this.tf("picker.accessRetry","Try again")}),a=this.transportAbort.signal;if(await new Promise(l=>{let c=()=>{r.removeEventListener("click",c),a.removeEventListener("abort",c),l()};r.addEventListener("click",c,{once:!0}),a.addEventListener("abort",c,{once:!0}),a.aborted&&c()}),this.destroyed||a.aborted)return!1;ai(this.els.boot,{title:this.tf("picker.restoringSeats","Checking your saved seats\u2026"),busy:!0})}}return!1}finally{t.forEach((o,s)=>{n[s]||o.removeAttribute("inert")})}}resumeHostedOrder(){if(this.checkoutMode!=="hosted")return;let e=kn(this.opts.event);e?.outcome!=="success"||!e.orderId||this.openCheckoutPanel({kind:"resume",orderId:e.orderId})}buildPanelToggle(){if(!this.regions["top-right"])return;let e=document.createElement("button");e.type="button",e.className="sl-side-toggle",e.addEventListener("click",()=>this.setPanelCollapsed(!this.sideCollapsed)),this.sideToggleEl=e,this.regions["top-right"].appendChild(e),this.syncPanelToggle()}syncPanelToggle(){let e=this.sideToggleEl;if(!e)return;let t=this.sideCollapsed;e.setAttribute("aria-expanded",String(!t)),e.setAttribute("aria-label",t?this.tf("picker.showTicketPanel","Show the ticket panel"):this.tf("picker.hideTicketPanel","Hide the ticket panel")),e.title=t?this.tf("picker.showTicketPanel","Show the ticket panel"):this.tf("picker.hideTicketPanel","Hide the ticket panel"),e.innerHTML=t?`<svg viewBox="0 0 24 24"><path d="M15 6l-6 6 6 6"/></svg><span>${this.tf("picker.tickets","Tickets")}</span>`:'<svg viewBox="0 0 24 24"><path d="M9 6l6 6-6 6"/></svg>'}setPanelCollapsed(e){this.destroyed||(this.sideCollapsed=e,this.applyPanelCollapsed(),this.scheduleMotion(()=>this.controller.refitCurrentView(),340))}applyPanelCollapsed(){let e=this.root?.dataset.layout!=="narrow";this.root?.setAttribute("data-side-collapsed",String(this.sideCollapsed)),this.els.side?.toggleAttribute("inert",this.sideCollapsed&&e),this.syncPanelToggle()}buildAccessibilityMenu(e){let t=this.els.zoom??this.regions["bottom-right"]??this.els.map;t&&(this.a11yMenu=new wn(t,{event:String(this.opts.event),chart:()=>this.controller.doc?.name??null,needs:()=>this.controller.getAccessNeeds(),hasLimitedView:e,tf:(n,o)=>this.tf(n,o),isColorblindSafe:()=>this.cbSafe,setColorblindSafe:n=>this.setColorblindSafe(n),isLimitedViewHidden:()=>this.limitedViewFilter,setLimitedViewHidden:n=>{this.limitedViewFilter=n,this.controller.setCommercialLimitedFilter(n),this.pushAvailabilityTo3d()},applyAccessibilityFilter:n=>this.applyAccessibilityFilter(n),focusSeatsForFilter:()=>this.focusSeatsForFilter(),stepToAccessibleSection:n=>this.controller.focusNextAccessibleSection?.([n])??null}),this.cbEl=this.a11yMenu.colorblindRow())}focusSeatsForFilter(){if(this.controller.focusAccessibilityFilter?.()){this.explainAccessibilitySpread();return}this.rungsEl&&this.controller.getRung()!=="seats"&&(this.controller.setRung("seats"),this.collapseSectionCard(),this.syncRung())}explainAccessibilitySpread(){let e=this.controller.accessibilitySpread?.();!e?.wholeVenue||e.sections.length<2||this.toast((0,H.t)("picker.accessSpreadHint",{count:e.spaces,sections:e.sections.length}),"neutral")}applyAccessibilityFilter(e){this.controller.setAccessibilityFilter(e),this.syncPrices(),this.minimap?.refreshMinimap(),this.pushAvailabilityTo3d()}setAccessibilityFilter(e){this.applyAccessibilityFilter(e),this.a11yMenu?.syncAccessibilityFilter(e),e?.length&&this.focusSeatsForFilter()}focusAccessibilityFilter(){this.focusSeatsForFilter()}dockLayoutChrome(){let e=this.root?.dataset.layout==="narrow";this.applyPanelCollapsed();let t=this.els.zfs,n=this.els.headInfo?.parentElement;t&&n&&t.parentElement!==n&&(t.classList.add("sl-fs-pill"),n.insertBefore(t,this.els.hold??null));let o=this.extendEl;if(o){let r=e?this.regions["bottom-center"]??this.els.map:n;r&&o.parentElement!==r&&(o.dataset.dock=e?"map":"head",r===n?r.insertBefore(o,this.els.close??null):r.appendChild(o))}let s=this.els.pricesSec;s&&(e?(s.setAttribute("role","button"),s.tabIndex=0,s.setAttribute("aria-expanded",String(this.root?.getAttribute("data-prices-open")==="true"))):(s.removeAttribute("role"),s.removeAttribute("aria-expanded"),s.tabIndex=-1)),this.lastSection&&this.renderSectionCard(this.lastSection)}buildExtendPrompt(){Va(this)}buildBookedOverlay(){let e=document.createElement("div");e.className="sl-booked",e.setAttribute("role","status"),e.setAttribute("aria-live","polite"),e.innerHTML=`<div class="sl-booked-badge"><svg viewBox="0 0 24 24"><path d="M20 6L9 17l-5-5"/></svg></div><div class="sl-booked-title">${this.tf("picker.allSetTitle","You're all set")}</div><div class="sl-booked-sub" data-ref="bookedSub"></div><ul class="sl-booked-list" data-ref="bookedList"></ul><button type="button" class="sl-booked-back" data-ref="bookedBack"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M15 18l-6-6 6-6"/></svg><span>${B(this.tf("picker.backToMap","Back to map"))}</span></button>`,this.root.appendChild(e),this.bookedEl=e,this.els.bookedSub=e.querySelector('[data-ref="bookedSub"]'),this.els.bookedList=e.querySelector('[data-ref="bookedList"]'),e.querySelector('[data-ref="bookedBack"]')?.addEventListener("click",()=>this.dismissBooked())}get onGAPromptHook(){return this.opts.onGAPrompt}tf(e,t){return b(e,t)}buildSoldoutOverlay(){if(!this.els.map)return;let e=document.createElement("div");e.className="sl-soldout",e.setAttribute("role","status");let t=(this.controller.doc?.theme?.brandName??this.opts.theme?.brandName??this.els.name?.textContent??this.tf("picker.soldOutEyebrow","This event")).toUpperCase(),n=document.createElement("div");n.className="sl-soldout-eyebrow",n.textContent=t;let o=document.createElement("div");o.className="sl-soldout-title",o.textContent=this.tf("picker.soldOutTitle","Sold out");let s=document.createElement("p");s.className="sl-soldout-copy",s.textContent=this.tf("picker.soldOutCopy","No reserved seats are currently available for this event."),e.append(n,o,s),this.els.map.appendChild(e),this.soldoutEl=e}syncSoldout(e,t){let n=this.controller.getGAAreas().length>0,o=this.isSoldOut(e,t,n);o!==this.soldOut&&(this.soldOut=o,this.soldoutEl?.classList.toggle("on",o))}isSoldOut(e,t,n){return!n&&e.length>0&&e.every(o=>(t[o.key]??0)===0)}setSalesClosed(e){let t=e||!!this.opts.readOnly;this.salesClosed!==t&&(this.salesClosed=t,this.applySalesClosed())}applySalesClosed(){this.salesClosed&&this.tableDialog&&!this.tableDialogHeld&&this.cancelTableDialog();let e=this.els.closedPill;if(e){e.classList.toggle("on",this.salesClosed);let t=this.els.closedPillText??e;t.textContent=this.tf("picker.salesClosedPill","Sales are closed")}this.root?.setAttribute("data-sales-closed",String(this.salesClosed)),this.salesClosed&&this.srEl&&(this.srEl.textContent=this.tf("picker.salesClosedToast","Sales are closed for this event.")),this.syncCta(),this.syncTray()}badgeHidden(e){return!!e?.hideBadge}buildBadge(e){if(this.badgeHidden(e))return;let t=this.els.foot;if(!t)return;let n=document.createElement("a");n.className="sl-powered",n.href="https://seatlayer.io/?ref=picker",n.target="_blank",n.rel="noopener noreferrer",n.setAttribute("aria-label",this.tf("picker.poweredBy","Powered by SeatLayer"));let o=document.createElement("span");o.className="sl-powered-mark",o.setAttribute("aria-hidden","true"),o.innerHTML=ji;let s=document.createElement("span");s.textContent=this.tf("picker.poweredBy","Powered by SeatLayer"),n.append(o,s),t.appendChild(n)}buildRegions(){if(!this.els.map)return;let e=["top-left","top-center","top-right","left-rail","bottom-left","bottom-center","bottom-right"];for(let t of e){let n=document.createElement("div");n.className="sl-anchor",n.dataset.region=t,this.els.map.appendChild(n),this.regions[t]=n}}cssVar(e){return this.root?getComputedStyle(this.root).getPropertyValue(e).trim():""}reducedMotion(){return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}scheduleMotion(e,t){let n=setTimeout(()=>{this.motionTimers.delete(n),this.destroyed||e()},t);this.motionTimers.add(n)}animateOnce(e,t,n=600){!e||this.reducedMotion()||(e.classList.remove(t),e.offsetWidth,e.classList.add(t),this.scheduleMotion(()=>e.classList.remove(t),n))}flashPickedSeat(e){this.reducedMotion()||this.controller.flashSeat(e,this.cssVar("--sl-accent")||"#f4b740")}flashHeldSeats(e){let t=this.reducedMotion(),n=(e.items??[]).filter(o=>o.objectType!=="ga").slice(0,10).map(o=>this.controller.seatByLabel(o.label)).filter(o=>!!o);Zs({regions:this.els,categories:this.controller.doc?.categories,pop:o=>this.controller.flashSeat(o,this.cssVar("--sl-accent")||"#f4b740"),focus:(o,s)=>this.controller.focusSection(o,s),focusSeats:o=>this.controller.focusSeats?.(o,{animate:!t})===!0,reducedMotion:t,screenPoint:o=>this.controller.worldToScreen(o),schedule:(o,s)=>this.scheduleMotion(o,s)},n)}committedSelection(){let e=this.confirmSeat?.id,t=this.tableDialog&&!this.tableDialogHeld?this.tableDialog.id:null;return this.controller.getSelection().filter(n=>n.id!==e&&n.id!==t)}pendingSelectionCount(){return $a(this)}heldTicketCount(){return ja(this)}totalTicketCount(){return Ga(this)}updateSelectionCapacity(){Ua(this)}syncCta(e=this.lastTrayCount,t=this.pendingSelectionCount()){qa(this,e,t)}setCtaPhase(e){Ka(this,e)}runCheckoutHandoff(e,t){return Wa(this,e,t)}holdStorageKey(){return Ya(this)}rememberedHoldId(){return Xa(this)}rememberHold(e){Za(this,e)}forgetHold(){Qa(this)}resumeHoldFromServer(e,t=!1){return Ja(this,e,t)}restoreRememberedHold(){return el(this)}activeFloorObjects(){let e=this.controller.doc;if(!e)return[];let t=e.floors;if(t?.length){let n=this.controller.getActiveFloorId();return(t.find(o=>o.id===n)??t[0]).objects??[]}return e.objects??[]}buildMinimap(){!this.els.map||this.root?.dataset.layout==="narrow"||(this.minimap=Zr({controller:this.controller,root:()=>this.root,cssVar:e=>this.cssVar(e),focusedSectionLabel:()=>this.lastSection?.label},this.regions["bottom-left"]??this.els.map))}syncMinimapForLayout(){let e=this.root?.dataset.layout==="narrow";if(e&&this.minimap){this.minimap.dispose(),this.minimap=null;return}!e&&!this.minimap&&this.buildMinimap()}catPrice(e){return gn(this,e)}catPriceRange(e){return bn(this,e)}buildPriceFilter(){dl(this)}applyPriceBand(e){pl(this,e)}buildArenaChrome(){let e=this.controller.doc;if(this.rungsEl=null,this.projectionEl=null,this.floorsEl=null,!e||!this.els.map){this.syncArenaViewportInsets();return}let t=e.objects.some(n=>n.type==="section")||(e.floors??[]).some(n=>n.objects.some(o=>o.type==="section"));if(this.canOffer3d()){let n=document.createElement("div");n.className="sl-projection",n.setAttribute("role","group"),n.setAttribute("aria-label",this.tf("picker.venueView","Venue view")),n.innerHTML=`<button type="button" data-view="map" aria-pressed="true" title="${this.tf("picker.flat2dMap","Flat 2D map")}">${this.tf("picker.map","Map")}</button><button type="button" data-view="venue3d" aria-pressed="false" title="${this.tf("picker.interactive3dVenueView","Interactive 3D venue view")}">3D</button>`,n.querySelectorAll("button").forEach(o=>{if(o.dataset.view==="venue3d")for(let s of["pointerenter","focus","pointerdown"])o.addEventListener(s,Ci,{once:!0});o.addEventListener("click",()=>{this.setBuyerView(o.dataset.view)})}),this.regions["top-right"].appendChild(n),this.projectionEl=n,this.syncProjection()}if(t){let n=[...e.objects,...(e.floors??[]).flatMap(p=>p.objects)],o=new Set((e.zones??[]).map(p=>p.id)),a=e.floorOverview==="combined"&&(e.floors?.length??0)>1&&o.size===0||n.some(p=>p.type==="section"&&typeof p.zone=="string"&&o.has(p.zone))?["zones","sections","seats"]:["sections","seats"],l=document.createElement("div");l.className="sl-rungs on sl-mo-indicator",l.setAttribute("role","group"),l.setAttribute("aria-label",(0,H.t)("picker.zoomLevel"));let c={zones:(0,H.t)("picker.rungLabel.zones"),sections:(0,H.t)("picker.rungLabel.sections"),seats:(0,H.t)("picker.rungLabel.seats")},d={zones:(0,H.t)("picker.rungTip.zones"),sections:(0,H.t)("picker.rungTip.sections"),seats:(0,H.t)("picker.rungTip.seats")};l.innerHTML=a.map(p=>`<button type="button" data-rung="${p}" title="${d[p]}" aria-pressed="false">${c[p]}</button>`).join(""),l.querySelectorAll("button").forEach(p=>{p.addEventListener("click",()=>{let u=p.dataset.rung;this.controller.setRung(u),u==="seats"&&this.collapseSectionCard()})}),this.regions["top-center"].appendChild(l),this.rungsEl=l,this.syncRung()}if(this.controller.isMultiFloor()){let n=vr({floors:this.controller.getFloors(),tf:(o,s)=>this.tf(o,s),onChoose:o=>{o===""?this.controller.setFloorOverview(!0):this.controller.setFloor(o),this.showSectionCard(null),this.syncFloors(),this.syncRung(),this.minimap?.refreshMinimap()}});this.regions["top-left"].appendChild(n),this.floorsEl=n,this.syncFloors()}this.syncArenaViewportInsets()}syncArenaViewportInsets(){let e=this.els.map,t=e?yr(e.getBoundingClientRect(),[this.floorsEl,this.rungsEl,this.projectionEl].map(n=>n?.isConnected?n.getBoundingClientRect():null),[]):{top:0,right:0,bottom:0,left:0};Object.keys(t).every(n=>t[n]===this.arenaViewportInsets[n])||(this.arenaViewportInsets=t,this.controller.setViewportInsets(t),this.syncFitClearance())}syncFitClearance(){let e=this.els.map,t=this.els.zoom,n=this.root?.dataset.layout==="narrow",o=0;if(n&&e&&t?.isConnected){let s=e.getBoundingClientRect(),r=t.getBoundingClientRect();r.height>0&&(o=Math.max(0,s.bottom-r.top+8))}this.controller.setFitClearance?.(o)}syncRung(){let e=this.controller.getRung(),t=this.controller.seatsRevealed?.()??(e==="seats"||!!this.controller.getFocusedSection?.());this.root&&(this.root.dataset.zoomed=String(t)),this.syncMapStepBack(),this.minimap?.setAutoOpen(!1),this.rungsEl&&this.rungsEl.querySelectorAll("button").forEach(n=>{let o=n.dataset.rung===e;n.classList.toggle("on",o),n.setAttribute("aria-pressed",String(o))})}syncMapStepBack(){let e=this.els?.zout,t=this.els?.zfit,n=this.els?.zin;if(!e||!this.root)return;let o=this.controller.getRenderer?.(),s=this.controller.canZoomIn?.()===!1||o?.seatsPickable?.()===!0,r=br({focusedSection:this.controller.getFocusedSection?.()??null,seatsRevealed:this.controller.seatsRevealed?.()??!0,atVenueFit:this.controller.atVenueFit?.()})==="none",a=e.disabled!==r||!!t&&t.disabled!==r||!!n&&n.disabled!==s||e.hidden||!!n?.hidden||!!t?.hidden;e.disabled=r,e.hidden=!1,n&&(n.disabled=s,n.hidden=!1),t&&(t.disabled=r,t.hidden=!1),a&&this.a11yMenu?.refit()}syncProjection(){this.els.pricesHint&&(this.els.pricesHint.textContent=this.buyerView==="venue3d"?this.tf("picker.priceHint3d","Colours in the venue are ticket types \u2014 choose one below to show just those seats."):this.tf("picker.priceHint","Colours on the map are ticket types \u2014 tap one below to show just those seats.")),this.projectionEl&&this.projectionEl.querySelectorAll("button").forEach(e=>{let t=e.dataset.view===this.buyerView;e.classList.toggle("on",t),e.setAttribute("aria-pressed",String(t))})}canOffer3d(){return this.opts.enable3D===!1||!this.controller.doc||!Ei()?!1:this.allSeats().length<=this.max3dSeats()}max3dSeats(){let e=this.opts.max3DSeats;if(typeof e=="number"&&e>0)return e;let t=globalThis.navigator;return(t?.hardwareConcurrency??8)<=4||(t?.deviceMemory??8)<=4||(globalThis.matchMedia?.("(pointer: coarse)").matches??!1)?Al/2:Al}syncFloors(){wr(this.floorsEl,this.controller.getActiveFloorId(),this.controller.isFloorOverview())}get sectionCard(){return this.sectionCardCache||(this.sectionCardCache=new ln({controller:this.controller,map:()=>this.els.map,root:()=>this.root,collapseSheet:()=>this.collapseSheet(),region:e=>this.regions[e],refreshMinimap:()=>this.minimap?.refreshMinimap(),activeFloorObjects:()=>this.activeFloorObjects(),sectionNeighbours:e=>this.sectionNeighbours(e),catPriceRange:e=>this.catPriceRange(e),money:e=>this.money(e),suppressPricing:()=>this.suppressPricing,priceBandKeys:()=>this.priceBandKeys})),this.sectionCardCache}showSectionCard(e){this.sectionCard.show(e)}renderSectionCard(e){this.sectionCard.render(e)}collapseSectionCard(){this.sectionCard.collapse()}sectionCardOnView(){this.sectionCard.onView()}sectionNeighbours(e){let t=this.activeFloorObjects().filter(o=>o.type==="section"&&!this.controller.isSectionClosed(o.id)&&this.controller.getSectionSeatCount(o.id)>0);if(t.length<2)return null;let n=t.findIndex(o=>o.id===e);return n<0?null:{previous:t[(n-1+t.length)%t.length],next:t[(n+1)%t.length]}}markedSeatAnnouncement(e){let t=to(this.controller.getRenderer()?.getSeatMark?.(e.id),this.performanceGroup?.nights?.());return Mr(t,e.displayLabel??e.label,this.opts.locale)}announceSeat(e){if(!this.srEl)return;if(!e){this.srEl.textContent="";return}let t=this.markedSeatAnnouncement(e);if(t){this.srEl.textContent=t;return}let n=this.controller.doc?.categories.find(h=>h.key===e.categoryKey),o=this.controller.getStatus(e.id)??"free",s=o==="free"?this.tf("picker.statusAvailable","available"):o==="held"?this.tf("picker.statusOnHold","on hold"):this.tf("picker.statusTaken2","taken"),r=n?this.catPriceRange(n):void 0,a=!this.suppressPricing&&r?r.min===r.max?this.money(r.min):`${this.money(r.min)}\u2013${this.money(r.max)}`:void 0,l=this.controller.tableSelection(e.id),c=l??this.controller.seatDetails(e.id),d=rt(c),p=c?.rowLabel??c?.displayLabel??e.displayLabel??e.label,u=l?`${d} ${p}, ${l.bookingMode==="variable"?(0,H.t)("picker.minToMaxGuests",{min:l.minOccupancy,max:l.maxOccupancy}):(0,H.t)("picker.capacityGuests",{count:l.capacity})}`:c?.objectType==="booth"?`${d} ${p}`:c?.objectType==="table"?`${d} ${p}, ${(0,H.t)("picker.seatNumberLower",{label:c.seatNumber??e.label})}`:(0,H.t)("picker.seatLabel",{label:c?.displayLabel??e.displayLabel??e.label});this.srEl.textContent=`${u}, ${n?.label??e.categoryKey}${a?`, ${a}`:""}, ${s}`}showTableDialog(e,t,n){this.dismissTableDialog(!1),this.tableDialog={...e},this.tableDialogHeld=t,this.tableDialogReturnFocus=n??document.activeElement;let o=this.controller.doc?.categories.find(a=>a.key===e.categoryKey),s=e.bookingMode==="variable",r=document.createElement("div");r.className="sl-table-scrim",r.innerHTML=ls(e,{variable:s,held:t,typeWord:rt(e),categoryLabel:o?.label??e.categoryKey,suppressPricing:this.suppressPricing,unitPrice:this.money(this.paidPrice(e.categoryKey,e.tierId??null,e.price,e.label))}),this.root.appendChild(r),this.tableDialogEl=r,this.renderTableDialogState(),r.querySelectorAll("[data-table-step]").forEach(a=>{a.addEventListener("click",()=>{if(!this.tableDialog)return;let l=Math.max(this.tableDialog.minOccupancy,Math.min(this.tableDialog.maxOccupancy,this.tableDialog.quantity+Number(a.dataset.tableStep)));this.tableDialog={...this.tableDialog,quantity:l},this.renderTableDialogState()})}),r.querySelector(".sl-table-cancel").addEventListener("click",()=>this.cancelTableDialog()),r.querySelector(".sl-table-confirm").addEventListener("click",()=>{this.confirmTableDialog()}),r.addEventListener("mousedown",a=>{a.target===r&&this.cancelTableDialog()}),r.addEventListener("keydown",a=>{if(a.key!=="Tab")return;let l=[...r.querySelectorAll('button:not(:disabled),[tabindex]:not([tabindex="-1"])')];if(!l.length)return;let c=l[0],d=l[l.length-1];a.shiftKey&&document.activeElement===c?(a.preventDefault(),d.focus()):!a.shiftKey&&document.activeElement===d&&(a.preventDefault(),c.focus())}),requestAnimationFrame(()=>r.querySelector(s?'[data-table-step="-1"]':".sl-table-confirm")?.focus())}renderTableDialogState(){let e=this.tableDialog,t=this.tableDialogEl;if(!e||!t)return;let n=t.querySelector("output[data-table-qty]");n&&(n.value=String(e.quantity));let o=t.querySelector("input[data-table-qty]");o&&(o.value=String(e.quantity)),t.querySelectorAll("[data-table-step]").forEach(a=>{let l=Number(a.dataset.tableStep);a.disabled=l<0?e.quantity<=e.minOccupancy:e.quantity>=e.maxOccupancy});let s=this.paidPrice(e.categoryKey,e.tierId??null,e.price,e.label),r=t.querySelector("[data-table-total]");r&&(r.textContent=this.money(s*e.quantity))}async confirmTableDialog(){let e=this.tableDialog,t=this.tableDialogHeld;if(!e)return;let n=this.tableDialogEl?.querySelector(".sl-table-confirm");if(n&&(n.disabled=!0,n.textContent=t?this.tf("picker.updatingEllipsis","Updating\u2026"):this.tf("picker.selectingEllipsis","Selecting\u2026")),t){try{let o=await this.controller.replaceTableQuantity(e.label,e.quantity,this.opts.holdTtlMs);if(!o){this.toast(this.tf("picker.guestCountCouldNotBeSecured","That guest count could not be secured. Your current table hold is unchanged."),"warning"),this.renderTableDialogState(),n&&(n.disabled=!1,n.textContent=this.tf("picker.updateTable","Update table"));return}this.hold={holdId:o.holdId,expiresAt:o.expiresAt,seats:o.seats,items:o.items},this.startHoldTimer(o.expiresAt),this.dismissTableDialog(),this.syncTray(),this.emitHoldChange(),this.toast((0,H.t)("picker.tableUpdatedForGuests",{label:e.label,count:e.quantity}),"success")}catch(o){this.opts.onError?.(o),this.toast(this.tf("picker.guestCountNoLongerAvailable","That guest count is no longer available. Your current hold is unchanged."),"error"),n&&(n.disabled=!1,n.textContent=this.tf("picker.updateTable","Update table"))}return}if(!this.controller.setTableQuantity(e.label,e.quantity)){n&&(n.disabled=!1,n.textContent=e.bookingMode==="variable"?this.tf("picker.selectTable","Select table"):this.tf("picker.selectWholeTable","Select whole table"));return}this.dismissTableDialog(),this.collapseSectionCard(),this.syncTray()}cancelTableDialog(){let e=this.tableDialog,t=this.tableDialogHeld;this.dismissTableDialog(),e&&!t&&this.controller.deselect(e.physicalSeatIds)}dismissTableDialog(e=!0){let t=this.tableDialogReturnFocus;this.tableDialogEl?.remove(),this.tableDialogEl=null,this.tableDialog=null,this.tableDialogHeld=!1,this.tableDialogReturnFocus=null,e&&requestAnimationFrame(()=>(t?.isConnected?t:this.root)?.focus())}get confirmCard(){return this.confirmCardCache||(this.confirmCardCache=new hn({controller:this.controller,root:()=>this.root,els:()=>this.els,regions:()=>this.regions,hideTooltip:()=>{this.tipEl&&(this.tipEl.style.display="none")},tf:(e,t)=>this.tf(e,t),money:e=>this.money(e),paidPrice:(e,t,n,o)=>this.paidPrice(e,t,n,o),suppressPricing:()=>this.suppressPricing,reducedMotion:()=>this.reducedMotion(),scheduleMotion:(e,t)=>this.scheduleMotion(e,t),canOffer3d:()=>this.canOffer3d(),buyerView:()=>this.buyerView,view3dHandle:()=>this.view3dHandle,view3dCompareSeatIds:()=>this.view3dCompareSeatIds,rememberView3dReturnSeat:e=>{this.view3dReturnSeat=e},enter3d:e=>{this.enter3d(e)},performanceGroup:()=>this.performanceGroup,seatViewEnabled:()=>this.seatViewEnabled(),openSeatView:e=>{this.openSeatView(e)},openSeatConfidencePassport:(e,t)=>this.openSeatConfidencePassport(e,t),saveView3dComparisonSeat:e=>this.saveView3dComparisonSeat(e),resolveAssetUrl:e=>this.buyerAssetUrls.resolve(e),onError:e=>this.opts.onError?.(e),liftToastOverConfirm:()=>this.liftToastOverConfirm(),fitTranslatedRows:()=>this.fitTranslatedRows(),syncTray:()=>this.syncTray(),syncSelectionTo3d:()=>this.syncSelectionTo3d(),collapseSectionCard:()=>this.collapseSectionCard(),applyPanelCollapsed:()=>this.applyPanelCollapsed(),dismiss:()=>this.dismissConfirm(),releaseHeldSeat:e=>this.controller.currentHold()?.labels.includes(e.label)?this.removeHeldLabels([e.label]):null,reanchor:()=>this.reanchorConfirm(),inviteCommit:(e,t)=>this.inviteCommit(e,t),addSeatLabel:e=>this.addSeatLabel(e),cartLanded:()=>this.cartLanded()})),this.confirmCardCache}showConfirm(e,t="add"){this.confirmCard.show(e,t)}reanchorConfirm(){this.confirmCard.reanchor()}dismissConfirm(){this.confirmCard.dismiss()}cartLanded(){this.animateOnce(this.els.count,"sl-value-pop",380),this.animateOnce(this.els.total,"sl-value-pop",380)}async commitConfirm(){await this.confirmCard.commit()}cancelConfirm(){this.confirmCard.cancel()}closeConfirm(){this.dismissConfirm()}inviteCommit(e,t){Wr(e,t,this.reducedMotion())}addSeatLabel(e){return Yr(e,(t,n)=>this.tf(t,n))}seatViewEnabled(){return this.opts.seatView!==!1}allSeats(){return this.allSeatsCache||(this.allSeatsCache=[...this.controller.getExpandedSeats()]),this.allSeatsCache}async openSeatView(e){if(!this.root||!this.seatViewEnabled())return;let t=++this.seatViewGen,n=this.controller.doc,o=this.controller.getActiveFloorId(),s=e.focalPoint??n?.floors?.find(p=>p.id===o)?.focalPoint??n?.focalPoint??{x:0,y:0},r,a,l=!1;if(e.viewUrl){let p,u=null;try{let y=e.viewMeta?.previewUrl;y&&y!==e.viewUrl?(u=await this.buyerAssetUrls.resolve(y),p=e.viewUrl):p=await this.buyerAssetUrls.resolve(e.viewUrl)}catch(y){t===this.seatViewGen&&this.opts.onError?.(y);return}if(t!==this.seatViewGen||!p||e.viewMeta?.previewUrl&&e.viewMeta.previewUrl!==e.viewUrl&&!u||!this.root||!this.seatViewEnabled())return;let h={url:p,...u?{previewUrl:u}:{},...e.viewMeta?.sourceWidth!==void 0?{sourceWidth:e.viewMeta.sourceWidth}:{},...e.viewMeta?.sourceHeight!==void 0?{sourceHeight:e.viewMeta.sourceHeight}:{},...e.viewMeta?.previewWidth!==void 0?{previewWidth:e.viewMeta.previewWidth}:{},...e.viewMeta?.previewHeight!==void 0?{previewHeight:e.viewMeta.previewHeight}:{},...e.viewMeta?.variants?.length?{variants:e.viewMeta.variants}:{},...e.viewMeta?.coverage?{coverage:e.viewMeta.coverage}:{},...e.viewMeta?.capturedAt?{capturedAt:e.viewMeta.capturedAt}:{},...e.viewMeta?.sourceLabel?{sourceLabel:e.viewMeta.sourceLabel}:{}};r=h,a=(0,Tn.seatViewDisclosure)(h),l=(0,Tn.isAuthoredSeatView)(h)}else{let p;try{let{generateSeatPanorama:u}=await Ai();p=u(e,s,this.allSeats())}catch(u){t===this.seatViewGen&&this.opts.onError?.(u);return}if(t!==this.seatViewGen||!this.root||!this.seatViewEnabled())return;r={url:p.url,generated:!0},a=(0,H.t)("picker.illustrationCaption",{m:p.distanceM})}this.closeSeatView(!1);let c=(0,H.t)("picker.viewFromSeat",{label:e.label}),d=qi({root:this.root,source:r,caption:a,real:l,closeLabel:this.tf("picker.close","Close"),dragHint:et(),viewFromSeatLabel:c,real360Label:(0,H.t)("picker.real360"),previewLabel:(0,H.t)("picker.preview"),resolveAsset:p=>this.buyerAssetUrls.resolve(p),onClose:()=>this.closeSeatView()});this.viewEl=d.element,this.viewCleanup=()=>d.dispose()}closeSeatView(e=!0){e&&(this.seatViewGen+=1),this.viewCleanup?.(),this.viewCleanup=null,this.viewEl?.remove(),this.viewEl=null}money(e){let t=this.opts.pricing?.formatter;if(t)return t(e,this.currency);let n=Number.isInteger(e);return(0,H.formatMoney)(e,this.currency,{locale:this.opts.locale,fallback:(o,s)=>`${o} ${s}`,...n?{minimumFractionDigits:0,maximumFractionDigits:0}:{}})}scheduleOfferBoundary(e){if(this.offerBoundaryTimer&&clearTimeout(this.offerBoundaryTimer),this.offerBoundaryTimer=null,!this.api.availability||this.destroyed)return;let t=Date.now(),n=gr(e,t);if(n==null)return;let o=6*36e5,s=Math.min(Math.max(n-t+1e3,1e3),o);this.offerBoundaryTimer=setTimeout(()=>{this.offerBoundaryTimer=null,!document.hidden&&this.refreshOfferAvailability(!1)},s)}offerReadIsCurrent(){return!!this.offerReadInFlight||Date.now()-this.offerReadSettledAt<Op}scheduleOfferRefresh(e){!this.api.availability||this.destroyed||this.offerReadIsCurrent()||(this.offerRefreshTimer&&clearTimeout(this.offerRefreshTimer),this.offerRefreshTimer=setTimeout(()=>{this.offerRefreshTimer=null,this.refreshOfferAvailability(e)},e?180:0))}refreshOfferAvailability(e){if(!this.api.availability||this.destroyed)return Promise.resolve();if(this.offerReadInFlight)return this.offerReadInFlight;if(this.offerReadIsCurrent())return Promise.resolve();let t=this.readOfferAvailability(e).finally(()=>{this.offerReadInFlight===t&&(this.offerReadInFlight=null)});return this.offerReadInFlight=t,t}async readOfferAvailability(e){if(!(!this.api.availability||this.destroyed))try{let t=await this.api.availability(this.opts.event,e);if(this.destroyed)return;this.offerReadSettledAt=Date.now();let n=rn(t);if(!n)return;this.offerAvailability=n,this.applyChannelPricing(n.channelPricing),this.scheduleOfferBoundary(n);let o=an(n),s={...this.hostPricing?.prices??{},...o},r=Object.keys(s).length>0||this.hostPricing?.formatter?{prices:s,...this.hostPricing?.formatter?{formatter:this.hostPricing.formatter}:{}}:void 0;this.setPricing(r),this.syncOffer(),this.opts.onOfferAvailabilityChange?.(n)}catch{!this.destroyed&&!this.offerBoundaryTimer&&!document.hidden&&(this.offerBoundaryTimer=setTimeout(()=>{this.offerBoundaryTimer=null,!document.hidden&&this.refreshOfferAvailability(!1)},3e4))}}offerPrice(e){return e?this.offerAvailability?.prices.find(t=>t.categoryKey===e)??null:null}applyChannelPricing(e){this.channelByObject.clear(),this.pricesByChannel.clear();for(let t of e?.channels??[])this.pricesByChannel.set(t.channelId,t.priceOverrides);for(let t of e?.objects??[])this.pricesByChannel.has(t.channelId)&&this.channelByObject.set(t.label,t.channelId)}syncOffer(){let e=this.els.offer;if(!e)return;if(this.suppressPricing){e.classList.remove("has"),e.replaceChildren();return}let t=this.offerAvailability,n=t?.release??null,o=n?null:t?.upcoming??null;if(!t||t.state==="closed"||t.state==="sold-out"||!n&&!o){e.classList.remove("has"),e.replaceChildren();return}let s=n??o,r=document.createElement("div");r.className="sl-offer-main";let a=document.createElement("div");a.className="sl-offer-copy";let l=document.createElement("span");l.className="sl-offer-kicker",l.textContent=n?this.tf("picker.currentTicketOffer","Current ticket offer"):this.tf("picker.upcomingTicketOffer","Upcoming ticket offer");let c=document.createElement("strong");c.className="sl-offer-name",c.textContent=s.name||(n?this.tf("picker.currentOffer","Current offer"):this.tf("picker.scheduledOffer","Scheduled offer"));let d=document.createElement("span");d.className="sl-offer-line";let p=[];n&&t.fromPrice!=null&&p.push(this.money(t.fromPrice/100)),n&&s.remaining!=null&&p.push((0,H.t)("picker.offerRemainingAvailable",{count:s.remaining})),n&&s.endsAt!=null&&p.push((0,H.t)("picker.offerUntil",{time:Li(s.endsAt,this.eventTimezone,this.opts.locale)})),o?.startsAt!=null&&p.push((0,H.t)("picker.offerStarts",{time:Li(o.startsAt,this.eventTimezone,this.opts.locale)})),d.textContent=p.join(" \xB7 "),a.append(l,c,d);let u=document.createElement("details");u.className="sl-offer-info";let h=document.createElement("summary");h.setAttribute("aria-label",(0,H.t)("picker.howOfferWorks",{name:c.textContent??""})),h.textContent="i";let y=document.createElement("div");y.className="sl-offer-detail",y.textContent=n?this.tf("picker.offerDetailActive","This price applies automatically to eligible seats. Tickets in active carts temporarily reduce the available quantity; released or expired holds return it. When the offer ends, the next matching offer or normal ticket price takes over."):this.tf("picker.offerDetailUpcoming","Tickets are available at their normal price now. This scheduled offer will apply automatically to eligible seats when it starts."),u.append(h,y),r.append(a,u),e.replaceChildren(r),e.classList.add("has")}paidPrice(e,t,n,o){let s=o?this.channelByObject.get(o):void 0;if(s&&e){let a=this.pricesByChannel.get(s)?.find(l=>l.categoryKey===e&&l.tierId===(t??null));if(a)return a.price}let r=e?this.opts.pricing?.prices?.[e]:void 0;return r===void 0?n:typeof r=="number"?r:t&&r.tiers?.[t]!==void 0?r.tiers[t]:r.base??n}legendDeps(){return hl(this)}syncPriceRail(e,t,n=this.legendDeps()){ul(this,e,t,n)}syncPrices(){ml(this)}focusCategory(e){fl(this,e)}evictTakenSelections(){let e=new Set([...this.controller.currentHold()?.labels??[],...this.holdingLabels]),t=this.controller.getSelection().filter(n=>!e.has(n.label)&&(this.controller.getStatus(n.id)??"free")!=="free");t.length&&(this.controller.deselect(t.map(n=>n.id)),this.toast((0,H.t)("picker.seatJustTakenByAnother",{label:t[0].label}),"error"))}syncTray(){if(!this.els.tray)return;this.updateSelectionCapacity();let{seats:e,gaAreas:t,heldItems:n,heldLabels:o,total:s,count:r}=fn(this),a=[],l=new Set;if(!this.salesClosed){let f=this.performanceGroup?.nightSummary?.()??[];f.length&&a.push(Tr(f,{title:this.tf("picker.group.yourSeatsByNight","Your seats by night"),empty:this.tf("picker.group.noSeatsChosenYet","No seats yet")}));let L=this.performanceGroup?.selectionModeSwitch;L&&a.push(`<button type="button" class="sl-pg-switch" data-pg-switch-mode>${B(L.label)}</button>`)}let c={salesClosed:this.salesClosed,hasPicks:e.length>0||n.length>0,hasGaAreas:t.length>0,groupMode:this.performanceGroup?this.performanceGroup.selectionMode??"same_seat":null,seated:!!this.controller.doc?.objects?.some(f=>f.type!=="gaArea"),venue3d:this.buyerView==="venue3d",whenText:this.eventWhenText?String(this.eventWhenText):void 0};a.push(Na(c)),this.els.trayHint&&(this.els.trayHint.textContent=Da(c)),this.els.seatsInfo&&(this.els.seatsInfo.hidden=this.salesClosed);let d=!e.length&&!n.length&&!je(this.gaQty,this.hold?.items??[]);if(!this.performanceGroup&&!this.salesClosed&&!this.hold&&(d||this.bestAvailableBusy||this.bestAvailableConfirm)){let f=(this.controller.doc?.categories??[]).filter(N=>!N.notForSale),L=this.controller.getBestAvailableZones();this.baZone&&!L.some(N=>N.id===this.baZone)&&(this.baZone=""),a.push(_a({confirming:this.bestAvailableConfirm,busy:this.bestAvailableBusy,reopened:!1,quantity:this.baQty,premium:this.baPremium,offerPremium:this.controller.hasPremiumSeats(),categories:f,zones:L,selectedCategory:this.baCat,selectedZone:this.baZone}))}let p=(f,L,N,R=1,O,C,_)=>Ia({categoryLabel:_,d:f?this.controller.seatDetails(f):null,area:N==="ga"?t.find(U=>U.id===O):void 0,label:L,objectType:N,quantity:R,identity:C,performanceLabel:this.performanceGroup?.activePerformanceLabel?.(),performanceDates:this.performanceGroup?.selectedPerformanceDates?.()}),u=B,h=[];for(let f of Hs(n)){let L=f.objectType==="ga"?`held:ga:${f.objectId}:${f.tierId??""}`:`held:${f.label}`;l.add(L);let N=this.controller.doc?.categories.find(X=>X.key===f.categoryKey),R=f.tierId?N?.tiers?.find(X=>X.id===f.tierId)?.name:void 0,O=f.objectType!=="ga"?this.controller.seatByLabel(f.label):null,C=f.objectType==="table"?this.controller.tableSelection(f.label):null,_=O?this.controller.seatDetails(O.id):null,U=this.seatViewEnabled()&&!!O&&f.objectType!=="table"&&!!this.deliverableViewReference(O),G=u(this.tf("picker.heldForYou","Held for you")),de=C?.bookingMode==="variable"?`<button type="button" class="sl-table-edit" data-table-edit="${u(encodeURIComponent(f.label))}">${u((0,H.t)("picker.guestsCountEdit",{count:f.quantity??1}))}</button>`:"",ge=this.paidPrice(f.categoryKey,f.tierId,f.unitPrice,f.label)*(f.quantity??1);h.push({key:L,fresh:!this.lastTrayKeys.has(L),held:!0,seatIds:[],heldLabels:f.labels,removeAria:(0,H.t)("picker.removeHeldTicketLabel",{label:$n(f,t)}),locateId:O?.id??null,section:_?.sectionLabel??"",rowLabel:_&&Q(_)||"",seatLabel:_?.seatNumber??f.label,categoryLabel:`${N?.label??f.categoryKey}${R?` \xB7 ${R}`:""}`,categoryColor:this.controller.getRenderer?.()?.categoryDisplayColor?.(f.categoryKey)??N?.color??"",identityHtml:p(O?.id??null,f.label,f.objectType,f.quantity??1,f.objectId,C??void 0,`${N?.label??f.categoryKey}${R?` \xB7 ${R}`:""}`),stateHtml:`<span class="sl-ticket-state held" aria-label="${G}" title="${G}"><svg viewBox="0 0 24 24"><rect x="5" y="10" width="14" height="10" rx="2"/><path d="M8 10V7a4 4 0 0 1 8 0v3"/></svg></span>`,extrasHtml:de,amount:ge,amountText:this.suppressPricing?"":this.money(ge),noteHtml:tt(O??void 0),railHtml:this.performanceGroup?"":ho((0,H.t)("picker.removeHeldTicketLabel",{label:$n(f,t)}),U?f.label:null)})}let y=this.seatViewEnabled();for(let f of e.filter(L=>!o.has(L.label))){let L=`seat:${f.id}`;l.add(L);let N=this.controller.doc?.categories.find(X=>X.key===f.categoryKey),R=f.tiers&&f.tiers.length&&!this.suppressPricing?`<select class="tier" data-tier="${u(f.id)}" aria-label="${u((0,H.t)("picker.ticketTierFor",{label:f.label}))}">`+f.tiers.map(X=>`<option value="${u(X.id)}"${X.id===f.tierId?" selected":""}>${u(X.name)} \xB7 ${u(this.money(this.paidPrice(f.categoryKey,X.id,X.price,f.label)))}</option>`).join("")+"</select>":"",O=f.tiers?.find(X=>X.id===f.tierId)??f.tiers?.[0],C=O?.buyerMessage?.trim()||(O?.restriction==="companion"?this.tf("picker.companionRequiresWheelchair","Requires the adjacent wheelchair place"):""),_=this.controller.seatDetails(f.id),U=u(this.tf("picker.selected","Selected")),G=(0,H.t)("picker.removeSeatLabel",{label:f.label}),de=(f.objectType==="table"&&f.bookingMode==="variable"?`<button type="button" class="sl-table-edit" data-table-edit="${u(encodeURIComponent(f.label))}">${u((0,H.t)("picker.guestsCountEdit",{count:f.quantity??1}))}</button>`:"")+R,ge=this.paidPrice(f.categoryKey,f.tierId??null,f.price,f.label)*(f.quantity??1);h.push({key:L,fresh:!this.lastTrayKeys.has(L),held:!1,seatIds:[f.id],heldLabels:[],locateId:f.id,section:_?.sectionLabel??"",rowLabel:_&&Q(_)||"",seatLabel:_?.seatNumber??f.label,categoryLabel:N?.label??f.categoryKey,identityHtml:p(f.id,f.label,f.objectType,f.quantity??1,f.objectId,f,N?.label??f.categoryKey),categoryColor:this.controller.getRenderer?.()?.categoryDisplayColor?.(f.categoryKey)??N?.color??"",stateHtml:`<span class="sl-ticket-state" aria-label="${U}" title="${U}"><svg viewBox="0 0 24 24"><path d="M5 12l4 4L19 6"/></svg></span>`,extrasHtml:de,amount:ge,amountText:this.suppressPricing?"":this.money(ge),removeAria:G,noteHtml:tt(f)+(C?`<small class="sl-tier-note">${u(C)}</small>`:""),railHtml:ho(G,y&&f.objectType!=="table"&&this.deliverableViewReference(this.controller.seatByLabel(f.label)??{})?f.label:null)})}h.length&&a.push(h.map(Oa).join("")),t.length&&a.push(Ns(this,t,n)),this.els.tray.innerHTML=a.join("")+(this.salesClosed?"":this.lapse.noteHtml()),this.lastTrayKeys=l,this.lapse.wire(this.els.tray),this.els.tray.querySelector("[data-pg-switch-mode]")?.addEventListener("click",()=>this.performanceGroup?.selectionModeSwitch?.activate());let g=this.performanceGroup?.selectNight;g&&_r(this.els.tray,f=>g(f)),this.els.tray.querySelectorAll("[data-ba]").forEach(f=>{f.addEventListener("click",()=>{this.baQty=Math.max(1,Math.min(this.maxTickets,this.baQty+Number(f.dataset.ba))),this.syncTray()})}),this.els.tray.querySelector("[data-ba-cat]")?.addEventListener("change",f=>{this.baCat=f.target.value}),this.els.tray.querySelector("[data-ba-zone]")?.addEventListener("change",f=>{this.baZone=f.target.value}),this.els.tray.querySelector("[data-ba-premium]")?.addEventListener("click",()=>{this.baPremium=!this.baPremium,this.syncTray()}),this.els.tray.querySelector(".sl-ba-go")?.addEventListener("click",()=>{if(this.pendingSelectionCount()>0){this.bestAvailableConfirm=!0,this.syncTray(),this.els.tray.querySelector("[data-ba-replace]")?.focus();return}this.bestAvailable(this.baQty,this.baCat||void 0,{preferPremium:this.baPremium,zoneId:this.baZone||void 0})}),this.els.tray.querySelector("[data-ba-cancel]")?.addEventListener("click",()=>{this.bestAvailableConfirm=!1,this.syncTray(),this.els.tray.querySelector(".sl-ba-go")?.focus()}),this.els.tray.querySelector("[data-ba-replace]")?.addEventListener("click",()=>{this.bestAvailableConfirm=!1,this.bestAvailable(this.baQty,this.baCat||void 0,{preferPremium:this.baPremium,zoneId:this.baZone||void 0})}),this.els.tray.querySelectorAll(".sl-chip .rm").forEach(f=>{f.addEventListener("click",()=>{let L=f.closest(".sl-chip");if(L.dataset.held){this.removeHeldLabels(decodeURIComponent(L.dataset.held).split(`
3243
- `),L);return}let N=L.dataset.seat.split(" "),R=()=>{this.controller.deselect(N)};if(this.reducedMotion()){R();return}L.classList.remove("sl-enter"),L.classList.add("sl-leave","sl-mo-collapse"),this.scheduleMotion(R,ee.collapse)})}),this.els.tray.querySelectorAll("[data-table-edit]").forEach(f=>{f.addEventListener("click",L=>{L.stopPropagation();let N=decodeURIComponent(f.dataset.tableEdit??""),R=this.controller.tableSelection(N);if(!R)return;let O=n.find(C=>C.label===N&&C.objectType==="table");this.showTableDialog({...R,quantity:O?.quantity??R.quantity},!!O,f)})}),this.els.tray.querySelectorAll(".sl-chip .tier").forEach(f=>{f.addEventListener("change",()=>this.controller.setSeatTier(f.dataset.tier,f.value||null))}),this.els.tray.querySelectorAll(".sl-chip .view[data-view-label]").forEach(f=>{f.addEventListener("click",()=>{let L=this.controller.seatByLabel(f.dataset.viewLabel);L&&this.openSeatView(L)})}),this.els.tray.querySelectorAll(".sl-chip[data-locate]").forEach(f=>{let L=()=>this.controller.flashSeat(f.dataset.locate,this.cssVar("--sl-accent")||"#f4b740");f.addEventListener("mouseenter",L),f.addEventListener("focusin",L),f.addEventListener("click",N=>{N.target.closest?.('button,a,select,[role="button"],input')||!this.controller.focusSeats?.([f.dataset.locate],{animate:!this.reducedMotion()})||L()})}),Ds(this,this.els.tray,t),this.controller.setGASelection(Ps(this.gaQty)),this.salesClosed&&this.els.tray.querySelectorAll(".sl-ba-go,[data-ba],[data-ba-cat],[data-ba-zone],[data-ba-replace],.sl-ga button").forEach(f=>{f.disabled=!0});let T=this.pendingSelectionCount(),w=this.lastTrayCount,v=this.lastTrayTotal,A=Or(this.performanceGroup?.groupSelectionSummary?.(),this.performanceGroup?.selectionMode??"same_seat");this.els.count.textContent=A||(r?(0,H.tCount)("picker.ticketsCount",r):this.tf("picker.noSeatsSelected","No seats selected")),this.els.total.textContent=r&&!this.suppressPricing?this.money(s):"",this.root?.setAttribute("data-has-selection",String(r>0)),this.sheetState()==="mini"&&r===0?this.setSheetState("mini"):r>w&&this.root?.dataset.layout==="narrow"?this.setSheetState("mini"):this.syncSheetAffordance(),this.root?.setAttribute("data-ba-active",String(this.bestAvailableConfirm||this.bestAvailableBusy)),this.els.seatSummary&&(this.els.seatSummary.textContent=A||(r?(0,H.tCount)("picker.seatsSelectedCount",r):"")),this.syncCta(r,T);let K=this.root?.dataset.layout==="narrow"&&this.root?.dataset.confirming==="true";r!==w&&!K&&this.animateOnce(this.els.count,"sl-value-pop",380),s!==v&&!K&&this.animateOnce(this.els.total,"sl-value-pop",380),w===0&&r>0&&(this.animateOnce(this.els.cta,"sl-ready",520),this.sideCollapsed&&this.root?.dataset.layout!=="narrow"&&this.setPanelCollapsed(!1)),this.lastTrayCount=r,this.lastTrayTotal=s,this.opts.onSelectionChange?.(e),this.emitSelectionValidity(r,e),this.scheduleFit()}scheduleFit(){if(this.fitScheduled||this.destroyed)return;this.fitScheduled=!0;let e=()=>{this.fitScheduled=!1,this.destroyed||this.fitTranslatedRows()};typeof requestAnimationFrame=="function"?requestAnimationFrame(e):e()}fitTranslatedRows(){dr(this.confirmEl?.querySelector(".sl-confirm-row")),this.els.tray?.querySelectorAll(".sl-chip-pos").forEach(pr),this.els.tray?.querySelectorAll(".sl-ba-go").forEach(hr)}emitSelectionValidity(e,t){let n=this.controller.getSelectionValidity(e);n&&(n.seats=t,this.opts.onSelectionValidityChange?.(n),n.isValid?this.lastSelectionValidity!==!0&&this.opts.onSelectionValid?.(t):this.lastSelectionValidity!==!1&&this.opts.onSelectionInvalid?.(n),this.lastSelectionValidity=n.isValid)}async removeHeldLabels(e,t){let n=e.filter(r=>r&&!this.releasingLabels.has(r));if(!n.length)return!1;let o=n[0];n.forEach(r=>this.releasingLabels.add(r)),t?.setAttribute("aria-busy","true");let s=t?.querySelector(".rm");s&&(s.disabled=!0);try{let r=this.handedOff;if(!await this.controller.releaseLabels(n))return this.toast((0,H.t)("picker.couldNotRemoveLabel",{label:o}),"error"),!1;Rs(this.gaQty,this.hold?.items??[],n);let l=this.controller.currentHold();return this.hold=l?{holdId:l.holdId,expiresAt:l.expiresAt,seats:l.seats,items:l.items}:null,this.handedOff=!!this.hold&&r,this.bookedShown=!1,this.ctaPhase="idle",this.hold?this.startHoldTimer(this.hold.expiresAt):(this.stopHoldTimer(),this.forgetHold()),this.syncTray(),this.emitHoldChange(),!0}finally{n.forEach(r=>this.releasingLabels.delete(r)),t?.removeAttribute("aria-busy"),s?.isConnected&&(s.disabled=!1)}}async handleCta(){if(this.salesClosed)return;let e=this.controller.getSelectionValidity(this.totalTicketCount());if(e&&!e.isValid){this.toast(vn(e,(n,o)=>this.tf(n,o)),"warning");return}if(this.totalTicketCount()>this.maxTickets){this.toast((0,H.t)("picker.removeTicketsUntilOrFewer",{count:this.maxTickets}),"warning");return}let t=this.committedSelection();if(this.hold&&!t.some(n=>!(this.hold.items??[]).some(o=>o.label===n.label))){let n=this.hold.seats??t;this.handedOff=!0,this.holdConflicted=!1,await this.runCheckoutHandoff(this.hold,n);return}this.holdingLabels=new Set(t.map(n=>n.label)),this.setCtaPhase("holding");try{let n=null,o=As(this.gaQty),s=this.committedSelection();if(s.length){let r=await this.controller.hold(void 0,this.opts.holdTtlMs);n=r?{holdId:r.holdId,expiresAt:r.expiresAt,seats:r.seats,items:r.items}:null}for(let{areaId:r,tierId:a,qty:l}of o){let c=await this.controller.holdGA(r,l,{tierId:a,ttlMs:this.opts.holdTtlMs});n=c?{holdId:c.holdId,expiresAt:c.expiresAt,seats:c.seats,items:c.items}:n}if(!n){this.raiseHoldConflict(this.tf("picker.seatsJustTaken","One or more seats were just taken. Please pick again.")),this.setCtaPhase("idle"),this.syncTray();return}this.hold=n,this.holdConflicted=!1,this.handedOff=!this.performanceGroup,this.startHoldTimer(n.expiresAt),this.flashHeldSeats(n),this.emitHoldChange(),this.performanceGroup?this.setCtaPhase("idle"):await this.runCheckoutHandoff(n,n.seats??s)}catch(n){this.opts.onError?.(n);let o=n,s=(o.conflicts??[]).map(a=>a.label).filter(Boolean).slice(0,3);o.reason==="event_closed"&&this.setSalesClosed(!0);let r=o.reason==="event_closed"?this.tf("picker.seatSalesClosedForEvent","Seat sales have closed for this event."):o.reason==="companion_pair_required"?this.tf("picker.companionPairRequired","Select the adjacent wheelchair place with each companion ticket."):o.reason==="ticket_option_not_applicable"?this.tf("picker.ticketOptionNotApplicable","That ticket choice is not available for the selected seat."):s.length?s.length===1?(0,H.t)("picker.labelsNoLongerAvailable.one",{labels:s.join(", ")}):(0,H.t)("picker.labelsNoLongerAvailable.other",{labels:s.join(", ")}):this.tf("picker.seatsJustTaken","One or more seats were just taken. Please pick again.");this.raiseHoldConflict(r),this.setCtaPhase("idle")}finally{this.holdingLabels.clear(),this.ctaPhase==="holding"&&(this.ctaPhase="idle"),this.syncTray()}}startHoldTimer(e){tl(this,e)}stopHoldTimer(){il(this)}setExtendPrompt(e,t){nl(this,e,t)}refreshExtendPrompt(){ol(this)}handleExtend(){return sl(this)}detectBooked(){this.bookedShown||!this.handedOff||!this.hold||this.controller.currentHold()===null&&(this.holdConflicted||this.showBooked())}raiseHoldConflict(e){this.holdConflicted=!0,this.bookedShown&&(this.bookedShown=!1,this.bookedEl?.classList.remove("on")),this.toast(e,"error")}showBooked(){if(this.bookedShown||!this.hold||this.holdConflicted)return;this.bookedShown=!0;let e=this.buildHandoff(this.hold);this.stopHoldTimer(),this.forgetHold();let t=e.lineItems.reduce((o,s)=>o+s.quantity,0),n=this.performanceGroup?.groupSelectionSummary?.();this.els.bookedSub&&(this.els.bookedSub.innerHTML=n?.seats?`<span class="sl-booked-seats">${(0,H.tCount)("picker.group.ticketsConfirmedAcross",n.seats,{performances:n.performances})}</span>`:`<span class="sl-booked-seats">${(0,H.tCount)("picker.ticketsCount",t)}</span> ${this.tf("picker.confirmedAndOnWay","confirmed. A confirmation is on its way.")}`),this.els.bookedList&&(this.els.bookedList.innerHTML=e.lineItems.map(o=>{let r=[o.sectionLabel,o.rowLabel&&`${this.tf("picker.row","Row")} ${o.rowLabel}`,o.seatNumber&&`${this.tf("picker.seat","Seat")} ${o.seatNumber}`].filter(Boolean).join(" \xB7 ")||o.displayLabel||o.label,a=o.quantity>1?` <span class="sl-booked-qty">\xD7${o.quantity}</span>`:"";return`<li>${B(r)}${a}</li>`}).join(""),this.els.bookedList.hidden=e.lineItems.length===0),this.bookedEl?.classList.add("on"),requestAnimationFrame(()=>this.bookedEl?.querySelector(".sl-booked-back")?.focus()),this.opts.onBooked?.(e)}dismissBooked(){this.bookedEl?.classList.remove("on"),this.resetAfterBooking(),this.root?.focus({preventScroll:!0})}resetAfterBooking(){this.bookedShown=!1,this.hold=null,this.handedOff=!1,this.holdConflicted=!1,this.holdingLabels.clear(),this.gaQty.clear(),this.stopHoldTimer(),this.forgetHold(),this.clearSelection(),this.setCtaPhase("idle"),this.setSheetOpen(!1),this.syncTray(),this.syncCta(),this.emitHoldChange()}notifyGroupSettled(e){e==="booked"?this.showBooked():this.dismissConfirm(),this.hold=null,this.handedOff=!1,this.ctaPhase="idle",this.stopHoldTimer(),this.forgetHold(),this.syncTray(),this.syncCta()}async checkoutHandoff(e,t){if(this.checkoutMode==="hosted"){await this.startHostedCheckout(e,t);return}await this.opts.onCheckout?.(e,t,this.buildHandoff(e))}async startHostedCheckout(e,t){let n=this.buildHandoff(e),o=null;try{o=await(this.paymentOptions??=this.pubApi.paymentOptions(this.opts.event))}catch(r){this.opts.onError?.(r)}if(this.destroyed)return;let s=o?.providers?.[0];if(!s){let r=Yo(o?.reason),a=!!this.opts.onCheckoutUnavailable||!!this.opts.onCheckout;this.opts.onCheckoutUnavailable?.({reason:r,handoff:n}),this.opts.onCheckout?.(e,t,n),a||this.openCheckoutPanel({kind:"unavailable",reason:r,seatCount:n.lineItems.reduce((l,c)=>l+c.quantity,0)});return}await this.openCheckoutPanel({kind:"pay",provider:s,order:{holdId:n.holdId,expiresAt:n.expiresAt,currency:n.currency,total:n.total,labels:n.lineItems.map(r=>r.displayLabel??r.label)}})}async openCheckoutPanel(e){let t;try{({mountCheckout:t}=await Pi())}catch(n){this.opts.onError?.(n),this.toast(this.tf("picker.checkoutCouldNotBeOpened","Checkout could not be opened. Your seats are still held \u2014 please try again."),"error"),this.setCtaPhase("idle");return}this.destroyed||!this.root||(this.closeCheckoutPanel(),this.checkoutPanel=t({root:this.root,state:e,eventKey:this.opts.event,formatMoney:n=>this.money(n),startSession:n=>this.pubApi.startCheckout(this.opts.event,{...n,...this.opts.returnUrl?{returnUrl:this.opts.returnUrl}:{}}),orderStatus:n=>this.pubApi.orderStatus(n),onCancel:()=>{this.checkoutPanel=null,this.hold||this.setCtaPhase("idle")},onConfirmed:n=>{this.opts.onOrderConfirmed?.(n),this.controller.refresh()},onError:n=>this.opts.onError?.(n)}))}closeCheckoutPanel(){this.checkoutPanel?.destroy(),this.checkoutPanel=null}buildHandoff(e){let n=(e.items??[]).map(r=>{let a=this.controller.lineItemDisplay(r);return{label:r.label,...a.displayLabel?{displayLabel:a.displayLabel}:{},...a.displayType?{displayType:a.displayType}:{},objectId:r.objectId,objectType:r.objectType,categoryKey:r.categoryKey,tierId:r.tierId,unitPrice:this.paidPrice(r.categoryKey,r.tierId,r.unitPrice,r.label),currency:r.currency??this.currency,quantity:r.quantity??1}}),o=n[0]?.currency??this.currency,s=n.reduce((r,a)=>r+a.unitPrice*a.quantity,0);return{holdId:e.holdId,expiresAt:e.expiresAt,currency:o,lineItems:n,total:s}}emitHoldChange(){let e=this.hold;this.scheduleOfferRefresh(!0),this.opts.onHoldChange?.(e,e?.seats??[],e?this.buildHandoff(e):null)}toast(e,t="neutral",n){let o=this.els.toast;if(!o)return;o.replaceChildren();let s=document.createElement("span");if(s.textContent=e,o.appendChild(s),o.classList.toggle("has-action",!!n),n){let r=document.createElement("button");r.type="button",r.className="sl-toast-action",r.textContent=n.label,r.addEventListener("click",n.onClick,{once:!0}),o.appendChild(r)}o.dataset.tone=t,o.classList.add("on","sl-mo-rise"),this.liftToastOverConfirmSoon(),this.toastTimer&&clearTimeout(this.toastTimer),this.toastTimer=setTimeout(()=>{o.classList.remove("on","sl-mo-rise"),o.classList.remove("has-action"),o.dataset.tone="neutral",this.liftToastOverConfirm()},4200)}liftToastOverConfirm(){let e=this.regions["bottom-center"];if(!e)return;let t=this.els.toast?.classList.contains("on")||this.extendEl?.classList.contains("on"),n=this.confirmEl;if(!t||!n?.isConnected){e.style.removeProperty("bottom");return}let o=this.els.map.clientHeight;if(o<=0)return;let s=n.getBoundingClientRect(),r=s.height||n.offsetHeight||Dp,a=s.height?s.top-this.els.map.getBoundingClientRect().top:o-no-r,l=Math.round(o-a+_p);if(l+Np>o){e.style.removeProperty("bottom");return}e.style.bottom=`${l}px`}liftToastOverConfirmSoon(){this.liftToastOverConfirm(),typeof requestAnimationFrame=="function"&&requestAnimationFrame(()=>{this.destroyed||this.liftToastOverConfirm()})}dismissSkeleton(){ta({boot:this.els.boot,map:this.els.map,rail:this.els.rail,root:this.root,reducedMotion:this.reducedMotion()})}placeTooltip(){if(!this.tipEl)return;let e={width:this.els.map.clientWidth,height:this.els.map.clientHeight},t={width:this.tipEl.offsetWidth,height:this.tipEl.offsetHeight},n=this.tipPinned?Fr(this.tipPos,e,t):null,o=n??Br(this.tipPos,e.width,e.height,t);this.tipEl.style.left=`${o.left}px`,this.tipEl.style.top=`${o.top}px`,n?this.tipEl.dataset.placement=n.placement:delete this.tipEl.dataset.placement}nightStripFor(e,t){let n=this.performanceGroup,o=to(e.mark,n?.nights?.()),s=o?.states.filter(r=>r.free).length??0;return Er(o,{locale:this.opts.locale,switchLabel:n?.selectionModeSwitch?.label??null,selectPartialLabel:n?.partialSeatSelection?.label(s)??null,pinned:t})}unpinTooltip(){this.tipPinned&&(this.tipPinned=!1,this.tipEl?.classList.remove("sl-tip-pinned"),this.tipEl&&(this.tipEl.style.display="none"))}handleMapPointerDown(e){if(this.tipEl?.contains(e.target))return;this.lastMapPoint={x:e.clientX,y:e.clientY},this.lastPointerType=e.pointerType||"mouse";let t=this.els.map.getBoundingClientRect();this.tipPos={x:e.clientX-t.left,y:e.clientY-t.top},this.unpinTooltip()}closeInfoPops(e){this.root?.querySelectorAll(".sl-info.open").forEach(t=>{t!==e&&(t.classList.remove("open"),t.querySelector("[data-sl-info]")?.setAttribute("aria-expanded","false"))})}updateTooltip(e){if(!this.tipEl)return;if(this.confirmSeat){this.tipEl.style.display="none";return}if(this.tipPinned&&e?.interaction!=="press")return;if(!e){this.tipPinned||(this.tipEl.style.display="none",this.tipMarkedHoverLabel=null);return}let t=e.mark?.kind==="partial"&&this.tipMarkedHoverLabel===e.label;if(e.interaction!=="press"&&this.lastPointerType==="mouse"&&!e.mark&&!this.tipPinned){this.tipEl.style.display="none",this.tipMarkedHoverLabel=null;return}if(e.unavailable&&e.status==="free"&&e.interaction==="press"){this.toast(this.tf("picker.turnOffAccessibilityFilter","Turn off the wheelchair filter to pick this seat"),"neutral"),this.tipEl.style.display="none";return}if(e.unavailable&&!e.mark){this.tipEl.style.display="none",this.tipMarkedHoverLabel=null;return}let n=e.mark?.kind==="partial"&&(e.interaction==="press"||this.lastPointerType!=="mouse"||t);this.tipMarkedHoverLabel=e.mark?.kind==="partial"?e.label:null;let o=this.nightStripFor(e,n);this.tipEl.style.setProperty("--sl-cat",e.categoryColor),this.tipEl.innerHTML=Dr(e,{price:this.suppressPricing?"":this.money(this.paidPrice(e.categoryKey,e.tierId??null,e.price,e.label)),priceNote:this.suppressPricing?this.performanceGroup?.surface==="season"?this.tf("picker.season.includedInPackage","Included in the Season package"):this.tf("picker.group.pricesPerPerformance","Prices shown per performance"):"",rowTypeWord:rt(e),extra:o+(n?`<button type="button" class="sl-tip-close" data-pg-tip-close aria-label="${B(this.tf("picker.group.closeSeatDetails","Close seat details"))}">\xD7</button>`:"")}),this.tipPinned=n,this.tipEl.classList.toggle("sl-tip-pinned",n),this.tipEl.querySelector("[data-pg-tip-close]")?.addEventListener("click",()=>this.unpinTooltip()),this.tipEl.querySelector("[data-pg-switch-mode]")?.addEventListener("click",()=>{this.unpinTooltip(),this.performanceGroup?.selectionModeSwitch?.activate()}),$r(this.tipEl,this.performanceGroup?.partialSeatSelection?.label,s=>{this.unpinTooltip(),this.performanceGroup?.partialSeatSelection?.activate(e.id,s)}),this.tipEl.style.display="block",this.placeTooltip()}syncSeatMarks(){let e=this.performanceGroup?.seatMarks,t=this.controller.getRenderer();if(!e||!t?.setSeatMarks)return;let n={};for(let[o,s]of Object.entries(e())){let r=this.controller.idForLabel(o);r&&(n[r]=s)}Object.keys(n).length&&t.setSeatMarks(n)}getSelection(){return this.committedSelection()}selectObjects(e){return this.controller.select(e)}selectObjectsWithoutConfirmation(e){let t=new Set(e),n=this.controller.getSelection().filter(o=>t.has(o.id)||t.has(o.label));if(n.length===t.size)return n;this.suppressConfirmationSeatId=e[0]??null;try{return this.controller.select(e)}finally{this.suppressConfirmationSeatId=null}}deselectObjects(e){this.controller.deselect(e)}clearSelection(){this.dismissConfirm(),this.dismissTableDialog(),this.controller.clearSelection()}categoryLegendColor(){let e=(this.controller.doc?.categories??[]).find(t=>!t.notForSale);return(e?this.controller.getRenderer()?.categoryDisplayColor?.(e.key):null)||e?.color||"#2563eb"}async refreshAvailability(){await this.controller.refresh(),this.syncSeatMarks(),this.syncTray()}refreshPerformanceGroupComposition(){this.syncTray()}async adoptRestoredHold(e){!e||this.hold||await this.resumeHoldFromServer(e)}selectCategories(e){return this.controller.selectCategories(e)}deselectCategories(e){this.controller.deselectCategories(e)}setSelectableObjects(e){this.controller.setSelectableObjects(e)}setMaxSelection(e){this.maxTickets=Math.max(this.exactTickets??1,Math.floor(e)),this.controller.setMaxSelection(this.maxTickets),this.updateSelectionCapacity(),this.syncTray()}getSelectionValidity(){let e=this.controller.getSelectionValidity(this.totalTicketCount());return e&&(e.seats=this.committedSelection()),e}setMapTheme(e){this.destroyed||(this.opts.theme={...this.opts.theme??{},map:e??void 0},this.controller.setMapTheme(e),this.applyMapChromeTokens(),this.minimap?.refreshMinimap())}applyThemeTokens(e){let t=Jt(this.themeMode),n=Et(this.controller.doc?.theme,this.opts.theme,t);for(let[o,s]of Object.entries(n))e.style.setProperty(o,s);t?e.dataset.theme=t:delete e.dataset.theme,this.applyMapChromeTokens()}watchThemeMode(){this.colorSchemeStop?.(),this.colorSchemeStop=null,this.themeMode==="auto"&&(this.colorSchemeStop=Oi(()=>{this.destroyed||this.repaintForThemeMode()}))}repaintForThemeMode(){this.root&&(this.applyThemeTokens(this.root),this.controller.setMapTheme(Tt(this.opts.theme,this.themeMode)),this.applyMapChromeTokens(),this.minimap?.refreshMinimap(),this.syncPrices())}setThemeMode(e){this.destroyed||e===this.themeMode||(this.themeMode=e,this.opts.theme={...this.opts.theme??{},...e?{mode:e}:{mode:void 0}},this.watchThemeMode(),this.repaintForThemeMode(),this.emitAnalytics("theme_mode_changed",{mode:e,resolved:Jt(e)??null}))}getThemeMode(){return this.themeMode}applyMapChromeTokens(){let e=this.els.map?.parentElement;if(!e||!this.root)return;let t=Jt(this.themeMode),n=Et(this.controller.doc?.theme,this.opts.theme,t),o=Tt(this.opts.theme,this.themeMode)?.background??this.controller.doc?.theme?.background??void 0,s=gs(n,o);for(let r of fs)s?e.style.setProperty(r,s[r]):e.style.removeProperty(r)}setEventDetailsHidden(e){this.eventDetailsHidden=e,this.syncFullscreenButtons()}setPricing(e){let t=JSON.stringify(this.opts.pricing??null),n=JSON.stringify(e??null);t!==n&&(this.opts.pricing=e,!(this.destroyed||!this.els.prices)&&(this.els.pricesSec?.querySelector(".sl-price-select")?.remove(),this.buildPriceFilter(),this.syncPrices(),this.syncTray(),this.lastSection&&this.showSectionCard(this.lastSection)))}buildLanguageSwitcher(e){this.langSel=ws(e,{languages:this.opts.languages,label:this.tf("picker.preferredTicketType","Language"),onChange:t=>{this.setLocale(t)}})}async setLocale(e){let t=(0,H.getLocale)(),n=this.localeGeneration+=1,o=await(0,H.loadLocale)(e);return this.opts.messages&&(0,H.setStringOverrides)(this.opts.messages),o===t||this.applyActiveLocale(o,n),o}applyActiveLocale(e,t){t===this.localeGeneration&&this.root&&(xs(e,{root:this.root,painters:[()=>this.syncTray(),()=>this.syncPrices(),()=>this.syncOffer(),()=>this.syncRung(),()=>this.syncFloors(),()=>this.syncPanelToggle(),()=>this.syncFullscreenButtons()],refreshMapCopy:()=>this.controller.refreshMapCopy(),languageSelect:this.langSel}),this.scheduleFit())}isColorblindSafe(){return this.cbSafe}setColorblindSafe(e){e!==this.cbSafe&&(this.cbSafe=e,this.cbEl?.setAttribute("aria-pressed",String(e)),this.controller.setColorblindSafe(e),this.syncPrices(),this.minimap?.refreshMinimap(),Fp(e))}setViewMode(e){this.controller.setViewMode(this.normalizeInitialView(e)),this.syncProjection(),this.dismissConfirm()}getViewMode(){return this.controller.getViewMode()}normalizeInitialView(e){return e==="perspective"?(this.perspectiveWarned||(this.perspectiveWarned=!0,console.warn("[seatlayer] initialView:'perspective' (2.5D) is deprecated for the buyer picker and was coerced to 'flat'. Use the Map | 3D control for the immersive view.")),"flat"):e??"flat"}emitAnalytics(e,t){try{this.opts.onAnalytics?.(e,t??{})}catch{}}emit3dAnalytics(e,t){this.emitAnalytics(e,t)}getBuyerView(){return ba(this)}setBuyerView(e,t){ya(this,e,t)}seatState3dFor(e){return va(this,e)}pushAvailabilityTo3d(){wa(this)}syncSelectionTo3d(){xa(this)}seatViewFor3d(e){return Sa(this,e)}onView3dSeatPick(e){ka(this,e)}seatViewCaption(e){return Ta(this,e)}saveView3dComparisonSeat(e){Ea(this,e)}clearView3dComparison(){Ca(this)}view3dComparisonSnapshot(e){return Aa(this,e)}enter3d(e){return Pa(this,e)}publish3dTopInset(){La(this)}exit3d(){Ma(this)}openSeatConfidencePassport(e,t=null){co(this,e,t)}closeSeatConfidencePassport(e=!0){di(this,e)}openView3dComparison(){ha(this)}closeView3dComparison(e=!0){at(this,e)}getCurrentHold(){return this.hold}async resumeHold(e){return this.resumeHoldFromServer(e)}async removeHeldTicket(e){return this.removeHeldLabels([e])}async bestAvailable(e,t,n={}){if(this.salesClosed||this.bestAvailableBusy)return null;e=Math.max(1,Math.min(this.maxTickets,Math.floor(e)));try{return await this.bestAvailableOrThrow(e,t,n)}catch(o){this.opts.onError?.(o);let s=o?.reason,r=s==="not_enough_together"?(0,H.t)("picker.couldNotFindSeatsTogether",{count:e}):s==="companion_pair_required"?this.tf("picker.companionPairRequired","Select the adjacent wheelchair place with each companion ticket."):s==="ticket_option_not_applicable"?this.tf("picker.ticketOptionNotApplicable","That ticket choice is not available for the selected seat."):s==="sold_out"?this.tf("picker.ticketTypeSoldOut","That ticket type is sold out. Try another ticket type."):s==="event_closed"?this.tf("picker.seatSalesClosedForEvent","Seat sales have closed for this event."):this.tf("picker.seatsNoLongerAvailableTryAnother","Those seats are no longer available. Try another quantity or ticket type.");return this.toast(r,"error"),null}}async bestAvailableOrThrow(e,t,n={}){if(this.salesClosed)throw new Error("seatlayer: seat sales are closed");if(this.bestAvailableBusy)throw new Error("seatlayer: Best Available is already in progress");if(!Number.isInteger(e)||e<1)throw new Error("seatlayer: Best Available quantity must be a positive integer");this.confirmSeat&&this.cancelConfirm(),this.bestAvailableConfirm=!1,this.bestAvailableBusy=!0;let o=this.els.tray?.querySelector(".sl-ba-go");o&&(o.disabled=!0,o.classList.add("sl-busy"),o.innerHTML=`<span class="sl-ba-spin" aria-hidden="true"></span>${this.tf("picker.findingEllipsis","Finding\u2026")}`);try{let s=await this.controller.bestAvailable(e,t,{...n,ttlMs:this.opts.holdTtlMs});return s?(this.hold={holdId:s.holdId,expiresAt:s.expiresAt,seats:s.seats,items:s.items},this.handedOff=!1,this.bookedShown=!1,this.gaQty.clear(),this.startHoldTimer(s.expiresAt),this.flashHeldSeats(this.hold),this.syncTray(),this.emitHoldChange(),n.preferPremium&&s.seats.length&&!s.seats.every(r=>r.commercial?.premium)&&this.toast((0,H.t)("picker.premiumFallbackNote",{count:e}),"neutral"),this.hold):null}finally{this.bestAvailableBusy=!1,this.syncTray()}}async release(){let e=this.hold,t=this.controller.currentHold(),n=!0;if(t)n=await this.controller.release();else if(e){let o=[...new Set([...(e.items??[]).map(s=>s.label),...(e.seats??[]).map(s=>s.label)])];if(o.length)try{await this.api.release(this.opts.event,o,e.holdId)}catch(s){this.opts.onError?.(s),n=!1}}if(!n){this.toast(this.tf("picker.couldNotReleaseTickets","Couldn't release your tickets. Your hold is unchanged."),"error");return}this.hold=null,this.forgetHold(),this.handedOff=!1,this.bookedShown=!1,this.ctaPhase="idle",this.stopHoldTimer(),this.gaQty.clear(),this.syncTray(),this.emitHoldChange()}startRealtime(){if(!this.access?.configured||!this.pubApi||this.realtime)return;let e=this.opts.event;this.realtime=new Ee({url:this.pubApi.subscribeUrl(e),mintTicket:()=>this.pubApi.subscribeTicket(e),onAccessUnavailable:t=>{this.opts.onAccessUnavailable?.(t),this.showAccessPanel(t)},sink:wt(this.controller,{flashOnLiveChange:!0,ownLabels:()=>this.holdingLabels,onStatusChange:()=>{this.syncPrices(),this.scheduleOfferRefresh(!0),this.detectBooked(),this.minimap?.refreshMinimap(),this.pushAvailabilityTo3d()},onSelectedObjectUnavailable:(t,n)=>{this.opts.onSelectedObjectUnavailable?.({labels:t,reason:n}),this.syncTray(),this.toast(n==="ineligible"?this.tf("picker.seatNoLongerYours","Some seats are no longer available to you. They have been removed from your order."):this.tf("picker.seatTaken","Someone else took a seat you had picked. It has been removed from your order."),"warning")}})}),this.realtime.start()}async refreshAccess(){return!this.access?.configured||!await this.access.refresh("manual")?!1:(this.dismissAccessPanel(),await this.controller.refresh(),this.realtime?this.realtime.restart():this.startRealtime(),!0)}clearDecisionSurfaces(){this.dismissConfirm(),this.dismissTableDialog(!1),Ce(this,!1)}showAccessPanel(e){if(this.loadAbort&&e.reason==="provider_failed"||this.destroyed||!this.root)return;this.dismissAccessPanel(),this.clearDecisionSurfaces();let t=cs(e.reason,()=>this.recoverAccess());(this.root.querySelector(".sl-body")??this.root).appendChild(t),this.accessEl=t}async recoverAccess(){return await this.refreshAccess()?!0:(this.opts.onAccessUnavailable||typeof window>"u"||window.location.reload(),!1)}dismissAccessPanel(){this.accessEl?.remove(),this.accessEl=null}showHoldExpired(){if(this.destroyed||!this.root||this.holdExpiredEl)return;this.clearDecisionSurfaces();let e=vl({restart:()=>this.restartAfterHoldExpiry()},this.holdExpiredUnits);this.root.appendChild(e),this.holdExpiredEl=e,requestAnimationFrame(()=>e.querySelector(".sl-interrupt-act")?.focus());let t=this.holdExpiredUnits;this.holdExpiredFresh=!1,this.refreshAvailability().then(()=>{if(this.destroyed||this.holdExpiredEl!==e)return;this.holdExpiredFresh=!0;let n=t.filter(r=>r.objectType!=="ga"),o=[],s=[];for(let r of n){let a=this.controller.seatByLabel(r.label);(a&&this.controller.getStatus(a.id)==="free"?o:s).push(r.label)}yl(e,{recoverable:o,taken:s,onRecover:r=>this.recoverAfterHoldExpiry(r)})}).catch(()=>{})}recoverAfterHoldExpiry(e){this.holdExpiredUnits=[],this.dismissHoldExpired(),this.lapse.clear(),this.clearSelection(),this.controller.select(e),this.syncTray(),this.handleCta()}dismissHoldExpired(){this.holdExpiredEl?.remove(),this.holdExpiredEl=null}restartAfterHoldExpiry(){let e=this.holdExpiredUnits;this.holdExpiredUnits=[],this.dismissHoldExpired(),this.lapse.clear(),this.clearSelection(),this.controller.overview(),this.syncTray(),this.syncCta(),this.root?.focus({preventScroll:!0});let t=this.holdExpiredFresh;this.holdExpiredFresh=!1,(t?Promise.resolve():this.refreshAvailability()).then(()=>{this.destroyed||bl({reducedMotion:this.reducedMotion(),accent:this.cssVar("--sl-accent")||"#f4b740",seatByLabel:n=>this.controller.seatByLabel(n),statusOf:n=>this.controller.getStatus(n),flash:(n,o)=>this.controller.flashSeat(n,o)},e)}).catch(()=>{})}destroy(){this.transportAbort.abort(),this.loadAbort?.abort(),this.loadAbort=null,this.destroyed=!0,ro(this),this.colorSchemeStop?.(),this.colorSchemeStop=null,this.realtime?.stop(),this.realtime=null,this.dismissAccessPanel(),this.dismissHoldExpired(),this.access?.clear(),this.hold&&!this.handedOff&&this.controller.release(),this.closeConfirm(),this.dismissTableDialog(!1),Ce(this,!1),this.closeSeatView(),this.closeCheckoutPanel(),this.exit3d(),this.buyerAssetUrls.dispose(),this.stopHoldTimer(),this.detachAttention?.(),this.toastTimer&&clearTimeout(this.toastTimer),this.offerRefreshTimer&&clearTimeout(this.offerRefreshTimer),this.offerBoundaryTimer&&clearTimeout(this.offerBoundaryTimer),this.offerRefreshTimer=null,this.offerBoundaryTimer=null,this.offerVisibilityHandler&&(document.removeEventListener("visibilitychange",this.offerVisibilityHandler),this.offerVisibilityHandler=null);for(let e of this.motionTimers)clearTimeout(e);this.motionTimers.clear(),this.ro?.disconnect(),this.ro=null,this.viewportResizeHandler&&window.removeEventListener("resize",this.viewportResizeHandler),this.viewportResizeHandler=null,this.framedFs&&this.setFramedFs(!1),this.escHandler&&document.removeEventListener("keydown",this.escHandler),this.fsChangeHandler&&document.removeEventListener("fullscreenchange",this.fsChangeHandler),this.fsEscHandler&&window.removeEventListener("keydown",this.fsEscHandler),this.controller.destroy(),this.projectionEl=null,this.root?.remove(),this.root=null,this.modalScrim&&(this.modalScrim.remove(),this.modalScrim=null,this.prevFocus?.isConnected&&this.prevFocus.focus({preventScroll:!0}),this.prevFocus=null)}};var We=require("@seatlayer/core");var Ml="seatlayer-performance-group-picker-style";function Hl(){if(document.getElementById(Ml))return;let i=document.createElement("style");i.id=Ml,i.textContent=`
3245
+ }`,e.append(t);let n="linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.10) 37%, rgba(255,255,255,0.04) 63%)",o=document.createElement("div");Object.assign(o.style,{position:"absolute",inset:"0",display:"flex",flexDirection:"column",padding:"16px",gap:"14px",opacity:"0.9"});let s=c=>{let d=document.createElement("div");return d.className="sl-shimmer",Object.assign(d.style,{background:n,borderRadius:"8px"}),Object.assign(d.style,c),d};o.append(s({height:"40px",width:"100%",flex:"0 0 auto"}));let r=document.createElement("div");Object.assign(r.style,{display:"flex",gap:"14px",flex:"1 1 auto",minHeight:"0"}),r.append(s({width:"220px",height:"100%",flex:"0 0 auto"})),r.append(s({flex:"1 1 auto",height:"100%"})),o.append(r),e.append(o);let a=document.createElement("div");Object.assign(a.style,{position:"relative",zIndex:"1",display:"flex",alignItems:"center",gap:"10px",padding:"10px 16px",borderRadius:"999px",background:"rgba(16, 22, 37, 0.72)",fontSize:"13px",fontWeight:"500",letterSpacing:"0.01em"});let l=document.createElement("span");l.className="sl-shimmer",Object.assign(l.style,{width:"9px",height:"9px",borderRadius:"50%",background:n,flex:"0 0 auto"}),a.append(l),a.append(document.createTextNode("Loading designer\u2026")),e.append(a)}buildErrorCard(e,t){let n=Sd[t],o=document.createElement("div");Object.assign(o.style,{maxWidth:"420px",margin:"0 24px",padding:"28px",textAlign:"center",background:"rgba(255, 255, 255, 0.03)",border:"1px solid rgba(255, 255, 255, 0.08)",borderRadius:"16px",boxShadow:"0 12px 40px rgba(0, 0, 0, 0.35)"});let s=document.createElement("h2");s.textContent=n.title,Object.assign(s.style,{margin:"0 0 8px",fontSize:"17px",fontWeight:"600",color:"#f4f7ff"});let r=document.createElement("p");r.textContent=n.body,Object.assign(r.style,{margin:"0 0 20px",fontSize:"13.5px",lineHeight:"1.5",color:"#aab4c8"});let a=document.createElement("button");a.type="button",a.textContent="Try again",Object.assign(a.style,{appearance:"none",cursor:"pointer",border:"0",borderRadius:"10px",padding:"10px 22px",fontSize:"14px",fontWeight:"600",color:"#101625",background:"#7aa2ff"}),a.addEventListener("click",()=>this.handleTryAgain()),o.append(s,r,a),e.append(o)}};function ai(i,e){let t=document.createElement("div");t.className="sl-loading-state";let n=document.createElement("div");if(n.setAttribute("role",e.busy?"status":"alert"),n.setAttribute("aria-atomic","true"),e.busy){let r=document.createElement("div");r.className="sl-boot-spin",r.setAttribute("aria-hidden","true"),t.append(r)}let o=document.createElement("div");if(o.className="sl-boot-title",o.textContent=e.title,n.append(o),e.description){let r=document.createElement("p");r.className="sl-loading-description",r.textContent=e.description,n.append(r)}t.append(n);let s=null;return e.actionLabel&&(s=document.createElement("button"),s.type="button",s.className="sl-boot-retry",s.textContent=e.actionLabel,t.append(s)),i.replaceChildren(t),s}function ar(i){let e=window.visualViewport;if(!e)return()=>{};let t=()=>{let{width:n,height:o,offsetTop:s,offsetLeft:r}=e;![n,o,s,r].every(Number.isFinite)||n<=0||o<=0||Object.assign(i.style,{right:"auto",bottom:"auto",top:`${s}px`,left:`${r}px`,width:`${n}px`,height:`${o}px`})};return t(),e.addEventListener("resize",t),e.addEventListener("scroll",t),window.addEventListener("resize",t),window.addEventListener("pageshow",t),()=>{e.removeEventListener("resize",t),e.removeEventListener("scroll",t),window.removeEventListener("resize",t),window.removeEventListener("pageshow",t)}}function lr(i,e){let t=new Set(["chart","objects","resume","availability"]),n=new Map;return new Proxy(Object.create(i),{get(o,s){let r=i,a=Reflect.get(r,s,r);return typeof a!="function"?a:(n.has(s)||n.set(s,t.has(String(s))?async(...l)=>{let c=await At(()=>a.apply(r,l),e,()=>{});if(c.outcome==="loaded")return c.value;if(c.outcome==="error")throw c.error;let d=new Error(c.outcome==="timeout"?"request_timeout":"request_cancelled");throw d.name=c.outcome==="timeout"?"TimeoutError":"AbortError",d}:a.bind(r)),n.get(s))}})}var H=require("@seatlayer/core"),Tn=require("@seatlayer/core/view3d/crossfade/panorama");function cr(i){return!!i&&i.clientWidth>0&&i.scrollWidth>i.clientWidth+1}function kd(i){return i.some(e=>cr(e))}var sn="data-fit-gone",Td=12;function Jn(i,e,t=cr){if(!i)return 0;for(let n of e)i.classList.remove(n.cls);if(i.querySelectorAll(`[${sn}]`).forEach(n=>{n.removeAttribute(sn),n.hidden=!1}),i.dataset.fit="0",i.clientWidth<=0||!t(i))return 0;for(let n=0;n<e.length;n+=1){let o=e[n];n>0&&i.classList.remove(e[n-1].cls),i.classList.add(o.cls),i.dataset.fit=String(n+1);let s=o.give?o.give(i):!0;if(!t(i))return n+1;if(o.repeat&&o.give){for(let r=1;s&&r<Td;r+=1)if(s=o.give(i),!t(i))return n+1}}return e.length}function Ed(i,e="[data-fit-seg]"){let t=[...i.querySelectorAll(e)].filter(n=>!n.hidden);return t.length<2?!1:dr(t[t.length-1])}function Cd(i,e){let t=i.querySelector(e);return t&&!t.hidden?dr(t):!1}function dr(i){let e=i.previousElementSibling;return e instanceof HTMLElement&&e.tagName==="I"&&(e.setAttribute(sn,""),e.hidden=!0),i.setAttribute(sn,""),i.hidden=!0,!0}function Ad(i){if(!i)return!1;let e=(i.getAttribute("aria-label")||i.textContent||"").trim();return e?(i.setAttribute("aria-label",e),i.setAttribute("title",e),!0):!1}function pr(i){if(!i)return 0;let e=i.querySelector(".sl-confirm-cancel"),t=i.querySelector(".sl-confirm-add-t");return Jn(i,[{cls:"sl-fit-track"},{cls:"sl-fit-type"},{cls:"sl-fit-icon",give:()=>Ad(e)}],()=>kd([e,t]))}function hr(i){return Jn(i,[{cls:"sl-fit-notype",give:e=>Cd(e,"[data-fit-type]")},{cls:"sl-fit-short",give:e=>Ed(e),repeat:!0}])}function ur(i){return i?(i.classList.add("sl-fitpill"),Jn(i,[{cls:"sl-fit-p1"},{cls:"sl-fit-p2"},{cls:"sl-fit-p3"}])):0}var Pd=["on-sale","low","sold-out","presale","closed"];function li(i){return i==null?null:typeof i=="number"&&Number.isFinite(i)&&i>=0?i:void 0}function fr(i){return i==null?null:typeof i=="number"&&Number.isFinite(i)&&i>=0?i:void 0}function mr(i){if(i==null)return null;if(typeof i!="object"||Array.isArray(i))return;let e=i,t=e.count,n=e.index;if(typeof n!="number"||!Number.isInteger(n)||n<1||typeof t!="number"||!Number.isInteger(t)||t<n)return;let o=e.remaining;if(o!=null&&(typeof o!="number"||!Number.isInteger(o)||o<0))return;let s={index:n,count:t,remaining:o??null};if(e.id!==void 0){if(typeof e.id!="string"||!e.id.trim())return;s.id=e.id.trim()}if(e.name!==void 0){if(typeof e.name!="string"||!e.name.trim())return;s.name=e.name.trim()}if(e.categoryKey!==void 0){if(e.categoryKey!==null&&(typeof e.categoryKey!="string"||!e.categoryKey.trim()))return;s.categoryKey=e.categoryKey==null?null:e.categoryKey.trim()}for(let r of["startsAt","endsAt"]){if(e[r]===void 0)continue;let a=fr(e[r]);if(a===void 0)return;s[r]=a}return s}function Ld(i){if(i==null)return null;if(typeof i!="object"||Array.isArray(i))return;let e=i;if(!Number.isInteger(e.assignmentVersion)||e.assignmentVersion<0||!Array.isArray(e.channels)||!Array.isArray(e.objects))return;let t=[],n=new Set;for(let r of e.channels){if(!r||typeof r!="object"||Array.isArray(r))return;let a=r,l=typeof a.channelId=="string"?a.channelId.trim():"";if(!l||n.has(l)||!Number.isInteger(a.pricingVersion)||a.pricingVersion<0||!Array.isArray(a.priceOverrides))return;let c=[],d=new Set;for(let p of a.priceOverrides){if(!p||typeof p!="object"||Array.isArray(p))return;let u=p,h=typeof u.categoryKey=="string"?u.categoryKey.trim():"",y=u.tierId===null?null:typeof u.tierId=="string"&&u.tierId.trim()?u.tierId.trim():void 0,f=li(u.price);if(!h||y===void 0||f===void 0||f===null)return;let T=`${h}\0${y??""}`;if(d.has(T))return;d.add(T),c.push({categoryKey:h,tierId:y,price:f})}n.add(l),t.push({channelId:l,pricingVersion:a.pricingVersion,priceOverrides:c})}let o=[],s=new Set;for(let r of e.objects){if(!r||typeof r!="object"||Array.isArray(r))return;let a=r,l=typeof a.label=="string"?a.label.trim():"",c=typeof a.channelId=="string"?a.channelId.trim():"";if(!l||s.has(l)||!n.has(c))return;s.add(l),o.push({label:l,channelId:c})}return{assignmentVersion:e.assignmentVersion,channels:t,objects:o}}function rn(i){if(!i||typeof i!="object"||Array.isArray(i))return null;let e=i,t=Pd.find(d=>d===e.state);if(!t)return null;let n=li(e.fromPrice),o=li(e.previousPrice);if(n===void 0||o===void 0)return null;let s=e.currency==null?null:typeof e.currency=="string"&&e.currency.trim()?e.currency.trim():void 0;if(s===void 0)return null;let r=mr(e.release);if(r===void 0)return null;let a=e.upcoming===void 0?null:mr(e.upcoming);if(a===void 0)return null;let l=[];if(e.prices!=null){if(!Array.isArray(e.prices))return null;let d=[];for(let p of e.prices){if(!p||typeof p!="object"||Array.isArray(p))return null;let u=p,h=typeof u.categoryKey=="string"?u.categoryKey.trim():"";if(!h)return null;let y=li(u.price),f=li(u.previousPrice);if(y==null||f===void 0)return null;let T={categoryKey:h,price:y,previousPrice:f};if(u.offerId!==void 0){if(typeof u.offerId!="string"||!u.offerId.trim())return null;T.offerId=u.offerId.trim()}if(u.offerName!==void 0){if(typeof u.offerName!="string"||!u.offerName.trim())return null;T.offerName=u.offerName.trim()}if(u.remaining!==void 0){if(u.remaining!==null&&(typeof u.remaining!="number"||!Number.isInteger(u.remaining)||u.remaining<0))return null;T.remaining=u.remaining==null?null:u.remaining}for(let w of["startsAt","endsAt"]){if(u[w]===void 0)continue;let v=fr(u[w]);if(v===void 0)return null;T[w]=v}d.push(T)}l=d}let c=Ld(e.channelPricing);return c===void 0?null:{state:t,fromPrice:n,previousPrice:o,currency:s,release:r,upcoming:a,prices:l,channelPricing:c}}function gr(i){return i?.changed!==!1}function br(i,e){if(!i)return null;let t=null,n=o=>{o!=null&&o>e&&(t===null||o<t)&&(t=o)};for(let o of[i.release,i.upcoming])n(o?.startsAt),n(o?.endsAt);for(let o of i.prices)n(o.startsAt),n(o.endsAt);return t}function an(i){let e={};for(let t of i?.prices??[])e[t.categoryKey]=t.price;return e}function yr(i){return i.focusedSection!==null?i.deeperThanSectionFrame===!1?"venue":"section":i.atVenueFit!==void 0?i.atVenueFit?"none":"venue":i.seatsRevealed?"venue":"none"}function vr(i,e,t=[],n=8){let o=e.reduce((r,a)=>!a||a.width<=0||a.height<=0?r:Math.max(r,a.bottom-i.top+n),0),s=t.reduce((r,a)=>!a||a.width<=0||a.height<=0?r:Math.max(r,i.bottom-a.top+n),o>0?n:0);return{top:Math.max(0,Math.ceil(o)),right:0,bottom:Math.max(0,Math.ceil(s)),left:0}}function wr(i){let e=document.createElement("div");e.className="sl-floors on",e.setAttribute("role","group"),e.setAttribute("aria-label",i.tf("picker.chooseLevel","Choose level"));let t=[{id:"",name:i.tf("picker.allLevels","All levels")},...i.floors.map(r=>({id:r.id,name:r.name}))],n=document.createElement("span");n.className="sl-floor-label",n.textContent=`${i.tf("picker.levels","Level")}:`,e.appendChild(n);let o=document.createElement("select");o.className="sl-floor-select",o.setAttribute("aria-label",i.tf("picker.chooseLevel","Choose level"));for(let r of t){let a=document.createElement("option");a.value=r.id,a.textContent=r.name,o.appendChild(a)}let s=i.tf("picker.floorHelp","All levels shows the complete venue. Choose one level to inspect and select its seats.");return o.title=s,o.addEventListener("change",()=>i.onChoose(o.value)),e.appendChild(o),e}function xr(i,e,t){if(!i)return;let n=t?"":e,o=i.querySelector(".sl-floor-select");o&&(o.value=n)}var ln=class{constructor(e){this.el=null;this.current=null;this.collapsed=!1;this.shownAt=0;this.host=e}get summary(){return this.current}adopt(e){this.current=e}get element(){return this.el}show(e){if(e&&e.id!==this.current?.id&&this.host.collapseSheet(),this.current=e,!e){this.el?.remove(),this.el=null,this.host.refreshMinimap();return}this.collapsed=this.host.controller.getRung()==="seats",this.shownAt=Date.now(),this.render(e),this.host.refreshMinimap()}render(e){this.el?.remove(),this.el=null}collapse(){!this.el||this.collapsed||!this.current||(this.collapsed=!0,this.render(this.current))}onView(){if(!(!this.el||this.collapsed||!this.current)){if(this.host.controller.getRung()==="seats"){this.collapse();return}if(Date.now()-this.shownAt<1400){this.coverage()>.25&&this.collapse();return}this.collapse()}}coverage(){let e=this.el,t=this.current,n=this.host.map();if(!e||!t||!n)return 0;let o=this.host.activeFloorObjects().find(v=>v.type==="section"&&v.id===t.id)?.outline;if(!o||o.length<3)return 0;let s=o.map(v=>this.host.controller.worldToScreen(v)),r=s.map(v=>v.x),a=s.map(v=>v.y),l=Math.min(...r),c=Math.min(...a),d=Math.max(...r)-l,p=Math.max(...a)-c;if(d<=0||p<=0)return 0;let u=n.getBoundingClientRect(),h=e.getBoundingClientRect(),y=h.left-u.left,f=h.top-u.top,T=Math.max(0,Math.min(y+h.width,l+d)-Math.max(y,l)),w=Math.max(0,Math.min(f+h.height,c+p)-Math.max(f,c));return T*w/(d*p)}};var Nt=require("@seatlayer/core"),Wr=require("@seatlayer/core/core/color");var Ue=require("@seatlayer/core");function eo(i,e,t){try{return new Intl.DateTimeFormat(e,{...t,...i.timezone?{timeZone:i.timezone}:{}}).format(new Date(i.startsAt))}catch{return new Date(i.startsAt).toLocaleString(e)}}var cn=(i,e)=>eo(i,e,{dateStyle:"medium"}),dn=(i,e)=>eo(i,e,{timeStyle:"short"}),pn=(i,e)=>eo(i,e,{weekday:"short",day:"numeric",month:"short"});function Sr(i,e,t,n){return!i.length||i.length>=e?null:{summary:n,labels:i.map(o=>`${cn(o,t)} \xB7 ${dn(o,t)}`)}}function Md(i,e){let t=new Set(e);return i.map(n=>({...n,free:!t.has(n.eventKey)}))}function kr(i,e){let t=[...i];if(t.length<=1)return t[0]??"";try{return new Intl.ListFormat(e,{style:"long",type:"conjunction"}).format(t)}catch{return t.join(", ")}}function Hd(i,e,t="",n=!1){if(!i.length)return"";let o=i.map(s=>{let r=s.free?e.free:e.blocked,a=n&&s.free?`<input class="sl-night-choice" type="checkbox" data-pg-event-key="${E(s.eventKey)}" aria-label="${E(`${s.shortDate}: ${r}`)}" checked>`:"";return`<li class="sl-night${s.free?" ok":" no"}" aria-label="${E(`${s.shortDate}: ${r}`)}">`+a+`<i class="sl-night-dot" aria-hidden="true"></i><span class="d">${E(s.shortDate)}</span><span class="st">${E(r)}</span></li>`}).join("");return`<div class="sl-tip-nights"><div class="sl-tip-nights-title">${E(e.title)}</div><ul class="sl-nightstrip">${o}</ul><p class="sl-tip-nights-note">${E(e.notAvailableOn)}</p>`+t+"</div>"}function Rd(i){return i.selectPartialLabel&&i.pinned?`<button type="button" class="sl-tip-switch" data-pg-select-partial>${E(i.selectPartialLabel)}</button>`:i.switchLabel&&i.pinned?`<button type="button" class="sl-tip-switch" data-pg-switch-mode>${E(i.switchLabel)}</button>`:i.switchLabel||i.selectPartialLabel?"":`<p class="sl-tip-advice">${E(i.advice)}</p>`}function Id(i){return Number(i.available)+Number(i.selected)+Number(i.partial)+Number(i.unavailable)}function Tr(i,e,t){if(Id(i)<2)return"";let n=(s,r,a="")=>`<li class="sl-pg-legend-item"><i class="sl-pg-sw ${s}"${a}></i>${E(r)}</li>`,o=[];return i.available&&o.push(n("sl-pg-sw-free",e.available,` style="background:${E(t)}"`)),i.selected&&o.push(n("sl-pg-sw-sel",e.selected)),i.partial&&o.push(n("sl-pg-sw-split",e.partial,` style="--sl-pg-sw-cat:${E(t)}"`)),i.unavailable&&o.push(n("sl-pg-sw-off",e.unavailable)),`<ul class="sl-pg-legend-list" aria-label="${E(e.title)}">${o.join("")}</ul>`}function Er(i,e){if(!i.length)return"";let t=i.map(n=>{let o=n.labels.length?n.labels.join(", "):e.empty;return`<li class="sl-pg-night-row${n.labels.length?"":" empty"}${n.active?" active":""}" role="button" tabindex="0"${n.active?' aria-current="true"':""} data-event-key="${E(n.eventKey)}"><span class="n">${E(n.name)}</span><span class="s">${E(o)}</span></li>`}).join("");return`<div class="sl-pg-nights" role="group" aria-label="${E(e.title)}"><div class="sl-pg-nights-title">${E(e.title)}</div><ul class="sl-pg-nights-list">${t}</ul></div>`}function to(i,e){if(i?.kind!=="partial"||!e?.length)return null;let t=i.data?.blockedEventKeys??[],n=Md(e,t);return{states:n,missing:n.filter(o=>!o.free).map(o=>o.shortDate)}}function Cr(i,e){return i?Hd(i.states,{title:b("picker.group.partlyAvailableTitle","Free on some nights only"),free:b("picker.group.nightFree","Free"),blocked:b("picker.group.nightBlocked","Not available"),notAvailableOn:(0,Ue.t)("picker.group.notAvailableOn",{dates:kr(i.missing,e.locale)})},Rd({switchLabel:e.switchLabel??null,selectPartialLabel:e.selectPartialLabel??null,pinned:e.pinned,advice:b("picker.group.pickSeatFreeEveryNight","Pick a seat that is free every night.")}),!!e.selectPartialLabel&&!!e.pinned):""}function Od(i,e,t,n){if(!i.length)return"";let o=new Set(e),s=new Set(t),r=i.map(a=>{let l=o.has(a.eventKey);return`<li class="sl-confirm-date${l?"":" blocked"}"><label><input type="checkbox" data-pg-confirm-event-key="${E(a.eventKey)}" aria-label="${E(`${a.shortDate}: ${l?n.available:n.unavailable}`)}"${l&&s.has(a.eventKey)?" checked":""}${l?"":" disabled"}><span class="sl-confirm-date-label">${E(a.shortDate)}</span><span class="sl-confirm-date-state">${E(l?n.available:n.unavailable)}</span></label></li>`}).join("");return`<fieldset class="sl-confirm-dates" data-pg-confirm-dates><legend>${E(n.title)}</legend><p class="sl-confirm-dates-copy">${E(n.copy)}</p><label class="sl-confirm-date-all"><input type="checkbox" data-pg-confirm-all><span>${E(n.selectAll)}</span></label><ul>${r}</ul><p class="sl-confirm-dates-summary" data-pg-confirm-summary aria-live="polite"></p></fieldset>`}function Ar(i,e,t,n){let o=e.availableEventKeys(t);return Od(i,o,e.includedEventKeys(),{title:n("picker.group.confirmDatesTitle","Choose performance dates"),copy:o.length===i.length?n("picker.group.confirmAllDatesCopy","This seat is available for all {count} dates. Keep all selected, or remove dates you do not want.").replace("{count}",String(i.length)):n("picker.group.confirmPartialDatesCopy","This seat is available for {available} of {total} dates. Choose one date or keep every available date.").replace("{available}",String(o.length)).replace("{total}",String(i.length)),selectAll:n("picker.group.confirmSelectAll","Select all available dates"),available:n("picker.group.nightFree","Available"),unavailable:n("picker.group.nightBlocked","Unavailable")})}function Pr(i){return[...i.querySelectorAll("[data-pg-confirm-event-key]")].filter(e=>e.checked&&!e.disabled).map(e=>e.dataset.pgConfirmEventKey).filter(Boolean)}function Lr(i,e,t,n){let o=[...i.querySelectorAll("[data-pg-confirm-event-key]")];if(!e||!o.length)return;let s=i.querySelector(".sl-confirm-add"),r=i.querySelector("[data-pg-confirm-all]"),a=()=>{let l=o.filter(p=>!p.disabled),c=Pr(i).length;r&&(r.checked=c===l.length,r.indeterminate=c>0&&c<l.length);let d=i.querySelector("[data-pg-confirm-summary]");d&&(d.textContent=c===l.length?t("picker.group.confirmAllSelected","All {count} available dates are selected.").replace("{count}",String(c)):t("picker.group.confirmSelectedOfAvailable","{selected} of {available} available dates selected.").replace("{selected}",String(c)).replace("{available}",String(l.length))),s.disabled=c===0,s.textContent=c?e.label(c):t("picker.group.confirmChooseOne","Choose at least 1 date"),n()};o.forEach(l=>l.addEventListener("change",a)),r?.addEventListener("change",()=>{o.filter(l=>!l.disabled).forEach(l=>{l.checked=r.checked}),a()}),a()}async function Mr(i,e,t){if(!i||!t||!i.querySelector("[data-pg-confirm-event-key]"))return!0;let n=Pr(i);if(!n.length)return!1;let o=i.querySelector(".sl-confirm-add");return o?.setAttribute("aria-busy","true"),o&&(o.disabled=!0),await t.apply(e,n)?!0:(o?.removeAttribute("aria-busy"),o?.isConnected&&(o.disabled=!1),!1)}function Hr(i,e,t){return i?(0,Ue.t)("picker.group.seatPartlyAvailable",{label:e,free:i.states.length-i.missing.length,total:i.states.length,dates:kr(i.missing,t)}):""}function Rr(i,e){let t=i.map((n,o)=>{let s=n.state==="done"?e.done:n.state==="current"?e.current:e.upcoming;return`<li class="sl-pg-step-item" data-step="${E(n.id)}" data-state="${E(n.state)}"${n.state==="current"?' aria-current="step"':""}><span class="i" aria-hidden="true">${n.state==="done"?"\u2713":String(o+1)}</span><span class="l">${E(n.label)}</span><span class="sl-pg-sr">${E(s)}</span></li>`}).join("");return`<ol class="sl-pg-steps" aria-label="${E(e.label)}">${t}</ol>`}function io(i,e){return`<ul class="sl-pg-cards">${i.map(n=>`<li class="sl-pg-card" data-event-key="${E(n.eventKey)}"><span class="n">${E(n.name)}</span><time datetime="${E(n.iso)}"><span class="d">${E(n.date)}</span><span class="t">${E(n.time)}</span></time></li>`).join("")}</ul><p class="sl-pg-included">${E(e)}</p>`}function Ir(i){let e=i.rows.map(t=>`<li class="sl-pg-pane-row${t.labels.length?"":" empty"}" data-event-key="${E(t.eventKey)}"><span class="n">${E(t.name)}</span><span class="s">${E(t.labels.length?t.labels.join(", "):i.empty)}</span></li>`).join("");return`<div class="sl-pg-pane-title">${E(i.title)}</div><ul class="sl-pg-pane-list">${e}</ul>`+(i.note?`<p class="sl-pg-pane-note">${E(i.note)}</p>`:"")+(i.total?`<div class="sl-pg-pane-total"><span>${E(i.total.label)}</span><b>${E(i.total.amount)}</b></div>`:"")+(i.holdStatus?`<p class="sl-pg-hold-status" role="status">${E(i.holdStatus)}</p>`:"")}function Or(i){let e=Math.max(0,i);return`${Math.floor(e/6e4)}:${String(Math.floor(e/1e3)%60).padStart(2,"0")}`}function _r(i,e){if(!i||i.seats<=0)return"";if(e==="same_seat"){let t=i.perPerformance??i.seats;return i.totalPerformances&&i.performances<i.totalPerformances?(0,Ue.tCount)("picker.group.performancesChosenOf",t,{chosen:i.performances,total:i.totalPerformances}):(0,Ue.tCount)("picker.group.seatsEveryPerformance",t)}return i.perPerformance!=null&&i.performancesChosen===i.performances?(0,Ue.tCount)("picker.group.seatsPerPerformance",i.seats,{per:i.perPerformance}):(0,Ue.tCount)("picker.group.performancesChosenOf",i.seats,{chosen:i.performancesChosen,total:i.performances})}function Nr(i,e){i.querySelectorAll(".sl-pg-night-row[data-event-key]").forEach(t=>{let n=()=>e(t.dataset.eventKey);t.addEventListener("click",n),t.addEventListener("keydown",o=>{o.key!=="Enter"&&o.key!==" "||(o.preventDefault(),n())})})}var Dr=require("@seatlayer/core");function qe(i){return String(i??"\u2014").replace(/[&<>"]/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[e])}function _d(i,e){let t=i.objectType==="table"&&!!i.bookingMode,n=i.objectType==="booth",o=t||n||!i.seatNumber,s=o?i.rowLabel??i.displayLabel??i.label:i.seatNumber,r=t?`${b("picker.guests","Guests")} ${i.bookingMode==="variable"?`${i.minOccupancy}\u2013${i.maxOccupancy}`:i.capacity}`:!n&&i.rowLabel?`${e} ${Q(i)??""}`.trim():"";return`<div class="sl-tip-head"><div class="sl-tip-id"><span class="sl-tip-seat${o?" name":""}">${qe(s)}</span>`+(r?`<span class="sl-tip-row">${qe(r)}</span>`:"")+"</div>"+(i.sectionLabel?`<div class="sl-tip-sec"><span class="sl-tip-eyebrow">${b("picker.section","Section")}</span><span class="sl-tip-secname">${qe(i.sectionLabel)}</span></div>`:"")+"</div>"}function Br(i,e){let t=i.status==="not_for_sale",n=i.mark?.kind==="partial",o=i.status==="free"||n?"":`<span class="sl-tip-tag">${t?b("picker.notAvailable","Not available"):i.status==="held"?(0,Dr.t)("map.statusHeld"):b("picker.sold","Sold")}</span>`,s=t?"":e.price,r=s?`<span class="sl-tip-amt">${qe(s)}</span>`:"",a=!s&&e.priceNote?`<div class="sl-tip-note">${qe(e.priceNote)}</div>`:"",l=tt(i,{compact:!0}),c=e.reason?`<div class="sl-tip-reason">${qe(e.reason)}</div>`:"";return'<i class="sl-tip-rail" aria-hidden="true"></i>'+_d(i,e.rowTypeWord)+`<div class="sl-tip-cat"><span class="sl-tip-dot" style="background:${qe(i.categoryColor)}"></span><span class="sl-tip-name">${qe(i.categoryLabel)}</span>`+o+r+"</div>"+a+c+l+(e.extra??"")}function Fr(i,e,t,n){let o=i.x+14,s=i.y-n.height-12,r=i.y+18,a=s;o+n.width>e-8&&(o=i.x-n.width-14),s<8&&r+n.height<=t-8&&(a=r);let l=Math.max(8,t-n.height-8);return{left:Math.max(8,Math.min(o,Math.max(8,e-n.width-8))),top:Math.max(8,Math.min(a,l))}}function Vr(i,e,t,n=22){let o=Math.max(8,Math.min(i.x-t.width/2,Math.max(8,e.width-t.width-8))),s=i.y-n-t.height,r=i.y+n;return s>=8?{left:o,top:s,placement:"above"}:r+t.height<=e.height-8?{left:o,top:r,placement:"below"}:{left:o,top:Math.max(8,Math.min(s<8?r:s,Math.max(8,e.height-t.height-8))),placement:s<8?"below":"above"}}var no=14,Nd=12,Dd=12,Bd=8;function zr(i,e,t,n=Nd){let o=e.height-no-t.height,s=Dd,r=o-n;if(r<=s)return{placement:"sheet",nudgeY:0};let a=(s+r)/2-i;return Math.abs(a)<=Bd?{placement:"sheet",nudgeY:0}:{placement:"sheet",nudgeY:Math.round(a)}}function $r(i,e,t,n,o=0){let s=t.width/2+12,r=Math.max(s,Math.min(e.width-s,i.x)),a=i.y+o+t.height+24<=e.height,l=i.y-o<t.height+24&&a?"below":"above",c=l==="above"?i.y-o:i.y+o,d=n&&l==="above"?Math.max(t.height+24,c):c;return{left:r,top:Math.max(8,Math.min(e.height-8,d)),placement:l}}function jr(i,e,t){let n=i.querySelector("[data-pg-select-partial]"),o=[...i.querySelectorAll("[data-pg-event-key]")],s=()=>o.filter(a=>a.checked).map(a=>a.dataset.pgEventKey).filter(Boolean),r=()=>{if(!n)return;let a=s().length;n.disabled=a===0,n.textContent=e?.(a)??n.textContent};o.forEach(a=>{a.addEventListener("change",r);let l=a.closest(".sl-night");l?.classList.add("selectable"),l?.addEventListener("click",c=>{c.target!==a&&(a.checked=!a.checked,r())})}),n?.addEventListener("click",()=>{let a=s();a.length&&t?.(a)})}function rt(i){let e=i?.displayType?.trim()||i?.rowType?.trim();return e||(i?.objectType==="table"?b("picker.table","Table"):i?.objectType==="booth"?b("picker.booth","Booth"):b("picker.row","Row"))}var Fd="sl-confirm-scrim",Vd="--sl-scrim-mask";function zd(i){let e=Math.round(i.x),t=Math.round(i.y);return`radial-gradient(circle at ${e}px ${t}px, transparent 0 56px, #000 88px)`}function Gr(i,e,t,n){let o=i??document.createElement("div");return i||(o.className=Fd),o.style.setProperty(Vd,zd(n)),t.parentNode===e?o.nextSibling!==t&&e.insertBefore(o,t):o.parentNode!==e&&e.appendChild(o),o}function oo(i){return i?.remove(),null}var Ur={passport:!1,compare:!1},$d=360,jd=160,Gd=700,qr=450;function Kr(){try{return globalThis.matchMedia?.("(pointer: coarse)").matches??!1}catch{return!1}}function Ud(i){return(0,Wr.contrastRatio)("#ffffff",i)>=3?"#ffffff":"#0b0f19"}var hn=class{constructor(e){this.el=null;this.seat=null;this.outsideTap=null;this.scrim=null;this.shownAt=0;this.lift=null;this.framing=null;this.mode="add";this.host=e}get element(){return this.el}set element(e){this.el=e}get candidate(){return this.seat}set candidate(e){this.seat=e}thumbHtml(e){let t=this.host.controller.doc;if(!t)return"";let n=_t(e)?e.viewUrl??"":"",o=en(t);if(!n&&!o)return"";let s=n?null:tn(e,e.focalPoint??t.focalPoint);if(!n&&s==null)return"";let r="";if(!n)return r;let a=B((0,Nt.t)("picker.viewFromSeat",{label:e.label})),l=B(this.host.tf("picker.viewFromHere","View from here"));return`<button type="button" class="sl-confirm-view sl-confirm-thumbwrap" aria-label="${a}"><img class="sl-confirm-thumb" alt="" /><span class="sl-confirm-thumb-badge">\u{1F52D} ${l}</span></button>`+r}show(e,t="add"){let n=this.host;this.mode=t;let o=this.seat?.id;this.el?.remove(),this.el=null,this.seat=e,n.root()?.setAttribute("data-confirming","true"),n.els().side?.toggleAttribute("inert",!0),Object.values(n.regions()).forEach(C=>C.toggleAttribute("inert",!0)),n.controller.setSelectionFocus(e.id),o&&o!==e.id&&n.controller.deselect([o]),n.hideTooltip();let s=n.controller.seatDetails(e.id),r=n.controller.doc?.categories.find(C=>C.key===e.categoryKey),a=s?.price??(r?.tiers?.length?r.tiers[0].price:r?.price),l=a!=null?n.paidPrice(e.categoryKey,s?.tierId??r?.tiers?.[0]?.id??null,a,e.label):void 0,c=is(s,e.displayLabel??e.label,rt(s)),d=s?.tiers??r?.tiers??[],p=s?.tierId??d[0]?.id,u=n.suppressPricing()?"":rs(d,p,C=>n.money(n.paidPrice(e.categoryKey,C.id,C.price,e.label))),h=n.buyerView()==="venue3d",y=n.performanceGroup()?.confirmDateSelection??void 0,f=y?n.performanceGroup()?.nights?.()??[]:[],T=y?Ar(f,y,e.id,(C,_)=>n.tf(C,_)):"";this.shownAt=performance.now();let w=document.createElement("div");w.className="sl-confirm sl-mo-in",t==="remove"&&w.classList.add("sl-confirm-removing"),T&&w.classList.add("sl-confirm-group-dates"),w.setAttribute("role","dialog"),w.setAttribute("aria-label",(0,Nt.t)("picker.confirmSeatLabel",{label:e.label}));let v=n.controller.getRenderer?.()?.categoryDisplayColor?.(e.categoryKey)??r?.color??"#6e7bff";w.style.setProperty("--sl-cat",v),w.style.setProperty("--sl-cat-ink",Ud(v));let A=String(s?.categoryLabel??r?.label??e.categoryKey),D=n.controller.categoryAvailability()[e.categoryKey],K=typeof D=="number"&&D>0?(0,Nt.tCount)("picker.leftCount",D):"",g=n.suppressPricing()?`${s?.displayLabel??e.displayLabel??e.label}`:`${s?.displayLabel??e.displayLabel??e.label} \xB7 ${l==null?n.tf("picker.priceNotSupplied","Price not supplied"):n.money(l)}`,L=Ur.passport?ts(e,g,h):"",N=Ur.compare?es(e,h?n.view3dCompareSeatIds():null):"";w.innerHTML=as({identityFields:c,identity:ns(s,e.displayLabel??e.label,rt(s)),marker:Jo({...s?.wheelchairSpaceType?{wheelchairSpaceType:s.wheelchairSpaceType}:{}}),see3dPill:os(n.canOffer3d(),h),categoryColor:v,categoryLabel:A,priceLabel:!n.suppressPricing()&&l!=null?n.money(l):"",categoryLeftLabel:K,tierChoices:u,groupDates:T,wheelchair:"",commercial:tt({...e.accessibility?.length?{accessibility:e.accessibility}:{},...s?.wheelchairSpaceType?{wheelchairSpaceType:s.wheelchairSpaceType}:{},...e.commercial?{commercial:e.commercial}:{}}),thumb:n.seatViewEnabled()&&n.buyerView()!=="venue3d"?this.thumbHtml(e):"",inspect:h?`<div class="sl-confirm-inspect-row">${L}${N}${_n(n.canOffer3d(),h)}</div>`:_n(n.canOffer3d(),h),see3dRow:ss(n.canOffer3d(),h),cancelLabel:(0,Nt.t)("common.cancel"),selectLabel:t==="remove"?n.tf("picker.removeSeat","Remove seat"):n.addSeatLabel(s?.objectType)}),t==="remove"&&w.querySelector(".sl-confirm-add svg path")?.setAttribute("d","M6 6l12 12M18 6L6 18"),n.els().map.appendChild(w),this.el=w;let R=w.querySelector(".sl-confirm-thumb"),O=R?.closest(".sl-confirm-thumbwrap")??null;if(R&&O){let C=!1,_=()=>{if(C||!O.isConnected)return;C=!0;let G=()=>{O.remove(),this.el===w&&n.reanchor()};if(n.reducedMotion()||typeof requestAnimationFrame!="function"){G();return}O.style.height=`${O.offsetHeight}px`,O.classList.add("sl-confirm-thumb-out"),requestAnimationFrame(()=>{O.style.height="0px",O.style.opacity="0"}),setTimeout(G,jd)};R.addEventListener("error",_),R.addEventListener("load",()=>{R.naturalWidth||_()});let U=e.viewMeta?.previewUrl??e.viewUrl;U?n.resolveAssetUrl(U).then(G=>{if(!(!w.isConnected||this.el!==w)){if(!G){_();return}R.src=G}}).catch(G=>{_(),n.onError(G)}):_()}n.reanchor(),this.liftSeatClearOfSheet(e),w.querySelector(".sl-confirm-view")?.addEventListener("click",()=>{n.openSeatView(e)}),w.querySelector(".sl-confirm-confidence")?.addEventListener("click",C=>{n.openSeatConfidencePassport(e,C.currentTarget instanceof HTMLElement?C.currentTarget:null)}),w.querySelector(".sl-confirm-compare")?.addEventListener("click",()=>n.saveView3dComparisonSeat(e)),w.querySelectorAll("[data-confirm-tier]").forEach(C=>{C.addEventListener("click",()=>{let _=C.dataset.confirmTier,U=d.find(de=>de.id===_);if(!U)return;n.controller.setSeatTier(e.id,U.id),w.querySelectorAll("[data-confirm-tier]").forEach(de=>{de.setAttribute("aria-pressed",String(de===C))});let G=w.querySelector(".sl-confirm-price");G&&(G.textContent=n.money(n.paidPrice(e.categoryKey,U.id,U.price,e.label))),n.reanchor()})}),w.querySelectorAll(".sl-confirm-3d,.sl-confirm-3dpill,.sl-confirm-3drow").forEach(C=>{C.addEventListener("pointerdown",Ci,{once:!0}),C.addEventListener("click",()=>{n.buyerView()==="venue3d"?(n.dismiss(),n.view3dHandle()?.flyToSeat(e.id)):(n.rememberView3dReturnSeat(e),n.dismiss(),n.enter3d(e.id))})}),Lr(w,y,(C,_)=>n.tf(C,_),()=>n.reanchor()),w.querySelector(".sl-confirm-add").addEventListener("click",()=>{if(!this.ghostActivation()){if(this.mode==="remove"){this.removeCommitted();return}this.commit()}}),w.querySelector(".sl-confirm-cancel").addEventListener("click",()=>{this.ghostActivation()||this.cancel()}),this.armOutsideTap(w),requestAnimationFrame(()=>{let C=w.querySelector(".sl-confirm-add");C?.focus(),n.liftToastOverConfirm(),n.fitTranslatedRows(),n.inviteCommit(w,C)})}liftSeatClearOfSheet(e){let t=this.host.controller.getRenderer();this.framing={gestures:t?.getCameraGestureCount?.()??0,quietUntil:0},this.frameSeatForSheet(e)}frameSeatForSheet(e){let t=this.host,n=t.root();if(!this.el||n?.dataset.layout!=="narrow"||n?.dataset.view3d==="on")return;let o=t.els().map;if(!o)return;let s=t.controller.worldToScreen({x:e.x,y:e.y}),r=t.controller.getRenderer(),a=r?.getCameraGestureCount?.()??0,{nudgeY:l}=zr(s.y,{height:o.clientHeight},{height:this.el.offsetHeight||230}),c=this.lift&&this.lift.gestures===a?this.lift.dy:0;if(!l){this.lift=c?{dy:c,gestures:a}:null;return}let d=!t.reducedMotion();r?.panScreenBy?.({x:0,y:l},{animate:d}),this.lift={dy:c+l,gestures:a},this.framing&&(this.framing.gestures=a,this.framing.quietUntil=d?this.now()+Gd:0)}reframeSeatForSheet(){let e=this.framing,t=this.seat;!e||!t||e.quietUntil&&this.now()<e.quietUntil||(this.host.controller.getRenderer()?.getCameraGestureCount?.()??e.gestures)!==e.gestures||this.frameSeatForSheet(t)}now(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}settleLift(){let e=this.lift;if(this.lift=null,this.framing=null,!e)return;let t=this.host.controller.getRenderer();(t?.getCameraGestureCount?.()??e.gestures)===e.gestures&&t?.panScreenBy?.({x:0,y:-e.dy},{animate:!this.host.reducedMotion()})}reanchor(){let e=this.host;if(!this.el||!this.seat||e.root()?.dataset.view3d==="on")return;let t=e.controller.worldToScreen({x:this.seat.x,y:this.seat.y}),n=e.els().map;if(e.root()?.dataset.layout==="narrow"){this.el.removeAttribute("data-placement"),this.el.style.removeProperty("bottom"),this.scrim=Gr(this.scrim,n,this.el,t),ks(this.el,t,n),e.liftToastOverConfirm(),this.reframeSeatForSheet();return}this.scrim=oo(this.scrim);let o=n.clientWidth,s=n.clientHeight,r=this.el.offsetWidth||276,a=this.el.offsetHeight||230,l=this.el.classList.contains("sl-confirm-group-dates"),c=e.controller.seatScreenRadius()*1.5,d=$r(t,{width:o,height:s},{width:r,height:a},l,c);this.el.dataset.placement=d.placement,this.el.style.left=`${d.left}px`,this.el.style.top=`${d.top}px`,Vi(this.el,t,{left:d.left,top:d.top,width:r,height:a})}ghostActivation(){return Kr()?performance.now()-this.shownAt<qr:!1}armOutsideTap(e){this.disarmOutsideTap();let t=this.host,n=s=>{if(this.el!==e){this.disarmOutsideTap();return}let r=s.target;!r||e.contains(r)||t.els().tray?.contains(r)||this.cancel()};this.outsideTap=n;let o=t.root();setTimeout(()=>{this.outsideTap===n&&(o??document).addEventListener("pointerdown",n,!0)},Kr()?qr:0)}disarmOutsideTap(){if(!this.outsideTap)return;let e=this.outsideTap;this.outsideTap=null,(this.host.root()??document).removeEventListener("pointerdown",e,!0),document.removeEventListener("pointerdown",e,!0)}dismiss(){let e=this.host;this.disarmOutsideTap(),this.scrim=oo(this.scrim),this.settleLift(),this.el&&zi(this.el),this.el=null,this.seat=null,e.liftToastOverConfirm(),e.root()?.removeAttribute("data-confirming"),Object.values(e.regions()).forEach(t=>t.toggleAttribute("inert",!1)),e.applyPanelCollapsed(),e.controller.setSelectionFocus(null),e.syncTray()}async commit(){let e=this.host,t=this.seat;if(!t)return;let o=this.el?.querySelector(".sl-confirm-add")??null;if(o?.classList.contains("is-adding")||!await Mr(this.el,t.id,e.performanceGroup()?.confirmDateSelection??void 0))return;e.collapseSectionCard(),this.seat=null,e.syncTray(),e.syncSelectionTo3d();let s=()=>{let l=e.root()?.dataset.layout==="narrow"?this.lift:null;l&&(this.lift=null),e.dismiss();let c=e.controller.worldToScreen(t);Kn(e.els(),c,t,e.controller.doc?.categories,()=>{e.cartLanded?.(),l&&(this.lift=l,this.settleLift())})};if(!o||e.reducedMotion()){s();return}o.classList.remove("sl-confirm-add-invite"),o.classList.add("is-adding"),o.setAttribute("aria-disabled","true");let r=o.querySelector(".sl-confirm-add-t");r&&(r.textContent=e.tf("picker.added","Added")),e.scheduleMotion(s,$d)}cancel(){let e=this.host,t=this.seat;t&&(this.mode!=="remove"&&e.controller.deselect([t.id]),this.seat&&e.dismiss(),e.syncSelectionTo3d(),e.root()?.focus({preventScroll:!0}))}removeCommitted(){let e=this.host,t=this.seat;if(!t)return;let n=e.releaseHeldSeat(t);n||e.controller.deselect([t.id]),e.dismiss(),e.syncTray(),e.syncSelectionTo3d(),e.root()?.focus({preventScroll:!0})}};function Yr(i,e,t){if(!e||t||i.classList.contains("sl-confirm-removing"))return;e.classList.add("sl-confirm-add-invite");let n=()=>e.classList.remove("sl-confirm-add-invite");i.addEventListener("pointerdown",n,{once:!0}),i.addEventListener("keydown",n,{once:!0}),e.addEventListener("focus",n,{once:!0})}function Xr(i,e){return i&&i!=="seat"?e("picker.select","Select"):e("picker.addSeat","Add seat")}var Zr=require("@seatlayer/core"),Dt=require("@seatlayer/core/picker/minimapGeometry");function qd(i){let e={inactive:0,available:1,selected:2},t=new Map;for(let o of i){let s=t.get(o.id);(!s||e[o.state]>e[s])&&t.set(o.id,o.state)}let n={selected:0,available:0,inactive:0};for(let o of t.values())n[o]+=1;return n}function Kd(i,e){return i.x<=e.x&&i.y<=e.y&&i.x+i.width>=e.x+e.width&&i.y+i.height>=e.y+e.height}function Qr(i,e){let t=new so(i);return t.build(e),t}var so=class{constructor(e){this.host=e;this.miniCanvas=null;this.miniBase=null;this.miniWrap=null;this.miniToggle=null;this.miniLabel=null;this.miniTf=null;this.miniDrag=null;this.miniSuppressClick=!1;this.userClosed=!1}dispose(){this.miniToggle?.remove(),this.miniWrap?.remove(),this.miniToggle=null,this.miniWrap=null,this.miniCanvas=null,this.miniBase=null,this.miniLabel=null,this.miniTf=null,this.miniDrag=null,this.host.root()?.removeAttribute("data-minimap-open")}build(e){if(!this.host.controller.getViewport())return;let n=document.createElement("button");n.type="button",n.className="sl-minimap-toggle",n.setAttribute("aria-label",b("picker.openVenueMap","Open venue overview map")),n.setAttribute("aria-expanded","false"),n.innerHTML='<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M3 6l5-2 8 3 5-2v13l-5 2-8-3-5 2zM8 4v13M16 7v13"/></svg>',e.appendChild(n),this.miniToggle=n;let o=document.createElement("div");o.className="sl-minimap",o.setAttribute("role","group");let s=document.createElement("div");s.className="sl-minimap-bar";let r=document.createElement("span");r.className="sl-minimap-label";let a=document.createElement("span");a.className="sl-minimap-key",a.setAttribute("aria-label",b("picker.minimapStateKey","Focused, selected, available, and inactive sections")),a.innerHTML='<i class="focused" title="Focused"></i><i class="selected" title="Selected"></i><i title="Available"></i><i class="inactive" title="Inactive"></i>';let l=document.createElement("button");l.type="button",l.className="sl-minimap-close",l.setAttribute("aria-label",b("picker.closeVenueMap","Close venue overview map")),l.textContent="\xD7",s.append(r,a,l);let c=document.createElement("canvas");c.tabIndex=0,c.setAttribute("role","application"),c.setAttribute("aria-label",b("picker.venueMapInstructions","Venue overview map. Drag the viewport, click a section, or use arrow keys to pan.")),o.append(s,c),e.appendChild(o),this.miniWrap=o,this.miniLabel=r,this.miniCanvas=c;let d=document.createElement("canvas");this.miniBase=d,n.addEventListener("click",()=>{let p=this.host.root()?.dataset.minimapOpen==="true";this.userClosed=p,this.setMinimapOpen(!p)}),l.addEventListener("click",()=>{this.userClosed=!0,this.setMinimapOpen(!1)}),c.addEventListener("click",p=>{if(this.miniSuppressClick){this.miniSuppressClick=!1;return}this.minimapJump(p)}),c.addEventListener("pointerdown",p=>this.minimapPointerDown(p)),c.addEventListener("pointermove",p=>this.minimapPointerMove(p)),c.addEventListener("pointerup",p=>this.minimapPointerUp(p)),c.addEventListener("pointercancel",p=>this.minimapPointerUp(p)),c.addEventListener("keydown",p=>this.minimapKeydown(p)),this.layoutMinimap(),this.syncMinimapLabel(),this.drawMinimapStatic(),this.drawMinimapRect()}setAutoOpen(e){if(this.miniWrap){if(!e){this.userClosed=!1,this.host.root()?.dataset.minimapOpen==="true"&&this.setMinimapOpen(!1,!1);return}this.userClosed||this.host.root()?.dataset.minimapOpen==="true"||this.setMinimapOpen(!0,!1)}}setMinimapOpen(e,t=!0){this.host.root()?.setAttribute("data-minimap-open",String(e)),this.miniToggle?.setAttribute("aria-expanded",String(e)),t&&(e?this.miniCanvas?.focus():this.miniToggle?.focus())}layoutMinimap(){let e=this.miniCanvas,t=this.miniBase,n=this.host.controller.getViewport()?.bounds;if(!e||!t||!n||!(n.width>0&&n.height>0))return;let o=196,s=146,r=6,a=n.width/Math.max(1,n.height),l=o,c=Math.round(o/a);c>s&&(c=s,l=Math.round(s*a)),l=Math.max(64,l),c=Math.max(48,c);let d=Math.min(2,window.devicePixelRatio||1);e.width=Math.round(l*d),e.height=Math.round(c*d),e.style.width=`${l}px`,e.style.height=`${c}px`,t.width=e.width,t.height=e.height,this.miniTf=(0,Dt.createMinimapTransform)(n,e.width,e.height,d,r)}syncMinimapLabel(){if(!this.miniLabel||!this.miniWrap)return;let e=this.host.controller.getFloors(),t=this.host.controller.isFloorOverview()?b("picker.allFloors","All floors"):e.find(d=>d.id===this.host.controller.getActiveFloorId())?.name??b("picker.venueOverview","Venue overview"),n=this.host.controller.getMinimapSnapshot().sections,s=n.find(d=>d.active)?.label??this.host.focusedSectionLabel(),r=s?`${t} \xB7 ${s}`:t;this.miniLabel.textContent=r;let{selected:a,available:l,inactive:c}=qd(n);this.miniWrap.setAttribute("aria-label",n.length?`${r}. ${a} selected, ${l} available, ${c} inactive sections.`:r),this.miniCanvas?.setAttribute("aria-label",n.length?`${r}. ${a} selected, ${l} available, ${c} inactive sections. ${b("picker.venueMapInstructions","The outlined region is the visible map area. Drag it, click a section, or use arrow keys to pan.")}`:`${r}. ${b("picker.venueMapInstructions","The outlined region is the visible map area. Drag it, click elsewhere, or use arrow keys to pan.")}`)}refreshMinimap(){this.miniBase&&(this.layoutMinimap(),this.syncMinimapLabel(),this.drawMinimapStatic(),this.drawMinimapRect())}drawMinimapStatic(){let e=this.miniBase,t=this.miniTf;if(!e||!t)return;let n=e.getContext("2d");if(!n)return;n.clearRect(0,0,e.width,e.height);let o=p=>p*t.scale+t.offX,s=p=>p*t.scale+t.offY,r=this.host.cssVar("--sl-line")||"rgba(139,147,167,.5)",a=this.host.cssVar("--sl-muted")||"#8b93a7",l=this.host.cssVar("--sl-accent")||"#6e7bff",c=this.host.cssVar("--sl-success")||"#22a06b",d=this.host.controller.getMinimapSnapshot();for(let p of d.sections){if(p.outline.length<3)continue;n.beginPath(),p.outline.forEach((h,y)=>y===0?n.moveTo(o(h.x),s(h.y)):n.lineTo(o(h.x),s(h.y))),n.closePath();let u=p.paint;if(n.globalAlpha=p.state==="inactive"?.5:.92,u?n.fillStyle=u.fill:(n.globalAlpha=p.state==="inactive"?.18:p.state==="selected"?.72:.34,n.fillStyle=p.state==="inactive"?a:p.state==="selected"?l:c),n.fill(),n.globalAlpha=.82,n.lineWidth=Math.max(1,t.dpr),n.strokeStyle=u?.stroke||r,n.stroke(),p.owned){n.globalAlpha=1,n.lineWidth=Math.max(2,t.dpr*1.5),n.strokeStyle=l,n.stroke();let h=p.outline.reduce((y,f)=>({x:y.x+f.x,y:y.y+f.y}),{x:0,y:0});n.beginPath(),n.arc(o(h.x/p.outline.length),s(h.y/p.outline.length),Math.max(1.5,t.dpr*1.6),0,Math.PI*2),n.fillStyle=l,n.fill(),n.beginPath(),p.outline.forEach((y,f)=>f===0?n.moveTo(o(y.x),s(y.y)):n.lineTo(o(y.x),s(y.y))),n.closePath()}p.active&&(n.globalAlpha=1,n.lineJoin="round",n.lineWidth=Math.max(4,t.dpr*3.5),n.strokeStyle=this.host.cssVar("--sl-surface")||"#fff",n.stroke(),n.lineWidth=Math.max(2,t.dpr*1.75),n.strokeStyle=l,n.stroke())}if(n.globalAlpha=1,!d.sections.length){let p=Math.max(1,t.dpr),u=this.host.controller.getRenderer?.(),h=new Map,y=f=>{let T=h.get(f);if(T)return T;let w=u?.categoryDisplayColor?.(f)||c;return h.set(f,w),w};for(let f of d.seats)n.globalAlpha=f.state==="inactive"?.22:.78,n.fillStyle=f.state==="inactive"?a:f.state==="selected"?l:y(f.categoryKey),n.beginPath(),n.arc(o(f.x),s(f.y),p,0,Math.PI*2),n.fill();n.globalAlpha=1}}drawMinimapRect(){let e=this.miniCanvas,t=this.miniBase,n=this.miniTf;if(!e||!t||!n)return;let o=e.getContext("2d");if(!o)return;o.clearRect(0,0,e.width,e.height),o.drawImage(t,0,0);let s=this.host.controller.getViewport();if(!s||Kd(s.visible,s.bounds))return;let r=(0,Dt.minimapViewportPlan)(s.visible,n,e.width,e.height,Math.max(2,n.dpr*2)),a=this.host.cssVar("--sl-text")||"#12151c",l=this.host.cssVar("--sl-surface")||"#fff";o.save(),o.globalAlpha=.1,o.fillStyle=a,o.fillRect(r.raw.x,r.raw.y,r.raw.width,r.raw.height),o.globalAlpha=.9,o.lineJoin="round",o.lineWidth=Math.max(4,n.dpr*3.25),o.strokeStyle=l,o.strokeRect(r.raw.x,r.raw.y,r.raw.width,r.raw.height),o.globalAlpha=1,o.lineWidth=Math.max(2,n.dpr*1.75),o.strokeStyle=a,o.strokeRect(r.raw.x,r.raw.y,r.raw.width,r.raw.height),r.clipped&&Object.values(r.clippedEdges).some(Boolean)&&(o.setLineDash([Math.max(3,n.dpr*3),Math.max(2,n.dpr*2)]),o.strokeRect(r.clipped.x,r.clipped.y,r.clipped.width,r.clipped.height)),o.restore()}minimapWorldPoint(e){let t=this.miniCanvas,n=this.miniTf;if(!t||!n)return null;let o=t.getBoundingClientRect(),s=(e.clientX-o.left)*(t.width/Math.max(1,o.width)),r=(e.clientY-o.top)*(t.height/Math.max(1,o.height));return{...(0,Dt.minimapPointToWorld)({x:s,y:r},n),px:s,py:r}}minimapPointerDown(e){let t=this.minimapWorldPoint(e),n=this.host.controller.getViewport()?.visible;!t||!n||!(t.x>=n.x&&t.x<=n.x+n.width&&t.y>=n.y&&t.y<=n.y+n.height)||(this.miniDrag={pointerId:e.pointerId,offsetX:t.x-(n.x+n.width/2),offsetY:t.y-(n.y+n.height/2),startX:e.clientX,startY:e.clientY,moved:!1},this.miniCanvas?.setPointerCapture(e.pointerId),this.miniCanvas?.classList.add("sl-dragging"),e.preventDefault())}minimapPointerMove(e){let t=this.miniDrag;if(!t||t.pointerId!==e.pointerId)return;let n=this.minimapWorldPoint(e);n&&(!t.moved&&Math.hypot(e.clientX-t.startX,e.clientY-t.startY)>2&&(t.moved=!0,this.host.controller.clearSectionFocus()),this.host.controller.panToWorld({x:n.x-t.offsetX,y:n.y-t.offsetY}),e.preventDefault())}minimapPointerUp(e){let t=this.miniDrag;!t||t.pointerId!==e.pointerId||(this.miniSuppressClick=t.moved,this.miniDrag=null,this.miniCanvas?.classList.remove("sl-dragging"),this.miniCanvas?.hasPointerCapture(e.pointerId)&&this.miniCanvas.releasePointerCapture(e.pointerId))}minimapKeydown(e){let t=this.host.controller.getViewport()?.visible;if(!t)return;if(e.key==="Home"){this.host.controller.overview(),e.preventDefault();return}let n=e.key==="ArrowLeft"?-t.width*.2:e.key==="ArrowRight"?t.width*.2:0,o=e.key==="ArrowUp"?-t.height*.2:e.key==="ArrowDown"?t.height*.2:0;!n&&!o||(this.host.controller.clearSectionFocus(),this.host.controller.panToWorld({x:t.x+t.width/2+n,y:t.y+t.height/2+o}),e.preventDefault())}minimapJump(e){let t=this.minimapWorldPoint(e);if(t){for(let n of this.host.controller.getMinimapSnapshot().sections)if(!(n.state==="inactive"||n.outline.length<3)&&(0,Zr.pointInPolygon)(t,n.outline)){this.host.controller.focusSection(n.id);return}this.host.controller.clearSectionFocus(),this.host.controller.panToWorld(t)}}};var un=require("@seatlayer/core");var Wd=12;function Jr(i,e){let t=e.floors(),n=new Set(t.map(g=>g.label.trim().toLocaleLowerCase())),o=e.zones().filter(g=>g.seatCount>0&&!n.has(g.label.trim().toLocaleLowerCase())),s=e.sections().filter(g=>g.seatCount>0&&!n.has(g.label.trim().toLocaleLowerCase())),r=o.length>1?[]:s,a=t.length>1,l=o.length>1,c=r.length>1;if(!a&&!l&&!c)return null;let d=document.createElement("div");d.className="sl-view3d-nav";let p=null,u=document.createElement("button");u.type="button",u.className="sl-view3d-nav-toggle",u.setAttribute("aria-expanded","false");let h='<svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="12" r="9"/><path d="M15.5 8.5l-2 5-5 2 2-5z"/></svg>',y=document.createElement("span");u.innerHTML=h,u.appendChild(y);let f=()=>{for(let g of d.querySelectorAll(":scope > div")){let L=g.querySelector('[aria-pressed="true"]');!L||g.scrollWidth<=g.clientWidth||L.scrollIntoView({block:"nearest",inline:"nearest"})}},T=()=>{if(p)return p;for(let g of d.querySelectorAll(":scope > div")){let L=g.querySelector('button[aria-pressed="true"]'),N=L?.textContent?.trim();if(N&&L?.dataset.floor!=="")return N}return a&&(l||c)?b("picker.levelsAndAreas","Levels & areas"):a?b("picker.levels","Levels"):b("picker.areas","Areas")},w=g=>{d.classList.toggle("is-open",g),u.setAttribute("aria-expanded",String(g)),g&&typeof requestAnimationFrame=="function"&&requestAnimationFrame(f),y.textContent=T()};u.addEventListener("click",()=>w(!d.classList.contains("is-open"))),d.addEventListener("keydown",g=>{g.key!=="Escape"||!d.classList.contains("is-open")||(g.preventDefault(),g.stopPropagation(),w(!1),u.focus())});let v=document.createElement("button");v.type="button",v.className="sl-view3d-nav-close",v.innerHTML='<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M18 6L6 18M6 6l12 12"/></svg>';let A=b("picker.closeVenueNavigation","Close venue navigation");v.setAttribute("aria-label",A),v.title=A,v.addEventListener("click",()=>{w(!1),u.focus()}),w(!1),d.appendChild(u);let D=g=>{},K=g=>{};if(a){let g=document.createElement("div");g.setAttribute("role","group"),g.setAttribute("aria-label",b("picker.levels","Levels"));let L=[];K=O=>{L.forEach(C=>{C.setAttribute("aria-pressed",String((C.dataset.floor===""?null:Number(C.dataset.floor))===O))})};let N=O=>{e.focusFloor(O)&&(K(O),D(O))},R=(O,C)=>{let _=document.createElement("button");_.type="button",_.textContent=O,_.dataset.floor=C===null?"":String(C),_.setAttribute("aria-pressed",String(C===null)),_.addEventListener("click",()=>{N(C),w(!1)}),L.push(_),g.appendChild(_)};R(b("picker.allLevels","All levels"),null);for(let O of t)R(O.label||(0,un.t)("picker.levelNumber",{number:O.index+1}),O.index);d.appendChild(g)}if(l||c){let g=document.createElement("div");g.setAttribute("role","group"),g.setAttribute("aria-label",b("picker.areas","Areas"));let L=l?o.map(R=>({id:R.id,label:R.label||R.id,go:()=>{e.focusZone(R.id)}})):r.map(R=>({id:R.id,label:R.label||R.id,floorIndex:R.floorIndex,go:()=>{e.focusSection(R.id),Number.isFinite(R.floorIndex)&&K(R.floorIndex)}})),N=R=>{let O=l||R===null?L:L.filter(C=>C.floorIndex===void 0||C.floorIndex===R);if(g.replaceChildren(),!O.length){g.remove();return}if(g.isConnected||d.insertBefore(g,v.isConnected?v:null),!l&&O.length>Wd){let C=document.createElement("select");C.setAttribute("aria-label",b("picker.jumpToSection","Jump to section"));let _=document.createElement("option");_.value="",_.textContent=b("picker.jumpToSection","Jump to section"),C.appendChild(_);for(let U of O){let G=document.createElement("option");G.value=U.id,G.textContent=U.label,C.appendChild(G)}C.addEventListener("change",()=>{O.find(U=>U.id===C.value)?.go()}),g.appendChild(C);return}for(let C of O){let _=document.createElement("button");_.type="button",_.textContent=C.label,_.dataset.area=C.id,_.addEventListener("click",()=>{p=C.label,C.go(),w(!1)}),g.appendChild(_)}};D=N,N(null)}return d.appendChild(v),i.appendChild(d),d}var mn=class{constructor(e){this.host=e;this.chip=null}sync(){let e=this.host.overlay();if(!e||this.host.savedSeatIds().length===0){this.chip?.remove(),this.chip=null;return}let t=this.chip;if(!t){t=document.createElement("div"),t.className="sl-view3d-compare-saved",t.setAttribute("role","group"),t.setAttribute("aria-label",b("picker.savedSeatComparison","Saved seat comparison"));let s=document.createElement("button");s.type="button",s.className="main",s.addEventListener("click",()=>{this.host.savedSeatIds().length>1?this.host.openComparison():this.host.toast(b("picker.chooseAnotherToCompare","Choose another seat to compare."),"neutral")});let r=document.createElement("button");r.type="button",r.className="clear",r.textContent="\xD7",r.setAttribute("aria-label",b("picker.clearSavedSeatComparison","Clear saved seat comparison")),r.addEventListener("click",()=>this.host.clearComparison()),t.append(s,r),e.appendChild(t),this.chip=t}let n=this.host.savedSeatIds().length,o=t.querySelector(".main");o&&(o.textContent=n>1?(0,un.t)("picker.compareCount",{count:n}):b("picker.oneSeatSaved","1 seat saved"),o.setAttribute("aria-label",n>1?(0,un.t)("picker.openComparisonOfSeats",{count:n}):b("picker.oneSeatSavedChooseAnother","One seat saved; choose another to compare")))}remove(){this.chip?.remove(),this.chip=null}mainButton(){return this.chip?.querySelector(".main")??null}};function ea(i){return!i?.querySelector('[data-ref="zfs"]')}var ta="sl:sheet-hint";function ia(i){let e=i.boot;if(!e?.isConnected)return;if(i.reducedMotion){e.remove();return}e.classList.add("is-going"),setTimeout(()=>e.remove(),200);let t=document.createElement("div");t.className="sl-shells-in",t.setAttribute("aria-hidden","true"),i.map?.appendChild(t),setTimeout(()=>t.remove(),650),i.rail?.classList.add("is-in"),i.root?.classList.add("is-arriving"),setTimeout(()=>{i.rail?.classList.remove("is-in"),i.root?.classList.remove("is-arriving"),Yd(i.root)},900)}function Yd(i){if(!i||i.dataset.layout!=="narrow")return;try{if(window.sessionStorage.getItem(ta))return;window.sessionStorage.setItem(ta,"1")}catch{}let e=i.querySelector(".sl-sheet-toggle");e&&(e.classList.add("sl-mo-hint"),e.addEventListener("animationend",()=>e.classList.remove("sl-mo-hint"),{once:!0}))}function na(i,e){i.addEventListener("keydown",t=>{if(t.key==="Escape"){for(let n of e())if(n.open()){t.preventDefault(),t.stopPropagation(),n.close();return}}})}function fn(i){let e=i.committedSelection(),t=i.controller.getGAAreas(),n=i.hold?.items??[],o=new Set(n.map(u=>u.label)),s=Ms(i,t,n),r=je(i.gaQty,n),a=n.reduce((u,h)=>u+i.paidPrice(h.categoryKey,h.tierId,h.unitPrice,h.label)*(h.quantity??1),0),l=n.reduce((u,h)=>u+(h.quantity??1),0),c=e.filter(u=>!o.has(u.label)),d=c.reduce((u,h)=>u+i.paidPrice(h.categoryKey,h.tierId??null,h.price,h.label)*(h.quantity??1),0)+s+a,p=c.reduce((u,h)=>u+(h.quantity??1),0)+r+l;return{seats:e,freshSeats:c,gaAreas:t,heldItems:n,heldLabels:o,heldCount:l,total:d,count:p}}function gn(i,e){let t=e.tiers?.length?e.tiers[0].price:e.price;return t===void 0||!e.key?t:i.paidPrice(e.key,e.tiers?.[0]?.id??null,t)}function bn(i,e){let t=e.tiers?.length?e.tiers.map(n=>i.paidPrice(e.key,n.id??null,n.price)):e.price==null?[]:[i.paidPrice(e.key,null,e.price)];if(e.key)for(let n of i.pricesByChannel.values())for(let o of n)o.categoryKey===e.key&&t.push(o.price);return t.length?{min:Math.min(...t),max:Math.max(...t)}:void 0}var ci="seatlayer_";function Xd(){let i=globalThis;return i.document?.modelContext??i.navigator?.modelContext??null}function ye(i,e){return e?{ok:!1,reason:i,message:e}:{ok:!1,reason:i}}function Zd(i){return Array.isArray(i)?i.filter(e=>typeof e=="string"&&!!e):[]}function Qd(i,e){let t=i.event();if(!t)return ye("not_loaded","The seat map has not finished loading.");let n=i.selectionLimits();return{ok:!0,event:t,selection:{max:n.max,...n.required!=null?{required:n.required}:{}},categories:i.categories(),zones:i.zones(),hasPremiumSeats:i.hasPremiumSeats(),holdsAllowed:e}}function oa(i,e){let t=o=>!!o&&o.toLowerCase()===e.toLowerCase(),n=i.find(o=>t(o.key??o.id))??i.find(o=>t(o.label));return n?.key??n?.id??null}function sa(i,e){let t=e.map(n=>i.describeSeat(n.id));return{seatIds:e.map(n=>n.id),labels:e.map(n=>n.label),section:t[0]?.section??"",row:t[0]?.row??"",seats:e.map((n,o)=>t[o]?.seat||n.label),category:t[0]?.category??e[0].categoryKey,unitPrice:e[0].price,total:e.reduce((n,o)=>n+o.price,0)}}function Jd(i,e,t){let n=new Map;for(let s of e){let r=n.get(s.rowKey);r?r.push(s):n.set(s.rowKey,[s])}let o=[];for(let s of n.values()){let r=[...s].sort((l,c)=>l.index-c.index),a=0;for(let l=1;l<=r.length;l++)if(l===r.length||r[l].index!==r[l-1].index+1||r[l].categoryKey!==r[l-1].categoryKey){for(let d=a;d+t<=l;d+=t)o.push(sa(i,r.slice(d,d+t)));a=l}}return o}function ep(i,e,t){let n=new Map;for(let s of e){let r=n.get(s.sectionKey);r?r.push(s):n.set(s.sectionKey,[s])}let o=[];for(let s of n.values()){if(s.length<t)continue;let r=[...s].sort((a,l)=>a.price!==l.price?l.price-a.price:a.rowKey.localeCompare(l.rowKey)||a.index-l.index);o.push(sa(i,r.slice(0,t)))}return o}function tp(i,e){if(!i.event())return ye("not_loaded","The seat map has not finished loading.");let n=i.selectionLimits(),o=Math.floor(Number(e.count));if(!Number.isInteger(o)||o<1||o>n.max)return ye("bad_count",`count must be a whole number between 1 and ${n.max}.`);let s=Number.isInteger(Number(e.limit))?Math.max(1,Math.min(20,Number(e.limit))):5,r=e.together===void 0?!0:!!e.together,a=typeof e.max_price=="number"&&Number.isFinite(e.max_price)?e.max_price:null,l=typeof e.category=="string"&&e.category?e.category:null,c=typeof e.zone=="string"&&e.zone?e.zone:null,d=l?oa(i.categories(),l):null;if(l&&!d)return ye("no_match",`No ticket type called "${l}".`);let p=c?oa(i.zones(),c):null;if(c&&!p)return ye("no_match",`No zone called "${c}".`);let u=i.seats().filter(f=>f.available);if(!u.length)return ye("sold_out");let h=u.filter(f=>(!d||f.categoryKey===d)&&(!p||f.zoneId===p)&&(a==null||f.price<=a));if(!h.length)return ye("no_match");let y=r?Jd(i,h,o):ep(i,h,o);return y.length?(y.sort((f,T)=>T.unitPrice!==f.unitPrice?T.unitPrice-f.unitPrice:f.row.localeCompare(T.row)||f.labels[0].localeCompare(T.labels[0])),{ok:!0,groups:y.slice(0,s),searched:{count:o,filters:{...a!=null?{max_price:a}:{},...d?{category:d}:{},...p?{zone:p}:{},together:r}}}):ye(r?"not_enough_together":"no_match")}function ra(i){return{ok:!0,...i.selection()}}function ip(i,e){let t=i.event();if(!t)return ye("not_loaded","The seat map has not finished loading.");if(t.salesClosed)return ye("event_closed","Sales are closed for this event.");let n=Zd(e.seat_ids);return n.length?(i.clearSelection(),i.selectObjects(n),ra(i)):ye("nothing_requested","Pass one or more seat ids or labels in seat_ids.")}function np(i,e){let t=async o=>{try{return await o()}catch(s){return ye("error",s instanceof Error?s.message:String(s))}},n=[{name:`${ci}describe_event`,title:"Describe this seated event",description:"Read the event, its ticket types with live availability and prices, its zones, and how many seats this buyer may select. Call this first.",inputSchema:{type:"object",properties:{},additionalProperties:!1},annotations:{readOnlyHint:!0,untrustedContentHint:!0},execute:()=>t(()=>Qd(i,e))},{name:`${ci}find_seats`,title:"Find available seats",description:"Search the seat map for groups of available seats. Read-only: it never selects, holds or reserves anything. Returns candidate groups with their seat ids, prices and location.",inputSchema:{type:"object",properties:{count:{type:"integer",minimum:1,description:"How many seats are needed."},max_price:{type:"number",description:"Highest acceptable price per seat."},category:{type:"string",description:"Ticket type key or label to restrict the search to."},zone:{type:"string",description:"Zone id or label to restrict the search to."},together:{type:"boolean",description:"Require the seats to be side by side in one row (default true)."},limit:{type:"integer",minimum:1,maximum:20,description:"How many candidate groups to return (default 5)."}},required:["count"],additionalProperties:!1},annotations:{readOnlyHint:!0,untrustedContentHint:!0},execute:o=>t(()=>tp(i,o))},{name:`${ci}select_seats`,title:"Select seats on the map",description:"Replace the current selection with the given seats, exactly as tapping them would. The buyer sees the seats light up and the basket update. No reservation is made.",inputSchema:{type:"object",properties:{seat_ids:{type:"array",items:{type:"string"},description:"Seat ids or labels, e.g. from find_seats."}},required:["seat_ids"],additionalProperties:!1},annotations:{readOnlyHint:!1,untrustedContentHint:!0},execute:o=>t(()=>ip(i,o))},{name:`${ci}get_selection`,title:"Read the current selection",description:"Read the seats currently selected in the basket, their total, any open reservation, and whether the selection satisfies this event\u2019s rules.",inputSchema:{type:"object",properties:{},additionalProperties:!1},annotations:{readOnlyHint:!0,untrustedContentHint:!0},execute:()=>t(()=>ra(i))}];return e&&n.push({name:`${ci}hold_selection`,title:"Reserve the selected seats",description:"Reserve the currently selected seats for this buyer for a limited time, exactly as pressing the checkout button would. Confirm with the buyer before calling this.",inputSchema:{type:"object",properties:{},additionalProperties:!1},annotations:{readOnlyHint:!1,untrustedContentHint:!0},execute:()=>t(()=>i.hold())}),n}async function aa(i,e={}){let t=Xd();if(!t||typeof t.registerTool!="function")return null;let n=new AbortController,o=np(i,!!e.holds),s=[],r=e.exposedTo?.length?[...new Set(e.exposedTo)]:void 0;try{for(let a of o)await t.registerTool(a,{signal:n.signal,...r?{exposedTo:r}:{}}),s.push(a.name)}catch(a){console.warn("seatmap: WebMCP tools could not be registered",a)}return s.length?{names:s,dispose:()=>{if(n.abort(),typeof t.unregisterTool=="function")for(let a of s)try{t.unregisterTool(a)}catch{}}}:null}async function la(i){let e=i.opts.webMcp;if(!e||i.destroyed)return;let t=typeof e=="object"&&!!e.holds,n=typeof e=="object"?e.exposedTo:void 0;try{i.webMcp=await aa(ao(i,t),{holds:t,exposedTo:n}),i.destroyed&&ro(i)}catch(o){console.warn("seatmap: WebMCP registration failed",o)}}function ro(i){i.webMcp?.dispose(),i.webMcp=null}function ao(i,e){let t=(n,o)=>{if(Number.isInteger(n.logicalSeatIndex))return n.logicalSeatIndex;let s=n.id.lastIndexOf(":"),r=s<0?NaN:Number(n.id.slice(s+1));return Number.isFinite(r)?r:o};return{event:()=>{let n=i.renderInfo;return n?{name:n.eventName??"",venue:n.venue??null,startsAt:n.startsAt??null,timezone:n.timezone??null,currency:i.currency,salesClosed:i.salesClosed}:null},selectionLimits:()=>({max:i.maxTickets,required:i.exactTickets}),categories:()=>{let n=i.controller.categoryAvailability();return(i.controller.doc?.categories??[]).filter(o=>!o.notForSale).map(o=>{let s=bn(i,o),r=gn(i,o);return{key:o.key,label:o.label??o.key,...r===void 0?{}:{price:r},...s&&s.min!==s.max?{priceRange:s}:{},available:n[o.key]??0}})},zones:()=>i.controller.getBestAvailableZones(),hasPremiumSeats:()=>i.controller.hasPremiumSeats(),seats:()=>{let n=i.controller.getActiveFloorId(),o=[];return i.allSeats().forEach((s,r)=>{if(s.floorId&&n&&s.floorId!==n)return;let a=i.controller.getStatus(s.id)??"free",l=i.controller.doc?.categories.find(d=>d.key===s.categoryKey),c=l?.tiers?.length?l.tiers[0].price:l?.price??0;o.push({id:s.id,label:s.label,rowKey:s.logicalRowId??s.rowId,sectionKey:s.sectionId??s.rowId,index:t(s,r),categoryKey:s.categoryKey,price:i.paidPrice(s.categoryKey,l?.tiers?.[0]?.id??null,c,s.label),...s.zoneId?{zoneId:s.zoneId}:{},available:a==="free"&&!l?.notForSale})}),o},describeSeat:n=>{let o=i.controller.seatDetails(n);return o?{section:o.sectionLabel??"",row:Q(o)??"",seat:o.seatNumber??o.label,category:o.categoryLabel??o.categoryKey}:null},selection:()=>{let{freshSeats:n,total:o,count:s}=fn(i);return{seats:n.map(r=>({id:r.id,label:r.label,section:r.sectionLabel??"",row:Q(r)??"",seat:r.seatNumber??r.label,category:r.categoryKey,price:i.paidPrice(r.categoryKey,r.tierId??null,r.price,r.label)})),count:s,total:o,currency:i.currency,hold:i.hold?{id:i.hold.holdId,expiresAt:i.hold.expiresAt}:null,validity:i.getSelectionValidity()}},clearSelection:()=>i.clearSelection(),selectObjects:n=>{i.selectObjects(n)},hold:()=>e?op(i):Promise.resolve({ok:!1,reason:"not_allowed"})}}async function op(i){if(i.salesClosed)return{ok:!1,reason:"event_closed"};if(!i.totalTicketCount())return{ok:!1,reason:"nothing_selected"};let e=i.controller.getSelectionValidity(i.totalTicketCount());return e&&!e.isValid?{ok:!1,reason:"invalid_selection"}:(await i.handleCta(),i.hold?{ok:!0,hold:{id:i.hold.holdId,expiresAt:i.hold.expiresAt}}:{ok:!1,reason:"hold_failed"})}function lo(i){return{renderingTimeMillis:i.ms,performanceProfile:i.performanceProfile,seatCount:i.seatCount,objectCount:i.objectCount,sectionCount:i.sectionCount,view:i.view,eventKey:i.eventKey,chartName:i.chartName,floorCount:i.floorCount,transport:i.transport,load:i.load,metricScope:i.metricScope,operationalTelemetryReporter:"sdk"}}function ca(i,e){Ae({apiBase:i.apiBase,event:i.eventKey,scope:i.metricScope,surface:i.surface,outcome:"success",ms:i.ms,performanceProfile:i.performanceProfile,chartDelivery:i.chartDelivery,seats:i.seatCount,floors:i.floorCount,view:i.view,load:i.load,transport:i.transport}),e("chart_rendered",lo(i))}var da=require("@seatlayer/core/core/seatConfidence");function ae(i){return String(i??"").replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#39;")}function pa(i){let e=(0,da.seatConfidenceDisclosure)(i.seat.confidenceEvidence),t=i.seat.confidenceEvidence,n=e.limitations.length?`<h4>Known limits</h4><ul>${e.limitations.map(c=>`<li>${ae(c)}</li>`).join("")}</ul>`:"",o=e.modeledTarget?`<div><dt>Modeled target</dt><dd>${ae(e.modeledTarget)}</dd></div>`:"",s=t?`<div><dt>Evidence ID</dt><dd>${ae(t.evidenceId)}</dd></div><div><dt>Model version</dt><dd>${ae(t.modelVersion)}</dd></div><div><dt>Event configuration</dt><dd>${ae(t.eventConfigurationId??"Not configuration-specific")}</dd></div><div><dt>Approval</dt><dd>${ae(t.approvedByRole??"No external approval supplied")}</dd></div>`+(t.validUntil?`<div><dt>Valid until</dt><dd>${ae(t.validUntil.slice(0,10))}</dd></div>`:""):"<div><dt>Evidence ID</dt><dd>None supplied</dd></div>",r=Mi(i.seat.commercial).join(" \xB7 ")||i.restrictionFallback,a=`<div><dt>View restriction</dt><dd>${ae(r)}</dd></div>`+(i.seat.commercial?.note?`<div><dt>Organizer note</dt><dd>${ae(i.seat.commercial.note)}</dd></div>`:""),l=i.canReport?'<button type="button" data-report>Report this view</button><p data-report-status role="status" aria-live="polite"></p>':"";return`<div class="sl-view3d-passport-scrim" aria-hidden="true"></div><section class="sl-view3d-passport" role="dialog" aria-modal="true" aria-labelledby="sl-view3d-passport-title"><header><div><span>Seat confidence passport</span><strong id="sl-view3d-passport-title">${ae(i.title)}</strong></div><button type="button" data-close aria-label="Close seat confidence passport">\xD7</button></header><div class="sl-view3d-passport-summary"><strong>${ae(e.headline)}</strong><span>${ae(e.coverage)} \xB7 ${ae(e.freshness)}</span></div><dl><div><dt>Model status</dt><dd>${ae(e.model)}</dd></div><div><dt>Reality evidence</dt><dd>${ae(e.reality)}</dd></div><div><dt>Source</dt><dd>${ae(e.provenance)}</dd></div>`+a+o+s+`</dl>${n}<p class="sl-view3d-passport-note">This passport describes supplied evidence and known limits. It does not guarantee that every temporary obstruction or real-world condition is knowable before the event build.</p>`+l+"</section>"}function ha(i){return i?i.closest("[data-report]")?"report":i.closest("[data-close]")||i.classList.contains("sl-view3d-passport-scrim")?"close":null:null}function yn(i,e,t){let n=i?.querySelector("[data-report]"),o=i?.querySelector("[data-report-status]");n&&(n.disabled=e!=="failed",n.textContent=e==="received"?"Report received":"Report this view"),o&&(o.setAttribute("role",e==="failed"?"alert":"status"),o.textContent=e==="sending"?"Sending report\u2026":e==="received"?`Report received. Reference ${t??""}.`:"The report could not be sent. Please try again.")}function co(i,e,t=null){let n=i.view3dEl;if(!n)return;di(i,!1);let o=e.confidenceEvidence,s=i.controller.seatDetails(e.id),r=document.createElement("div");r.className="sl-view3d-passport-shell",r.innerHTML=pa({seat:e,title:s?.displayLabel??e.displayLabel??e.label,restrictionFallback:i.tf("picker.noAuthoredRestriction","No organizer-authored restriction"),canReport:typeof i.api.reportViewEvidence=="function"});let a=[...new Set([...n.children,...[...i.els.map.children].filter(u=>u!==n)])].filter(u=>u instanceof HTMLElement),l=a.map(u=>({element:u,inert:u.inert,ariaHidden:u.getAttribute("aria-hidden")}));for(let u of a)u.inert=!0,u.setAttribute("aria-hidden","true");n.appendChild(r),n.classList.add("has-passport"),i.view3dPassportEl=r;let c=r.querySelector(".sl-view3d-passport"),d=()=>[...c.querySelectorAll('button:not(:disabled),[href],[tabindex]:not([tabindex="-1"])')],p=u=>{if(u.key==="Escape"){u.preventDefault(),u.stopPropagation(),u.stopImmediatePropagation(),di(i);return}if(u.key!=="Tab")return;let h=d();if(!h.length)return;let y=h[0],f=h[h.length-1];u.shiftKey&&document.activeElement===y?(u.preventDefault(),f.focus()):!u.shiftKey&&document.activeElement===f&&(u.preventDefault(),y.focus())};window.addEventListener("keydown",p,!0),i.view3dPassportCleanup=()=>{window.removeEventListener("keydown",p,!0);for(let f of l)f.element.inert=f.inert,f.ariaHidden===null?f.element.removeAttribute("aria-hidden"):f.element.setAttribute("aria-hidden",f.ariaHidden);let u=t?.isConnected?t:i.confirmEl?.querySelector(".sl-confirm-confidence")??i.view3dCompareEl?.querySelector("[data-passport-seat]")??null,h=u?.closest(".sl-confirm,.sl-view3d-compare");h?.isConnected&&(h.inert=!1,h.removeAttribute("aria-hidden")),r.remove(),n.classList.remove("has-passport"),i.view3dPassportEl===r&&(i.view3dPassportEl=null);let y=u??i.view3dCompareEl?.querySelector("[data-passport-seat]")??i.confirmEl?.querySelector(".sl-confirm-confidence")??i.view3dCompareChip.mainButton();(t?.isConnected?t:y)?.focus()},r.addEventListener("click",u=>{let h=ha(u.target instanceof HTMLElement?u.target:null);h==="close"&&di(i),h==="report"&&sp(i,e)}),requestAnimationFrame(()=>d()[0]?.focus()),i.emit3dAnalytics("3d_confidence_passport_opened",{seatId:e.id,evidenceId:o?.evidenceId??null,eventConfigurationId:o?.eventConfigurationId??null,modelLevel:o?.modelLevel??"unverified",realityLevel:o?.realityLevel??"none"})}async function sp(i,e){if(i.api.reportViewEvidence){yn(i.view3dPassportEl,"sending");try{let t=await i.api.reportViewEvidence(i.opts.event,{seatId:e.id,evidenceId:e.confidenceEvidence?.evidenceId});i.emit3dAnalytics("3d_confidence_view_reported",{seatId:e.id,evidenceId:e.confidenceEvidence?.evidenceId??null}),yn(i.view3dPassportEl,"received",t.report.id)}catch{yn(i.view3dPassportEl,"failed")}}}function di(i,e=!0){let t=i.view3dPassportCleanup;if(i.view3dPassportCleanup=null,!t){i.view3dPassportEl?.remove(),i.view3dPassportEl=null,i.view3dEl?.classList.remove("has-passport");return}e||(document.activeElement instanceof HTMLElement?document.activeElement:null)?.blur(),t(),e||i.root?.focus({preventScroll:!0})}function ua(i){let e=i.view3dEl;if(!e||i.view3dCompareSeatIds.length<2)return;at(i,!1);let t=i.view3dCompareSeatIds.map(h=>i.view3dComparisonSnapshot(h)).filter(h=>!!h);if(t.length<2){i.clearView3dComparison();return}let n=h=>E(h),o=t.some(h=>!!h.price),s=document.createElement("div");s.className="sl-view3d-compare-shell";let r=t.map((h,y)=>`<article><span>Seat ${y===0?"A":"B"}</span><strong>${n(h.label)}</strong><small>Section ${n(h.section)} \xB7 Row ${n(h.row)}</small><dl>`+(o?`<div><dt>Current price</dt><dd>${n(h.price)}</dd></div>`:"")+`<div><dt>Ticket type</dt><dd>${n(h.category)}</dd></div><div><dt>Availability</dt><dd>${n(h.availability)}</dd></div><div><dt>View source</dt><dd>${n(h.viewSource)}</dd></div><div><dt>View restriction</dt><dd>${n(h.limited)}</dd></div><div><dt>Seat confidence</dt><dd>${n(h.confidence.headline)}</dd></div><div><dt>Reality check</dt><dd>${n(h.confidence.reality)}</dd></div><div><dt>Accessibility</dt><dd>${n(h.accessibility)}</dd></div></dl><div class="sl-view3d-compare-actions"><button type="button" data-passport-seat="${n(h.seat.id)}">Passport</button><button type="button" data-view-seat="${n(h.seat.id)}">View seat</button><button type="button" class="select" data-select-seat="${n(h.seat.id)}"${h.selectable?"":" disabled"}>Select seat</button></div></article>`).join("");s.innerHTML=`<div class="sl-view3d-compare-scrim" aria-hidden="true"></div><section class="sl-view3d-compare" role="dialog" aria-modal="true" aria-labelledby="sl-view3d-compare-title"><header><div><span>Seat inspection</span><strong id="sl-view3d-compare-title">Compare disclosed attributes</strong></div><button type="button" data-close aria-label="Close seat comparison">\xD7</button></header><p class="sl-view3d-compare-note">${o?"Current price and availability":"Availability"} comes from this picker. Modeled views are chart-derived unless organizer media is labeled.</p><div class="sl-view3d-compare-grid">${r}</div></section>`;let a=document.activeElement instanceof HTMLElement?document.activeElement:null,l=[...e.children].filter(h=>h instanceof HTMLElement),c=l.map(h=>({element:h,inert:h.inert,ariaHidden:h.getAttribute("aria-hidden")}));for(let h of l)h.inert=!0,h.setAttribute("aria-hidden","true");e.appendChild(s),e.classList.add("has-comparison"),i.view3dCompareEl=s;let d=s.querySelector(".sl-view3d-compare"),p=()=>[...d.querySelectorAll('button:not(:disabled),[href],[tabindex]:not([tabindex="-1"])')],u=h=>{if(h.key==="Escape"){h.preventDefault(),at(i);return}if(h.key!=="Tab")return;let y=p();if(!y.length)return;let f=y[0],T=y[y.length-1];h.shiftKey&&document.activeElement===f?(h.preventDefault(),T.focus()):!h.shiftKey&&document.activeElement===T&&(h.preventDefault(),f.focus())};window.addEventListener("keydown",u),i.view3dCompareCleanup=()=>{window.removeEventListener("keydown",u);for(let h of c)h.element.inert=h.inert,h.ariaHidden===null?h.element.removeAttribute("aria-hidden"):h.element.setAttribute("aria-hidden",h.ariaHidden);s.remove(),e.classList.remove("has-comparison"),i.view3dCompareEl===s&&(i.view3dCompareEl=null),a?.isConnected?a.focus():i.view3dCompareChip.mainButton()?.focus()},s.querySelector("[data-close]")?.addEventListener("click",()=>at(i)),s.querySelectorAll("[data-passport-seat]").forEach(h=>h.addEventListener("click",()=>{let y=h.dataset.passportSeat,f=y?i.allSeats().find(T=>T.id===y):void 0;f&&co(i,f,h)})),s.querySelectorAll("[data-view-seat]").forEach(h=>h.addEventListener("click",()=>{let y=h.dataset.viewSeat;at(i,!1),y&&i.view3dHandle?.flyToSeat(y)})),s.querySelectorAll("[data-select-seat]").forEach(h=>h.addEventListener("click",()=>{let y=h.dataset.selectSeat;y&&rp(i,y)})),requestAnimationFrame(()=>p()[0]?.focus()),i.emit3dAnalytics("3d_comparison_opened",{seatIds:i.view3dCompareSeatIds.slice()})}function at(i,e=!0){let t=i.view3dCompareCleanup;if(i.view3dCompareCleanup=null,!t){i.view3dCompareEl?.remove(),i.view3dCompareEl=null,i.view3dEl?.classList.remove("has-comparison");return}e||(document.activeElement instanceof HTMLElement?document.activeElement:null)?.blur(),t(),e||i.root?.focus({preventScroll:!0})}function rp(i,e){if(i.salesClosed){i.toast(i.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}let t=i.allSeats().find(o=>o.id===e);if(!t)return;if(at(i,!1),!i.controller.select([e]).length){i.syncSelectionTo3d(),i.toast(i.tf("picker.seatNoLongerAvailable","That seat is no longer available."),"warning");return}i.syncSelectionTo3d(),i.showConfirm(t),i.emit3dAnalytics("3d_comparison_selected",{seatId:e})}var ga=require("@seatlayer/core/view3d/crossfade/panorama");var po=require("@seatlayer/core");var ap=900,lp=450;function cp(i){switch(i){case"seat":return b("picker.stopYourSeat","Your seat");case"row":return b("picker.stopYourRow","Your row");case"section":return b("picker.stopYourSection","Your section");default:return b("picker.stopWholeVenue","Whole venue")}}function ma(i,e){let t=document.createElement("button");t.type="button",t.className="sl-view3d-recentre sl-mo-rotate-in",t.textContent="\u25CE";let n=b("picker.recentreOnStage","Recentre on the stage");t.setAttribute("aria-label",n),t.title=n,t.addEventListener("click",()=>{e.handle()?.recentreSeatView()});let o=document.createElement("div");o.className="sl-view3d-stop",o.setAttribute("role","status"),o.setAttribute("aria-live","polite"),i.append(t,o);let s=null,r=null;return{onStopChange(a){if(s&&(clearTimeout(s),s=null),r&&(clearTimeout(r),r=null),!a){o.classList.remove("is-shown"),o.textContent="",r=setTimeout(()=>{r=null,i.classList.remove("is-seat-view")},lp);return}i.classList.add("is-seat-view"),o.textContent=cp(a),o.classList.add("is-shown"),s=setTimeout(()=>{s=null,o.classList.remove("is-shown")},ap)},dispose(){s&&(clearTimeout(s),s=null),r&&(clearTimeout(r),r=null),t.remove(),o.remove(),i.classList.remove("is-seat-view")}}}var dp=44,pp=92;function fa(i,e,t,n={}){let o=i?.sectionLabel,s=Q(i),r=hp(i,e),a=[o,s?(0,po.t)("picker.rowLabel",{label:s}):null,r?(0,po.t)("picker.seatLabel",{label:r}):null].filter(Boolean).join(" \xB7 "),l=n.maxChars??(n.narrow?dp:pp);for(let c of[t,n.shortTail??t,null]){let d=[a,c].filter(Boolean).join(" \xB7 ");if(d.length<=l||c==null)return d}return a}function hp(i,e){if(i?.seatNumber)return i.seatNumber;let t=i?.displayLabel??e,n=o=>{!o||!t.startsWith(o)||t.length<=o.length||(t=t.slice(o.length).replace(/^[\s·\-\/_]+/,""))};return n(i?.sectionLabel),n(Q(i)),t}var ba=require("@seatlayer/core/core/seatConfidence");function ya(i){return i.buyerView}function va(i,e,t){if(e==="map"){i.exit3d();return}let n=t?.flyToSeatId;if(i.buyerView==="venue3d"){n?(i.opts.onBuyerViewChange?.({view:"venue3d",seatId:n}),i.view3dHandle?.flyToSeat(n)):t?.resetView&&i.view3dHandle?.focusOverview();return}i.enter3d(n)}function wa(i,e){switch(i.controller.getStatus(e.id)){case"held":return"held";case"booked":return"sold";case"not_for_sale":return"dimmed";default:break}return i.priceBandKeys!=null&&!i.priceBandKeys.has(e.categoryKey)||i.controller.accessibilityFilterDims?.(e)||i.limitedViewFilter&&(e.commercial?.restrictedView||e.commercial?.obstructedView)?"dimmed":"available"}function xa(i){if(!i.view3dHandle)return;let e=i.allSeats().map(t=>({seatId:t.id,state:i.seatState3dFor(t)}));i.view3dHandle.setAvailability(e)}function Sa(i){i.view3dHandle&&i.view3dHandle.setSelection(i.controller.getSelection().map(e=>e.id))}async function ka(i,e){let t=i.allSeats().find(n=>n.id===e);if(!t)return null;if(t.viewUrl)try{let n=t.viewMeta?.previewUrl,o=!!n&&n!==t.viewUrl,s=o?await i.buyerAssetUrls.resolve(n):null,r=o?t.viewUrl:await i.buyerAssetUrls.resolve(t.viewUrl);return!r||o&&!s?null:{url:r,...s?{previewUrl:s}:{},...o?{resolveUrl:a=>i.buyerAssetUrls.resolve(a)}:{},...t.viewMeta?.sourceWidth!==void 0?{sourceWidth:t.viewMeta.sourceWidth}:{},...t.viewMeta?.sourceHeight!==void 0?{sourceHeight:t.viewMeta.sourceHeight}:{},...t.viewMeta?.previewWidth!==void 0?{previewWidth:t.viewMeta.previewWidth}:{},...t.viewMeta?.previewHeight!==void 0?{previewHeight:t.viewMeta.previewHeight}:{},...t.viewMeta?.variants?.length?{variants:t.viewMeta.variants}:{},...t.viewMeta?.initialBearingDeg!==void 0?{initialBearingDeg:t.viewMeta.initialBearingDeg}:{},...t.viewMeta?.initialPitchDeg!==void 0?{initialPitchDeg:t.viewMeta.initialPitchDeg}:{},...t.viewMeta?.coverage?{coverage:t.viewMeta.coverage}:{},...t.viewMeta?.capturedAt?{capturedAt:t.viewMeta.capturedAt}:{},...t.viewMeta?.sourceLabel?{sourceLabel:t.viewMeta.sourceLabel}:{}}}catch(n){return i.opts.onError?.(n),null}return{url:"",generated:!0,mediaKind:"model",coverage:"exact-seat",sourceLabel:i.tf("picker.chartDerivedModel","Chart-derived model")}}function Ta(i,e){if(i.salesClosed){i.toast(i.tf("picker.salesClosedToast","Sales are closed for this event."),"warning"),i.syncSelectionTo3d();return}let t=i.allSeats().find(a=>a.id===e);if(!t)return;let n=i.controller.tableSelection(e);if(i.committedSelection().some(a=>n?a.label===n.label:a.id===e)){i.controller.deselect([e]),i.dismissConfirm(),i.syncSelectionTo3d();return}let s=i.controller.getStatus(t.id);if(s==="held"||s==="booked"||s==="not_for_sale"){i.syncSelectionTo3d();return}if(!i.controller.select([e]).length){i.syncSelectionTo3d(),i.dismissConfirm();return}if(i.opts.onBuyerViewChange?.({view:"venue3d",seatId:e}),i.flashPickedSeat(e),n){i.showTableDialog(n,!1),i.syncSelectionTo3d();return}i.opts.confirmSelection!==!1?i.showConfirm(t):i.syncTray(),i.syncSelectionTo3d()}function Ea(i,e){let t=i.allSeats().find(n=>n.id===e);return fa(i.controller.seatDetails(e),t?.displayLabel??t?.label??e,i.tf("picker.viewFromYourSeat","view from your seat"),{narrow:i.root?.dataset.layout==="narrow",shortTail:i.tf("picker.fromYourSeat","from your seat")})}function Ca(i,e){if(i.buyerView!=="venue3d")return;let t=i.view3dCompareSeatIds;t.includes(e.id)||(i.view3dCompareSeatIds=t.length===0?[e.id]:[t[0],e.id]),i.confirmSeat?.id===e.id&&(i.controller.deselect([e.id]),i.dismissConfirm(),i.syncSelectionTo3d(),i.syncTray()),i.view3dCompareChip.sync(),i.emit3dAnalytics("3d_comparison_saved",{seatId:e.id,count:i.view3dCompareSeatIds.length}),i.view3dCompareSeatIds.length>1?i.openView3dComparison():i.toast(i.tf("picker.chooseAnotherToCompare","Seat saved. Choose another seat to compare."),"success")}function Aa(i){i.closeView3dComparison(!1),i.view3dCompareSeatIds=[],i.view3dCompareChip.remove(),i.emit3dAnalytics("3d_comparison_cleared")}function Pa(i,e){let t=i.allSeats().find(y=>y.id===e);if(!t)return null;let n=i.controller.seatDetails(t.id),o=i.controller.doc?.categories.find(y=>y.key===t.categoryKey),s=n?.price??(o?.tiers?.length?o.tiers[0].price:o?.price),r=s!=null?i.paidPrice(t.categoryKey,n?.tierId??o?.tiers?.[0]?.id??null,s,t.label):void 0,a=i.controller.getStatus(t.id),l=a==="held"?i.tf("picker.temporarilyHeld","Temporarily held"):a==="booked"?i.tf("picker.sold","Sold"):a==="not_for_sale"?i.tf("picker.notForSale","Not for sale"):i.tf("picker.available","Available"),c=t.viewUrl?(0,ga.seatViewDisclosure)({url:t.viewUrl,...t.viewMeta?.coverage?{coverage:t.viewMeta.coverage}:{},...t.viewMeta?.capturedAt?{capturedAt:t.viewMeta.capturedAt}:{},...t.viewMeta?.sourceLabel?{sourceLabel:t.viewMeta.sourceLabel}:{}}):i.tf("picker.chartDerivedSeatEye","Live 3D \xB7 chart-derived seat-eye \xB7 not surveyed"),d=Mi(t.commercial).join(" \xB7 ")||i.tf("picker.noAuthoredRestriction","No organizer-authored restriction"),p=Qo({...t.accessibility?.length?{accessibility:t.accessibility}:{},...n?.wheelchairSpaceType?{wheelchairSpaceType:n.wheelchairSpaceType}:{}}),u=p.length?`${p.join(" \xB7 ")} \xB7 metadata, not access certification`:i.tf("picker.noAccessibilityMetadata","No accessibility metadata supplied"),h=(0,ba.seatConfidenceDisclosure)(t.confidenceEvidence);return{seat:t,label:n?.displayLabel??t.displayLabel??t.label,section:n?.sectionLabel??t.sectionId??"\u2014",row:Q(n)??n?.rowLabel??"\u2014",category:n?.categoryLabel??o?.label??t.categoryKey,price:i.suppressPricing||r==null?"":i.money(r),availability:l,selectable:a==null||a==="free",viewSource:c,limited:d,accessibility:u,confidence:h}}async function La(i,e){if(i.view3dEl||!i.canOffer3d()||!i.els.map)return;let t=i.controller.doc;if(!t)return;i.buyerView="venue3d",i.view3dTargetSeatId=null,i.opts.onBuyerViewChange?.({view:"venue3d",...e?{seatId:e}:{}}),i.root?.setAttribute("data-view3d","on"),i.dismissConfirm(),i.syncProjection(),i.syncTray();let n=document.createElement("div");n.className="sl-view3d sl-mo-zoom",n.setAttribute("role","group"),n.setAttribute("aria-label",i.tf("picker.interactive3dVenueView","Interactive 3D venue view"));let o=document.createElement("button");o.type="button",o.className="sl-view3d-back",o.innerHTML=`<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M15 18l-6-6 6-6"/></svg><span>${i.tf("picker.backToMap","Back to map")}</span>`;let s=o.querySelector("span"),r=c=>{i.view3dTargetSeatId=c;let d=!!c;n.classList.toggle("is-seat-focused",d),i.root&&(i.root.dataset.view3dSeat=d?"on":"off");let p=d?i.tf("picker.backToVenue","Back to venue"):i.tf("picker.backToMap","Back to map");s&&(s.textContent=p),o.setAttribute("aria-label",p)};if(o.addEventListener("click",()=>{if(i.view3dTargetSeatId&&i.view3dHandle){i.view3dHandle.focusOverview();return}i.exit3d()}),i.regions["top-left"]?.prepend(o),i.view3dBack=o,i.publish3dTopInset(),ea(i.root)){let c=document.createElement("button");c.type="button",c.className="sl-view3d-fs",c.textContent="\u26F6";let d=i.tf("picker.fullScreen","Full screen");c.setAttribute("aria-label",d),c.title=d,c.setAttribute("aria-pressed",String(!!document.fullscreenElement||i.fsFallback||i.framedFs)),c.addEventListener("click",()=>i.toggleFullscreen()),n.appendChild(c)}let a=document.createElement("div");a.className="sl-view3d-loading",a.setAttribute("role","status"),a.setAttribute("aria-live","polite"),a.textContent=i.tf("picker.loading3d","Building the 3D venue\u2026"),n.appendChild(a),i.els.map.appendChild(n),i.view3dEl=n,i.view3dCompareChip.sync(),requestAnimationFrame(()=>{n.style.opacity="1"});let l=++i.view3dGen;try{let c=i.allSeats(),[d,p]=await Promise.all([Qt(),i.controller.loadEventConfiguration()]),u=p?await Gi(p,v=>i.buyerAssetUrls.resolve(v)):null,h=t.theme?.venue3d?.shellAssetUrl,y=await Ui(h,v=>i.buyerAssetUrls.resolve(v));if(l!==i.view3dGen||i.buyerView!=="venue3d"||i.view3dEl!==n)return;let f={doc:t,seats:c,...u?{eventConfigurationId:u.id,eventConfiguration:u}:{},...y?{registeredShellGlb:y}:{}};a.textContent=i.tf("picker.building3d","Building venue geometry\u2026");let T=await d.prepareVenue3D(f);if(l!==i.view3dGen||i.buyerView!=="venue3d"||i.view3dEl!==n)return;let w=d.mountVenue3D(n,{...f,prepared:T},{portraitOverviewCrop:!0,arriveAtSeatEye:!0,lookAroundHint:et(),navLabels:Ti(),seatViewActionLabel:v=>i.allSeats().find(A=>A.id===v)?.viewUrl?i.tf("picker.openAuthored360","Open venue 360\xB0"):i.tf("picker.lookAroundLive3d","Look around in live 3D"),seatViewCaption:v=>i.seatViewCaption(v),onSeatViewStopChange:v=>i.view3dSeatViewChrome?.onStopChange(v),onSeatPick:v=>i.onView3dSeatPick(v),onSeatInspect:v=>i.onView3dSeatPick(v),onSectionFocusChange:v=>{let A=n.querySelector('select[data-locator="section"]'),D=v??"";!A||A.value===D||(A.value=D,A.dispatchEvent(new Event("change")))},onViewTargetChange:v=>{n.querySelector(".sl-view3d-nav")?.classList.toggle("is-seat-focused",!!v),r(v),i.opts.onBuyerViewChange?.({view:"venue3d",...v?{seatId:v}:{}})},...i.seatViewEnabled()?{getSeatView:v=>new Promise((A,D)=>{let K=()=>{i.seatViewFor3d(v).then(L=>{L?A(L):D(new Error("seat_view_unavailable"))})},g=globalThis.requestIdleCallback;typeof g=="function"?g(K,{timeout:1500}):setTimeout(K,50)})}:{},onAnalytics:(v,A)=>i.emit3dAnalytics(v,A)});i.view3dHandle=w,i.view3dSeatViewChrome=ma(n,{handle:()=>i.view3dHandle}),requestAnimationFrame(()=>a.remove()),i.pushAvailabilityTo3d(),i.syncSelectionTo3d(),i.view3dNav=Jr(i.regions["bottom-left"]??n,w),e&&w.flyToSeat(e)}catch(c){if(l!==i.view3dGen||i.buyerView!=="venue3d"||i.view3dEl!==n)return;i.opts.onError?.(c),i.toast(i.tf("picker.unavailable3d","3D could not start. The seat map is still available."),"warning"),i.exit3d()}}function Ma(i){let e=i.regions["top-left"];if(!i.root||!e)return;let t=()=>{!i.root||i.root.dataset.view3d!=="on"||i.root.style.setProperty("--sl-3d-top-inset",`${Math.max(44,Math.ceil(e.offsetHeight))}px`)};t(),typeof requestAnimationFrame=="function"&&requestAnimationFrame(t)}function Ha(i){if(i.buyerView!=="venue3d"&&!i.view3dEl)return;i.view3dGen++,i.buyerView="map",i.view3dTargetSeatId=null,i.opts.onBuyerViewChange?.({view:"map"}),i.root?.removeAttribute("data-view3d"),i.closeSeatConfidencePassport(!1),i.closeView3dComparison(!1),i.view3dCompareChip.remove(),i.view3dSeatViewChrome?.dispose(),i.view3dSeatViewChrome=null,i.view3dBack?.remove(),i.view3dBack=null,i.view3dNav?.remove(),i.view3dNav=null,i.root?.removeAttribute("data-view3d-seat"),i.root?.style.removeProperty("--sl-3d-top-inset");try{i.view3dHandle?.dispose()}catch{}i.view3dHandle=null;let e=i.view3dEl;i.view3dEl=null,e&&(e.style.opacity="0",setTimeout(()=>e.remove(),320)),i.syncProjection(),i.syncTray();let t=i.view3dReturnSeat;i.view3dReturnSeat=null,t&&i.committedSelection().some(n=>n.id===t.id)&&i.opts.confirmSelection!==!1&&i.showConfirm(t)}var Fa=require("@seatlayer/core");var pi=require("@seatlayer/core");function Ra(i){return Array.isArray(i)?i.reduce((e,t)=>t.type==="minimumSelectedPlaces"?Math.max(e,t.minimum):e,0):0}function vn(i,e,t=!1){let n=i.violations[0];return n==="numberOfPlacesToSelect"?i.remaining>0?(0,pi.t)("picker.selectExactMore",{count:i.remaining}):(0,pi.t)("picker.selectExactCount",{count:i.required}):n==="minimumSelectedPlaces"?(0,pi.t)("picker.selectMinimumMore",{count:i.remaining}):t?e("picker.adjustSeatSelection","Adjust seat selection"):n==="consecutiveSeats"?e("picker.selectSeatsTogether","Choose seats together in the same row and ticket category."):(0,pi.t)("picker.orphanHint")}var hi=require("@seatlayer/core");function Ia(i){let e=Math.max(0,i),t=Math.floor(e/6e4),n=String(Math.floor(e%6e4/1e3)).padStart(2,"0");return`${t}:${n}`}function Oa(i){let e=i.performanceLabel?`<div class="sl-chip-when">${B(i.performanceLabel)}</div>`:"",t=i.performanceDates?.labels.length?`<div class="sl-chip-dates"><span class="sl-chip-dates-summary">${B(i.performanceDates.summary)}</span><span class="sl-chip-date-list">${i.performanceDates.labels.map(n=>`<span class="sl-chip-date">${B(n)}</span>`).join("")}</span></div>`:"";return e+mp(i)+t}function mp(i){let{d:e,area:t,label:n,objectType:o,quantity:s=1,identity:r}=i,a=A=>String(A??"\u2014").replace(/[&<>"]/g,D=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[D]),l=o==="ga"?"ga":e?.objectType??o,c=r?.displayType?.trim()||e?.displayType?.trim()||t?.displayType?.trim()||(l==="table"?b("picker.table","Table"):l==="booth"?b("picker.booth","Booth"):l==="ga"?b("picker.generalAdmission","General admission"):b("picker.row","Row")),d=r?.rowLabel??r?.displayLabel??e?.rowLabel??e?.displayLabel??t?.label??n,p=i.categoryLabel?.trim()??"",u="",h=[];l==="table"&&r?.bookingMode?(u=`${c} ${d}`,h.push([b("picker.guests","Guests"),String(s)])):l==="ga"?(u=String(t?.displayLabel??d),s>1&&h.push([b("picker.tickets","Tickets"),String(s)])):l==="booth"?(u=e?.sectionLabel??`${c} ${d}`,e?.sectionLabel&&h.push([c,String(d)])):!e?.sectionLabel&&!e?.rowLabel&&!e?.seatNumber?u=String(d):(u=e.sectionLabel??"",e.rowLabel&&h.push([c,String(Q(e)??e.rowLabel)]),e.seatNumber&&h.push([b("picker.seat","Seat"),String(e.seatNumber)]));let y=!u&&!!p,f=u||p||String(d),T=!!p&&!y&&p!==f,w=h.map(([A,D])=>`<span class="sl-chip-seg" data-fit-seg><span class="w">${a(A)}</span> <b>${a(D)}</b></span>`);T&&w.push(`<span class="sl-chip-seg" data-fit-seg data-fit-type><span class="w">${a(p)}</span></span>`);let v=[f,...h.map(([A,D])=>`${A} ${D}`),T?p:""].filter(Boolean).join(" \xB7 ");return`<div class="sl-chip-id"><span class="sl-sr">${a(v)}</span><span class="sl-chip-name" aria-hidden="true">${a(f)}</span>`+(w.length?`<span class="sl-chip-pos" aria-hidden="true">${w.join("<i>\xB7</i>")}</span>`:"")+"</div>"}function fp(i){let e=B;return` data-key="${e(i.key)}"`+(i.heldLabels.length?` data-held="${e(encodeURIComponent(i.heldLabels.join(`
3246
+ `)))}"`:"")+(i.seatIds.length?` data-seat="${e(i.seatIds.join(" "))}"`:"")+(i.locateId?` data-locate="${e(i.locateId)}"`:"")}function _a(i){let e=B;return`<div class="sl-chip${i.held?" sl-held":""}${i.fresh?" sl-enter":""}"`+fp(i)+">"+(i.held?i.stateHtml:`<span class="sl-chip-dot" style="background:${E(i.categoryColor)}" aria-hidden="true"></span>`)+`<div class="sl-chip-main">${i.identityHtml}`+(i.extrasHtml?`<div class="sl-chip-sub">${i.extrasHtml}</div>`:"")+`${i.noteHtml}</div>`+(i.amountText?`<span class="amt">${e(i.amountText)}</span>`:"")+i.railHtml+"</div>"}function ho(i,e){let t=B(i),n=e?B(e):"";return'<div class="sl-chip-rail">'+(e?`<button type="button" class="view" data-view-label="${n}" aria-label="${B((0,hi.t)("picker.viewFromSeat",{label:e}))}"><svg viewBox="0 0 24 24"><path d="M1 12s4-7 11-7 11 7 11 7-4 7-11 7S1 12 1 12z"/><circle cx="12" cy="12" r="3"/></svg></button>`:"")+`<button type="button" class="rm" aria-label="${t}"><svg viewBox="0 0 24 24"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg></button></div>`}function Na(i){return i.confirming?`<div class="sl-ba" role="alert"><div class="sl-ba-title"><span class="spark" aria-hidden="true">\u2726</span>${b("picker.replaceCurrentChoices","Replace your current choices?")}</div><div class="sl-ba-replace"><b>${(0,hi.t)("picker.willFindSeatsTogether",{count:i.quantity})}</b><span>${b("picker.manualTicketsRemovedNote","Your manually selected tickets will be removed only after a new group is secured.")}</span></div><div class="sl-ba-actions"><button type="button" data-ba-cancel>${b("picker.keepMine","Keep mine")}</button><button type="button" class="replace" data-ba-replace>${b("picker.findNewSeats","Find new seats")}</button></div></div>`:`<div class="sl-ba"><div class="sl-ba-title"><span class="sl-ba-title-t">${b("picker.findSeatsTogether","Find seats together")}</span>`+kt({id:"sl-info-best-seats",label:b("picker.aboutBestSeats","About finding seats together"),text:b("picker.closestGroupChosenInstantly","Closest available group, chosen instantly.")})+(i.offerPremium?`<button type="button" class="sl-ba-premium${i.premium?" on":""}" data-ba-premium aria-pressed="${i.premium?"true":"false"}"><span class="star" aria-hidden="true">\u2605</span>${b("picker.bestSeatsPremium","Best seats")}</button>`:"")+`</div><div class="sl-ba-qty"><button type="button" data-ba="-1" aria-label="${b("picker.fewerSeats","Fewer seats")}">\u2212</button><span>${i.quantity}</span><button type="button" data-ba="1" aria-label="${b("picker.moreSeats","More seats")}">+</button></div>`+(i.categories.length>1?`<select class="sl-ba-cat" aria-label="${B(b("picker.preferredTicketType","Preferred ticket type"))}" data-ba-cat><option value="">${B(b("picker.anyTicketType","Any ticket type"))}</option>`+i.categories.map(e=>`<option value="${B(e.key)}"${i.selectedCategory===e.key?" selected":""}>${B(e.label)}</option>`).join("")+"</select>":'<span class="sl-ba-cat" aria-hidden="true"></span>')+(i.zones.length?`<select class="sl-ba-zone" aria-label="${b("picker.preferredVenueZone","Preferred venue zone")}" data-ba-zone><option value="">${b("picker.anyVenueZone","Any venue zone")}</option>`+i.zones.map(e=>`<option value="${B(e.id)}"${i.selectedZone===e.id?" selected":""}>${B(e.label)}</option>`).join("")+"</select>":"")+`<button type="button" class="sl-ba-go${i.busy?" sl-busy":""}"${i.busy?" disabled":""}>`+(i.busy?`<span class="sl-ba-spin" aria-hidden="true"></span>${b("picker.findingBestSeats","Finding the best seats\u2026")}`:(0,hi.tCount)("picker.findBestSeatsCount",i.quantity))+"</button>"+(i.reopened?`<button type="button" class="sl-ba-back" data-ba-close>${b("picker.keepMyPicks","Keep my picks")}</button>`:"")+"</div>"}function Da(i){if(i.salesClosed&&!i.hasPicks){let e=i.whenText?`<span class="when">${B(i.whenText)}</span>`:"";return`<div class="sl-closed-note" role="status"><b>${b("picker.salesClosedPill","Sales are closed")}</b><span>${b("picker.salesClosedCopy","Ticket sales for this event have ended.")}${e}</span></div>`}return""}function Ba(i){return i.hasGaAreas?i.seated?i.venue3d?b("picker.trayHintChoose3dOrStanding","Choose a seat in the 3D venue \u2014 or grab standing tickets below."):b("picker.trayHintTapOrStanding","Tap a seat on the map \u2014 or grab standing tickets below."):i.venue3d?b("picker.gaTrayHintChoose3dArea","Choose an area in the 3D venue to select tickets."):b("picker.gaTrayHintTapArea","Tap an area on the map to choose tickets."):i.groupMode==="per_performance"?b("picker.groupPerPerformanceTrayHint","Choose seats for this performance, then complete every date above."):i.groupMode?b("picker.groupTrayHint","Choose seats once \u2014 the same seats will be held for every performance."):i.venue3d?b("picker.trayHintChoose3dOrBest","Choose a seat in the 3D venue, or let us pick the best available for you."):b("picker.trayHintTapOrBest","Tap a seat on the map, or let us pick the best available for you.")}var uo=6e4,Va=5*6e4,gp=String(Math.round(Va/6e4));function za(i){let e=document.createElement("div");e.className="sl-extend",e.dataset.dock="map",e.setAttribute("role","status"),e.innerHTML='<button type="button" class="sl-extend-btn" data-ref="extendBtn"></button><button type="button" class="sl-extend-x" data-ref="extendDismiss" aria-label=""><svg viewBox="0 0 16 16" width="12" height="12" aria-hidden="true" focusable="false"><path d="M3.5 3.5 12.5 12.5M12.5 3.5 3.5 12.5" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg></button>',(i.regions["bottom-center"]??i.els.map).appendChild(e),i.extendEl=e,i.els.extendBtn=e.querySelector('[data-ref="extendBtn"]'),i.els.extendDismiss=e.querySelector('[data-ref="extendDismiss"]'),i.els.extendBtn.textContent=$a(i),i.els.extendDismiss.setAttribute("aria-label",i.tf("picker.close","Close")),i.els.extendBtn.addEventListener("click",()=>{i.handleExtend()}),i.els.extendDismiss.addEventListener("click",()=>{i.extendDismissed=!0,i.setExtendPrompt(!1,0)})}function $a(i){return i.tf("picker.addMinutes","+{count} min").replace("{count}",gp)}function ja(i){let e=i.hold?.items??[],t=new Set(e.map(o=>o.label));return i.committedSelection().filter(o=>!t.has(o.label)).reduce((o,s)=>o+(s.quantity??1),0)+je(i.gaQty,i.hold?.items??[])}function Ga(i){return(i.hold?.items??[]).reduce((e,t)=>e+(t.quantity??1),0)}function Ua(i){let e=new Set((i.hold?.items??[]).map(n=>n.label)),t=i.committedSelection().filter(n=>!e.has(n.label)).reduce((n,o)=>n+(o.quantity??1),0);return i.heldTicketCount()+t+je(i.gaQty,i.hold?.items??[])}function qa(i){let e=new Set((i.hold?.items??[]).map(o=>o.label)),t=i.committedSelection().filter(o=>e.has(o.label)).reduce((o,s)=>o+(s.quantity??1),0),n=Math.max(0,i.maxTickets-i.heldTicketCount()-je(i.gaQty,i.hold?.items??[]));i.controller.setMaxSelection(t+n)}function Ka(i,e=i.lastTrayCount,t=i.pendingSelectionCount()){let n=i.els.cta;if(!n)return;if(delete n.dataset.act,i.salesClosed){n.disabled=!0,n.textContent=i.tf("picker.salesClosedCta","Sales closed");return}if(i.ctaPhase==="holding"){n.disabled=!0,n.innerHTML=`<span class="sl-cta-spin" aria-hidden="true"></span>${i.tf("picker.securingSeats","Securing your seats\u2026")}`;return}if(i.ctaPhase==="checkout"){n.disabled=!0,n.innerHTML=`<span class="sl-cta-spin" aria-hidden="true"></span>${i.tf("picker.openingCheckout","Opening secure checkout\u2026")}`;return}let o=!i.hold&&i.performanceGroup?.selectionMode==="per_performance"?i.performanceGroup.submissionState?.():null;if(o&&!o.ready){n.disabled=!0,n.textContent=i.tf("picker.completeAllPerformances","Complete all performances ({complete}/{total})").replace("{complete}",String(o.complete)).replace("{total}",String(o.total));return}let s=i.controller.getSelectionValidity(e);if(s&&!s.isValid){n.disabled=!0,n.textContent=vn(s,(r,a)=>i.tf(r,a),!0);return}if(!e&&i.root?.dataset.layout==="narrow"&&!i.performanceGroup&&!i.hold){n.disabled=!1,n.dataset.act="find",n.textContent=i.tf("picker.findBestSeats","Find best seats");return}n.disabled=e===0,n.textContent=i.hold?t?(0,Fa.t)("picker.secureMoreAndCheckout",{count:t}):i.tf("picker.continueToCheckout","Continue to checkout"):e?i.performanceGroup?i.tf("picker.holdSeatsForAllPerformances","Hold seats for all {count} performances").replace("{count}",String(i.performanceGroup.performanceCount)):i.tf("picker.holdSeatsAndCheckout","Hold seats & checkout"):i.tf("picker.selectSeats","Select seats")}function Wa(i,e){i.ctaPhase=e,i.syncCta()}async function Ya(i,e,t){i.setCtaPhase("checkout");try{await i.checkoutHandoff(e,t)}finally{i.ctaPhase==="checkout"&&!i.bookedShown&&i.setCtaPhase("idle")}}function Xa(i){return`@seatlayer/hold/v1/${encodeURIComponent(i.apiBase)}/${encodeURIComponent(i.opts.event)}`}function Za(i){if(i.opts.initialHoldId)return i.opts.initialHoldId;if(i.opts.restoreHold===!1||typeof window>"u")return null;try{return window.sessionStorage.getItem(i.holdStorageKey())}catch{return null}}function Qa(i,e){if(!(i.opts.restoreHold===!1||typeof window>"u"))try{window.sessionStorage.setItem(i.holdStorageKey(),e.holdId)}catch{}}function Ja(i){if(!(typeof window>"u"))try{window.sessionStorage.removeItem(i.holdStorageKey())}catch{}}async function el(i,e,t=!1){try{let n=await i.controller.resumeHold(e);if(!n||i.destroyed)return null;let o={holdId:n.holdId,expiresAt:n.expiresAt,seats:n.seats,items:n.items};return i.hold=o,i.handedOff=!0,i.bookedShown=!1,i.ctaPhase="idle",i.startHoldTimer(o.expiresAt),i.rememberHold(o),i.syncTray(),i.emitHoldChange(),i.opts.onHoldRestored?.(o,o.seats??[],i.buildHandoff(o)),o}catch(n){let o=n?.status;if(o===404||o===409)i.forgetHold();else if(i.opts.onError?.(n),t)throw n;return null}}async function tl(i){let e=i.rememberedHoldId();e&&await i.resumeHoldFromServer(e,!0)}function il(i,e){i.stopHoldTimer(),i.holdExpiresAt=e,i.extendDismissed=!1,i.extendUsed=!1,i.hold&&i.rememberHold(i.hold);let t=i.els.hold;t.innerHTML=`<span class="sl-hold-dot" aria-hidden="true"></span><span>${i.tf("picker.held","Held")}</span><span class="sl-hold-time" data-ref="holdTime"></span>`;let n=t.querySelector('[data-ref="holdTime"]'),o=()=>{let s=Math.max(0,i.holdExpiresAt-Date.now());n&&(n.textContent=Ia(s)),t.classList.add("on"),t.classList.toggle("is-expiring",s>0&&s<=uo),i.setExtendPrompt(s>0&&s<=uo,s),(s<=0||!i.controller.currentHold())&&i.stopHoldTimer()};i.holdTimer=setInterval(o,500),o()}function nl(i){i.holdTimer&&clearInterval(i.holdTimer),i.holdTimer=null,i.els.hold?.classList.remove("on","is-expiring"),i.setExtendPrompt(!1,0)}function ol(i,e,t){if(!i.extendEl)return;let n=e&&t>0&&i.root?.dataset.layout!=="narrow"&&!i.extendDismissed&&!i.extendUsed&&!!i.controller.currentHold()&&!i.bookedShown;i.extendEl.classList.toggle("on",n)}function sl(i){if(!i.holdTimer)return;let e=Math.max(0,i.holdExpiresAt-Date.now());i.setExtendPrompt(e>0&&e<=uo,e)}async function rl(i){let e=i.els.extendBtn,t=i.controller.currentHold();if(!(!t||!i.api.extend||i.extendUsed)){e.disabled=!0,e.textContent=i.tf("picker.addingEllipsis","Adding\u2026");try{let n=await i.api.extend(i.controller.key,t.holdId,Va);if(i.controller.currentHold()?.holdId!==t.holdId)return;i.controller.setHold({holdId:t.holdId,labels:t.labels,expiresAt:n.expiresAt,items:t.items});let o=i.controller.currentHold();if(!o)return;i.hold={holdId:o.holdId,expiresAt:o.expiresAt,seats:o.seats,items:o.items},i.holdExpiresAt=o.expiresAt,i.extendUsed=!0,i.extendEl?.classList.remove("on"),i.rememberHold(i.hold),i.emitHoldChange(),i.toast(i.tf("picker.moreTimeAdded","More time added \u2014 your seats are still held."),"success")}catch(n){if(n?.reason==="extend_limit"){i.extendUsed=!0,i.setExtendPrompt(!1,0);return}i.opts.onError?.(n),i.toast(i.tf("picker.couldNotAddMoreTime","Couldn't add more time \u2014 please head to checkout now."),"warning")}finally{e.disabled=!1,e.textContent=$a(i)}}}var fo=require("@seatlayer/core");function al(i){return i?.previousPrice!=null&&i.previousPrice>i.price?i.previousPrice:null}function ll(i){return yp(i)+(i.moreLabel?`<button type="button" class="sl-price-more" aria-expanded="${!i.collapsed}">${i.esc(i.moreLabel)}</button>`:"")+vp(i.status)}function yp(i){let{esc:e,money:t}=i;return i.categories.map(n=>{let o=i.priceOf(n),s=i.rangeOf(n),r=i.offerOf(n.key),a=al(r),l=i.activeKey===n.key;return`<div class="sl-price-row${i.bandKeys!=null&&!i.bandKeys.has(n.key)?" sl-dim":""}${l?" sl-active":""}" data-cat="${e(n.key)}" role="button" tabindex="0" aria-pressed="${l}" title="${e(i.titleFor(n,l))}"><span class="sl-dot" style="--sl-cat-dot:${e(i.colorOf(n))}"></span><span class="sl-price-label">${e(n.label)}`+(r?.offerName?`<small class="sl-price-offer">${e(r.offerName)}</small>`:"")+"</span>"+(a!=null?`<span class="sl-price-was">${e(t(a))}</span>`:"")+(s!=null?`<span class="sl-price-amt">${s.min===s.max?e(t(s.min)):`${e(t(s.min))}\u2013${e(t(s.max))}`}</span>`:o!=null?`<span class="sl-price-amt">${e(t(o))}</span>`:"")+"</div>"}).join("")}function vp(i){let e=t=>t.replace(/[&<>"']/g,n=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[n]);return`<div class="sl-status-key" aria-label="${e(i.legend)}"><span class="sl-status-item"><i class="sl-status-icon unavailable" aria-hidden="true"></i>${e(i.unavailable)}</span></div>`}function mo(i){let e=Math.abs(i.scrollLeft),t=e>2,n=e+i.clientWidth<i.scrollWidth-2;return i.dataset.fadeStart=String(t),i.dataset.fadeEnd=String(n),{start:t,end:n}}function cl(i){let{esc:e,money:t}=i;return`<button type="button" class="sl-rc sl-rc-all" data-rail-all aria-pressed="${i.allActive}" title="${e(i.allWord)}"><span class="sl-rc-t">${e(i.allWord)}</span></button>`+i.categories.map(o=>{let s=i.rangeOf(o),r=i.priceOf(o),a=s?s.min===s.max?t(s.min):`${t(s.min)}+`:r!=null?t(r):null,l=Object.prototype.hasOwnProperty.call(i.left,o.key)&&i.left[o.key]<=0,c=al(i.offerOf(o.key)),d=a?`${o.label} \u2014 ${a}${l?` (${i.soldOutWord})`:""}`:o.label;return`<button type="button" class="sl-rc" data-cat="${e(o.key)}" aria-pressed="${i.activeKey===o.key}" aria-label="${e(d)}" title="${e(d)}"${l?" disabled":""}><i class="sl-rc-dot" style="--sl-cat-dot:${e(i.colorOf(o))}"></i>`+(c!=null?`<span class="sl-rc-was">${e(t(c))}</span>`:"")+`<span class="sl-rc-t">${e(a??o.label)}</span></button>`}).join("")}function dl(i,e){let t=i.map(a=>({key:a.key,range:e.rangeOf(a)})).filter(a=>a.range!=null);if(!t.length)return[];let n=[...new Map(t.map(a=>[`${a.range.min}:${a.range.max}`,a.range])).values()].sort((a,l)=>a.min-l.min||a.max-l.max);if(n.length<=5)return n.map(a=>({id:`p${a.min}-${a.max}`,label:a.min===a.max?e.money(a.min):`${e.money(a.min)}\u2013${e.money(a.max)}`,keys:t.filter(l=>l.range.min===a.min&&l.range.max===a.max).map(l=>l.key),min:a.min,max:a.max}));let o=[...t].sort((a,l)=>a.range.min-l.range.min||a.range.max-l.range.max),s=Math.ceil(o.length/4),r=[];for(let a=0;a<o.length;a+=s){let l=o.slice(a,a+s),c=Math.min(...l.map(p=>p.range.min)),d=Math.max(...l.map(p=>p.range.max));r.push({id:`b${a}`,label:c===d?e.money(c):`${e.money(c)}\u2013${e.money(d)}`,keys:l.map(p=>p.key),min:c,max:d})}return r}function pl(i){if(i.suppressPricing||!i.els.prices||!i.els.pricesSec)return;let e=dl(i.controller.doc?.categories??[],i.legendDeps());if(e.length<2)return;let t=document.createElement("select");t.className="sl-price-select",t.setAttribute("aria-label",i.tf("picker.filterAndFocusByPrice","Filter and focus seats by price"));let n=document.createElement("option");n.value="all",n.textContent=i.tf("picker.allPrices","All prices"),t.appendChild(n);for(let o of e){let s=document.createElement("option");s.value=o.id,s.textContent=o.label,t.appendChild(s)}i.els.pricesSec.appendChild(t),i.priceSelect=t,t.addEventListener("change",()=>{i.applyPriceBand(e.find(o=>o.id===t.value)?.keys??null)})}function hl(i,e){if(i.focusedCatKey=null,i.priceBandKeys=e?new Set(e):null,i.priceSelect){let t=e?i.priceSelect.value:"all";i.priceSelect.value!==t&&(i.priceSelect.value=t)}i.controller.setCategoryFilter(e),i.controller.focusCategoryFilter(e),i.pushAvailabilityTo3d(),i.syncFloors(),i.syncRung(),i.minimap?.refreshMinimap(),i.syncPrices(),i.lastSection&&i.showSectionCard(i.lastSection)}function ul(i){return{colorOf:e=>i.controller.getRenderer()?.categoryDisplayColor?.(e.key)??e.color,rangeOf:e=>i.catPriceRange(e),priceOf:e=>i.catPrice(e),offerOf:e=>i.offerPrice(e),money:e=>i.money(e),esc:B}}function ml(i,e,t,n=i.legendDeps()){let o=i.els.railScroll,s=e.length>1;if(i.els.rail?.classList.toggle("has",s),!o)return;o.innerHTML=s?cl({...n,categories:e,left:t,activeKey:i.focusedCatKey,soldOutWord:i.tf("picker.soldOut","Sold out"),allWord:i.tf("picker.allPrices","All prices"),allActive:!i.focusedCatKey&&!i.priceBandKeys}):"";let r=e.map(a=>a.key).join("|");i.lastRailSignature!==r&&(i.lastRailSignature=r,o.scrollLeft=0),o.querySelectorAll(".sl-rc").forEach(a=>{a.addEventListener("click",()=>{if(a.hasAttribute("data-rail-all")){i.applyPriceBand(null);return}i.focusCategory(a.dataset.cat??"")})}),i.railEdgesBound||(i.railEdgesBound=!0,o.addEventListener("scroll",()=>mo(o),{passive:!0})),requestAnimationFrame(()=>mo(o))}function fl(i){let e=i.controller.doc;if(!e||!i.els.prices)return;let t=i.controller.categoryAvailability(),n=e.categories.filter(p=>!p.notForSale);i.syncSoldout(n,t);let o=i.legendDeps(),s=i.suppressPricing,r=s?{...o,priceOf:()=>{},rangeOf:()=>{},offerOf:()=>null}:o;s&&(i.els.pricesSec?.querySelector("span")?.replaceChildren(i.tf("picker.seatCategories","Seat categories")),i.els.pricesInfo?.remove()),i.syncPriceRail(n,t,r);let a=5,l=n.length-a,c=l>1&&!i.pricesExpanded,d=c?n.slice(0,a):n;i.els.prices.classList.toggle("sl-expanded",l>1&&i.pricesExpanded),i.els.prices.innerHTML=ll({...r,categories:d,left:t,collapsed:c,activeKey:i.focusedCatKey,bandKeys:i.priceBandKeys,titleFor:(p,u)=>u?i.tf("picker.showAllSeats","Show all seats"):(0,fo.t)("picker.showLabelSeatsOnMap",{label:p.label}),moreLabel:l>1?c?s?i.tf("picker.showAllCategories","Show all categories"):(0,fo.t)("picker.showAllTicketTypes",{count:n.length}):i.tf("picker.showFewer","Show fewer"):null,status:{legend:i.tf("picker.seatStatusLegend","Seat status legend"),unavailable:i.tf("picker.notAvailable","Not available")}}),i.els.prices.querySelectorAll(".sl-price-row").forEach(p=>{p.addEventListener("mouseenter",()=>i.controller.getRenderer()?.setCategoryHighlight?.(p.dataset.cat??null)),p.addEventListener("mouseleave",()=>i.controller.getRenderer()?.setCategoryHighlight?.(null));let u=()=>i.focusCategory(p.dataset.cat??"");p.addEventListener("click",u),p.addEventListener("keydown",h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),u())})}),i.els.prices.querySelector(".sl-price-more")?.addEventListener("click",()=>{i.pricesExpanded=!i.pricesExpanded,i.syncPrices()})}function gl(i,e){if(!e)return;let t=i.focusedCatKey===e?null:e;i.focusedCatKey=t,i.priceBandKeys=t?new Set([t]):null;let n=i.els.pricesSec?.querySelector(".sl-price-select");n&&(n.value="all"),i.controller.setCategoryFilter(t?[t]:null),i.controller.focusCategoryFilter(t?[t]:null),i.pushAvailabilityTo3d(),i.syncFloors(),i.syncRung(),i.minimap?.refreshMinimap(),i.syncPrices(),i.lastSection&&i.showSectionCard(i.lastSection)}var Bt=require("@seatlayer/core");function ve(i,e,t){let n=(0,Bt.t)(i,t);return n&&n!==i?n:t?e.replace(/\{(\w+)\}/g,(o,s)=>s in t?String(t[s]):o):e}function xp(i){let e=(0,Bt.tCount)("picker.seatCount",i);return e.includes("picker.seatCount")?`${i} ${i===1?"seat":"seats"}`:e}function Sp(i){try{let e=Intl.ListFormat;if(e)return new e(void 0,{style:"long",type:"conjunction"}).format(i)}catch{}return i.join(", ")}function kp(i){if(i.length<2)return!1;let e=[...i].sort((t,n)=>t-n);return new Set(e).size!==e.length?!1:e[e.length-1]-e[0]===e.length-1}function Tp(i){let e=i.filter(o=>o.objectType==="ga"),t=i.filter(o=>o.objectType!=="ga"),n=[];if(t.length){let o=xp(t.length),s=[...new Set(t.map(l=>l.sectionLabel).filter(Boolean))],r=[...new Set(t.map(l=>l.rowLabel).filter(Boolean))],a=t.map(l=>Number(l.seatNumber)).filter(l=>Number.isFinite(l));if(s.length===1&&r.length===1&&a.length===t.length){let l=t.length===1?ve("picker.releasedSeatPlace","Section {section}, Row {row}, Seat {seat}",{section:s[0],row:r[0],seat:String(t[0].seatNumber??"")}):kp(a)?ve("picker.releasedSeatRange","Section {section}, Row {row}, Seats {from}\u2013{to}",{section:s[0],row:r[0],from:Math.min(...a),to:Math.max(...a)}):"";n.push(l?ve("picker.releasedPair","{first} \xB7 {second}",{first:o,second:l}):ve("picker.releasedInSection","{seats} in Section {section}",{seats:o,section:s[0]}))}else s.length===1?n.push(ve("picker.releasedInSection","{seats} in Section {section}",{seats:o,section:s[0]})):s.length>1?n.push(ve("picker.releasedInSections","{seats} in Sections {sections}",{seats:o,sections:Sp(s)})):n.push(o)}for(let o of e)n.push(ve("picker.releasedGa","{quantity} \xD7 {area}",{quantity:o.quantity??1,area:o.label}));return n.length?n.reduce((o,s)=>ve("picker.releasedPair","{first} \xB7 {second}",{first:o,second:s})):""}function bl(i){if(!i)return[];let e=new Map((i.seats??[]).map(o=>[o.label,o])),t=i.items??[];return(t.length?t.map(o=>({label:o.label,objectType:o.objectType,quantity:o.quantity})):[...e.keys()].map(o=>({label:o}))).map(o=>{let s=e.get(o.label);return{label:o.label,...o.objectType?{objectType:o.objectType}:{},...o.quantity==null?{}:{quantity:o.quantity},...s?.sectionLabel?{sectionLabel:s.sectionLabel}:{},...s?.rowLabel?{rowLabel:Q(s)??s.rowLabel}:{},...s?.seatNumber?{seatNumber:s.seatNumber}:{}}})}function yl(i,e){if(!i.reducedMotion)for(let t of e.slice(0,10)){if(t.objectType==="ga")continue;let n=i.seatByLabel(t.label);!n||i.statusOf(n.id)!=="free"||i.flash(n.id,i.accent)}}function vl(i,e){if(!e.recoverable.length||!i.isConnected)return;let t=i.querySelector(".sl-hold-expired-next");t&&(e.taken.length?t.textContent=e.taken.slice(0,3).map(r=>(0,Bt.t)("picker.seatJustTakenByAnother",{label:r})).join(" "):t.remove());let n=i.querySelector(".sl-interrupt-actions"),o=n?.querySelector(".sl-interrupt-act");if(!n||!o)return;o.classList.add("sl-interrupt-act-secondary");let s=document.createElement("button");s.type="button",s.className="sl-interrupt-act sl-hold-expired-recover",s.textContent=(0,Bt.tCount)("picker.holdLapsedSelectAgain",e.recoverable.length),s.addEventListener("click",()=>e.onRecover([...e.recoverable])),n.insertBefore(s,o),i.classList.add("has-recovery"),s.focus()}function wl(i,e=[]){let t=document.createElement("div");t.className="sl-interrupt sl-hold-expired sl-mo-scrim",t.setAttribute("role","alertdialog"),t.setAttribute("aria-modal","true");let n=document.createElement("div");n.className="sl-interrupt-card sl-mo-in";let o=document.createElement("div");o.className="sl-interrupt-title",o.id="sl-hold-expired-title";let s=document.createElement("span");s.className="sl-interrupt-glyph",s.setAttribute("aria-hidden","true"),s.textContent="\u23F1";let r=document.createElement("span");r.textContent=ve("picker.holdExpiredTitle","Your seats were released"),o.append(s,r);let a=document.createElement("div");a.className="sl-interrupt-body",a.id="sl-hold-expired-body",a.textContent=ve("picker.holdExpiredBody","Your hold time ran out and the seats went back on sale."),n.append(o,a);let l=Tp(e);if(l){let u=document.createElement("div");u.className="sl-interrupt-body sl-interrupt-fact sl-hold-expired-seats",u.textContent=l,n.appendChild(u)}let c=document.createElement("div");c.className="sl-interrupt-body sl-hold-expired-next",c.textContent=ve("picker.holdExpiredPickAgain","Pick your seats again to continue \u2014 they may already be taken."),n.appendChild(c),t.setAttribute("aria-labelledby",o.id),t.setAttribute("aria-describedby",a.id);let d=document.createElement("div");d.className="sl-interrupt-actions";let p=document.createElement("button");return p.type="button",p.className="sl-interrupt-act sl-hold-expired-restart",p.textContent=ve("picker.holdExpiredRestart","Choose seats again"),p.addEventListener("click",()=>i.restart()),d.appendChild(p),n.appendChild(d),t.appendChild(n),t.addEventListener("pointerdown",u=>{u.target===t&&i.restart()}),t}var _e=require("@seatlayer/core");var xl={wheelchair:"Wheelchair space",companion:"Companion seat","semi-ambulatory":"Limited mobility","designated-aisle":"Aisle / transfer","step-free":"Step-free",hearing:"Assistive listening",cart:"Live captions","sign-language":"Sign language","low-vision":"Low vision","sensory-friendly":"Sensory-friendly","plus-size":"Plus-size","lift-armrest":"Lift-up armrest"},Ep='<svg viewBox="0 0 20 20" width="17" height="17" fill="none" stroke="currentColor" stroke-width="1.45" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><circle cx="10" cy="10" r="7.5" /><path d="M10 2.5a7.5 7.5 0 0 1 0 15Z" fill="currentColor" stroke="none" /></svg>',Cp='<svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="13" cy="4.4" r="1.9"/><path d="M11 8.2v5.1h5.1"/><path d="M16.6 13.3l1.9 6.3"/><path d="M15.4 14.9a5.6 5.6 0 1 1-5.9-3.4"/></svg>',Ap=8,Pp=8,Lp=88;function Mp(i){let e=i.gap??Ap,t=i.margin??Pp,n=i.min??Lp,o=Math.max(i.boundsTop,0);return Math.max(Math.round(i.buttonTop-o-e-t),n)}var wn=class{constructor(e,t){this.active=new Set;this.deps=t,this.root=document.createElement("div"),this.root.className="sl-a11y",this.button=document.createElement("button"),this.button.type="button",this.button.className="sl-a11ybtn",this.button.setAttribute("aria-haspopup","true"),this.button.setAttribute("aria-expanded","false");let o=this.offered().length>0?t.tf("picker.accessibilityOptions","Accessibility and colour options"):t.tf("picker.displayOptions","Display options");this.button.setAttribute("aria-label",o),this.button.innerHTML=Cp,this.menu=document.createElement("div"),this.menu.className="sl-a11ymenu",this.menu.hidden=!0;for(let s of this.stored())this.offeredFree().has(s)&&this.active.add(s);if(this.menu.innerHTML=ds(o,t.tf("picker.close","Close"))+ps(this.rows()),this.root.append(this.menu,this.button),e.prepend(this.root),this.button.addEventListener("pointerdown",s=>s.stopPropagation()),this.button.addEventListener("click",s=>{s.stopPropagation(),this.open(this.menu.hidden)}),this.menu.querySelector("[data-a11y-close]")?.addEventListener("click",s=>{s.stopPropagation(),this.open(!1),this.button.focus({preventScroll:!0})}),this.menu.addEventListener("pointerdown",s=>s.stopPropagation()),this.menu.addEventListener("click",s=>s.stopPropagation()),this.menu.addEventListener("focusin",s=>{let r=s.target;r&&typeof r.scrollIntoView=="function"&&r.scrollIntoView({block:"nearest"})}),this.dismiss=()=>this.open(!1),this.escape=s=>{s.key==="Escape"&&this.open(!1)},this.reflow=()=>{this.menu.hidden||this.fit()},document.addEventListener("pointerdown",this.dismiss),document.addEventListener("keydown",this.escape),window.addEventListener("resize",this.reflow),this.promoteCounts(),this.wire(),this.active.size){this.applyFilter({focus:!1});let s=()=>this.deps.focusSeatsForFilter();typeof requestAnimationFrame=="function"?requestAnimationFrame(s):s()}}colorblindRow(){return this.menu.querySelector(".sl-cbbtn")}syncCounts(){let e=new Map(this.offered().map(({key:n,count:o})=>[n,o])),t=!1;for(let n of this.menu.querySelectorAll("[data-a11y-row]")){let o=n.dataset.a11yRow??"";if(!o.startsWith("a11y:"))continue;let s=o.slice(5),r=e.get(s);if(r===void 0)continue;let a=this.countNode(n),l=r==null?"":this.countText(r);a&&(a.textContent=l);let c=r===0;a instanceof HTMLButtonElement&&(a.disabled=c,a.setAttribute("aria-label",this.jumpLabel(s,l))),n.disabled=c,c?n.setAttribute("aria-disabled","true"):n.removeAttribute("aria-disabled"),c&&this.active.delete(s)&&(this.paint(n,!1),t=!0)}t&&this.applyFilter()}syncAccessibilityFilter(e){this.active.clear();for(let t of e??[])this.active.add(t);this.remember(e&&e.length?e:null);for(let t of this.menu.querySelectorAll("[data-a11y-row]")){let n=t.dataset.a11yRow??"";n.startsWith("a11y:")&&this.paint(t,this.active.has(n.slice(5)))}}refit(){this.menu.hidden||this.fit()}destroy(){document.removeEventListener("pointerdown",this.dismiss),document.removeEventListener("keydown",this.escape),window.removeEventListener("resize",this.reflow),this.root.remove()}fit(){this.menu.style.setProperty("--sl-a11ymenu-max",`${Mp({boundsTop:this.boundsTop(),buttonTop:this.button.getBoundingClientRect().top})}px`)}boundsTop(){let e=this.root.closest(".sl-map")??this.root.closest(".sl-picker");return e instanceof HTMLElement?e.getBoundingClientRect().top:0}open(e){if(e===!this.menu.hidden)return;if(this.button.setAttribute("aria-expanded",String(e)),!e){this.menu.hidden=!0,this.menu.classList.remove("sl-mo-in","sl-mo-stagger");return}this.menu.hidden=!1,this.fit(),this.menu.scrollTop=0;let t=this.button.getBoundingClientRect();Vn(this.menu,{x:t.left+t.width/2,y:t.top}),Es(this.menu),Ts(this.menu)}rows(){return[...this.filterRows(),...this.deps.hasLimitedView?[{key:"limited",iconHtml:(0,_e.seatTypeIconSvg)("restrictedView",{size:17}),label:this.deps.tf("picker.hideLimitedView","Hide limited-view seats"),on:this.deps.isLimitedViewHidden()}]:[],{key:"colorblind",iconHtml:Ep,className:"sl-cbbtn",label:this.deps.tf("picker.colorblindColors","Colourblind-friendly colours"),on:this.deps.isColorblindSafe()}]}offered(){let e=this.deps.needs?.();if(e)return e.map(({key:n,count:o})=>({key:n,count:o}));let t=this.deps.present;return t?_e.ACCESSIBILITY_TYPES.filter(({key:n})=>t.has(n)).map(({key:n})=>({key:n,count:null})):[]}offeredKeys(){return new Set(this.offered().map(({key:e})=>e))}offeredFree(){return new Set(this.offered().filter(({count:e})=>e!==0).map(({key:e})=>e))}filterRows(){let e=this.offeredKeys(),t=new Map(_e.ACCESSIBILITY_TYPES.map(n=>[n.key,n]));return this.offered().flatMap(({key:n,count:o})=>{let s=t.get(n);return s?[{key:`a11y:${n}`,iconHtml:(0,_e.seatTypeIconSvg)(n,{size:17}),label:this.deps.tf(`picker.accessShort.${n}`,xl[n]??s.label),...n==="wheelchair"&&e.has("companion")?{note:this.deps.tf("picker.companionSeatsNote","Companion places beside them stay selectable")}:{},...o==null?{}:{count:this.countText(o),disabled:o===0},on:this.active.has(n)}]:[]})}wire(){for(let e of this.menu.querySelectorAll("[data-sl-info]"))e.addEventListener("click",()=>{let t=e.closest(".sl-info"),n=!t?.classList.contains("open");for(let o of this.menu.querySelectorAll(".sl-info.open"))o.classList.remove("open"),o.querySelector("[data-sl-info]")?.setAttribute("aria-expanded","false");t?.classList.toggle("open",n),e.setAttribute("aria-expanded",String(n))});for(let e of this.menu.querySelectorAll("[data-a11y-row]"))e.addEventListener("click",()=>{let t=e.dataset.a11yRow??"";if(t==="colorblind"){let s=!this.deps.isColorblindSafe();this.deps.setColorblindSafe(s),this.paint(e,s);return}if(t==="limited"){let s=!this.deps.isLimitedViewHidden();this.deps.setLimitedViewHidden(s),s&&this.deps.focusSeatsForFilter(),this.paint(e,s);return}let n=t.slice(5),o=!this.active.has(n);o?this.active.add(n):this.active.delete(n),this.paint(e,o),this.applyFilter()})}promoteCounts(){if(this.deps.stepToAccessibleSection)for(let e of this.menu.querySelectorAll('[data-a11y-row^="a11y:"]')){let t=e.querySelector(".sl-a11yrow-c");if(!t)continue;let n=(e.dataset.a11yRow??"").slice(5),o=e.parentElement;o?.classList.contains("sl-a11yrow-w")||(o=document.createElement("div"),o.className="sl-a11yrow-w",e.replaceWith(o),o.appendChild(e));let s=document.createElement("button");s.type="button",s.className="sl-a11yrow-c sl-a11yjump",s.dataset.a11yJump=n,s.textContent=t.textContent,s.disabled=e.disabled,s.setAttribute("aria-label",this.jumpLabel(n,t.textContent??"")),t.remove(),e.setAttribute("aria-label",this.rowLabel(n,s.textContent??""));let r=o.querySelector(".sl-info");r?r.after(s):e.after(s),o.dataset.a11yTapThrough||(o.dataset.a11yTapThrough="true",o.addEventListener("click",a=>{a.target===o&&!e.disabled&&e.click()})),s.addEventListener("click",a=>{a.stopPropagation(),this.active.has(n)||(this.active.add(n),this.paint(e,!0),this.applyFilter({focus:!1}));let l=this.deps.stepToAccessibleSection?.(n);l&&s.setAttribute("aria-label",this.jumpLabel(n,s.textContent??"",l.label))})}}countText(e){return e>0?(0,_e.t)("picker.accessFreeCount",{count:e}):"0"}countNode(e){return e.querySelector(".sl-a11yrow-c")??e.parentElement?.querySelector(".sl-a11yrow-c")??null}typeLabel(e){let t=xl[e]??_e.ACCESSIBILITY_TYPES.find(n=>n.key===e)?.label??e;return this.deps.tf(`picker.accessShort.${e}`,t)}jumpLabel(e,t,n){return[this.deps.tf("picker.jumpToSection","Jump to section"),this.typeLabel(e),t,...n?[`${this.deps.tf("picker.section","Section")} ${n}`]:[]].filter(Boolean).join(" \xB7 ")}rowLabel(e,t){return[this.typeLabel(e),t].filter(Boolean).join(" \xB7 ")}paint(e,t){e.classList.toggle("on",t),e.setAttribute("aria-checked",String(t)),e.setAttribute("aria-pressed",String(t))}applyFilter(e={}){let t=this.active.size?[...this.active]:null;this.deps.applyAccessibilityFilter(t),this.remember(t),t&&e.focus!==!1&&this.deps.focusSeatsForFilter()}key(){let e=this.deps.chart?.();return`seatmap.a11y.filter.${this.deps.event}${e?`.${e}`:""}`}stored(){try{let e=window.sessionStorage.getItem(this.key()),t=e?JSON.parse(e):null;return Array.isArray(t)?t:[]}catch{return[]}}remember(e){try{e&&e.length?window.sessionStorage.setItem(this.key(),JSON.stringify(e)):window.sessionStorage.removeItem(this.key())}catch{}}};var Sl=require("@seatlayer/core"),Hp=250;function kl(i,e=Hp){let t=null,n=()=>{t===null&&(t=setTimeout(()=>{t=null,i()},e))},o=(0,Sl.attachVisibilityCatchUp)(n),s=typeof window<"u"&&typeof window.addEventListener=="function";return s&&window.addEventListener("focus",n),()=>{t!==null&&(clearTimeout(t),t=null),o(),s&&window.removeEventListener("focus",n)}}var lt=require("@seatlayer/core");var xn=class{constructor(e){this.note=null;this.told=!1;this.deps=e}deferExpiryToast(e){this.told=!1,queueMicrotask(()=>{this.told||e()})}handle(e){if(!e.holdLapsed)return;this.told=!0;let t=(0,lt.holdRecoveryShape)(e),n=e.lapsedLabels.length,o=n-e.recoverable.length,s=t==="all"?(0,lt.tCount)("picker.holdLapsedStillFree",n):t==="partial"?(0,lt.tCount)("picker.holdLapsedSomeTaken",o):(0,lt.tCount)("picker.holdLapsedAllTaken",n);this.note={message:s,recoverable:t==="none"?[]:[...e.recoverable]},this.deps.toast(s,t==="none"?"error":"warning",t==="none"?void 0:{label:this.actionLabel(),onClick:()=>this.recover()}),this.deps.syncTray()}noteHtml(){if(!this.note)return"";let e=this.note.recoverable.length?`<button type="button" data-lapse-again>${B(this.actionLabel())}</button>`:"";return`<div class="sl-lapse-note" role="status"><span>${B(this.note.message)}</span>${e}</div>`}wire(e){e?.querySelector("[data-lapse-again]")?.addEventListener("click",()=>this.recover())}clear(){this.note&&(this.note=null,this.deps.syncTray())}actionLabel(){return(0,lt.tCount)("picker.holdLapsedSelectAgain",this.note?.recoverable.length??0)}recover(){let e=this.note?.recoverable??[];this.note=null,this.deps.syncTray(),e.length&&this.deps.reselect(e)}};var Tl=Symbol("seatlayer.performance-group-picker");function Sn(i,e){return Object.defineProperty(i,Tl,{configurable:!1,enumerable:!1,value:Object.freeze({...e})}),i}function El(i){return i[Tl]??null}var Cl="@seatlayer/pending-checkout/v1";function Rp(i){return typeof i=="string"&&i.length<=160&&/^ord_[A-Za-z0-9_-]+$/.test(i)}function kn(i){if(typeof location>"u")return null;let e=new URLSearchParams(location.search),t=e.get("seatlayer_checkout");if(t!=="success"&&t!=="cancelled")return null;let n=null;try{let o=window.sessionStorage.getItem(Cl);if(o){let s=null;try{s=JSON.parse(o)}catch{}if(s&&Rp(s.orderId)){let r=Date.now()-Number(s.storedAt);if(r>=0&&r<=144e5){if(s.eventKey&&s.eventKey!==i)return null;n=s.orderId}}}window.sessionStorage.removeItem(Cl)}catch{}e.delete("seatlayer_checkout");try{let o=e.toString();history.replaceState(history.state,"",`${location.pathname}${o?`?${o}`:""}${location.hash}`)}catch{}return{outcome:t,orderId:n}}function Al(i){if(!i.framed)return null;let e=i.ancestorOrigins?.length?i.ancestorOrigins[0]:null;for(let t of[e,i.referrer])if(t)try{return new URL(t).origin}catch{}return null}var Ip="https://api.seatlayer.io",Op=10,_p=250,Pl=6e4,Ll=4,Np=10,Dp=40,Bp=220,go=["mini","peek","open"],Ml="seatmap.a11y.cb";function Fp(){try{if(typeof window>"u")return null;let i=window.localStorage.getItem(Ml);return i==null?null:i==="1"}catch{return null}}function Vp(i){try{window.localStorage.setItem(Ml,i?"1":"0")}catch{}}var Ke=class i{constructor(e){this.realtime=null;this.accessEl=null;this.lastSelectionValidity=null;this.root=null;this.mapHost=null;this.rendered=!1;this.destroyed=!1;this.renderInfo=null;this.webMcp=null;this.localeGeneration=0;this.els={};this.regions={};this.ro=null;this.viewportResizeHandler=null;this.holdTimer=null;this.loadAbort=null;this.transportAbort=new AbortController;this.toastTimer=null;this.offerReadInFlight=null;this.offerReadSettledAt=0;this.offerRefreshTimer=null;this.offerBoundaryTimer=null;this.offerVisibilityHandler=null;this.motionTimers=new Set;this.currency="USD";this.eventTimezone=null;this.eventWhenText=null;this.offerAvailability=null;this.channelByObject=new Map;this.pricesByChannel=new Map;this.hold=null;this.holdExpiresAt=0;this.handedOff=!1;this.bookedShown=!1;this.holdConflicted=!1;this.paymentOptions=null;this.checkoutPanel=null;this.extendEl=null;this.extendDismissed=!1;this.extendUsed=!1;this.bookedEl=null;this.holdExpiredEl=null;this.holdExpiredFresh=!1;this.holdExpiredUnits=[];this.gaQty=new Map;this.gaPromptEl=null;this.gaPromptReturnFocus=null;this.gaAreasExpanded=!1;this.lastMapPoint=null;this.tipEl=null;this.tipPos={x:0,y:0};this.tipPinned=!1;this.tipMarkedHoverLabel=null;this.lastPointerType="mouse";this.themeMode=null;this.colorSchemeStop=null;this.seatsRevealed=!1;this.seatsReadyResolve=null;this.seatsRevealedReport=null;this.confirmCardCache=null;this.suppressConfirmationSeatId=null;this.tableDialogEl=null;this.tableDialog=null;this.tableDialogHeld=!1;this.tableDialogReturnFocus=null;this.srEl=null;this.baQty=2;this.baCat="";this.baZone="";this.baPremium=!1;this.bestAvailableConfirm=!1;this.salesClosed=!1;this.soldOut=!1;this.soldoutEl=null;this.cbSafe=!1;this.rungsEl=null;this.projectionEl=null;this.buyerView="map";this.view3dEl=null;this.view3dHandle=null;this.view3dGen=0;this.view3dReturnSeat=null;this.view3dTargetSeatId=null;this.view3dCompareSeatIds=[];this.view3dCompareChip=new mn({overlay:()=>this.view3dEl,savedSeatIds:()=>this.view3dCompareSeatIds,openComparison:()=>this.openView3dComparison(),clearComparison:()=>this.clearView3dComparison(),toast:(e,t)=>this.toast(e,t)});this.view3dCompareEl=null;this.view3dCompareCleanup=null;this.view3dSeatViewChrome=null;this.view3dPassportEl=null;this.view3dPassportCleanup=null;this.floorsEl=null;this.arenaViewportInsets={top:0,right:0,bottom:0,left:0};this.viewEl=null;this.viewCleanup=null;this.seatViewGen=0;this.allSeatsCache=null;this.view3dBack=null;this.view3dNav=null;this.lastRailSignature="";this.priceSelect=null;this.minimap=null;this.pickerLayoutSize={width:0,height:0};this.fullscreenAffordanceSize={rootWidth:-1,rootHeight:-1,viewportWidth:-1,viewportHeight:-1};this.priceBandKeys=null;this.focusedCatKey=null;this.limitedViewFilter=!1;this.pricesExpanded=!1;this.sectionCardCache=null;this.lastTrayCount=0;this.langSel=null;this.lastTrayTotal=0;this.lastTrayKeys=new Set;this.bestAvailableBusy=!1;this.releasingLabels=new Set;this.holdingLabels=new Set;this.ctaPhase="idle";this.a11yMenu=null;this.detachAttention=null;this.lapse=new xn({toast:(e,t,n)=>this.toast(e,t,n),reselect:e=>{this.controller.select(e),this.handleCta()},syncTray:()=>this.syncTray()});this.railEdgesBound=!1;this.fsFallback=!1;this.fsChangeHandler=null;this.fsEscHandler=null;this.eventDetailsHidden=!1;this.sideCollapsed=!1;this.sideToggleEl=null;this.framedFs=!1;this.lastPostedHeight=0;this.cbEl=null;this.modalCleanup=null;this.prevFocus=null;this.escHandler=null;this.closeModal=null;this.fitScheduled=!1;this.perspectiveWarned=!1;if(!e||typeof e!="object")throw new Error("seatmap: options object is required");if(!e.event||typeof e.event!="string")throw new Error("seatmap: `event` key is required");if(!e.container)throw new Error("seatmap: `container` is required (or use SeatPicker.open())");this.performanceGroup=El(e),this.suppressPricing=!!this.performanceGroup?.suppressPricing,this.opts={...e,confirmSelection:e.confirmSelection??!0},this.eventDetailsHidden=!!e.hideEventDetails,this.hostPricing=e.pricing,this.apiBase=(e.apiBase??Ip).replace(/\/+$/,"");let t={onExpired:a=>{this.opts.onAccessExpired?.(a),a.refreshed||this.showAccessPanel({reason:"no_token",retryable:!1})},onUnavailable:a=>{this.opts.onAccessUnavailable?.(a),this.showAccessPanel(a)}},n=!e.transport&&e.publicKey&&!e.buyerAccessTokenProvider&&!e.buyerAccessToken?Bi({base:this.apiBase,event:e.event,publicKey:e.publicKey,accessHooks:t,apiOptions:{referral:e.referral,onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)}}):null;this.access=e.transport?null:n?.access??Ht(e,t),this.pubApi=e.transport?null:n?.api??new Ve(this.apiBase,{access:this.access??void 0,referral:e.referral,onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)}),this.api=lr(e.transport??this.pubApi,this.transportAbort.signal),this.buyerAssetUrls=new It(e.event,this.api.asset?(a,l)=>this.api.asset(a,l):void 0),e.checkout==="hosted"&&!this.pubApi&&console.warn('seatlayer: checkout: "hosted" needs the widget\'s own transport \u2014 a custom `transport` owns its backend, so the picker is staying on onCheckout for this mount.'),this.checkoutMode=e.checkout==="hosted"&&this.pubApi?"hosted":"handoff";let o=e.numberOfPlacesToSelect;if(o!=null&&(!Number.isInteger(o)||o<1))throw new Error("seatmap: `numberOfPlacesToSelect` must be a positive integer");this.exactTickets=o??null;let s=Ra(e.selectionValidators);if(this.exactTickets!=null&&s>this.exactTickets)throw new Error("seatmap: `minimumSelectedPlaces.minimum` cannot exceed `numberOfPlacesToSelect`");let r=Math.max(1,Math.floor(e.maxSelection??this.exactTickets??Math.max(Op,s)));if(this.exactTickets!=null&&r<this.exactTickets)throw new Error("seatmap: `maxSelection` cannot be lower than `numberOfPlacesToSelect`");if(e.maxSelection!=null&&r<s)throw new Error("seatmap: `maxSelection` cannot be lower than `minimumSelectedPlaces.minimum`");this.maxTickets=this.exactTickets??r,this.cbSafe=Fp()??!!e.colorblindSafe,this.controller=this.wireController(e)}get confirmEl(){return this.confirmCard.element}set confirmEl(e){this.confirmCard.element=e}get confirmSeat(){return this.confirmCard.candidate}set confirmSeat(e){this.confirmCard.candidate=e}get lastSection(){return this.sectionCard.summary}set lastSection(e){this.sectionCard.adopt(e)}deliverableViewReference(e){return _t(e)}isFramed(){return typeof window<"u"&&window.parent!==window}postToHost(e){if(!this.isFramed())return;let t=Al({framed:!0,ancestorOrigins:window.location.ancestorOrigins,referrer:document.referrer});if(t)try{window.parent.postMessage(e,t)}catch{}}measureFramedHeight(){let e=this.root;if(!e)return 0;let t=e.clientWidth||(typeof window<"u"?window.innerWidth:0)||0;if(t<=0)return 0;let n=t<640?1.2:.62;return Math.max(420,Math.round(t*n))}reportFramedHeight(){if(!this.isFramed())return;let e=this.measureFramedHeight();e<=0||e===this.lastPostedHeight||(this.lastPostedHeight=e,this.postToHost({type:"seatlayer:height",px:e}))}toggleFullscreen(){let e=this.root;if(!e)return;!!document.fullscreenElement||this.fsFallback||this.framedFs?document.fullscreenElement?document.exitFullscreen().catch(()=>{}):this.framedFs?this.setFramedFs(!1):this.setFsFallback(!1):e.requestFullscreen?e.requestFullscreen().catch(()=>this.enterFsFallback()):this.enterFsFallback()}fillsViewport(){let e=this.root;if(!e||typeof window>"u")return!1;let t=e.getBoundingClientRect();return t.height>=window.innerHeight-Ll&&t.width>=window.innerWidth-Ll}syncFullscreenAffordance(){let e=this.els.zfs;if(!e)return;let n=!(!!document.fullscreenElement||this.fsFallback||this.framedFs)&&this.root?.dataset.layout==="narrow"&&this.fillsViewport();e.hidden=n,e.tabIndex=n?-1:0,e.setAttribute("aria-hidden",String(n))}fullscreenMeasurementChanged(e,t){let n=typeof window>"u"?0:window.innerWidth,o=typeof window>"u"?0:window.innerHeight,s=e!==this.fullscreenAffordanceSize.rootWidth||t!==this.fullscreenAffordanceSize.rootHeight||n!==this.fullscreenAffordanceSize.viewportWidth||o!==this.fullscreenAffordanceSize.viewportHeight;return this.fullscreenAffordanceSize={rootWidth:e,rootHeight:t,viewportWidth:n,viewportHeight:o},s}syncFullscreenButtons(){let e=!!document.fullscreenElement||this.fsFallback||this.framedFs,t=this.eventDetailsHidden&&!e;this.root?.setAttribute("data-event-details-hidden",String(t)),this.root?.setAttribute("data-fs",String(e)),this.els.zfs?.setAttribute("aria-pressed",String(e)),this.els.zfs?.setAttribute("title",e?this.tf("picker.exitFullScreen","Exit full screen"):this.tf("picker.fullScreen","Full screen"));let n=this.els.zfs?.querySelector(".sl-zfs-lbl");n&&(n.textContent=e?this.tf("picker.exitFullScreen","Exit full screen"):this.tf("picker.fullScreen","Full screen")),this.view3dEl?.querySelector(".sl-view3d-fs")?.setAttribute("aria-pressed",String(e)),this.syncFullscreenAffordance()}enterFsFallback(){this.isFramed()?this.setFramedFs(!0):this.setFsFallback(!0)}setFramedFs(e){this.framedFs!==e&&(this.framedFs=e,this.syncFullscreenButtons(),this.postToHost({type:"seatlayer:fullscreen",on:e,background:this.cssVar("--sl-bg")||void 0}),e&&!this.fsEscHandler?(this.fsEscHandler=t=>{t.key==="Escape"&&!document.fullscreenElement&&this.setFramedFs(!1)},window.addEventListener("keydown",this.fsEscHandler)):!e&&this.fsEscHandler&&(window.removeEventListener("keydown",this.fsEscHandler),this.fsEscHandler=null),requestAnimationFrame(()=>this.controller.refitCurrentView()))}setFsFallback(e){this.fsFallback!==e&&(this.fsFallback=e,this.root?.classList.toggle("sl-fs",e),this.syncFullscreenButtons(),e&&!this.fsEscHandler?(this.fsEscHandler=t=>{t.key==="Escape"&&!document.fullscreenElement&&this.setFsFallback(!1)},window.addEventListener("keydown",this.fsEscHandler)):!e&&this.fsEscHandler&&(window.removeEventListener("keydown",this.fsEscHandler),this.fsEscHandler=null),requestAnimationFrame(()=>this.controller.refitCurrentView()))}close(){this.closeModal?this.closeModal():this.destroy()}static async open(e){Ot();let t=document.activeElement instanceof HTMLElement?document.activeElement:null,n=document.createElement("div");n.className="sl-modal-scrim";let o=document.createElement("div");o.className="sl-modal-frame",o.style.setProperty("--sl-bg",Et(void 0,e.theme)["--sl-bg"]),o.setAttribute("role","dialog"),o.setAttribute("aria-modal","true"),o.setAttribute("aria-label",b("picker.seatSelection","Seat selection")),o.tabIndex=-1,n.appendChild(o),document.body.appendChild(n);let s=document.body.style.overflow;document.body.style.overflow="hidden";let r=ar(n),a;try{a=new i({...e,container:o})}catch(f){throw r(),n.remove(),document.body.style.overflow=s,f}a.prevFocus=t,a.modalCleanup=()=>{a.modalCleanup=null,r(),document.body.style.overflow=s,a.escHandler&&document.removeEventListener("keydown",a.escHandler),n.remove();let f=a.prevFocus;a.prevFocus=null,f?.isConnected&&f.focus({preventScroll:!0})};let l=["a[href]","area[href]","button","input","select","textarea","iframe","object","embed","summary","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"[tabindex]"].join(","),c=()=>{let f=[...o.querySelectorAll('[role="dialog"][aria-modal="true"]')].filter(T=>T.isConnected&&!T.closest('[hidden], [aria-hidden="true"], [inert]'));return f[f.length-1]??o},d=(f,T)=>{let w=f;for(;w;){let v=window.getComputedStyle(w);if(w.hidden||w.getAttribute("aria-hidden")==="true"||w.hasAttribute("inert")||v.display==="none"||v.visibility==="hidden"||v.visibility==="collapse")return!0;if(w===T)return!1;w=w.parentElement}return!0},p=f=>[...f.querySelectorAll(l)].filter(T=>T.tabIndex>=0&&!T.matches(":disabled")&&!d(T,f)),u=(f,T)=>{let w=p(f),v=T?w[w.length-1]:w[0];v?v.focus({preventScroll:!0}):(f.hasAttribute("tabindex")||(f.tabIndex=-1),f.focus({preventScroll:!0}))},h=!1,y=()=>{if(h)return;h=!0,a.modalCleanup?.();let f=()=>{a.destroy(),e.onClose?.()};a.hold&&!a.handedOff?a.release().finally(f):f()};a.closeModal=y,n.addEventListener("mousedown",f=>{f.target===n&&y()}),a.escHandler=f=>{if(f.key==="Tab"){if(f.defaultPrevented)return;let T=c(),w=p(T),v=w[0],A=w[w.length-1],D=document.activeElement;!v||!A?(f.preventDefault(),u(T,f.shiftKey)):D===T||!D||!T.contains(D)?(f.preventDefault(),(f.shiftKey?A:v).focus({preventScroll:!0})):f.shiftKey&&D===v?(f.preventDefault(),A.focus({preventScroll:!0})):!f.shiftKey&&D===A&&(f.preventDefault(),v.focus({preventScroll:!0}));return}f.key==="Escape"&&(a.tableDialog?(f.preventDefault(),a.cancelTableDialog()):a.confirmSeat?(f.preventDefault(),a.cancelConfirm()):a.bestAvailableConfirm?(f.preventDefault(),a.bestAvailableConfirm=!1,a.syncTray()):(f.preventDefault(),y()))},document.addEventListener("keydown",a.escHandler);try{let f=a.render();a.els.close?.classList.add("on"),a.els.close?.addEventListener("click",y),await f}catch(f){throw a.destroy(),f}return a.destroyed||u(c(),!1),a}wireController(e){return new H.PickerController({sectionPreview:!0,transport:this.api,eventKey:e.event,maxSelection:this.maxTickets,selectedObjects:e.selectedObjects,selectableObjects:e.selectableObjects,numberOfPlacesToSelect:e.numberOfPlacesToSelect,selectionValidators:e.selectionValidators,currency:e.currency,flashOnLiveChange:!0,colorblindSafe:this.cbSafe,...e.loadingReveal?{loadingReveal:e.loadingReveal}:{},mapTheme:Tt(e.theme),onSeatsRevealed:()=>{this.seatsRevealed=!0,this.seatsReadyResolve?.(),this.seatsReadyResolve=null,e.onSeatsRevealed?.(),this.seatsRevealedReport?.()},onGAClick:t=>{let n=this.controller.getGAAreas().find(o=>o.id===t);n&&(this.collapseSheet(),jn(this,n,this.lastMapPoint))},onSelectionChange:()=>{this.syncTray(),this.minimap?.refreshMinimap(),this.committedSelection().length&&this.collapseSectionCard(),this.syncSelectionTo3d()},onStatusChange:(t=>{this.syncSeatMarks(),this.syncPrices(),this.a11yMenu?.syncCounts(),gr(t)&&this.scheduleOfferRefresh(!0),this.evictTakenSelections(),this.detectBooked(),this.minimap?.refreshMinimap(),this.pushAvailabilityTo3d()}),onHoldExpired:()=>{let t=this.handedOff,n=this.holdConflicted;this.holdExpiredUnits=bl(this.hold),this.hold=null,this.forgetHold(),this.handedOff=!1,this.bookedShown=!1,this.holdConflicted=!1,this.ctaPhase="idle",this.stopHoldTimer(),this.gaQty.clear(),this.lapse.deferExpiryToast(()=>{if(t||n){this.toast((0,H.t)("picker.holdExpired",void 0)||"Your hold expired \u2014 seats released. Pick again.","warning");return}this.showHoldExpired()}),this.syncTray(),this.emitHoldChange(),this.opts.onHoldExpired?.()},onAvailabilityRefresh:t=>this.lapse.handle(t),confirmSelection:this.opts.confirmSelection,onSelect:t=>{if(this.salesClosed){this.controller.deselect([t.id]),this.toast(this.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}this.controller.tableSelection(t.id)||(this.collapseSheet(),this.flashPickedSeat(t.id),this.opts.confirmSelection&&this.suppressConfirmationSeatId!==t.id&&this.showConfirm(t))},onTableSelectionRequest:t=>{if(this.salesClosed){this.controller.deselect(t.physicalSeatIds),this.toast(this.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}this.showTableDialog(t,!1)},onDeselect:t=>{if(this.controller.currentHold()?.labels.includes(t.label)){if(this.opts.confirmSelection===!1||this.salesClosed){this.removeHeldLabels([t.label]);return}if(this.confirmSeat?.id===t.id){this.dismissConfirm();return}this.showConfirm(t,"remove");return}if(this.confirmSeat?.id===t.id){this.dismissConfirm();return}if(this.tableDialog?.physicalSeatIds.includes(t.id)){this.dismissTableDialog();return}this.opts.confirmSelection===!1||this.salesClosed||this.controller.tableSelection(t.id)||(this.controller.select([t.id]),this.showConfirm(t,"remove"))},onSelectionLimit:()=>{this.toast((0,H.t)("picker.maxTicketsForOrder",{count:this.maxTickets}),"warning"),this.opts.onSelectionLimit?.(this.maxTickets)},onViewChange:()=>{this.reanchorConfirm(),this.syncRung(),this.syncProjection(),this.minimap?.drawMinimapRect(),this.sectionCardOnView()},onSectionFocus:t=>this.showSectionCard(t),onDeckTap:()=>{this.showSectionCard(null),this.syncFloors(),this.syncRung(),this.minimap?.refreshMinimap()},onFocusSeat:t=>this.announceSeat(t),onSeatHover:t=>this.updateTooltip(t),hostCardOpen:()=>this.tipPinned||!!this.confirmSeat,onHint:t=>{t&&this.toast(t)},onSalesClosed:()=>this.setSalesClosed(!0),onError:t=>this.opts.onError?.(t)})}async render(){if(this.rendered)return this;let e=performance.now(),t={},n=h=>Math.round((performance.now()-h)*100)/100;this.rendered=!0,Ot();let o=performance.now(),s=_i(this.opts.locale,this.opts.messages),r=this.localeGeneration+=1;this.checkoutMode==="hosted"&&(this.paymentOptions=this.pubApi.paymentOptions(this.opts.event));let a=performance.now(),l=Ko(this.opts.container),{root:c,els:d,mapHost:p}=ys(l,(h,y)=>this.tf(h,y),this.opts.theme);this.root=c,this.els=d,this.mapHost=p,Ni(c,s,h=>{t.loadLocale=n(o),this.destroyed||this.applyActiveLocale(h,r)}),na(c,()=>[{open:()=>!!this.holdExpiredEl,close:()=>this.restartAfterHoldExpiry()},{open:()=>this.tipPinned,close:()=>this.unpinTooltip()},{open:()=>!!this.tableDialog,close:()=>this.cancelTableDialog()},{open:()=>!!this.confirmSeat,close:()=>this.cancelConfirm()},{open:()=>this.bestAvailableConfirm,close:()=>{this.bestAvailableConfirm=!1,this.syncTray()}}]),this.syncFullscreenButtons(),this.wireBuyerShell(c);let u=document.createElement("div");return u.style.cssText="position:absolute;inset:0",this.mapHost.appendChild(u),t.mountBuyerShell=n(a),t.skeletonPaint=n(e),this.loadAndFinishChart(u,t,n,e,c)}async loadAndFinishChart(e,t,n,o,s){this.startRealtime();let r=await this.loadChart(e,t,n);if(!r)return this.realtime?.stop(),this.realtime=null,this;t.shellsPaint=n(o);let a=performance.now();if(this.salesClosed=!!r.salesClosed||!!this.opts.readOnly,s.dataset.eventMode=r.mode==="test"?"test":"live",!this.opts.locale&&r.locale&&this.setLocale(r.locale),this.controller.setViewMode(this.normalizeInitialView(this.opts.initialView)),this.buildRegions(),this.regions["bottom-right"].appendChild(this.els.zoom),this.regions["bottom-center"].appendChild(this.els.toast),r.mode==="test"){let v=document.createElement("div");v.className="sl-testbadge",v.textContent=qo((0,H.t)("picker.testMode"),(0,H.getLocale)()),v.setAttribute("aria-label",(0,H.t)("picker.testMode")),v.title=this.tf("picker.testModeExplained","Bookings here are not real and no card is charged"),this.regions["top-left"].appendChild(v)}let l=this.controller.doc?.theme;this.themeMode=this.opts.theme?.mode??null,this.applyThemeTokens(s),this.watchThemeMode(),this.currency=r.currency??this.opts.currency??"USD",this.eventTimezone=r.timezone??null,Wo(this.els.logo,[this.opts.theme?.logoUrl,l?.logoUrl,r.posterUrl],this.opts.theme?.brandName??l?.brandName??r.eventName??"?"),this.els.name.textContent=r.eventName??"";let c=r.startsAt?Li(r.startsAt,r.timezone??null,this.opts.locale):"";this.eventWhenText=c||null,this.els.meta.textContent=[r.venue,c].filter(Boolean).join(" \xB7 "),this.syncProjection(),this.buildBadge(l);let d=!!this.controller.doc&&this.controller.getExpandedSeats().some(v=>v.commercial?.restrictedView||v.commercial?.obstructedView);this.buildAccessibilityMenu(d),this.buildLanguageSwitcher(this.els.zoom??this.regions["bottom-right"]),this.srEl=document.createElement("div"),this.srEl.className="sl-sr",this.srEl.setAttribute("aria-live","polite"),s.appendChild(this.srEl),this.buildArenaChrome(),this.buildMinimap(),this.buildPriceFilter(),this.buildExtendPrompt(),this.buildBookedOverlay(),this.buildSoldoutOverlay(),this.buildPanelToggle(),this.opts.panelCollapsed&&this.setPanelCollapsed(!0),this.dockLayoutChrome(),t.buildBuyerControls=n(a);let p=performance.now();if(!await this.restoreHoldForFirstPaint(t))return this;if(t.restoreHold=n(p),this.destroyed)return this;this.dismissSkeleton(),this.salesClosed&&this.applySalesClosed(),this.syncPrices(),this.syncTray(),this.resumeHostedOrder();let u=this.controller.doc,h=Xi(this.opts.event),y=this.performanceGroup?.surface??(this.performanceGroup?"performance_group":null),f=y??"event",T={apiBase:this.apiBase,eventKey:this.opts.event,metricScope:f,surface:y==="season"?"season_picker":y==="performance_group"?"performance_group_picker":"seat_picker",ms:n(o),performanceProfile:t,chartDelivery:r.chartDelivery,seatCount:this.allSeats().length,objectCount:u?.objects.length??0,sectionCount:u?.objects.filter(v=>v.type==="section").length??0,floorCount:this.controller.getFloors().length,chartName:u?.name,view:this.buyerView,load:h,transport:this.opts.transport?"custom":"pubapi"};ca(T,(v,A)=>this.emitAnalytics(v,A));let w=r.performanceProfile;return this.seatsRevealedReport=()=>this.emitAnalytics("chart_seats_revealed",lo({...T,performanceProfile:{...T.performanceProfile,...w}})),this.seatsRevealed&&this.seatsRevealedReport(),this.renderInfo=r,await this.registerAgentTools(),this}registerAgentTools(){return la(this)}webMcpHost(e){return ao(this,e)}wireBuyerShell(e){this.refreshOfferAvailability(!1),this.api.availability&&(this.offerVisibilityHandler=()=>{!document.hidden&&!this.destroyed&&this.refreshOfferAvailability(!1)},document.addEventListener("visibilitychange",this.offerVisibilityHandler)),this.detachAttention=kl(()=>{this.destroyed||this.controller.refreshAvailability()}),this.observeLayout(e),this.els.zin.addEventListener("click",()=>this.controller.zoomIn()),this.els.zout.addEventListener("click",()=>this.controller.zoomOut()),this.els.zfit?.addEventListener("click",()=>this.controller.overview()),this.els.zfs.addEventListener("click",()=>this.toggleFullscreen()),this.fsChangeHandler=()=>{document.fullscreenElement||this.setFsFallback(!1),this.syncFullscreenButtons(),requestAnimationFrame(()=>this.controller.refitCurrentView())},document.addEventListener("fullscreenchange",this.fsChangeHandler);let t=this.els.sheetHead;if(t){let o=this.els.sheetToggle;this.syncSheetAffordance();let s=0,r=!1,a=!1,l=!1;o?.addEventListener("click",c=>{c.stopPropagation(),!r&&this.cycleSheet()}),t.addEventListener("pointerdown",c=>{if(c.target.closest?.(".sl-seccard")){a=!1;return}l=!!c.target.closest?.(".sl-sheet-toggle"),a=!0,r=!1,s=c.clientY,(l&&o?o:t).setPointerCapture?.(c.pointerId)}),t.addEventListener("pointermove",c=>{if(!a||r)return;let d=c.clientY-s;d<-18?(this.stepSheet(1),r=!0):d>18&&(this.stepSheet(-1),r=!0)}),t.addEventListener("pointerup",c=>{a&&!r&&!l&&Math.abs(c.clientY-s)<6&&this.cycleSheet(),a=!1,(l&&o?o:t).releasePointerCapture?.(c.pointerId),l=!1})}this.els.foot?.addEventListener("click",o=>{this.root?.dataset.layout==="narrow"&&(o.target.closest?.('.sl-chip,button,a,input,select,label,[role="button"]')||this.cycleSheet())});let n=()=>{if(this.root?.dataset.layout!=="narrow")return;let o=this.root.getAttribute("data-prices-open")==="true";this.root.setAttribute("data-prices-open",String(!o)),this.els.pricesSec?.setAttribute("aria-expanded",String(!o)),!o&&this.root.dataset.sheet!=="open"&&this.setSheetOpen(!0)};this.els.pricesSec?.addEventListener("click",o=>{o.target.closest("select,button")||n()}),this.els.pricesSec?.addEventListener("keydown",o=>{o.key!=="Enter"&&o.key!==" "||o.target.closest("select,button")||(o.preventDefault(),n())}),e.addEventListener("click",o=>{let s=o.target.closest("[data-sl-info]");if(!s||!e.contains(s))return;o.stopPropagation();let r=s.closest(".sl-info"),a=!r?.classList.contains("open");this.closeInfoPops(r),r?.classList.toggle("open",a),s.setAttribute("aria-expanded",String(a))}),e.addEventListener("pointerdown",o=>{o.target.closest(".sl-info")||this.closeInfoPops()}),this.tipEl=document.createElement("div"),this.tipEl.setAttribute("role","tooltip"),this.tipEl.className="sl-tip",this.els.map.appendChild(this.tipEl),this.els.map.addEventListener("pointerdown",o=>{this.handleMapPointerDown(o)},!0),this.els.map.addEventListener("mousemove",o=>{if(this.tipPinned)return;let s=this.els.map.getBoundingClientRect();this.tipPos={x:o.clientX-s.left,y:o.clientY-s.top},this.tipEl&&this.tipEl.style.display!=="none"&&this.placeTooltip()}),this.els.cta.addEventListener("click",()=>{this.els.cta.dataset.act==="find"?this.openBestSeatsForm():this.handleCta()})}sheetState(){let e=this.root?.dataset.sheet;return e==="mini"||e==="open"?e:"peek"}sheetHasCards(){return this.root?.getAttribute("data-has-selection")==="true"}setSheetState(e){let t=this.root;if(!t)return;let n=t.dataset.sheet;t.dataset.sheet=e==="mini"&&!this.sheetHasCards()?"peek":e,this.syncSheetAffordance(),n==="mini"&&t.dataset.sheet!=="mini"&&this.scheduleFit()}syncSheetAffordance(){let e=this.sheetState(),t=e==="open"||e==="peek"&&this.sheetHasCards(),n=this.els.sheetToggle;n?.setAttribute("aria-expanded",String(e==="open")),n?.setAttribute("aria-label",t?this.tf("picker.collapseTicketPanel","Collapse ticket panel"):this.tf("picker.openTicketPanel","Open ticket panel"))}cycleSheet(){let e=this.sheetState();e==="open"||e==="mini"?this.setSheetState("peek"):this.setSheetState(this.sheetHasCards()?"mini":"open")}stepSheet(e){let t=go.indexOf(this.sheetState()),n=Math.min(go.length-1,Math.max(0,t+e));this.setSheetState(go[n])}setSheetOpen(e){this.setSheetState(e?"open":"peek")}openBestSeatsForm(){this.setSheetOpen(!0),this.els.tray?.querySelector(".sl-ba")?.scrollIntoView({block:"nearest",behavior:this.reducedMotion()?"auto":"smooth"}),this.els.tray?.querySelector(".sl-ba-go")?.focus()}collapseSheet(){let e=this.root;!e||e.dataset.layout!=="narrow"||e.dataset.sheet!=="open"||this.setSheetState("peek")}observeLayout(e){let t=()=>{let n=e.clientWidth;if(n<=0)return;let o=e.clientHeight,s=n!==this.pickerLayoutSize.width||o!==this.pickerLayoutSize.height;this.pickerLayoutSize={width:n,height:o};let r=this.fullscreenMeasurementChanged(n,o);this.reportFramedHeight();let a=n<640?"narrow":"wide",l=o<560?"compact":"comfortable",c=e.dataset.layout!==a||e.dataset.density!==l;c&&(e.dataset.layout=a,e.dataset.density=l,this.controller.setNarrowLayout?.(a==="narrow"),queueMicrotask(()=>this.syncFitClearance()),this.controller.getRenderer()?.setSectionFocusDim?.(a!=="narrow"),a==="narrow"&&!e.dataset.sheet&&(e.dataset.sheet="peek"),this.dockLayoutChrome(),this.syncMinimapForLayout(),this.lastTrayKeys.size&&this.syncTray(),this.syncMapStepBack(),this.refreshExtendPrompt()),(r||c)&&this.syncFullscreenAffordance(),this.syncArenaViewportInsets(),s&&(this.minimap?.refreshMinimap(),this.scheduleFit())};this.ro=new ResizeObserver(t),this.ro.observe(e),this.viewportResizeHandler=()=>{this.fullscreenMeasurementChanged(e.clientWidth,e.clientHeight)&&this.syncFullscreenAffordance()},window.addEventListener("resize",this.viewportResizeHandler),t(),requestAnimationFrame(t)}async loadChart(e,t,n){let o=performance.now();this.loadAbort=new AbortController;let s=await At(async()=>{let a=await this.controller.render(e);return a&&this.controller.getRenderer()?.isSeatRevealPending?.()&&await new Promise(l=>{this.seatsReadyResolve=l}),a},this.loadAbort.signal,()=>{let a=this.els.boot.querySelector(".sl-boot-say");a&&(a.classList.add("is-visible"),a.textContent=this.tf("picker.loadingTakingLonger","The seat map is taking longer to load. Please wait\u2026"))});if(this.seatsReadyResolve?.(),this.seatsReadyResolve=null,this.loadAbort=null,s.outcome==="cancelled"||this.destroyed)return null;let r=s.outcome==="loaded"?s.value:null;return r||this.controller.destroy(),t.loadChartAndStatuses=n(o),this.destroyed?null:r?(Object.assign(t,r.performanceProfile),r):(Ae({apiBase:this.apiBase,event:this.opts.event,scope:this.performanceGroup?.surface??(this.performanceGroup?"performance_group":"event"),surface:this.performanceGroup?.surface==="season"?"season_picker":this.performanceGroup?"performance_group_picker":"seat_picker",outcome:"failure",stage:s.outcome==="timeout"?"load_timeout":s.outcome==="error"?"render_error":"load_chart",ms:t.loadChartAndStatuses,performanceProfile:t,view:"map",load:Oe(this.opts.event),transport:this.opts.transport?"custom":"pubapi"}),ai(this.els.boot,{title:this.tf("picker.mapDidNotLoad","The seat map didn\u2019t load"),description:this.tf("picker.checkConnection","Check your connection and try again."),actionLabel:this.tf("picker.accessRetry","Try again")}),this.els.boot.querySelector("button").addEventListener("click",()=>{if(this.destroyed||!this.root)return;this.controller=this.wireController(this.opts),ai(this.els.boot,{title:this.tf("picker.loadingSeatMap","Loading seat map\u2026"),busy:!0});let a=performance.now();this.loadAndFinishChart(e,{},n,a,this.root)},{once:!0}),null)}async restoreHoldForFirstPaint(e){let t=[this.els.side,this.els.rail].filter(Boolean),n=t.map(o=>o.hasAttribute("inert"));t.forEach(o=>o.setAttribute("inert",""));try{for(;!this.destroyed;){let o=performance.now();try{return await this.restoreRememberedHold(),!this.destroyed}catch{if(this.destroyed)return!1;Ae({apiBase:this.apiBase,event:this.opts.event,scope:this.performanceGroup?.surface??(this.performanceGroup?"performance_group":"event"),surface:this.performanceGroup?.surface==="season"?"season_picker":this.performanceGroup?"performance_group_picker":"seat_picker",outcome:"failure",stage:"restore_hold",ms:performance.now()-o,performanceProfile:e,view:"map",load:Oe(this.opts.event),transport:this.opts.transport?"custom":"pubapi"});let r=ai(this.els.boot,{title:this.tf("picker.restoreUnavailableTitle","Unable to check saved seats"),description:this.tf("picker.restoreUnavailable","Try again to check whether your saved seats are still held."),actionLabel:this.tf("picker.accessRetry","Try again")}),a=this.transportAbort.signal;if(await new Promise(l=>{let c=()=>{r.removeEventListener("click",c),a.removeEventListener("abort",c),l()};r.addEventListener("click",c,{once:!0}),a.addEventListener("abort",c,{once:!0}),a.aborted&&c()}),this.destroyed||a.aborted)return!1;ai(this.els.boot,{title:this.tf("picker.restoringSeats","Checking your saved seats\u2026"),busy:!0})}}return!1}finally{t.forEach((o,s)=>{n[s]||o.removeAttribute("inert")})}}resumeHostedOrder(){if(this.checkoutMode!=="hosted")return;let e=kn(this.opts.event);e?.outcome!=="success"||!e.orderId||this.openCheckoutPanel({kind:"resume",orderId:e.orderId})}buildPanelToggle(){if(!this.regions["top-right"])return;let e=document.createElement("button");e.type="button",e.className="sl-side-toggle",e.addEventListener("click",()=>this.setPanelCollapsed(!this.sideCollapsed)),this.sideToggleEl=e,this.regions["top-right"].appendChild(e),this.syncPanelToggle()}syncPanelToggle(){let e=this.sideToggleEl;if(!e)return;let t=this.sideCollapsed;e.setAttribute("aria-expanded",String(!t)),e.setAttribute("aria-label",t?this.tf("picker.showTicketPanel","Show the ticket panel"):this.tf("picker.hideTicketPanel","Hide the ticket panel")),e.title=t?this.tf("picker.showTicketPanel","Show the ticket panel"):this.tf("picker.hideTicketPanel","Hide the ticket panel"),e.innerHTML=t?`<svg viewBox="0 0 24 24"><path d="M15 6l-6 6 6 6"/></svg><span>${this.tf("picker.tickets","Tickets")}</span>`:'<svg viewBox="0 0 24 24"><path d="M9 6l6 6-6 6"/></svg>'}setPanelCollapsed(e){this.destroyed||(this.sideCollapsed=e,this.applyPanelCollapsed(),this.scheduleMotion(()=>this.controller.refitCurrentView(),340))}applyPanelCollapsed(){let e=this.root?.dataset.layout!=="narrow";this.root?.setAttribute("data-side-collapsed",String(this.sideCollapsed)),this.els.side?.toggleAttribute("inert",this.sideCollapsed&&e),this.syncPanelToggle()}buildAccessibilityMenu(e){let t=this.els.zoom??this.regions["bottom-right"]??this.els.map;t&&(this.a11yMenu=new wn(t,{event:String(this.opts.event),chart:()=>this.controller.doc?.name??null,needs:()=>this.controller.getAccessNeeds(),hasLimitedView:e,tf:(n,o)=>this.tf(n,o),isColorblindSafe:()=>this.cbSafe,setColorblindSafe:n=>this.setColorblindSafe(n),isLimitedViewHidden:()=>this.limitedViewFilter,setLimitedViewHidden:n=>{this.limitedViewFilter=n,this.controller.setCommercialLimitedFilter(n),this.pushAvailabilityTo3d()},applyAccessibilityFilter:n=>this.applyAccessibilityFilter(n),focusSeatsForFilter:()=>this.focusSeatsForFilter(),stepToAccessibleSection:n=>this.controller.focusNextAccessibleSection?.([n])??null}),this.cbEl=this.a11yMenu.colorblindRow())}focusSeatsForFilter(){if(this.controller.focusAccessibilityFilter?.()){this.explainAccessibilitySpread();return}this.rungsEl&&this.controller.getRung()!=="seats"&&(this.controller.setRung("seats"),this.collapseSectionCard(),this.syncRung())}explainAccessibilitySpread(){let e=this.controller.accessibilitySpread?.();!e?.wholeVenue||e.sections.length<2||this.toast((0,H.t)("picker.accessSpreadHint",{count:e.spaces,sections:e.sections.length}),"neutral")}applyAccessibilityFilter(e){this.controller.setAccessibilityFilter(e),this.syncPrices(),this.minimap?.refreshMinimap(),this.pushAvailabilityTo3d()}setAccessibilityFilter(e){this.applyAccessibilityFilter(e),this.a11yMenu?.syncAccessibilityFilter(e),e?.length&&this.focusSeatsForFilter()}focusAccessibilityFilter(){this.focusSeatsForFilter()}dockLayoutChrome(){let e=this.root?.dataset.layout==="narrow";this.applyPanelCollapsed();let t=this.els.zfs,n=this.els.headInfo?.parentElement;t&&n&&t.parentElement!==n&&(t.classList.add("sl-fs-pill"),n.insertBefore(t,this.els.hold??null));let o=this.extendEl;if(o){let r=e?this.regions["bottom-center"]??this.els.map:n;r&&o.parentElement!==r&&(o.dataset.dock=e?"map":"head",r===n?r.insertBefore(o,this.els.close??null):r.appendChild(o))}let s=this.els.pricesSec;s&&(e?(s.setAttribute("role","button"),s.tabIndex=0,s.setAttribute("aria-expanded",String(this.root?.getAttribute("data-prices-open")==="true"))):(s.removeAttribute("role"),s.removeAttribute("aria-expanded"),s.tabIndex=-1)),this.lastSection&&this.renderSectionCard(this.lastSection)}buildExtendPrompt(){za(this)}buildBookedOverlay(){let e=document.createElement("div");e.className="sl-booked",e.setAttribute("role","status"),e.setAttribute("aria-live","polite"),e.innerHTML=`<div class="sl-booked-badge"><svg viewBox="0 0 24 24"><path d="M20 6L9 17l-5-5"/></svg></div><div class="sl-booked-title">${this.tf("picker.allSetTitle","You're all set")}</div><div class="sl-booked-sub" data-ref="bookedSub"></div><ul class="sl-booked-list" data-ref="bookedList"></ul><button type="button" class="sl-booked-back" data-ref="bookedBack"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M15 18l-6-6 6-6"/></svg><span>${B(this.tf("picker.backToMap","Back to map"))}</span></button>`,this.root.appendChild(e),this.bookedEl=e,this.els.bookedSub=e.querySelector('[data-ref="bookedSub"]'),this.els.bookedList=e.querySelector('[data-ref="bookedList"]'),e.querySelector('[data-ref="bookedBack"]')?.addEventListener("click",()=>this.dismissBooked())}get onGAPromptHook(){return this.opts.onGAPrompt}tf(e,t){return b(e,t)}buildSoldoutOverlay(){if(!this.els.map)return;let e=document.createElement("div");e.className="sl-soldout",e.setAttribute("role","status");let t=(this.controller.doc?.theme?.brandName??this.opts.theme?.brandName??this.els.name?.textContent??this.tf("picker.soldOutEyebrow","This event")).toUpperCase(),n=document.createElement("div");n.className="sl-soldout-eyebrow",n.textContent=t;let o=document.createElement("div");o.className="sl-soldout-title",o.textContent=this.tf("picker.soldOutTitle","Sold out");let s=document.createElement("p");s.className="sl-soldout-copy",s.textContent=this.tf("picker.soldOutCopy","No reserved seats are currently available for this event."),e.append(n,o,s),this.els.map.appendChild(e),this.soldoutEl=e}syncSoldout(e,t){let n=this.controller.getGAAreas().length>0,o=this.isSoldOut(e,t,n);o!==this.soldOut&&(this.soldOut=o,this.soldoutEl?.classList.toggle("on",o))}isSoldOut(e,t,n){return!n&&e.length>0&&e.every(o=>(t[o.key]??0)===0)}setSalesClosed(e){let t=e||!!this.opts.readOnly;this.salesClosed!==t&&(this.salesClosed=t,this.applySalesClosed())}applySalesClosed(){this.salesClosed&&this.tableDialog&&!this.tableDialogHeld&&this.cancelTableDialog();let e=this.els.closedPill;if(e){e.classList.toggle("on",this.salesClosed);let t=this.els.closedPillText??e;t.textContent=this.tf("picker.salesClosedPill","Sales are closed")}this.root?.setAttribute("data-sales-closed",String(this.salesClosed)),this.salesClosed&&this.srEl&&(this.srEl.textContent=this.tf("picker.salesClosedToast","Sales are closed for this event.")),this.syncCta(),this.syncTray()}badgeHidden(e){return!!e?.hideBadge}buildBadge(e){if(this.badgeHidden(e))return;let t=this.els.foot;if(!t)return;let n=document.createElement("a");n.className="sl-powered",n.href="https://seatlayer.io/?ref=picker",n.target="_blank",n.rel="noopener noreferrer",n.setAttribute("aria-label",this.tf("picker.poweredBy","Powered by SeatLayer"));let o=document.createElement("span");o.className="sl-powered-mark",o.setAttribute("aria-hidden","true"),o.innerHTML=ji;let s=document.createElement("span");s.textContent=this.tf("picker.poweredBy","Powered by SeatLayer"),n.append(o,s),t.appendChild(n)}buildRegions(){if(!this.els.map)return;let e=["top-left","top-center","top-right","left-rail","bottom-left","bottom-center","bottom-right"];for(let t of e){let n=document.createElement("div");n.className="sl-anchor",n.dataset.region=t,this.els.map.appendChild(n),this.regions[t]=n}}cssVar(e){return this.root?getComputedStyle(this.root).getPropertyValue(e).trim():""}reducedMotion(){return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}scheduleMotion(e,t){let n=setTimeout(()=>{this.motionTimers.delete(n),this.destroyed||e()},t);this.motionTimers.add(n)}animateOnce(e,t,n=600){!e||this.reducedMotion()||(e.classList.remove(t),e.offsetWidth,e.classList.add(t),this.scheduleMotion(()=>e.classList.remove(t),n))}flashPickedSeat(e){this.reducedMotion()||this.controller.flashSeat(e,this.cssVar("--sl-accent")||"#f4b740")}flashHeldSeats(e){let t=this.reducedMotion(),n=(e.items??[]).filter(o=>o.objectType!=="ga").slice(0,10).map(o=>this.controller.seatByLabel(o.label)).filter(o=>!!o);Zs({regions:this.els,categories:this.controller.doc?.categories,pop:o=>this.controller.flashSeat(o,this.cssVar("--sl-accent")||"#f4b740"),focus:(o,s)=>this.controller.focusSection(o,s),focusSeats:o=>this.controller.focusSeats?.(o,{animate:!t})===!0,reducedMotion:t,screenPoint:o=>this.controller.worldToScreen(o),schedule:(o,s)=>this.scheduleMotion(o,s)},n)}committedSelection(){let e=this.confirmSeat?.id,t=this.tableDialog&&!this.tableDialogHeld?this.tableDialog.id:null;return this.controller.getSelection().filter(n=>n.id!==e&&n.id!==t)}pendingSelectionCount(){return ja(this)}heldTicketCount(){return Ga(this)}totalTicketCount(){return Ua(this)}updateSelectionCapacity(){qa(this)}syncCta(e=this.lastTrayCount,t=this.pendingSelectionCount()){Ka(this,e,t)}setCtaPhase(e){Wa(this,e)}runCheckoutHandoff(e,t){return Ya(this,e,t)}holdStorageKey(){return Xa(this)}rememberedHoldId(){return Za(this)}rememberHold(e){Qa(this,e)}forgetHold(){Ja(this)}resumeHoldFromServer(e,t=!1){return el(this,e,t)}restoreRememberedHold(){return tl(this)}activeFloorObjects(){let e=this.controller.doc;if(!e)return[];let t=e.floors;if(t?.length){let n=this.controller.getActiveFloorId();return(t.find(o=>o.id===n)??t[0]).objects??[]}return e.objects??[]}buildMinimap(){!this.els.map||this.root?.dataset.layout==="narrow"||(this.minimap=Qr({controller:this.controller,root:()=>this.root,cssVar:e=>this.cssVar(e),focusedSectionLabel:()=>this.lastSection?.label},this.regions["bottom-left"]??this.els.map))}syncMinimapForLayout(){let e=this.root?.dataset.layout==="narrow";if(e&&this.minimap){this.minimap.dispose(),this.minimap=null;return}!e&&!this.minimap&&this.buildMinimap()}catPrice(e){return gn(this,e)}catPriceRange(e){return bn(this,e)}buildPriceFilter(){pl(this)}applyPriceBand(e){hl(this,e)}buildArenaChrome(){let e=this.controller.doc;if(this.rungsEl=null,this.projectionEl=null,this.floorsEl=null,!e||!this.els.map){this.syncArenaViewportInsets();return}let t=e.objects.some(n=>n.type==="section")||(e.floors??[]).some(n=>n.objects.some(o=>o.type==="section"));if(this.canOffer3d()){let n=document.createElement("div");n.className="sl-projection",n.setAttribute("role","group"),n.setAttribute("aria-label",this.tf("picker.venueView","Venue view")),n.innerHTML=`<button type="button" data-view="map" aria-pressed="true" title="${this.tf("picker.flat2dMap","Flat 2D map")}">${this.tf("picker.map","Map")}</button><button type="button" data-view="venue3d" aria-pressed="false" title="${this.tf("picker.interactive3dVenueView","Interactive 3D venue view")}">3D</button>`,n.querySelectorAll("button").forEach(o=>{if(o.dataset.view==="venue3d")for(let s of["pointerenter","focus","pointerdown"])o.addEventListener(s,Ci,{once:!0});o.addEventListener("click",()=>{this.setBuyerView(o.dataset.view)})}),this.regions["top-right"].appendChild(n),this.projectionEl=n,this.syncProjection()}if(t){let n=[...e.objects,...(e.floors??[]).flatMap(p=>p.objects)],o=new Set((e.zones??[]).map(p=>p.id)),a=e.floorOverview==="combined"&&(e.floors?.length??0)>1&&o.size===0||n.some(p=>p.type==="section"&&typeof p.zone=="string"&&o.has(p.zone))?["zones","sections","seats"]:["sections","seats"],l=document.createElement("div");l.className="sl-rungs on sl-mo-indicator",l.setAttribute("role","group"),l.setAttribute("aria-label",(0,H.t)("picker.zoomLevel"));let c={zones:(0,H.t)("picker.rungLabel.zones"),sections:(0,H.t)("picker.rungLabel.sections"),seats:(0,H.t)("picker.rungLabel.seats")},d={zones:(0,H.t)("picker.rungTip.zones"),sections:(0,H.t)("picker.rungTip.sections"),seats:(0,H.t)("picker.rungTip.seats")};l.innerHTML=a.map(p=>`<button type="button" data-rung="${p}" title="${d[p]}" aria-pressed="false">${c[p]}</button>`).join(""),l.querySelectorAll("button").forEach(p=>{p.addEventListener("click",()=>{let u=p.dataset.rung;this.controller.setRung(u),u==="seats"&&this.collapseSectionCard()})}),this.regions["top-center"].appendChild(l),this.rungsEl=l,this.syncRung()}if(this.controller.isMultiFloor()){let n=wr({floors:this.controller.getFloors(),tf:(o,s)=>this.tf(o,s),onChoose:o=>{o===""?this.controller.setFloorOverview(!0):this.controller.setFloor(o),this.showSectionCard(null),this.syncFloors(),this.syncRung(),this.minimap?.refreshMinimap()}});this.regions["top-left"].appendChild(n),this.floorsEl=n,this.syncFloors()}this.syncArenaViewportInsets()}syncArenaViewportInsets(){let e=this.els.map,t=e?vr(e.getBoundingClientRect(),[this.floorsEl,this.rungsEl,this.projectionEl].map(n=>n?.isConnected?n.getBoundingClientRect():null),[]):{top:0,right:0,bottom:0,left:0};Object.keys(t).every(n=>t[n]===this.arenaViewportInsets[n])||(this.arenaViewportInsets=t,this.controller.setViewportInsets(t),this.syncFitClearance())}syncFitClearance(){let e=this.els.map,t=this.els.zoom,n=this.root?.dataset.layout==="narrow",o=0;if(n&&e&&t?.isConnected){let s=e.getBoundingClientRect(),r=t.getBoundingClientRect();r.height>0&&(o=Math.max(0,s.bottom-r.top+8))}this.controller.setFitClearance?.(o)}syncRung(){let e=this.controller.getRung(),t=this.controller.seatsRevealed?.()??(e==="seats"||!!this.controller.getFocusedSection?.());this.root&&(this.root.dataset.zoomed=String(t)),this.syncMapStepBack(),this.minimap?.setAutoOpen(!1),this.rungsEl&&this.rungsEl.querySelectorAll("button").forEach(n=>{let o=n.dataset.rung===e;n.classList.toggle("on",o),n.setAttribute("aria-pressed",String(o))})}syncMapStepBack(){let e=this.els?.zout,t=this.els?.zfit,n=this.els?.zin;if(!e||!this.root)return;let o=this.controller.getRenderer?.(),s=this.controller.canZoomIn?.()===!1||o?.seatsPickable?.()===!0,r=yr({focusedSection:this.controller.getFocusedSection?.()??null,seatsRevealed:this.controller.seatsRevealed?.()??!0,atVenueFit:this.controller.atVenueFit?.()})==="none",a=e.disabled!==r||!!t&&t.disabled!==r||!!n&&n.disabled!==s||e.hidden||!!n?.hidden||!!t?.hidden;e.disabled=r,e.hidden=!1,n&&(n.disabled=s,n.hidden=!1),t&&(t.disabled=r,t.hidden=!1),a&&this.a11yMenu?.refit()}syncProjection(){this.els.pricesHint&&(this.els.pricesHint.textContent=this.buyerView==="venue3d"?this.tf("picker.priceHint3d","Colours in the venue are ticket types \u2014 choose one below to show just those seats."):this.tf("picker.priceHint","Colours on the map are ticket types \u2014 tap one below to show just those seats.")),this.projectionEl&&this.projectionEl.querySelectorAll("button").forEach(e=>{let t=e.dataset.view===this.buyerView;e.classList.toggle("on",t),e.setAttribute("aria-pressed",String(t))})}canOffer3d(){return this.opts.enable3D===!1||!this.controller.doc||!Ei()?!1:this.allSeats().length<=this.max3dSeats()}max3dSeats(){let e=this.opts.max3DSeats;if(typeof e=="number"&&e>0)return e;let t=globalThis.navigator;return(t?.hardwareConcurrency??8)<=4||(t?.deviceMemory??8)<=4||(globalThis.matchMedia?.("(pointer: coarse)").matches??!1)?Pl/2:Pl}syncFloors(){xr(this.floorsEl,this.controller.getActiveFloorId(),this.controller.isFloorOverview())}get sectionCard(){return this.sectionCardCache||(this.sectionCardCache=new ln({controller:this.controller,map:()=>this.els.map,root:()=>this.root,collapseSheet:()=>this.collapseSheet(),region:e=>this.regions[e],refreshMinimap:()=>this.minimap?.refreshMinimap(),activeFloorObjects:()=>this.activeFloorObjects(),sectionNeighbours:e=>this.sectionNeighbours(e),catPriceRange:e=>this.catPriceRange(e),money:e=>this.money(e),suppressPricing:()=>this.suppressPricing,priceBandKeys:()=>this.priceBandKeys})),this.sectionCardCache}showSectionCard(e){this.sectionCard.show(e)}renderSectionCard(e){this.sectionCard.render(e)}collapseSectionCard(){this.sectionCard.collapse()}sectionCardOnView(){this.sectionCard.onView()}sectionNeighbours(e){let t=this.activeFloorObjects().filter(o=>o.type==="section"&&!this.controller.isSectionClosed(o.id)&&this.controller.getSectionSeatCount(o.id)>0);if(t.length<2)return null;let n=t.findIndex(o=>o.id===e);return n<0?null:{previous:t[(n-1+t.length)%t.length],next:t[(n+1)%t.length]}}markedSeatAnnouncement(e){let t=to(this.controller.getRenderer()?.getSeatMark?.(e.id),this.performanceGroup?.nights?.());return Hr(t,e.displayLabel??e.label,this.opts.locale)}announceSeat(e){if(!this.srEl)return;if(!e){this.srEl.textContent="";return}let t=this.markedSeatAnnouncement(e);if(t){this.srEl.textContent=t;return}let n=this.controller.doc?.categories.find(h=>h.key===e.categoryKey),o=this.controller.getStatus(e.id)??"free",s=o==="free"?this.tf("picker.statusAvailable","available"):o==="held"?this.tf("picker.statusOnHold","on hold"):this.tf("picker.statusTaken2","taken"),r=n?this.catPriceRange(n):void 0,a=!this.suppressPricing&&r?r.min===r.max?this.money(r.min):`${this.money(r.min)}\u2013${this.money(r.max)}`:void 0,l=this.controller.tableSelection(e.id),c=l??this.controller.seatDetails(e.id),d=rt(c),p=c?.rowLabel??c?.displayLabel??e.displayLabel??e.label,u=l?`${d} ${p}, ${l.bookingMode==="variable"?(0,H.t)("picker.minToMaxGuests",{min:l.minOccupancy,max:l.maxOccupancy}):(0,H.t)("picker.capacityGuests",{count:l.capacity})}`:c?.objectType==="booth"?`${d} ${p}`:c?.objectType==="table"?`${d} ${p}, ${(0,H.t)("picker.seatNumberLower",{label:c.seatNumber??e.label})}`:(0,H.t)("picker.seatLabel",{label:c?.displayLabel??e.displayLabel??e.label});this.srEl.textContent=`${u}, ${n?.label??e.categoryKey}${a?`, ${a}`:""}, ${s}`}showTableDialog(e,t,n){this.dismissTableDialog(!1),this.tableDialog={...e},this.tableDialogHeld=t,this.tableDialogReturnFocus=n??document.activeElement;let o=this.controller.doc?.categories.find(a=>a.key===e.categoryKey),s=e.bookingMode==="variable",r=document.createElement("div");r.className="sl-table-scrim",r.innerHTML=ls(e,{variable:s,held:t,typeWord:rt(e),categoryLabel:o?.label??e.categoryKey,suppressPricing:this.suppressPricing,unitPrice:this.money(this.paidPrice(e.categoryKey,e.tierId??null,e.price,e.label))}),this.root.appendChild(r),this.tableDialogEl=r,this.renderTableDialogState(),r.querySelectorAll("[data-table-step]").forEach(a=>{a.addEventListener("click",()=>{if(!this.tableDialog)return;let l=Math.max(this.tableDialog.minOccupancy,Math.min(this.tableDialog.maxOccupancy,this.tableDialog.quantity+Number(a.dataset.tableStep)));this.tableDialog={...this.tableDialog,quantity:l},this.renderTableDialogState()})}),r.querySelector(".sl-table-cancel").addEventListener("click",()=>this.cancelTableDialog()),r.querySelector(".sl-table-confirm").addEventListener("click",()=>{this.confirmTableDialog()}),r.addEventListener("mousedown",a=>{a.target===r&&this.cancelTableDialog()}),r.addEventListener("keydown",a=>{if(a.key!=="Tab")return;let l=[...r.querySelectorAll('button:not(:disabled),[tabindex]:not([tabindex="-1"])')];if(!l.length)return;let c=l[0],d=l[l.length-1];a.shiftKey&&document.activeElement===c?(a.preventDefault(),d.focus()):!a.shiftKey&&document.activeElement===d&&(a.preventDefault(),c.focus())}),requestAnimationFrame(()=>r.querySelector(s?'[data-table-step="-1"]':".sl-table-confirm")?.focus())}renderTableDialogState(){let e=this.tableDialog,t=this.tableDialogEl;if(!e||!t)return;let n=t.querySelector("output[data-table-qty]");n&&(n.value=String(e.quantity));let o=t.querySelector("input[data-table-qty]");o&&(o.value=String(e.quantity)),t.querySelectorAll("[data-table-step]").forEach(a=>{let l=Number(a.dataset.tableStep);a.disabled=l<0?e.quantity<=e.minOccupancy:e.quantity>=e.maxOccupancy});let s=this.paidPrice(e.categoryKey,e.tierId??null,e.price,e.label),r=t.querySelector("[data-table-total]");r&&(r.textContent=this.money(s*e.quantity))}async confirmTableDialog(){let e=this.tableDialog,t=this.tableDialogHeld;if(!e)return;let n=this.tableDialogEl?.querySelector(".sl-table-confirm");if(n&&(n.disabled=!0,n.textContent=t?this.tf("picker.updatingEllipsis","Updating\u2026"):this.tf("picker.selectingEllipsis","Selecting\u2026")),t){try{let o=await this.controller.replaceTableQuantity(e.label,e.quantity,this.opts.holdTtlMs);if(!o){this.toast(this.tf("picker.guestCountCouldNotBeSecured","That guest count could not be secured. Your current table hold is unchanged."),"warning"),this.renderTableDialogState(),n&&(n.disabled=!1,n.textContent=this.tf("picker.updateTable","Update table"));return}this.hold={holdId:o.holdId,expiresAt:o.expiresAt,seats:o.seats,items:o.items},this.startHoldTimer(o.expiresAt),this.dismissTableDialog(),this.syncTray(),this.emitHoldChange(),this.toast((0,H.t)("picker.tableUpdatedForGuests",{label:e.label,count:e.quantity}),"success")}catch(o){this.opts.onError?.(o),this.toast(this.tf("picker.guestCountNoLongerAvailable","That guest count is no longer available. Your current hold is unchanged."),"error"),n&&(n.disabled=!1,n.textContent=this.tf("picker.updateTable","Update table"))}return}if(!this.controller.setTableQuantity(e.label,e.quantity)){n&&(n.disabled=!1,n.textContent=e.bookingMode==="variable"?this.tf("picker.selectTable","Select table"):this.tf("picker.selectWholeTable","Select whole table"));return}this.dismissTableDialog(),this.collapseSectionCard(),this.syncTray()}cancelTableDialog(){let e=this.tableDialog,t=this.tableDialogHeld;this.dismissTableDialog(),e&&!t&&this.controller.deselect(e.physicalSeatIds)}dismissTableDialog(e=!0){let t=this.tableDialogReturnFocus;this.tableDialogEl?.remove(),this.tableDialogEl=null,this.tableDialog=null,this.tableDialogHeld=!1,this.tableDialogReturnFocus=null,e&&requestAnimationFrame(()=>(t?.isConnected?t:this.root)?.focus())}get confirmCard(){return this.confirmCardCache||(this.confirmCardCache=new hn({controller:this.controller,root:()=>this.root,els:()=>this.els,regions:()=>this.regions,hideTooltip:()=>{this.tipEl&&(this.tipEl.style.display="none")},tf:(e,t)=>this.tf(e,t),money:e=>this.money(e),paidPrice:(e,t,n,o)=>this.paidPrice(e,t,n,o),suppressPricing:()=>this.suppressPricing,reducedMotion:()=>this.reducedMotion(),scheduleMotion:(e,t)=>this.scheduleMotion(e,t),canOffer3d:()=>this.canOffer3d(),buyerView:()=>this.buyerView,view3dHandle:()=>this.view3dHandle,view3dCompareSeatIds:()=>this.view3dCompareSeatIds,rememberView3dReturnSeat:e=>{this.view3dReturnSeat=e},enter3d:e=>{this.enter3d(e)},performanceGroup:()=>this.performanceGroup,seatViewEnabled:()=>this.seatViewEnabled(),openSeatView:e=>{this.openSeatView(e)},openSeatConfidencePassport:(e,t)=>this.openSeatConfidencePassport(e,t),saveView3dComparisonSeat:e=>this.saveView3dComparisonSeat(e),resolveAssetUrl:e=>this.buyerAssetUrls.resolve(e),onError:e=>this.opts.onError?.(e),liftToastOverConfirm:()=>this.liftToastOverConfirm(),fitTranslatedRows:()=>this.fitTranslatedRows(),syncTray:()=>this.syncTray(),syncSelectionTo3d:()=>this.syncSelectionTo3d(),collapseSectionCard:()=>this.collapseSectionCard(),applyPanelCollapsed:()=>this.applyPanelCollapsed(),dismiss:()=>this.dismissConfirm(),releaseHeldSeat:e=>this.controller.currentHold()?.labels.includes(e.label)?this.removeHeldLabels([e.label]):null,reanchor:()=>this.reanchorConfirm(),inviteCommit:(e,t)=>this.inviteCommit(e,t),addSeatLabel:e=>this.addSeatLabel(e),cartLanded:()=>this.cartLanded()})),this.confirmCardCache}showConfirm(e,t="add"){this.confirmCard.show(e,t)}reanchorConfirm(){this.confirmCard.reanchor()}dismissConfirm(){this.confirmCard.dismiss()}cartLanded(){this.animateOnce(this.els.count,"sl-value-pop",380),this.animateOnce(this.els.total,"sl-value-pop",380)}async commitConfirm(){await this.confirmCard.commit()}cancelConfirm(){this.confirmCard.cancel()}closeConfirm(){this.dismissConfirm()}inviteCommit(e,t){Yr(e,t,this.reducedMotion())}addSeatLabel(e){return Xr(e,(t,n)=>this.tf(t,n))}seatViewEnabled(){return this.opts.seatView!==!1}allSeats(){return this.allSeatsCache||(this.allSeatsCache=[...this.controller.getExpandedSeats()]),this.allSeatsCache}async openSeatView(e){if(!this.root||!this.seatViewEnabled())return;let t=++this.seatViewGen,n=this.controller.doc,o=this.controller.getActiveFloorId(),s=e.focalPoint??n?.floors?.find(p=>p.id===o)?.focalPoint??n?.focalPoint??{x:0,y:0},r,a,l=!1;if(e.viewUrl){let p,u=null;try{let y=e.viewMeta?.previewUrl;y&&y!==e.viewUrl?(u=await this.buyerAssetUrls.resolve(y),p=e.viewUrl):p=await this.buyerAssetUrls.resolve(e.viewUrl)}catch(y){t===this.seatViewGen&&this.opts.onError?.(y);return}if(t!==this.seatViewGen||!p||e.viewMeta?.previewUrl&&e.viewMeta.previewUrl!==e.viewUrl&&!u||!this.root||!this.seatViewEnabled())return;let h={url:p,...u?{previewUrl:u}:{},...e.viewMeta?.sourceWidth!==void 0?{sourceWidth:e.viewMeta.sourceWidth}:{},...e.viewMeta?.sourceHeight!==void 0?{sourceHeight:e.viewMeta.sourceHeight}:{},...e.viewMeta?.previewWidth!==void 0?{previewWidth:e.viewMeta.previewWidth}:{},...e.viewMeta?.previewHeight!==void 0?{previewHeight:e.viewMeta.previewHeight}:{},...e.viewMeta?.variants?.length?{variants:e.viewMeta.variants}:{},...e.viewMeta?.coverage?{coverage:e.viewMeta.coverage}:{},...e.viewMeta?.capturedAt?{capturedAt:e.viewMeta.capturedAt}:{},...e.viewMeta?.sourceLabel?{sourceLabel:e.viewMeta.sourceLabel}:{}};r=h,a=(0,Tn.seatViewDisclosure)(h),l=(0,Tn.isAuthoredSeatView)(h)}else{let p;try{let{generateSeatPanorama:u}=await Ai();p=u(e,s,this.allSeats())}catch(u){t===this.seatViewGen&&this.opts.onError?.(u);return}if(t!==this.seatViewGen||!this.root||!this.seatViewEnabled())return;r={url:p.url,generated:!0},a=(0,H.t)("picker.illustrationCaption",{m:p.distanceM})}this.closeSeatView(!1);let c=(0,H.t)("picker.viewFromSeat",{label:e.label}),d=qi({root:this.root,source:r,caption:a,real:l,closeLabel:this.tf("picker.close","Close"),dragHint:et(),viewFromSeatLabel:c,real360Label:(0,H.t)("picker.real360"),previewLabel:(0,H.t)("picker.preview"),resolveAsset:p=>this.buyerAssetUrls.resolve(p),onClose:()=>this.closeSeatView()});this.viewEl=d.element,this.viewCleanup=()=>d.dispose()}closeSeatView(e=!0){e&&(this.seatViewGen+=1),this.viewCleanup?.(),this.viewCleanup=null,this.viewEl?.remove(),this.viewEl=null}money(e){let t=this.opts.pricing?.formatter;if(t)return t(e,this.currency);let n=Number.isInteger(e);return(0,H.formatMoney)(e,this.currency,{locale:this.opts.locale,fallback:(o,s)=>`${o} ${s}`,...n?{minimumFractionDigits:0,maximumFractionDigits:0}:{}})}scheduleOfferBoundary(e){if(this.offerBoundaryTimer&&clearTimeout(this.offerBoundaryTimer),this.offerBoundaryTimer=null,!this.api.availability||this.destroyed)return;let t=Date.now(),n=br(e,t);if(n==null)return;let o=6*36e5,s=Math.min(Math.max(n-t+1e3,1e3),o);this.offerBoundaryTimer=setTimeout(()=>{this.offerBoundaryTimer=null,!document.hidden&&this.refreshOfferAvailability(!1)},s)}offerReadIsCurrent(){return!!this.offerReadInFlight||Date.now()-this.offerReadSettledAt<_p}scheduleOfferRefresh(e){!this.api.availability||this.destroyed||this.offerReadIsCurrent()||(this.offerRefreshTimer&&clearTimeout(this.offerRefreshTimer),this.offerRefreshTimer=setTimeout(()=>{this.offerRefreshTimer=null,this.refreshOfferAvailability(e)},e?180:0))}refreshOfferAvailability(e){if(!this.api.availability||this.destroyed)return Promise.resolve();if(this.offerReadInFlight)return this.offerReadInFlight;if(this.offerReadIsCurrent())return Promise.resolve();let t=this.readOfferAvailability(e).finally(()=>{this.offerReadInFlight===t&&(this.offerReadInFlight=null)});return this.offerReadInFlight=t,t}async readOfferAvailability(e){if(!(!this.api.availability||this.destroyed))try{let t=await this.api.availability(this.opts.event,e);if(this.destroyed)return;this.offerReadSettledAt=Date.now();let n=rn(t);if(!n)return;this.offerAvailability=n,this.applyChannelPricing(n.channelPricing),this.scheduleOfferBoundary(n);let o=an(n),s={...this.hostPricing?.prices??{},...o},r=Object.keys(s).length>0||this.hostPricing?.formatter?{prices:s,...this.hostPricing?.formatter?{formatter:this.hostPricing.formatter}:{}}:void 0;this.setPricing(r),this.syncOffer(),this.opts.onOfferAvailabilityChange?.(n)}catch{!this.destroyed&&!this.offerBoundaryTimer&&!document.hidden&&(this.offerBoundaryTimer=setTimeout(()=>{this.offerBoundaryTimer=null,!document.hidden&&this.refreshOfferAvailability(!1)},3e4))}}offerPrice(e){return e?this.offerAvailability?.prices.find(t=>t.categoryKey===e)??null:null}applyChannelPricing(e){this.channelByObject.clear(),this.pricesByChannel.clear();for(let t of e?.channels??[])this.pricesByChannel.set(t.channelId,t.priceOverrides);for(let t of e?.objects??[])this.pricesByChannel.has(t.channelId)&&this.channelByObject.set(t.label,t.channelId)}syncOffer(){let e=this.els.offer;if(!e)return;if(this.suppressPricing){e.classList.remove("has"),e.replaceChildren();return}let t=this.offerAvailability,n=t?.release??null,o=n?null:t?.upcoming??null;if(!t||t.state==="closed"||t.state==="sold-out"||!n&&!o){e.classList.remove("has"),e.replaceChildren();return}let s=n??o,r=document.createElement("div");r.className="sl-offer-main";let a=document.createElement("div");a.className="sl-offer-copy";let l=document.createElement("span");l.className="sl-offer-kicker",l.textContent=n?this.tf("picker.currentTicketOffer","Current ticket offer"):this.tf("picker.upcomingTicketOffer","Upcoming ticket offer");let c=document.createElement("strong");c.className="sl-offer-name",c.textContent=s.name||(n?this.tf("picker.currentOffer","Current offer"):this.tf("picker.scheduledOffer","Scheduled offer"));let d=document.createElement("span");d.className="sl-offer-line";let p=[];n&&t.fromPrice!=null&&p.push(this.money(t.fromPrice/100)),n&&s.remaining!=null&&p.push((0,H.t)("picker.offerRemainingAvailable",{count:s.remaining})),n&&s.endsAt!=null&&p.push((0,H.t)("picker.offerUntil",{time:Li(s.endsAt,this.eventTimezone,this.opts.locale)})),o?.startsAt!=null&&p.push((0,H.t)("picker.offerStarts",{time:Li(o.startsAt,this.eventTimezone,this.opts.locale)})),d.textContent=p.join(" \xB7 "),a.append(l,c,d);let u=document.createElement("details");u.className="sl-offer-info";let h=document.createElement("summary");h.setAttribute("aria-label",(0,H.t)("picker.howOfferWorks",{name:c.textContent??""})),h.textContent="i";let y=document.createElement("div");y.className="sl-offer-detail",y.textContent=n?this.tf("picker.offerDetailActive","This price applies automatically to eligible seats. Tickets in active carts temporarily reduce the available quantity; released or expired holds return it. When the offer ends, the next matching offer or normal ticket price takes over."):this.tf("picker.offerDetailUpcoming","Tickets are available at their normal price now. This scheduled offer will apply automatically to eligible seats when it starts."),u.append(h,y),r.append(a,u),e.replaceChildren(r),e.classList.add("has")}paidPrice(e,t,n,o){let s=o?this.channelByObject.get(o):void 0;if(s&&e){let a=this.pricesByChannel.get(s)?.find(l=>l.categoryKey===e&&l.tierId===(t??null));if(a)return a.price}let r=e?this.opts.pricing?.prices?.[e]:void 0;return r===void 0?n:typeof r=="number"?r:t&&r.tiers?.[t]!==void 0?r.tiers[t]:r.base??n}legendDeps(){return ul(this)}syncPriceRail(e,t,n=this.legendDeps()){ml(this,e,t,n)}syncPrices(){fl(this)}focusCategory(e){gl(this,e)}evictTakenSelections(){let e=new Set([...this.controller.currentHold()?.labels??[],...this.holdingLabels]),t=this.controller.getSelection().filter(n=>!e.has(n.label)&&(this.controller.getStatus(n.id)??"free")!=="free");t.length&&(this.controller.deselect(t.map(n=>n.id)),this.toast((0,H.t)("picker.seatJustTakenByAnother",{label:t[0].label}),"error"))}syncTray(){if(!this.els.tray)return;this.updateSelectionCapacity();let{seats:e,gaAreas:t,heldItems:n,heldLabels:o,total:s,count:r}=fn(this),a=[],l=new Set;if(!this.salesClosed){let g=this.performanceGroup?.nightSummary?.()??[];g.length&&a.push(Er(g,{title:this.tf("picker.group.yourSeatsByNight","Your seats by night"),empty:this.tf("picker.group.noSeatsChosenYet","No seats yet")}));let L=this.performanceGroup?.selectionModeSwitch;L&&a.push(`<button type="button" class="sl-pg-switch" data-pg-switch-mode>${B(L.label)}</button>`)}let c={salesClosed:this.salesClosed,hasPicks:e.length>0||n.length>0,hasGaAreas:t.length>0,groupMode:this.performanceGroup?this.performanceGroup.selectionMode??"same_seat":null,seated:!!this.controller.doc?.objects?.some(g=>g.type!=="gaArea"),venue3d:this.buyerView==="venue3d",whenText:this.eventWhenText?String(this.eventWhenText):void 0};a.push(Da(c)),this.els.trayHint&&(this.els.trayHint.textContent=Ba(c)),this.els.seatsInfo&&(this.els.seatsInfo.hidden=this.salesClosed);let d=!e.length&&!n.length&&!je(this.gaQty,this.hold?.items??[]);if(!this.performanceGroup&&!this.salesClosed&&!this.hold&&(d||this.bestAvailableBusy||this.bestAvailableConfirm)){let g=(this.controller.doc?.categories??[]).filter(N=>!N.notForSale),L=this.controller.getBestAvailableZones();this.baZone&&!L.some(N=>N.id===this.baZone)&&(this.baZone=""),a.push(Na({confirming:this.bestAvailableConfirm,busy:this.bestAvailableBusy,reopened:!1,quantity:this.baQty,premium:this.baPremium,offerPremium:this.controller.hasPremiumSeats(),categories:g,zones:L,selectedCategory:this.baCat,selectedZone:this.baZone}))}let p=(g,L,N,R=1,O,C,_)=>Oa({categoryLabel:_,d:g?this.controller.seatDetails(g):null,area:N==="ga"?t.find(U=>U.id===O):void 0,label:L,objectType:N,quantity:R,identity:C,performanceLabel:this.performanceGroup?.activePerformanceLabel?.(),performanceDates:this.performanceGroup?.selectedPerformanceDates?.()}),u=B,h=[];for(let g of Hs(n)){let L=g.objectType==="ga"?`held:ga:${g.objectId}:${g.tierId??""}`:`held:${g.label}`;l.add(L);let N=this.controller.doc?.categories.find(X=>X.key===g.categoryKey),R=g.tierId?N?.tiers?.find(X=>X.id===g.tierId)?.name:void 0,O=g.objectType!=="ga"?this.controller.seatByLabel(g.label):null,C=g.objectType==="table"?this.controller.tableSelection(g.label):null,_=O?this.controller.seatDetails(O.id):null,U=this.seatViewEnabled()&&!!O&&g.objectType!=="table"&&!!this.deliverableViewReference(O),G=u(this.tf("picker.heldForYou","Held for you")),de=C?.bookingMode==="variable"?`<button type="button" class="sl-table-edit" data-table-edit="${u(encodeURIComponent(g.label))}">${u((0,H.t)("picker.guestsCountEdit",{count:g.quantity??1}))}</button>`:"",ge=this.paidPrice(g.categoryKey,g.tierId,g.unitPrice,g.label)*(g.quantity??1);h.push({key:L,fresh:!this.lastTrayKeys.has(L),held:!0,seatIds:[],heldLabels:g.labels,removeAria:(0,H.t)("picker.removeHeldTicketLabel",{label:$n(g,t)}),locateId:O?.id??null,section:_?.sectionLabel??"",rowLabel:_&&Q(_)||"",seatLabel:_?.seatNumber??g.label,categoryLabel:`${N?.label??g.categoryKey}${R?` \xB7 ${R}`:""}`,categoryColor:this.controller.getRenderer?.()?.categoryDisplayColor?.(g.categoryKey)??N?.color??"",identityHtml:p(O?.id??null,g.label,g.objectType,g.quantity??1,g.objectId,C??void 0,`${N?.label??g.categoryKey}${R?` \xB7 ${R}`:""}`),stateHtml:`<span class="sl-ticket-state held" aria-label="${G}" title="${G}"><svg viewBox="0 0 24 24"><rect x="5" y="10" width="14" height="10" rx="2"/><path d="M8 10V7a4 4 0 0 1 8 0v3"/></svg></span>`,extrasHtml:de,amount:ge,amountText:this.suppressPricing?"":this.money(ge),noteHtml:tt(O??void 0),railHtml:this.performanceGroup?"":ho((0,H.t)("picker.removeHeldTicketLabel",{label:$n(g,t)}),U?g.label:null)})}let y=this.seatViewEnabled();for(let g of e.filter(L=>!o.has(L.label))){let L=`seat:${g.id}`;l.add(L);let N=this.controller.doc?.categories.find(X=>X.key===g.categoryKey),R=g.tiers&&g.tiers.length&&!this.suppressPricing?`<select class="tier" data-tier="${u(g.id)}" aria-label="${u((0,H.t)("picker.ticketTierFor",{label:g.label}))}">`+g.tiers.map(X=>`<option value="${u(X.id)}"${X.id===g.tierId?" selected":""}>${u(X.name)} \xB7 ${u(this.money(this.paidPrice(g.categoryKey,X.id,X.price,g.label)))}</option>`).join("")+"</select>":"",O=g.tiers?.find(X=>X.id===g.tierId)??g.tiers?.[0],C=O?.buyerMessage?.trim()||(O?.restriction==="companion"?this.tf("picker.companionRequiresWheelchair","Requires the adjacent wheelchair place"):""),_=this.controller.seatDetails(g.id),U=u(this.tf("picker.selected","Selected")),G=(0,H.t)("picker.removeSeatLabel",{label:g.label}),de=(g.objectType==="table"&&g.bookingMode==="variable"?`<button type="button" class="sl-table-edit" data-table-edit="${u(encodeURIComponent(g.label))}">${u((0,H.t)("picker.guestsCountEdit",{count:g.quantity??1}))}</button>`:"")+R,ge=this.paidPrice(g.categoryKey,g.tierId??null,g.price,g.label)*(g.quantity??1);h.push({key:L,fresh:!this.lastTrayKeys.has(L),held:!1,seatIds:[g.id],heldLabels:[],locateId:g.id,section:_?.sectionLabel??"",rowLabel:_&&Q(_)||"",seatLabel:_?.seatNumber??g.label,categoryLabel:N?.label??g.categoryKey,identityHtml:p(g.id,g.label,g.objectType,g.quantity??1,g.objectId,g,N?.label??g.categoryKey),categoryColor:this.controller.getRenderer?.()?.categoryDisplayColor?.(g.categoryKey)??N?.color??"",stateHtml:`<span class="sl-ticket-state" aria-label="${U}" title="${U}"><svg viewBox="0 0 24 24"><path d="M5 12l4 4L19 6"/></svg></span>`,extrasHtml:de,amount:ge,amountText:this.suppressPricing?"":this.money(ge),removeAria:G,noteHtml:tt(g)+(C?`<small class="sl-tier-note">${u(C)}</small>`:""),railHtml:ho(G,y&&g.objectType!=="table"&&this.deliverableViewReference(this.controller.seatByLabel(g.label)??{})?g.label:null)})}h.length&&a.push(h.map(_a).join("")),t.length&&a.push(Ns(this,t,n)),this.els.tray.innerHTML=a.join("")+(this.salesClosed?"":this.lapse.noteHtml()),this.lastTrayKeys=l,this.lapse.wire(this.els.tray),this.els.tray.querySelector("[data-pg-switch-mode]")?.addEventListener("click",()=>this.performanceGroup?.selectionModeSwitch?.activate());let f=this.performanceGroup?.selectNight;f&&Nr(this.els.tray,g=>f(g)),this.els.tray.querySelectorAll("[data-ba]").forEach(g=>{g.addEventListener("click",()=>{this.baQty=Math.max(1,Math.min(this.maxTickets,this.baQty+Number(g.dataset.ba))),this.syncTray()})}),this.els.tray.querySelector("[data-ba-cat]")?.addEventListener("change",g=>{this.baCat=g.target.value}),this.els.tray.querySelector("[data-ba-zone]")?.addEventListener("change",g=>{this.baZone=g.target.value}),this.els.tray.querySelector("[data-ba-premium]")?.addEventListener("click",()=>{this.baPremium=!this.baPremium,this.syncTray()}),this.els.tray.querySelector(".sl-ba-go")?.addEventListener("click",()=>{if(this.pendingSelectionCount()>0){this.bestAvailableConfirm=!0,this.syncTray(),this.els.tray.querySelector("[data-ba-replace]")?.focus();return}this.bestAvailable(this.baQty,this.baCat||void 0,{preferPremium:this.baPremium,zoneId:this.baZone||void 0})}),this.els.tray.querySelector("[data-ba-cancel]")?.addEventListener("click",()=>{this.bestAvailableConfirm=!1,this.syncTray(),this.els.tray.querySelector(".sl-ba-go")?.focus()}),this.els.tray.querySelector("[data-ba-replace]")?.addEventListener("click",()=>{this.bestAvailableConfirm=!1,this.bestAvailable(this.baQty,this.baCat||void 0,{preferPremium:this.baPremium,zoneId:this.baZone||void 0})}),this.els.tray.querySelectorAll(".sl-chip .rm").forEach(g=>{g.addEventListener("click",()=>{let L=g.closest(".sl-chip");if(L.dataset.held){this.removeHeldLabels(decodeURIComponent(L.dataset.held).split(`
3247
+ `),L);return}let N=L.dataset.seat.split(" "),R=()=>{this.controller.deselect(N)};if(this.reducedMotion()){R();return}L.classList.remove("sl-enter"),L.classList.add("sl-leave","sl-mo-collapse"),this.scheduleMotion(R,ee.collapse)})}),this.els.tray.querySelectorAll("[data-table-edit]").forEach(g=>{g.addEventListener("click",L=>{L.stopPropagation();let N=decodeURIComponent(g.dataset.tableEdit??""),R=this.controller.tableSelection(N);if(!R)return;let O=n.find(C=>C.label===N&&C.objectType==="table");this.showTableDialog({...R,quantity:O?.quantity??R.quantity},!!O,g)})}),this.els.tray.querySelectorAll(".sl-chip .tier").forEach(g=>{g.addEventListener("change",()=>this.controller.setSeatTier(g.dataset.tier,g.value||null))}),this.els.tray.querySelectorAll(".sl-chip .view[data-view-label]").forEach(g=>{g.addEventListener("click",()=>{let L=this.controller.seatByLabel(g.dataset.viewLabel);L&&this.openSeatView(L)})}),this.els.tray.querySelectorAll(".sl-chip[data-locate]").forEach(g=>{let L=()=>this.controller.flashSeat(g.dataset.locate,this.cssVar("--sl-accent")||"#f4b740");g.addEventListener("mouseenter",L),g.addEventListener("focusin",L),g.addEventListener("click",N=>{N.target.closest?.('button,a,select,[role="button"],input')||!this.controller.focusSeats?.([g.dataset.locate],{animate:!this.reducedMotion()})||L()})}),Ds(this,this.els.tray,t),this.controller.setGASelection(Ps(this.gaQty)),this.salesClosed&&this.els.tray.querySelectorAll(".sl-ba-go,[data-ba],[data-ba-cat],[data-ba-zone],[data-ba-replace],.sl-ga button").forEach(g=>{g.disabled=!0});let T=this.pendingSelectionCount(),w=this.lastTrayCount,v=this.lastTrayTotal,A=_r(this.performanceGroup?.groupSelectionSummary?.(),this.performanceGroup?.selectionMode??"same_seat");this.els.count.textContent=A||(r?(0,H.tCount)("picker.ticketsCount",r):this.tf("picker.noSeatsSelected","No seats selected")),this.els.total.textContent=r&&!this.suppressPricing?this.money(s):"",this.root?.setAttribute("data-has-selection",String(r>0)),this.sheetState()==="mini"&&r===0?this.setSheetState("mini"):r>w&&this.root?.dataset.layout==="narrow"?this.setSheetState("mini"):this.syncSheetAffordance(),this.root?.setAttribute("data-ba-active",String(this.bestAvailableConfirm||this.bestAvailableBusy)),this.els.seatSummary&&(this.els.seatSummary.textContent=A||(r?(0,H.tCount)("picker.seatsSelectedCount",r):"")),this.syncCta(r,T);let K=this.root?.dataset.layout==="narrow"&&this.root?.dataset.confirming==="true";r!==w&&!K&&this.animateOnce(this.els.count,"sl-value-pop",380),s!==v&&!K&&this.animateOnce(this.els.total,"sl-value-pop",380),w===0&&r>0&&(this.animateOnce(this.els.cta,"sl-ready",520),this.sideCollapsed&&this.root?.dataset.layout!=="narrow"&&this.setPanelCollapsed(!1)),this.lastTrayCount=r,this.lastTrayTotal=s,this.opts.onSelectionChange?.(e),this.emitSelectionValidity(r,e),this.scheduleFit()}scheduleFit(){if(this.fitScheduled||this.destroyed)return;this.fitScheduled=!0;let e=()=>{this.fitScheduled=!1,this.destroyed||this.fitTranslatedRows()};typeof requestAnimationFrame=="function"?requestAnimationFrame(e):e()}fitTranslatedRows(){pr(this.confirmEl?.querySelector(".sl-confirm-row")),this.els.tray?.querySelectorAll(".sl-chip-pos").forEach(hr),this.els.tray?.querySelectorAll(".sl-ba-go").forEach(ur)}emitSelectionValidity(e,t){let n=this.controller.getSelectionValidity(e);n&&(n.seats=t,this.opts.onSelectionValidityChange?.(n),n.isValid?this.lastSelectionValidity!==!0&&this.opts.onSelectionValid?.(t):this.lastSelectionValidity!==!1&&this.opts.onSelectionInvalid?.(n),this.lastSelectionValidity=n.isValid)}async removeHeldLabels(e,t){let n=e.filter(r=>r&&!this.releasingLabels.has(r));if(!n.length)return!1;let o=n[0];n.forEach(r=>this.releasingLabels.add(r)),t?.setAttribute("aria-busy","true");let s=t?.querySelector(".rm");s&&(s.disabled=!0);try{let r=this.handedOff;if(!await this.controller.releaseLabels(n))return this.toast((0,H.t)("picker.couldNotRemoveLabel",{label:o}),"error"),!1;Rs(this.gaQty,this.hold?.items??[],n);let l=this.controller.currentHold();return this.hold=l?{holdId:l.holdId,expiresAt:l.expiresAt,seats:l.seats,items:l.items}:null,this.handedOff=!!this.hold&&r,this.bookedShown=!1,this.ctaPhase="idle",this.hold?this.startHoldTimer(this.hold.expiresAt):(this.stopHoldTimer(),this.forgetHold()),this.syncTray(),this.emitHoldChange(),!0}finally{n.forEach(r=>this.releasingLabels.delete(r)),t?.removeAttribute("aria-busy"),s?.isConnected&&(s.disabled=!1)}}async handleCta(){if(this.salesClosed)return;let e=this.controller.getSelectionValidity(this.totalTicketCount());if(e&&!e.isValid){this.toast(vn(e,(n,o)=>this.tf(n,o)),"warning");return}if(this.totalTicketCount()>this.maxTickets){this.toast((0,H.t)("picker.removeTicketsUntilOrFewer",{count:this.maxTickets}),"warning");return}let t=this.committedSelection();if(this.hold&&!t.some(n=>!(this.hold.items??[]).some(o=>o.label===n.label))){let n=this.hold.seats??t;this.handedOff=!0,this.holdConflicted=!1,await this.runCheckoutHandoff(this.hold,n);return}this.holdingLabels=new Set(t.map(n=>n.label)),this.setCtaPhase("holding");try{let n=null,o=As(this.gaQty),s=this.committedSelection();if(s.length){let r=await this.controller.hold(void 0,this.opts.holdTtlMs);n=r?{holdId:r.holdId,expiresAt:r.expiresAt,seats:r.seats,items:r.items}:null}for(let{areaId:r,tierId:a,qty:l}of o){let c=await this.controller.holdGA(r,l,{tierId:a,ttlMs:this.opts.holdTtlMs});n=c?{holdId:c.holdId,expiresAt:c.expiresAt,seats:c.seats,items:c.items}:n}if(!n){this.raiseHoldConflict(this.tf("picker.seatsJustTaken","One or more seats were just taken. Please pick again.")),this.setCtaPhase("idle"),this.syncTray();return}this.hold=n,this.holdConflicted=!1,this.handedOff=!this.performanceGroup,this.startHoldTimer(n.expiresAt),this.flashHeldSeats(n),this.emitHoldChange(),this.performanceGroup?this.setCtaPhase("idle"):await this.runCheckoutHandoff(n,n.seats??s)}catch(n){this.opts.onError?.(n);let o=n,s=(o.conflicts??[]).map(a=>a.label).filter(Boolean).slice(0,3);o.reason==="event_closed"&&this.setSalesClosed(!0);let r=o.reason==="event_closed"?this.tf("picker.seatSalesClosedForEvent","Seat sales have closed for this event."):o.reason==="companion_pair_required"?this.tf("picker.companionPairRequired","Select the adjacent wheelchair place with each companion ticket."):o.reason==="ticket_option_not_applicable"?this.tf("picker.ticketOptionNotApplicable","That ticket choice is not available for the selected seat."):s.length?s.length===1?(0,H.t)("picker.labelsNoLongerAvailable.one",{labels:s.join(", ")}):(0,H.t)("picker.labelsNoLongerAvailable.other",{labels:s.join(", ")}):this.tf("picker.seatsJustTaken","One or more seats were just taken. Please pick again.");this.raiseHoldConflict(r),this.setCtaPhase("idle")}finally{this.holdingLabels.clear(),this.ctaPhase==="holding"&&(this.ctaPhase="idle"),this.syncTray()}}startHoldTimer(e){il(this,e)}stopHoldTimer(){nl(this)}setExtendPrompt(e,t){ol(this,e,t)}refreshExtendPrompt(){sl(this)}handleExtend(){return rl(this)}detectBooked(){this.bookedShown||!this.handedOff||!this.hold||this.controller.currentHold()===null&&(this.holdConflicted||this.showBooked())}raiseHoldConflict(e){this.holdConflicted=!0,this.bookedShown&&(this.bookedShown=!1,this.bookedEl?.classList.remove("on")),this.toast(e,"error")}showBooked(){if(this.bookedShown||!this.hold||this.holdConflicted)return;this.bookedShown=!0;let e=this.buildHandoff(this.hold);this.stopHoldTimer(),this.forgetHold();let t=e.lineItems.reduce((o,s)=>o+s.quantity,0),n=this.performanceGroup?.groupSelectionSummary?.();this.els.bookedSub&&(this.els.bookedSub.innerHTML=n?.seats?`<span class="sl-booked-seats">${(0,H.tCount)("picker.group.ticketsConfirmedAcross",n.seats,{performances:n.performances})}</span>`:`<span class="sl-booked-seats">${(0,H.tCount)("picker.ticketsCount",t)}</span> ${this.tf("picker.confirmedAndOnWay","confirmed. A confirmation is on its way.")}`),this.els.bookedList&&(this.els.bookedList.innerHTML=e.lineItems.map(o=>{let r=[o.sectionLabel,o.rowLabel&&`${this.tf("picker.row","Row")} ${o.rowLabel}`,o.seatNumber&&`${this.tf("picker.seat","Seat")} ${o.seatNumber}`].filter(Boolean).join(" \xB7 ")||o.displayLabel||o.label,a=o.quantity>1?` <span class="sl-booked-qty">\xD7${o.quantity}</span>`:"";return`<li>${B(r)}${a}</li>`}).join(""),this.els.bookedList.hidden=e.lineItems.length===0),this.bookedEl?.classList.add("on"),requestAnimationFrame(()=>this.bookedEl?.querySelector(".sl-booked-back")?.focus()),this.opts.onBooked?.(e)}dismissBooked(){this.bookedEl?.classList.remove("on"),this.resetAfterBooking(),this.root?.focus({preventScroll:!0})}resetAfterBooking(){this.bookedShown=!1,this.hold=null,this.handedOff=!1,this.holdConflicted=!1,this.holdingLabels.clear(),this.gaQty.clear(),this.stopHoldTimer(),this.forgetHold(),this.clearSelection(),this.setCtaPhase("idle"),this.setSheetOpen(!1),this.syncTray(),this.syncCta(),this.emitHoldChange()}notifyGroupSettled(e){e==="booked"?this.showBooked():this.dismissConfirm(),this.hold=null,this.handedOff=!1,this.ctaPhase="idle",this.stopHoldTimer(),this.forgetHold(),this.syncTray(),this.syncCta()}async checkoutHandoff(e,t){if(this.checkoutMode==="hosted"){await this.startHostedCheckout(e,t);return}await this.opts.onCheckout?.(e,t,this.buildHandoff(e))}async startHostedCheckout(e,t){let n=this.buildHandoff(e),o=null;try{o=await(this.paymentOptions??=this.pubApi.paymentOptions(this.opts.event))}catch(r){this.opts.onError?.(r)}if(this.destroyed)return;let s=o?.providers?.[0];if(!s){let r=Yo(o?.reason),a=!!this.opts.onCheckoutUnavailable||!!this.opts.onCheckout;this.opts.onCheckoutUnavailable?.({reason:r,handoff:n}),this.opts.onCheckout?.(e,t,n),a||this.openCheckoutPanel({kind:"unavailable",reason:r,seatCount:n.lineItems.reduce((l,c)=>l+c.quantity,0)});return}await this.openCheckoutPanel({kind:"pay",provider:s,order:{holdId:n.holdId,expiresAt:n.expiresAt,currency:n.currency,total:n.total,labels:n.lineItems.map(r=>r.displayLabel??r.label)}})}async openCheckoutPanel(e){let t;try{({mountCheckout:t}=await Pi())}catch(n){this.opts.onError?.(n),this.toast(this.tf("picker.checkoutCouldNotBeOpened","Checkout could not be opened. Your seats are still held \u2014 please try again."),"error"),this.setCtaPhase("idle");return}this.destroyed||!this.root||(this.closeCheckoutPanel(),this.checkoutPanel=t({root:this.root,state:e,eventKey:this.opts.event,formatMoney:n=>this.money(n),startSession:n=>this.pubApi.startCheckout(this.opts.event,{...n,...this.opts.returnUrl?{returnUrl:this.opts.returnUrl}:{}}),orderStatus:n=>this.pubApi.orderStatus(n),onCancel:()=>{this.checkoutPanel=null,this.hold||this.setCtaPhase("idle")},onConfirmed:n=>{this.opts.onOrderConfirmed?.(n),this.controller.refresh()},onError:n=>this.opts.onError?.(n)}))}closeCheckoutPanel(){this.checkoutPanel?.destroy(),this.checkoutPanel=null}buildHandoff(e){let n=(e.items??[]).map(r=>{let a=this.controller.lineItemDisplay(r);return{label:r.label,...a.displayLabel?{displayLabel:a.displayLabel}:{},...a.displayType?{displayType:a.displayType}:{},objectId:r.objectId,objectType:r.objectType,categoryKey:r.categoryKey,tierId:r.tierId,unitPrice:this.paidPrice(r.categoryKey,r.tierId,r.unitPrice,r.label),currency:r.currency??this.currency,quantity:r.quantity??1}}),o=n[0]?.currency??this.currency,s=n.reduce((r,a)=>r+a.unitPrice*a.quantity,0);return{holdId:e.holdId,expiresAt:e.expiresAt,currency:o,lineItems:n,total:s}}emitHoldChange(){let e=this.hold;this.scheduleOfferRefresh(!0),this.opts.onHoldChange?.(e,e?.seats??[],e?this.buildHandoff(e):null)}toast(e,t="neutral",n){let o=this.els.toast;if(!o)return;o.replaceChildren();let s=document.createElement("span");if(s.textContent=e,o.appendChild(s),o.classList.toggle("has-action",!!n),n){let r=document.createElement("button");r.type="button",r.className="sl-toast-action",r.textContent=n.label,r.addEventListener("click",n.onClick,{once:!0}),o.appendChild(r)}o.dataset.tone=t,o.classList.add("on","sl-mo-rise"),this.liftToastOverConfirmSoon(),this.toastTimer&&clearTimeout(this.toastTimer),this.toastTimer=setTimeout(()=>{o.classList.remove("on","sl-mo-rise"),o.classList.remove("has-action"),o.dataset.tone="neutral",this.liftToastOverConfirm()},4200)}liftToastOverConfirm(){let e=this.regions["bottom-center"];if(!e)return;let t=this.els.toast?.classList.contains("on")||this.extendEl?.classList.contains("on"),n=this.confirmEl;if(!t||!n?.isConnected){e.style.removeProperty("bottom");return}let o=this.els.map.clientHeight;if(o<=0)return;let s=n.getBoundingClientRect(),r=s.height||n.offsetHeight||Bp,a=s.height?s.top-this.els.map.getBoundingClientRect().top:o-no-r,l=Math.round(o-a+Np);if(l+Dp>o){e.style.removeProperty("bottom");return}e.style.bottom=`${l}px`}liftToastOverConfirmSoon(){this.liftToastOverConfirm(),typeof requestAnimationFrame=="function"&&requestAnimationFrame(()=>{this.destroyed||this.liftToastOverConfirm()})}dismissSkeleton(){ia({boot:this.els.boot,map:this.els.map,rail:this.els.rail,root:this.root,reducedMotion:this.reducedMotion()})}placeTooltip(){if(!this.tipEl)return;let e={width:this.els.map.clientWidth,height:this.els.map.clientHeight},t={width:this.tipEl.offsetWidth,height:this.tipEl.offsetHeight},n=this.tipPinned?Vr(this.tipPos,e,t):null,o=n??Fr(this.tipPos,e.width,e.height,t);this.tipEl.style.left=`${o.left}px`,this.tipEl.style.top=`${o.top}px`,n?this.tipEl.dataset.placement=n.placement:delete this.tipEl.dataset.placement}nightStripFor(e,t){let n=this.performanceGroup,o=to(e.mark,n?.nights?.()),s=o?.states.filter(r=>r.free).length??0;return Cr(o,{locale:this.opts.locale,switchLabel:n?.selectionModeSwitch?.label??null,selectPartialLabel:n?.partialSeatSelection?.label(s)??null,pinned:t})}unpinTooltip(){this.tipPinned&&(this.tipPinned=!1,this.tipEl?.classList.remove("sl-tip-pinned"),this.tipEl&&(this.tipEl.style.display="none"))}handleMapPointerDown(e){if(this.tipEl?.contains(e.target))return;this.lastMapPoint={x:e.clientX,y:e.clientY},this.lastPointerType=e.pointerType||"mouse";let t=this.els.map.getBoundingClientRect();this.tipPos={x:e.clientX-t.left,y:e.clientY-t.top},this.unpinTooltip()}closeInfoPops(e){this.root?.querySelectorAll(".sl-info.open").forEach(t=>{t!==e&&(t.classList.remove("open"),t.querySelector("[data-sl-info]")?.setAttribute("aria-expanded","false"))})}updateTooltip(e){if(!this.tipEl)return;if(this.confirmSeat){this.tipEl.style.display="none";return}if(this.tipPinned&&e?.interaction!=="press")return;if(!e){this.tipPinned||(this.tipEl.style.display="none",this.tipMarkedHoverLabel=null);return}let t=e.mark?.kind==="partial"&&this.tipMarkedHoverLabel===e.label;if(e.interaction!=="press"&&this.lastPointerType==="mouse"&&!e.mark&&!this.tipPinned){this.tipEl.style.display="none",this.tipMarkedHoverLabel=null;return}if(e.unavailable&&e.status==="free"&&e.interaction==="press"){this.toast(this.tf("picker.turnOffAccessibilityFilter","Turn off the wheelchair filter to pick this seat"),"neutral"),this.tipEl.style.display="none";return}if(e.unavailable&&!e.mark){this.tipEl.style.display="none",this.tipMarkedHoverLabel=null;return}let n=e.mark?.kind==="partial"&&(e.interaction==="press"||this.lastPointerType!=="mouse"||t);this.tipMarkedHoverLabel=e.mark?.kind==="partial"?e.label:null;let o=this.nightStripFor(e,n);this.tipEl.style.setProperty("--sl-cat",e.categoryColor),this.tipEl.innerHTML=Br(e,{price:this.suppressPricing?"":this.money(this.paidPrice(e.categoryKey,e.tierId??null,e.price,e.label)),priceNote:this.suppressPricing?this.performanceGroup?.surface==="season"?this.tf("picker.season.includedInPackage","Included in the Season package"):this.tf("picker.group.pricesPerPerformance","Prices shown per performance"):"",rowTypeWord:rt(e),extra:o+(n?`<button type="button" class="sl-tip-close" data-pg-tip-close aria-label="${B(this.tf("picker.group.closeSeatDetails","Close seat details"))}">\xD7</button>`:"")}),this.tipPinned=n,this.tipEl.classList.toggle("sl-tip-pinned",n),this.tipEl.querySelector("[data-pg-tip-close]")?.addEventListener("click",()=>this.unpinTooltip()),this.tipEl.querySelector("[data-pg-switch-mode]")?.addEventListener("click",()=>{this.unpinTooltip(),this.performanceGroup?.selectionModeSwitch?.activate()}),jr(this.tipEl,this.performanceGroup?.partialSeatSelection?.label,s=>{this.unpinTooltip(),this.performanceGroup?.partialSeatSelection?.activate(e.id,s)}),this.tipEl.style.display="block",this.placeTooltip()}syncSeatMarks(){let e=this.performanceGroup?.seatMarks,t=this.controller.getRenderer();if(!e||!t?.setSeatMarks)return;let n={};for(let[o,s]of Object.entries(e())){let r=this.controller.idForLabel(o);r&&(n[r]=s)}Object.keys(n).length&&t.setSeatMarks(n)}getSelection(){return this.committedSelection()}selectObjects(e){return this.controller.select(e)}selectObjectsWithoutConfirmation(e){let t=new Set(e),n=this.controller.getSelection().filter(o=>t.has(o.id)||t.has(o.label));if(n.length===t.size)return n;this.suppressConfirmationSeatId=e[0]??null;try{return this.controller.select(e)}finally{this.suppressConfirmationSeatId=null}}deselectObjects(e){this.controller.deselect(e)}clearSelection(){this.dismissConfirm(),this.dismissTableDialog(),this.controller.clearSelection()}categoryLegendColor(){let e=(this.controller.doc?.categories??[]).find(t=>!t.notForSale);return(e?this.controller.getRenderer()?.categoryDisplayColor?.(e.key):null)||e?.color||"#2563eb"}async refreshAvailability(){await this.controller.refresh(),this.syncSeatMarks(),this.syncTray()}refreshPerformanceGroupComposition(){this.syncTray()}async adoptRestoredHold(e){!e||this.hold||await this.resumeHoldFromServer(e)}selectCategories(e){return this.controller.selectCategories(e)}deselectCategories(e){this.controller.deselectCategories(e)}setSelectableObjects(e){this.controller.setSelectableObjects(e)}setMaxSelection(e){this.maxTickets=Math.max(this.exactTickets??1,Math.floor(e)),this.controller.setMaxSelection(this.maxTickets),this.updateSelectionCapacity(),this.syncTray()}getSelectionValidity(){let e=this.controller.getSelectionValidity(this.totalTicketCount());return e&&(e.seats=this.committedSelection()),e}setMapTheme(e){this.destroyed||(this.opts.theme={...this.opts.theme??{},map:e??void 0},this.controller.setMapTheme(e),this.applyMapChromeTokens(),this.minimap?.refreshMinimap())}applyThemeTokens(e){let t=Jt(this.themeMode),n=Et(this.controller.doc?.theme,this.opts.theme,t);for(let[o,s]of Object.entries(n))e.style.setProperty(o,s);t?e.dataset.theme=t:delete e.dataset.theme,this.applyMapChromeTokens()}watchThemeMode(){this.colorSchemeStop?.(),this.colorSchemeStop=null,this.themeMode==="auto"&&(this.colorSchemeStop=Oi(()=>{this.destroyed||this.repaintForThemeMode()}))}repaintForThemeMode(){this.root&&(this.applyThemeTokens(this.root),this.controller.setMapTheme(Tt(this.opts.theme,this.themeMode)),this.applyMapChromeTokens(),this.minimap?.refreshMinimap(),this.syncPrices())}setThemeMode(e){this.destroyed||e===this.themeMode||(this.themeMode=e,this.opts.theme={...this.opts.theme??{},...e?{mode:e}:{mode:void 0}},this.watchThemeMode(),this.repaintForThemeMode(),this.emitAnalytics("theme_mode_changed",{mode:e,resolved:Jt(e)??null}))}getThemeMode(){return this.themeMode}applyMapChromeTokens(){let e=this.els.map?.parentElement;if(!e||!this.root)return;let t=Jt(this.themeMode),n=Et(this.controller.doc?.theme,this.opts.theme,t),o=Tt(this.opts.theme,this.themeMode)?.background??this.controller.doc?.theme?.background??void 0,s=gs(n,o);for(let r of fs)s?e.style.setProperty(r,s[r]):e.style.removeProperty(r)}setEventDetailsHidden(e){this.eventDetailsHidden=e,this.syncFullscreenButtons()}setPricing(e){let t=JSON.stringify(this.opts.pricing??null),n=JSON.stringify(e??null);t!==n&&(this.opts.pricing=e,!(this.destroyed||!this.els.prices)&&(this.els.pricesSec?.querySelector(".sl-price-select")?.remove(),this.buildPriceFilter(),this.syncPrices(),this.syncTray(),this.lastSection&&this.showSectionCard(this.lastSection)))}buildLanguageSwitcher(e){this.langSel=ws(e,{languages:this.opts.languages,label:this.tf("picker.preferredTicketType","Language"),onChange:t=>{this.setLocale(t)}})}async setLocale(e){let t=(0,H.getLocale)(),n=this.localeGeneration+=1,o=await(0,H.loadLocale)(e);return this.opts.messages&&(0,H.setStringOverrides)(this.opts.messages),o===t||this.applyActiveLocale(o,n),o}applyActiveLocale(e,t){t===this.localeGeneration&&this.root&&(xs(e,{root:this.root,painters:[()=>this.syncTray(),()=>this.syncPrices(),()=>this.syncOffer(),()=>this.syncRung(),()=>this.syncFloors(),()=>this.syncPanelToggle(),()=>this.syncFullscreenButtons()],refreshMapCopy:()=>this.controller.refreshMapCopy(),languageSelect:this.langSel}),this.scheduleFit())}isColorblindSafe(){return this.cbSafe}setColorblindSafe(e){e!==this.cbSafe&&(this.cbSafe=e,this.cbEl?.setAttribute("aria-pressed",String(e)),this.controller.setColorblindSafe(e),this.syncPrices(),this.minimap?.refreshMinimap(),Vp(e))}setViewMode(e){this.controller.setViewMode(this.normalizeInitialView(e)),this.syncProjection(),this.dismissConfirm()}getViewMode(){return this.controller.getViewMode()}normalizeInitialView(e){return e==="perspective"?(this.perspectiveWarned||(this.perspectiveWarned=!0,console.warn("[seatlayer] initialView:'perspective' (2.5D) is deprecated for the buyer picker and was coerced to 'flat'. Use the Map | 3D control for the immersive view.")),"flat"):e??"flat"}emitAnalytics(e,t){try{this.opts.onAnalytics?.(e,t??{})}catch{}}emit3dAnalytics(e,t){this.emitAnalytics(e,t)}getBuyerView(){return ya(this)}setBuyerView(e,t){va(this,e,t)}seatState3dFor(e){return wa(this,e)}pushAvailabilityTo3d(){xa(this)}syncSelectionTo3d(){Sa(this)}seatViewFor3d(e){return ka(this,e)}onView3dSeatPick(e){Ta(this,e)}seatViewCaption(e){return Ea(this,e)}saveView3dComparisonSeat(e){Ca(this,e)}clearView3dComparison(){Aa(this)}view3dComparisonSnapshot(e){return Pa(this,e)}enter3d(e){return La(this,e)}publish3dTopInset(){Ma(this)}exit3d(){Ha(this)}openSeatConfidencePassport(e,t=null){co(this,e,t)}closeSeatConfidencePassport(e=!0){di(this,e)}openView3dComparison(){ua(this)}closeView3dComparison(e=!0){at(this,e)}getCurrentHold(){return this.hold}async resumeHold(e){return this.resumeHoldFromServer(e)}async removeHeldTicket(e){return this.removeHeldLabels([e])}async bestAvailable(e,t,n={}){if(this.salesClosed||this.bestAvailableBusy)return null;e=Math.max(1,Math.min(this.maxTickets,Math.floor(e)));try{return await this.bestAvailableOrThrow(e,t,n)}catch(o){this.opts.onError?.(o);let s=o?.reason,r=s==="not_enough_together"?(0,H.t)("picker.couldNotFindSeatsTogether",{count:e}):s==="companion_pair_required"?this.tf("picker.companionPairRequired","Select the adjacent wheelchair place with each companion ticket."):s==="ticket_option_not_applicable"?this.tf("picker.ticketOptionNotApplicable","That ticket choice is not available for the selected seat."):s==="sold_out"?this.tf("picker.ticketTypeSoldOut","That ticket type is sold out. Try another ticket type."):s==="event_closed"?this.tf("picker.seatSalesClosedForEvent","Seat sales have closed for this event."):this.tf("picker.seatsNoLongerAvailableTryAnother","Those seats are no longer available. Try another quantity or ticket type.");return this.toast(r,"error"),null}}async bestAvailableOrThrow(e,t,n={}){if(this.salesClosed)throw new Error("seatlayer: seat sales are closed");if(this.bestAvailableBusy)throw new Error("seatlayer: Best Available is already in progress");if(!Number.isInteger(e)||e<1)throw new Error("seatlayer: Best Available quantity must be a positive integer");this.confirmSeat&&this.cancelConfirm(),this.bestAvailableConfirm=!1,this.bestAvailableBusy=!0;let o=this.els.tray?.querySelector(".sl-ba-go");o&&(o.disabled=!0,o.classList.add("sl-busy"),o.innerHTML=`<span class="sl-ba-spin" aria-hidden="true"></span>${this.tf("picker.findingEllipsis","Finding\u2026")}`);try{let s=await this.controller.bestAvailable(e,t,{...n,ttlMs:this.opts.holdTtlMs});return s?(this.hold={holdId:s.holdId,expiresAt:s.expiresAt,seats:s.seats,items:s.items},this.handedOff=!1,this.bookedShown=!1,this.gaQty.clear(),this.startHoldTimer(s.expiresAt),this.flashHeldSeats(this.hold),this.syncTray(),this.emitHoldChange(),n.preferPremium&&s.seats.length&&!s.seats.every(r=>r.commercial?.premium)&&this.toast((0,H.t)("picker.premiumFallbackNote",{count:e}),"neutral"),this.hold):null}finally{this.bestAvailableBusy=!1,this.syncTray()}}async release(){let e=this.hold,t=this.controller.currentHold(),n=!0;if(t)n=await this.controller.release();else if(e){let o=[...new Set([...(e.items??[]).map(s=>s.label),...(e.seats??[]).map(s=>s.label)])];if(o.length)try{await this.api.release(this.opts.event,o,e.holdId)}catch(s){this.opts.onError?.(s),n=!1}}if(!n){this.toast(this.tf("picker.couldNotReleaseTickets","Couldn't release your tickets. Your hold is unchanged."),"error");return}this.hold=null,this.forgetHold(),this.handedOff=!1,this.bookedShown=!1,this.ctaPhase="idle",this.stopHoldTimer(),this.gaQty.clear(),this.syncTray(),this.emitHoldChange()}startRealtime(){if(!this.access?.configured||!this.pubApi||this.realtime)return;let e=this.opts.event;this.realtime=new Ee({url:this.pubApi.subscribeUrl(e),mintTicket:()=>this.pubApi.subscribeTicket(e),onAccessUnavailable:t=>{this.opts.onAccessUnavailable?.(t),this.showAccessPanel(t)},sink:wt(this.controller,{flashOnLiveChange:!0,ownLabels:()=>this.holdingLabels,onStatusChange:()=>{this.syncPrices(),this.scheduleOfferRefresh(!0),this.detectBooked(),this.minimap?.refreshMinimap(),this.pushAvailabilityTo3d()},onSelectedObjectUnavailable:(t,n)=>{this.opts.onSelectedObjectUnavailable?.({labels:t,reason:n}),this.syncTray(),this.toast(n==="ineligible"?this.tf("picker.seatNoLongerYours","Some seats are no longer available to you. They have been removed from your order."):this.tf("picker.seatTaken","Someone else took a seat you had picked. It has been removed from your order."),"warning")}})}),this.realtime.start()}async refreshAccess(){return!this.access?.configured||!await this.access.refresh("manual")?!1:(this.dismissAccessPanel(),await this.controller.refresh(),this.realtime?this.realtime.restart():this.startRealtime(),!0)}clearDecisionSurfaces(){this.dismissConfirm(),this.dismissTableDialog(!1),Ce(this,!1)}showAccessPanel(e){if(this.loadAbort&&e.reason==="provider_failed"||this.destroyed||!this.root)return;this.dismissAccessPanel(),this.clearDecisionSurfaces();let t=cs(e.reason,()=>this.recoverAccess());(this.root.querySelector(".sl-body")??this.root).appendChild(t),this.accessEl=t}async recoverAccess(){return await this.refreshAccess()?!0:(this.opts.onAccessUnavailable||typeof window>"u"||window.location.reload(),!1)}dismissAccessPanel(){this.accessEl?.remove(),this.accessEl=null}showHoldExpired(){if(this.destroyed||!this.root||this.holdExpiredEl)return;this.clearDecisionSurfaces();let e=wl({restart:()=>this.restartAfterHoldExpiry()},this.holdExpiredUnits);this.root.appendChild(e),this.holdExpiredEl=e,requestAnimationFrame(()=>e.querySelector(".sl-interrupt-act")?.focus());let t=this.holdExpiredUnits;this.holdExpiredFresh=!1,this.refreshAvailability().then(()=>{if(this.destroyed||this.holdExpiredEl!==e)return;this.holdExpiredFresh=!0;let n=t.filter(r=>r.objectType!=="ga"),o=[],s=[];for(let r of n){let a=this.controller.seatByLabel(r.label);(a&&this.controller.getStatus(a.id)==="free"?o:s).push(r.label)}vl(e,{recoverable:o,taken:s,onRecover:r=>this.recoverAfterHoldExpiry(r)})}).catch(()=>{})}recoverAfterHoldExpiry(e){this.holdExpiredUnits=[],this.dismissHoldExpired(),this.lapse.clear(),this.clearSelection(),this.controller.select(e),this.syncTray(),this.handleCta()}dismissHoldExpired(){this.holdExpiredEl?.remove(),this.holdExpiredEl=null}restartAfterHoldExpiry(){let e=this.holdExpiredUnits;this.holdExpiredUnits=[],this.dismissHoldExpired(),this.lapse.clear(),this.clearSelection(),this.controller.overview(),this.syncTray(),this.syncCta(),this.root?.focus({preventScroll:!0});let t=this.holdExpiredFresh;this.holdExpiredFresh=!1,(t?Promise.resolve():this.refreshAvailability()).then(()=>{this.destroyed||yl({reducedMotion:this.reducedMotion(),accent:this.cssVar("--sl-accent")||"#f4b740",seatByLabel:n=>this.controller.seatByLabel(n),statusOf:n=>this.controller.getStatus(n),flash:(n,o)=>this.controller.flashSeat(n,o)},e)}).catch(()=>{})}destroy(){this.transportAbort.abort(),this.loadAbort?.abort(),this.loadAbort=null,this.destroyed=!0,ro(this),this.colorSchemeStop?.(),this.colorSchemeStop=null,this.realtime?.stop(),this.realtime=null,this.dismissAccessPanel(),this.dismissHoldExpired(),this.access?.clear(),this.hold&&!this.handedOff&&this.controller.release(),this.closeConfirm(),this.dismissTableDialog(!1),Ce(this,!1),this.closeSeatView(),this.closeCheckoutPanel(),this.exit3d(),this.buyerAssetUrls.dispose(),this.stopHoldTimer(),this.detachAttention?.(),this.toastTimer&&clearTimeout(this.toastTimer),this.offerRefreshTimer&&clearTimeout(this.offerRefreshTimer),this.offerBoundaryTimer&&clearTimeout(this.offerBoundaryTimer),this.offerRefreshTimer=null,this.offerBoundaryTimer=null,this.offerVisibilityHandler&&(document.removeEventListener("visibilitychange",this.offerVisibilityHandler),this.offerVisibilityHandler=null);for(let e of this.motionTimers)clearTimeout(e);this.motionTimers.clear(),this.ro?.disconnect(),this.ro=null,this.viewportResizeHandler&&window.removeEventListener("resize",this.viewportResizeHandler),this.viewportResizeHandler=null,this.framedFs&&this.setFramedFs(!1),this.escHandler&&document.removeEventListener("keydown",this.escHandler),this.fsChangeHandler&&document.removeEventListener("fullscreenchange",this.fsChangeHandler),this.fsEscHandler&&window.removeEventListener("keydown",this.fsEscHandler),this.controller.destroy(),this.projectionEl=null,this.root?.remove(),this.root=null,this.modalCleanup?.(),this.closeModal=null}};var We=require("@seatlayer/core");var Hl="seatlayer-performance-group-picker-style";function Rl(){if(document.getElementById(Hl))return;let i=document.createElement("style");i.id=Hl,i.textContent=`
3244
3248
  .sl-pg-root{display:grid;gap:12px;min-width:0;color:var(--sl-text,#18202b);font-family:var(--sl-font,Inter,system-ui,sans-serif)}
3245
3249
  .sl-pg-head{display:grid;gap:8px;padding:16px 18px;border:1px solid var(--sl-line,#dde3ea);border-radius:14px;background:var(--sl-surface,#fff)}
3246
3250
  .sl-pg-head h2{font:700 20px/1.25 inherit;margin:0}.sl-pg-summary{margin:0;color:var(--sl-muted,#627081);font-size:14px}
@@ -3300,7 +3304,7 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default;text-decoration-color:t
3300
3304
  @media(min-width:900px){.sl-pg-legend-list{justify-content:flex-start}}
3301
3305
  .sl-pg-live{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
3302
3306
  @media(max-width:640px){.sl-pg-head{padding:13px 14px}.sl-pg-head h2{font-size:18px}.sl-pg-inner{min-height:590px}}
3303
- `,document.head.appendChild(i)}var Vp="https://api.seatlayer.io",zp=6e4,$p=2e3,jp=1e3,Gp=36e5,Up=5e3,qp=5e3,Kp=15e3,Wp=12e4,Yp=new Set(["preparing","commit_pending","abort_pending","expire_pending"]),J=class extends Error{constructor(){super("performance_group_destroyed"),this.name="PerformanceGroupDestroyedError"}};function Xp(i){return new Promise(e=>setTimeout(e,i))}function bo(i){let e=Number(i.headers.get("Retry-After")??"1");return Number.isFinite(e)?Math.max(50,Math.min(Up,e*1e3)):1e3}function Ft(i,e){return`/pub/performance-groups/${encodeURIComponent(i)}/operations/${encodeURIComponent(e)}`}function Vt(i){return i.replace(/^pghop_/,"").replace(/-/g,"").slice(-8).toUpperCase()}var yo=class{constructor(e,t,n){this.api=e;this.sink=t;this.intervalMs=n;this.stopped=!0;this.timer=null;this.prior=new Map}start(){this.stopped&&(this.stopped=!1,this.tick())}stop(){this.stopped=!0,this.timer&&clearTimeout(this.timer),this.timer=null}async tick(){try{let e=await this.api.objects(this.api.groupKey);if(this.stopped)return;let t=new Map(Object.entries(e.seats)),o=[...new Set([...this.prior.keys(),...t.keys()])].filter(s=>this.prior.get(s)!==t.get(s)).map(s=>({label:s,status:t.get(s)??"blocked"}));this.prior=t,o.length&&this.sink.applyStatuses(o),this.sink.onSections?.(e.hidden??[],e.closed??[])}catch(e){if(e instanceof J){this.stop();return}this.stopped||await this.sink.resync()}finally{this.stopped||(this.timer=setTimeout(()=>{this.tick()},this.intervalMs))}}},En=class{constructor(e,t){this.descriptorCache=null;this.chartRequest=null;this.objectsCache=null;this.activePerformanceKey=null;this.includedEventKeys=new Set;this.reuseObjectsCacheOnce=!1;this.selectionsByEvent=new Map;this.allocationsByHold=new Map;this.pendingOperationId=null;this.operationByHold=new Map;this.knownRevision=null;this.destroyed=!1;this.aborter=new AbortController;this.adoptFailure=null;this.settleTimer=null;this.settleOperationId=null;this.settleStartedAt=0;this.settleState=null;this.settleVisibility=null;this.lastRecovery={kind:"idle"};if(!e)throw new Error("seatlayer: `performanceGroup` key is required");this.groupKey=e,this.base=(t.apiBase??Vp).replace(/\/+$/,""),this.access=t.access,this.fetcher=t.fetch??globalThis.fetch.bind(globalThis),this.recoveryTimeoutMs=t.recoveryTimeoutMs??zp,this.realtimePollMs=Math.max(500,t.realtimePollMs??$p),this.selectionMode=t.selectionMode??"same_seat",this.partySize=t.partySize??null,this.onOperationState=t.onOperationState,this.onRecoveryState=t.onRecoveryState,this.onAvailability=t.onAvailability,this.access.onRenewed(o=>this.adoptSession(o));let n=this.readOperationRecord();n&&this.storedIsUndecided(n)&&(this.pendingOperationId=n.operationId)}get pendingOperation(){return this.pendingOperationId}get holdBlocked(){return!!this.adoptFailure||!!this.pendingOperationId&&this.lastRecovery.kind!=="idle"}async descriptor(){let e=await this.json(`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/descriptor`);return this.descriptorCache=e.performanceGroup,this.includedEventKeys.size||(this.includedEventKeys=new Set(e.performanceGroup.performances.map(t=>t.eventKey))),e.performanceGroup.revision&&(this.knownRevision=e.performanceGroup.revision),this.activePerformanceKey??=e.performanceGroup.performances[0]?.eventKey??null,e.performanceGroup}async chart(e){this.chartRequest??=this.json(`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/chart`).catch(o=>{throw this.chartRequest=null,o});let[t,n]=await Promise.all([this.descriptorCache?Promise.resolve(this.descriptorCache):this.descriptor(),this.chartRequest]);return{doc:n,event:{key:t.key,name:t.name,salesClosed:t.state!=="active",venue:t.venue,startsAt:t.performances[0]?.startsAt??null,timezone:t.timezone,currency:t.currency,mode:t.mode,inventoryModelVersion:2}}}asset(e,t){return/^[a-zA-Z0-9._-]+$/.test(t)?this.blob(`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/assets/${encodeURIComponent(t)}`):Promise.reject(new j(404,"not_found","not_found"))}async objects(e){let t=this.descriptorCache?.inclusionMode==="flexible_dates",n=`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/objects`+(this.selectionMode==="per_performance"||t?"?view=per-performance":"");if(this.reuseObjectsCacheOnce&&this.objectsCache)this.reuseObjectsCacheOnce=!1;else{let r=await this.authorized(n,this.objectsCache?.revision?{headers:{"If-None-Match":`"${this.objectsCache.revision}"`}}:{});if(r.status!==304){if(!r.ok)return this.throwResponse(r);this.objectsCache=await this.responseJson(r)}}if(!this.objectsCache)throw new j(502,"group_projection_unavailable","group_projection_unavailable");if(this.selectionMode==="same_seat"&&!t){let r=this.objectsCache;return this.noteAvailability(r,r.salesClosed,r),r}let o=this.objectsCache;if(this.selectionMode==="same_seat"){let r=o.performances.filter(p=>this.includedEventKeys.has(p.eventKey));if(!r.length)throw new j(409,"group_selection_incomplete","group_selection_incomplete");let a=Object.keys(r[0]?.seats??{}),l=Object.fromEntries(a.map(p=>[p,r.every(u=>u.seats[p]==="free")?"free":"blocked"])),c=Object.fromEntries(a.flatMap(p=>{let u=r.filter(h=>h.seats[p]!=="free").map(h=>h.eventKey);return u.length>0&&u.length<r.length?[[p,u]]:[]})),d={seats:l,partial:c,hidden:[...new Set(r.flatMap(p=>p.hidden??[]))],closed:[...new Set(r.flatMap(p=>p.closed??[]))],revision:o.revision,state:o.state,salesClosed:r.some(p=>p.salesClosed)};return this.noteAvailability(o,d.salesClosed,d),d}let s=o.performances.find(r=>r.eventKey===this.activePerformanceKey);if(!s)throw new j(409,"group_performance_unavailable","group_performance_unavailable");return this.noteAvailability(o,o.salesClosed||o.performances.some(r=>r.salesClosed),s),s}setSelectionMode(e,t){if(this.pendingOperationId||this.holdBlocked)throw new j(409,"group_operation_pending","group_operation_pending");e!==this.selectionMode&&(this.selectionMode=e,t!=null&&(this.partySize=t),this.objectsCache=null,this.selectionsByEvent.clear(),this.activePerformanceKey=this.descriptorCache?.performances[0]?.eventKey??this.activePerformanceKey)}setActivePerformance(e){if(this.descriptorCache&&!this.descriptorCache.performances.some(t=>t.eventKey===e))throw new j(404,"group_performance_not_found","group_performance_not_found");this.activePerformanceKey=e}setIncludedEventKeys(e){let t=new Set(this.descriptorCache?.performances.map(n=>n.eventKey)??[]);if(!e.length||new Set(e).size!==e.length||e.some(n=>!t.has(n)))throw new j(422,"invalid_event_keys","invalid_event_keys");this.includedEventKeys=new Set(e),this.reuseObjectsCacheOnce=!!this.objectsCache}includedPerformanceKeys(){return(this.descriptorCache?.performances??[]).map(e=>e.eventKey).filter(e=>this.includedEventKeys.has(e))}setPerformanceSelections(e,t){this.selectionsByEvent.set(e,t.map(n=>({...n})))}allocationsForHold(e){return(this.allocationsByHold.get(e)??[]).map(t=>({eventKey:t.eventKey,items:t.items.map(n=>({...n}))}))}async hold(e,t,n,o){if(this.assertUsable(),o)throw new j(409,"group_hold_replace_unsupported","group_hold_replace_unsupported");let s=t.map(c=>c.label),r={labels:s};if(this.descriptorCache?.inclusionMode==="flexible_dates"&&(r.eventKeys=this.includedPerformanceKeys()),this.selectionMode==="per_performance"){if(!this.activePerformanceKey||!this.descriptorCache||!this.partySize)throw new j(409,"group_selection_incomplete","group_selection_incomplete");this.setPerformanceSelections(this.activePerformanceKey,t);let c=this.descriptorCache.performances.filter(d=>this.includedEventKeys.has(d.eventKey)).map(d=>({eventKey:d.eventKey,selections:this.selectionsByEvent.get(d.eventKey)??[]}));if(c.some(d=>d.selections.length!==this.partySize))throw new j(409,"group_selection_incomplete","group_selection_incomplete");r={selectionMode:"per_performance",allocations:c,...this.descriptorCache.inclusionMode==="flexible_dates"?{eventKeys:this.includedPerformanceKeys()}:{}}}let a=this.pendingOperationId??`pghop_${crypto.randomUUID()}`;this.beginOperation(a),this.onOperationState?.({operationId:a,state:"preparing",decision:null});let l;try{l=await this.authorized(`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/hold`,{method:"POST",body:JSON.stringify({operationId:a,...r,...n?{ttlMs:n}:{}})})}catch(c){if(c instanceof J)throw c;if(c instanceof re)throw this.failOperation(a),c;return this.recover(a,s,Date.now()+this.recoveryTimeoutMs)}if(l.status===201||l.status===202||l.status===504){let c=await this.responseJson(l);return this.emit(c.operation),l.status===201?this.complete(c.operation):this.recover(a,s,Date.now()+this.recoveryTimeoutMs,bo(l))}if(l.status===503){let c=await l.clone().json().catch(()=>null);if((c?.code??c?.error)==="performance_group_abort_pending"){let d=c?.operation?.operationId??a;return this.beginOperation(d),c?.operation&&this.emit(c.operation),this.recover(d,s,Date.now()+this.recoveryTimeoutMs,bo(l))}}try{return await this.throwResponse(l,s)}catch(c){throw this.failOperation(a),c}}async release(e,t,n){this.assertUsable();let o=this.operationForHold(n),s=await this.json(`${Ft(this.groupKey,o)}/release`,{method:"POST",body:"{}"});return this.operationByHold.delete(n),this.allocationsByHold.delete(n),this.clearOperationRecord(),s}async resume(e,t){this.assertUsable();let n=this.operationForHold(t),o=await this.json(Ft(this.groupKey,n));return this.complete(o.operation)}async extend(e,t,n=12e4){this.assertUsable();let o=this.operationForHold(t),s=Math.max(jp,Math.min(Gp,Math.round(n))),r=await this.json(`${Ft(this.groupKey,o)}/extend`,{method:"POST",body:JSON.stringify({ttlMs:s})}),a=this.complete(r.operation);return{holdId:a.holdId,expiresAt:a.expiresAt}}bestAvailable(){return Promise.reject(new j(400,"group_best_available_unsupported","group_best_available_unsupported"))}socketUrl(){return""}createRealtime(e,t){return new yo(this,t,this.realtimePollMs)}operationIdForHold(e){return this.operationByHold.get(e)??this.readMapping(e)}rememberOperation(e,t){!e||!t||(this.operationByHold.set(e,t),this.writeMapping(e,t))}async restoreOperation(){let e=this.readOperationRecord();if(!e)return null;if(!this.storedIsUndecided(e)&&e.state!=="committed"&&e.state!=="booked")return this.clearOperationRecord(),null;this.pendingOperationId=e.operationId,this.emitRecovery({kind:"pending",operationId:e.operationId,phase:e.state==="undecided"?"unknown":e.state,longRunning:!1,reference:Vt(e.operationId)});let t;try{t=await this.authorized(Ft(this.groupKey,e.operationId))}catch(s){return s instanceof J||this.recoveryFailed(e.operationId,"request_failed"),null}if(t.status===404)return this.failOperation(e.operationId),null;if(!t.ok)return this.recoveryFailed(e.operationId,"request_failed"),null;let n=await this.responseJson(t);this.emit(n.operation);let o=n.operation.state;return o==="committed"||o==="booked"?(this.emitRecovery({kind:"idle"}),this.complete(n.operation)):o==="aborted"||o==="expired"?(this.failOperation(e.operationId),null):this.recover(e.operationId,[],Date.now()+this.recoveryTimeoutMs)}async retryRecovery(){this.assertUsable();let e=this.pendingOperationId??this.readOperationRecord()?.operationId??null;return e?(this.pendingOperationId=e,this.recover(e,[],Date.now()+this.recoveryTimeoutMs)):null}watchSettlement(e){if(this.destroyed)return;let t=this.operationIdForHold(e);!t||t===this.settleOperationId||(this.stopSettlementWatch(),this.settleOperationId=t,this.settleStartedAt=Date.now(),this.settleState="committed",typeof document<"u"&&(this.settleVisibility=()=>{document.hidden||!this.settleOperationId||this.pollSettlement()},document.addEventListener("visibilitychange",this.settleVisibility)),this.scheduleSettlementPoll())}stopSettlementWatch(){this.settleTimer&&clearTimeout(this.settleTimer),this.settleTimer=null,this.settleOperationId=null,this.settleState=null,this.settleVisibility&&typeof document<"u"&&document.removeEventListener("visibilitychange",this.settleVisibility),this.settleVisibility=null}scheduleSettlementPoll(){if(this.destroyed||!this.settleOperationId)return;if(this.settleTimer&&clearTimeout(this.settleTimer),typeof document<"u"&&document.hidden){this.settleTimer=null;return}let t=Date.now()-this.settleStartedAt>=Wp?Kp:qp;this.settleTimer=setTimeout(()=>{this.pollSettlement()},t)}settled(e){return e==="booked"||e==="expired"||e==="aborted"}async pollSettlement(){let e=this.settleOperationId;if(this.destroyed||!e)return;if(typeof document<"u"&&document.hidden){this.settleTimer&&clearTimeout(this.settleTimer),this.settleTimer=null;return}let t;try{let o=await this.authorized(Ft(this.groupKey,e));if(!o.ok)return this.scheduleSettlementPoll();t=(await this.responseJson(o)).operation}catch(o){return o instanceof J?this.stopSettlementWatch():this.scheduleSettlementPoll()}if(this.destroyed||this.settleOperationId!==e)return;let n=t.state!==this.settleState;if(this.settleState=t.state,n&&this.noteOperationState(e,t.state),this.settled(t.state)){this.stopSettlementWatch(),t.state!=="booked"&&this.clearOperationRecord(),this.emit(t);return}n&&this.emit(t),this.scheduleSettlementPoll()}destroy(){if(!this.destroyed){this.destroyed=!0,this.stopSettlementWatch(),this.access.onRenewed(void 0);try{this.aborter.abort()}catch{}}}operationRecordKey(){return`@seatlayer/performance-group-operation/v1/${encodeURIComponent(this.base)}/${encodeURIComponent(this.groupKey)}`}readOperationRecord(){try{let e=window.sessionStorage.getItem(this.operationRecordKey());if(!e)return null;let t=JSON.parse(e);return!t?.operationId||t.groupKey!==this.groupKey?null:t}catch{return null}}storedIsUndecided(e){return e.state==="undecided"||Yp.has(e.state)}writeOperationRecord(e){try{window.sessionStorage.setItem(this.operationRecordKey(),JSON.stringify(e))}catch{}}clearOperationRecord(){try{window.sessionStorage.removeItem(this.operationRecordKey())}catch{}}beginOperation(e){this.pendingOperationId=e;let t=this.readOperationRecord();this.writeOperationRecord({operationId:e,groupKey:this.groupKey,state:"undecided",createdAt:t?.operationId===e?t.createdAt:Date.now()})}noteOperationState(e,t){let n=this.readOperationRecord();!n||n.operationId!==e||this.writeOperationRecord({...n,state:t})}failOperation(e){this.pendingOperationId=null,this.clearOperationRecord(),this.emitRecovery({kind:"idle"}),this.onOperationState?.({operationId:e,state:"aborted",decision:"abort"})}async adoptSession(e){if(this.destroyed)return;let t=`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/session/adopt`;for(let o=0;o<2;o++){if(this.destroyed)return;try{if((await this.fetcher(`${this.base}${t}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e.token}`},body:JSON.stringify({previousToken:e.previousToken}),credentials:"omit",signal:this.aborter.signal})).ok){this.adoptFailure=null;return}}catch{}}if(this.destroyed)return;this.adoptFailure=new j(409,"performance_group_session_adopt_failed","performance_group_session_adopt_failed");let n=this.pendingOperationId??"";throw this.emitRecovery({kind:"failed",operationId:n,reference:n?Vt(n):"",reason:"session_adopt_failed",retryable:!1}),this.adoptFailure}async recover(e,t,n,o=100){let s=o,r=Date.now()+Math.min(8e3,Math.max(500,this.recoveryTimeoutMs/2)),a="unknown";for(;Date.now()<=n;){if(this.destroyed)throw new J;if(this.emitRecovery({kind:"pending",operationId:e,phase:a,longRunning:Date.now()>=r,reference:Vt(e)}),await Xp(s),this.destroyed)throw new J;let l;try{l=await this.authorized(Ft(this.groupKey,e))}catch(p){if(p instanceof J)throw p;if(p instanceof re)throw this.recoveryFailed(e,"request_failed"),p;s=Math.min(2e3,Math.max(100,s*2));continue}if(l.status===404){s=Math.min(1e3,Math.max(100,s*2));continue}if(!l.ok){this.recoveryFailed(e,"request_failed");try{return await this.throwResponse(l,t)}finally{this.pendingOperationId=null,this.clearOperationRecord()}}let d=(await this.responseJson(l)).operation;if(a=d.state,this.noteOperationState(e,d.state),this.emit(d),d.state==="committed"||d.state==="booked")return this.emitRecovery({kind:"idle"}),this.complete(d);if(d.state==="aborted"||d.state==="expired")throw this.failOperation(e),new j(409,"conflict","conflict",t.map(p=>({label:p,status:"held"})));s=bo(l)}throw this.recoveryFailed(e,"deadline"),new j(504,"performance_group_outcome_unknown","performance_group_outcome_unknown")}recoveryFailed(e,t){this.emitRecovery({kind:"failed",operationId:e,reference:Vt(e),reason:t,retryable:!0})}emitRecovery(e){if(this.destroyed)return;let t=this.lastRecovery.kind===e.kind&&JSON.stringify(this.lastRecovery)===JSON.stringify(e);this.lastRecovery=e,t||this.onRecoveryState?.(e)}noteAvailability(e,t,n){if(this.destroyed||!this.onAvailability)return;let o=e.state??this.descriptorCache?.state??"active",s=e.revision??null,r=!!s&&!!this.knownRevision&&s!==this.knownRevision;s&&!this.knownRevision&&(this.knownRevision=s);let a=n?.partial??{},l=Object.values(n?.seats??{});this.onAvailability({partial:a,freeCount:l.filter(c=>c==="free").length,blockedCount:Object.keys(n?.seats??{}).filter(c=>n.seats[c]!=="free"&&!(c in a)).length,state:o,salesClosed:!!t||o!=="active",revision:s,revisionChanged:r})}acceptRevision(e){this.knownRevision=e}complete(e){if(!e.hold||e.hold.expiresAt==null)throw new j(409,"group_hold_not_active","group_hold_not_active");this.pendingOperationId=null,this.noteOperationState(e.operationId,e.state),this.operationByHold.set(e.hold.id,e.operationId),this.writeMapping(e.hold.id,e.operationId);let t=e.hold.allocations??[];this.allocationsByHold.set(e.hold.id,t);let n=t.find(o=>o.eventKey===this.activePerformanceKey)?.items;return{holdId:e.hold.id,expiresAt:e.hold.expiresAt,items:n??e.hold.items??[]}}emit(e){this.destroyed||this.onOperationState?.({operationId:e.operationId,state:e.state,decision:e.decision})}operationForHold(e){let t=this.operationIdForHold(e);if(!t)throw new j(404,"group_hold_not_found","group_hold_not_found");return t}mappingKey(e){return`@seatlayer/performance-group-hold/v1/${encodeURIComponent(this.base)}/${encodeURIComponent(this.groupKey)}/${encodeURIComponent(e)}`}readMapping(e){try{return window.sessionStorage.getItem(this.mappingKey(e))}catch{return null}}writeMapping(e,t){try{window.sessionStorage.setItem(this.mappingKey(e),t)}catch{}}assertUsable(){if(this.destroyed)throw new J;if(this.adoptFailure)throw this.adoptFailure}async authorized(e,t={},n=!1){if(this.destroyed)throw new J;if(this.adoptFailure)throw this.adoptFailure;let o={...t.headers};t.body!==void 0&&(o["Content-Type"]="application/json");let s=await this.access.authorization(n?"unauthorized":"initial");if(this.destroyed)throw new J;if(this.adoptFailure)throw this.adoptFailure;if(!s)throw new Error("performance_group_buyer_access_required");o.Authorization=s;let r=await this.fetcher(`${this.base}${e}`,{method:t.method??"GET",headers:o,body:t.body,credentials:"omit",signal:this.aborter.signal});if(!n&&(r.status===401||r.status===403||r.status===422)){let a=await r.clone().json().catch(()=>null);if(await this.access.handleFailure(r.status,a?.code??a?.error))return this.authorized(e,t,!0)}return r}async json(e,t={}){let n=await this.authorized(e,t);return n.ok?this.responseJson(n):this.throwResponse(n)}async blob(e){let t=await this.authorized(e);return t.ok?t.blob():this.throwResponse(t)}async responseJson(e){return e.json()}async throwResponse(e,t=[]){let o=await e.json().catch(()=>null)??{},s=o.code??o.error??`request_failed_${e.status}`;throw e.status===409&&!o.conflicts?.length&&t.length&&(o.conflicts=t.map(r=>({label:r,status:"held"}))),new j(e.status,o.error??s,s,o.conflicts)}};var Zp="https://api.seatlayer.io";function Rl(i){let e=typeof i=="string"?document.querySelector(i):i;if(!e)throw new Error("seatlayer: Performance Group picker container was not found");return e}var Cn=class{constructor(e){this.descriptorValue=null;this.picker=null;this.root=null;this.innerHost=null;this.tabsHost=null;this.prevButton=null;this.nextButton=null;this.heldSummary=null;this.live=null;this.statusHost=null;this.statusCopy=null;this.statusAction=null;this.rendered=!1;this.destroyed=!1;this.continued=!1;this.switchingPerformance=!1;this.operationPending=!1;this.recovery={kind:"idle"};this.availability=null;this.activePerformanceKey=null;this.selectionsByEvent=new Map;this.validByEvent=new Map;this.refreshingComposition=!1;this.activeHandoff=null;this.selectionModeValue="same_seat";this.progressHost=null;this.legendHost=null;this.paneHost=null;this.datesSummaryHost=null;this.datesCardsHost=null;this.resettingFlexibleSelection=!1;this.selectingPartialSeat=!1;this.partialSeatDates=new Map;this.markedLabels=new Set;this.holdTicker=null;this.switchingMode=!1;this.booked=!1;if(!e||typeof e!="object")throw new Error("seatlayer: options object is required");if(!e.performanceGroup)throw new Error("seatlayer: `performanceGroup` key is required");if(!e.container)throw new Error("seatlayer: `container` is required");if(!e.buyerAccessToken&&!e.buyerAccessTokenProvider)throw new Error("seatlayer: Performance Group buyer access is required");if(!!e.initialHoldId!=!!e.initialOperationId)throw new Error("seatlayer: `initialHoldId` and `initialOperationId` must be supplied together");if((e.selectionMode==="per_performance"||e.allowSelectionModeSwitch)&&(!Number.isSafeInteger(e.numberOfPlacesToSelect)||(e.numberOfPlacesToSelect??0)<1))throw new Error("seatlayer: `numberOfPlacesToSelect` is required for per-performance selection");this.selectionModeValue=e.selectionMode??"same_seat",this.options=e,this.panelId=`sl-pg-panel-${e.performanceGroup}`,this.access=new me({provider:e.buyerAccessTokenProvider,token:e.buyerAccessToken,onExpired:e.onAccessExpired,onUnavailable:e.onAccessUnavailable}),this.api=new En(e.performanceGroup,{apiBase:e.apiBase,access:this.access,selectionMode:e.selectionMode,partySize:e.selectionMode==="per_performance"?e.numberOfPlacesToSelect:void 0,onOperationState:t=>this.operationChanged(t),onRecoveryState:t=>this.recoveryChanged(t),onAvailability:t=>this.availabilityChanged(t)}),e.initialHoldId&&e.initialOperationId&&this.api.rememberOperation(e.initialHoldId,e.initialOperationId)}get mode(){return this.selectionModeValue}get selectionMode(){return this.selectionModeValue}get descriptor(){return this.descriptorValue}get currentHold(){return this.activeHandoff}async render(){if(this.rendered)return this;let e=performance.now();if(this.rendered=!0,Hl(),await(0,We.loadLocale)(this.options.locale),this.options.messages&&(0,We.setStringOverrides)(this.options.messages),this.destroyed)return this;let t;try{t=await this.api.descriptor()}catch(n){throw Ae({apiBase:this.options.apiBase??Zp,event:this.options.performanceGroup,scope:"performance_group",surface:"performance_group_picker",outcome:"failure",stage:"group_descriptor",ms:performance.now()-e,load:Oe(this.options.performanceGroup),transport:"pubapi"}),n}return this.destroyed?this:(this.descriptorValue=t,this.activePerformanceKey=t.performances[0]?.eventKey??null,this.buildChrome(Rl(this.options.container),t),this.announce(this.copy("picker.group.checkingAvailability")),await this.mountPicker(t),this.destroyed?this:(await this.restoreOperation(),this))}buildChrome(e,t){e.replaceChildren();let n=document.createElement("div");n.className="sl-pg-root",n.dataset.performanceGroup=t.key,n.dataset.selectionMode=this.mode;let o=document.createElement("div");o.className="sl-pg-progress";let s=document.createElement("section");s.className="sl-pg-head",s.setAttribute("aria-labelledby",`sl-pg-title-${t.key}`);let r=document.createElement("h2");r.id=`sl-pg-title-${t.key}`,r.textContent=t.name;let a=document.createElement("p");a.className="sl-pg-summary",a.textContent=this.copy(this.mode==="per_performance"?"picker.group.perPerformanceSummary":"picker.group.sameSeatSummary",{count:t.performanceCount});let l=document.createElement("p");l.className="sl-pg-help",l.textContent=this.copy(this.mode==="per_performance"?"picker.group.perPerformanceMapHelp":"picker.group.sameSeatMapHelp");let c=document.createElement("details");c.className="sl-pg-dates",c.open=t.performanceCount<=3;let d=document.createElement("summary");d.textContent=this.copy(t.inclusionMode==="flexible_dates"?"picker.group.flexibleDatesInView":"picker.group.allDates",{count:t.performanceCount});let p=document.createElement("div");p.innerHTML=io(this.performanceCards(t),this.copy(t.inclusionMode==="flexible_dates"?"picker.group.flexibleDatesNote":"picker.group.includedNote",{count:t.performanceCount})),c.append(d,p);let u=document.createElement("div");u.className="sl-pg-held-summary",u.hidden=!0,s.append(r,a,l,c,u);let h=document.createElement("div");h.className="sl-pg-legend";let y=document.createElement("div");y.className="sl-pg-pane",y.setAttribute("role","group"),y.setAttribute("aria-label",this.copy("picker.group.yourSelection")),y.hidden=!0;let g=this.mode==="per_performance"?this.performanceTabs(t):null,T=document.createElement("div");T.className="sl-pg-inner",T.id=this.panelId,T.setAttribute("aria-busy","false"),T.dataset.locked="false",this.mode==="per_performance"&&(T.setAttribute("role","tabpanel"),T.tabIndex=-1);let w=document.createElement("div");w.className="sl-pg-status",w.setAttribute("role","status"),w.setAttribute("aria-live","polite"),w.hidden=!0;let v=document.createElement("p"),A=document.createElement("button");A.type="button",A.hidden=!0,A.textContent=this.copy("picker.group.retry"),A.addEventListener("click",()=>{this.retryRecovery()}),w.append(v,A),T.appendChild(w);let D=document.createElement("div");D.className="sl-pg-live",D.setAttribute("role","status"),D.setAttribute("aria-live","polite"),n.append(o,s),g&&n.append(g),n.append(h,T,y,D),e.appendChild(n),this.root=n,this.progressHost=o,this.legendHost=h,this.paneHost=y,this.datesSummaryHost=d,this.datesCardsHost=p,this.innerHost=T,this.heldSummary=u,this.live=D,this.statusHost=w,this.statusCopy=v,this.statusAction=A,this.syncProgress(),this.syncLegend(),this.syncPane()}async mountPicker(e){let t=new Ke(Sn({container:this.innerHost,event:e.key,apiBase:this.options.apiBase,transport:this.api,hideEventDetails:!0,maxSelection:this.options.maxSelection,selectedObjects:this.options.selectedObjects,selectableObjects:this.options.selectableObjects,numberOfPlacesToSelect:this.options.numberOfPlacesToSelect,selectionValidators:this.options.selectionValidators,locale:this.options.locale,messages:this.options.messages,languages:this.options.languages,colorblindSafe:this.options.colorblindSafe,initialView:this.options.initialView,enable3D:this.options.enable3D,max3DSeats:this.options.max3DSeats,onBuyerViewChange:this.options.onBuyerViewChange,onAnalytics:(n,o)=>{try{this.options.onAnalytics?.(n,{...o,metricScope:"performance_group",performanceGroupKey:e.key,performanceCount:e.performanceCount,selectionMode:this.mode})}catch{}},hideBadge:this.options.hideBadge,theme:this.options.theme,holdTtlMs:this.options.holdTtlMs,initialHoldId:this.options.initialHoldId,restoreHold:this.options.restoreHold,confirmSelection:this.options.confirmSelection,seatView:this.options.seatView,onSelectionChange:n=>this.selectionChanged(n),onSelectionValidityChange:n=>this.selectionValidityChanged(n),onSelectionValid:this.options.onSelectionValid,onSelectionInvalid:this.options.onSelectionInvalid,onSelectionLimit:this.options.onSelectionLimit,onHoldChange:(n,o)=>this.holdChanged(n,o),onCheckout:(n,o)=>this.checkout(n,o),onHoldExpired:()=>{this.activeHandoff=null,this.api.stopSettlementWatch(),this.resetPerPerformanceSelection(),this.syncProgress(),this.syncPane(),this.syncHoldTicker(),this.options.onHoldChange?.(null),this.options.onHoldExpired?.()},onError:this.options.onError},{performanceCount:e.performanceCount,selectionMode:this.mode,submissionState:()=>this.submissionState(),suppressPricing:!0,nights:()=>this.nights(),seatMarks:()=>this.seatMarks(),nightSummary:()=>this.nightSummary(),groupSelectionSummary:()=>this.groupSelectionSummary(),activePerformanceLabel:()=>this.activePerformanceLabel(),selectedPerformanceDates:()=>this.mode==="same_seat"&&e.inclusionMode==="flexible_dates"?xr(this.includedPerformances(),e.performanceCount,this.options.locale,this.copy("picker.group.flexibleSelectedNote",{count:this.includedPerformances().length})):null,selectNight:n=>{this.switchPerformance(n)},selectionModeSwitch:this.options.allowSelectionModeSwitch&&this.mode==="same_seat"?{label:this.copy("picker.group.chooseNightByNight"),activate:()=>{this.switchSelectionMode("per_performance")}}:null,partialSeatSelection:e.inclusionMode==="flexible_dates"&&this.mode==="same_seat"?{label:n=>this.copy("picker.group.selectAvailableDates",{count:n}),activate:(n,o)=>{this.selectPartialSeat(n,o)}}:null,confirmDateSelection:e.inclusionMode==="flexible_dates"&&this.mode==="same_seat"?{includedEventKeys:()=>this.api.includedPerformanceKeys(),availableEventKeys:n=>this.partialSeatDates.get(n)??this.nights().map(o=>o.eventKey),label:n=>this.copy("picker.group.selectAvailableDates",{count:n}),apply:(n,o)=>this.applySeatDates(n,o,!0)}:null}));this.picker=t,await t.render(),!this.destroyed&&this.updateTabs()}performanceCards(e){return e.performances.map(t=>({eventKey:t.eventKey,name:t.name,iso:new Date(t.startsAt).toISOString(),date:cn(t,this.options.locale),time:dn(t,this.options.locale)}))}nights(){return(this.descriptorValue?.performances??[]).map(e=>({eventKey:e.eventKey,name:e.name,shortDate:pn(e,this.options.locale)}))}seatMarks(){let e=this.descriptorValue?.performanceCount??0,t=this.availability,n=!!t?.salesClosed||!!t&&t.state!=="active",o=this.mode==="same_seat"&&!n?t?.partial??{}:{},s={};for(let r of this.markedLabels)s[r]=null;if(this.markedLabels.clear(),e>0)for(let[r,a]of Object.entries(o))!a.length||a.length>=e||(s[r]={kind:"partial",fraction:(e-a.length)/e,data:{blockedEventKeys:[...a]}},this.markedLabels.add(r));return s}activePerformanceLabel(){if(this.mode!=="per_performance")return null;let e=this.descriptorValue?.performances.find(o=>o.eventKey===this.activePerformanceKey);if(!e)return null;let t=pn(e,this.options.locale),n=e.name?.trim();return n&&n!==t?`${n} \xB7 ${t}`:t}nightSummary(){return this.mode!=="per_performance"?[]:(this.descriptorValue?.performances??[]).map(e=>({eventKey:e.eventKey,name:pn(e,this.options.locale),labels:(this.selectionsByEvent.get(e.eventKey)??[]).map(t=>t.label),active:e.eventKey===this.activePerformanceKey}))}groupSelectionSummary(){let e=this.includedPerformances();if(!e.length)return null;if(this.mode==="same_seat"){let s=this.activeHandoff?.seatLabels.length??this.picker?.getSelection().length??0;return{seats:s*e.length,performances:e.length,totalPerformances:this.descriptorValue?.performanceCount??e.length,performancesChosen:s?e.length:0,perPerformance:s}}let t=e.map(s=>this.selectionsByEvent.get(s.eventKey)?.length??0),n=t.filter(s=>s>0),o=n.length===t.length&&n.every(s=>s===n[0]);return{seats:t.reduce((s,r)=>s+r,0),performances:e.length,totalPerformances:this.descriptorValue?.performanceCount??e.length,performancesChosen:n.length,perPerformance:o&&n.length?n[0]:null}}syncProgress(){if(!this.progressHost)return;let e=!!this.activeHandoff,t=[{id:"performances",label:this.copy("picker.group.stepPerformances"),state:"done"},{id:"seats",label:this.copy("picker.group.stepSeats"),state:e?"done":"current"},{id:"review",label:this.copy("picker.group.stepReview"),state:this.booked?"done":e?"current":"upcoming"}];this.progressHost.innerHTML=Hr(t,{label:this.copy("picker.group.progressLabel"),done:this.copy("picker.group.stepDone"),current:this.copy("picker.group.stepCurrent"),upcoming:this.copy("picker.group.notStarted")})}syncLegend(){if(!this.legendHost)return;let e=this.availability,t=!!e?.salesClosed||e&&e.state!=="active";if(!e||t){this.legendHost.replaceChildren();return}this.legendHost.innerHTML=kr({available:e.freeCount>0,selected:(this.picker?.getSelection().length??0)>0,partial:Object.keys(e.partial).length>0,unavailable:e.blockedCount>0},{title:this.copy("picker.group.legendTitle"),available:this.copy("picker.group.legendAvailable"),selected:this.copy("picker.group.legendSelected"),partial:this.copy("picker.group.legendNotEveryDate"),unavailable:this.copy("picker.group.legendUnavailable")},this.categoryColor())}categoryColor(){return this.picker?.categoryLegendColor()??"#2563eb"}syncPane(){let e=this.paneHost;if(!e)return;let t=this.includedPerformances();if(this.mode!=="same_seat"||!t.length){e.hidden=!0,e.replaceChildren();return}let n=this.activeHandoff?.seatLabels??this.picker?.getSelection().map(s=>s.label)??[],o=this.heldTotal();e.hidden=!1,e.innerHTML=Rr({title:this.copy("picker.group.yourSelection"),rows:t.map(s=>({eventKey:s.eventKey,name:`${cn(s,this.options.locale)} ${dn(s,this.options.locale)}`,labels:n})),empty:this.copy("picker.group.noSeatsChosenYet"),note:o?null:this.copy("picker.group.pricesPerPerformance"),total:o?{label:this.copy("picker.group.total"),amount:o}:null,holdStatus:this.booked?this.copy("picker.group.bookedAll",{count:t.length}):this.activeHandoff?this.copy("picker.group.heldTogether",{count:t.length,time:Ir(this.activeHandoff.expiresAt-Date.now())}):null})}heldTotal(){let e=this.activeHandoff,t=this.descriptorValue;if(!e||!t)return null;let o=this.api.allocationsForHold(e.holdId).flatMap(a=>a.items);if(!o.length)return null;let s=o.reduce((a,l)=>a+l.unitPrice*(l.quantity??1),0),r=o[0]?.currency??t.currency;try{return(0,We.formatMoney)(s,r,void 0,this.options.locale)}catch{return`${r} ${s.toFixed(2)}`}}includedPerformances(){let e=this.descriptorValue?.performances??[];if(this.descriptorValue?.inclusionMode!=="flexible_dates")return e;let t=new Set(this.api.includedPerformanceKeys());return e.filter(n=>t.has(n.eventKey))}syncIncludedDates(){let e=this.descriptorValue;if(!e||!this.datesSummaryHost||!this.datesCardsHost)return;let t=this.includedPerformances(),n=e.inclusionMode==="flexible_dates";this.datesSummaryHost.textContent=n&&t.length<e.performanceCount?this.copy("picker.group.flexibleDatesSelected",{selected:t.length,total:e.performanceCount}):this.copy(n?"picker.group.flexibleDatesInView":"picker.group.allDates",{count:e.performanceCount}),this.datesCardsHost.innerHTML=io(this.performanceCards({...e,performances:t}),this.copy(n&&t.length<e.performanceCount?"picker.group.flexibleSelectedNote":n?"picker.group.flexibleDatesNote":"picker.group.includedNote",{count:t.length}))}async selectPartialSeat(e,t){if(!(this.destroyed||this.holdBlocked()||this.activeHandoff||!t.length)){if((this.picker?.getSelection().length??0)>0){this.announce(this.copy("picker.group.clearBeforePartial"));return}this.partialSeatDates.set(e,[...t]),await this.applySeatDates(e,t,!1)}}async applySeatDates(e,t,n){if(this.destroyed||this.holdBlocked()||this.activeHandoff||!t.length)return!1;let o=this.api.includedPerformanceKeys();if(o.length===t.length&&o.every(s=>t.includes(s)))return!0;this.selectingPartialSeat=!0;try{if(this.api.setIncludedEventKeys(t),this.syncIncludedDates(),await this.picker?.refreshAvailability(),!(n?this.picker?.selectObjectsWithoutConfirmation([e])??[]:this.picker?.selectObjects([e])??[]).length)throw new Error("performance_group_partial_seat_unavailable");return this.announce(this.copy("picker.group.selectedAvailableDates",{count:t.length})),this.syncPane(),this.syncLegend(),!0}catch(s){return o.length&&(this.api.setIncludedEventKeys(o),this.syncIncludedDates(),await this.picker?.refreshAvailability().catch(()=>{})),this.options.onError?.(s),!1}finally{this.selectingPartialSeat=!1}}syncHoldTicker(){this.booked||(this.activeHandoff&&!this.holdTicker?this.holdTicker=setInterval(()=>this.syncPane(),1e3):!this.activeHandoff&&this.holdTicker&&(clearInterval(this.holdTicker),this.holdTicker=null))}async switchSelectionMode(e){if(!(this.destroyed||this.switchingMode||e===this.mode)&&!(this.activeHandoff||this.holdBlocked())){this.switchingMode=!0;try{this.api.setSelectionMode(e,this.options.numberOfPlacesToSelect),this.selectionModeValue=e,this.picker?.destroy(),this.picker=null,this.selectionsByEvent.clear(),this.validByEvent.clear(),this.markedLabels.clear(),this.availability=null;let t=this.descriptorValue;if(this.activePerformanceKey=t.performances[0]?.eventKey??null,this.buildChrome(Rl(this.options.container),t),await this.mountPicker(t),this.destroyed)return;this.announce(this.copy("picker.group.nightByNightStarted")),this.options.onSelectionModeChange?.(e)}catch(t){if(t instanceof J)return;this.options.onError?.(t)}finally{this.switchingMode=!1}}}async release(){await this.picker?.release()}close(){this.destroy()}destroy(){if(this.destroyed)return;this.destroyed=!0,this.api.destroy(),this.holdTicker&&clearInterval(this.holdTicker),this.holdTicker=null;let e=this.picker;this.root?.setAttribute("hidden","");let t=()=>{e?.destroy(),this.access.clear(),this.root?.remove(),this.root=null,this.picker=null,this.innerHost=null,this.tabsHost=null,this.statusHost=null,this.statusCopy=null,this.statusAction=null,this.live=null};e?.getCurrentHold()&&!this.continued?e.release().catch(()=>{}).finally(t):t()}copy(e,t){let n=this.options.messages?.[e];return n!==void 0?t?n.replace(/\{(\w+)\}/g,(o,s)=>String(t[s]??`{${s}}`)):n:(0,We.t)(e,t)}performanceTabs(e){let t=document.createElement("div");t.className="sl-pg-tabsbar";let n=document.createElement("button");n.type="button",n.className="sl-pg-step",n.dataset.step="previous",n.setAttribute("aria-label",this.copy("picker.group.previousPerformance")),n.textContent="\u2039",n.addEventListener("click",()=>{this.stepPerformance(-1)});let o=document.createElement("button");o.type="button",o.className="sl-pg-step",o.dataset.step="next",o.setAttribute("aria-label",this.copy("picker.group.nextPerformance")),o.textContent="\u203A",o.addEventListener("click",()=>{this.stepPerformance(1)});let s=document.createElement("div");return s.className="sl-pg-tabs",s.setAttribute("role","tablist"),s.setAttribute("aria-label",this.copy("picker.group.performances")),e.performances.forEach((r,a)=>{let l=document.createElement("button");l.type="button",l.className="sl-pg-tab",l.id=`sl-pg-tab-${e.key}-${r.eventKey}`,l.dataset.eventKey=r.eventKey,l.dataset.state="not-started",l.setAttribute("role","tab"),l.setAttribute("aria-selected",String(a===0)),l.setAttribute("aria-controls",this.panelId),l.tabIndex=a===0?0:-1;let c=document.createElement("span");c.className="sl-pg-tab-name",c.textContent=r.name;let d=document.createElement("span");d.className="sl-pg-tab-state",d.textContent=this.copy("picker.group.stillNeedsSeat");let p=document.createElement("span");p.className="sl-pg-tab-badge",p.textContent=this.copy("picker.group.chosenOfTotal",{chosen:0,total:this.options.numberOfPlacesToSelect??1}),l.append(c,p,d),l.addEventListener("click",()=>{this.switchPerformance(r.eventKey)}),l.addEventListener("keydown",u=>this.tabKeydown(u)),s.appendChild(l)}),t.append(n,s,o),this.tabsHost=s,this.prevButton=n,this.nextButton=o,t}tabButtons(){return[...this.tabsHost?.querySelectorAll(".sl-pg-tab")??[]]}tabKeydown(e){let t=this.tabButtons(),n=t.findIndex(a=>a===e.target);if(n<0)return;let o=getComputedStyle(this.tabsHost??document.body).direction==="rtl",s=-1;switch(e.key){case"ArrowRight":s=n+(o?-1:1);break;case"ArrowLeft":s=n+(o?1:-1);break;case"ArrowDown":s=n+1;break;case"ArrowUp":s=n-1;break;case"Home":s=0;break;case"End":s=t.length-1;break;default:return}if(s<0||s>=t.length)return;e.preventDefault();let r=t[s];r.focus({preventScroll:!0}),r.disabled||this.switchPerformance(r.dataset.eventKey)}stepPerformance(e){let t=this.tabButtons(),n=t.findIndex(s=>s.dataset.eventKey===this.activePerformanceKey),o=t[n+e];!o||o.disabled||(o.focus({preventScroll:!0}),this.switchPerformance(o.dataset.eventKey))}submissionState(){let e=this.descriptorValue?.performances??[];if(this.mode!=="per_performance"){let o=!this.holdBlocked();return{complete:e.length,total:e.length,ready:o}}let t=this.options.numberOfPlacesToSelect,n=e.filter(o=>this.selectionsByEvent.get(o.eventKey)?.length===t&&this.validByEvent.get(o.eventKey)!==!1).length;return{complete:n,total:e.length,ready:n===e.length&&!this.holdBlocked()}}holdBlocked(){return this.operationPending||this.recovery.kind!=="idle"||!!this.availability?.salesClosed}selectionChanged(e){if(this.mode!=="per_performance"){this.options.onSelectionChange?.(e),this.syncPane(),this.syncLegend(),!e.length&&!this.activeHandoff&&!this.resettingFlexibleSelection&&!this.selectingPartialSeat&&this.descriptorValue?.inclusionMode==="flexible_dates"&&this.api.includedPerformanceKeys().length<this.descriptorValue.performanceCount&&(this.resettingFlexibleSelection=!0,this.api.setIncludedEventKeys(this.descriptorValue.performances.map(n=>n.eventKey)),this.syncIncludedDates(),this.picker?.refreshAvailability().catch(n=>this.options.onError?.(n)).finally(()=>{this.resettingFlexibleSelection=!1}));return}if(this.refreshingComposition||this.switchingPerformance||!this.activePerformanceKey)return;let t=e.map(n=>({...n}));this.selectionsByEvent.set(this.activePerformanceKey,t),this.api.setPerformanceSelections(this.activePerformanceKey,t.map(n=>({label:n.label}))),t.length!==this.options.numberOfPlacesToSelect?this.validByEvent.set(this.activePerformanceKey,!1):this.validByEvent.has(this.activePerformanceKey)||this.validByEvent.set(this.activePerformanceKey,!0),this.updateTabs(),this.options.onSelectionChange?.(e),this.refreshComposition(),this.syncLegend()}selectionValidityChanged(e){if(this.mode==="per_performance"&&!this.switchingPerformance&&this.activePerformanceKey){let t=this.validByEvent.get(this.activePerformanceKey);this.validByEvent.set(this.activePerformanceKey,e.isValid),this.updateTabs(),!this.refreshingComposition&&t!==e.isValid&&this.refreshComposition()}this.options.onSelectionValidityChange?.(e)}refreshComposition(){if(this.refreshingComposition||!this.picker)return;let e=this.submissionState();this.refreshingComposition=!0;try{this.picker.refreshPerformanceGroupComposition();let t=this.submissionState();(e.complete!==t.complete||e.ready!==t.ready)&&this.picker.refreshPerformanceGroupComposition()}finally{this.refreshingComposition=!1}}tabState(e){let t=this.options.numberOfPlacesToSelect??1,n=(this.selectionsByEvent.get(e)??[]).map(s=>s.label),o=this.copy("picker.group.chosenOfTotal",{chosen:n.length,total:t});return n.length===0?{key:"not-started",label:this.copy("picker.group.stillNeedsSeat"),badge:o}:n.length===t&&this.validByEvent.get(e)!==!1?{key:"complete",label:this.copy("picker.group.completeWithSeats",{seats:n.join(", ")}),badge:o}:n.length===t?{key:"needs-attention",label:this.copy("picker.group.needsAttention"),badge:o}:{key:"in-progress",label:this.copy("picker.group.needsMoreSeats",{count:t-n.length}),badge:o}}updateTabs(){let e=this.tabButtons(),t=this.switchingPerformance||this.operationPending||this.recovery.kind!=="idle"||!!this.activeHandoff;e.forEach(o=>{let s=o.dataset.eventKey,r=this.tabState(s),a=s===this.activePerformanceKey;o.dataset.state=r.key,o.disabled=t,o.setAttribute("aria-selected",String(a)),o.tabIndex=a?0:-1;let l=o.querySelector(".sl-pg-tab-state");l&&(l.textContent=r.label);let c=o.querySelector(".sl-pg-tab-badge");c&&(c.textContent=r.badge);let d=o.querySelector(".sl-pg-tab-name")?.textContent??s;o.setAttribute("aria-label",`${d}: ${r.badge} \xB7 ${r.label}`),a&&this.innerHost?.setAttribute("aria-labelledby",o.id)});let n=e.findIndex(o=>o.dataset.eventKey===this.activePerformanceKey);this.prevButton&&(this.prevButton.disabled=t||n<=0),this.nextButton&&(this.nextButton.disabled=t||n<0||n>=e.length-1)}async switchPerformance(e){if(this.mode!=="per_performance"||this.switchingPerformance||this.holdBlocked()||this.activeHandoff||e===this.activePerformanceKey||!this.picker)return;this.activePerformanceKey&&this.selectionChanged(this.picker.getSelection());let t=this.selectionsByEvent.get(e)?.map(n=>n.label)??[];this.switchingPerformance=!0,this.activePerformanceKey=e,this.updateTabs(),this.setInteractionLocked(!0);try{this.picker.clearSelection(),this.api.setActivePerformance(e),await this.picker.refreshAvailability();let n=this.picker.selectObjects(t);this.switchingPerformance=!1,this.selectionChanged(n),n.length!==t.length&&this.validByEvent.set(e,!1),this.options.onSelectionChange?.(n);let o=this.descriptorValue?.performances.find(s=>s.eventKey===e);o&&this.announce(this.copy("picker.group.performanceOpened",{performance:o.name}))}catch(n){this.options.onError?.(n)}finally{this.switchingPerformance=!1,!this.operationPending&&this.recovery.kind==="idle"&&this.setInteractionLocked(!1),this.updateTabs(),this.picker.refreshPerformanceGroupComposition()}}setInteractionLocked(e){let t=this.innerHost;t&&(t.dataset.locked=String(e),t.setAttribute("aria-busy",String(e)),t.setAttribute("aria-disabled",String(e)))}announce(e){this.live&&(this.live.textContent=e)}showStatus(e,t,n={}){this.statusHost&&this.statusCopy&&this.statusAction&&(this.statusCopy.textContent=t,this.statusHost.hidden=!t,this.statusAction.hidden=!n.retry),this.announce(t),this.options.onStatusChange?.({kind:e,message:t,...n.reference?{reference:n.reference}:{}})}clearStatus(){this.statusHost&&(this.statusHost.hidden=!0),this.statusAction&&(this.statusAction.hidden=!0),this.options.onStatusChange?.({kind:"idle",message:""})}operationChanged(e){if(this.destroyed)return;let t=e.state==="preparing"||e.state==="commit_pending"||e.state==="abort_pending"||e.state==="expire_pending";if(this.operationPending=t,this.setInteractionLocked(t||this.recovery.kind!=="idle"),this.updateTabs(),t){this.showStatus("pending",this.copy(e.state==="commit_pending"?"picker.group.commitPending":e.state==="abort_pending"||e.state==="expire_pending"?"picker.group.abortPending":"picker.group.securing"));return}if(e.state==="booked"){this.bookingSettled();return}if(e.state==="expired"||e.state==="aborted"){this.activeHandoff&&this.holdLost();return}if(e.state==="committed"){this.clearStatus(),this.announce(this.copy("picker.group.secured")),queueMicrotask(()=>this.innerHost?.querySelector('[data-ref="cta"]')?.focus({preventScroll:!0}));return}e.decision==="abort"&&this.recovery.kind==="idle"&&(this.clearStatus(),this.announce(this.copy("picker.group.notSecured")))}bookingSettled(){if(this.booked)return;this.booked=!0,this.root&&(this.root.dataset.booking="booked"),this.clearStatus(),this.holdTicker&&clearInterval(this.holdTicker),this.holdTicker=null;let e=this.activeHandoff?{...this.activeHandoff,bookingState:"booked"}:null;e&&(this.activeHandoff=e),this.syncProgress(),this.syncPane(),this.updateTabs(),this.picker?.notifyGroupSettled("booked"),this.announce(this.copy("picker.group.bookedAll",{count:this.descriptorValue?.performanceCount??0})),e&&this.options.onBooked?.(e)}holdLost(){this.activeHandoff=null,this.api.stopSettlementWatch(),this.resetPerPerformanceSelection(),this.syncProgress(),this.syncPane(),this.syncHoldTicker(),this.picker?.notifyGroupSettled("lost"),this.announce(this.copy("picker.group.notSecured")),this.options.onHoldChange?.(null),this.options.onHoldExpired?.()}recoveryChanged(e){if(!this.destroyed){if(this.recovery=e,this.setInteractionLocked(this.operationPending||e.kind!=="idle"),this.updateTabs(),this.refreshComposition(),e.kind==="idle"){this.operationPending||this.clearStatus();return}if(e.kind==="pending"){this.showStatus("pending",e.longRunning?this.copy("picker.group.longRunning",{reference:e.reference}):this.copy("picker.group.outcomeUnknown"),{reference:e.reference});return}this.showStatus("recovery_failed",this.copy("picker.group.longRunning",{reference:e.reference}),{retry:e.retryable,reference:e.reference}),this.setInteractionLocked(!1)}}async retryRecovery(){if(!(this.destroyed||this.recovery.kind!=="failed"||!this.recovery.retryable))try{await this.api.retryRecovery()}catch(e){if(e instanceof J)return;this.options.onError?.(e)}}async restoreOperation(){try{let e=await this.api.restoreOperation();e&&!this.destroyed&&await this.picker?.adoptRestoredHold(e.holdId)}catch(e){if(e instanceof J)return;this.options.onError?.(e)}}availabilityChanged(e){if(this.destroyed)return;let t=this.availability;if(this.availability=e,e.revisionChanged){this.showStatus("revision_changed",this.copy("picker.group.revisionChanged")),this.reloadDescriptor(e.revision);return}e.salesClosed?this.showStatus("sales_closed",this.copy("picker.group.salesClosed")):t?.salesClosed&&this.clearStatus(),this.updateTabs(),this.refreshComposition(),this.syncLegend()}async reloadDescriptor(e){this.api.acceptRevision(e);try{let t=await this.api.descriptor();if(this.destroyed)return;this.descriptorValue=t,await this.picker?.refreshAvailability()}catch(t){if(t instanceof J)return;this.options.onError?.(t)}}handoff(e,t){let n=this.descriptorValue,o=this.api.operationIdForHold(e.holdId);if(!n||!o)throw new Error("seatlayer: Performance Group hold identity is unavailable");let s=this.api.allocationsForHold(e.holdId);return{operationId:o,holdId:e.holdId,expiresAt:e.expiresAt,performanceGroup:n,selectionMode:this.mode,performanceKeys:s.map(r=>r.eventKey),bookingState:this.booked?"booked":"held",seatLabels:t.map(r=>r.label),...this.mode==="per_performance"?{allocations:s.map(r=>({eventKey:r.eventKey,seatLabels:r.items.map(a=>a.label)}))}:{}}}renderHeldAllocations(e){if(!(!this.heldSummary||this.mode!=="per_performance")){this.heldSummary.replaceChildren();for(let t of e){let n=this.descriptorValue?.performances.find(r=>r.eventKey===t.eventKey),o=document.createElement("p"),s=document.createElement("strong");s.textContent=n?.name??t.eventKey,o.append(s,document.createTextNode(t.items.map(r=>r.label).join(", "))),this.heldSummary.appendChild(o)}this.heldSummary.hidden=e.length===0}}resetPerPerformanceSelection(){this.mode==="per_performance"&&(this.selectionsByEvent.clear(),this.validByEvent.clear(),this.heldSummary?.replaceChildren(),this.heldSummary&&(this.heldSummary.hidden=!0),this.updateTabs(),this.picker?.refreshPerformanceGroupComposition())}holdChanged(e,t){if(!e){this.activeHandoff=null,this.api.stopSettlementWatch(),this.resetPerPerformanceSelection(),this.syncProgress(),this.syncPane(),this.syncHoldTicker(),this.options.onHoldChange?.(null);return}let n=this.handoff(e,t),o=this.activeHandoff?.holdId!==n.holdId;this.activeHandoff=n,this.renderHeldAllocations(this.api.allocationsForHold(e.holdId)),this.updateTabs(),this.api.watchSettlement(e.holdId),this.syncProgress(),this.syncPane(),this.syncHoldTicker(),o&&this.options.onHold?.(n),this.options.onHoldChange?.(n)}checkout(e,t){let n=this.handoff(e,t);this.continued=!0,this.activeHandoff=n,this.options.onCheckout?.(n)}};var Yt=require("@seatlayer/core");var Il="seatlayer-season-picker-style";function Ol(){if(document.getElementById(Il))return;let i=document.createElement("style");i.id=Il,i.textContent=`
3307
+ `,document.head.appendChild(i)}var zp="https://api.seatlayer.io",$p=6e4,jp=2e3,Gp=1e3,Up=36e5,qp=5e3,Kp=5e3,Wp=15e3,Yp=12e4,Xp=new Set(["preparing","commit_pending","abort_pending","expire_pending"]),J=class extends Error{constructor(){super("performance_group_destroyed"),this.name="PerformanceGroupDestroyedError"}};function Zp(i){return new Promise(e=>setTimeout(e,i))}function bo(i){let e=Number(i.headers.get("Retry-After")??"1");return Number.isFinite(e)?Math.max(50,Math.min(qp,e*1e3)):1e3}function Ft(i,e){return`/pub/performance-groups/${encodeURIComponent(i)}/operations/${encodeURIComponent(e)}`}function Vt(i){return i.replace(/^pghop_/,"").replace(/-/g,"").slice(-8).toUpperCase()}var yo=class{constructor(e,t,n){this.api=e;this.sink=t;this.intervalMs=n;this.stopped=!0;this.timer=null;this.prior=new Map}start(){this.stopped&&(this.stopped=!1,this.tick())}stop(){this.stopped=!0,this.timer&&clearTimeout(this.timer),this.timer=null}async tick(){try{let e=await this.api.objects(this.api.groupKey);if(this.stopped)return;let t=new Map(Object.entries(e.seats)),o=[...new Set([...this.prior.keys(),...t.keys()])].filter(s=>this.prior.get(s)!==t.get(s)).map(s=>({label:s,status:t.get(s)??"blocked"}));this.prior=t,o.length&&this.sink.applyStatuses(o),this.sink.onSections?.(e.hidden??[],e.closed??[])}catch(e){if(e instanceof J){this.stop();return}this.stopped||await this.sink.resync()}finally{this.stopped||(this.timer=setTimeout(()=>{this.tick()},this.intervalMs))}}},En=class{constructor(e,t){this.descriptorCache=null;this.chartRequest=null;this.objectsCache=null;this.activePerformanceKey=null;this.includedEventKeys=new Set;this.reuseObjectsCacheOnce=!1;this.selectionsByEvent=new Map;this.allocationsByHold=new Map;this.pendingOperationId=null;this.operationByHold=new Map;this.knownRevision=null;this.destroyed=!1;this.aborter=new AbortController;this.adoptFailure=null;this.settleTimer=null;this.settleOperationId=null;this.settleStartedAt=0;this.settleState=null;this.settleVisibility=null;this.lastRecovery={kind:"idle"};if(!e)throw new Error("seatlayer: `performanceGroup` key is required");this.groupKey=e,this.base=(t.apiBase??zp).replace(/\/+$/,""),this.access=t.access,this.fetcher=t.fetch??globalThis.fetch.bind(globalThis),this.recoveryTimeoutMs=t.recoveryTimeoutMs??$p,this.realtimePollMs=Math.max(500,t.realtimePollMs??jp),this.selectionMode=t.selectionMode??"same_seat",this.partySize=t.partySize??null,this.onOperationState=t.onOperationState,this.onRecoveryState=t.onRecoveryState,this.onAvailability=t.onAvailability,this.access.onRenewed(o=>this.adoptSession(o));let n=this.readOperationRecord();n&&this.storedIsUndecided(n)&&(this.pendingOperationId=n.operationId)}get pendingOperation(){return this.pendingOperationId}get holdBlocked(){return!!this.adoptFailure||!!this.pendingOperationId&&this.lastRecovery.kind!=="idle"}async descriptor(){let e=await this.json(`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/descriptor`);return this.descriptorCache=e.performanceGroup,this.includedEventKeys.size||(this.includedEventKeys=new Set(e.performanceGroup.performances.map(t=>t.eventKey))),e.performanceGroup.revision&&(this.knownRevision=e.performanceGroup.revision),this.activePerformanceKey??=e.performanceGroup.performances[0]?.eventKey??null,e.performanceGroup}async chart(e){this.chartRequest??=this.json(`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/chart`).catch(o=>{throw this.chartRequest=null,o});let[t,n]=await Promise.all([this.descriptorCache?Promise.resolve(this.descriptorCache):this.descriptor(),this.chartRequest]);return{doc:n,event:{key:t.key,name:t.name,salesClosed:t.state!=="active",venue:t.venue,startsAt:t.performances[0]?.startsAt??null,timezone:t.timezone,currency:t.currency,mode:t.mode,inventoryModelVersion:2}}}asset(e,t){return/^[a-zA-Z0-9._-]+$/.test(t)?this.blob(`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/assets/${encodeURIComponent(t)}`):Promise.reject(new j(404,"not_found","not_found"))}async objects(e){let t=this.descriptorCache?.inclusionMode==="flexible_dates",n=`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/objects`+(this.selectionMode==="per_performance"||t?"?view=per-performance":"");if(this.reuseObjectsCacheOnce&&this.objectsCache)this.reuseObjectsCacheOnce=!1;else{let r=await this.authorized(n,this.objectsCache?.revision?{headers:{"If-None-Match":`"${this.objectsCache.revision}"`}}:{});if(r.status!==304){if(!r.ok)return this.throwResponse(r);this.objectsCache=await this.responseJson(r)}}if(!this.objectsCache)throw new j(502,"group_projection_unavailable","group_projection_unavailable");if(this.selectionMode==="same_seat"&&!t){let r=this.objectsCache;return this.noteAvailability(r,r.salesClosed,r),r}let o=this.objectsCache;if(this.selectionMode==="same_seat"){let r=o.performances.filter(p=>this.includedEventKeys.has(p.eventKey));if(!r.length)throw new j(409,"group_selection_incomplete","group_selection_incomplete");let a=Object.keys(r[0]?.seats??{}),l=Object.fromEntries(a.map(p=>[p,r.every(u=>u.seats[p]==="free")?"free":"blocked"])),c=Object.fromEntries(a.flatMap(p=>{let u=r.filter(h=>h.seats[p]!=="free").map(h=>h.eventKey);return u.length>0&&u.length<r.length?[[p,u]]:[]})),d={seats:l,partial:c,hidden:[...new Set(r.flatMap(p=>p.hidden??[]))],closed:[...new Set(r.flatMap(p=>p.closed??[]))],revision:o.revision,state:o.state,salesClosed:r.some(p=>p.salesClosed)};return this.noteAvailability(o,d.salesClosed,d),d}let s=o.performances.find(r=>r.eventKey===this.activePerformanceKey);if(!s)throw new j(409,"group_performance_unavailable","group_performance_unavailable");return this.noteAvailability(o,o.salesClosed||o.performances.some(r=>r.salesClosed),s),s}setSelectionMode(e,t){if(this.pendingOperationId||this.holdBlocked)throw new j(409,"group_operation_pending","group_operation_pending");e!==this.selectionMode&&(this.selectionMode=e,t!=null&&(this.partySize=t),this.objectsCache=null,this.selectionsByEvent.clear(),this.activePerformanceKey=this.descriptorCache?.performances[0]?.eventKey??this.activePerformanceKey)}setActivePerformance(e){if(this.descriptorCache&&!this.descriptorCache.performances.some(t=>t.eventKey===e))throw new j(404,"group_performance_not_found","group_performance_not_found");this.activePerformanceKey=e}setIncludedEventKeys(e){let t=new Set(this.descriptorCache?.performances.map(n=>n.eventKey)??[]);if(!e.length||new Set(e).size!==e.length||e.some(n=>!t.has(n)))throw new j(422,"invalid_event_keys","invalid_event_keys");this.includedEventKeys=new Set(e),this.reuseObjectsCacheOnce=!!this.objectsCache}includedPerformanceKeys(){return(this.descriptorCache?.performances??[]).map(e=>e.eventKey).filter(e=>this.includedEventKeys.has(e))}setPerformanceSelections(e,t){this.selectionsByEvent.set(e,t.map(n=>({...n})))}allocationsForHold(e){return(this.allocationsByHold.get(e)??[]).map(t=>({eventKey:t.eventKey,items:t.items.map(n=>({...n}))}))}async hold(e,t,n,o){if(this.assertUsable(),o)throw new j(409,"group_hold_replace_unsupported","group_hold_replace_unsupported");let s=t.map(c=>c.label),r={labels:s};if(this.descriptorCache?.inclusionMode==="flexible_dates"&&(r.eventKeys=this.includedPerformanceKeys()),this.selectionMode==="per_performance"){if(!this.activePerformanceKey||!this.descriptorCache||!this.partySize)throw new j(409,"group_selection_incomplete","group_selection_incomplete");this.setPerformanceSelections(this.activePerformanceKey,t);let c=this.descriptorCache.performances.filter(d=>this.includedEventKeys.has(d.eventKey)).map(d=>({eventKey:d.eventKey,selections:this.selectionsByEvent.get(d.eventKey)??[]}));if(c.some(d=>d.selections.length!==this.partySize))throw new j(409,"group_selection_incomplete","group_selection_incomplete");r={selectionMode:"per_performance",allocations:c,...this.descriptorCache.inclusionMode==="flexible_dates"?{eventKeys:this.includedPerformanceKeys()}:{}}}let a=this.pendingOperationId??`pghop_${crypto.randomUUID()}`;this.beginOperation(a),this.onOperationState?.({operationId:a,state:"preparing",decision:null});let l;try{l=await this.authorized(`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/hold`,{method:"POST",body:JSON.stringify({operationId:a,...r,...n?{ttlMs:n}:{}})})}catch(c){if(c instanceof J)throw c;if(c instanceof re)throw this.failOperation(a),c;return this.recover(a,s,Date.now()+this.recoveryTimeoutMs)}if(l.status===201||l.status===202||l.status===504){let c=await this.responseJson(l);return this.emit(c.operation),l.status===201?this.complete(c.operation):this.recover(a,s,Date.now()+this.recoveryTimeoutMs,bo(l))}if(l.status===503){let c=await l.clone().json().catch(()=>null);if((c?.code??c?.error)==="performance_group_abort_pending"){let d=c?.operation?.operationId??a;return this.beginOperation(d),c?.operation&&this.emit(c.operation),this.recover(d,s,Date.now()+this.recoveryTimeoutMs,bo(l))}}try{return await this.throwResponse(l,s)}catch(c){throw this.failOperation(a),c}}async release(e,t,n){this.assertUsable();let o=this.operationForHold(n),s=await this.json(`${Ft(this.groupKey,o)}/release`,{method:"POST",body:"{}"});return this.operationByHold.delete(n),this.allocationsByHold.delete(n),this.clearOperationRecord(),s}async resume(e,t){this.assertUsable();let n=this.operationForHold(t),o=await this.json(Ft(this.groupKey,n));return this.complete(o.operation)}async extend(e,t,n=12e4){this.assertUsable();let o=this.operationForHold(t),s=Math.max(Gp,Math.min(Up,Math.round(n))),r=await this.json(`${Ft(this.groupKey,o)}/extend`,{method:"POST",body:JSON.stringify({ttlMs:s})}),a=this.complete(r.operation);return{holdId:a.holdId,expiresAt:a.expiresAt}}bestAvailable(){return Promise.reject(new j(400,"group_best_available_unsupported","group_best_available_unsupported"))}socketUrl(){return""}createRealtime(e,t){return new yo(this,t,this.realtimePollMs)}operationIdForHold(e){return this.operationByHold.get(e)??this.readMapping(e)}rememberOperation(e,t){!e||!t||(this.operationByHold.set(e,t),this.writeMapping(e,t))}async restoreOperation(){let e=this.readOperationRecord();if(!e)return null;if(!this.storedIsUndecided(e)&&e.state!=="committed"&&e.state!=="booked")return this.clearOperationRecord(),null;this.pendingOperationId=e.operationId,this.emitRecovery({kind:"pending",operationId:e.operationId,phase:e.state==="undecided"?"unknown":e.state,longRunning:!1,reference:Vt(e.operationId)});let t;try{t=await this.authorized(Ft(this.groupKey,e.operationId))}catch(s){return s instanceof J||this.recoveryFailed(e.operationId,"request_failed"),null}if(t.status===404)return this.failOperation(e.operationId),null;if(!t.ok)return this.recoveryFailed(e.operationId,"request_failed"),null;let n=await this.responseJson(t);this.emit(n.operation);let o=n.operation.state;return o==="committed"||o==="booked"?(this.emitRecovery({kind:"idle"}),this.complete(n.operation)):o==="aborted"||o==="expired"?(this.failOperation(e.operationId),null):this.recover(e.operationId,[],Date.now()+this.recoveryTimeoutMs)}async retryRecovery(){this.assertUsable();let e=this.pendingOperationId??this.readOperationRecord()?.operationId??null;return e?(this.pendingOperationId=e,this.recover(e,[],Date.now()+this.recoveryTimeoutMs)):null}watchSettlement(e){if(this.destroyed)return;let t=this.operationIdForHold(e);!t||t===this.settleOperationId||(this.stopSettlementWatch(),this.settleOperationId=t,this.settleStartedAt=Date.now(),this.settleState="committed",typeof document<"u"&&(this.settleVisibility=()=>{document.hidden||!this.settleOperationId||this.pollSettlement()},document.addEventListener("visibilitychange",this.settleVisibility)),this.scheduleSettlementPoll())}stopSettlementWatch(){this.settleTimer&&clearTimeout(this.settleTimer),this.settleTimer=null,this.settleOperationId=null,this.settleState=null,this.settleVisibility&&typeof document<"u"&&document.removeEventListener("visibilitychange",this.settleVisibility),this.settleVisibility=null}scheduleSettlementPoll(){if(this.destroyed||!this.settleOperationId)return;if(this.settleTimer&&clearTimeout(this.settleTimer),typeof document<"u"&&document.hidden){this.settleTimer=null;return}let t=Date.now()-this.settleStartedAt>=Yp?Wp:Kp;this.settleTimer=setTimeout(()=>{this.pollSettlement()},t)}settled(e){return e==="booked"||e==="expired"||e==="aborted"}async pollSettlement(){let e=this.settleOperationId;if(this.destroyed||!e)return;if(typeof document<"u"&&document.hidden){this.settleTimer&&clearTimeout(this.settleTimer),this.settleTimer=null;return}let t;try{let o=await this.authorized(Ft(this.groupKey,e));if(!o.ok)return this.scheduleSettlementPoll();t=(await this.responseJson(o)).operation}catch(o){return o instanceof J?this.stopSettlementWatch():this.scheduleSettlementPoll()}if(this.destroyed||this.settleOperationId!==e)return;let n=t.state!==this.settleState;if(this.settleState=t.state,n&&this.noteOperationState(e,t.state),this.settled(t.state)){this.stopSettlementWatch(),t.state!=="booked"&&this.clearOperationRecord(),this.emit(t);return}n&&this.emit(t),this.scheduleSettlementPoll()}destroy(){if(!this.destroyed){this.destroyed=!0,this.stopSettlementWatch(),this.access.onRenewed(void 0);try{this.aborter.abort()}catch{}}}operationRecordKey(){return`@seatlayer/performance-group-operation/v1/${encodeURIComponent(this.base)}/${encodeURIComponent(this.groupKey)}`}readOperationRecord(){try{let e=window.sessionStorage.getItem(this.operationRecordKey());if(!e)return null;let t=JSON.parse(e);return!t?.operationId||t.groupKey!==this.groupKey?null:t}catch{return null}}storedIsUndecided(e){return e.state==="undecided"||Xp.has(e.state)}writeOperationRecord(e){try{window.sessionStorage.setItem(this.operationRecordKey(),JSON.stringify(e))}catch{}}clearOperationRecord(){try{window.sessionStorage.removeItem(this.operationRecordKey())}catch{}}beginOperation(e){this.pendingOperationId=e;let t=this.readOperationRecord();this.writeOperationRecord({operationId:e,groupKey:this.groupKey,state:"undecided",createdAt:t?.operationId===e?t.createdAt:Date.now()})}noteOperationState(e,t){let n=this.readOperationRecord();!n||n.operationId!==e||this.writeOperationRecord({...n,state:t})}failOperation(e){this.pendingOperationId=null,this.clearOperationRecord(),this.emitRecovery({kind:"idle"}),this.onOperationState?.({operationId:e,state:"aborted",decision:"abort"})}async adoptSession(e){if(this.destroyed)return;let t=`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/session/adopt`;for(let o=0;o<2;o++){if(this.destroyed)return;try{if((await this.fetcher(`${this.base}${t}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e.token}`},body:JSON.stringify({previousToken:e.previousToken}),credentials:"omit",signal:this.aborter.signal})).ok){this.adoptFailure=null;return}}catch{}}if(this.destroyed)return;this.adoptFailure=new j(409,"performance_group_session_adopt_failed","performance_group_session_adopt_failed");let n=this.pendingOperationId??"";throw this.emitRecovery({kind:"failed",operationId:n,reference:n?Vt(n):"",reason:"session_adopt_failed",retryable:!1}),this.adoptFailure}async recover(e,t,n,o=100){let s=o,r=Date.now()+Math.min(8e3,Math.max(500,this.recoveryTimeoutMs/2)),a="unknown";for(;Date.now()<=n;){if(this.destroyed)throw new J;if(this.emitRecovery({kind:"pending",operationId:e,phase:a,longRunning:Date.now()>=r,reference:Vt(e)}),await Zp(s),this.destroyed)throw new J;let l;try{l=await this.authorized(Ft(this.groupKey,e))}catch(p){if(p instanceof J)throw p;if(p instanceof re)throw this.recoveryFailed(e,"request_failed"),p;s=Math.min(2e3,Math.max(100,s*2));continue}if(l.status===404){s=Math.min(1e3,Math.max(100,s*2));continue}if(!l.ok){this.recoveryFailed(e,"request_failed");try{return await this.throwResponse(l,t)}finally{this.pendingOperationId=null,this.clearOperationRecord()}}let d=(await this.responseJson(l)).operation;if(a=d.state,this.noteOperationState(e,d.state),this.emit(d),d.state==="committed"||d.state==="booked")return this.emitRecovery({kind:"idle"}),this.complete(d);if(d.state==="aborted"||d.state==="expired")throw this.failOperation(e),new j(409,"conflict","conflict",t.map(p=>({label:p,status:"held"})));s=bo(l)}throw this.recoveryFailed(e,"deadline"),new j(504,"performance_group_outcome_unknown","performance_group_outcome_unknown")}recoveryFailed(e,t){this.emitRecovery({kind:"failed",operationId:e,reference:Vt(e),reason:t,retryable:!0})}emitRecovery(e){if(this.destroyed)return;let t=this.lastRecovery.kind===e.kind&&JSON.stringify(this.lastRecovery)===JSON.stringify(e);this.lastRecovery=e,t||this.onRecoveryState?.(e)}noteAvailability(e,t,n){if(this.destroyed||!this.onAvailability)return;let o=e.state??this.descriptorCache?.state??"active",s=e.revision??null,r=!!s&&!!this.knownRevision&&s!==this.knownRevision;s&&!this.knownRevision&&(this.knownRevision=s);let a=n?.partial??{},l=Object.values(n?.seats??{});this.onAvailability({partial:a,freeCount:l.filter(c=>c==="free").length,blockedCount:Object.keys(n?.seats??{}).filter(c=>n.seats[c]!=="free"&&!(c in a)).length,state:o,salesClosed:!!t||o!=="active",revision:s,revisionChanged:r})}acceptRevision(e){this.knownRevision=e}complete(e){if(!e.hold||e.hold.expiresAt==null)throw new j(409,"group_hold_not_active","group_hold_not_active");this.pendingOperationId=null,this.noteOperationState(e.operationId,e.state),this.operationByHold.set(e.hold.id,e.operationId),this.writeMapping(e.hold.id,e.operationId);let t=e.hold.allocations??[];this.allocationsByHold.set(e.hold.id,t);let n=t.find(o=>o.eventKey===this.activePerformanceKey)?.items;return{holdId:e.hold.id,expiresAt:e.hold.expiresAt,items:n??e.hold.items??[]}}emit(e){this.destroyed||this.onOperationState?.({operationId:e.operationId,state:e.state,decision:e.decision})}operationForHold(e){let t=this.operationIdForHold(e);if(!t)throw new j(404,"group_hold_not_found","group_hold_not_found");return t}mappingKey(e){return`@seatlayer/performance-group-hold/v1/${encodeURIComponent(this.base)}/${encodeURIComponent(this.groupKey)}/${encodeURIComponent(e)}`}readMapping(e){try{return window.sessionStorage.getItem(this.mappingKey(e))}catch{return null}}writeMapping(e,t){try{window.sessionStorage.setItem(this.mappingKey(e),t)}catch{}}assertUsable(){if(this.destroyed)throw new J;if(this.adoptFailure)throw this.adoptFailure}async authorized(e,t={},n=!1){if(this.destroyed)throw new J;if(this.adoptFailure)throw this.adoptFailure;let o={...t.headers};t.body!==void 0&&(o["Content-Type"]="application/json");let s=await this.access.authorization(n?"unauthorized":"initial");if(this.destroyed)throw new J;if(this.adoptFailure)throw this.adoptFailure;if(!s)throw new Error("performance_group_buyer_access_required");o.Authorization=s;let r=await this.fetcher(`${this.base}${e}`,{method:t.method??"GET",headers:o,body:t.body,credentials:"omit",signal:this.aborter.signal});if(!n&&(r.status===401||r.status===403||r.status===422)){let a=await r.clone().json().catch(()=>null);if(await this.access.handleFailure(r.status,a?.code??a?.error))return this.authorized(e,t,!0)}return r}async json(e,t={}){let n=await this.authorized(e,t);return n.ok?this.responseJson(n):this.throwResponse(n)}async blob(e){let t=await this.authorized(e);return t.ok?t.blob():this.throwResponse(t)}async responseJson(e){return e.json()}async throwResponse(e,t=[]){let o=await e.json().catch(()=>null)??{},s=o.code??o.error??`request_failed_${e.status}`;throw e.status===409&&!o.conflicts?.length&&t.length&&(o.conflicts=t.map(r=>({label:r,status:"held"}))),new j(e.status,o.error??s,s,o.conflicts)}};var Qp="https://api.seatlayer.io";function Il(i){let e=typeof i=="string"?document.querySelector(i):i;if(!e)throw new Error("seatlayer: Performance Group picker container was not found");return e}var Cn=class{constructor(e){this.descriptorValue=null;this.picker=null;this.root=null;this.innerHost=null;this.tabsHost=null;this.prevButton=null;this.nextButton=null;this.heldSummary=null;this.live=null;this.statusHost=null;this.statusCopy=null;this.statusAction=null;this.rendered=!1;this.destroyed=!1;this.continued=!1;this.switchingPerformance=!1;this.operationPending=!1;this.recovery={kind:"idle"};this.availability=null;this.activePerformanceKey=null;this.selectionsByEvent=new Map;this.validByEvent=new Map;this.refreshingComposition=!1;this.activeHandoff=null;this.selectionModeValue="same_seat";this.progressHost=null;this.legendHost=null;this.paneHost=null;this.datesSummaryHost=null;this.datesCardsHost=null;this.resettingFlexibleSelection=!1;this.selectingPartialSeat=!1;this.partialSeatDates=new Map;this.markedLabels=new Set;this.holdTicker=null;this.switchingMode=!1;this.booked=!1;if(!e||typeof e!="object")throw new Error("seatlayer: options object is required");if(!e.performanceGroup)throw new Error("seatlayer: `performanceGroup` key is required");if(!e.container)throw new Error("seatlayer: `container` is required");if(!e.buyerAccessToken&&!e.buyerAccessTokenProvider)throw new Error("seatlayer: Performance Group buyer access is required");if(!!e.initialHoldId!=!!e.initialOperationId)throw new Error("seatlayer: `initialHoldId` and `initialOperationId` must be supplied together");if((e.selectionMode==="per_performance"||e.allowSelectionModeSwitch)&&(!Number.isSafeInteger(e.numberOfPlacesToSelect)||(e.numberOfPlacesToSelect??0)<1))throw new Error("seatlayer: `numberOfPlacesToSelect` is required for per-performance selection");this.selectionModeValue=e.selectionMode??"same_seat",this.options=e,this.panelId=`sl-pg-panel-${e.performanceGroup}`,this.access=new me({provider:e.buyerAccessTokenProvider,token:e.buyerAccessToken,onExpired:e.onAccessExpired,onUnavailable:e.onAccessUnavailable}),this.api=new En(e.performanceGroup,{apiBase:e.apiBase,access:this.access,selectionMode:e.selectionMode,partySize:e.selectionMode==="per_performance"?e.numberOfPlacesToSelect:void 0,onOperationState:t=>this.operationChanged(t),onRecoveryState:t=>this.recoveryChanged(t),onAvailability:t=>this.availabilityChanged(t)}),e.initialHoldId&&e.initialOperationId&&this.api.rememberOperation(e.initialHoldId,e.initialOperationId)}get mode(){return this.selectionModeValue}get selectionMode(){return this.selectionModeValue}get descriptor(){return this.descriptorValue}get currentHold(){return this.activeHandoff}async render(){if(this.rendered)return this;let e=performance.now();if(this.rendered=!0,Rl(),await(0,We.loadLocale)(this.options.locale),this.options.messages&&(0,We.setStringOverrides)(this.options.messages),this.destroyed)return this;let t;try{t=await this.api.descriptor()}catch(n){throw Ae({apiBase:this.options.apiBase??Qp,event:this.options.performanceGroup,scope:"performance_group",surface:"performance_group_picker",outcome:"failure",stage:"group_descriptor",ms:performance.now()-e,load:Oe(this.options.performanceGroup),transport:"pubapi"}),n}return this.destroyed?this:(this.descriptorValue=t,this.activePerformanceKey=t.performances[0]?.eventKey??null,this.buildChrome(Il(this.options.container),t),this.announce(this.copy("picker.group.checkingAvailability")),await this.mountPicker(t),this.destroyed?this:(await this.restoreOperation(),this))}buildChrome(e,t){e.replaceChildren();let n=document.createElement("div");n.className="sl-pg-root",n.dataset.performanceGroup=t.key,n.dataset.selectionMode=this.mode;let o=document.createElement("div");o.className="sl-pg-progress";let s=document.createElement("section");s.className="sl-pg-head",s.setAttribute("aria-labelledby",`sl-pg-title-${t.key}`);let r=document.createElement("h2");r.id=`sl-pg-title-${t.key}`,r.textContent=t.name;let a=document.createElement("p");a.className="sl-pg-summary",a.textContent=this.copy(this.mode==="per_performance"?"picker.group.perPerformanceSummary":"picker.group.sameSeatSummary",{count:t.performanceCount});let l=document.createElement("p");l.className="sl-pg-help",l.textContent=this.copy(this.mode==="per_performance"?"picker.group.perPerformanceMapHelp":"picker.group.sameSeatMapHelp");let c=document.createElement("details");c.className="sl-pg-dates",c.open=t.performanceCount<=3;let d=document.createElement("summary");d.textContent=this.copy(t.inclusionMode==="flexible_dates"?"picker.group.flexibleDatesInView":"picker.group.allDates",{count:t.performanceCount});let p=document.createElement("div");p.innerHTML=io(this.performanceCards(t),this.copy(t.inclusionMode==="flexible_dates"?"picker.group.flexibleDatesNote":"picker.group.includedNote",{count:t.performanceCount})),c.append(d,p);let u=document.createElement("div");u.className="sl-pg-held-summary",u.hidden=!0,s.append(r,a,l,c,u);let h=document.createElement("div");h.className="sl-pg-legend";let y=document.createElement("div");y.className="sl-pg-pane",y.setAttribute("role","group"),y.setAttribute("aria-label",this.copy("picker.group.yourSelection")),y.hidden=!0;let f=this.mode==="per_performance"?this.performanceTabs(t):null,T=document.createElement("div");T.className="sl-pg-inner",T.id=this.panelId,T.setAttribute("aria-busy","false"),T.dataset.locked="false",this.mode==="per_performance"&&(T.setAttribute("role","tabpanel"),T.tabIndex=-1);let w=document.createElement("div");w.className="sl-pg-status",w.setAttribute("role","status"),w.setAttribute("aria-live","polite"),w.hidden=!0;let v=document.createElement("p"),A=document.createElement("button");A.type="button",A.hidden=!0,A.textContent=this.copy("picker.group.retry"),A.addEventListener("click",()=>{this.retryRecovery()}),w.append(v,A),T.appendChild(w);let D=document.createElement("div");D.className="sl-pg-live",D.setAttribute("role","status"),D.setAttribute("aria-live","polite"),n.append(o,s),f&&n.append(f),n.append(h,T,y,D),e.appendChild(n),this.root=n,this.progressHost=o,this.legendHost=h,this.paneHost=y,this.datesSummaryHost=d,this.datesCardsHost=p,this.innerHost=T,this.heldSummary=u,this.live=D,this.statusHost=w,this.statusCopy=v,this.statusAction=A,this.syncProgress(),this.syncLegend(),this.syncPane()}async mountPicker(e){let t=new Ke(Sn({container:this.innerHost,event:e.key,apiBase:this.options.apiBase,transport:this.api,hideEventDetails:!0,maxSelection:this.options.maxSelection,selectedObjects:this.options.selectedObjects,selectableObjects:this.options.selectableObjects,numberOfPlacesToSelect:this.options.numberOfPlacesToSelect,selectionValidators:this.options.selectionValidators,locale:this.options.locale,messages:this.options.messages,languages:this.options.languages,colorblindSafe:this.options.colorblindSafe,initialView:this.options.initialView,enable3D:this.options.enable3D,max3DSeats:this.options.max3DSeats,onBuyerViewChange:this.options.onBuyerViewChange,onAnalytics:(n,o)=>{try{this.options.onAnalytics?.(n,{...o,metricScope:"performance_group",performanceGroupKey:e.key,performanceCount:e.performanceCount,selectionMode:this.mode})}catch{}},hideBadge:this.options.hideBadge,theme:this.options.theme,holdTtlMs:this.options.holdTtlMs,initialHoldId:this.options.initialHoldId,restoreHold:this.options.restoreHold,confirmSelection:this.options.confirmSelection,seatView:this.options.seatView,onSelectionChange:n=>this.selectionChanged(n),onSelectionValidityChange:n=>this.selectionValidityChanged(n),onSelectionValid:this.options.onSelectionValid,onSelectionInvalid:this.options.onSelectionInvalid,onSelectionLimit:this.options.onSelectionLimit,onHoldChange:(n,o)=>this.holdChanged(n,o),onCheckout:(n,o)=>this.checkout(n,o),onHoldExpired:()=>{this.activeHandoff=null,this.api.stopSettlementWatch(),this.resetPerPerformanceSelection(),this.syncProgress(),this.syncPane(),this.syncHoldTicker(),this.options.onHoldChange?.(null),this.options.onHoldExpired?.()},onError:this.options.onError},{performanceCount:e.performanceCount,selectionMode:this.mode,submissionState:()=>this.submissionState(),suppressPricing:!0,nights:()=>this.nights(),seatMarks:()=>this.seatMarks(),nightSummary:()=>this.nightSummary(),groupSelectionSummary:()=>this.groupSelectionSummary(),activePerformanceLabel:()=>this.activePerformanceLabel(),selectedPerformanceDates:()=>this.mode==="same_seat"&&e.inclusionMode==="flexible_dates"?Sr(this.includedPerformances(),e.performanceCount,this.options.locale,this.copy("picker.group.flexibleSelectedNote",{count:this.includedPerformances().length})):null,selectNight:n=>{this.switchPerformance(n)},selectionModeSwitch:this.options.allowSelectionModeSwitch&&this.mode==="same_seat"?{label:this.copy("picker.group.chooseNightByNight"),activate:()=>{this.switchSelectionMode("per_performance")}}:null,partialSeatSelection:e.inclusionMode==="flexible_dates"&&this.mode==="same_seat"?{label:n=>this.copy("picker.group.selectAvailableDates",{count:n}),activate:(n,o)=>{this.selectPartialSeat(n,o)}}:null,confirmDateSelection:e.inclusionMode==="flexible_dates"&&this.mode==="same_seat"?{includedEventKeys:()=>this.api.includedPerformanceKeys(),availableEventKeys:n=>this.partialSeatDates.get(n)??this.nights().map(o=>o.eventKey),label:n=>this.copy("picker.group.selectAvailableDates",{count:n}),apply:(n,o)=>this.applySeatDates(n,o,!0)}:null}));this.picker=t,await t.render(),!this.destroyed&&this.updateTabs()}performanceCards(e){return e.performances.map(t=>({eventKey:t.eventKey,name:t.name,iso:new Date(t.startsAt).toISOString(),date:cn(t,this.options.locale),time:dn(t,this.options.locale)}))}nights(){return(this.descriptorValue?.performances??[]).map(e=>({eventKey:e.eventKey,name:e.name,shortDate:pn(e,this.options.locale)}))}seatMarks(){let e=this.descriptorValue?.performanceCount??0,t=this.availability,n=!!t?.salesClosed||!!t&&t.state!=="active",o=this.mode==="same_seat"&&!n?t?.partial??{}:{},s={};for(let r of this.markedLabels)s[r]=null;if(this.markedLabels.clear(),e>0)for(let[r,a]of Object.entries(o))!a.length||a.length>=e||(s[r]={kind:"partial",fraction:(e-a.length)/e,data:{blockedEventKeys:[...a]}},this.markedLabels.add(r));return s}activePerformanceLabel(){if(this.mode!=="per_performance")return null;let e=this.descriptorValue?.performances.find(o=>o.eventKey===this.activePerformanceKey);if(!e)return null;let t=pn(e,this.options.locale),n=e.name?.trim();return n&&n!==t?`${n} \xB7 ${t}`:t}nightSummary(){return this.mode!=="per_performance"?[]:(this.descriptorValue?.performances??[]).map(e=>({eventKey:e.eventKey,name:pn(e,this.options.locale),labels:(this.selectionsByEvent.get(e.eventKey)??[]).map(t=>t.label),active:e.eventKey===this.activePerformanceKey}))}groupSelectionSummary(){let e=this.includedPerformances();if(!e.length)return null;if(this.mode==="same_seat"){let s=this.activeHandoff?.seatLabels.length??this.picker?.getSelection().length??0;return{seats:s*e.length,performances:e.length,totalPerformances:this.descriptorValue?.performanceCount??e.length,performancesChosen:s?e.length:0,perPerformance:s}}let t=e.map(s=>this.selectionsByEvent.get(s.eventKey)?.length??0),n=t.filter(s=>s>0),o=n.length===t.length&&n.every(s=>s===n[0]);return{seats:t.reduce((s,r)=>s+r,0),performances:e.length,totalPerformances:this.descriptorValue?.performanceCount??e.length,performancesChosen:n.length,perPerformance:o&&n.length?n[0]:null}}syncProgress(){if(!this.progressHost)return;let e=!!this.activeHandoff,t=[{id:"performances",label:this.copy("picker.group.stepPerformances"),state:"done"},{id:"seats",label:this.copy("picker.group.stepSeats"),state:e?"done":"current"},{id:"review",label:this.copy("picker.group.stepReview"),state:this.booked?"done":e?"current":"upcoming"}];this.progressHost.innerHTML=Rr(t,{label:this.copy("picker.group.progressLabel"),done:this.copy("picker.group.stepDone"),current:this.copy("picker.group.stepCurrent"),upcoming:this.copy("picker.group.notStarted")})}syncLegend(){if(!this.legendHost)return;let e=this.availability,t=!!e?.salesClosed||e&&e.state!=="active";if(!e||t){this.legendHost.replaceChildren();return}this.legendHost.innerHTML=Tr({available:e.freeCount>0,selected:(this.picker?.getSelection().length??0)>0,partial:Object.keys(e.partial).length>0,unavailable:e.blockedCount>0},{title:this.copy("picker.group.legendTitle"),available:this.copy("picker.group.legendAvailable"),selected:this.copy("picker.group.legendSelected"),partial:this.copy("picker.group.legendNotEveryDate"),unavailable:this.copy("picker.group.legendUnavailable")},this.categoryColor())}categoryColor(){return this.picker?.categoryLegendColor()??"#2563eb"}syncPane(){let e=this.paneHost;if(!e)return;let t=this.includedPerformances();if(this.mode!=="same_seat"||!t.length){e.hidden=!0,e.replaceChildren();return}let n=this.activeHandoff?.seatLabels??this.picker?.getSelection().map(s=>s.label)??[],o=this.heldTotal();e.hidden=!1,e.innerHTML=Ir({title:this.copy("picker.group.yourSelection"),rows:t.map(s=>({eventKey:s.eventKey,name:`${cn(s,this.options.locale)} ${dn(s,this.options.locale)}`,labels:n})),empty:this.copy("picker.group.noSeatsChosenYet"),note:o?null:this.copy("picker.group.pricesPerPerformance"),total:o?{label:this.copy("picker.group.total"),amount:o}:null,holdStatus:this.booked?this.copy("picker.group.bookedAll",{count:t.length}):this.activeHandoff?this.copy("picker.group.heldTogether",{count:t.length,time:Or(this.activeHandoff.expiresAt-Date.now())}):null})}heldTotal(){let e=this.activeHandoff,t=this.descriptorValue;if(!e||!t)return null;let o=this.api.allocationsForHold(e.holdId).flatMap(a=>a.items);if(!o.length)return null;let s=o.reduce((a,l)=>a+l.unitPrice*(l.quantity??1),0),r=o[0]?.currency??t.currency;try{return(0,We.formatMoney)(s,r,void 0,this.options.locale)}catch{return`${r} ${s.toFixed(2)}`}}includedPerformances(){let e=this.descriptorValue?.performances??[];if(this.descriptorValue?.inclusionMode!=="flexible_dates")return e;let t=new Set(this.api.includedPerformanceKeys());return e.filter(n=>t.has(n.eventKey))}syncIncludedDates(){let e=this.descriptorValue;if(!e||!this.datesSummaryHost||!this.datesCardsHost)return;let t=this.includedPerformances(),n=e.inclusionMode==="flexible_dates";this.datesSummaryHost.textContent=n&&t.length<e.performanceCount?this.copy("picker.group.flexibleDatesSelected",{selected:t.length,total:e.performanceCount}):this.copy(n?"picker.group.flexibleDatesInView":"picker.group.allDates",{count:e.performanceCount}),this.datesCardsHost.innerHTML=io(this.performanceCards({...e,performances:t}),this.copy(n&&t.length<e.performanceCount?"picker.group.flexibleSelectedNote":n?"picker.group.flexibleDatesNote":"picker.group.includedNote",{count:t.length}))}async selectPartialSeat(e,t){if(!(this.destroyed||this.holdBlocked()||this.activeHandoff||!t.length)){if((this.picker?.getSelection().length??0)>0){this.announce(this.copy("picker.group.clearBeforePartial"));return}this.partialSeatDates.set(e,[...t]),await this.applySeatDates(e,t,!1)}}async applySeatDates(e,t,n){if(this.destroyed||this.holdBlocked()||this.activeHandoff||!t.length)return!1;let o=this.api.includedPerformanceKeys();if(o.length===t.length&&o.every(s=>t.includes(s)))return!0;this.selectingPartialSeat=!0;try{if(this.api.setIncludedEventKeys(t),this.syncIncludedDates(),await this.picker?.refreshAvailability(),!(n?this.picker?.selectObjectsWithoutConfirmation([e])??[]:this.picker?.selectObjects([e])??[]).length)throw new Error("performance_group_partial_seat_unavailable");return this.announce(this.copy("picker.group.selectedAvailableDates",{count:t.length})),this.syncPane(),this.syncLegend(),!0}catch(s){return o.length&&(this.api.setIncludedEventKeys(o),this.syncIncludedDates(),await this.picker?.refreshAvailability().catch(()=>{})),this.options.onError?.(s),!1}finally{this.selectingPartialSeat=!1}}syncHoldTicker(){this.booked||(this.activeHandoff&&!this.holdTicker?this.holdTicker=setInterval(()=>this.syncPane(),1e3):!this.activeHandoff&&this.holdTicker&&(clearInterval(this.holdTicker),this.holdTicker=null))}async switchSelectionMode(e){if(!(this.destroyed||this.switchingMode||e===this.mode)&&!(this.activeHandoff||this.holdBlocked())){this.switchingMode=!0;try{this.api.setSelectionMode(e,this.options.numberOfPlacesToSelect),this.selectionModeValue=e,this.picker?.destroy(),this.picker=null,this.selectionsByEvent.clear(),this.validByEvent.clear(),this.markedLabels.clear(),this.availability=null;let t=this.descriptorValue;if(this.activePerformanceKey=t.performances[0]?.eventKey??null,this.buildChrome(Il(this.options.container),t),await this.mountPicker(t),this.destroyed)return;this.announce(this.copy("picker.group.nightByNightStarted")),this.options.onSelectionModeChange?.(e)}catch(t){if(t instanceof J)return;this.options.onError?.(t)}finally{this.switchingMode=!1}}}async release(){await this.picker?.release()}close(){this.destroy()}destroy(){if(this.destroyed)return;this.destroyed=!0,this.api.destroy(),this.holdTicker&&clearInterval(this.holdTicker),this.holdTicker=null;let e=this.picker;this.root?.setAttribute("hidden","");let t=()=>{e?.destroy(),this.access.clear(),this.root?.remove(),this.root=null,this.picker=null,this.innerHost=null,this.tabsHost=null,this.statusHost=null,this.statusCopy=null,this.statusAction=null,this.live=null};e?.getCurrentHold()&&!this.continued?e.release().catch(()=>{}).finally(t):t()}copy(e,t){let n=this.options.messages?.[e];return n!==void 0?t?n.replace(/\{(\w+)\}/g,(o,s)=>String(t[s]??`{${s}}`)):n:(0,We.t)(e,t)}performanceTabs(e){let t=document.createElement("div");t.className="sl-pg-tabsbar";let n=document.createElement("button");n.type="button",n.className="sl-pg-step",n.dataset.step="previous",n.setAttribute("aria-label",this.copy("picker.group.previousPerformance")),n.textContent="\u2039",n.addEventListener("click",()=>{this.stepPerformance(-1)});let o=document.createElement("button");o.type="button",o.className="sl-pg-step",o.dataset.step="next",o.setAttribute("aria-label",this.copy("picker.group.nextPerformance")),o.textContent="\u203A",o.addEventListener("click",()=>{this.stepPerformance(1)});let s=document.createElement("div");return s.className="sl-pg-tabs",s.setAttribute("role","tablist"),s.setAttribute("aria-label",this.copy("picker.group.performances")),e.performances.forEach((r,a)=>{let l=document.createElement("button");l.type="button",l.className="sl-pg-tab",l.id=`sl-pg-tab-${e.key}-${r.eventKey}`,l.dataset.eventKey=r.eventKey,l.dataset.state="not-started",l.setAttribute("role","tab"),l.setAttribute("aria-selected",String(a===0)),l.setAttribute("aria-controls",this.panelId),l.tabIndex=a===0?0:-1;let c=document.createElement("span");c.className="sl-pg-tab-name",c.textContent=r.name;let d=document.createElement("span");d.className="sl-pg-tab-state",d.textContent=this.copy("picker.group.stillNeedsSeat");let p=document.createElement("span");p.className="sl-pg-tab-badge",p.textContent=this.copy("picker.group.chosenOfTotal",{chosen:0,total:this.options.numberOfPlacesToSelect??1}),l.append(c,p,d),l.addEventListener("click",()=>{this.switchPerformance(r.eventKey)}),l.addEventListener("keydown",u=>this.tabKeydown(u)),s.appendChild(l)}),t.append(n,s,o),this.tabsHost=s,this.prevButton=n,this.nextButton=o,t}tabButtons(){return[...this.tabsHost?.querySelectorAll(".sl-pg-tab")??[]]}tabKeydown(e){let t=this.tabButtons(),n=t.findIndex(a=>a===e.target);if(n<0)return;let o=getComputedStyle(this.tabsHost??document.body).direction==="rtl",s=-1;switch(e.key){case"ArrowRight":s=n+(o?-1:1);break;case"ArrowLeft":s=n+(o?1:-1);break;case"ArrowDown":s=n+1;break;case"ArrowUp":s=n-1;break;case"Home":s=0;break;case"End":s=t.length-1;break;default:return}if(s<0||s>=t.length)return;e.preventDefault();let r=t[s];r.focus({preventScroll:!0}),r.disabled||this.switchPerformance(r.dataset.eventKey)}stepPerformance(e){let t=this.tabButtons(),n=t.findIndex(s=>s.dataset.eventKey===this.activePerformanceKey),o=t[n+e];!o||o.disabled||(o.focus({preventScroll:!0}),this.switchPerformance(o.dataset.eventKey))}submissionState(){let e=this.descriptorValue?.performances??[];if(this.mode!=="per_performance"){let o=!this.holdBlocked();return{complete:e.length,total:e.length,ready:o}}let t=this.options.numberOfPlacesToSelect,n=e.filter(o=>this.selectionsByEvent.get(o.eventKey)?.length===t&&this.validByEvent.get(o.eventKey)!==!1).length;return{complete:n,total:e.length,ready:n===e.length&&!this.holdBlocked()}}holdBlocked(){return this.operationPending||this.recovery.kind!=="idle"||!!this.availability?.salesClosed}selectionChanged(e){if(this.mode!=="per_performance"){this.options.onSelectionChange?.(e),this.syncPane(),this.syncLegend(),!e.length&&!this.activeHandoff&&!this.resettingFlexibleSelection&&!this.selectingPartialSeat&&this.descriptorValue?.inclusionMode==="flexible_dates"&&this.api.includedPerformanceKeys().length<this.descriptorValue.performanceCount&&(this.resettingFlexibleSelection=!0,this.api.setIncludedEventKeys(this.descriptorValue.performances.map(n=>n.eventKey)),this.syncIncludedDates(),this.picker?.refreshAvailability().catch(n=>this.options.onError?.(n)).finally(()=>{this.resettingFlexibleSelection=!1}));return}if(this.refreshingComposition||this.switchingPerformance||!this.activePerformanceKey)return;let t=e.map(n=>({...n}));this.selectionsByEvent.set(this.activePerformanceKey,t),this.api.setPerformanceSelections(this.activePerformanceKey,t.map(n=>({label:n.label}))),t.length!==this.options.numberOfPlacesToSelect?this.validByEvent.set(this.activePerformanceKey,!1):this.validByEvent.has(this.activePerformanceKey)||this.validByEvent.set(this.activePerformanceKey,!0),this.updateTabs(),this.options.onSelectionChange?.(e),this.refreshComposition(),this.syncLegend()}selectionValidityChanged(e){if(this.mode==="per_performance"&&!this.switchingPerformance&&this.activePerformanceKey){let t=this.validByEvent.get(this.activePerformanceKey);this.validByEvent.set(this.activePerformanceKey,e.isValid),this.updateTabs(),!this.refreshingComposition&&t!==e.isValid&&this.refreshComposition()}this.options.onSelectionValidityChange?.(e)}refreshComposition(){if(this.refreshingComposition||!this.picker)return;let e=this.submissionState();this.refreshingComposition=!0;try{this.picker.refreshPerformanceGroupComposition();let t=this.submissionState();(e.complete!==t.complete||e.ready!==t.ready)&&this.picker.refreshPerformanceGroupComposition()}finally{this.refreshingComposition=!1}}tabState(e){let t=this.options.numberOfPlacesToSelect??1,n=(this.selectionsByEvent.get(e)??[]).map(s=>s.label),o=this.copy("picker.group.chosenOfTotal",{chosen:n.length,total:t});return n.length===0?{key:"not-started",label:this.copy("picker.group.stillNeedsSeat"),badge:o}:n.length===t&&this.validByEvent.get(e)!==!1?{key:"complete",label:this.copy("picker.group.completeWithSeats",{seats:n.join(", ")}),badge:o}:n.length===t?{key:"needs-attention",label:this.copy("picker.group.needsAttention"),badge:o}:{key:"in-progress",label:this.copy("picker.group.needsMoreSeats",{count:t-n.length}),badge:o}}updateTabs(){let e=this.tabButtons(),t=this.switchingPerformance||this.operationPending||this.recovery.kind!=="idle"||!!this.activeHandoff;e.forEach(o=>{let s=o.dataset.eventKey,r=this.tabState(s),a=s===this.activePerformanceKey;o.dataset.state=r.key,o.disabled=t,o.setAttribute("aria-selected",String(a)),o.tabIndex=a?0:-1;let l=o.querySelector(".sl-pg-tab-state");l&&(l.textContent=r.label);let c=o.querySelector(".sl-pg-tab-badge");c&&(c.textContent=r.badge);let d=o.querySelector(".sl-pg-tab-name")?.textContent??s;o.setAttribute("aria-label",`${d}: ${r.badge} \xB7 ${r.label}`),a&&this.innerHost?.setAttribute("aria-labelledby",o.id)});let n=e.findIndex(o=>o.dataset.eventKey===this.activePerformanceKey);this.prevButton&&(this.prevButton.disabled=t||n<=0),this.nextButton&&(this.nextButton.disabled=t||n<0||n>=e.length-1)}async switchPerformance(e){if(this.mode!=="per_performance"||this.switchingPerformance||this.holdBlocked()||this.activeHandoff||e===this.activePerformanceKey||!this.picker)return;this.activePerformanceKey&&this.selectionChanged(this.picker.getSelection());let t=this.selectionsByEvent.get(e)?.map(n=>n.label)??[];this.switchingPerformance=!0,this.activePerformanceKey=e,this.updateTabs(),this.setInteractionLocked(!0);try{this.picker.clearSelection(),this.api.setActivePerformance(e),await this.picker.refreshAvailability();let n=this.picker.selectObjects(t);this.switchingPerformance=!1,this.selectionChanged(n),n.length!==t.length&&this.validByEvent.set(e,!1),this.options.onSelectionChange?.(n);let o=this.descriptorValue?.performances.find(s=>s.eventKey===e);o&&this.announce(this.copy("picker.group.performanceOpened",{performance:o.name}))}catch(n){this.options.onError?.(n)}finally{this.switchingPerformance=!1,!this.operationPending&&this.recovery.kind==="idle"&&this.setInteractionLocked(!1),this.updateTabs(),this.picker.refreshPerformanceGroupComposition()}}setInteractionLocked(e){let t=this.innerHost;t&&(t.dataset.locked=String(e),t.setAttribute("aria-busy",String(e)),t.setAttribute("aria-disabled",String(e)))}announce(e){this.live&&(this.live.textContent=e)}showStatus(e,t,n={}){this.statusHost&&this.statusCopy&&this.statusAction&&(this.statusCopy.textContent=t,this.statusHost.hidden=!t,this.statusAction.hidden=!n.retry),this.announce(t),this.options.onStatusChange?.({kind:e,message:t,...n.reference?{reference:n.reference}:{}})}clearStatus(){this.statusHost&&(this.statusHost.hidden=!0),this.statusAction&&(this.statusAction.hidden=!0),this.options.onStatusChange?.({kind:"idle",message:""})}operationChanged(e){if(this.destroyed)return;let t=e.state==="preparing"||e.state==="commit_pending"||e.state==="abort_pending"||e.state==="expire_pending";if(this.operationPending=t,this.setInteractionLocked(t||this.recovery.kind!=="idle"),this.updateTabs(),t){this.showStatus("pending",this.copy(e.state==="commit_pending"?"picker.group.commitPending":e.state==="abort_pending"||e.state==="expire_pending"?"picker.group.abortPending":"picker.group.securing"));return}if(e.state==="booked"){this.bookingSettled();return}if(e.state==="expired"||e.state==="aborted"){this.activeHandoff&&this.holdLost();return}if(e.state==="committed"){this.clearStatus(),this.announce(this.copy("picker.group.secured")),queueMicrotask(()=>this.innerHost?.querySelector('[data-ref="cta"]')?.focus({preventScroll:!0}));return}e.decision==="abort"&&this.recovery.kind==="idle"&&(this.clearStatus(),this.announce(this.copy("picker.group.notSecured")))}bookingSettled(){if(this.booked)return;this.booked=!0,this.root&&(this.root.dataset.booking="booked"),this.clearStatus(),this.holdTicker&&clearInterval(this.holdTicker),this.holdTicker=null;let e=this.activeHandoff?{...this.activeHandoff,bookingState:"booked"}:null;e&&(this.activeHandoff=e),this.syncProgress(),this.syncPane(),this.updateTabs(),this.picker?.notifyGroupSettled("booked"),this.announce(this.copy("picker.group.bookedAll",{count:this.descriptorValue?.performanceCount??0})),e&&this.options.onBooked?.(e)}holdLost(){this.activeHandoff=null,this.api.stopSettlementWatch(),this.resetPerPerformanceSelection(),this.syncProgress(),this.syncPane(),this.syncHoldTicker(),this.picker?.notifyGroupSettled("lost"),this.announce(this.copy("picker.group.notSecured")),this.options.onHoldChange?.(null),this.options.onHoldExpired?.()}recoveryChanged(e){if(!this.destroyed){if(this.recovery=e,this.setInteractionLocked(this.operationPending||e.kind!=="idle"),this.updateTabs(),this.refreshComposition(),e.kind==="idle"){this.operationPending||this.clearStatus();return}if(e.kind==="pending"){this.showStatus("pending",e.longRunning?this.copy("picker.group.longRunning",{reference:e.reference}):this.copy("picker.group.outcomeUnknown"),{reference:e.reference});return}this.showStatus("recovery_failed",this.copy("picker.group.longRunning",{reference:e.reference}),{retry:e.retryable,reference:e.reference}),this.setInteractionLocked(!1)}}async retryRecovery(){if(!(this.destroyed||this.recovery.kind!=="failed"||!this.recovery.retryable))try{await this.api.retryRecovery()}catch(e){if(e instanceof J)return;this.options.onError?.(e)}}async restoreOperation(){try{let e=await this.api.restoreOperation();e&&!this.destroyed&&await this.picker?.adoptRestoredHold(e.holdId)}catch(e){if(e instanceof J)return;this.options.onError?.(e)}}availabilityChanged(e){if(this.destroyed)return;let t=this.availability;if(this.availability=e,e.revisionChanged){this.showStatus("revision_changed",this.copy("picker.group.revisionChanged")),this.reloadDescriptor(e.revision);return}e.salesClosed?this.showStatus("sales_closed",this.copy("picker.group.salesClosed")):t?.salesClosed&&this.clearStatus(),this.updateTabs(),this.refreshComposition(),this.syncLegend()}async reloadDescriptor(e){this.api.acceptRevision(e);try{let t=await this.api.descriptor();if(this.destroyed)return;this.descriptorValue=t,await this.picker?.refreshAvailability()}catch(t){if(t instanceof J)return;this.options.onError?.(t)}}handoff(e,t){let n=this.descriptorValue,o=this.api.operationIdForHold(e.holdId);if(!n||!o)throw new Error("seatlayer: Performance Group hold identity is unavailable");let s=this.api.allocationsForHold(e.holdId);return{operationId:o,holdId:e.holdId,expiresAt:e.expiresAt,performanceGroup:n,selectionMode:this.mode,performanceKeys:s.map(r=>r.eventKey),bookingState:this.booked?"booked":"held",seatLabels:t.map(r=>r.label),...this.mode==="per_performance"?{allocations:s.map(r=>({eventKey:r.eventKey,seatLabels:r.items.map(a=>a.label)}))}:{}}}renderHeldAllocations(e){if(!(!this.heldSummary||this.mode!=="per_performance")){this.heldSummary.replaceChildren();for(let t of e){let n=this.descriptorValue?.performances.find(r=>r.eventKey===t.eventKey),o=document.createElement("p"),s=document.createElement("strong");s.textContent=n?.name??t.eventKey,o.append(s,document.createTextNode(t.items.map(r=>r.label).join(", "))),this.heldSummary.appendChild(o)}this.heldSummary.hidden=e.length===0}}resetPerPerformanceSelection(){this.mode==="per_performance"&&(this.selectionsByEvent.clear(),this.validByEvent.clear(),this.heldSummary?.replaceChildren(),this.heldSummary&&(this.heldSummary.hidden=!0),this.updateTabs(),this.picker?.refreshPerformanceGroupComposition())}holdChanged(e,t){if(!e){this.activeHandoff=null,this.api.stopSettlementWatch(),this.resetPerPerformanceSelection(),this.syncProgress(),this.syncPane(),this.syncHoldTicker(),this.options.onHoldChange?.(null);return}let n=this.handoff(e,t),o=this.activeHandoff?.holdId!==n.holdId;this.activeHandoff=n,this.renderHeldAllocations(this.api.allocationsForHold(e.holdId)),this.updateTabs(),this.api.watchSettlement(e.holdId),this.syncProgress(),this.syncPane(),this.syncHoldTicker(),o&&this.options.onHold?.(n),this.options.onHoldChange?.(n)}checkout(e,t){let n=this.handoff(e,t);this.continued=!0,this.activeHandoff=n,this.options.onCheckout?.(n)}};var Yt=require("@seatlayer/core");var Ol="seatlayer-season-picker-style";function _l(){if(document.getElementById(Ol))return;let i=document.createElement("style");i.id=Ol,i.textContent=`
3304
3308
  .sl-season-root{--sl-season-accent:var(--sl-accent,#7357d8);box-sizing:border-box;display:grid;gap:12px;min-width:0;max-width:100%;color:var(--sl-text,#18202b);font-family:var(--sl-font,Inter,system-ui,sans-serif)}
3305
3309
  .sl-season-root *{box-sizing:border-box}.sl-season-root button,.sl-season-root summary{font:inherit}
3306
3310
  .sl-season-hero{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:18px;padding:20px;border:1px solid var(--sl-line,#dde3ea);border-radius:18px;background:linear-gradient(135deg,color-mix(in srgb,var(--sl-season-accent) 10%,var(--sl-surface,#fff)),var(--sl-surface,#fff) 58%);box-shadow:0 10px 30px #18202b0a}
@@ -3316,4 +3320,4 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default;text-decoration-color:t
3316
3320
  .sl-season-status{min-height:20px;margin:0;padding:0 4px;color:var(--sl-muted,#627081);font-size:13px}.sl-season-status[data-kind=ready]{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.sl-season-status[data-kind=failed],.sl-season-status[data-kind=partial_terminal]{position:static;width:auto;height:auto;margin:0;padding:10px 12px;overflow:visible;clip:auto;border-radius:10px;background:#fff1f0;color:var(--sl-danger,#b42318);font-weight:700}.sl-season-root[data-busy=true] .sl-season-map{opacity:.82;pointer-events:none}
3317
3321
  @media(max-width:820px){.sl-season-stage{grid-template-columns:1fr}.sl-season-summary-card{position:static;order:-1}.sl-season-map{min-height:590px}}
3318
3322
  @media(max-width:560px){.sl-season-root{gap:9px}.sl-season-hero{grid-template-columns:1fr;padding:15px;border-radius:14px}.sl-season-offer{min-width:0}.sl-season-progress{grid-template-columns:1fr}.sl-season-progress li+li{border-inline-start:0;border-top:1px solid var(--sl-line,#dde3ea)}.sl-season-progress li[data-state=upcoming]{display:none}.sl-season-date-list{grid-template-columns:1fr}.sl-season-map{min-height:560px}.sl-season-summary-card{padding:13px}.sl-season-benefits{display:grid;grid-template-columns:1fr}}
3319
- `,document.head.appendChild(i)}var Qp=new Set(["audience_not_public","sales_not_open","origin_not_allowed"]),Jp=3e4;function eh(i,e){if(!i||typeof i!="object"||Array.isArray(i))return!1;let t=i;return typeof t.token=="string"&&t.token.length>0&&typeof t.expiresAt=="number"&&Number.isFinite(t.expiresAt)&&t.expiresAt>Date.now()&&t.seasonKey===e&&Array.isArray(t.planActivationIds)&&t.planActivationIds.every(n=>typeof n=="string"&&!!n)}var ui=class extends Error{constructor(t,n){super(`season_public_session_refused:${t}`);this.reason=t;this.status=n;this.name="SeasonPublicSessionRefused"}},Ne,Ye,mi,zt,vo=class{constructor(e){this.options=e;P(this,Ne,null);P(this,Ye,null);P(this,mi);P(this,zt);k(this,mi,e.fetch??globalThis.fetch.bind(globalThis)),k(this,zt,e.origin??(typeof location>"u"?void 0:location.origin))}get session(){return m(this,Ne)}async mint(e=!1){if(e&&k(this,Ne,null),m(this,Ne)&&m(this,Ne).expiresAt-Jp>Date.now())return m(this,Ne);if(m(this,Ye))return m(this,Ye);let t=(async()=>{let n=await m(this,mi).call(this,`${this.options.base}/pub/seasons/${encodeURIComponent(this.options.season)}/sessions`,{method:"POST",body:JSON.stringify(m(this,zt)?{origin:m(this,zt)}:{}),credentials:"omit"}),o=await n.json().catch(()=>null);if(!n.ok){let s=o?.code??o?.error;if(n.status===403&&s&&Qp.has(s)){let r=s;throw this.options.onRefused?.({reason:r,code:s,status:n.status,retryable:r==="sales_not_open"}),new ui(r,n.status)}throw new Error(`season_public_session_failed_${n.status}`)}if(!eh(o,this.options.season))throw new Error("season_public_session_invalid");return k(this,Ne,o),o})();k(this,Ye,t);try{return await t}finally{m(this,Ye)===t&&k(this,Ye,null)}}async token(e){let t=e==="expiring"||e==="expired"||e==="unauthorized"||e==="manual",n=await this.mint(t);return{token:n.token,expiresAt:n.expiresAt}}};Ne=new WeakMap,Ye=new WeakMap,mi=new WeakMap,zt=new WeakMap;function _l(i){let e=new vo(i);return{access:new me({provider:({reason:n})=>e.token(n),...i.accessHooks}),loader:e}}var th="https://api.seatlayer.io",ih=6e4,nh=5e3,z=class extends Error{constructor(t,n){super(`season_request_failed:${t}`);this.code=t;this.status=n;this.name="SeasonApiError"}},gi=class extends Error{constructor(t){super(`season_operation_timeout:${t}`);this.operationId=t;this.name="SeasonRecoveryTimeoutError"}};function oh(i,e){let t=Number(i.headers.get("Retry-After")),n=Number.isFinite(t)&&t>=0?t:e.retryAfterSeconds;return Math.max(0,Math.min(nh,n*1e3))}function sh(i,e){return e?.aborted?Promise.reject(e.reason??new DOMException("Aborted","AbortError")):new Promise((t,n)=>{let o=setTimeout(t,i);e?.addEventListener("abort",()=>{clearTimeout(o),n(e.reason??new DOMException("Aborted","AbortError"))},{once:!0})})}function Nl(i){if(!i||typeof i!="object")return"unknown";let e=i;return typeof e.code=="string"?e.code:typeof e.error=="string"?e.error:"unknown"}var rh=/^shc_[a-f0-9]{40}$/,ah=/^shh_[a-f0-9]{40}$/,lh=new Set(["preparing","commit_pending","committed","expire_pending","booking_pending","abort_pending","aborted","partial_terminal","expired","booked"]),ch=new Set(["pending","prepared","refused","applied","expired","booked","aborted"]);function wo(i){return Array.isArray(i)?i.some(wo):!i||typeof i!="object"?!1:Object.entries(i).some(([e,t])=>e==="childHoldId"||e==="child_hold_id"||e==="holdId"&&typeof t=="string"&&rh.test(t)||wo(t))}function fi(i,e,t="invalid_operation_response"){if(!i||typeof i!="object"||Array.isArray(i))throw new z(t,502);if(wo(i))throw new z("unsafe_operation_response",502);let n=i,o=n.allocations,s=new Set,r=Array.isArray(o)&&o.length>0&&o.every(p=>{if(!p||typeof p!="object")return!1;let u=p.eventId,h=p.state;return typeof u!="string"||!u||typeof h!="string"||!ch.has(h)||s.has(u)?!1:(s.add(u),!0)}),a=n.bookingRef===null||typeof n.bookingRef=="string"&&n.bookingRef.length>0,l=n.state!=="booked"||typeof n.bookingRef=="string"&&r&&o.every(p=>p.state==="booked"),c=n.state!=="booking_pending"||typeof n.bookingRef=="string"&&r&&o.some(p=>p.state!=="booked"),d=n.state!=="committed"||n.bookingRef===null;if(n.operationId!==e.operationId||n.seasonId!==e.seasonId||n.kind!=="HOLD"||typeof n.holdId!="string"||!ah.test(n.holdId)||n.policy!=="fixed_inclusion_same_seat"||typeof n.state!="string"||!lh.has(n.state)||typeof n.expiresAt!="number"||!Number.isFinite(n.expiresAt)||n.expiresAt<0||!a||typeof n.location!="string"||!n.location||typeof n.retryAfterSeconds!="number"||!Number.isFinite(n.retryAfterSeconds)||n.retryAfterSeconds<0||!r||!l||!c||!d||n.pricingAuthority!==void 0&&n.pricingAuthority!=="host"||n.authoritativeAmountIncluded!==void 0&&n.authoritativeAmountIncluded!==!1)throw new z(t,502);return{operationId:n.operationId,seasonId:n.seasonId,kind:n.kind,holdId:n.holdId,expiresAt:n.expiresAt,policy:n.policy,pricingAuthority:"host",authoritativeAmountIncluded:!1,state:n.state,bookingRef:n.bookingRef,location:n.location,retryAfterSeconds:n.retryAfterSeconds,allocations:o.map(p=>({eventId:p.eventId,state:p.state}))}}function dh(i,e,t){if(!Array.isArray(i)||i.length!==t||i.some(r=>typeof r!="string"||!r)||new Set(i).size!==i.length||!Array.isArray(e)||e.length!==i.length)throw new z("invalid_best_available_response",502);let n=i,o=new Set(n),s=new Map;for(let r of e){if(!r||typeof r!="object")throw new z("invalid_best_available_response",502);let a=r;if(typeof a.label!="string"||!o.has(a.label)||s.has(a.label)||typeof a.objectId!="string"||!a.objectId||a.objectType!=="seat"||typeof a.categoryKey!="string"||!a.categoryKey||a.tierId!==null&&(typeof a.tierId!="string"||!a.tierId)||a.quantity!==void 0&&a.quantity!==1)throw new z("invalid_best_available_response",502);s.set(a.label,{label:a.label,objectId:a.objectId,objectType:"seat",categoryKey:a.categoryKey,tierId:a.tierId,...a.quantity===void 0?{}:{quantity:a.quantity}})}return{labels:n,items:n.map(r=>s.get(r))}}function ph(i){if(!i||typeof i!="object"||Array.isArray(i))return null;let e=i;if(typeof e.currency!="string"||!e.currency||!Array.isArray(e.packages))return null;let t=[];for(let n of e.packages){if(!n||typeof n!="object")continue;let o=n;if(typeof o.planKey!="string"||!o.planKey||!Array.isArray(o.prices))continue;let s=[],r=new Set;for(let a of o.prices){if(!a||typeof a!="object")continue;let l=a;typeof l.categoryKey!="string"||!l.categoryKey||r.has(l.categoryKey)||typeof l.unitPrice!="number"||!Number.isInteger(l.unitPrice)||l.unitPrice<0||(r.add(l.categoryKey),s.push({categoryKey:l.categoryKey,unitPrice:l.unitPrice}))}s.length&&t.push({planKey:o.planKey,name:typeof o.name=="string"&&o.name?o.name:o.planKey,prices:s})}return t.length?{currency:e.currency,packages:t}:null}function hh(i){if(!i||typeof i!="object"||Array.isArray(i))throw new z("invalid_checkout_response",502);let e=i,t=typeof e.redirectUrl=="string"&&!!e.redirectUrl,n=!!e.clientPayload&&typeof e.clientPayload=="object"&&!Array.isArray(e.clientPayload);if(typeof e.orderId!="string"||!e.orderId||typeof e.currency!="string"||!e.currency||typeof e.totalMinor!="number"||!Number.isFinite(e.totalMinor)||typeof e.expiresAt!="number"||!Number.isFinite(e.expiresAt)||t===n)throw new z("invalid_checkout_response",502);return{orderId:e.orderId,totalMinor:e.totalMinor,currency:e.currency,expiresAt:e.expiresAt,...t?{redirectUrl:e.redirectUrl}:{},...n?{clientPayload:e.clientPayload}:{}}}function Dl(i,e){return{seasonKey:i.key,planActivationId:i.planActivationId,operationId:e.operationId,holdId:e.holdId,expiresAt:e.expiresAt,policy:e.policy,pricingAuthority:"host",authoritativeAmountIncluded:!1,state:e.state,allocations:e.allocations.map(({eventId:t,state:n})=>({eventKey:t,state:n}))}}var ke,ct,Pe,dt,bi,Le,Me,le,we,Bl,An=class{constructor(e,t){P(this,le);P(this,ke);P(this,ct);P(this,Pe);P(this,dt);P(this,bi);P(this,Le,!1);P(this,Me,null);k(this,ke,e),k(this,ct,(t.apiBase??th).replace(/\/$/,"")),k(this,Pe,t.access),k(this,dt,t.fetch??globalThis.fetch.bind(globalThis)),k(this,bi,t.recoveryTimeoutMs??ih),m(this,Pe).onRenewed(n=>S(this,le,Bl).call(this,n))}async descriptor(){let{body:e}=await S(this,le,we).call(this,"GET","");return e.season}async chart(){let{body:e}=await S(this,le,we).call(this,"GET","/chart");return e}async availability(){let{body:e}=await S(this,le,we).call(this,"GET","/availability"),t=Object.values(e.seats??{});return{...e,freeCount:t.filter(n=>n==="free").length,blockedCount:t.filter(n=>n!=="free").length}}async hold(e,t){let{body:n,response:o}=await S(this,le,we).call(this,"POST","/holds",{operationId:t,labels:[...e]});return{operation:fi(n.operation,{seasonId:m(this,ke),operationId:t}),response:o}}async bestAvailable(e){let{body:t,response:n}=await S(this,le,we).call(this,"POST","/best-available",{operationId:e.operationId,qty:e.qty,...e.categoryKey?{categoryKey:e.categoryKey}:{},...e.zoneId?{zoneId:e.zoneId}:{},...e.accessibility?.length?{accessibility:[...e.accessibility]}:{},...e.requireContiguous===!0?{requireContiguous:!0}:{}}),o=fi(t.operation,{seasonId:m(this,ke),operationId:e.operationId},"invalid_best_available_response"),{labels:s,items:r}=dh(t.labels,t.items,e.qty);return{operation:o,labels:s,items:r,response:n}}async operation(e){let{body:t,response:n}=await S(this,le,we).call(this,"GET",`/operations/${encodeURIComponent(e)}`);return{operation:fi(t.operation,{seasonId:m(this,ke),operationId:e}),response:n}}async release(e,t){let{body:n,response:o}=await S(this,le,we).call(this,"POST",`/holds/${encodeURIComponent(e)}/release`,{releaseActionId:t});return{operation:fi(n.operation,{seasonId:m(this,ke),operationId:e}),response:o}}async prices(){let e;try{({body:e}=await S(this,le,we).call(this,"GET","/prices"))}catch(t){if(t instanceof z&&t.status===404)return null;throw t}return ph(e)}async checkout(e){let{body:t}=await S(this,le,we).call(this,"POST","/checkout",{operationId:e.operationId,buyerEmail:e.buyerEmail,...e.buyerName?{buyerName:e.buyerName}:{},...e.provider?{provider:e.provider}:{},...e.returnUrl?{returnUrl:e.returnUrl}:{}});return hh(t)}async orderStatus(e){let t=await m(this,dt).call(this,`${m(this,ct)}/pub/orders/${encodeURIComponent(e)}/status`,{method:"GET",credentials:"omit"}),n=await t.json().catch(()=>null);if(!t.ok)throw new z(Nl(n),t.status);if(n===null)throw new z("invalid_json_response",502);return n}async renewalIntent(e){let{body:t}=await S(this,le,we).call(this,"POST","/renewal-intents",{offerId:e}),n=t.intent;if(!n||n.offerId!==e||n.state!=="intent_received"||!n.intentId||!Number.isFinite(n.receivedAt))throw new z("invalid_renewal_intent_response",502);return n}async waitForTerminal(e,t,n){let o=Date.now(),s=t?{operation:fi(t.operation,{seasonId:m(this,ke),operationId:e}),response:t.response}:await this.operation(e);for(;s.operation.state==="preparing"||s.operation.state==="commit_pending"||s.operation.state==="expire_pending"||s.operation.state==="booking_pending"||s.operation.state==="abort_pending";){if(Date.now()-o>=m(this,bi))throw new gi(e);await sh(oh(s.response,s.operation),n),s=await this.operation(e)}return s.operation}destroy(){m(this,Le)||(k(this,Le,!0),m(this,Pe).onRenewed(void 0),m(this,Pe).clear())}};ke=new WeakMap,ct=new WeakMap,Pe=new WeakMap,dt=new WeakMap,bi=new WeakMap,Le=new WeakMap,Me=new WeakMap,le=new WeakSet,we=async function(e,t,n,o=!0){if(m(this,Le))throw new z("season_api_destroyed",409);if(m(this,Me))throw m(this,Me);let s=await m(this,Pe).authorization();if(m(this,Le))throw new z("season_api_destroyed",409);if(m(this,Me))throw m(this,Me);if(!s)throw new re({reason:"no_token",retryable:!1});let r=await m(this,dt).call(this,`${m(this,ct)}/pub/seasons/${encodeURIComponent(m(this,ke))}${t}`,{method:e,headers:{Authorization:s,...n===void 0?{}:{"Content-Type":"application/json"}},body:n===void 0?void 0:JSON.stringify(n)}),a=await r.json().catch(()=>null);if(!r.ok){let l=Nl(a);if(o&&await m(this,Pe).handleFailure(r.status,l))return S(this,le,we).call(this,e,t,n,!1);let c=m(this,Pe).unavailable;throw c?new re(c):new z(l,r.status)}if(a===null)throw new z("invalid_json_response",502);return{body:a,response:r}},Bl=async function(e){if(m(this,Le))return;let t=`/pub/seasons/${encodeURIComponent(m(this,ke))}/session/adopt`;for(let n=0;n<2;n++){if(m(this,Le))return;try{if((await m(this,dt).call(this,`${m(this,ct)}${t}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e.token}`},body:JSON.stringify({previousToken:e.previousToken}),credentials:"omit"})).ok){k(this,Me,null);return}}catch{}}if(!m(this,Le))throw k(this,Me,new z("season_session_adopt_failed",409)),m(this,Me)};var uh=2500;function mh(i){let e=typeof i=="string"?document.querySelector(i):i;if(!e)throw new Error("seatlayer: Season picker container was not found");return e}function fh(i,e,t){if(i.startsAt==null)return{date:"Date to be announced",time:null};try{let n=new Date(i.startsAt),o=e?{timeZone:e}:{};return{date:new Intl.DateTimeFormat(t,{dateStyle:"medium",...o}).format(n),time:new Intl.DateTimeFormat(t,{timeStyle:"short",...o}).format(n)}}catch{return{date:"Date to be announced",time:null}}}function Fl(i){return i.state==="committed"||i.state==="booked"}var xo=class{constructor(e,t,n){this.transport=e;this.sink=t;this.intervalMs=n;this.timer=null;this.stopped=!0;this.prior={}}start(){this.stopped&&(this.stopped=!1,this.timer=setTimeout(()=>{this.tick()},this.intervalMs))}stop(){this.stopped=!0,this.timer&&clearTimeout(this.timer),this.timer=null}async tick(){if(!this.stopped)try{let e=await this.transport.objects(""),t=Object.entries(e.seats).filter(([n,o])=>this.prior[n]!==o).map(([n,o])=>({label:n,status:o}));this.prior={...e.seats},t.length&&this.sink.applyStatuses(t)}catch{this.stopped||await this.sink.resync()}finally{this.stopped||(this.timer=setTimeout(()=>{this.tick()},this.intervalMs))}}},So=class{constructor(e,t){this.api=e;this.realtimePollMs=t;this.descriptorValue=null;this.availabilityValue=null;this.categoryLabels=new Map;this.reuseAvailabilityOnce=!1;this.nextOperationId=null;this.nextBestAvailable=null;this.nextReleaseActionId=null;this.operationByHold=new Map}prime(e,t){this.descriptorValue=e,this.availabilityValue=t,this.reuseAvailabilityOnce=!0}queueOperation(e){this.nextOperationId=e}queueBestAvailable(e,t){if(this.nextBestAvailable)throw new z("season_best_available_in_progress",409);let n={operationId:e,...t.accessibility?.length?{accessibility:[...t.accessibility]}:{},...t.requireContiguous===!0?{requireContiguous:!0}:{}};return this.nextBestAvailable=n,n}clearBestAvailable(e){this.nextBestAvailable===e&&(this.nextBestAvailable=null)}queueRelease(e){this.nextReleaseActionId=e}operationForHold(e){return this.operationByHold.get(e)??null}remember(e){this.operationByHold.set(e.holdId,e)}forget(e){this.operationByHold.delete(e)}async chart(e){let[t,n]=await Promise.all([this.descriptorValue?Promise.resolve(this.descriptorValue):this.api.descriptor(),this.api.chart()]);this.descriptorValue=t;for(let o of n.categories??[])typeof o?.key=="string"&&typeof o.label=="string"&&this.categoryLabels.set(o.key,o.label);return{doc:n,event:{key:t.key,name:t.name,venue:t.venue,startsAt:t.occurrences[0]?.startsAt??null,timezone:t.timezone,currency:t.currency,mode:t.mode,inventoryModelVersion:2}}}async objects(e){let t;return this.reuseAvailabilityOnce&&this.availabilityValue?(this.reuseAvailabilityOnce=!1,t=this.availabilityValue):(t=await this.api.availability(),this.availabilityValue=t),{seats:{...t.seats}}}async hold(e,t,n,o){if(o)throw new z("season_hold_replace_unsupported",409);let s=this.nextOperationId??`sop_${crypto.randomUUID()}`;this.nextOperationId=null;let r=await this.api.hold(t.map(l=>l.label),s),a=await this.api.waitForTerminal(s,r);if(!Fl(a))throw new z(`season_operation_${a.state}`,409);return this.remember(a),{holdId:a.holdId,expiresAt:a.expiresAt,items:t.map(l=>({label:l.label,objectId:l.label,objectType:"seat",categoryKey:"",tierId:l.tierId??null,unitPrice:0,currency:this.descriptorValue?.currency??"USD",...l.quantity==null?{}:{quantity:l.quantity}}))}}async release(e,t,n){let o=this.operationForHold(n);if(!o)throw new z("season_hold_not_found",404);let s=this.nextReleaseActionId??`sra_${crypto.randomUUID()}`;this.nextReleaseActionId=null;let r=await this.api.release(o.operationId,s),a=await this.api.waitForTerminal(o.operationId,r);if(a.state==="partial_terminal")throw this.remember(a),new z("season_operation_partial_terminal",409);this.forget(n)}async bestAvailable(e,t,n,o){let s=this.nextBestAvailable;this.nextBestAvailable=null;let r=s?.operationId??`sop_${crypto.randomUUID()}`,a=await this.api.bestAvailable({operationId:r,qty:t,...n?{categoryKey:n}:{},...o?{zoneId:o}:{},...s?.accessibility?.length?{accessibility:s.accessibility}:{},...s?.requireContiguous===!0?{requireContiguous:!0}:{}}),l=await this.api.waitForTerminal(r,a);if(!Fl(l))throw new z(`season_operation_${l.state}`,409);this.remember(l);let c=new Map(a.items.map(d=>[d.label,d]));return{holdId:l.holdId,expiresAt:l.expiresAt,labels:[...a.labels],items:a.labels.map(d=>{let p=c.get(d);return{label:d,objectId:p?.objectId??d,objectType:"seat",categoryKey:p?.categoryKey??n??"",tierId:p?.tierId??null,unitPrice:0,currency:this.descriptorValue?.currency??"USD",...p?.quantity==null?{}:{quantity:p.quantity}}})}}categoryLabel(e){return this.categoryLabels.get(e)??e}socketUrl(){return""}createRealtime(e,t){return new xo(this,t,this.realtimePollMs)}},I,ut,jt,fe,ie,vi,ne,Be,Y,ce,Te,Gt,Xe,Fe,mt,xe,wi,He,Ut,qt,ft,Kt,Ze,gt,bt,Wt,x,Vl,zl,ko,To,Eo,Co,Pn,pt,$l,jl,De,yi,Gl,Ul,Ao,Po,ql,Kl,Wl,Lo,Mo,W,ht,Ho,$t,Ln=class{constructor(e){P(this,x);P(this,I);P(this,ut);P(this,jt);P(this,fe);P(this,ie);P(this,vi,new AbortController);P(this,ne,null);P(this,Be,null);P(this,Y,null);P(this,ce,null);P(this,Te,null);P(this,Gt,null);P(this,Xe,null);P(this,Fe,null);P(this,mt,null);P(this,xe,[]);P(this,wi,new Map);P(this,He,!1);P(this,Ut,!1);P(this,qt);P(this,ft,null);P(this,Kt,null);P(this,Ze,null);P(this,gt,"handoff");P(this,bt,null);P(this,Wt,!1);if(!e?.season)throw new Error("seatlayer: `season` key is required");if(!e.container)throw new Error("seatlayer: `container` is required");if("event"in e||"performanceGroup"in e)throw new Error("seatlayer: SeasonPicker is not SeatPicker or PerformanceGroupPicker");k(this,I,e),k(this,ut,mh(e.container));let t={onExpired:o=>e.onAccessExpired?.(o),onUnavailable:o=>{let s=m(this,ft)&&o.reason==="provider_failed"?m(this,ft):o;k(this,ft,null),k(this,Kt,s.reason==="provider_failed"?null:s),e.onAccessUnavailable?.(s),S(this,x,ql).call(this,s)}};if(!e.buyerAccessToken&&!e.buyerAccessTokenProvider){let{access:o,loader:s}=_l({base:(e.apiBase??"https://api.seatlayer.io").replace(/\/$/,""),season:e.season,fetch:e.fetch,onRefused:r=>{k(this,ft,r)},accessHooks:t});k(this,jt,o),k(this,qt,s)}else k(this,qt,null),k(this,jt,new me({token:e.buyerAccessToken,provider:e.buyerAccessTokenProvider,...t}));k(this,fe,new An(e.season,{apiBase:e.apiBase,access:m(this,jt),fetch:e.fetch,recoveryTimeoutMs:e.recoveryTimeoutMs})),k(this,ie,new So(m(this,fe),Math.max(750,e.realtimePollMs??uh)))}async render(){S(this,x,Ho).call(this),Ol(),S(this,x,zl).call(this),S(this,x,W).call(this,{kind:"loading",message:"Loading Season seats available for every performance."},!0);try{let[e,t,n]=await Promise.all([m(this,fe).descriptor(),m(this,fe).availability(),m(this,fe).prices().catch(()=>null)]);return m(this,He)?this:(k(this,ne,e),k(this,Be,t),k(this,Ze,n),k(this,gt,m(this,I).checkout==="hosted"&&e.checkoutMode!=="server"&&n?"hosted":"handoff"),m(this,ie).prime(e,t),S(this,x,ko).call(this),await S(this,x,Vl).call(this,e),m(this,He)?this:(n&&S(this,x,ko).call(this),S(this,x,Wl).call(this),S(this,x,W).call(this,{kind:"ready",message:`${t.freeCount} seat${t.freeCount===1?"":"s"} available for every included performance.`}),m(this,I).initialOperationId&&await this.restoreOperation(m(this,I).initialOperationId),this))}catch(e){if(m(this,He))return this;throw S(this,x,ht).call(this,e)}}async holdSameSeat(e,t){if(S(this,x,$t).call(this),!t.startsWith("sop_"))throw new Error("seatlayer: caller-stable Season operation id is required");if(!e.length)throw new Error("seatlayer: select at least one seat");if(m(this,ie).queueOperation(t),m(this,ce).selectObjectsWithoutConfirmation([...e]),S(this,x,W).call(this,{kind:"pending",message:"Holding the same seats for every performance.",operationId:t},!0),await m(this,ce).handleCta(),!m(this,Y))throw new z("season_hold_not_created",409);return m(this,Y)}async holdBestAvailable(e,t,n={}){if(S(this,x,$t).call(this),!t.startsWith("sop_"))throw new Error("seatlayer: caller-stable Season operation id is required");if(!Number.isInteger(e)||e<1)throw new Error("seatlayer: positive Best Available quantity is required");let o=m(this,ce).maxTickets;if(e>o)throw new Error(`seatlayer: Best Available quantity cannot exceed the configured maximum (${o})`);if(m(this,Ut))throw new z("season_best_available_in_progress",409);k(this,Ut,!0);let s=null;try{if(s=m(this,ie).queueBestAvailable(t,n),S(this,x,W).call(this,{kind:"pending",message:`Finding ${e} Season seat${e===1?"":"s"} available for every performance.`,operationId:t},!0),!await m(this,ce).bestAvailableOrThrow(e,n.categoryKey,{zoneId:n.zoneId})||!m(this,Y))throw new z("season_hold_not_created",409);return m(this,Y)}catch(r){throw S(this,x,ht).call(this,r,t)}finally{s&&m(this,ie).clearBestAvailable(s),k(this,Ut,!1)}}async restoreOperation(e){S(this,x,$t).call(this),S(this,x,W).call(this,{kind:"pending",message:"Restoring your Season selection.",operationId:e},!0);try{let t=await m(this,fe).waitForTerminal(e,void 0,m(this,vi).signal);return t.state==="aborted"||t.state==="expired"?(k(this,Y,null),m(this,I).onHoldChange?.(null),S(this,x,W).call(this,{kind:"released",message:"The previous Season selection is no longer held.",operationId:e}),null):(m(this,ie).remember(t),S(this,x,Co).call(this,t,!1))}catch(t){throw S(this,x,ht).call(this,t,e)}}async release(e){S(this,x,$t).call(this);let t=m(this,Y);if(t){if(!e)throw new Error("seatlayer: caller-stable release action id is required");m(this,ie).queueRelease(e),S(this,x,W).call(this,{kind:"pending",message:"Releasing the Season seats.",operationId:t.operationId},!0);try{m(this,ce)?.getCurrentHold()?.holdId===t.holdId?await m(this,ce).release():(await m(this,ie).release("",[],t.holdId),S(this,x,Pn).call(this)),S(this,x,W).call(this,{kind:"released",message:"The Season seats were released.",operationId:t.operationId})}catch(n){throw S(this,x,ht).call(this,n,t.operationId)}}}async createRenewalIntent(e){if(S(this,x,$t).call(this),!e.startsWith("sro_"))throw new Error("seatlayer: Season renewal offer id is required");S(this,x,W).call(this,{kind:"pending",message:"Recording renewal intent. No purchase is made in the browser."},!0);try{let t=await m(this,fe).renewalIntent(e);return S(this,x,W).call(this,{kind:"renewal_intent",message:"Renewal intent recorded. Your ticketing platform will confirm price, payment, and renewal."}),m(this,I).onRenewalIntent?.(t),t}catch(t){throw S(this,x,ht).call(this,t)}}getDescriptor(){return m(this,ne)}getAvailability(){return m(this,Be)}getHandoff(){return m(this,Y)}destroy(){m(this,He)||(k(this,He,!0),m(this,vi).abort(),S(this,x,Mo).call(this),m(this,ce)?.destroy(),m(this,fe).destroy(),m(this,ut).replaceChildren(),k(this,Te,null),k(this,Gt,null),k(this,Xe,null),k(this,Fe,null),k(this,mt,null),k(this,ne,null),k(this,Be,null),k(this,Y,null))}};I=new WeakMap,ut=new WeakMap,jt=new WeakMap,fe=new WeakMap,ie=new WeakMap,vi=new WeakMap,ne=new WeakMap,Be=new WeakMap,Y=new WeakMap,ce=new WeakMap,Te=new WeakMap,Gt=new WeakMap,Xe=new WeakMap,Fe=new WeakMap,mt=new WeakMap,xe=new WeakMap,wi=new WeakMap,He=new WeakMap,Ut=new WeakMap,qt=new WeakMap,ft=new WeakMap,Kt=new WeakMap,Ze=new WeakMap,gt=new WeakMap,bt=new WeakMap,Wt=new WeakMap,x=new WeakSet,Vl=async function(e){let t=new Ke(Sn({container:m(this,Gt),event:e.key,apiBase:m(this,I).apiBase,transport:m(this,ie),hideEventDetails:!0,maxSelection:m(this,I).maxSelection,selectedObjects:m(this,I).selectedObjects,selectableObjects:m(this,I).selectableObjects,numberOfPlacesToSelect:m(this,I).numberOfPlacesToSelect,selectionValidators:m(this,I).selectionValidators,locale:m(this,I).locale,messages:m(this,I).messages,languages:m(this,I).languages,colorblindSafe:m(this,I).colorblindSafe,initialView:m(this,I).initialView,enable3D:m(this,I).enable3D,max3DSeats:m(this,I).max3DSeats,hideBadge:m(this,I).hideBadge,theme:m(this,I).theme,confirmSelection:m(this,I).confirmSelection,seatView:m(this,I).seatView,onBuyerViewChange:m(this,I).onBuyerViewChange,onAnalytics:(n,o)=>{try{m(this,I).onAnalytics?.(n,{...o,metricScope:"season",seasonKey:e.key,planActivationId:e.planActivationId,performanceCount:e.occurrenceCount})}catch{}},onSelectionChange:n=>{k(this,xe,n.map(o=>o.label)),k(this,wi,new Map(n.filter(o=>!!o.categoryKey).map(o=>[o.label,o.categoryKey]))),S(this,x,pt).call(this),m(this,I).onSelectionChange?.(n)},onSelectionValidityChange:m(this,I).onSelectionValidityChange,onHoldChange:n=>{if(!n){S(this,x,Pn).call(this);return}let o=m(this,ie).operationForHold(n.holdId);o&&S(this,x,Co).call(this,o,!0)},onCheckout:()=>{m(this,Y)&&(S(this,x,De).call(this,"checkout"),m(this,I).onContinue?.(m(this,Y)),m(this,gt)==="hosted"&&S(this,x,Kl).call(this,m(this,Y)))},onHoldExpired:()=>{S(this,x,Pn).call(this),S(this,x,W).call(this,{kind:"released",message:"The Season hold expired. Choose seats again."}),m(this,I).onHoldExpired?.()},onError:n=>S(this,x,ht).call(this,n)},{surface:"season",performanceCount:e.occurrenceCount,selectionMode:"same_seat",suppressPricing:!0,groupSelectionSummary:()=>{let n=m(this,xe).length;return n?{seats:n,performances:e.occurrenceCount,performancesChosen:e.occurrenceCount,perPerformance:n}:null}}));k(this,ce,t),await t.render()},zl=function(){m(this,ut).replaceChildren();let e=document.createElement("section");e.className="sl-season-root",e.setAttribute("aria-label","Season ticket selection");let t=document.createElement("header");t.className="sl-season-hero";let n=document.createElement("ol");n.className="sl-season-progress",n.setAttribute("aria-label","Season checkout progress");for(let[g,T]of["Choose seats","Review package","Checkout"].entries()){let w=document.createElement("li");w.dataset.state=g===0?"current":"upcoming";let v=document.createElement("span");v.textContent=String(g+1),w.append(v,T),n.append(w)}let o=document.createElement("div");o.className="sl-season-stage";let s=document.createElement("div");s.className="sl-season-map";let r=document.createElement("aside");r.className="sl-season-summary-card",r.setAttribute("aria-label","Your Season selection");let a=document.createElement("h3");a.textContent="Your Season seats";let l=document.createElement("p");l.className="sl-season-selection",l.textContent="Choose a seat on the map.";let c=document.createElement("p");c.className="sl-season-rule";let d=document.createElement("i");d.textContent="1\xD7";let p=document.createElement("span");p.textContent="Each seat you choose is reserved for every included performance.",c.append(d,p);let u=document.createElement("p");u.className="sl-season-availability";let h=document.createElement("p");h.className="sl-season-checkout-note",h.textContent="Your ticketing platform confirms package price, payment, admission passes, and member benefits.",r.append(a,l,c,u,h),o.append(s,r);let y=document.createElement("p");y.className="sl-season-status",y.setAttribute("role","status"),y.setAttribute("aria-live","polite"),e.append(t,n,o,y),m(this,ut).append(e),k(this,Te,e),k(this,Gt,s),k(this,Xe,y),k(this,Fe,l),k(this,mt,u)},ko=function(){let e=m(this,ne),t=m(this,I).offer,n=m(this,Te).querySelector(".sl-season-hero");n.replaceChildren();let o=document.createElement("div");o.className="sl-season-copy";let s=document.createElement("p");s.className="sl-season-eyebrow",s.textContent=t?.eyebrow??"Season ticket";let r=document.createElement("h2");r.textContent=e.edition?`${e.name} \xB7 ${e.edition}`:e.name;let a=document.createElement("p");a.className="sl-season-promise",a.textContent=`Choose once and keep the same seat for all ${e.occurrenceCount} included performances.`;let l=document.createElement("div");l.className="sl-season-facts";for(let h of[`${e.occurrenceCount} performances`,e.venue,t?.renewalLabel??"Same-seat package"].filter(Boolean)){let y=document.createElement("span");y.className="sl-season-fact",y.textContent=h,l.append(y)}o.append(s,r,a,l),n.append(o);let c=document.createElement("div");c.className="sl-season-offer";let d=document.createElement("span");d.className="sl-season-offer-label";let p=S(this,x,yi).call(this);if(p){d.textContent=b("season.packagePriceLabel","Package price"),c.append(d,S(this,x,Ul).call(this,p,e.occurrenceCount));let h=document.createElement("span");h.className="sl-season-price-note",h.textContent=b("season.packagePricePerSeat","Per seat, for the whole package."),c.append(h),n.append(c),S(this,x,To).call(this,n,t),S(this,x,Eo).call(this,n,e),S(this,x,pt).call(this);return}d.textContent=t?.priceLabel?"Season package":"Package price";let u=document.createElement(t?.priceLabel?"strong":"span");if(u.className=t?.priceLabel?"sl-season-price":"sl-season-price-note",u.textContent=t?.priceLabel??"Confirmed by your ticketing platform at checkout",c.append(d,u),t?.compareAtPriceLabel){let h=document.createElement("span");h.className="sl-season-was",h.textContent=t.compareAtPriceLabel,c.append(h)}if(t?.savingsLabel){let h=document.createElement("span");h.className="sl-season-saving",h.textContent=t.savingsLabel,c.append(h)}if(t?.priceNote){let h=document.createElement("span");h.className="sl-season-price-note",h.textContent=t.priceNote,c.append(h)}n.append(c),S(this,x,To).call(this,n,t),S(this,x,Eo).call(this,n,e),S(this,x,pt).call(this)},To=function(e,t){if(!t?.benefits?.length)return;let n=document.createElement("ul");n.className="sl-season-benefits";for(let o of t.benefits.slice(0,6)){let s=document.createElement("li");s.textContent=o,n.append(s)}e.append(n)},Eo=function(e,t){let n=document.createElement("details");n.className="sl-season-dates";let o=document.createElement("summary");o.textContent=`All ${t.occurrenceCount} performances included`;let s=document.createElement("ol");s.className="sl-season-date-list";for(let r of t.occurrences){let a=document.createElement("li");a.className="sl-season-date";let l=document.createElement("b");l.textContent=r.name;let c=fh(r,t.timezone,m(this,I).locale),d=document.createElement("time");r.startsAt!=null&&(d.dateTime=new Date(r.startsAt).toISOString()),d.textContent=c.time?`${c.date} \xB7 ${c.time}`:c.date,a.append(l,d),s.append(a)}n.append(o,s),e.append(n)},Co=function(e,t){if(e.state==="booked")return k(this,Y,null),m(this,ie).forget(e.holdId),m(this,ce)?.notifyGroupSettled("booked"),S(this,x,De).call(this,"complete"),S(this,x,W).call(this,{kind:"booked",message:`Your Season booking is complete for all ${m(this,ne).occurrenceCount} performances. No further checkout action is needed.`,operationId:e.operationId}),m(this,I).onHoldChange?.(null),null;if(e.state==="partial_terminal")return k(this,Y,null),k(this,xe,[]),m(this,ie).forget(e.holdId),m(this,ce)?.notifyGroupSettled("lost"),S(this,x,pt).call(this),S(this,x,De).call(this,"review"),S(this,x,W).call(this,{kind:"partial_terminal",message:"This Season selection needs organizer review. Do not try another selection.",operationId:e.operationId}),m(this,I).onHoldChange?.(null),null;if(e.state!=="committed")return k(this,Y,null),m(this,ie).forget(e.holdId),m(this,ce)?.notifyGroupSettled("lost"),S(this,x,W).call(this,{kind:"failed",message:"The Season selection could not be completed.",operationId:e.operationId}),m(this,I).onHoldChange?.(null),null;let n=Dl(m(this,ne),e),o=m(this,Y)?.holdId!==n.holdId;return k(this,Y,n),S(this,x,pt).call(this),S(this,x,De).call(this,"review"),m(this,I).onHoldChange?.(n),S(this,x,W).call(this,{kind:"held",message:`Your seats are held for all ${m(this,ne).occurrenceCount} performances. Review and continue to checkout.`,operationId:e.operationId}),o&&t&&m(this,I).onHold?.(n),n},Pn=function(){k(this,Y,null),k(this,xe,[]),S(this,x,pt).call(this),S(this,x,De).call(this,"choose"),m(this,I).onHoldChange?.(null)},pt=function(){if(!m(this,Fe))return;let e=m(this,xe).length;if(!e)m(this,Fe).textContent="Choose a seat on the map. Unavailable seats are already booked on at least one included performance.";else{m(this,Fe).replaceChildren();let t=document.createElement("strong");t.textContent=m(this,xe).join(", "),m(this,Fe).append(t,` \xB7 ${e} Season seat${e===1?"":"s"} across all ${m(this,ne)?.occurrenceCount??0} performances`)}m(this,mt)&&m(this,Be)&&(m(this,mt).textContent=`${m(this,Be).freeCount} seat${m(this,Be).freeCount===1?"":"s"} currently available for the complete Season`),S(this,x,$l).call(this),S(this,x,jl).call(this)},$l=function(){let e=m(this,Te)?.querySelector(".sl-season-summary-card");if(!e)return;e.querySelector(".sl-season-package-total")?.remove();let t=S(this,x,Ao).call(this);if(t==null)return;let n=m(this,Ze)?.currency??m(this,ne)?.currency??"USD",o=m(this,ne)?.occurrenceCount??0,s=document.createElement("p");s.className="sl-season-package-total";let r=document.createElement("span");r.textContent=b("season.packageTotal","Package total");let a=document.createElement("strong");a.textContent=S(this,x,Po).call(this,t,n);let l=document.createElement("span");l.className="sl-season-package-total-scope",l.textContent=b("season.priceForAllDates","for all {count} dates").replace("{count}",String(o)),s.append(r,a,l);let c=e.querySelector(".sl-season-checkout-note");c?e.insertBefore(s,c):e.append(s)},jl=function(){let e=m(this,Te)?.querySelector(".sl-season-checkout-note");if(e){if(m(this,gt)==="hosted"){e.textContent=b("season.hostedCheckoutNote","You pay for the whole package here. Your tickets for every performance arrive by email.");return}if(S(this,x,yi).call(this)){e.textContent=b("season.serverCheckoutPricedNote","Payment and admission passes are completed in the checkout on this page.");return}e.textContent="Your ticketing platform confirms package price, payment, admission passes, and member benefits."}},De=function(e){let t=e==="choose"?0:e==="review"?1:e==="checkout"?2:3;m(this,Te)?.querySelectorAll(".sl-season-progress li").forEach((n,o)=>{n.dataset.state=o<t?"done":o===t?"current":"upcoming";let s=n.querySelector("span");s&&(s.textContent=o<t?"\u2713":String(o+1))})},yi=function(){let e=m(this,Ze)?.packages;if(!e?.length)return null;let t=m(this,ne)?.planActivationId,n=e.find(r=>r.planKey===t);if(n)return n;let o=m(this,qt)?.session?.planActivationIds;return(o?.length?e.filter(r=>o.includes(r.planKey)):[])[0]??e[0]},Gl=function(e){let t=S(this,x,yi).call(this)?.prices.find(n=>n.categoryKey===e);return t?t.unitPrice:null},Ul=function(e,t){let n=document.createElement("ul");n.className="sl-season-price-lines";let o=m(this,Ze)?.currency??m(this,ne)?.currency??"USD";for(let s of e.prices){let r=document.createElement("li"),a=document.createElement("span");a.className="sl-season-price-category",a.textContent=m(this,ie).categoryLabel(s.categoryKey);let l=document.createElement("strong");l.className="sl-season-price",l.textContent=S(this,x,Po).call(this,s.unitPrice,o);let c=document.createElement("span");c.className="sl-season-price-scope",c.textContent=b("season.priceForAllDates","for all {count} dates").replace("{count}",String(t)),r.append(a,l,c),n.append(r)}return n},Ao=function(){if(!m(this,xe).length||!S(this,x,yi).call(this))return null;let e=0;for(let t of m(this,xe)){let n=m(this,wi).get(t),o=n?S(this,x,Gl).call(this,n):null;if(o==null)return null;e+=o}return e},Po=function(e,t){let n=(0,Yt.fromMinorUnits)(e,t),o=Number.isInteger(n);return(0,Yt.formatMoney)(n,t,{locale:m(this,I).locale,fallback:(s,r)=>`${s} ${r}`,...o?{minimumFractionDigits:0,maximumFractionDigits:0}:{}})},ql=function(e){let t=e.reason==="audience_not_public"?b("season.accessNotPublic","This season isn't open for online booking yet."):e.reason==="sales_not_open"?b("season.accessSalesNotOpen","Season tickets aren't on sale right now. Check back when sales open."):e.reason==="origin_not_allowed"?b("season.accessOriginNotAllowed","This season can't be booked from this page."):b("season.accessUnavailable","Season tickets can't be loaded right now. Please try again later.");S(this,x,W).call(this,{kind:"failed",message:t})},Kl=async function(e){if(!m(this,Wt)){k(this,Wt,!0);try{let t=m(this,Ze)?.currency??m(this,ne)?.currency??"USD",n=S(this,x,Ao).call(this);if(n==null){S(this,x,W).call(this,{kind:"failed",message:b("season.checkoutNotPriced","We can\u2019t price this package here. Your seats are still held \u2014 please continue in the checkout on this page."),operationId:e.operationId});return}await S(this,x,Lo).call(this,{kind:"pay",provider:null,order:{holdId:e.operationId,expiresAt:e.expiresAt,currency:t,total:(0,Yt.fromMinorUnits)(n,t),labels:[...m(this,xe)]}})}finally{k(this,Wt,!1)}}},Wl=function(){if(m(this,gt)!=="hosted")return;let e=kn(m(this,I).season);e?.outcome!=="success"||!e.orderId||(S(this,x,De).call(this,"checkout"),S(this,x,Lo).call(this,{kind:"resume",orderId:e.orderId}))},Lo=async function(e){let t;try{({mountCheckout:t}=await Pi())}catch(o){m(this,I).onError?.(o),S(this,x,W).call(this,{kind:"failed",message:b("season.checkoutCouldNotBeOpened","Checkout could not be opened. Your seats are still held \u2014 please try again.")});return}let n=m(this,ce)?.root;m(this,He)||!n||(S(this,x,Mo).call(this),k(this,bt,t({root:n,state:e,eventKey:m(this,I).season,formatMoney:(o,s)=>(0,Yt.formatMoney)(o,s,{locale:m(this,I).locale,fallback:(r,a)=>`${r} ${a}`,...Number.isInteger(o)?{minimumFractionDigits:0,maximumFractionDigits:0}:{}}),startSession:o=>m(this,fe).checkout({operationId:o.holdId,buyerEmail:o.buyerEmail,...o.buyerName?{buyerName:o.buyerName}:{},...m(this,I).returnUrl?{returnUrl:m(this,I).returnUrl}:{}}),orderStatus:o=>m(this,fe).orderStatus(o),onCancel:()=>{k(this,bt,null),m(this,Y)&&S(this,x,De).call(this,"review")},onConfirmed:o=>{m(this,I).onOrderConfirmed?.(o),S(this,x,De).call(this,"complete"),S(this,x,W).call(this,{kind:"booked",message:b("season.orderConfirmed","Your season tickets are confirmed for every included performance.")})},onError:o=>m(this,I).onError?.(o)})))},Mo=function(){m(this,bt)?.destroy(),k(this,bt,null)},W=function(e,t=!1){m(this,Xe)&&(m(this,Xe).textContent=e.message,m(this,Xe).dataset.kind=e.kind),m(this,Te)&&(m(this,Te).dataset.busy=String(t)),m(this,I).onStatusChange?.(e)},ht=function(e,t){let n=e instanceof re&&e.reason==="provider_failed"&&m(this,Kt)?new re(m(this,Kt)):e;if(n instanceof re)return m(this,I).onError?.(n),n;let o=n instanceof z?`Season selection unavailable (${n.code}).`:"Season selection could not be completed.";return S(this,x,W).call(this,{kind:"failed",message:o,operationId:t}),m(this,I).onError?.(n),n},Ho=function(){if(m(this,He))throw new Error("seatlayer: SeasonPicker was destroyed")},$t=function(){if(S(this,x,Ho).call(this),!m(this,ne)||!m(this,ce))throw new Error("seatlayer: render SeasonPicker before using it")};function Yl(i,e={}){let t=e.origin??"";if(!t)try{t=new URL(i.src,window.location.href).origin}catch{t=""}let n=!1,o=null,s=null,r=null,a="",l=null,c="",d=()=>{if(n)return;n=!0,o=i.getAttribute("style"),Object.assign(i.style,{position:"fixed",inset:"0",margin:"0",border:"0",zIndex:"2147483000",background:c||"transparent"}),i.style.width="100vw",i.style.height="100vh",i.style.width="100dvw",i.style.height="100dvh";let h=document.documentElement;s=h.style.overflow,h.style.overflow="hidden",document.body&&(r=document.body.style.overflow,document.body.style.overflow="hidden"),l=y=>{y.key==="Escape"&&p()},window.addEventListener("keydown",l)},p=()=>{n&&(n=!1,o===null?i.removeAttribute("style"):i.setAttribute("style",o),o=null,a&&(i.style.height=a),s!==null&&(document.documentElement.style.overflow=s,s=null),r!==null&&document.body&&(document.body.style.overflow=r,r=null),l&&(window.removeEventListener("keydown",l),l=null))},u=h=>{if(h.source!==i.contentWindow||t&&h.origin!==t||!h.data||typeof h.data!="object")return;let y=h.data;if(y.type==="seatlayer:height"){typeof y.px=="number"&&Number.isFinite(y.px)&&y.px>0&&(a=`${Math.round(y.px)}px`,n||(i.style.height=a));return}y.type==="seatlayer:fullscreen"&&(typeof y.background=="string"&&/^[#a-zA-Z0-9(),.%\s-]{1,64}$/.test(y.background)&&(c=y.background,n&&(i.style.background=c)),y.on===!0?d():y.on===!1&&p())};return window.addEventListener("message",u),()=>{window.removeEventListener("message",u),p()}}0&&(module.exports={ApiError,BuyerAccessContext,BuyerAccessUnavailableError,BuyerRealtimeClient,EmbeddedDesigner,PerformanceGroupDestroyedError,PerformanceGroupPicker,SEATING_CHART_CALLBACK_PROPS,SEATING_CHART_HANDLE_METHODS,SEATING_CHART_IDENTITY_PROPS,SEATING_CHART_VALUE_PROPS,SeasonApiError,SeasonPicker,SeasonPublicSessionRefused,SeasonRecoveryTimeoutError,SeatPicker,SeatingChart,attachPickerFrame,bindSeatingChartHandle,buildSeatingChartOptions,createBuyerAccessContext,createControllerSink,parseTicketOfferAvailability,shortOperationReference,ticketOfferPrices});
3323
+ `,document.head.appendChild(i)}var Jp=new Set(["audience_not_public","sales_not_open","origin_not_allowed"]),eh=3e4;function th(i,e){if(!i||typeof i!="object"||Array.isArray(i))return!1;let t=i;return typeof t.token=="string"&&t.token.length>0&&typeof t.expiresAt=="number"&&Number.isFinite(t.expiresAt)&&t.expiresAt>Date.now()&&t.seasonKey===e&&Array.isArray(t.planActivationIds)&&t.planActivationIds.every(n=>typeof n=="string"&&!!n)}var ui=class extends Error{constructor(t,n){super(`season_public_session_refused:${t}`);this.reason=t;this.status=n;this.name="SeasonPublicSessionRefused"}},Ne,Ye,mi,zt,vo=class{constructor(e){this.options=e;P(this,Ne,null);P(this,Ye,null);P(this,mi);P(this,zt);k(this,mi,e.fetch??globalThis.fetch.bind(globalThis)),k(this,zt,e.origin??(typeof location>"u"?void 0:location.origin))}get session(){return m(this,Ne)}async mint(e=!1){if(e&&k(this,Ne,null),m(this,Ne)&&m(this,Ne).expiresAt-eh>Date.now())return m(this,Ne);if(m(this,Ye))return m(this,Ye);let t=(async()=>{let n=await m(this,mi).call(this,`${this.options.base}/pub/seasons/${encodeURIComponent(this.options.season)}/sessions`,{method:"POST",body:JSON.stringify(m(this,zt)?{origin:m(this,zt)}:{}),credentials:"omit"}),o=await n.json().catch(()=>null);if(!n.ok){let s=o?.code??o?.error;if(n.status===403&&s&&Jp.has(s)){let r=s;throw this.options.onRefused?.({reason:r,code:s,status:n.status,retryable:r==="sales_not_open"}),new ui(r,n.status)}throw new Error(`season_public_session_failed_${n.status}`)}if(!th(o,this.options.season))throw new Error("season_public_session_invalid");return k(this,Ne,o),o})();k(this,Ye,t);try{return await t}finally{m(this,Ye)===t&&k(this,Ye,null)}}async token(e){let t=e==="expiring"||e==="expired"||e==="unauthorized"||e==="manual",n=await this.mint(t);return{token:n.token,expiresAt:n.expiresAt}}};Ne=new WeakMap,Ye=new WeakMap,mi=new WeakMap,zt=new WeakMap;function Nl(i){let e=new vo(i);return{access:new me({provider:({reason:n})=>e.token(n),...i.accessHooks}),loader:e}}var ih="https://api.seatlayer.io",nh=6e4,oh=5e3,z=class extends Error{constructor(t,n){super(`season_request_failed:${t}`);this.code=t;this.status=n;this.name="SeasonApiError"}},gi=class extends Error{constructor(t){super(`season_operation_timeout:${t}`);this.operationId=t;this.name="SeasonRecoveryTimeoutError"}};function sh(i,e){let t=Number(i.headers.get("Retry-After")),n=Number.isFinite(t)&&t>=0?t:e.retryAfterSeconds;return Math.max(0,Math.min(oh,n*1e3))}function rh(i,e){return e?.aborted?Promise.reject(e.reason??new DOMException("Aborted","AbortError")):new Promise((t,n)=>{let o=setTimeout(t,i);e?.addEventListener("abort",()=>{clearTimeout(o),n(e.reason??new DOMException("Aborted","AbortError"))},{once:!0})})}function Dl(i){if(!i||typeof i!="object")return"unknown";let e=i;return typeof e.code=="string"?e.code:typeof e.error=="string"?e.error:"unknown"}var ah=/^shc_[a-f0-9]{40}$/,lh=/^shh_[a-f0-9]{40}$/,ch=new Set(["preparing","commit_pending","committed","expire_pending","booking_pending","abort_pending","aborted","partial_terminal","expired","booked"]),dh=new Set(["pending","prepared","refused","applied","expired","booked","aborted"]);function wo(i){return Array.isArray(i)?i.some(wo):!i||typeof i!="object"?!1:Object.entries(i).some(([e,t])=>e==="childHoldId"||e==="child_hold_id"||e==="holdId"&&typeof t=="string"&&ah.test(t)||wo(t))}function fi(i,e,t="invalid_operation_response"){if(!i||typeof i!="object"||Array.isArray(i))throw new z(t,502);if(wo(i))throw new z("unsafe_operation_response",502);let n=i,o=n.allocations,s=new Set,r=Array.isArray(o)&&o.length>0&&o.every(p=>{if(!p||typeof p!="object")return!1;let u=p.eventId,h=p.state;return typeof u!="string"||!u||typeof h!="string"||!dh.has(h)||s.has(u)?!1:(s.add(u),!0)}),a=n.bookingRef===null||typeof n.bookingRef=="string"&&n.bookingRef.length>0,l=n.state!=="booked"||typeof n.bookingRef=="string"&&r&&o.every(p=>p.state==="booked"),c=n.state!=="booking_pending"||typeof n.bookingRef=="string"&&r&&o.some(p=>p.state!=="booked"),d=n.state!=="committed"||n.bookingRef===null;if(n.operationId!==e.operationId||n.seasonId!==e.seasonId||n.kind!=="HOLD"||typeof n.holdId!="string"||!lh.test(n.holdId)||n.policy!=="fixed_inclusion_same_seat"||typeof n.state!="string"||!ch.has(n.state)||typeof n.expiresAt!="number"||!Number.isFinite(n.expiresAt)||n.expiresAt<0||!a||typeof n.location!="string"||!n.location||typeof n.retryAfterSeconds!="number"||!Number.isFinite(n.retryAfterSeconds)||n.retryAfterSeconds<0||!r||!l||!c||!d||n.pricingAuthority!==void 0&&n.pricingAuthority!=="host"||n.authoritativeAmountIncluded!==void 0&&n.authoritativeAmountIncluded!==!1)throw new z(t,502);return{operationId:n.operationId,seasonId:n.seasonId,kind:n.kind,holdId:n.holdId,expiresAt:n.expiresAt,policy:n.policy,pricingAuthority:"host",authoritativeAmountIncluded:!1,state:n.state,bookingRef:n.bookingRef,location:n.location,retryAfterSeconds:n.retryAfterSeconds,allocations:o.map(p=>({eventId:p.eventId,state:p.state}))}}function ph(i,e,t){if(!Array.isArray(i)||i.length!==t||i.some(r=>typeof r!="string"||!r)||new Set(i).size!==i.length||!Array.isArray(e)||e.length!==i.length)throw new z("invalid_best_available_response",502);let n=i,o=new Set(n),s=new Map;for(let r of e){if(!r||typeof r!="object")throw new z("invalid_best_available_response",502);let a=r;if(typeof a.label!="string"||!o.has(a.label)||s.has(a.label)||typeof a.objectId!="string"||!a.objectId||a.objectType!=="seat"||typeof a.categoryKey!="string"||!a.categoryKey||a.tierId!==null&&(typeof a.tierId!="string"||!a.tierId)||a.quantity!==void 0&&a.quantity!==1)throw new z("invalid_best_available_response",502);s.set(a.label,{label:a.label,objectId:a.objectId,objectType:"seat",categoryKey:a.categoryKey,tierId:a.tierId,...a.quantity===void 0?{}:{quantity:a.quantity}})}return{labels:n,items:n.map(r=>s.get(r))}}function hh(i){if(!i||typeof i!="object"||Array.isArray(i))return null;let e=i;if(typeof e.currency!="string"||!e.currency||!Array.isArray(e.packages))return null;let t=[];for(let n of e.packages){if(!n||typeof n!="object")continue;let o=n;if(typeof o.planKey!="string"||!o.planKey||!Array.isArray(o.prices))continue;let s=[],r=new Set;for(let a of o.prices){if(!a||typeof a!="object")continue;let l=a;typeof l.categoryKey!="string"||!l.categoryKey||r.has(l.categoryKey)||typeof l.unitPrice!="number"||!Number.isInteger(l.unitPrice)||l.unitPrice<0||(r.add(l.categoryKey),s.push({categoryKey:l.categoryKey,unitPrice:l.unitPrice}))}s.length&&t.push({planKey:o.planKey,name:typeof o.name=="string"&&o.name?o.name:o.planKey,prices:s})}return t.length?{currency:e.currency,packages:t}:null}function uh(i){if(!i||typeof i!="object"||Array.isArray(i))throw new z("invalid_checkout_response",502);let e=i,t=typeof e.redirectUrl=="string"&&!!e.redirectUrl,n=!!e.clientPayload&&typeof e.clientPayload=="object"&&!Array.isArray(e.clientPayload);if(typeof e.orderId!="string"||!e.orderId||typeof e.currency!="string"||!e.currency||typeof e.totalMinor!="number"||!Number.isFinite(e.totalMinor)||typeof e.expiresAt!="number"||!Number.isFinite(e.expiresAt)||t===n)throw new z("invalid_checkout_response",502);return{orderId:e.orderId,totalMinor:e.totalMinor,currency:e.currency,expiresAt:e.expiresAt,...t?{redirectUrl:e.redirectUrl}:{},...n?{clientPayload:e.clientPayload}:{}}}function Bl(i,e){return{seasonKey:i.key,planActivationId:i.planActivationId,operationId:e.operationId,holdId:e.holdId,expiresAt:e.expiresAt,policy:e.policy,pricingAuthority:"host",authoritativeAmountIncluded:!1,state:e.state,allocations:e.allocations.map(({eventId:t,state:n})=>({eventKey:t,state:n}))}}var ke,ct,Pe,dt,bi,Le,Me,le,we,Fl,An=class{constructor(e,t){P(this,le);P(this,ke);P(this,ct);P(this,Pe);P(this,dt);P(this,bi);P(this,Le,!1);P(this,Me,null);k(this,ke,e),k(this,ct,(t.apiBase??ih).replace(/\/$/,"")),k(this,Pe,t.access),k(this,dt,t.fetch??globalThis.fetch.bind(globalThis)),k(this,bi,t.recoveryTimeoutMs??nh),m(this,Pe).onRenewed(n=>S(this,le,Fl).call(this,n))}async descriptor(){let{body:e}=await S(this,le,we).call(this,"GET","");return e.season}async chart(){let{body:e}=await S(this,le,we).call(this,"GET","/chart");return e}async availability(){let{body:e}=await S(this,le,we).call(this,"GET","/availability"),t=Object.values(e.seats??{});return{...e,freeCount:t.filter(n=>n==="free").length,blockedCount:t.filter(n=>n!=="free").length}}async hold(e,t){let{body:n,response:o}=await S(this,le,we).call(this,"POST","/holds",{operationId:t,labels:[...e]});return{operation:fi(n.operation,{seasonId:m(this,ke),operationId:t}),response:o}}async bestAvailable(e){let{body:t,response:n}=await S(this,le,we).call(this,"POST","/best-available",{operationId:e.operationId,qty:e.qty,...e.categoryKey?{categoryKey:e.categoryKey}:{},...e.zoneId?{zoneId:e.zoneId}:{},...e.accessibility?.length?{accessibility:[...e.accessibility]}:{},...e.requireContiguous===!0?{requireContiguous:!0}:{}}),o=fi(t.operation,{seasonId:m(this,ke),operationId:e.operationId},"invalid_best_available_response"),{labels:s,items:r}=ph(t.labels,t.items,e.qty);return{operation:o,labels:s,items:r,response:n}}async operation(e){let{body:t,response:n}=await S(this,le,we).call(this,"GET",`/operations/${encodeURIComponent(e)}`);return{operation:fi(t.operation,{seasonId:m(this,ke),operationId:e}),response:n}}async release(e,t){let{body:n,response:o}=await S(this,le,we).call(this,"POST",`/holds/${encodeURIComponent(e)}/release`,{releaseActionId:t});return{operation:fi(n.operation,{seasonId:m(this,ke),operationId:e}),response:o}}async prices(){let e;try{({body:e}=await S(this,le,we).call(this,"GET","/prices"))}catch(t){if(t instanceof z&&t.status===404)return null;throw t}return hh(e)}async checkout(e){let{body:t}=await S(this,le,we).call(this,"POST","/checkout",{operationId:e.operationId,buyerEmail:e.buyerEmail,...e.buyerName?{buyerName:e.buyerName}:{},...e.provider?{provider:e.provider}:{},...e.returnUrl?{returnUrl:e.returnUrl}:{}});return uh(t)}async orderStatus(e){let t=await m(this,dt).call(this,`${m(this,ct)}/pub/orders/${encodeURIComponent(e)}/status`,{method:"GET",credentials:"omit"}),n=await t.json().catch(()=>null);if(!t.ok)throw new z(Dl(n),t.status);if(n===null)throw new z("invalid_json_response",502);return n}async renewalIntent(e){let{body:t}=await S(this,le,we).call(this,"POST","/renewal-intents",{offerId:e}),n=t.intent;if(!n||n.offerId!==e||n.state!=="intent_received"||!n.intentId||!Number.isFinite(n.receivedAt))throw new z("invalid_renewal_intent_response",502);return n}async waitForTerminal(e,t,n){let o=Date.now(),s=t?{operation:fi(t.operation,{seasonId:m(this,ke),operationId:e}),response:t.response}:await this.operation(e);for(;s.operation.state==="preparing"||s.operation.state==="commit_pending"||s.operation.state==="expire_pending"||s.operation.state==="booking_pending"||s.operation.state==="abort_pending";){if(Date.now()-o>=m(this,bi))throw new gi(e);await rh(sh(s.response,s.operation),n),s=await this.operation(e)}return s.operation}destroy(){m(this,Le)||(k(this,Le,!0),m(this,Pe).onRenewed(void 0),m(this,Pe).clear())}};ke=new WeakMap,ct=new WeakMap,Pe=new WeakMap,dt=new WeakMap,bi=new WeakMap,Le=new WeakMap,Me=new WeakMap,le=new WeakSet,we=async function(e,t,n,o=!0){if(m(this,Le))throw new z("season_api_destroyed",409);if(m(this,Me))throw m(this,Me);let s=await m(this,Pe).authorization();if(m(this,Le))throw new z("season_api_destroyed",409);if(m(this,Me))throw m(this,Me);if(!s)throw new re({reason:"no_token",retryable:!1});let r=await m(this,dt).call(this,`${m(this,ct)}/pub/seasons/${encodeURIComponent(m(this,ke))}${t}`,{method:e,headers:{Authorization:s,...n===void 0?{}:{"Content-Type":"application/json"}},body:n===void 0?void 0:JSON.stringify(n)}),a=await r.json().catch(()=>null);if(!r.ok){let l=Dl(a);if(o&&await m(this,Pe).handleFailure(r.status,l))return S(this,le,we).call(this,e,t,n,!1);let c=m(this,Pe).unavailable;throw c?new re(c):new z(l,r.status)}if(a===null)throw new z("invalid_json_response",502);return{body:a,response:r}},Fl=async function(e){if(m(this,Le))return;let t=`/pub/seasons/${encodeURIComponent(m(this,ke))}/session/adopt`;for(let n=0;n<2;n++){if(m(this,Le))return;try{if((await m(this,dt).call(this,`${m(this,ct)}${t}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e.token}`},body:JSON.stringify({previousToken:e.previousToken}),credentials:"omit"})).ok){k(this,Me,null);return}}catch{}}if(!m(this,Le))throw k(this,Me,new z("season_session_adopt_failed",409)),m(this,Me)};var mh=2500;function fh(i){let e=typeof i=="string"?document.querySelector(i):i;if(!e)throw new Error("seatlayer: Season picker container was not found");return e}function gh(i,e,t){if(i.startsAt==null)return{date:"Date to be announced",time:null};try{let n=new Date(i.startsAt),o=e?{timeZone:e}:{};return{date:new Intl.DateTimeFormat(t,{dateStyle:"medium",...o}).format(n),time:new Intl.DateTimeFormat(t,{timeStyle:"short",...o}).format(n)}}catch{return{date:"Date to be announced",time:null}}}function Vl(i){return i.state==="committed"||i.state==="booked"}var xo=class{constructor(e,t,n){this.transport=e;this.sink=t;this.intervalMs=n;this.timer=null;this.stopped=!0;this.prior={}}start(){this.stopped&&(this.stopped=!1,this.timer=setTimeout(()=>{this.tick()},this.intervalMs))}stop(){this.stopped=!0,this.timer&&clearTimeout(this.timer),this.timer=null}async tick(){if(!this.stopped)try{let e=await this.transport.objects(""),t=Object.entries(e.seats).filter(([n,o])=>this.prior[n]!==o).map(([n,o])=>({label:n,status:o}));this.prior={...e.seats},t.length&&this.sink.applyStatuses(t)}catch{this.stopped||await this.sink.resync()}finally{this.stopped||(this.timer=setTimeout(()=>{this.tick()},this.intervalMs))}}},So=class{constructor(e,t){this.api=e;this.realtimePollMs=t;this.descriptorValue=null;this.availabilityValue=null;this.categoryLabels=new Map;this.reuseAvailabilityOnce=!1;this.nextOperationId=null;this.nextBestAvailable=null;this.nextReleaseActionId=null;this.operationByHold=new Map}prime(e,t){this.descriptorValue=e,this.availabilityValue=t,this.reuseAvailabilityOnce=!0}queueOperation(e){this.nextOperationId=e}queueBestAvailable(e,t){if(this.nextBestAvailable)throw new z("season_best_available_in_progress",409);let n={operationId:e,...t.accessibility?.length?{accessibility:[...t.accessibility]}:{},...t.requireContiguous===!0?{requireContiguous:!0}:{}};return this.nextBestAvailable=n,n}clearBestAvailable(e){this.nextBestAvailable===e&&(this.nextBestAvailable=null)}queueRelease(e){this.nextReleaseActionId=e}operationForHold(e){return this.operationByHold.get(e)??null}remember(e){this.operationByHold.set(e.holdId,e)}forget(e){this.operationByHold.delete(e)}async chart(e){let[t,n]=await Promise.all([this.descriptorValue?Promise.resolve(this.descriptorValue):this.api.descriptor(),this.api.chart()]);this.descriptorValue=t;for(let o of n.categories??[])typeof o?.key=="string"&&typeof o.label=="string"&&this.categoryLabels.set(o.key,o.label);return{doc:n,event:{key:t.key,name:t.name,venue:t.venue,startsAt:t.occurrences[0]?.startsAt??null,timezone:t.timezone,currency:t.currency,mode:t.mode,inventoryModelVersion:2}}}async objects(e){let t;return this.reuseAvailabilityOnce&&this.availabilityValue?(this.reuseAvailabilityOnce=!1,t=this.availabilityValue):(t=await this.api.availability(),this.availabilityValue=t),{seats:{...t.seats}}}async hold(e,t,n,o){if(o)throw new z("season_hold_replace_unsupported",409);let s=this.nextOperationId??`sop_${crypto.randomUUID()}`;this.nextOperationId=null;let r=await this.api.hold(t.map(l=>l.label),s),a=await this.api.waitForTerminal(s,r);if(!Vl(a))throw new z(`season_operation_${a.state}`,409);return this.remember(a),{holdId:a.holdId,expiresAt:a.expiresAt,items:t.map(l=>({label:l.label,objectId:l.label,objectType:"seat",categoryKey:"",tierId:l.tierId??null,unitPrice:0,currency:this.descriptorValue?.currency??"USD",...l.quantity==null?{}:{quantity:l.quantity}}))}}async release(e,t,n){let o=this.operationForHold(n);if(!o)throw new z("season_hold_not_found",404);let s=this.nextReleaseActionId??`sra_${crypto.randomUUID()}`;this.nextReleaseActionId=null;let r=await this.api.release(o.operationId,s),a=await this.api.waitForTerminal(o.operationId,r);if(a.state==="partial_terminal")throw this.remember(a),new z("season_operation_partial_terminal",409);this.forget(n)}async bestAvailable(e,t,n,o){let s=this.nextBestAvailable;this.nextBestAvailable=null;let r=s?.operationId??`sop_${crypto.randomUUID()}`,a=await this.api.bestAvailable({operationId:r,qty:t,...n?{categoryKey:n}:{},...o?{zoneId:o}:{},...s?.accessibility?.length?{accessibility:s.accessibility}:{},...s?.requireContiguous===!0?{requireContiguous:!0}:{}}),l=await this.api.waitForTerminal(r,a);if(!Vl(l))throw new z(`season_operation_${l.state}`,409);this.remember(l);let c=new Map(a.items.map(d=>[d.label,d]));return{holdId:l.holdId,expiresAt:l.expiresAt,labels:[...a.labels],items:a.labels.map(d=>{let p=c.get(d);return{label:d,objectId:p?.objectId??d,objectType:"seat",categoryKey:p?.categoryKey??n??"",tierId:p?.tierId??null,unitPrice:0,currency:this.descriptorValue?.currency??"USD",...p?.quantity==null?{}:{quantity:p.quantity}}})}}categoryLabel(e){return this.categoryLabels.get(e)??e}socketUrl(){return""}createRealtime(e,t){return new xo(this,t,this.realtimePollMs)}},I,ut,jt,fe,ie,vi,ne,Be,Y,ce,Te,Gt,Xe,Fe,mt,xe,wi,He,Ut,qt,ft,Kt,Ze,gt,bt,Wt,x,zl,$l,ko,To,Eo,Co,Pn,pt,jl,Gl,De,yi,Ul,ql,Ao,Po,Kl,Wl,Yl,Lo,Mo,W,ht,Ho,$t,Ln=class{constructor(e){P(this,x);P(this,I);P(this,ut);P(this,jt);P(this,fe);P(this,ie);P(this,vi,new AbortController);P(this,ne,null);P(this,Be,null);P(this,Y,null);P(this,ce,null);P(this,Te,null);P(this,Gt,null);P(this,Xe,null);P(this,Fe,null);P(this,mt,null);P(this,xe,[]);P(this,wi,new Map);P(this,He,!1);P(this,Ut,!1);P(this,qt);P(this,ft,null);P(this,Kt,null);P(this,Ze,null);P(this,gt,"handoff");P(this,bt,null);P(this,Wt,!1);if(!e?.season)throw new Error("seatlayer: `season` key is required");if(!e.container)throw new Error("seatlayer: `container` is required");if("event"in e||"performanceGroup"in e)throw new Error("seatlayer: SeasonPicker is not SeatPicker or PerformanceGroupPicker");k(this,I,e),k(this,ut,fh(e.container));let t={onExpired:o=>e.onAccessExpired?.(o),onUnavailable:o=>{let s=m(this,ft)&&o.reason==="provider_failed"?m(this,ft):o;k(this,ft,null),k(this,Kt,s.reason==="provider_failed"?null:s),e.onAccessUnavailable?.(s),S(this,x,Kl).call(this,s)}};if(!e.buyerAccessToken&&!e.buyerAccessTokenProvider){let{access:o,loader:s}=Nl({base:(e.apiBase??"https://api.seatlayer.io").replace(/\/$/,""),season:e.season,fetch:e.fetch,onRefused:r=>{k(this,ft,r)},accessHooks:t});k(this,jt,o),k(this,qt,s)}else k(this,qt,null),k(this,jt,new me({token:e.buyerAccessToken,provider:e.buyerAccessTokenProvider,...t}));k(this,fe,new An(e.season,{apiBase:e.apiBase,access:m(this,jt),fetch:e.fetch,recoveryTimeoutMs:e.recoveryTimeoutMs})),k(this,ie,new So(m(this,fe),Math.max(750,e.realtimePollMs??mh)))}async render(){S(this,x,Ho).call(this),_l(),S(this,x,$l).call(this),S(this,x,W).call(this,{kind:"loading",message:"Loading Season seats available for every performance."},!0);try{let[e,t,n]=await Promise.all([m(this,fe).descriptor(),m(this,fe).availability(),m(this,fe).prices().catch(()=>null)]);return m(this,He)?this:(k(this,ne,e),k(this,Be,t),k(this,Ze,n),k(this,gt,m(this,I).checkout==="hosted"&&e.checkoutMode!=="server"&&n?"hosted":"handoff"),m(this,ie).prime(e,t),S(this,x,ko).call(this),await S(this,x,zl).call(this,e),m(this,He)?this:(n&&S(this,x,ko).call(this),S(this,x,Yl).call(this),S(this,x,W).call(this,{kind:"ready",message:`${t.freeCount} seat${t.freeCount===1?"":"s"} available for every included performance.`}),m(this,I).initialOperationId&&await this.restoreOperation(m(this,I).initialOperationId),this))}catch(e){if(m(this,He))return this;throw S(this,x,ht).call(this,e)}}async holdSameSeat(e,t){if(S(this,x,$t).call(this),!t.startsWith("sop_"))throw new Error("seatlayer: caller-stable Season operation id is required");if(!e.length)throw new Error("seatlayer: select at least one seat");if(m(this,ie).queueOperation(t),m(this,ce).selectObjectsWithoutConfirmation([...e]),S(this,x,W).call(this,{kind:"pending",message:"Holding the same seats for every performance.",operationId:t},!0),await m(this,ce).handleCta(),!m(this,Y))throw new z("season_hold_not_created",409);return m(this,Y)}async holdBestAvailable(e,t,n={}){if(S(this,x,$t).call(this),!t.startsWith("sop_"))throw new Error("seatlayer: caller-stable Season operation id is required");if(!Number.isInteger(e)||e<1)throw new Error("seatlayer: positive Best Available quantity is required");let o=m(this,ce).maxTickets;if(e>o)throw new Error(`seatlayer: Best Available quantity cannot exceed the configured maximum (${o})`);if(m(this,Ut))throw new z("season_best_available_in_progress",409);k(this,Ut,!0);let s=null;try{if(s=m(this,ie).queueBestAvailable(t,n),S(this,x,W).call(this,{kind:"pending",message:`Finding ${e} Season seat${e===1?"":"s"} available for every performance.`,operationId:t},!0),!await m(this,ce).bestAvailableOrThrow(e,n.categoryKey,{zoneId:n.zoneId})||!m(this,Y))throw new z("season_hold_not_created",409);return m(this,Y)}catch(r){throw S(this,x,ht).call(this,r,t)}finally{s&&m(this,ie).clearBestAvailable(s),k(this,Ut,!1)}}async restoreOperation(e){S(this,x,$t).call(this),S(this,x,W).call(this,{kind:"pending",message:"Restoring your Season selection.",operationId:e},!0);try{let t=await m(this,fe).waitForTerminal(e,void 0,m(this,vi).signal);return t.state==="aborted"||t.state==="expired"?(k(this,Y,null),m(this,I).onHoldChange?.(null),S(this,x,W).call(this,{kind:"released",message:"The previous Season selection is no longer held.",operationId:e}),null):(m(this,ie).remember(t),S(this,x,Co).call(this,t,!1))}catch(t){throw S(this,x,ht).call(this,t,e)}}async release(e){S(this,x,$t).call(this);let t=m(this,Y);if(t){if(!e)throw new Error("seatlayer: caller-stable release action id is required");m(this,ie).queueRelease(e),S(this,x,W).call(this,{kind:"pending",message:"Releasing the Season seats.",operationId:t.operationId},!0);try{m(this,ce)?.getCurrentHold()?.holdId===t.holdId?await m(this,ce).release():(await m(this,ie).release("",[],t.holdId),S(this,x,Pn).call(this)),S(this,x,W).call(this,{kind:"released",message:"The Season seats were released.",operationId:t.operationId})}catch(n){throw S(this,x,ht).call(this,n,t.operationId)}}}async createRenewalIntent(e){if(S(this,x,$t).call(this),!e.startsWith("sro_"))throw new Error("seatlayer: Season renewal offer id is required");S(this,x,W).call(this,{kind:"pending",message:"Recording renewal intent. No purchase is made in the browser."},!0);try{let t=await m(this,fe).renewalIntent(e);return S(this,x,W).call(this,{kind:"renewal_intent",message:"Renewal intent recorded. Your ticketing platform will confirm price, payment, and renewal."}),m(this,I).onRenewalIntent?.(t),t}catch(t){throw S(this,x,ht).call(this,t)}}getDescriptor(){return m(this,ne)}getAvailability(){return m(this,Be)}getHandoff(){return m(this,Y)}destroy(){m(this,He)||(k(this,He,!0),m(this,vi).abort(),S(this,x,Mo).call(this),m(this,ce)?.destroy(),m(this,fe).destroy(),m(this,ut).replaceChildren(),k(this,Te,null),k(this,Gt,null),k(this,Xe,null),k(this,Fe,null),k(this,mt,null),k(this,ne,null),k(this,Be,null),k(this,Y,null))}};I=new WeakMap,ut=new WeakMap,jt=new WeakMap,fe=new WeakMap,ie=new WeakMap,vi=new WeakMap,ne=new WeakMap,Be=new WeakMap,Y=new WeakMap,ce=new WeakMap,Te=new WeakMap,Gt=new WeakMap,Xe=new WeakMap,Fe=new WeakMap,mt=new WeakMap,xe=new WeakMap,wi=new WeakMap,He=new WeakMap,Ut=new WeakMap,qt=new WeakMap,ft=new WeakMap,Kt=new WeakMap,Ze=new WeakMap,gt=new WeakMap,bt=new WeakMap,Wt=new WeakMap,x=new WeakSet,zl=async function(e){let t=new Ke(Sn({container:m(this,Gt),event:e.key,apiBase:m(this,I).apiBase,transport:m(this,ie),hideEventDetails:!0,maxSelection:m(this,I).maxSelection,selectedObjects:m(this,I).selectedObjects,selectableObjects:m(this,I).selectableObjects,numberOfPlacesToSelect:m(this,I).numberOfPlacesToSelect,selectionValidators:m(this,I).selectionValidators,locale:m(this,I).locale,messages:m(this,I).messages,languages:m(this,I).languages,colorblindSafe:m(this,I).colorblindSafe,initialView:m(this,I).initialView,enable3D:m(this,I).enable3D,max3DSeats:m(this,I).max3DSeats,hideBadge:m(this,I).hideBadge,theme:m(this,I).theme,confirmSelection:m(this,I).confirmSelection,seatView:m(this,I).seatView,onBuyerViewChange:m(this,I).onBuyerViewChange,onAnalytics:(n,o)=>{try{m(this,I).onAnalytics?.(n,{...o,metricScope:"season",seasonKey:e.key,planActivationId:e.planActivationId,performanceCount:e.occurrenceCount})}catch{}},onSelectionChange:n=>{k(this,xe,n.map(o=>o.label)),k(this,wi,new Map(n.filter(o=>!!o.categoryKey).map(o=>[o.label,o.categoryKey]))),S(this,x,pt).call(this),m(this,I).onSelectionChange?.(n)},onSelectionValidityChange:m(this,I).onSelectionValidityChange,onHoldChange:n=>{if(!n){S(this,x,Pn).call(this);return}let o=m(this,ie).operationForHold(n.holdId);o&&S(this,x,Co).call(this,o,!0)},onCheckout:()=>{m(this,Y)&&(S(this,x,De).call(this,"checkout"),m(this,I).onContinue?.(m(this,Y)),m(this,gt)==="hosted"&&S(this,x,Wl).call(this,m(this,Y)))},onHoldExpired:()=>{S(this,x,Pn).call(this),S(this,x,W).call(this,{kind:"released",message:"The Season hold expired. Choose seats again."}),m(this,I).onHoldExpired?.()},onError:n=>S(this,x,ht).call(this,n)},{surface:"season",performanceCount:e.occurrenceCount,selectionMode:"same_seat",suppressPricing:!0,groupSelectionSummary:()=>{let n=m(this,xe).length;return n?{seats:n,performances:e.occurrenceCount,performancesChosen:e.occurrenceCount,perPerformance:n}:null}}));k(this,ce,t),await t.render()},$l=function(){m(this,ut).replaceChildren();let e=document.createElement("section");e.className="sl-season-root",e.setAttribute("aria-label","Season ticket selection");let t=document.createElement("header");t.className="sl-season-hero";let n=document.createElement("ol");n.className="sl-season-progress",n.setAttribute("aria-label","Season checkout progress");for(let[f,T]of["Choose seats","Review package","Checkout"].entries()){let w=document.createElement("li");w.dataset.state=f===0?"current":"upcoming";let v=document.createElement("span");v.textContent=String(f+1),w.append(v,T),n.append(w)}let o=document.createElement("div");o.className="sl-season-stage";let s=document.createElement("div");s.className="sl-season-map";let r=document.createElement("aside");r.className="sl-season-summary-card",r.setAttribute("aria-label","Your Season selection");let a=document.createElement("h3");a.textContent="Your Season seats";let l=document.createElement("p");l.className="sl-season-selection",l.textContent="Choose a seat on the map.";let c=document.createElement("p");c.className="sl-season-rule";let d=document.createElement("i");d.textContent="1\xD7";let p=document.createElement("span");p.textContent="Each seat you choose is reserved for every included performance.",c.append(d,p);let u=document.createElement("p");u.className="sl-season-availability";let h=document.createElement("p");h.className="sl-season-checkout-note",h.textContent="Your ticketing platform confirms package price, payment, admission passes, and member benefits.",r.append(a,l,c,u,h),o.append(s,r);let y=document.createElement("p");y.className="sl-season-status",y.setAttribute("role","status"),y.setAttribute("aria-live","polite"),e.append(t,n,o,y),m(this,ut).append(e),k(this,Te,e),k(this,Gt,s),k(this,Xe,y),k(this,Fe,l),k(this,mt,u)},ko=function(){let e=m(this,ne),t=m(this,I).offer,n=m(this,Te).querySelector(".sl-season-hero");n.replaceChildren();let o=document.createElement("div");o.className="sl-season-copy";let s=document.createElement("p");s.className="sl-season-eyebrow",s.textContent=t?.eyebrow??"Season ticket";let r=document.createElement("h2");r.textContent=e.edition?`${e.name} \xB7 ${e.edition}`:e.name;let a=document.createElement("p");a.className="sl-season-promise",a.textContent=`Choose once and keep the same seat for all ${e.occurrenceCount} included performances.`;let l=document.createElement("div");l.className="sl-season-facts";for(let h of[`${e.occurrenceCount} performances`,e.venue,t?.renewalLabel??"Same-seat package"].filter(Boolean)){let y=document.createElement("span");y.className="sl-season-fact",y.textContent=h,l.append(y)}o.append(s,r,a,l),n.append(o);let c=document.createElement("div");c.className="sl-season-offer";let d=document.createElement("span");d.className="sl-season-offer-label";let p=S(this,x,yi).call(this);if(p){d.textContent=b("season.packagePriceLabel","Package price"),c.append(d,S(this,x,ql).call(this,p,e.occurrenceCount));let h=document.createElement("span");h.className="sl-season-price-note",h.textContent=b("season.packagePricePerSeat","Per seat, for the whole package."),c.append(h),n.append(c),S(this,x,To).call(this,n,t),S(this,x,Eo).call(this,n,e),S(this,x,pt).call(this);return}d.textContent=t?.priceLabel?"Season package":"Package price";let u=document.createElement(t?.priceLabel?"strong":"span");if(u.className=t?.priceLabel?"sl-season-price":"sl-season-price-note",u.textContent=t?.priceLabel??"Confirmed by your ticketing platform at checkout",c.append(d,u),t?.compareAtPriceLabel){let h=document.createElement("span");h.className="sl-season-was",h.textContent=t.compareAtPriceLabel,c.append(h)}if(t?.savingsLabel){let h=document.createElement("span");h.className="sl-season-saving",h.textContent=t.savingsLabel,c.append(h)}if(t?.priceNote){let h=document.createElement("span");h.className="sl-season-price-note",h.textContent=t.priceNote,c.append(h)}n.append(c),S(this,x,To).call(this,n,t),S(this,x,Eo).call(this,n,e),S(this,x,pt).call(this)},To=function(e,t){if(!t?.benefits?.length)return;let n=document.createElement("ul");n.className="sl-season-benefits";for(let o of t.benefits.slice(0,6)){let s=document.createElement("li");s.textContent=o,n.append(s)}e.append(n)},Eo=function(e,t){let n=document.createElement("details");n.className="sl-season-dates";let o=document.createElement("summary");o.textContent=`All ${t.occurrenceCount} performances included`;let s=document.createElement("ol");s.className="sl-season-date-list";for(let r of t.occurrences){let a=document.createElement("li");a.className="sl-season-date";let l=document.createElement("b");l.textContent=r.name;let c=gh(r,t.timezone,m(this,I).locale),d=document.createElement("time");r.startsAt!=null&&(d.dateTime=new Date(r.startsAt).toISOString()),d.textContent=c.time?`${c.date} \xB7 ${c.time}`:c.date,a.append(l,d),s.append(a)}n.append(o,s),e.append(n)},Co=function(e,t){if(e.state==="booked")return k(this,Y,null),m(this,ie).forget(e.holdId),m(this,ce)?.notifyGroupSettled("booked"),S(this,x,De).call(this,"complete"),S(this,x,W).call(this,{kind:"booked",message:`Your Season booking is complete for all ${m(this,ne).occurrenceCount} performances. No further checkout action is needed.`,operationId:e.operationId}),m(this,I).onHoldChange?.(null),null;if(e.state==="partial_terminal")return k(this,Y,null),k(this,xe,[]),m(this,ie).forget(e.holdId),m(this,ce)?.notifyGroupSettled("lost"),S(this,x,pt).call(this),S(this,x,De).call(this,"review"),S(this,x,W).call(this,{kind:"partial_terminal",message:"This Season selection needs organizer review. Do not try another selection.",operationId:e.operationId}),m(this,I).onHoldChange?.(null),null;if(e.state!=="committed")return k(this,Y,null),m(this,ie).forget(e.holdId),m(this,ce)?.notifyGroupSettled("lost"),S(this,x,W).call(this,{kind:"failed",message:"The Season selection could not be completed.",operationId:e.operationId}),m(this,I).onHoldChange?.(null),null;let n=Bl(m(this,ne),e),o=m(this,Y)?.holdId!==n.holdId;return k(this,Y,n),S(this,x,pt).call(this),S(this,x,De).call(this,"review"),m(this,I).onHoldChange?.(n),S(this,x,W).call(this,{kind:"held",message:`Your seats are held for all ${m(this,ne).occurrenceCount} performances. Review and continue to checkout.`,operationId:e.operationId}),o&&t&&m(this,I).onHold?.(n),n},Pn=function(){k(this,Y,null),k(this,xe,[]),S(this,x,pt).call(this),S(this,x,De).call(this,"choose"),m(this,I).onHoldChange?.(null)},pt=function(){if(!m(this,Fe))return;let e=m(this,xe).length;if(!e)m(this,Fe).textContent="Choose a seat on the map. Unavailable seats are already booked on at least one included performance.";else{m(this,Fe).replaceChildren();let t=document.createElement("strong");t.textContent=m(this,xe).join(", "),m(this,Fe).append(t,` \xB7 ${e} Season seat${e===1?"":"s"} across all ${m(this,ne)?.occurrenceCount??0} performances`)}m(this,mt)&&m(this,Be)&&(m(this,mt).textContent=`${m(this,Be).freeCount} seat${m(this,Be).freeCount===1?"":"s"} currently available for the complete Season`),S(this,x,jl).call(this),S(this,x,Gl).call(this)},jl=function(){let e=m(this,Te)?.querySelector(".sl-season-summary-card");if(!e)return;e.querySelector(".sl-season-package-total")?.remove();let t=S(this,x,Ao).call(this);if(t==null)return;let n=m(this,Ze)?.currency??m(this,ne)?.currency??"USD",o=m(this,ne)?.occurrenceCount??0,s=document.createElement("p");s.className="sl-season-package-total";let r=document.createElement("span");r.textContent=b("season.packageTotal","Package total");let a=document.createElement("strong");a.textContent=S(this,x,Po).call(this,t,n);let l=document.createElement("span");l.className="sl-season-package-total-scope",l.textContent=b("season.priceForAllDates","for all {count} dates").replace("{count}",String(o)),s.append(r,a,l);let c=e.querySelector(".sl-season-checkout-note");c?e.insertBefore(s,c):e.append(s)},Gl=function(){let e=m(this,Te)?.querySelector(".sl-season-checkout-note");if(e){if(m(this,gt)==="hosted"){e.textContent=b("season.hostedCheckoutNote","You pay for the whole package here. Your tickets for every performance arrive by email.");return}if(S(this,x,yi).call(this)){e.textContent=b("season.serverCheckoutPricedNote","Payment and admission passes are completed in the checkout on this page.");return}e.textContent="Your ticketing platform confirms package price, payment, admission passes, and member benefits."}},De=function(e){let t=e==="choose"?0:e==="review"?1:e==="checkout"?2:3;m(this,Te)?.querySelectorAll(".sl-season-progress li").forEach((n,o)=>{n.dataset.state=o<t?"done":o===t?"current":"upcoming";let s=n.querySelector("span");s&&(s.textContent=o<t?"\u2713":String(o+1))})},yi=function(){let e=m(this,Ze)?.packages;if(!e?.length)return null;let t=m(this,ne)?.planActivationId,n=e.find(r=>r.planKey===t);if(n)return n;let o=m(this,qt)?.session?.planActivationIds;return(o?.length?e.filter(r=>o.includes(r.planKey)):[])[0]??e[0]},Ul=function(e){let t=S(this,x,yi).call(this)?.prices.find(n=>n.categoryKey===e);return t?t.unitPrice:null},ql=function(e,t){let n=document.createElement("ul");n.className="sl-season-price-lines";let o=m(this,Ze)?.currency??m(this,ne)?.currency??"USD";for(let s of e.prices){let r=document.createElement("li"),a=document.createElement("span");a.className="sl-season-price-category",a.textContent=m(this,ie).categoryLabel(s.categoryKey);let l=document.createElement("strong");l.className="sl-season-price",l.textContent=S(this,x,Po).call(this,s.unitPrice,o);let c=document.createElement("span");c.className="sl-season-price-scope",c.textContent=b("season.priceForAllDates","for all {count} dates").replace("{count}",String(t)),r.append(a,l,c),n.append(r)}return n},Ao=function(){if(!m(this,xe).length||!S(this,x,yi).call(this))return null;let e=0;for(let t of m(this,xe)){let n=m(this,wi).get(t),o=n?S(this,x,Ul).call(this,n):null;if(o==null)return null;e+=o}return e},Po=function(e,t){let n=(0,Yt.fromMinorUnits)(e,t),o=Number.isInteger(n);return(0,Yt.formatMoney)(n,t,{locale:m(this,I).locale,fallback:(s,r)=>`${s} ${r}`,...o?{minimumFractionDigits:0,maximumFractionDigits:0}:{}})},Kl=function(e){let t=e.reason==="audience_not_public"?b("season.accessNotPublic","This season isn't open for online booking yet."):e.reason==="sales_not_open"?b("season.accessSalesNotOpen","Season tickets aren't on sale right now. Check back when sales open."):e.reason==="origin_not_allowed"?b("season.accessOriginNotAllowed","This season can't be booked from this page."):b("season.accessUnavailable","Season tickets can't be loaded right now. Please try again later.");S(this,x,W).call(this,{kind:"failed",message:t})},Wl=async function(e){if(!m(this,Wt)){k(this,Wt,!0);try{let t=m(this,Ze)?.currency??m(this,ne)?.currency??"USD",n=S(this,x,Ao).call(this);if(n==null){S(this,x,W).call(this,{kind:"failed",message:b("season.checkoutNotPriced","We can\u2019t price this package here. Your seats are still held \u2014 please continue in the checkout on this page."),operationId:e.operationId});return}await S(this,x,Lo).call(this,{kind:"pay",provider:null,order:{holdId:e.operationId,expiresAt:e.expiresAt,currency:t,total:(0,Yt.fromMinorUnits)(n,t),labels:[...m(this,xe)]}})}finally{k(this,Wt,!1)}}},Yl=function(){if(m(this,gt)!=="hosted")return;let e=kn(m(this,I).season);e?.outcome!=="success"||!e.orderId||(S(this,x,De).call(this,"checkout"),S(this,x,Lo).call(this,{kind:"resume",orderId:e.orderId}))},Lo=async function(e){let t;try{({mountCheckout:t}=await Pi())}catch(o){m(this,I).onError?.(o),S(this,x,W).call(this,{kind:"failed",message:b("season.checkoutCouldNotBeOpened","Checkout could not be opened. Your seats are still held \u2014 please try again.")});return}let n=m(this,ce)?.root;m(this,He)||!n||(S(this,x,Mo).call(this),k(this,bt,t({root:n,state:e,eventKey:m(this,I).season,formatMoney:(o,s)=>(0,Yt.formatMoney)(o,s,{locale:m(this,I).locale,fallback:(r,a)=>`${r} ${a}`,...Number.isInteger(o)?{minimumFractionDigits:0,maximumFractionDigits:0}:{}}),startSession:o=>m(this,fe).checkout({operationId:o.holdId,buyerEmail:o.buyerEmail,...o.buyerName?{buyerName:o.buyerName}:{},...m(this,I).returnUrl?{returnUrl:m(this,I).returnUrl}:{}}),orderStatus:o=>m(this,fe).orderStatus(o),onCancel:()=>{k(this,bt,null),m(this,Y)&&S(this,x,De).call(this,"review")},onConfirmed:o=>{m(this,I).onOrderConfirmed?.(o),S(this,x,De).call(this,"complete"),S(this,x,W).call(this,{kind:"booked",message:b("season.orderConfirmed","Your season tickets are confirmed for every included performance.")})},onError:o=>m(this,I).onError?.(o)})))},Mo=function(){m(this,bt)?.destroy(),k(this,bt,null)},W=function(e,t=!1){m(this,Xe)&&(m(this,Xe).textContent=e.message,m(this,Xe).dataset.kind=e.kind),m(this,Te)&&(m(this,Te).dataset.busy=String(t)),m(this,I).onStatusChange?.(e)},ht=function(e,t){let n=e instanceof re&&e.reason==="provider_failed"&&m(this,Kt)?new re(m(this,Kt)):e;if(n instanceof re)return m(this,I).onError?.(n),n;let o=n instanceof z?`Season selection unavailable (${n.code}).`:"Season selection could not be completed.";return S(this,x,W).call(this,{kind:"failed",message:o,operationId:t}),m(this,I).onError?.(n),n},Ho=function(){if(m(this,He))throw new Error("seatlayer: SeasonPicker was destroyed")},$t=function(){if(S(this,x,Ho).call(this),!m(this,ne)||!m(this,ce))throw new Error("seatlayer: render SeasonPicker before using it")};function Xl(i,e={}){let t=e.origin??"";if(!t)try{t=new URL(i.src,window.location.href).origin}catch{t=""}let n=!1,o=null,s=null,r=null,a="",l=null,c="",d=()=>{if(n)return;n=!0,o=i.getAttribute("style"),Object.assign(i.style,{position:"fixed",inset:"0",margin:"0",border:"0",zIndex:"2147483000",background:c||"transparent"}),i.style.width="100vw",i.style.height="100vh",i.style.width="100dvw",i.style.height="100dvh";let h=document.documentElement;s=h.style.overflow,h.style.overflow="hidden",document.body&&(r=document.body.style.overflow,document.body.style.overflow="hidden"),l=y=>{y.key==="Escape"&&p()},window.addEventListener("keydown",l)},p=()=>{n&&(n=!1,o===null?i.removeAttribute("style"):i.setAttribute("style",o),o=null,a&&(i.style.height=a),s!==null&&(document.documentElement.style.overflow=s,s=null),r!==null&&document.body&&(document.body.style.overflow=r,r=null),l&&(window.removeEventListener("keydown",l),l=null))},u=h=>{if(h.source!==i.contentWindow||t&&h.origin!==t||!h.data||typeof h.data!="object")return;let y=h.data;if(y.type==="seatlayer:height"){typeof y.px=="number"&&Number.isFinite(y.px)&&y.px>0&&(a=`${Math.round(y.px)}px`,n||(i.style.height=a));return}y.type==="seatlayer:fullscreen"&&(typeof y.background=="string"&&/^[#a-zA-Z0-9(),.%\s-]{1,64}$/.test(y.background)&&(c=y.background,n&&(i.style.background=c)),y.on===!0?d():y.on===!1&&p())};return window.addEventListener("message",u),()=>{window.removeEventListener("message",u),p()}}0&&(module.exports={ApiError,BuyerAccessContext,BuyerAccessUnavailableError,BuyerRealtimeClient,EmbeddedDesigner,PerformanceGroupDestroyedError,PerformanceGroupPicker,SEATING_CHART_CALLBACK_PROPS,SEATING_CHART_HANDLE_METHODS,SEATING_CHART_IDENTITY_PROPS,SEATING_CHART_VALUE_PROPS,SeasonApiError,SeasonPicker,SeasonPublicSessionRefused,SeasonRecoveryTimeoutError,SeatPicker,SeatingChart,attachPickerFrame,bindSeatingChartHandle,buildSeatingChartOptions,createBuyerAccessContext,createControllerSink,parseTicketOfferAvailability,shortOperationReference,ticketOfferPrices});