@seatlayer/js 0.53.0 → 0.55.0

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 Zt=Object.create;var Ae=Object.defineProperty;var Jt=Object.getOwnPropertyDescriptor;var ei=Object.getOwnPropertyNames;var ti=Object.getPrototypeOf,ii=Object.prototype.hasOwnProperty;var lt=n=>{throw TypeError(n)};var si=(n,e,t)=>()=>{if(t)throw t[0];try{return n&&(e=n(n=0)),e}catch(i){throw t=[i],i}};var ct=(n,e)=>{for(var t in e)Ae(n,t,{get:e[t],enumerable:!0})},dt=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of ei(e))!ii.call(n,s)&&s!==t&&Ae(n,s,{get:()=>e[s],enumerable:!(i=Jt(e,s))||i.enumerable});return n};var pt=(n,e,t)=>(t=n!=null?Zt(ti(n)):{},dt(e||!n||!n.__esModule?Ae(t,"default",{value:n,enumerable:!0}):t,n)),ri=n=>dt(Ae({},"__esModule",{value:!0}),n);var Ne=(n,e,t)=>e.has(n)||lt("Cannot "+t);var O=(n,e,t)=>(Ne(n,e,"read from private field"),t?t.call(n):e.get(n)),K=(n,e,t)=>e.has(n)?lt("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,t),B=(n,e,t,i)=>(Ne(n,e,"write to private field"),i?i.call(n,t):e.set(n,t),t),W=(n,e,t)=>(Ne(n,e,"access private method"),t);var Tt={};ct(Tt,{errorCopy:()=>Qe,formatMoney:()=>Ct,mountCheckout:()=>Ni,unavailableCopy:()=>Et});function Fi(){if(typeof document>"u"||document.getElementById(St))return;let n=document.createElement("style");n.id=St,n.textContent=_i,document.head.appendChild(n)}function Ct(n,e){try{return new Intl.NumberFormat(void 0,{style:"currency",currency:e}).format(n)}catch{return`${n.toFixed(2)} ${e}`}}function Et(n,e){let t=`${e} ${e===1?"seat is":"seats are"} held for a limited time.`;return n==="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."}:n==="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 Qe(n){switch(n){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 Di(){let n=window.Razorpay;return n?Promise.resolve(n):new Promise((e,t)=>{let i=document.querySelector(`script[src="${kt}"]`),s=i??document.createElement("script"),r=()=>{let o=window.Razorpay;o?e(o):t(new Error("razorpay_unavailable"))};s.addEventListener("load",r,{once:!0}),s.addEventListener("error",()=>t(new Error("razorpay_script_failed")),{once:!0}),!i&&(s.src=kt,s.async=!0,document.head.appendChild(s))})}function R(n,e,t){let i=document.createElement(n);return e&&(i.className=e),t!==void 0&&(i.textContent=t),i}function Ni(n){Fi();let e=!0,t=!1,i=R("div","sl-hco");i.setAttribute("role","dialog"),i.setAttribute("aria-modal","true");let s=R("div","sl-hco-card");i.appendChild(s);let r=()=>{e=!1,i.remove(),document.removeEventListener("keydown",a,!0)},o=()=>{r(),n.onCancel()};function a(H){H.key!=="Escape"||!i.isConnected||(H.stopPropagation(),H.preventDefault(),o())}document.addEventListener("keydown",a,!0);let l=R("h2","sl-hco-title","Checkout"),c=`sl-hco-t-${Math.random().toString(36).slice(2,8)}`;l.id=c,i.setAttribute("aria-labelledby",c);let p=(...H)=>{s.replaceChildren(l,...H)},d=H=>{if(!e)return;let N=R("p","sl-hco-status sl-hco-error",H);N.setAttribute("role","alert");let z=R("button","sl-hco-back","Back to seats");z.type="button",z.addEventListener("click",o),p(N,z)},h=H=>{if(!e)return;let N=R("p","sl-hco-status",H);N.setAttribute("role","status"),p(N)},b=async H=>{h("Payment received \u2014 confirming your seats\u2026");let N=Date.now()+9e4;for(;e&&Date.now()<N;){try{let z=await n.orderStatus(H);if(!e)return;if(z.status==="confirmed"){t=!0,l.textContent="Your tickets are confirmed";let ot=R("p","sl-hco-status",`${z.seatCount} ${z.seatCount===1?"seat":"seats"} confirmed. Your tickets \u2014 with their door QR codes \u2014 are in your email.`),Ee=R("dl","sl-hco-receipt"),at=(z.tickets??[]).map(oe=>oe.label);at.length&&Ee.append(R("dt",void 0,"Seats"),R("dd",void 0,at.join(", "))),Ee.append(R("dt",void 0,"Paid"),R("dd",void 0,`${z.amountFormatted} ${z.currency}`),R("dt",void 0,"Order"),R("dd","sl-hco-ref",z.orderId));let Te=R("button","sl-hco-back","Close");if(Te.type="button",Te.addEventListener("click",o),z.ticketUrl){let oe=R("a","sl-hco-tickets","View tickets & QR codes");oe.href=z.ticketUrl,oe.target="_blank",oe.rel="noreferrer",p(ot,Ee,oe,Te)}else p(ot,Ee,Te);n.onConfirmed(z);return}if(z.status==="failed"||z.status==="expired"){d(z.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(z=>setTimeout(z,2e3))}!e||t||d("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(n.state.kind==="unavailable"){let H=Et(n.state.reason,n.state.seatCount);l.textContent=H.title;let N=R("p","sl-hco-label","Seats held"),z=R("button","sl-hco-back","Back to seat map");return z.type="button",z.addEventListener("click",o),s.replaceChildren(N,l,R("p","sl-hco-status",H.body),R("p","sl-hco-note",H.detail),z),n.root.appendChild(i),z.focus(),{destroy:r}}if(n.state.kind==="resume")return n.root.appendChild(i),b(n.state.orderId),{destroy:r};let{order:m,provider:f}=n.state,k=R("div","sl-hco-summary"),C=R("div","sl-hco-seats");for(let H of m.labels)C.appendChild(R("span","sl-hco-seat",H));let w=Ct(m.total,m.currency),x=R("div","sl-hco-total");x.append(R("span",void 0,"Total"),R("strong",void 0,w)),k.append(C,x);let T=R("form","sl-hco-form"),u=R("label","sl-hco-label","Email \u2014 your tickets go here"),v=R("input","sl-hco-input");v.type="email",v.required=!0,v.autocomplete="email",v.placeholder="you@example.com",v.id=`${c}-email`,u.htmlFor=v.id;let L=R("label","sl-hco-label","Name (optional)"),$=R("input","sl-hco-input");$.type="text",$.autocomplete="name",$.placeholder="Your name",$.id=`${c}-name`,L.htmlFor=$.id;let y=R("button","sl-hco-pay",`Pay ${w}`);y.type="submit",y.disabled=!0;let S=R("button","sl-hco-back","Back to seats");S.type="button",S.addEventListener("click",o);let M=new Date(m.expiresAt).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),_=R("p","sl-hco-note",`Your seats are held until ${M}. Payment is handled by ${f==="razorpay"?"Razorpay":"Stripe"} \u2014 we never see your card details.`),I=R("p","sl-hco-note");I.append("The event organizer and SeatLayer use your email to issue and manage your tickets. ");let P=R("a",void 0,"Privacy Policy");P.href="https://seatlayer.io/privacy/",P.target="_blank",P.rel="noreferrer",I.appendChild(P);let A=()=>/.+@.+\..+/.test(v.value.trim());v.addEventListener("input",()=>{y.disabled=!A()});let F=async()=>{h("Opening secure payment\u2026");try{let H=await n.startSession({holdId:m.holdId,buyerEmail:v.value.trim(),...$.value.trim()?{buyerName:$.value.trim()}:{}});if(!e)return;if(H.redirectUrl){h("Taking you to secure payment\u2026"),window.location.assign(H.redirectUrl);return}if(H.clientPayload){let N=H.clientPayload,z=await Di();if(!e)return;h("Waiting for payment\u2026"),new z({key:N.key,order_id:N.orderId,amount:N.amount,currency:N.currency,name:N.name,prefill:N.prefill,handler:()=>{b(H.orderId)},modal:{ondismiss:()=>{e&&X()}}}).open();return}d(Qe("gateway_unavailable"))}catch(H){n.onError?.(H),d(Qe(H?.code))}};T.addEventListener("submit",H=>{H.preventDefault(),A()&&F()}),T.append(u,v,L,$,I,y,S,_);let X=()=>{l.textContent="Checkout",p(k,T),y.disabled=!A()};return X(),n.root.appendChild(i),v.focus(),{destroy:r}}var kt,St,_i,At=si(()=>{"use strict";kt="https://checkout.razorpay.com/v1/checkout.js",St="seatlayer-checkout-style",_i=`
1
+ "use strict";var ei=Object.create;var Le=Object.defineProperty;var ti=Object.getOwnPropertyDescriptor;var ii=Object.getOwnPropertyNames;var si=Object.getPrototypeOf,ri=Object.prototype.hasOwnProperty;var ct=n=>{throw TypeError(n)};var ni=(n,e,t)=>()=>{if(t)throw t[0];try{return n&&(e=n(n=0)),e}catch(i){throw t=[i],i}};var dt=(n,e)=>{for(var t in e)Le(n,t,{get:e[t],enumerable:!0})},pt=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of ii(e))!ri.call(n,s)&&s!==t&&Le(n,s,{get:()=>e[s],enumerable:!(i=ti(e,s))||i.enumerable});return n};var ht=(n,e,t)=>(t=n!=null?ei(si(n)):{},pt(e||!n||!n.__esModule?Le(t,"default",{value:n,enumerable:!0}):t,n)),oi=n=>pt(Le({},"__esModule",{value:!0}),n);var Ue=(n,e,t)=>e.has(n)||ct("Cannot "+t);var O=(n,e,t)=>(Ue(n,e,"read from private field"),t?t.call(n):e.get(n)),N=(n,e,t)=>e.has(n)?ct("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,t),$=(n,e,t,i)=>(Ue(n,e,"write to private field"),i?i.call(n,t):e.set(n,t),t),V=(n,e,t)=>(Ue(n,e,"access private method"),t);var Lt={};dt(Lt,{errorCopy:()=>Je,mountCheckout:()=>Vi,unavailableCopy:()=>At});function ji(){if(typeof document>"u"||document.getElementById(Et))return;let n=document.createElement("style");n.id=Et,n.textContent=Di,document.head.appendChild(n)}function At(n,e){let t=`${e} ${e===1?"seat is":"seats are"} held for a limited time.`;return n==="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."}:n==="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 Je(n){switch(n){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 Ni(){let n=window.Razorpay;return n?Promise.resolve(n):new Promise((e,t)=>{let i=document.querySelector(`script[src="${Tt}"]`),s=i??document.createElement("script"),r=()=>{let o=window.Razorpay;o?e(o):t(new Error("razorpay_unavailable"))};s.addEventListener("load",r,{once:!0}),s.addEventListener("error",()=>t(new Error("razorpay_script_failed")),{once:!0}),!i&&(s.src=Tt,s.async=!0,document.head.appendChild(s))})}function M(n,e,t){let i=document.createElement(n);return e&&(i.className=e),t!==void 0&&(i.textContent=t),i}function Vi(n){ji();let e=!0,t=!1,i=M("div","sl-hco");i.setAttribute("role","dialog"),i.setAttribute("aria-modal","true");let s=M("div","sl-hco-card");i.appendChild(s);let r=()=>{e=!1,i.remove(),document.removeEventListener("keydown",a,!0)},o=()=>{r(),n.onCancel()};function a(T){T.key!=="Escape"||!i.isConnected||(T.stopPropagation(),T.preventDefault(),o())}document.addEventListener("keydown",a,!0);let l=M("h2","sl-hco-title","Checkout"),d=`sl-hco-t-${Math.random().toString(36).slice(2,8)}`;l.id=d,i.setAttribute("aria-labelledby",d);let p=(...T)=>{s.replaceChildren(l,...T)},c=T=>{if(!e)return;let I=M("p","sl-hco-status sl-hco-error",T);I.setAttribute("role","alert");let R=M("button","sl-hco-back","Back to seats");R.type="button",R.addEventListener("click",o),p(I,R)},h=T=>{if(!e)return;let I=M("p","sl-hco-status",T);I.setAttribute("role","status"),p(I)},f=async T=>{h("Payment received \u2014 confirming your seats\u2026");let I=Date.now()+9e4;for(;e&&Date.now()<I;){try{let R=await n.orderStatus(T);if(!e)return;if(R.status==="confirmed"){t=!0,l.textContent="Your tickets are confirmed";let ve=M("p","sl-hco-status",`${R.seatCount} ${R.seatCount===1?"seat":"seats"} confirmed. Your tickets \u2014 with their door QR codes \u2014 are in your email.`),Ee=M("dl","sl-hco-receipt"),lt=(R.tickets??[]).map(re=>re.label);lt.length&&Ee.append(M("dt",void 0,"Seats"),M("dd",void 0,lt.join(", "))),Ee.append(M("dt",void 0,"Paid"),M("dd",void 0,`${R.amountFormatted} ${R.currency}`),M("dt",void 0,"Order"),M("dd","sl-hco-ref",R.orderId));let Ae=M("button","sl-hco-back","Close");if(Ae.type="button",Ae.addEventListener("click",o),R.ticketUrl){let re=M("a","sl-hco-tickets","View tickets & QR codes");re.href=R.ticketUrl,re.target="_blank",re.rel="noreferrer",p(ve,Ee,re,Ae)}else p(ve,Ee,Ae);n.onConfirmed(R);return}if(R.status==="failed"||R.status==="expired"){c(R.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(R=>setTimeout(R,2e3))}!e||t||c("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(n.state.kind==="unavailable"){let T=At(n.state.reason,n.state.seatCount);l.textContent=T.title;let I=M("p","sl-hco-label","Seats held"),R=M("button","sl-hco-back","Back to seat map");return R.type="button",R.addEventListener("click",o),s.replaceChildren(I,l,M("p","sl-hco-status",T.body),M("p","sl-hco-note",T.detail),R),n.root.appendChild(i),R.focus(),{destroy:r}}if(n.state.kind==="resume")return n.root.appendChild(i),f(n.state.orderId),{destroy:r};let{order:m,provider:v}=n.state,k=M("div","sl-hco-summary"),w=M("div","sl-hco-seats");for(let T of m.labels)w.appendChild(M("span","sl-hco-seat",T));let x=n.formatMoney(m.total,m.currency),y=M("div","sl-hco-total");y.append(M("span",void 0,"Total"),M("strong",void 0,x)),k.append(w,y);let E=M("form","sl-hco-form"),u=M("label","sl-hco-label","Email \u2014 your tickets go here"),b=M("input","sl-hco-input");b.type="email",b.required=!0,b.autocomplete="email",b.placeholder="you@example.com",b.id=`${d}-email`,u.htmlFor=b.id;let S=M("label","sl-hco-label","Name (optional)"),A=M("input","sl-hco-input");A.type="text",A.autocomplete="name",A.placeholder="Your name",A.id=`${d}-name`,S.htmlFor=A.id;let H=M("button","sl-hco-pay",`Pay ${x}`);H.type="submit",H.disabled=!0;let L=M("button","sl-hco-back","Back to seats");L.type="button",L.addEventListener("click",o);let P=new Date(m.expiresAt).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),j=M("p","sl-hco-note",`Your seats are held until ${P}. Payment is handled by ${v==="razorpay"?"Razorpay":"Stripe"} \u2014 we never see your card details.`),K=M("p","sl-hco-note");K.append("The event organizer and SeatLayer use your email to issue and manage your tickets. ");let W=M("a",void 0,"Privacy Policy");W.href="https://seatlayer.io/privacy/",W.target="_blank",W.rel="noreferrer",K.appendChild(W);let se=()=>/.+@.+\..+/.test(b.value.trim());b.addEventListener("input",()=>{H.disabled=!se()});let fe=async()=>{h("Opening secure payment\u2026");try{let T=await n.startSession({holdId:m.holdId,buyerEmail:b.value.trim(),...A.value.trim()?{buyerName:A.value.trim()}:{}});if(!e)return;if(T.redirectUrl){h("Taking you to secure payment\u2026"),window.location.assign(T.redirectUrl);return}if(T.clientPayload){let I=T.clientPayload,R=await Ni();if(!e)return;h("Waiting for payment\u2026"),new R({key:I.key,order_id:I.orderId,amount:I.amount,currency:I.currency,name:I.name,prefill:I.prefill,handler:()=>{f(T.orderId)},modal:{ondismiss:()=>{e&&be()}}}).open();return}c(Je("gateway_unavailable"))}catch(T){n.onError?.(T),c(Je(T?.code))}};E.addEventListener("submit",T=>{T.preventDefault(),se()&&fe()}),E.append(u,b,S,A,K,H,L,j);let be=()=>{l.textContent="Checkout",p(k,E),H.disabled=!se()};return be(),n.root.appendChild(i),b.focus(),{destroy:r}}var Tt,Et,Di,Mt=ni(()=>{"use strict";Tt="https://checkout.razorpay.com/v1/checkout.js",Et="seatlayer-checkout-style",Di=`
2
2
  .sl-hco{position:absolute;inset:0;z-index:60;display:flex;align-items:center;justify-content:center;
3
3
  padding:16px;background:color-mix(in srgb, var(--sl-bg) 82%, transparent);backdrop-filter:blur(3px)}
4
4
  .sl-hco-card{width:100%;max-width:380px;max-height:100%;overflow:auto;padding:22px;
@@ -32,7 +32,7 @@
32
32
  .sl-hco-tickets{display:block;width:100%;margin-top:14px;padding:12px;font:inherit;font-size:15px;
33
33
  font-weight:650;text-align:center;text-decoration:none;color:var(--sl-accent-ink);
34
34
  background:var(--sl-accent);border-radius:calc(var(--sl-radius) * .55)}
35
- `});var Xi={};ct(Xi,{ApiError:()=>ie,BuyerAccessContext:()=>ve,BuyerAccessUnavailableError:()=>he,BuyerRealtimeClient:()=>Y,EmbeddedDesigner:()=>He,SEATING_CHART_CALLBACK_PROPS:()=>Ke,SEATING_CHART_HANDLE_METHODS:()=>Ue,SEATING_CHART_IDENTITY_PROPS:()=>Ve,SEATING_CHART_VALUE_PROPS:()=>qe,SeatPicker:()=>De,SeatingChart:()=>Pe,attachPickerFrame:()=>Qt,bindSeatingChartHandle:()=>bt,buildSeatingChartOptions:()=>vt,createBuyerAccessContext:()=>ue,createControllerSink:()=>ae,parseTicketOfferAvailability:()=>Ie,ticketOfferPrices:()=>Oe});module.exports=ri(Xi);var q=require("@seatlayer/core");var te="seatlayer.v1";function ni(n){let e=typeof n.default=="string"?n.default:"free",t={};if(n.seats&&typeof n.seats=="object")for(let[i,s]of Object.entries(n.seats))typeof s=="string"&&s!==e&&(t[i]=s);return{default:e,exceptions:t}}function oi(n,e){if(!n||n.default!==e.default)return null;let t=[];for(let[i,s]of Object.entries(e.exceptions))n.exceptions[i]!==s&&t.push({label:i,status:s});for(let i of Object.keys(n.exceptions))i in e.exceptions||t.push({label:i,status:e.default});return t}function ai(n,e){for(let t of e)t.status===n.default?delete n.exceptions[t.label]:n.exceptions[t.label]=t.status}function ht(n){if(/(?:^|[?&#])(?:token|access_token|bearer|authorization|ticket|tkt|bse)=/i.test(n))throw new Error("seatlayer: refusing to open a socket with a credential in the URL");if(/\bbse_[A-Za-z0-9._-]+/.test(n))throw new Error("seatlayer: refusing to open a socket with a credential in the URL")}var Y=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,ht(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=[te];if(this.opts.mintTicket){let r;try{r=await this.opts.mintTicket()}catch(o){this.reportIfAccessError(o),this.scheduleReconnect();return}if(this.stopped)return;r?.protocols?.length?(e=[...r.protocols],e.includes(te)||e.unshift(te)):r?.ticket&&(e=[te,`tkt.${r.ticket}`])}let t=this.version!==null;t&&e.push(`sv.${this.version}`);let i=this.useQueryMarker?`${this.opts.url}${this.opts.url.includes("?")?"&":"?"}pv=1`:this.opts.url;ht(i);let s;try{s=(this.opts.socketFactory??((o,a)=>new WebSocket(o,a)))(i,e)}catch{this.scheduleReconnect();return}this.ws=s,s.onopen=()=>{this.ws===s&&(this.attempt=0,this.v1=s.protocol===te,this.v1||(this.useQueryMarker=!0),this.startKeepalive(s),t?this.resumeTimer=setTimeout(()=>{this.resumeTimer=null,this.opts.sink.resync()},5e3):this.opts.sink.resync())},s.onmessage=r=>{if(this.ws!==s)return;let o;try{o=JSON.parse(typeof r.data=="string"?r.data:"")}catch{return}!o||typeof o!="object"||this.handleFrame(o)},s.onclose=r=>{if(this.ws===s){if(this.ws=null,this.clearTimers(),r?.code===4401){this.stopped=!0,this.opts.onAccessUnavailable?.({reason:"revoked",code:"access_revoked",retryable:!1});return}this.scheduleReconnect()}},s.onerror=()=>{try{s.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 i=Array.isArray(e.hidden)?e.hidden:[],s=Array.isArray(e.closed)?e.closed:[],r=i.join("\0"),o=s.join("\0");(r!==this.hidden||o!==this.closedSections)&&(this.hidden=r,this.closedSections=o,this.opts.sink.onSections?.(i,s))}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 i=ni(e),s=oi(this.projection,i);this.projection=i,s===null?this.opts.sink.applyProjection?this.opts.sink.applyProjection(i):this.opts.sink.resync():s.length&&this.opts.sink.applyStatuses(s);return}if(t==="delta"&&Array.isArray(e.changes)){this.answered();let i=e.changes.filter(s=>typeof s?.label=="string"&&typeof s?.status=="string").map(s=>({label:s.label,status:s.status}));if(!i.length)return;this.projection&&ai(this.projection,i),this.opts.sink.applyStatuses(i)}}}}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),i=Math.random()*t;this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},i)}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 li(n){return n==="blocked"?"not_for_sale":n==="held"||n==="booked"||n==="free"||n==="not_for_sale"?n:"free"}function ae(n,e={}){let t=i=>{let s=n.tableSelection(i);if(s)return s.physicalSeatIds;let r=n.idForLabel(i);return r?[r]:[]};return{applyStatuses(i){let s=n.currentHold()?.labels??[],r={free:[],held:[],booked:[],not_for_sale:[]},o=[],a=[],l=new Map(n.getSelection().map(c=>[c.label,c.id]));for(let c of i){let p=t(c.label);if(!p.length)continue;let d=li(c.status);if(r[d].push(...p),e.flashOnLiveChange&&d!=="free"&&!s.includes(c.label)&&p.some(h=>n.getStatus(h)==="free")){let h=d==="held"?"#f4b740":"#f43f5e";for(let b of p)o.push({id:b,color:h})}d!=="free"&&!s.includes(c.label)&&l.has(c.label)&&a.push(c.label)}for(let c of["free","held","booked","not_for_sale"])r[c].length&&n.setStatus(r[c],c);for(let c of o)n.flashSeat(c.id,c.color);if(a.length){let c=a.flatMap(d=>t(d));c.length&&n.deselect(c);let p=i.some(d=>d.status==="blocked"&&a.includes(d.label));e.onSelectedObjectUnavailable?.(a,p?"ineligible":"taken")}e.onStatusChange?.()},async resync(){await n.refresh()},onSections(i,s){n.refresh(),e.onSections?.(i,s)}}}var ie=class extends Error{constructor(e,t,i,s,r,o){super(t),this.name="ApiError",this.status=e,this.code=i,this.conflicts=s,this.reason=r,this.retryAfterS=o}},ut=10,mt=1;function ft(n,e){let t=(n??"").trim();if(t){let i=Number(t);if(Number.isFinite(i)&&i>=0)return Math.ceil(i);let s=Date.parse(t);if(Number.isFinite(s))return Math.max(0,Math.ceil((s-Date.now())/1e3))}if(typeof e=="number"&&Number.isFinite(e)&&e>=0)return Math.ceil(e)}var ci={seat_conflict:"taken",conflict:"taken",channel_assignment_conflict:"ineligible",allocation_exhausted:"exhausted"},le=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}get accessScoped(){return!!this.access?.configured}async request(e,t={},i={}){let s=t.method??"GET",r={},o;t.body!==void 0&&(r["Content-Type"]="application/json",o=JSON.stringify(t.body));let a=await this.access?.authorization(i.auth?"unauthorized":"initial");a&&(r.Authorization=a);let l=await fetch(`${this.base}${e}`,{method:s,headers:r,body:o,credentials:"omit"}),p=(l.headers.get("content-type")??"").includes("application/json")?await l.json().catch(()=>null):null;if(!l.ok){let d=p,h=d?.code??d?.error;if(this.access?.configured&&(l.status===401||l.status===403||l.status===422)&&await this.access.handleFailure(l.status,h)&&!i.auth)return this.request(e,t,{...i,auth:!0});if(l.status===409){let m=h?ci[h]:void 0,f=d?.conflicts?.map(k=>k.label)??t.labels??[];m&&this.onObjectUnavailable?.({labels:f,reason:m,code:h})}let b;if(l.status===429&&(b=ft(l.headers.get("Retry-After"),d?.retryAfterSeconds)??mt,s==="GET"&&!i.rateLimit&&b<=ut))return await new Promise(m=>setTimeout(m,b*1e3)),this.request(e,t,{...i,rateLimit:!0});throw new ie(l.status,d?.error??`request_failed_${l.status}`,h,d?.conflicts,d?.reason,b)}return p}async requestBlob(e,t={}){let i={},s=await this.access?.authorization(t.auth?"unauthorized":"initial");s&&(i.Authorization=s);let r=await fetch(`${this.base}${e}`,{method:"GET",headers:i,credentials:"omit"});if(r.ok)return r.blob();let a=(r.headers.get("content-type")??"").includes("application/json")?await r.json().catch(()=>null):null,l=a?.code??a?.error;if(this.access?.configured&&(r.status===401||r.status===403||r.status===422)&&await this.access.handleFailure(r.status,l)&&!t.auth)return this.requestBlob(e,{...t,auth:!0});let c;if(r.status===429&&(c=ft(r.headers.get("Retry-After"),a?.retryAfterSeconds)??mt,!t.rateLimit&&c<=ut))return await new Promise(p=>setTimeout(p,c*1e3)),this.requestBlob(e,{...t,rateLimit:!0});throw new ie(r.status,a?.error??`request_failed_${r.status}`,l,void 0,void 0,c)}chart(e){return this.request(`/pub/events/${encodeURIComponent(e)}/chart`)}asset(e,t){return/^[a-zA-Z0-9._-]+$/.test(t)?this.requestBlob(`/pub/events/${encodeURIComponent(e)}/assets/${encodeURIComponent(t)}`):Promise.reject(new ie(404,"not_found","not_found"))}objects(e){return this.request(`/pub/events/${encodeURIComponent(e)}/objects?compact=1`)}hold(e,t,i,s){return this.request(`/pub/events/${encodeURIComponent(e)}/hold`,{method:"POST",body:{selections:t,...i?{ttlMs:i}:{},...s?{replaceHoldId:s}:{}},labels:t.map(r=>r.label)})}bestAvailable(e,t,i,s,r){return this.request(`/pub/events/${encodeURIComponent(e)}/best-available`,{method:"POST",body:{qty:t,...i?{categoryKey:i}:{},...s?{zoneId:s}:{},...r?{ttlMs:r}:{}}})}resume(e,t){return this.request(`/pub/events/${encodeURIComponent(e)}/hold/resume`,{method:"POST",body:{holdId:t}})}release(e,t,i){return this.request(`/pub/events/${encodeURIComponent(e)}/release`,{method:"POST",body:{labels:t,holdId:i}})}extend(e,t,i){return this.request(`/pub/events/${encodeURIComponent(e)}/extend`,{method:"POST",body:{holdId:t,...i?{ttlMs:i}:{}}})}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"),i=new URLSearchParams({surface:"picker",viewerId:this.viewerId});return`${t}/pub/events/${encodeURIComponent(e)}/subscribe?${i}`}socketUrl(e){return this.accessScoped?"":this.subscribeUrl(e)}socketProtocols(e){return this.accessScoped?[]:[te]}createRealtime(e,t){return this.accessScoped?null:new Y({url:this.subscribeUrl(e),sink:t})}};var he=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}},di=new Set(["buyer_access_expired"]),pi=new Set(["paused","provider_failed","channel_denied"]);function hi(n,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_mode_mismatch":return"mode_mismatch";case"channel_access_denied":return"channel_denied";case"channel_paused":return"paused";case"invalid_channel_scope":return"invalid_scope";default:break}return n===401?"invalid":null}function ui(n,e){return n===401&&!!e&&di.has(e)}var mi=3e4,j,U,de,ge,J,Q,pe,ye,xe,we,V,je,Le,ce,ve=class{constructor(e){K(this,V);K(this,j,null);K(this,U,0);K(this,de);K(this,ge);K(this,J,null);K(this,Q,null);K(this,pe,null);K(this,ye);K(this,xe);K(this,we,!1);if(B(this,de,e.provider),B(this,ge,e.skewMs??mi),B(this,ye,e.onExpired),B(this,xe,e.onUnavailable),e.token){let t=typeof e.token=="string"?{token:e.token}:e.token;W(this,V,je).call(this,t)}B(this,we,!!O(this,de)||!!O(this,j))}get configured(){return O(this,we)}get unavailable(){return O(this,Q)}get hasToken(){return!!O(this,j)&&(O(this,U)===0||O(this,U)>Date.now())}get expiresAt(){return O(this,U)}async authorization(e="initial"){if(!this.configured)return null;if(O(this,Q))throw new he(O(this,Q));let t=Date.now();if(!O(this,j)||O(this,U)>0&&O(this,U)-O(this,ge)<=t){let s=!!O(this,j)&&O(this,U)>0&&O(this,U)<=t,r=O(this,j)?s?"expired":"expiring":e,o=await W(this,V,Le).call(this,r);if(!o)throw new he(O(this,Q)??O(this,pe)??W(this,V,ce).call(this,"provider_failed"));return`Bearer ${o}`}return`Bearer ${O(this,j)}`}async handleFailure(e,t){var s;if(!this.configured)return!1;if(ui(e,t)){B(this,j,null),B(this,U,0);let r=await W(this,V,Le).call(this,"unauthorized",t);return(s=O(this,ye))==null||s.call(this,{reason:"unauthorized",code:t,refreshed:!!r}),!!r}let i=hi(e,t);return i&&W(this,V,ce).call(this,i,t,e),!1}async refresh(e="manual"){return B(this,Q,null),B(this,pe,null),B(this,j,null),B(this,U,0),!!await W(this,V,Le).call(this,e)}clear(){B(this,j,null),B(this,U,0),B(this,J,null)}toJSON(){return{configured:this.configured,hasToken:this.hasToken}}toString(){return"[BuyerAccessContext redacted]"}};j=new WeakMap,U=new WeakMap,de=new WeakMap,ge=new WeakMap,J=new WeakMap,Q=new WeakMap,pe=new WeakMap,ye=new WeakMap,xe=new WeakMap,we=new WeakMap,V=new WeakSet,je=function(e){return!e||typeof e.token!="string"||!e.token?null:(B(this,j,e.token),B(this,U,typeof e.expiresAt=="number"?e.expiresAt:0),O(this,j))},Le=function(e,t){if(O(this,J))return O(this,J);let i=O(this,de);if(!i)return W(this,V,ce).call(this,"no_token",t),Promise.resolve(null);let s=(async()=>{try{let r=await i({reason:e}),o=W(this,V,je).call(this,r);return o||(W(this,V,ce).call(this,"provider_failed",t),null)}catch{return W(this,V,ce).call(this,"provider_failed",t),null}finally{B(this,J,null)}})();return B(this,J,s),s},ce=function(e,t,i){var r;let s={reason:e,code:t,status:i,retryable:e==="paused"||e==="channel_denied"};return B(this,pe,s),pi.has(e)||(B(this,Q,s),B(this,j,null),B(this,U,0)),(r=O(this,xe))==null||r.call(this,s),s};function ue(n,e={}){return!n.buyerAccessTokenProvider&&!n.buyerAccessToken?null:new ve({provider:n.buyerAccessTokenProvider,token:n.buyerAccessToken,...e})}var Me='<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 fi="https://api.seatlayer.io",bi=10;function vi(n){if(typeof n=="string"){let e=document.querySelector(n);if(!e)throw new Error(`seatmap: container "${n}" not found`);return e}if(!(n instanceof HTMLElement))throw new Error("seatmap: container must be a CSS selector or an HTMLElement");return n}var Pe=class{constructor(e){this.mount=null;this.hostEl=null;this.rendered=!1;this.mode_=null;this.tipEl=null;this.tipPos={x:0,y:0};this.onTipMove=null;this.realtime=null;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.publicKey=e.publicKey,this.access=ue(e,{onExpired:i=>this.opts.onAccessExpired?.(i),onUnavailable:i=>this.opts.onAccessUnavailable?.(i)});let t=new le((e.apiBase??fi).replace(/\/+$/,""),{access:this.access??void 0,onObjectUnavailable:i=>this.opts.onSelectedObjectUnavailable?.(i)});this.api=t,this.controller=new q.PickerController({transport:t,eventKey:e.event,maxSelection:e.maxSelection??bi,currency:e.currency,onSelectionChange:i=>this.opts.onSelectionChange?.(i),onHold:i=>this.opts.onHold?.({holdId:i.holdId,expiresAt:i.expiresAt,seats:i.seats,items:i.items}),onHoldRestored:i=>this.opts.onHoldRestored?.({holdId:i.holdId,expiresAt:i.expiresAt,seats:i.seats,items:i.items}),onHoldExpired:()=>this.opts.onHoldExpired?.(),onGAClick:i=>{let s=this.controller.getGAAreas().find(r=>r.id===i);s&&this.opts.onGAClick?.(s)},onError:i=>this.opts.onError?.(i),onDeckTap:i=>this.opts.onDeckTap?.(i),onHint:i=>this.opts.onHint?.(i),flashOnLiveChange:!0,onSeatHover:i=>{this.opts.onSeatHover?.(i),this.opts.seatTooltip!==!1&&this.updateTooltip(i)},colorblindSafe:e.colorblindSafe})}async render(){if(this.rendered)return this;this.rendered=!0,await(0,q.loadLocale)(this.opts.locale),this.opts.messages&&(0,q.setStringOverrides)(this.opts.messages),this.mount=vi(this.opts.container);let e=document.createElement("div");e.style.width="100%",e.style.height="100%",e.style.position="relative",this.mount.appendChild(e),this.hostEl=e;let t=await this.controller.render(e);if(!t)return this.rendered=!1,this.opts.errorDisplay!=="none"&&this.showLoadFailure(e),this;if(this.controller.setViewMode(this.opts.initialView??"flat"),this.startRealtime(),this.mode_=t.mode==="test"?"test":"live",this.opts.seatTooltip!==!1){let i=document.createElement("div");i.setAttribute("role","tooltip"),i.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);',e.appendChild(i),this.tipEl=i,this.onTipMove=s=>{let r=e.getBoundingClientRect();this.tipPos={x:s.clientX-r.left,y:s.clientY-r.top},this.tipEl&&this.tipEl.style.display!=="none"&&this.placeTooltip()},e.addEventListener("mousemove",this.onTipMove)}if(t.mode==="test"){e.style.overflow="hidden";let i=document.createElement("div");i.textContent=(0,q.t)("picker.testMode"),i.setAttribute("aria-label",(0,q.t)("picker.testMode")),i.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;",e.appendChild(i)}return this.buildBadge(e),this}buildBadge(e){if(this.controller.doc?.theme?.hideBadge)return;let t=document.createElement("a");t.href="https://seatlayer.io",t.target="_blank",t.rel="noopener noreferrer",t.setAttribute("aria-label",(0,q.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);',t.innerHTML='<span aria-hidden="true" style="width:16px;height:16px;border-radius:4px;flex:none;display:flex;align-items:center;justify-content:center;background:#0c1220;color:#fcf7ee">'+Me+`</span><span>${(0,q.t)("picker.poweredBy")}</span>`,e.appendChild(t)}placeTooltip(){if(!this.tipEl||!this.hostEl)return;let e=this.hostEl.clientWidth,t=this.tipEl.offsetWidth,i=this.tipEl.offsetHeight,s=this.tipPos.x+14,r=this.tipPos.y-i-12;s+t>e-8&&(s=this.tipPos.x-t-14),r<8&&(r=this.tipPos.y+18),this.tipEl.style.left=`${Math.max(8,s)}px`,this.tipEl.style.top=`${Math.max(8,r)}px`}updateTooltip(e){if(!this.tipEl)return;if(!e){this.tipEl.style.display="none";return}let t=(()=>{try{return new Intl.NumberFormat(void 0,{style:"currency",currency:e.currency}).format(e.price)}catch{return`${e.price} ${e.currency}`}})(),i=e.status==="free"?"":`<div style="margin-top:5px;font-size:10.5px;letter-spacing:.08em;text-transform:uppercase;color:#fca5a5;font-weight:700">${e.status==="held"?(0,q.t)("map.statusHeld"):(0,q.t)("map.statusTaken")}</div>`;this.tipEl.innerHTML=`<div style="font-weight:700;font-size:13px">${e.label}</div><div style="display:flex;align-items:center;gap:6px;margin-top:4px;color:#c7cddc"><span style="width:9px;height:9px;border-radius:50%;flex:none;background:${e.categoryColor}"></span><span>${e.categoryLabel}</span><span style="margin-left:auto;font-weight:700;color:#fff">${t}</span></div>`+i,this.tipEl.style.display="block",this.placeTooltip()}getMode(){return this.mode_}getSelection(){return this.controller.getSelection()}async hold(e={}){try{return await this.holdOrThrow(e)}catch(t){return this.opts.onError?.(t),null}}async holdOrThrow(e={}){let t=await this.controller.hold(void 0,e.ttlMs);return t?{holdId:t.holdId,expiresAt:t.expiresAt,seats:t.seats,items:t.items}:null}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,i={}){try{return await this.holdGAOrThrow(e,t,i)}catch(s){return this.opts.onError?.(s),null}}async holdGAOrThrow(e,t,i={}){let s=await this.controller.holdGA(e,t,i);return s?{holdId:s.holdId,expiresAt:s.expiresAt,seats:s.seats,items:s.items}:null}async bestAvailable(e,t,i={}){try{return await this.bestAvailableOrThrow(e,t,i)}catch(s){return this.opts.onError?.(s),null}}async bestAvailableOrThrow(e,t,i={}){let s=await this.controller.bestAvailable(e,t,i);return s?{holdId:s.holdId,expiresAt:s.expiresAt,labels:s.labels,seats:s.seats,items:s.items,...i.zoneId?{zoneId:i.zoneId}:{}}:null}setSeatTier(e,t){this.controller.setSeatTier(e,t)}getFloors(){return this.controller.getFloors()}setFloor(e){if(this.controller.getFloors().length<=1){console.warn("seatmap: setFloor() ignored \u2014 this chart has a single floor");return}this.controller.setFloor(e)}setColorblindSafe(e){this.controller.setColorblindSafe(e)}setViewMode(e){this.controller.setViewMode(e)}getViewMode(){return this.controller.getViewMode()}zoomIn(){this.controller.zoomIn()}zoomOut(){this.controller.zoomOut()}zoomToFit(){this.controller.zoomToFit()}async release(){await this.controller.release()}async releaseLabels(e){return this.controller.releaseLabels(e)}startRealtime(){!this.access?.configured||this.realtime||(this.realtime=new Y({url:this.api.subscribeUrl(this.opts.event),mintTicket:()=>this.api.subscribeTicket(this.opts.event),onAccessUnavailable:e=>this.opts.onAccessUnavailable?.(e),sink:ae(this.controller,{flashOnLiveChange:!0,onSelectedObjectUnavailable:(e,t)=>this.opts.onSelectedObjectUnavailable?.({labels:e,reason:t})})}),this.realtime.start())}async refreshAccess(){if(!this.access?.configured)return!1;let e=await this.access.refresh("manual");return e&&(await this.controller.refresh(),this.realtime?.restart(),this.realtime||this.startRealtime()),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 i=document.createElement("div");i.textContent="The seat map didn\u2019t load.",t.appendChild(i);let s=document.createElement("button");s.type="button",s.textContent="Try again",s.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;",s.addEventListener("click",()=>{this.destroy(),this.render().catch(r=>this.opts.onError?.(r))}),t.appendChild(s),e.appendChild(t)}destroy(){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.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}};var Ue=["hold","resumeHold","getCurrentHold","getGAAreas","holdGA","bestAvailable","release","releaseLabels","getSelection","setSeatTier","getFloors","setFloor","setColorblindSafe","zoomIn","zoomOut","zoomToFit","refreshAccess"],gi={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:()=>[],setSeatTier:()=>{},getFloors:()=>[],setFloor:()=>{},setColorblindSafe:()=>{},zoomIn:()=>{},zoomOut:()=>{},zoomToFit:()=>{},refreshAccess:()=>Promise.resolve(!1)};function bt(n){let e={};for(let t of Ue)e[t]=(...i)=>{let s=n();return s?s[t](...i):gi[t]()};return e}var Ve=["event","apiBase","maxSelection","publicKey","locale","currency","colorblindSafe","initialView","errorDisplay"],qe=[...Ve,"messages","seatTooltip","buyerAccessTokenProvider","buyerAccessToken"],Ke=["onSelectionChange","onHold","onHoldRestored","onHoldExpired","onGAClick","onError","onDeckTap","onHint","onSeatHover","onAccessExpired","onAccessUnavailable","onSelectedObjectUnavailable"];function vt(n,e,t){let i={container:n};for(let s of qe)i[s]=e[s];for(let s of Ke)i[s]=t[s];return i}var yi=new Set(["seatlayer.designer.ready","seatlayer.designer.saved","seatlayer.designer.published","seatlayer.designer.close","seatlayer.designer.error"]),xi=2e4,wi=480,ki=180*1e3,Si=900*1e3,Ci=.8,Ei=30*1e3,Ti=1e5,Ai=4,Li=50;function We(n){if(typeof n!="string")return n;let e=document.querySelector(n);if(!e)throw new Error(`EmbeddedDesigner container not found: ${n}`);return e}function Mi(n){let e=(n??"").toLowerCase();return e.includes("expire")||e.includes("revoke")||e==="401"?"expired":e.includes("mismatch")?"mismatch":e.includes("timeout")?"timeout":"load"}var Pi={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."}},He=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.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"||!yi.has(t.type))return;let i={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},s=this.identityEstablished||i.type==="seatlayer.designer.ready"||i.type==="seatlayer.designer.saved"||i.type==="seatlayer.designer.published"||i.type==="seatlayer.designer.close",r=this.options.expectedChartId!==void 0&&i.chartId!==this.options.expectedChartId&&(s||i.chartId!==void 0),o=this.options.expectedWorkspaceId!==void 0&&i.workspaceId!==this.options.expectedWorkspaceId&&(s||i.workspaceId!==void 0);if(r||o){this.showError("mismatch");return}switch(i.type){case"seatlayer.designer.ready":this.identityEstablished=!0,this.sessionExpiresAt=i.expiresAt,this.phase="ready",this.clearTimeoutTimer(),this.removeOverlay(),this.autoRecoverUsed=!1,this.scheduleRenewal(i.expiresAt),this.options.onReady?.(i);break;case"seatlayer.designer.saved":this.options.onSaved?.(i);break;case"seatlayer.designer.published":this.options.onPublished?.(i);break;case"seatlayer.designer.close":this.options.onClose?.(i);break;case"seatlayer.designer.error":{let a=Mi(i.code);if(a==="expired"&&this.autoRenewEnabled()&&!this.autoRecoverUsed){this.autoRecoverUsed=!0,this.clearRenewTimer(),this.options.onRequestRelaunch();return}(typeof i.fatal=="boolean"?i.fatal:a!=="load"||this.phase!=="ready")&&this.showError(a),this.options.onError?.(i);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 i=We(this.options.container);if(this.containerEl=i,window.addEventListener("message",this.handleMessage),i.append(t),this.frame=t,this.fillEnabled()&&this.startFill(),this.phase="loading",this.loadingStateEnabled()){this.ensureContainerPositioned(i),this.renderOverlay(i,"loading");let s=this.options.loadingTimeoutMs??xi;s>0&&Number.isFinite(s)&&(this.timeoutTimer=setTimeout(()=>{this.phase==="loading"&&this.showError("timeout")},s))}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 i=()=>e.getBoundingClientRect().height,s=t.style.getPropertyValue("height"),r=t.style.getPropertyPriority("height");t.style.setProperty("height","0px","important");let o=i();t.style.setProperty("height",`${Ti}px`,"important");let a=i();return s?t.style.setProperty("height",s,r):t.style.removeProperty("height"),!(a-o>Ai)&&o>=Li?"container":"viewport"}applyFill(){if(!this.frame||this.pinned)return;let e=this.options.minHeight??wi;if(this.fillMode==="container"&&this.containerEl){let s=Math.max(e,Math.round(this.containerEl.getBoundingClientRect().height));this.setFrameHeight(`${s}px`);return}let t=this.frame.getBoundingClientRect().top,i=Math.max(e,Math.round(window.innerHeight-t));this.setFrameHeight(`${i}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[i,s]of Object.entries(e))this.frame.style.setProperty(i,s,"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=i=>{i.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 i=t<Si?t*Ci:t-ki,s=Math.max(Ei,i);this.renewTimer=setTimeout(()=>{this.renewTimer=null,this.autoRenewEnabled()&&this.options.onRequestRelaunch()},s)}ensureContainerPositioned(e){getComputedStyle(e).position==="static"&&(this.restoreContainerPosition=e.style.position,e.style.position="relative")}restoreContainerStyle(){if(this.restoreContainerPosition!==null){try{We(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=We(this.options.container)}catch{return}this.renderOverlay(t,"error",e)}handleTryAgain(){if(this.options.onRequestRelaunch){this.options.onRequestRelaunch();return}this.mount()}renderOverlay(e,t,i){this.removeOverlay();let s=document.createElement("div");s.setAttribute("data-seatlayer-designer-overlay",t),s.setAttribute("role",t==="error"?"alert":"status"),s.setAttribute("aria-live","polite"),Object.assign(s.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(s):this.buildErrorCard(s,i??"load"),e.append(s),this.overlay=s}buildSkeleton(e){let t=document.createElement("style");t.textContent=`
35
+ `});var Zi={};dt(Zi,{ApiError:()=>J,BuyerAccessContext:()=>ge,BuyerAccessUnavailableError:()=>de,BuyerRealtimeClient:()=>q,EmbeddedDesigner:()=>Re,SEATING_CHART_CALLBACK_PROPS:()=>Ye,SEATING_CHART_HANDLE_METHODS:()=>Ke,SEATING_CHART_IDENTITY_PROPS:()=>We,SEATING_CHART_VALUE_PROPS:()=>Ge,SeatPicker:()=>Ve,SeatingChart:()=>He,attachPickerFrame:()=>Jt,bindSeatingChartHandle:()=>vt,buildSeatingChartOptions:()=>gt,createBuyerAccessContext:()=>pe,createControllerSink:()=>ne,parseTicketOfferAvailability:()=>Ie,ticketOfferPrices:()=>ze});module.exports=oi(Zi);var D=require("@seatlayer/core");var Z="seatlayer.v1";function ai(n){let e=typeof n.default=="string"?n.default:"free",t={};if(n.seats&&typeof n.seats=="object")for(let[i,s]of Object.entries(n.seats))typeof s=="string"&&s!==e&&(t[i]=s);return{default:e,exceptions:t}}function li(n,e){if(!n||n.default!==e.default)return null;let t=[];for(let[i,s]of Object.entries(e.exceptions))n.exceptions[i]!==s&&t.push({label:i,status:s});for(let i of Object.keys(n.exceptions))i in e.exceptions||t.push({label:i,status:e.default});return t}function ci(n,e){for(let t of e)t.status===n.default?delete n.exceptions[t.label]:n.exceptions[t.label]=t.status}function ut(n){if(/(?:^|[?&#])(?:token|access_token|bearer|authorization|ticket|tkt|bse)=/i.test(n))throw new Error("seatlayer: refusing to open a socket with a credential in the URL");if(/\bbse_[A-Za-z0-9._-]+/.test(n))throw new Error("seatlayer: refusing to open a socket with a credential in the URL")}var q=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,ut(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=[Z];if(this.opts.mintTicket){let r;try{r=await this.opts.mintTicket()}catch(o){this.reportIfAccessError(o),this.scheduleReconnect();return}if(this.stopped)return;r?.protocols?.length?(e=[...r.protocols],e.includes(Z)||e.unshift(Z)):r?.ticket&&(e=[Z,`tkt.${r.ticket}`])}let t=this.version!==null;t&&e.push(`sv.${this.version}`);let i=this.useQueryMarker?`${this.opts.url}${this.opts.url.includes("?")?"&":"?"}pv=1`:this.opts.url;ut(i);let s;try{s=(this.opts.socketFactory??((o,a)=>new WebSocket(o,a)))(i,e)}catch{this.scheduleReconnect();return}this.ws=s,s.onopen=()=>{this.ws===s&&(this.attempt=0,this.v1=s.protocol===Z,this.v1||(this.useQueryMarker=!0),this.startKeepalive(s),t?this.resumeTimer=setTimeout(()=>{this.resumeTimer=null,this.opts.sink.resync()},5e3):this.opts.sink.resync())},s.onmessage=r=>{if(this.ws!==s)return;let o;try{o=JSON.parse(typeof r.data=="string"?r.data:"")}catch{return}!o||typeof o!="object"||this.handleFrame(o)},s.onclose=r=>{if(this.ws===s){if(this.ws=null,this.clearTimers(),r?.code===4401){this.stopped=!0,this.opts.onAccessUnavailable?.({reason:"revoked",code:"access_revoked",retryable:!1});return}this.scheduleReconnect()}},s.onerror=()=>{try{s.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 i=Array.isArray(e.hidden)?e.hidden:[],s=Array.isArray(e.closed)?e.closed:[],r=i.join("\0"),o=s.join("\0");(r!==this.hidden||o!==this.closedSections)&&(this.hidden=r,this.closedSections=o,this.opts.sink.onSections?.(i,s))}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 i=ai(e),s=li(this.projection,i);this.projection=i,s===null?this.opts.sink.applyProjection?this.opts.sink.applyProjection(i):this.opts.sink.resync():s.length&&this.opts.sink.applyStatuses(s);return}if(t==="delta"&&Array.isArray(e.changes)){this.answered();let i=e.changes.filter(s=>typeof s?.label=="string"&&typeof s?.status=="string").map(s=>({label:s.label,status:s.status}));if(!i.length)return;this.projection&&ci(this.projection,i),this.opts.sink.applyStatuses(i)}}}}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),i=Math.random()*t;this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},i)}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 di(n){return n==="blocked"?"not_for_sale":n==="held"||n==="booked"||n==="free"||n==="not_for_sale"?n:"free"}function ne(n,e={}){let t=i=>{let s=n.tableSelection(i);if(s)return s.physicalSeatIds;let r=n.idForLabel(i);return r?[r]:[]};return{applyStatuses(i){let s=n.currentHold()?.labels??[],r={free:[],held:[],booked:[],not_for_sale:[]},o=[],a=[],l=new Map(n.getSelection().map(d=>[d.label,d.id]));for(let d of i){let p=t(d.label);if(!p.length)continue;let c=di(d.status);if(r[c].push(...p),e.flashOnLiveChange&&c!=="free"&&!s.includes(d.label)&&p.some(h=>n.getStatus(h)==="free")){let h=c==="held"?"#f4b740":"#f43f5e";for(let f of p)o.push({id:f,color:h})}c!=="free"&&!s.includes(d.label)&&l.has(d.label)&&a.push(d.label)}for(let d of["free","held","booked","not_for_sale"])r[d].length&&n.setStatus(r[d],d);for(let d of o)n.flashSeat(d.id,d.color);if(a.length){let d=a.flatMap(c=>t(c));d.length&&n.deselect(d);let p=i.some(c=>c.status==="blocked"&&a.includes(c.label));e.onSelectedObjectUnavailable?.(a,p?"ineligible":"taken")}e.onStatusChange?.()},async resync(){await n.refresh()},onSections(i,s){n.refresh(),e.onSections?.(i,s)}}}var J=class extends Error{constructor(e,t,i,s,r,o){super(t),this.name="ApiError",this.status=e,this.code=i,this.conflicts=s,this.reason=r,this.retryAfterS=o}},mt=10,ft=1;function bt(n,e){let t=(n??"").trim();if(t){let i=Number(t);if(Number.isFinite(i)&&i>=0)return Math.ceil(i);let s=Date.parse(t);if(Number.isFinite(s))return Math.max(0,Math.ceil((s-Date.now())/1e3))}if(typeof e=="number"&&Number.isFinite(e)&&e>=0)return Math.ceil(e)}var pi={seat_conflict:"taken",conflict:"taken",channel_assignment_conflict:"ineligible",allocation_exhausted:"exhausted"},oe=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}get accessScoped(){return!!this.access?.configured}async request(e,t={},i={}){let s=t.method??"GET",r={},o;t.body!==void 0&&(r["Content-Type"]="application/json",o=JSON.stringify(t.body));let a=await this.access?.authorization(i.auth?"unauthorized":"initial");a&&(r.Authorization=a);let l=await fetch(`${this.base}${e}`,{method:s,headers:r,body:o,credentials:"omit"}),p=(l.headers.get("content-type")??"").includes("application/json")?await l.json().catch(()=>null):null;if(!l.ok){let c=p,h=c?.code??c?.error;if(this.access?.configured&&(l.status===401||l.status===403||l.status===422)&&await this.access.handleFailure(l.status,h)&&!i.auth)return this.request(e,t,{...i,auth:!0});if(l.status===409){let m=h?pi[h]:void 0,v=c?.conflicts?.map(k=>k.label)??t.labels??[];m&&this.onObjectUnavailable?.({labels:v,reason:m,code:h})}let f;if(l.status===429&&(f=bt(l.headers.get("Retry-After"),c?.retryAfterSeconds)??ft,s==="GET"&&!i.rateLimit&&f<=mt))return await new Promise(m=>setTimeout(m,f*1e3)),this.request(e,t,{...i,rateLimit:!0});throw new J(l.status,c?.error??`request_failed_${l.status}`,h,c?.conflicts,c?.reason,f)}return p}async requestBlob(e,t={}){let i={},s=await this.access?.authorization(t.auth?"unauthorized":"initial");s&&(i.Authorization=s);let r=await fetch(`${this.base}${e}`,{method:"GET",headers:i,credentials:"omit"});if(r.ok)return r.blob();let a=(r.headers.get("content-type")??"").includes("application/json")?await r.json().catch(()=>null):null,l=a?.code??a?.error;if(this.access?.configured&&(r.status===401||r.status===403||r.status===422)&&await this.access.handleFailure(r.status,l)&&!t.auth)return this.requestBlob(e,{...t,auth:!0});let d;if(r.status===429&&(d=bt(r.headers.get("Retry-After"),a?.retryAfterSeconds)??ft,!t.rateLimit&&d<=mt))return await new Promise(p=>setTimeout(p,d*1e3)),this.requestBlob(e,{...t,rateLimit:!0});throw new J(r.status,a?.error??`request_failed_${r.status}`,l,void 0,void 0,d)}chart(e){return this.request(`/pub/events/${encodeURIComponent(e)}/chart`)}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,i,s){return this.request(`/pub/events/${encodeURIComponent(e)}/hold`,{method:"POST",body:{selections:t,...i?{ttlMs:i}:{},...s?{replaceHoldId:s}:{}},labels:t.map(r=>r.label)})}bestAvailable(e,t,i,s,r){return this.request(`/pub/events/${encodeURIComponent(e)}/best-available`,{method:"POST",body:{qty:t,...i?{categoryKey:i}:{},...s?{zoneId:s}:{},...r?{ttlMs:r}:{}}})}resume(e,t){return this.request(`/pub/events/${encodeURIComponent(e)}/hold/resume`,{method:"POST",body:{holdId:t}})}release(e,t,i){return this.request(`/pub/events/${encodeURIComponent(e)}/release`,{method:"POST",body:{labels:t,holdId:i}})}extend(e,t,i){return this.request(`/pub/events/${encodeURIComponent(e)}/extend`,{method:"POST",body:{holdId:t,...i?{ttlMs:i}:{}}})}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"),i=new URLSearchParams({surface:"picker",viewerId:this.viewerId});return`${t}/pub/events/${encodeURIComponent(e)}/subscribe?${i}`}socketUrl(e){return this.accessScoped?"":this.subscribeUrl(e)}socketProtocols(e){return this.accessScoped?[]:[Z]}createRealtime(e,t){return this.accessScoped?null:new q({url:this.subscribeUrl(e),sink:t})}};var de=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}},hi=new Set(["buyer_access_expired"]),ui=new Set(["paused","provider_failed","channel_denied"]);function mi(n,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_mode_mismatch":return"mode_mismatch";case"channel_access_denied":return"channel_denied";case"channel_paused":return"paused";case"invalid_channel_scope":return"invalid_scope";default:break}return n===401?"invalid":null}function fi(n,e){return n===401&&!!e&&hi.has(e)}var bi=3e4,B,_,le,ye,X,G,ce,xe,we,ke,F,qe,Me,ae,ge=class{constructor(e){N(this,F);N(this,B,null);N(this,_,0);N(this,le);N(this,ye);N(this,X,null);N(this,G,null);N(this,ce,null);N(this,xe);N(this,we);N(this,ke,!1);if($(this,le,e.provider),$(this,ye,e.skewMs??bi),$(this,xe,e.onExpired),$(this,we,e.onUnavailable),e.token){let t=typeof e.token=="string"?{token:e.token}:e.token;V(this,F,qe).call(this,t)}$(this,ke,!!O(this,le)||!!O(this,B))}get configured(){return O(this,ke)}get unavailable(){return O(this,G)}get hasToken(){return!!O(this,B)&&(O(this,_)===0||O(this,_)>Date.now())}get expiresAt(){return O(this,_)}async authorization(e="initial"){if(!this.configured)return null;if(O(this,G))throw new de(O(this,G));let t=Date.now();if(!O(this,B)||O(this,_)>0&&O(this,_)-O(this,ye)<=t){let s=!!O(this,B)&&O(this,_)>0&&O(this,_)<=t,r=O(this,B)?s?"expired":"expiring":e,o=await V(this,F,Me).call(this,r);if(!o)throw new de(O(this,G)??O(this,ce)??V(this,F,ae).call(this,"provider_failed"));return`Bearer ${o}`}return`Bearer ${O(this,B)}`}async handleFailure(e,t){var s;if(!this.configured)return!1;if(fi(e,t)){$(this,B,null),$(this,_,0);let r=await V(this,F,Me).call(this,"unauthorized",t);return(s=O(this,xe))==null||s.call(this,{reason:"unauthorized",code:t,refreshed:!!r}),!!r}let i=mi(e,t);return i&&V(this,F,ae).call(this,i,t,e),!1}async refresh(e="manual"){return $(this,G,null),$(this,ce,null),$(this,B,null),$(this,_,0),!!await V(this,F,Me).call(this,e)}clear(){$(this,B,null),$(this,_,0),$(this,X,null)}toJSON(){return{configured:this.configured,hasToken:this.hasToken}}toString(){return"[BuyerAccessContext redacted]"}};B=new WeakMap,_=new WeakMap,le=new WeakMap,ye=new WeakMap,X=new WeakMap,G=new WeakMap,ce=new WeakMap,xe=new WeakMap,we=new WeakMap,ke=new WeakMap,F=new WeakSet,qe=function(e){return!e||typeof e.token!="string"||!e.token?null:($(this,B,e.token),$(this,_,typeof e.expiresAt=="number"?e.expiresAt:0),O(this,B))},Me=function(e,t){if(O(this,X))return O(this,X);let i=O(this,le);if(!i)return V(this,F,ae).call(this,"no_token",t),Promise.resolve(null);let s=(async()=>{try{let r=await i({reason:e}),o=V(this,F,qe).call(this,r);return o||(V(this,F,ae).call(this,"provider_failed",t),null)}catch{return V(this,F,ae).call(this,"provider_failed",t),null}finally{$(this,X,null)}})();return $(this,X,s),s},ae=function(e,t,i){var r;let s={reason:e,code:t,status:i,retryable:e==="paused"||e==="channel_denied"};return $(this,ce,s),ui.has(e)||($(this,G,s),$(this,B,null),$(this,_,0)),(r=O(this,we))==null||r.call(this,s),s};function pe(n,e={}){return!n.buyerAccessTokenProvider&&!n.buyerAccessToken?null:new ge({provider:n.buyerAccessTokenProvider,token:n.buyerAccessToken,...e})}var Pe='<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 vi="https://api.seatlayer.io",gi=10;function yi(n){if(typeof n=="string"){let e=document.querySelector(n);if(!e)throw new Error(`seatmap: container "${n}" not found`);return e}if(!(n instanceof HTMLElement))throw new Error("seatmap: container must be a CSS selector or an HTMLElement");return n}var He=class{constructor(e){this.mount=null;this.hostEl=null;this.rendered=!1;this.mode_=null;this.tipEl=null;this.tipPos={x:0,y:0};this.onTipMove=null;this.realtime=null;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.publicKey=e.publicKey,this.access=pe(e,{onExpired:i=>this.opts.onAccessExpired?.(i),onUnavailable:i=>this.opts.onAccessUnavailable?.(i)});let t=new oe((e.apiBase??vi).replace(/\/+$/,""),{access:this.access??void 0,onObjectUnavailable:i=>this.opts.onSelectedObjectUnavailable?.(i)});this.api=t,this.controller=new D.PickerController({transport:t,eventKey:e.event,maxSelection:e.maxSelection??gi,selectedObjects:e.selectedObjects,selectableObjects:e.selectableObjects,numberOfPlacesToSelect:e.numberOfPlacesToSelect,currency:e.currency,onSelectionChange:i=>this.opts.onSelectionChange?.(i),onSelectionValidityChange:i=>this.opts.onSelectionValidityChange?.(i),onSelectionValid:i=>this.opts.onSelectionValid?.(i),onSelectionInvalid:i=>this.opts.onSelectionInvalid?.(i),onSelectionLimit:i=>this.opts.onSelectionLimit?.(i),onHold:i=>this.opts.onHold?.({holdId:i.holdId,expiresAt:i.expiresAt,seats:i.seats,items:i.items}),onHoldRestored:i=>this.opts.onHoldRestored?.({holdId:i.holdId,expiresAt:i.expiresAt,seats:i.seats,items:i.items}),onHoldExpired:()=>this.opts.onHoldExpired?.(),onGAClick:i=>{let s=this.controller.getGAAreas().find(r=>r.id===i);s&&this.opts.onGAClick?.(s)},onError:i=>this.opts.onError?.(i),onDeckTap:i=>this.opts.onDeckTap?.(i),onHint:i=>this.opts.onHint?.(i),flashOnLiveChange:!0,onSeatHover:i=>{this.opts.onSeatHover?.(i),this.opts.seatTooltip!==!1&&this.updateTooltip(i)},colorblindSafe:e.colorblindSafe})}async render(){if(this.rendered)return this;this.rendered=!0,await(0,D.loadLocale)(this.opts.locale),this.opts.messages&&(0,D.setStringOverrides)(this.opts.messages),this.mount=yi(this.opts.container);let e=document.createElement("div");e.style.width="100%",e.style.height="100%",e.style.position="relative",this.mount.appendChild(e),this.hostEl=e;let t=await this.controller.render(e);if(!t)return this.rendered=!1,this.opts.errorDisplay!=="none"&&this.showLoadFailure(e),this;if(this.controller.setViewMode(this.opts.initialView??"flat"),this.startRealtime(),this.mode_=t.mode==="test"?"test":"live",this.opts.seatTooltip!==!1){let i=document.createElement("div");i.setAttribute("role","tooltip"),i.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);',e.appendChild(i),this.tipEl=i,this.onTipMove=s=>{let r=e.getBoundingClientRect();this.tipPos={x:s.clientX-r.left,y:s.clientY-r.top},this.tipEl&&this.tipEl.style.display!=="none"&&this.placeTooltip()},e.addEventListener("mousemove",this.onTipMove)}if(t.mode==="test"){e.style.overflow="hidden";let i=document.createElement("div");i.textContent=(0,D.t)("picker.testMode"),i.setAttribute("aria-label",(0,D.t)("picker.testMode")),i.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;",e.appendChild(i)}return this.buildBadge(e),this}buildBadge(e){if(this.controller.doc?.theme?.hideBadge)return;let t=document.createElement("a");t.href="https://seatlayer.io",t.target="_blank",t.rel="noopener noreferrer",t.setAttribute("aria-label",(0,D.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);',t.innerHTML='<span aria-hidden="true" style="width:16px;height:16px;border-radius:4px;flex:none;display:flex;align-items:center;justify-content:center;background:#0c1220;color:#fcf7ee">'+Pe+`</span><span>${(0,D.t)("picker.poweredBy")}</span>`,e.appendChild(t)}placeTooltip(){if(!this.tipEl||!this.hostEl)return;let e=this.hostEl.clientWidth,t=this.tipEl.offsetWidth,i=this.tipEl.offsetHeight,s=this.tipPos.x+14,r=this.tipPos.y-i-12;s+t>e-8&&(s=this.tipPos.x-t-14),r<8&&(r=this.tipPos.y+18),this.tipEl.style.left=`${Math.max(8,s)}px`,this.tipEl.style.top=`${Math.max(8,r)}px`}updateTooltip(e){if(!this.tipEl)return;if(!e){this.tipEl.style.display="none";return}let t=(0,D.formatMoney)(e.price,e.currency,{locale:this.opts.locale,fallback:(s,r)=>`${s} ${r}`}),i=e.status==="free"?"":`<div style="margin-top:5px;font-size:10.5px;letter-spacing:.08em;text-transform:uppercase;color:#fca5a5;font-weight:700">${e.status==="held"?(0,D.t)("map.statusHeld"):(0,D.t)("map.statusTaken")}</div>`;this.tipEl.innerHTML=`<div style="font-weight:700;font-size:13px">${e.label}</div><div style="display:flex;align-items:center;gap:6px;margin-top:4px;color:#c7cddc"><span style="width:9px;height:9px;border-radius:50%;flex:none;background:${e.categoryColor}"></span><span>${e.categoryLabel}</span><span style="margin-left:auto;font-weight:700;color:#fff">${t}</span></div>`+i,this.tipEl.style.display="block",this.placeTooltip()}getMode(){return this.mode_}getSelection(){return this.controller.getSelection()}selectObjects(e){return this.controller.select(e)}deselectObjects(e){this.controller.deselect(e)}clearSelection(){this.controller.clearSelection()}selectCategories(e){return this.controller.selectCategories(e)}deselectCategories(e){this.controller.deselectCategories(e)}setSelectableObjects(e){this.controller.setSelectableObjects(e)}setMaxSelection(e){this.controller.setMaxSelection(e)}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)throw Object.assign(new Error(`seatmap: select exactly ${t.required} places before holding`),{code:"selection_count_mismatch",selection:t});let i=await this.controller.hold(void 0,e.ttlMs);return i?{holdId:i.holdId,expiresAt:i.expiresAt,seats:i.seats,items:i.items}:null}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,i={}){try{return await this.holdGAOrThrow(e,t,i)}catch(s){return this.opts.onError?.(s),null}}async holdGAOrThrow(e,t,i={}){let s=await this.controller.holdGA(e,t,i);return s?{holdId:s.holdId,expiresAt:s.expiresAt,seats:s.seats,items:s.items}:null}async bestAvailable(e,t,i={}){try{return await this.bestAvailableOrThrow(e,t,i)}catch(s){return this.opts.onError?.(s),null}}async bestAvailableOrThrow(e,t,i={}){let s=await this.controller.bestAvailable(e,t,i);return s?{holdId:s.holdId,expiresAt:s.expiresAt,labels:s.labels,seats:s.seats,items:s.items,...i.zoneId?{zoneId:i.zoneId}:{}}:null}setSeatTier(e,t){this.controller.setSeatTier(e,t)}getFloors(){return this.controller.getFloors()}setFloor(e){if(this.controller.getFloors().length<=1){console.warn("seatmap: setFloor() ignored \u2014 this chart has a single floor");return}this.controller.setFloor(e)}setColorblindSafe(e){this.controller.setColorblindSafe(e)}setViewMode(e){this.controller.setViewMode(e)}getViewMode(){return this.controller.getViewMode()}zoomIn(){this.controller.zoomIn()}zoomOut(){this.controller.zoomOut()}zoomToFit(){this.controller.zoomToFit()}async release(){await this.controller.release()}async releaseLabels(e){return this.controller.releaseLabels(e)}startRealtime(){!this.access?.configured||this.realtime||(this.realtime=new q({url:this.api.subscribeUrl(this.opts.event),mintTicket:()=>this.api.subscribeTicket(this.opts.event),onAccessUnavailable:e=>this.opts.onAccessUnavailable?.(e),sink:ne(this.controller,{flashOnLiveChange:!0,onSelectedObjectUnavailable:(e,t)=>this.opts.onSelectedObjectUnavailable?.({labels:e,reason:t})})}),this.realtime.start())}async refreshAccess(){if(!this.access?.configured)return!1;let e=await this.access.refresh("manual");return e&&(await this.controller.refresh(),this.realtime?.restart(),this.realtime||this.startRealtime()),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 i=document.createElement("div");i.textContent="The seat map didn\u2019t load.",t.appendChild(i);let s=document.createElement("button");s.type="button",s.textContent="Try again",s.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;",s.addEventListener("click",()=>{this.destroy(),this.render().catch(r=>this.opts.onError?.(r))}),t.appendChild(s),e.appendChild(t)}destroy(){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.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}};var Ke=["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"],xi={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 vt(n){let e={};for(let t of Ke)e[t]=(...i)=>{let s=n();return s?s[t](...i):xi[t]()};return e}var We=["event","apiBase","maxSelection","numberOfPlacesToSelect","publicKey","locale","currency","colorblindSafe","initialView","errorDisplay"],Ge=[...We,"selectedObjects","selectableObjects","messages","seatTooltip","buyerAccessTokenProvider","buyerAccessToken"],Ye=["onSelectionChange","onSelectionValidityChange","onSelectionValid","onSelectionInvalid","onSelectionLimit","onHold","onHoldRestored","onHoldExpired","onGAClick","onError","onDeckTap","onHint","onSeatHover","onAccessExpired","onAccessUnavailable","onSelectedObjectUnavailable"];function gt(n,e,t){let i={container:n};for(let s of Ge)i[s]=e[s];for(let s of Ye)i[s]=t[s];return i}var wi=new Set(["seatlayer.designer.ready","seatlayer.designer.saved","seatlayer.designer.published","seatlayer.designer.close","seatlayer.designer.error"]),ki=2e4,Si=480,Ci=180*1e3,Ti=900*1e3,Ei=.8,Ai=30*1e3,Li=1e5,Mi=4,Pi=50;function Xe(n){if(typeof n!="string")return n;let e=document.querySelector(n);if(!e)throw new Error(`EmbeddedDesigner container not found: ${n}`);return e}function Hi(n){let e=(n??"").toLowerCase();return e.includes("expire")||e.includes("revoke")||e==="401"?"expired":e.includes("mismatch")?"mismatch":e.includes("timeout")?"timeout":"load"}var Ri={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."}},Re=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.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"||!wi.has(t.type))return;let i={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},s=this.identityEstablished||i.type==="seatlayer.designer.ready"||i.type==="seatlayer.designer.saved"||i.type==="seatlayer.designer.published"||i.type==="seatlayer.designer.close",r=this.options.expectedChartId!==void 0&&i.chartId!==this.options.expectedChartId&&(s||i.chartId!==void 0),o=this.options.expectedWorkspaceId!==void 0&&i.workspaceId!==this.options.expectedWorkspaceId&&(s||i.workspaceId!==void 0);if(r||o){this.showError("mismatch");return}switch(i.type){case"seatlayer.designer.ready":this.identityEstablished=!0,this.sessionExpiresAt=i.expiresAt,this.phase="ready",this.clearTimeoutTimer(),this.removeOverlay(),this.autoRecoverUsed=!1,this.scheduleRenewal(i.expiresAt),this.options.onReady?.(i);break;case"seatlayer.designer.saved":this.options.onSaved?.(i);break;case"seatlayer.designer.published":this.options.onPublished?.(i);break;case"seatlayer.designer.close":this.options.onClose?.(i);break;case"seatlayer.designer.error":{let a=Hi(i.code);if(a==="expired"&&this.autoRenewEnabled()&&!this.autoRecoverUsed){this.autoRecoverUsed=!0,this.clearRenewTimer(),this.options.onRequestRelaunch();return}(typeof i.fatal=="boolean"?i.fatal:a!=="load"||this.phase!=="ready")&&this.showError(a),this.options.onError?.(i);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 i=Xe(this.options.container);if(this.containerEl=i,window.addEventListener("message",this.handleMessage),i.append(t),this.frame=t,this.fillEnabled()&&this.startFill(),this.phase="loading",this.loadingStateEnabled()){this.ensureContainerPositioned(i),this.renderOverlay(i,"loading");let s=this.options.loadingTimeoutMs??ki;s>0&&Number.isFinite(s)&&(this.timeoutTimer=setTimeout(()=>{this.phase==="loading"&&this.showError("timeout")},s))}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 i=()=>e.getBoundingClientRect().height,s=t.style.getPropertyValue("height"),r=t.style.getPropertyPriority("height");t.style.setProperty("height","0px","important");let o=i();t.style.setProperty("height",`${Li}px`,"important");let a=i();return s?t.style.setProperty("height",s,r):t.style.removeProperty("height"),!(a-o>Mi)&&o>=Pi?"container":"viewport"}applyFill(){if(!this.frame||this.pinned)return;let e=this.options.minHeight??Si;if(this.fillMode==="container"&&this.containerEl){let s=Math.max(e,Math.round(this.containerEl.getBoundingClientRect().height));this.setFrameHeight(`${s}px`);return}let t=this.frame.getBoundingClientRect().top,i=Math.max(e,Math.round(window.innerHeight-t));this.setFrameHeight(`${i}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[i,s]of Object.entries(e))this.frame.style.setProperty(i,s,"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=i=>{i.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 i=t<Ti?t*Ei:t-Ci,s=Math.max(Ai,i);this.renewTimer=setTimeout(()=>{this.renewTimer=null,this.autoRenewEnabled()&&this.options.onRequestRelaunch()},s)}ensureContainerPositioned(e){getComputedStyle(e).position==="static"&&(this.restoreContainerPosition=e.style.position,e.style.position="relative")}restoreContainerStyle(){if(this.restoreContainerPosition!==null){try{Xe(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=Xe(this.options.container)}catch{return}this.renderOverlay(t,"error",e)}handleTryAgain(){if(this.options.onRequestRelaunch){this.options.onRequestRelaunch();return}this.mount()}renderOverlay(e,t,i){this.removeOverlay();let s=document.createElement("div");s.setAttribute("data-seatlayer-designer-overlay",t),s.setAttribute("role",t==="error"?"alert":"status"),s.setAttribute("aria-live","polite"),Object.assign(s.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(s):this.buildErrorCard(s,i??"load"),e.append(s),this.overlay=s}buildSkeleton(e){let t=document.createElement("style");t.textContent=`
36
36
  @media (prefers-reduced-motion: no-preference) {
37
37
  @keyframes seatlayer-designer-shimmer {
38
38
  0% { background-position: -320px 0; }
@@ -42,7 +42,7 @@
42
42
  animation: seatlayer-designer-shimmer 1.25s ease-in-out infinite;
43
43
  background-size: 640px 100%;
44
44
  }
45
- }`,e.append(t);let i="linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.10) 37%, rgba(255,255,255,0.04) 63%)",s=document.createElement("div");Object.assign(s.style,{position:"absolute",inset:"0",display:"flex",flexDirection:"column",padding:"16px",gap:"14px",opacity:"0.9"});let r=c=>{let p=document.createElement("div");return p.className="sl-shimmer",Object.assign(p.style,{background:i,borderRadius:"8px"}),Object.assign(p.style,c),p};s.append(r({height:"40px",width:"100%",flex:"0 0 auto"}));let o=document.createElement("div");Object.assign(o.style,{display:"flex",gap:"14px",flex:"1 1 auto",minHeight:"0"}),o.append(r({width:"220px",height:"100%",flex:"0 0 auto"})),o.append(r({flex:"1 1 auto",height:"100%"})),s.append(o),e.append(s);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:i,flex:"0 0 auto"}),a.append(l),a.append(document.createTextNode("Loading designer\u2026")),e.append(a)}buildErrorCard(e,t){let i=Pi[t],s=document.createElement("div");Object.assign(s.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 r=document.createElement("h2");r.textContent=i.title,Object.assign(r.style,{margin:"0 0 8px",fontSize:"17px",fontWeight:"600",color:"#f4f7ff"});let o=document.createElement("p");o.textContent=i.body,Object.assign(o.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()),s.append(r,o,a),e.append(s)}};var g=require("@seatlayer/core"),Ce=require("@seatlayer/core/view3d/crossfade/panorama"),nt=require("@seatlayer/core/core/seatConfidence"),ee=require("@seatlayer/core/view/panoramaDelivery");var Hi=/^[a-zA-Z0-9._-]+$/;function Ri(n){let e;try{e=new URL(n,"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 i=decodeURIComponent(t[1]),s=decodeURIComponent(t[2]);return!i||!Hi.test(s)?null:{eventKey:i,asset:s}}catch{return null}}function $i(n){try{return/^\/pub\/events\/[^/]+\/assets(?:\/|$)/.test(new URL(n,"https://seatlayer.invalid").pathname)}catch{return!1}}var Re=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=Ri(e);if(!t)return Promise.resolve($i(e)?null:e);if(t.eventKey!==this.eventKey||!this.load||this.disposed)return Promise.resolve(null);let i=this.pending.get(e);if(i)return i;let s=this.load(this.eventKey,t.asset).then(r=>{let o=URL.createObjectURL(r);return this.disposed?(URL.revokeObjectURL(o),null):(this.created.add(o),o)}).catch(r=>{throw this.pending.delete(e),r});return this.pending.set(e,s),s}dispose(){if(!this.disposed){this.disposed=!0;for(let e of this.created)URL.revokeObjectURL(e);this.created.clear(),this.pending.clear()}}};var Ii=["on-sale","low","sold-out","presale","closed"];function $e(n){return n==null?null:typeof n=="number"&&Number.isFinite(n)&&n>=0?n:void 0}function yt(n){return n==null?null:typeof n=="number"&&Number.isFinite(n)&&n>=0?n:void 0}function gt(n){if(n==null)return null;if(typeof n!="object"||Array.isArray(n))return;let e=n,t=e.count,i=e.index;if(typeof i!="number"||!Number.isInteger(i)||i<1||typeof t!="number"||!Number.isInteger(t)||t<i)return;let s=e.remaining;if(s!=null&&(typeof s!="number"||!Number.isInteger(s)||s<0))return;let r={index:i,count:t,remaining:s??null};if(e.id!==void 0){if(typeof e.id!="string"||!e.id.trim())return;r.id=e.id.trim()}if(e.name!==void 0){if(typeof e.name!="string"||!e.name.trim())return;r.name=e.name.trim()}if(e.categoryKey!==void 0){if(e.categoryKey!==null&&(typeof e.categoryKey!="string"||!e.categoryKey.trim()))return;r.categoryKey=e.categoryKey==null?null:e.categoryKey.trim()}for(let o of["startsAt","endsAt"]){if(e[o]===void 0)continue;let a=yt(e[o]);if(a===void 0)return;r[o]=a}return r}function Ie(n){if(!n||typeof n!="object"||Array.isArray(n))return null;let e=n,t=Ii.find(c=>c===e.state);if(!t)return null;let i=$e(e.fromPrice),s=$e(e.previousPrice);if(i===void 0||s===void 0)return null;let r=e.currency==null?null:typeof e.currency=="string"&&e.currency.trim()?e.currency.trim():void 0;if(r===void 0)return null;let o=gt(e.release);if(o===void 0)return null;let a=e.upcoming===void 0?null:gt(e.upcoming);if(a===void 0)return null;let l=[];if(e.prices!=null){if(!Array.isArray(e.prices))return null;let c=[];for(let p of e.prices){if(!p||typeof p!="object"||Array.isArray(p))return null;let d=p,h=typeof d.categoryKey=="string"?d.categoryKey.trim():"";if(!h)return null;let b=$e(d.price),m=$e(d.previousPrice);if(b==null||m===void 0)return null;let f={categoryKey:h,price:b,previousPrice:m};if(d.offerId!==void 0){if(typeof d.offerId!="string"||!d.offerId.trim())return null;f.offerId=d.offerId.trim()}if(d.offerName!==void 0){if(typeof d.offerName!="string"||!d.offerName.trim())return null;f.offerName=d.offerName.trim()}if(d.remaining!==void 0){if(d.remaining!==null&&(typeof d.remaining!="number"||!Number.isInteger(d.remaining)||d.remaining<0))return null;f.remaining=d.remaining==null?null:d.remaining}for(let k of["startsAt","endsAt"]){if(d[k]===void 0)continue;let C=yt(d[k]);if(C===void 0)return null;f[k]=C}c.push(f)}l=c}return{state:t,fromPrice:i,previousPrice:s,currency:r,release:o,upcoming:a,prices:l}}function xt(n,e){if(!n)return null;let t=null,i=s=>{s!=null&&s>e&&(t===null||s<t)&&(t=s)};for(let s of[n.release,n.upcoming])i(s?.startsAt),i(s?.endsAt);for(let s of n.prices)i(s.startsAt),i(s.endsAt);return t}function Oe(n){let e={};for(let t of n?.prices??[])e[t.categoryKey]=t.price;return e}var wt="seatlayer-picker-style",Oi=`
45
+ }`,e.append(t);let i="linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.10) 37%, rgba(255,255,255,0.04) 63%)",s=document.createElement("div");Object.assign(s.style,{position:"absolute",inset:"0",display:"flex",flexDirection:"column",padding:"16px",gap:"14px",opacity:"0.9"});let r=d=>{let p=document.createElement("div");return p.className="sl-shimmer",Object.assign(p.style,{background:i,borderRadius:"8px"}),Object.assign(p.style,d),p};s.append(r({height:"40px",width:"100%",flex:"0 0 auto"}));let o=document.createElement("div");Object.assign(o.style,{display:"flex",gap:"14px",flex:"1 1 auto",minHeight:"0"}),o.append(r({width:"220px",height:"100%",flex:"0 0 auto"})),o.append(r({flex:"1 1 auto",height:"100%"})),s.append(o),e.append(s);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:i,flex:"0 0 auto"}),a.append(l),a.append(document.createTextNode("Loading designer\u2026")),e.append(a)}buildErrorCard(e,t){let i=Ri[t],s=document.createElement("div");Object.assign(s.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 r=document.createElement("h2");r.textContent=i.title,Object.assign(r.style,{margin:"0 0 8px",fontSize:"17px",fontWeight:"600",color:"#f4f7ff"});let o=document.createElement("p");o.textContent=i.body,Object.assign(o.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()),s.append(r,o,a),e.append(s)}};var g=require("@seatlayer/core"),Te=require("@seatlayer/core/view3d/crossfade/panorama"),at=require("@seatlayer/core/core/seatConfidence");var Oi=/^[a-zA-Z0-9._-]+$/;function $i(n){let e;try{e=new URL(n,"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 i=decodeURIComponent(t[1]),s=decodeURIComponent(t[2]);return!i||!Oi.test(s)?null:{eventKey:i,asset:s}}catch{return null}}function Ii(n){try{return/^\/pub\/events\/[^/]+\/assets(?:\/|$)/.test(new URL(n,"https://seatlayer.invalid").pathname)}catch{return!1}}var Oe=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=$i(e);if(!t)return Promise.resolve(Ii(e)?null:e);if(t.eventKey!==this.eventKey||!this.load||this.disposed)return Promise.resolve(null);let i=this.pending.get(e);if(i)return i;let s=this.load(this.eventKey,t.asset).then(r=>{let o=URL.createObjectURL(r);return this.disposed?(URL.revokeObjectURL(o),null):(this.created.add(o),o)}).catch(r=>{throw this.pending.delete(e),r});return this.pending.set(e,s),s}dispose(){if(!this.disposed){this.disposed=!0;for(let e of this.created)URL.revokeObjectURL(e);this.created.clear(),this.pending.clear()}}};var zi=["on-sale","low","sold-out","presale","closed"];function $e(n){return n==null?null:typeof n=="number"&&Number.isFinite(n)&&n>=0?n:void 0}function xt(n){return n==null?null:typeof n=="number"&&Number.isFinite(n)&&n>=0?n:void 0}function yt(n){if(n==null)return null;if(typeof n!="object"||Array.isArray(n))return;let e=n,t=e.count,i=e.index;if(typeof i!="number"||!Number.isInteger(i)||i<1||typeof t!="number"||!Number.isInteger(t)||t<i)return;let s=e.remaining;if(s!=null&&(typeof s!="number"||!Number.isInteger(s)||s<0))return;let r={index:i,count:t,remaining:s??null};if(e.id!==void 0){if(typeof e.id!="string"||!e.id.trim())return;r.id=e.id.trim()}if(e.name!==void 0){if(typeof e.name!="string"||!e.name.trim())return;r.name=e.name.trim()}if(e.categoryKey!==void 0){if(e.categoryKey!==null&&(typeof e.categoryKey!="string"||!e.categoryKey.trim()))return;r.categoryKey=e.categoryKey==null?null:e.categoryKey.trim()}for(let o of["startsAt","endsAt"]){if(e[o]===void 0)continue;let a=xt(e[o]);if(a===void 0)return;r[o]=a}return r}function Ie(n){if(!n||typeof n!="object"||Array.isArray(n))return null;let e=n,t=zi.find(d=>d===e.state);if(!t)return null;let i=$e(e.fromPrice),s=$e(e.previousPrice);if(i===void 0||s===void 0)return null;let r=e.currency==null?null:typeof e.currency=="string"&&e.currency.trim()?e.currency.trim():void 0;if(r===void 0)return null;let o=yt(e.release);if(o===void 0)return null;let a=e.upcoming===void 0?null:yt(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 c=p,h=typeof c.categoryKey=="string"?c.categoryKey.trim():"";if(!h)return null;let f=$e(c.price),m=$e(c.previousPrice);if(f==null||m===void 0)return null;let v={categoryKey:h,price:f,previousPrice:m};if(c.offerId!==void 0){if(typeof c.offerId!="string"||!c.offerId.trim())return null;v.offerId=c.offerId.trim()}if(c.offerName!==void 0){if(typeof c.offerName!="string"||!c.offerName.trim())return null;v.offerName=c.offerName.trim()}if(c.remaining!==void 0){if(c.remaining!==null&&(typeof c.remaining!="number"||!Number.isInteger(c.remaining)||c.remaining<0))return null;v.remaining=c.remaining==null?null:c.remaining}for(let k of["startsAt","endsAt"]){if(c[k]===void 0)continue;let w=xt(c[k]);if(w===void 0)return null;v[k]=w}d.push(v)}l=d}return{state:t,fromPrice:i,previousPrice:s,currency:r,release:o,upcoming:a,prices:l}}function wt(n,e){if(!n)return null;let t=null,i=s=>{s!=null&&s>e&&(t===null||s<t)&&(t=s)};for(let s of[n.release,n.upcoming])i(s?.startsAt),i(s?.endsAt);for(let s of n.prices)i(s.startsAt),i(s.endsAt);return t}function ze(n){let e={};for(let t of n?.prices??[])e[t.categoryKey]=t.price;return e}var kt="seatlayer-picker-style",Bi=`
46
46
  .sl-picker{position:relative;display:flex;flex-direction:column;width:100%;height:100%;min-height:420px;overflow:hidden;
47
47
  background:var(--sl-bg);color:var(--sl-text);font-family:var(--sl-font);border-radius:var(--sl-radius);
48
48
  --sl-r-sm:calc(var(--sl-radius) * .55);
@@ -1207,7 +1207,7 @@
1207
1207
  corners, and it is the frame. */
1208
1208
  .sl-modal-frame > .sl-picker{border-radius:0}
1209
1209
  @media(max-width:640px){.sl-modal-scrim{padding:0}.sl-modal-frame{width:100%;height:100%;border-radius:0}}
1210
- `;function Ge(){if(document.getElementById(wt))return;let n=document.createElement("style");n.id=wt,n.textContent=Oi,document.head.appendChild(n)}function se(n){if(!n)return null;let e=n.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 s=t.length<=4?[...t].map(r=>`${r}${r}`).join(""):t;return{r:Number.parseInt(s.slice(0,2),16),g:Number.parseInt(s.slice(2,4),16),b:Number.parseInt(s.slice(4,6),16)}}let i=/^rgba?\(\s*([\d.]+)[,\s]+([\d.]+)[,\s]+([\d.]+)(?:\s*[,/]\s*[\d.]+%?)?\s*\)$/i.exec(e);return i?{r:Math.max(0,Math.min(255,Number(i[1]))),g:Math.max(0,Math.min(255,Number(i[2]))),b:Math.max(0,Math.min(255,Number(i[3])))}:null}function ze(n){let e=t=>{let i=t/255;return i<=.04045?i/12.92:((i+.055)/1.055)**2.4};return .2126*e(n.r)+.7152*e(n.g)+.0722*e(n.b)}function Z(n,e){let t=se(n),i=se(e);if(!t||!i)return null;let s=Math.max(ze(t),ze(i)),r=Math.min(ze(t),ze(i));return(s+.05)/(r+.05)}function ke(n,e="#172033",t="#eef1f8"){return(Z(e,n)??0)>=(Z(t,n)??0)?e:t}function zi(n){let e=t=>Math.round(t).toString(16).padStart(2,"0");return`#${e(n.r)}${e(n.g)}${e(n.b)}`}function Ye(n,e,t){let i=se(n),s=se(e);if(!i||!s)return null;let r=Math.max(0,Math.min(1,t));return zi({r:i.r*r+s.r*(1-r),g:i.g*r+s.g*(1-r),b:i.b*r+s.b*(1-r)})}function Bi(n,e,t,i){if((Z(n,t)??4.5)>=4.5&&(Z(n,i)??4.5)>=4.5)return n;if(!se(n)||!se(e))return e;for(let s=.15;s<=1;s+=.05){let r=Ye(n,e,1-s);if(r&&(Z(r,t)??0)>=4.5&&(Z(r,i)??0)>=4.5)return r}return e}function Xe(n,e){let t=e?.background??n?.background??"#0f1522",i=se(t)?ke(t)==="#172033":!1,s=e?.surface??(i?"#ffffff":"#1a2234"),r=e?.accent??n?.accent??"#f4b740",o=n?.accentInk,a=e?.accentInk??(o&&(Z(o,r)??4.5)>=4.5?o:ke(r,"#1a1200","#ffffff")),l=n?.textColor,c=e?.text??(l&&(Z(l,t)??4.5)>=4.5&&(Z(l,s)??4.5)>=4.5?l:ke(t));return{"--sl-accent":r,"--sl-accent-ink":a,"--sl-accent-text":Bi(r,c,t,s),"--sl-bg":t,"--sl-surface":s,"--sl-text":c,"--sl-muted":e?.muted??(i?"#667085":"#a5aec2"),"--sl-line":e?.line??(i?"rgba(23,32,51,.16)":"rgba(165,174,194,.24)"),"--sl-font":e?.fontFamily??n?.fontFamily??"-apple-system,BlinkMacSystemFont,'Segoe UI',Inter,sans-serif","--sl-radius":`${e?.radius??14}px`}}var Ot=require("@seatlayer/core/core/seatConfidence");var Lt=require("@seatlayer/core"),Ui={};function E(n,e){let t=(0,Lt.t)(n);return t===n?e:t}function Mt(n){if(typeof n=="string"){let e=document.querySelector(n);if(!e)throw new Error(`seatmap: container "${n}" not found`);return e}if(!(n instanceof HTMLElement))throw new Error("seatmap: container must be a CSS selector or an HTMLElement");return n}function D(n){return String(n??"").replace(/[&<>"']/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[e])}var ji=(()=>{if(typeof document<"u"&&document.currentScript instanceof HTMLScriptElement&&document.currentScript.src)return document.currentScript.src;try{let n=Ui.url;if(typeof n=="string"&&n)return n}catch{}})(),me=null;function Pt(){if(me!==null)return me;try{if(typeof document>"u")return me=!1;me=!!document.createElement("canvas").getContext("webgl2")}catch{me=!1}return me}function Ze(n){let e=ji??(typeof location<"u"?location.href:void 0);if(!e)throw new Error(`seatlayer: cannot resolve the ${n} chunk URL`);return new URL(`./${n}`,e).href}async function Ht(){return typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?import(Ze("seatlayer-view3d.mjs")):import("@seatlayer/core/view3d")}async function Rt(){return typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?import(Ze("seatlayer-panorama.mjs")):import("@seatlayer/core")}async function $t(){return typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?import(Ze("seatlayer-checkout.mjs")):Promise.resolve().then(()=>(At(),Tt))}function It(n){return n==="unavailable_for_event"||n==="payments_off_for_event"?n:"not_configured"}function Be(n,e,t){let i={month:"short",day:"numeric",hour:"numeric",minute:"2-digit"},s=new Date(n);if(e)try{return s.toLocaleString(t,{...i,timeZone:e})}catch{}return s.toLocaleString(t,i)}function G(n){return String(n??"").replace(/[&<>"]/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[e])}function fe(n){return n?.restrictedView?E("picker.restrictedView","Restricted view"):n?.obstructedView?E("picker.obstructedView","Obstructed view"):""}function zt(n){if(!n)return"";let e=[];n.premium&&e.push(`<div class="sl-cx-premium"><span class="sl-cx-star" aria-hidden="true">\u2605</span>${E("picker.premiumSeat","Premium seat")}</div>`);let t=fe(n);return t?e.push(`<div class="sl-cx-warn"><span class="sl-cx-glyph" aria-hidden="true">\u25D0</span><span class="sl-cx-txt"><b>${t}</b>${n.note?`<span class="sl-cx-note">${G(n.note)}</span>`:""}</span></div>`):n.note&&e.push(`<div class="sl-cx-warn"><span class="sl-cx-glyph" aria-hidden="true">\u2139</span><span class="sl-cx-txt"><span class="sl-cx-note">${G(n.note)}</span></span></div>`),e.length?`<div class="sl-cx">${e.join("")}</div>`:""}function Je(n){let e=fe(n);if(!e)return"";let t=G(n?.note?n.note:e);return`<span class="sl-cx-mark" role="img" aria-label="${t}" title="${t}">\u25D0</span>`}function Se(n){return n==="no-seat"?E("picker.emptyWheelchairSpace","Empty wheelchair space"):n==="seat-present"?E("picker.accessiblePhysicalSeat","Accessible physical seat"):""}function Bt(n){let e=Se(n);return e?`<div class="sl-cx"><div class="sl-cx-warn"><span class="sl-cx-glyph" aria-hidden="true">\u267F</span><span class="sl-cx-txt"><b>${e}</b></span></div></div>`:""}function et(n){let e=Se(n);return e?`<span class="sl-cx-mark" role="img" aria-label="${e}" title="${e}">\u267F</span>`:""}function tt(n,e){if(!n)return"";let t=e?E("picker.viewFromThisSeat","View from this seat"):E("picker.seeItIn3d","See it in 3D");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>${t}</span></button>`}function _t(n){if(!n)return"";let e=n.previous.label||n.previous.id,t=n.next.label||n.next.id;return`<span class="sl-seccard-nav" aria-label="${E("picker.browseSections","Browse sections")}"><button type="button" data-section-nav="${D(n.previous.id)}" aria-label="${E("picker.previousSection","Previous section")}: ${D(e)}" title="${D(e)}">\u2190</button><button type="button" data-section-nav="${D(n.next.id)}" aria-label="${E("picker.nextSection","Next section")}: ${D(t)}" title="${D(t)}">\u2192</button></span>`}function Ft(n,e){if(!e)return"";let t=e,i=t.includes(n.id),s=i?t.length>1?E("picker.openComparison","Open comparison"):E("picker.savedForComparison","Saved for comparison"):t.length?E("picker.compareWithSaved","Compare with saved"):E("picker.saveToCompare","Save to compare");return`<button type="button" class="sl-confirm-compare"${i&&t.length===1?" disabled":""}><span aria-hidden="true">\u21C4</span><span>${G(s)}</span></button>`}function Dt(n,e,t){if(!t)return"";let i=(0,Ot.seatConfidenceDisclosure)(n.confidenceEvidence),s=i.modeledTarget??i.reality;return`<button type="button" class="sl-confirm-confidence" aria-label="Open seat confidence passport for ${G(n.displayLabel??n.label)}"><span><em>${G(e)}</em><strong>${G(i.headline)}</strong><small>${G(s)}</small></span><b>Passport</b></button>`}function re(n){let e=n?.rowLabel,t=n?.sectionLabel;if(!e||!t)return e;for(let i of["-"," ","\xB7","/","_"]){let s=`${t}${i}`;if(e.startsWith(s)&&e.length>s.length)return e.slice(s.length)}return e}var Nt=require("@seatlayer/core"),be=require("@seatlayer/core/picker/minimapGeometry");function jt(n,e){let t=new it(n);return t.build(e),t}var it=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}build(e){if(!this.host.controller.getViewport())return;let i=document.createElement("button");i.type="button",i.className="sl-minimap-toggle",i.setAttribute("aria-label",E("picker.openVenueMap","Open venue overview map")),i.setAttribute("aria-expanded","false"),i.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(i),this.miniToggle=i;let s=document.createElement("div");s.className="sl-minimap",s.setAttribute("role","group");let r=document.createElement("div");r.className="sl-minimap-bar";let o=document.createElement("span");o.className="sl-minimap-label";let a=document.createElement("span");a.className="sl-minimap-key",a.setAttribute("aria-label",E("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",E("picker.closeVenueMap","Close venue overview map")),l.textContent="\xD7",r.append(o,a,l);let c=document.createElement("canvas");c.tabIndex=0,c.setAttribute("role","application"),c.setAttribute("aria-label",E("picker.venueMapInstructions","Venue overview map. Drag the viewport, click a section, or use arrow keys to pan.")),s.append(r,c),e.appendChild(s),this.miniWrap=s,this.miniLabel=o,this.miniCanvas=c;let p=document.createElement("canvas");this.miniBase=p,i.addEventListener("click",()=>this.setMinimapOpen(!0)),l.addEventListener("click",()=>this.setMinimapOpen(!1)),c.addEventListener("click",d=>{if(this.miniSuppressClick){this.miniSuppressClick=!1;return}this.minimapJump(d)}),c.addEventListener("pointerdown",d=>this.minimapPointerDown(d)),c.addEventListener("pointermove",d=>this.minimapPointerMove(d)),c.addEventListener("pointerup",d=>this.minimapPointerUp(d)),c.addEventListener("pointercancel",d=>this.minimapPointerUp(d)),c.addEventListener("keydown",d=>this.minimapKeydown(d)),this.layoutMinimap(),this.syncMinimapLabel(),this.drawMinimapStatic(),this.drawMinimapRect()}setMinimapOpen(e){this.host.root()?.setAttribute("data-minimap-open",String(e)),this.miniToggle?.setAttribute("aria-expanded",String(e)),e?this.miniCanvas?.focus():this.miniToggle?.focus()}layoutMinimap(){let e=this.miniCanvas,t=this.miniBase,i=this.host.controller.getViewport()?.bounds;if(!e||!t||!i||!(i.width>0&&i.height>0))return;let s=196,r=146,o=6,a=i.width/Math.max(1,i.height),l=s,c=Math.round(s/a);c>r&&(c=r,l=Math.round(r*a)),l=Math.max(64,l),c=Math.max(48,c);let p=Math.min(2,window.devicePixelRatio||1);e.width=Math.round(l*p),e.height=Math.round(c*p),e.style.width=`${l}px`,e.style.height=`${c}px`,t.width=e.width,t.height=e.height,this.miniTf=(0,be.createMinimapTransform)(i,e.width,e.height,p,o)}syncMinimapLabel(){if(!this.miniLabel||!this.miniWrap)return;let e=this.host.controller.getFloors(),t=this.host.controller.isFloorOverview()?E("picker.allFloors","All floors"):e.find(p=>p.id===this.host.controller.getActiveFloorId())?.name??E("picker.venueOverview","Venue overview"),i=this.host.controller.getMinimapSnapshot().sections,r=i.find(p=>p.active)?.label??this.host.focusedSectionLabel(),o=r?`${t} \xB7 ${r}`:t;this.miniLabel.textContent=o;let a=i.filter(p=>p.state==="selected").length,l=i.filter(p=>p.state==="available").length,c=i.filter(p=>p.state==="inactive").length;this.miniWrap.setAttribute("aria-label",i.length?`${o}. ${a} selected, ${l} available, ${c} inactive sections.`:o),this.miniCanvas?.setAttribute("aria-label",i.length?`${o}. ${a} selected, ${l} available, ${c} inactive sections. ${E("picker.venueMapInstructions","The outlined region is the visible map area. Drag it, click a section, or use arrow keys to pan.")}`:`${o}. ${E("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 i=e.getContext("2d");if(!i)return;i.clearRect(0,0,e.width,e.height);let s=d=>d*t.scale+t.offX,r=d=>d*t.scale+t.offY,o=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",p=this.host.controller.getMinimapSnapshot();for(let d of p.sections)d.outline.length<3||(i.beginPath(),d.outline.forEach((h,b)=>b===0?i.moveTo(s(h.x),r(h.y)):i.lineTo(s(h.x),r(h.y))),i.closePath(),i.globalAlpha=d.state==="inactive"?.18:d.state==="selected"?.72:.34,i.fillStyle=d.state==="inactive"?a:d.state==="selected"?l:c,i.fill(),i.globalAlpha=.82,i.lineWidth=Math.max(1,t.dpr),i.strokeStyle=o,i.stroke(),d.active&&(i.globalAlpha=1,i.lineJoin="round",i.lineWidth=Math.max(4,t.dpr*3.5),i.strokeStyle=this.host.cssVar("--sl-surface")||"#fff",i.stroke(),i.lineWidth=Math.max(2,t.dpr*1.75),i.strokeStyle=l,i.stroke()));if(i.globalAlpha=1,!p.sections.length){let d=Math.max(1,t.dpr);for(let h of p.seats)i.globalAlpha=h.state==="inactive"?.22:.78,i.fillStyle=h.state==="inactive"?a:h.state==="selected"?l:c,i.beginPath(),i.arc(s(h.x),r(h.y),d,0,Math.PI*2),i.fill();i.globalAlpha=1}}drawMinimapRect(){let e=this.miniCanvas,t=this.miniBase,i=this.miniTf;if(!e||!t||!i)return;let s=e.getContext("2d");if(!s)return;s.clearRect(0,0,e.width,e.height),s.drawImage(t,0,0);let r=this.host.controller.getViewport();if(!r)return;let o=(0,be.minimapViewportPlan)(r.visible,i,e.width,e.height,Math.max(2,i.dpr*2)),a=this.host.cssVar("--sl-text")||"#12151c",l=this.host.cssVar("--sl-surface")||"#fff";s.save(),s.globalAlpha=.1,s.fillStyle=a,s.fillRect(o.raw.x,o.raw.y,o.raw.width,o.raw.height),s.globalAlpha=.9,s.lineJoin="round",s.lineWidth=Math.max(4,i.dpr*3.25),s.strokeStyle=l,s.strokeRect(o.raw.x,o.raw.y,o.raw.width,o.raw.height),s.globalAlpha=1,s.lineWidth=Math.max(2,i.dpr*1.75),s.strokeStyle=a,s.strokeRect(o.raw.x,o.raw.y,o.raw.width,o.raw.height),o.clipped&&Object.values(o.clippedEdges).some(Boolean)&&(s.setLineDash([Math.max(3,i.dpr*3),Math.max(2,i.dpr*2)]),s.strokeRect(o.clipped.x,o.clipped.y,o.clipped.width,o.clipped.height)),s.restore()}minimapWorldPoint(e){let t=this.miniCanvas,i=this.miniTf;if(!t||!i)return null;let s=t.getBoundingClientRect(),r=(e.clientX-s.left)*(t.width/Math.max(1,s.width)),o=(e.clientY-s.top)*(t.height/Math.max(1,s.height));return{...(0,be.minimapPointToWorld)({x:r,y:o},i),px:r,py:o}}minimapPointerDown(e){let t=this.minimapWorldPoint(e),i=this.host.controller.getViewport()?.visible;!t||!i||!(t.x>=i.x&&t.x<=i.x+i.width&&t.y>=i.y&&t.y<=i.y+i.height)||(this.miniDrag={pointerId:e.pointerId,offsetX:t.x-(i.x+i.width/2),offsetY:t.y-(i.y+i.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 i=this.minimapWorldPoint(e);i&&(!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:i.x-t.offsetX,y:i.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 i=e.key==="ArrowLeft"?-t.width*.2:e.key==="ArrowRight"?t.width*.2:0,s=e.key==="ArrowUp"?-t.height*.2:e.key==="ArrowDown"?t.height*.2:0;!i&&!s||(this.host.controller.clearSectionFocus(),this.host.controller.panToWorld({x:t.x+t.width/2+i,y:t.y+t.height/2+s}),e.preventDefault())}minimapJump(e){let t=this.minimapWorldPoint(e);if(t){for(let i of this.host.controller.getMinimapSnapshot().sections)if(!(i.state==="inactive"||i.outline.length<3)&&(0,Nt.pointInPolygon)(t,i.outline)){this.host.controller.focusSection(i.id);return}this.host.controller.clearSectionFocus(),this.host.controller.panToWorld(t)}}};var _e=require("@seatlayer/core");var Vi=12;function Ut(n,e){let t=e.floors(),i=new Set(t.map(f=>f.label.trim().toLocaleLowerCase())),s=e.zones().filter(f=>f.seatCount>0&&!i.has(f.label.trim().toLocaleLowerCase())),r=e.sections().filter(f=>f.seatCount>0&&!i.has(f.label.trim().toLocaleLowerCase())),o=s.length>1?[]:r,a=t.length>1,l=s.length>1,c=o.length>1;if(!a&&!l&&!c)return;let p=document.createElement("div");p.className="sl-view3d-nav";let d=document.createElement("button");d.type="button",d.className="sl-view3d-nav-toggle",d.setAttribute("aria-expanded","false");let h=f=>{p.classList.toggle("is-open",f),d.setAttribute("aria-expanded",String(f)),d.textContent=f?E("picker.closeVenueNav","Close"):a&&(l||c)?E("picker.levelsAndAreas","Levels & areas"):a?E("picker.levels","Levels"):E("picker.areas","Areas")};d.addEventListener("click",()=>h(!p.classList.contains("is-open"))),p.addEventListener("keydown",f=>{f.key!=="Escape"||!p.classList.contains("is-open")||(f.preventDefault(),f.stopPropagation(),h(!1),d.focus())}),h(!1),p.appendChild(d);let b=f=>{},m=f=>{};if(a){let f=document.createElement("div");f.setAttribute("role","group"),f.setAttribute("aria-label",E("picker.levels","Levels"));let k=[];m=x=>{k.forEach(T=>{T.setAttribute("aria-pressed",String((T.dataset.floor===""?null:Number(T.dataset.floor))===x))})};let C=x=>{e.focusFloor(x)&&(m(x),b(x))},w=(x,T)=>{let u=document.createElement("button");u.type="button",u.textContent=x,u.dataset.floor=T===null?"":String(T),u.setAttribute("aria-pressed",String(T===null)),u.addEventListener("click",()=>{C(T),h(!1)}),k.push(u),f.appendChild(u)};w(E("picker.allLevels","All levels"),null);for(let x of t)w(x.label||(0,_e.t)("picker.levelNumber",{number:x.index+1}),x.index);p.appendChild(f)}if(l||c){let f=document.createElement("div");f.setAttribute("role","group"),f.setAttribute("aria-label",E("picker.areas","Areas"));let k=l?s.map(w=>({id:w.id,label:w.label||w.id,go:()=>{e.focusZone(w.id)}})):o.map(w=>({id:w.id,label:w.label||w.id,floorIndex:w.floorIndex,go:()=>{e.focusSection(w.id),Number.isFinite(w.floorIndex)&&m(w.floorIndex)}})),C=w=>{let x=l||w===null?k:k.filter(T=>T.floorIndex===void 0||T.floorIndex===w);if(f.replaceChildren(),!x.length){f.remove();return}if(f.isConnected||p.appendChild(f),!l&&x.length>Vi){let T=document.createElement("select");T.setAttribute("aria-label",E("picker.jumpToSection","Jump to section"));let u=document.createElement("option");u.value="",u.textContent=E("picker.jumpToSection","Jump to section"),T.appendChild(u);for(let v of x){let L=document.createElement("option");L.value=v.id,L.textContent=v.label,T.appendChild(L)}T.addEventListener("change",()=>{x.find(v=>v.id===T.value)?.go()}),f.appendChild(T);return}for(let T of x){let u=document.createElement("button");u.type="button",u.textContent=T.label,u.addEventListener("click",()=>{T.go(),h(!1)}),f.appendChild(u)}};b=C,C(null)}n.appendChild(p)}var Fe=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",E("picker.savedSeatComparison","Saved seat comparison"));let r=document.createElement("button");r.type="button",r.className="main",r.addEventListener("click",()=>{this.host.savedSeatIds().length>1?this.host.openComparison():this.host.toast(E("picker.chooseAnotherToCompare","Choose another seat to compare."),"neutral")});let o=document.createElement("button");o.type="button",o.className="clear",o.textContent="\xD7",o.setAttribute("aria-label",E("picker.clearSavedSeatComparison","Clear saved seat comparison")),o.addEventListener("click",()=>this.host.clearComparison()),t.append(r,o),e.appendChild(t),this.chip=t}let i=this.host.savedSeatIds().length,s=t.querySelector(".main");s&&(s.textContent=i>1?(0,_e.t)("picker.compareCount",{count:i}):E("picker.oneSeatSaved","1 seat saved"),s.setAttribute("aria-label",i>1?(0,_e.t)("picker.openComparisonOfSeats",{count:i}):E("picker.oneSeatSavedChooseAnother","One seat saved; choose another to compare")))}remove(){this.chip?.remove(),this.chip=null}mainButton(){return this.chip?.querySelector(".main")??null}};var ne=require("@seatlayer/core");function st(n){let e=Math.max(0,n),t=Math.floor(e/6e4),i=String(Math.floor(e%6e4/1e3)).padStart(2,"0");return`${t}:${i}`}function Vt({d:n,area:e,label:t,objectType:i,quantity:s=1,identity:r}){let o=p=>String(p??"\u2014").replace(/[&<>"]/g,d=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[d]),a=i==="ga"?"ga":n?.objectType??i,l=r?.displayType?.trim()||n?.displayType?.trim()||e?.displayType?.trim()||(a==="table"?E("picker.table","Table"):a==="booth"?E("picker.booth","Booth"):a==="ga"?E("picker.generalAdmission","General admission"):E("picker.row","Row")),c=r?.rowLabel??r?.displayLabel??n?.rowLabel??n?.displayLabel??e?.displayLabel??e?.label??t;return a==="table"&&r?.bookingMode?`<div class="sl-chip-id"><span class="fld sec"><span class="sl-chip-eb">${o(l)}</span><span class="val">${o(c)}</span></span><span class="fld mid"><span class="sl-chip-eb">${E("picker.guests","Guests")}</span><span class="val">${s}</span></span></div>`:a==="ga"?`<div class="sl-chip-id"><span class="fld sec"><span class="sl-chip-eb">${o(l)}</span><span class="val">${o(c)}</span></span>`+(s>1?`<span class="fld mid"><span class="sl-chip-eb">${E("picker.tickets","Tickets")}</span><span class="val">${s}</span></span>`:"")+"</div>":a==="booth"?'<div class="sl-chip-id">'+(n?.sectionLabel?`<span class="fld sec"><span class="sl-chip-eb">${E("picker.section","Section")}</span><span class="val">${o(n.sectionLabel)}</span></span>`:"")+`<span class="fld mid"><span class="sl-chip-eb">${o(l)}</span><span class="val">${o(c)}</span></span></div>`:!n?.sectionLabel&&!n?.rowLabel&&!n?.seatNumber?`<div class="sl-chip-id"><span class="fld sec"><span class="sl-chip-eb">${E("picker.seat","Seat")}</span><span class="val">${o(c)}</span></span></div>`:'<div class="sl-chip-id">'+(n.sectionLabel?`<span class="fld sec"><span class="sl-chip-eb">${E("picker.section","Section")}</span><span class="val">${o(n.sectionLabel)}</span></span>`:"")+(n.rowLabel?`<span class="fld mid"><span class="sl-chip-eb">${o(l)}</span><span class="val">${o(re(n))}</span></span>`:"")+(n.seatNumber?`<span class="fld mid"><span class="sl-chip-eb">${E("picker.seat","Seat")}</span><span class="val">${o(n.seatNumber)}</span></span>`:"")+"</div>"}function qt(n,e){return`<div class="sl-chip-rail"><button type="button" class="rm" aria-label="${n}"><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>`+(e?`<button type="button" class="view" data-view-label="${e}" aria-label="${(0,ne.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>`:"")+"</div>"}function Kt({count:n,total:e,pendingCount:t,ctaPhase:i,hasHold:s,salesClosed:r,fromPrice:o,money:a}){if(n&&i==="holding")return`<span>${E("picker.securingSeats","Securing your seats\u2026")}</span>`;if(n&&i==="checkout")return`<span>${(0,ne.t)("picker.peekSecured",{count:n,total:a(e)})}</span>`;if(n){let l=!!s;return`<span>${(0,ne.tCount)("picker.peekTicketsTotal",n,{total:a(e)})}</span><button type="button" class="go sl-sheet-go" data-act="${l?"checkout":"open"}">${s?t?E("picker.secureMore","Secure more"):E("picker.continue","Continue"):E("picker.review","Review")}</button>`}else return r?`<span>${E("picker.salesClosedPill","Sales are closed")}</span>`:(o!=null?`<span>${(0,ne.t)("picker.peekFromPrice",{price:a(o)})}</span>`:`<span>${E("picker.pickYourSeats","Pick your seats")}</span>`)+`<button type="button" class="go sl-sheet-go" data-act="open">${E("picker.bestSeatsStar","\u2726 Best seats")}</button>`}function rt(n,e=Date.now()){return(0,ne.t)("picker.holdReassurance",{time:st(n-e)})}var qi="https://api.seatlayer.io",Ki=10,Wt=6e4,Gt=6e4,Yt=new Set;function Wi(n){let e=Yt.has(n);return Yt.add(n),e}var Xt="seatmap.a11y.cb";function Gi(){try{if(typeof window>"u")return null;let n=window.localStorage.getItem(Xt);return n==null?null:n==="1"}catch{return null}}function Yi(n){try{window.localStorage.setItem(Xt,n?"1":"0")}catch{}}var De=class n{constructor(e){this.realtime=null;this.accessEl=null;this.root=null;this.mapHost=null;this.rendered=!1;this.destroyed=!1;this.els={};this.regions={};this.ro=null;this.holdTimer=null;this.toastTimer=null;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.hold=null;this.holdExpiresAt=0;this.handedOff=!1;this.bookedShown=!1;this.paymentOptions=null;this.checkoutPanel=null;this.extendEl=null;this.bookedEl=null;this.gaQty=new Map;this.tipEl=null;this.tipPos={x:0,y:0};this.confirmEl=null;this.confirmSeat=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.baReopen=!1;this.bestAvailableConfirm=!1;this.releasingHold=!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 Fe({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.view3dPassportEl=null;this.view3dPassportCleanup=null;this.floorsEl=null;this.secCardEl=null;this.viewEl=null;this.viewCleanup=null;this.seatViewGen=0;this.allSeatsCache=null;this.minimap=null;this.pickerLayoutSize={width:0,height:0};this.priceBandKeys=null;this.focusedCatKey=null;this.limitedViewFilter=!1;this.pricesExpanded=!1;this.lastSection=null;this.secCardCollapsed=!1;this.secCardShownAt=0;this.lastTrayCount=0;this.lastTrayTotal=0;this.lastTrayKeys=new Set;this.bestAvailableBusy=!1;this.releasingLabels=new Set;this.holdingLabels=new Set;this.ctaPhase="idle";this.a11yChipsEl=null;this.fsFallback=!1;this.fsChangeHandler=null;this.fsEscHandler=null;this.eventDetailsHidden=!1;this.holdCopyPending=!1;this.sideCollapsed=!1;this.sideToggleEl=null;this.pricesBtnEl=null;this.framedFs=!1;this.lastPostedHeight=0;this.cbEl=null;this.modalScrim=null;this.prevFocus=null;this.escHandler=null;this.closeModal=null;this.lastCatAvail=null;this.lastAvailFloorId="";this.availQuietUntil=0;this.liveTimer=null;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.opts={...e,confirmSelection:e.confirmSelection??!0},this.eventDetailsHidden=!!e.hideEventDetails,this.hostPricing=e.pricing,this.apiBase=(e.apiBase??qi).replace(/\/+$/,""),this.access=e.transport?null:ue(e,{onExpired:t=>{this.opts.onAccessExpired?.(t),t.refreshed||this.showAccessPanel({reason:"no_token",retryable:!1})},onUnavailable:t=>{this.opts.onAccessUnavailable?.(t),this.showAccessPanel(t)}}),this.pubApi=e.transport?null:new le(this.apiBase,{access:this.access??void 0,onObjectUnavailable:t=>this.opts.onSelectedObjectUnavailable?.(t)}),this.api=e.transport??this.pubApi,this.buyerAssetUrls=new Re(e.event,this.api.asset?(t,i)=>this.api.asset(t,i):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",this.maxTickets=Math.max(1,Math.floor(e.maxSelection??Ki)),this.cbSafe=Gi()??!!e.colorblindSafe,this.controller=new g.PickerController({transport:this.api,eventKey:e.event,maxSelection:this.maxTickets,currency:e.currency,flashOnLiveChange:!0,colorblindSafe:this.cbSafe,mapTheme:e.theme?.map??null,onSelectionChange:()=>{this.syncTray(),this.minimap?.refreshMinimap(),this.committedSelection().length&&this.collapseSectionCard(),this.syncSelectionTo3d()},onStatusChange:()=>{this.syncPrices(),this.scheduleOfferRefresh(!0),this.evictTakenSelections(),this.detectBooked(),this.minimap?.refreshMinimap(),this.pushAvailabilityTo3d()},onHoldExpired:()=>{this.hold=null,this.forgetHold(),this.handedOff=!1,this.bookedShown=!1,this.ctaPhase="idle",this.stopHoldTimer(),this.gaQty.clear(),this.toast((0,g.t)("picker.holdExpired",void 0)||"Your hold expired \u2014 seats released. Pick again.","warning"),this.syncTray(),this.emitHoldChange(),this.opts.onHoldExpired?.()},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.flashPickedSeat(t.id),this.opts.confirmSelection&&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=>{this.confirmSeat?.id===t.id&&this.dismissConfirm(),this.tableDialog?.physicalSeatIds.includes(t.id)&&this.dismissTableDialog()},onSelectionLimit:()=>{this.toast((0,g.t)("picker.maxTicketsForOrder",{count:this.maxTickets}),"warning")},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),onHint:t=>{t&&this.toast(t)},onSalesClosed:()=>this.setSalesClosed(!0),onError:t=>this.opts.onError?.(t)})}chartHasStage(){let e=this.controller.doc;if(!e)return!1;let t=e.floors?.length?e.floors.map(i=>i.objects??[]):[e.objects??[]];for(let i of t)for(let s of i)if(s.type==="shape"&&(s.role==="stage"||s.stageKind))return!0;return!1}confirmThumbHtml(e){let t=this.controller.doc;if(!t)return"";let i=e.viewUrl??"",s=this.chartHasStage();if(!i&&!s)return"";let r=null;if(!i)try{r=(0,g.generateSeatThumb)(e,e.focalPoint??t.focalPoint).distanceM??null}catch{return""}let o=s&&r!=null?`<div class="sl-confirm-sight">${(0,g.t)("picker.sightline",{m:r})}</div>`:"";return(i?`<button type="button" class="sl-confirm-view sl-confirm-thumbwrap" aria-label="${(0,g.t)("picker.viewFromSeat",{label:e.label})}"><img class="sl-confirm-thumb" alt="" /><span class="sl-confirm-thumb-badge">\u{1F52D} ${this.tf("picker.viewFromHere","View from here")}</span></button>`:`<button type="button" class="sl-confirm-view sl-confirm-viewbtn" aria-label="${(0,g.t)("picker.viewFromSeat",{label:e.label})}"><span aria-hidden="true">\u{1F52D}</span><span>${this.tf("picker.viewFromHere","View from here")}</span></button>`)+o}isFramed(){return typeof window<"u"&&window.parent!==window}postToHost(e){if(this.isFramed())try{window.parent.postMessage(e,"*")}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 i=t<640?1.2:.62;return Math.max(420,Math.round(t*i))}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()}syncFullscreenButtons(){let e=!!document.fullscreenElement||this.fsFallback||this.framedFs,t=this.eventDetailsHidden&&!e;this.root?.setAttribute("data-event-details-hidden",String(t)),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 i=this.els.zfs?.querySelector(".sl-zfs-lbl");i&&(i.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))}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}),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){Ge();let t=document.activeElement instanceof HTMLElement?document.activeElement:null,i=document.createElement("div");i.className="sl-modal-scrim";let s=document.createElement("div");s.className="sl-modal-frame",s.setAttribute("role","dialog"),s.setAttribute("aria-modal","true"),s.setAttribute("aria-label",E("picker.seatSelection","Seat selection")),s.tabIndex=-1,i.appendChild(s),document.body.appendChild(i);let r=document.body.style.overflow;document.body.style.overflow="hidden";let o=new n({...e,container:s});o.modalScrim=i,o.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 m=[...s.querySelectorAll('[role="dialog"][aria-modal="true"]')].filter(f=>f.isConnected&&!f.closest('[hidden], [aria-hidden="true"], [inert]'));return m[m.length-1]??s},c=(m,f)=>{let k=m;for(;k;){let C=window.getComputedStyle(k);if(k.hidden||k.getAttribute("aria-hidden")==="true"||k.hasAttribute("inert")||C.display==="none"||C.visibility==="hidden"||C.visibility==="collapse")return!0;if(k===f)return!1;k=k.parentElement}return!0},p=m=>[...m.querySelectorAll(a)].filter(f=>f.tabIndex>=0&&!f.matches(":disabled")&&!c(f,m)),d=(m,f)=>{let k=p(m),C=f?k[k.length-1]:k[0];C?C.focus({preventScroll:!0}):(m.hasAttribute("tabindex")||(m.tabIndex=-1),m.focus({preventScroll:!0}))},h=!1,b=()=>{if(h)return;h=!0,document.body.style.overflow=r,o.escHandler&&document.removeEventListener("keydown",o.escHandler),i.remove(),o.modalScrim=null;let m=o.prevFocus;o.prevFocus=null,m?.isConnected&&m.focus({preventScroll:!0});let f=()=>{o.destroy(),e.onClose?.()};o.hold&&!o.handedOff?o.release().finally(f):f()};return o.closeModal=b,i.addEventListener("mousedown",m=>{m.target===i&&b()}),o.escHandler=m=>{if(m.key==="Tab"){if(m.defaultPrevented)return;let f=l(),k=p(f),C=k[0],w=k[k.length-1],x=document.activeElement;!C||!w?(m.preventDefault(),d(f,m.shiftKey)):x===f||!x||!f.contains(x)?(m.preventDefault(),(m.shiftKey?w:C).focus({preventScroll:!0})):m.shiftKey&&x===C?(m.preventDefault(),w.focus({preventScroll:!0})):!m.shiftKey&&x===w&&(m.preventDefault(),C.focus({preventScroll:!0}));return}m.key==="Escape"&&(o.tableDialog?(m.preventDefault(),o.cancelTableDialog()):o.confirmSeat?(m.preventDefault(),o.cancelConfirm()):o.bestAvailableConfirm?(m.preventDefault(),o.bestAvailableConfirm=!1,o.syncTray()):(m.preventDefault(),b()))},document.addEventListener("keydown",o.escHandler),await o.render(),o.els.close?.classList.add("on"),o.els.close?.addEventListener("click",b),d(l(),!1),o}async render(){if(this.rendered)return this;let e=performance.now(),t={},i=y=>Math.round((performance.now()-y)*100)/100;this.rendered=!0,Ge();let s=performance.now();await(0,g.loadLocale)(this.opts.locale),t.loadLocale=i(s),this.opts.messages&&(0,g.setStringOverrides)(this.opts.messages),this.checkoutMode==="hosted"&&(this.paymentOptions=this.pubApi.paymentOptions(this.opts.event));let r=performance.now(),o=Mt(this.opts.container),a=document.createElement("div");a.className="sl-picker",a.tabIndex=-1,this.root=a,o.appendChild(a),a.addEventListener("keydown",y=>{y.key==="Escape"&&(this.tableDialog?(y.preventDefault(),y.stopPropagation(),this.cancelTableDialog()):this.confirmSeat?(y.preventDefault(),y.stopPropagation(),this.cancelConfirm()):this.bestAvailableConfirm&&(y.preventDefault(),y.stopPropagation(),this.bestAvailableConfirm=!1,this.syncTray()))}),Object.entries(Xe(void 0,this.opts.theme)).forEach(([y,S])=>a.style.setProperty(y,S)),a.innerHTML=`
1210
+ `;function Qe(){if(document.getElementById(kt))return;let n=document.createElement("style");n.id=kt,n.textContent=Bi,document.head.appendChild(n)}var _e=require("@seatlayer/core/core/color");function ee(n){if(!n)return null;let e=n.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 s=t.length<=4?[...t].map(r=>`${r}${r}`).join(""):t;return{r:Number.parseInt(s.slice(0,2),16),g:Number.parseInt(s.slice(2,4),16),b:Number.parseInt(s.slice(4,6),16)}}let i=/^rgba?\(\s*([\d.]+)[,\s]+([\d.]+)[,\s]+([\d.]+)(?:\s*[,/]\s*[\d.]+%?)?\s*\)$/i.exec(e);return i?{r:Math.max(0,Math.min(255,Number(i[1]))),g:Math.max(0,Math.min(255,Number(i[2]))),b:Math.max(0,Math.min(255,Number(i[3])))}:null}function Be(n){return(0,_e.relativeLuminance255)([n.r,n.g,n.b])}function Y(n,e){let t=ee(n),i=ee(e);if(!t||!i)return null;let s=Math.max(Be(t),Be(i)),r=Math.min(Be(t),Be(i));return(s+.05)/(r+.05)}function Se(n,e="#172033",t="#eef1f8"){return(Y(e,n)??0)>=(Y(t,n)??0)?e:t}function _i(n){return(0,_e.rgb255ToHex)(n.r,n.g,n.b)}function Ze(n,e,t){let i=ee(n),s=ee(e);if(!i||!s)return null;let r=Math.max(0,Math.min(1,t));return _i({r:i.r*r+s.r*(1-r),g:i.g*r+s.g*(1-r),b:i.b*r+s.b*(1-r)})}function Fi(n,e,t,i){if((Y(n,t)??4.5)>=4.5&&(Y(n,i)??4.5)>=4.5)return n;if(!ee(n)||!ee(e))return e;for(let s=.15;s<=1;s+=.05){let r=Ze(n,e,1-s);if(r&&(Y(r,t)??0)>=4.5&&(Y(r,i)??0)>=4.5)return r}return e}function Fe(n,e){let t=e?.background??n?.background??"#0f1522",i=ee(t)?Se(t)==="#172033":!1,s=e?.surface??(i?"#ffffff":"#1a2234"),r=e?.accent??n?.accent??"#f4b740",o=n?.accentInk,a=e?.accentInk??(o&&(Y(o,r)??4.5)>=4.5?o:Se(r,"#1a1200","#ffffff")),l=n?.textColor,d=e?.text??(l&&(Y(l,t)??4.5)>=4.5&&(Y(l,s)??4.5)>=4.5?l:Se(t));return{"--sl-accent":r,"--sl-accent-ink":a,"--sl-accent-text":Fi(r,d,t,s),"--sl-bg":t,"--sl-surface":s,"--sl-text":d,"--sl-muted":e?.muted??(i?"#667085":"#a5aec2"),"--sl-line":e?.line??(i?"rgba(23,32,51,.16)":"rgba(165,174,194,.24)"),"--sl-font":e?.fontFamily??n?.fontFamily??"-apple-system,BlinkMacSystemFont,'Segoe UI',Inter,sans-serif","--sl-radius":`${e?.radius??14}px`}}function St(n,e,t){let i=document.createElement("div");i.className="sl-picker",i.tabIndex=-1,n.appendChild(i),Object.entries(Fe(void 0,t)).forEach(([r,o])=>i.style.setProperty(r,o)),i.innerHTML=`
1211
1211
  <div class="sl-head">
1212
1212
  <div class="sl-logo" data-ref="logo"></div>
1213
1213
  <div class="sl-head-info" data-ref="headInfo">
@@ -1219,7 +1219,7 @@
1219
1219
  <svg viewBox="0 0 24 24" aria-hidden="true"><rect x="5" y="11" width="14" height="9" rx="2"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg>
1220
1220
  <span data-ref="closedPillText"></span>
1221
1221
  </span>
1222
- <button type="button" class="sl-close" data-ref="close" aria-label="${this.tf("picker.close","Close")}">
1222
+ <button type="button" class="sl-close" data-ref="close" aria-label="${e("picker.close","Close")}">
1223
1223
  <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>
1224
1224
  </button>
1225
1225
  </div>
@@ -1227,17 +1227,17 @@
1227
1227
  <div class="sl-map">
1228
1228
  <div class="sl-map-host" data-ref="map"></div>
1229
1229
  <div class="sl-zoom" data-ref="zoom">
1230
- <button type="button" aria-label="${this.tf("picker.zoomIn","Zoom in")}" title="${this.tf("picker.zoomIn","Zoom in")}" data-ref="zin">+</button>
1231
- <button type="button" aria-label="${this.tf("picker.zoomOut","Zoom out")}" title="${this.tf("picker.zoomOut","Zoom out")}" data-ref="zout">\u2212</button>
1232
- <button type="button" aria-label="${this.tf("picker.fitToScreen","Fit to screen")}" title="${this.tf("picker.fitToScreen","Fit to screen")}" data-ref="zfit">
1233
- <svg viewBox="0 0 24 24"><path d="M8 3H5a2 2 0 0 0-2 2v3M16 3h3a2 2 0 0 1 2 2v3M8 21H5a2 2 0 0 1-2-2v-3M16 21h3a2 2 0 0 0 2-2v-3"/></svg>
1230
+ <button type="button" aria-label="${e("picker.zoomIn","Zoom in")}" title="${e("picker.zoomIn","Zoom in")}" data-ref="zin">+</button>
1231
+ <button type="button" aria-label="${e("picker.zoomOut","Zoom out")}" title="${e("picker.zoomOut","Zoom out")}" data-ref="zout">\u2212</button>
1232
+ <button type="button" aria-label="${e("picker.fitToScreen","Fit to screen")}" title="${e("picker.fitToScreen","Fit to screen")}" data-ref="zfit">
1233
+ <svg viewBox="0 0 24 24"><path d="M8 3H5a2 2 0 0 0-2 2v3M16 3h3a2 2 0 0 0 2 2v3M8 21H5a2 2 0 0 0-2-2v-3M16 21h3a2 2 0 0 0 2-2v-3"/></svg>
1234
1234
  </button>
1235
- <button type="button" aria-label="${this.tf("picker.fullScreen","Full screen")}" title="${this.tf("picker.fullScreen","Full screen")}" aria-pressed="false" data-ref="zfs">
1235
+ <button type="button" aria-label="${e("picker.fullScreen","Full screen")}" title="${e("picker.fullScreen","Full screen")}" aria-pressed="false" data-ref="zfs">
1236
1236
  <svg viewBox="0 0 24 24"><path d="M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7"/></svg>
1237
- <span class="sl-zfs-lbl" aria-hidden="true">${this.tf("picker.fullScreen","Full screen")}</span>
1237
+ <span class="sl-zfs-lbl" aria-hidden="true">${e("picker.fullScreen","Full screen")}</span>
1238
1238
  </button>
1239
1239
  </div>
1240
- <div class="sl-boot" data-ref="boot"><span class="sl-boot-spin"></span>${this.tf("picker.loadingSeatMap","Loading seat map\u2026")}</div>
1240
+ <div class="sl-boot" data-ref="boot"><span class="sl-boot-spin"></span>${e("picker.loadingSeatMap","Loading seat map\u2026")}</div>
1241
1241
  <div class="sl-toast" data-ref="toast" role="status" aria-live="polite"></div>
1242
1242
  </div>
1243
1243
  <div class="sl-side" data-ref="side">
@@ -1245,28 +1245,37 @@
1245
1245
  <div class="sl-sheet-grab"></div>
1246
1246
  <div class="sl-sheet-bar">
1247
1247
  <div class="sl-sheet-peek" data-ref="peek"></div>
1248
- <button type="button" class="sl-sheet-toggle" data-ref="sheetToggle" aria-label="${this.tf("picker.openTicketPanel","Open ticket panel")}" aria-expanded="false">
1248
+ <button type="button" class="sl-sheet-toggle" data-ref="sheetToggle" aria-label="${e("picker.openTicketPanel","Open ticket panel")}" aria-expanded="false">
1249
1249
  <svg viewBox="0 0 24 24"><path d="M6 15l6-6 6 6"/></svg>
1250
1250
  </button>
1251
1251
  </div>
1252
1252
  </div>
1253
- <div class="sl-sec sl-filtersec" data-ref="filtersSec">${this.tf("picker.filters","Filters")}</div>
1253
+ <div class="sl-sec sl-filtersec" data-ref="filtersSec">${e("picker.filters","Filters")}</div>
1254
1254
  <div class="sl-filters" data-ref="filters"></div>
1255
1255
  <div class="sl-offer" data-ref="offer" role="status" aria-live="polite"></div>
1256
- <div class="sl-sec sl-prices-sec" data-ref="pricesSec"><span>${this.tf("picker.ticketPrices","Ticket prices")}</span></div>
1256
+ <div class="sl-sec sl-prices-sec" data-ref="pricesSec"><span>${e("picker.ticketPrices","Ticket prices")}</span></div>
1257
1257
  <div class="sl-prices-hint" data-ref="pricesHint"></div>
1258
1258
  <div class="sl-prices" data-ref="prices"></div>
1259
- <div class="sl-live" data-ref="live" role="status" aria-live="polite"><span class="dot" aria-hidden="true"></span><span data-ref="liveText">${this.tf("picker.liveAvailability","Live availability \u2014 seats update in real time")}</span></div>
1260
- <div class="sl-sec sl-seats-sec"><span>${this.tf("picker.yourSeats","Your seats")}</span><span class="sl-seat-summary" data-ref="seatSummary"></span></div>
1259
+ <div class="sl-live" data-ref="live" role="status" aria-live="polite">
1260
+ <span class="dot" aria-hidden="true"></span>
1261
+ <span data-ref="liveText">${e("picker.liveAvailability","Live availability \u2014 seats update in real time")}</span>
1262
+ </div>
1263
+ <div class="sl-sec sl-seats-sec">
1264
+ <span>${e("picker.yourSeats","Your seats")}</span>
1265
+ <span class="sl-seat-summary" data-ref="seatSummary"></span>
1266
+ </div>
1261
1267
  <div class="sl-tray" data-ref="tray"></div>
1262
1268
  <div class="sl-foot" data-ref="foot">
1263
1269
  <div class="sl-hold-note" data-ref="holdNote" role="status" aria-live="polite">
1264
1270
  <svg viewBox="0 0 24 24" aria-hidden="true"><path d="M20 6L9 17l-5-5"/></svg>
1265
- <span><b data-ref="holdTitle">${this.tf("picker.seatsSecured","Seats secured")}</b><span class="sl-hold-copy" data-ref="holdCopy">${this.tf("picker.notChargedYet","You won\u2019t be charged yet.")}</span></span>
1266
- <button type="button" class="sl-hold-change" data-ref="holdChange" aria-label="${this.tf("picker.releaseHeldTickets","Release held tickets and choose different seats")}">${this.tf("picker.change","Change")}</button>
1271
+ <span>
1272
+ <b data-ref="holdTitle">${e("picker.seatsSecured","Seats secured")}</b>
1273
+ <span class="sl-hold-copy" data-ref="holdCopy">${e("picker.notChargedYet","You won\u2019t be charged yet.")}</span>
1274
+ </span>
1275
+ <button type="button" class="sl-hold-change" data-ref="holdChange" aria-label="${e("picker.releaseHeldTickets","Release held tickets and choose different seats")}">${e("picker.change","Change")}</button>
1267
1276
  </div>
1268
1277
  <div class="sl-total"><span data-ref="count"></span><b data-ref="total"></b></div>
1269
1278
  <button type="button" class="sl-cta" data-ref="cta" disabled></button>
1270
1279
  </div>
1271
1280
  </div>
1272
- </div>`,a.querySelectorAll("[data-ref]").forEach(y=>{this.els[y.dataset.ref]=y}),this.mapHost=this.els.map,this.syncFullscreenButtons(),this.refreshOfferAvailability(!1),this.api.availability&&(this.offerVisibilityHandler=()=>{!document.hidden&&!this.destroyed&&this.refreshOfferAvailability(!1)},document.addEventListener("visibilitychange",this.offerVisibilityHandler));let l=()=>{let y=a.clientWidth;if(y<=0)return;let S=a.clientHeight,M=y!==this.pickerLayoutSize.width||S!==this.pickerLayoutSize.height;this.pickerLayoutSize={width:y,height:S},this.reportFramedHeight();let _=y<640?"narrow":"wide",I=S<560?"compact":"comfortable";(a.dataset.layout!==_||a.dataset.density!==I)&&(a.dataset.layout=_,a.dataset.density=I,_==="narrow"&&!a.dataset.sheet&&(a.dataset.sheet="peek"),this.dockLayoutChrome()),M&&this.minimap?.refreshMinimap()};this.ro=new ResizeObserver(l),this.ro.observe(a),l(),requestAnimationFrame(l),this.els.zin.addEventListener("click",()=>this.controller.zoomIn()),this.els.zout.addEventListener("click",()=>this.controller.zoomOut()),this.els.zfit.addEventListener("click",()=>this.controller.zoomToFit()),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 c=this.els.sheetHead;if(c){let y=this.els.sheetToggle,S=P=>{a.dataset.sheet=P?"open":"peek",y?.setAttribute("aria-expanded",String(P)),y?.setAttribute("aria-label",P?this.tf("picker.collapseTicketPanel","Collapse ticket panel"):this.tf("picker.openTicketPanel","Open ticket panel"))};S(a.dataset.sheet==="open"),y?.addEventListener("click",P=>{P.stopPropagation(),S(a.dataset.sheet!=="open")}),this.els.peek?.addEventListener("click",P=>{let A=P.target.closest(".sl-sheet-go");A&&(P.stopPropagation(),A.dataset.act==="checkout"?this.handleCta():S(!0))});let M=0,_=!1,I=!1;c.addEventListener("pointerdown",P=>{if(P.target.closest?.(".sl-seccard,.sl-sheet-toggle,.sl-sheet-go")){I=!1;return}I=!0,_=!1,M=P.clientY,c.setPointerCapture?.(P.pointerId)}),c.addEventListener("pointermove",P=>{if(!I||_)return;let A=P.clientY-M;A<-18?(S(!0),_=!0):A>18&&(S(!1),_=!0)}),c.addEventListener("pointerup",P=>{I&&!_&&Math.abs(P.clientY-M)<6&&S(a.dataset.sheet!=="open"),I=!1,c.releasePointerCapture?.(P.pointerId)})}let p=()=>{if(this.root?.dataset.layout!=="narrow")return;let y=this.root.getAttribute("data-prices-open")==="true";if(this.root.setAttribute("data-prices-open",String(!y)),this.els.pricesSec?.setAttribute("aria-expanded",String(!y)),this.pricesBtnEl?.setAttribute("aria-pressed",String(!y)),!y&&this.root.dataset.sheet!=="open"){this.root.dataset.sheet="open";let S=this.els.sheetToggle;S?.setAttribute("aria-expanded","true"),S?.setAttribute("aria-label","Collapse ticket panel")}};this.els.pricesSec?.addEventListener("click",y=>{y.target.closest("select,button")||p()}),this.els.pricesSec?.addEventListener("keydown",y=>{y.key!=="Enter"&&y.key!==" "||y.target.closest("select,button")||(y.preventDefault(),p())});let d=document.createElement("button");d.type="button",d.className="sl-prices-btn",d.setAttribute("aria-label",this.tf("picker.ticketPrices","Ticket prices")),d.setAttribute("title",this.tf("picker.ticketPrices","Ticket prices")),d.setAttribute("aria-pressed","false"),d.innerHTML='<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M20.6 13.4 13.4 20.6a2 2 0 0 1-2.8 0L3 13V5a2 2 0 0 1 2-2h8l7.6 7.6a2 2 0 0 1 0 2.8z"/><circle cx="7.5" cy="7.5" r="1.3"/></svg>',d.addEventListener("click",()=>p()),this.els.headInfo?.parentElement?.insertBefore(d,this.els.hold??null),this.pricesBtnEl=d,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("mousemove",y=>{let S=this.els.map.getBoundingClientRect();this.tipPos={x:y.clientX-S.left,y:y.clientY-S.top},this.tipEl&&this.tipEl.style.display!=="none"&&this.placeTooltip()}),this.els.cta.addEventListener("click",()=>{this.handleCta()}),this.els.holdChange?.addEventListener("click",()=>{this.handleChangeSeats()});let h=document.createElement("div");h.style.cssText="position:absolute;inset:0",this.mapHost.appendChild(h),t.mountBuyerShell=i(r);let b=performance.now(),m=await this.controller.render(h);if(t.loadChartAndStatuses=i(b),this.destroyed)return this;if(!m)return this.els.boot.innerHTML=`<div class="sl-boot-title">${this.tf("picker.mapDidNotLoad","The seat map didn\u2019t load")}</div><div>${this.tf("picker.checkConnection","Check your connection and try again.")}</div><button type="button" class="sl-boot-retry">${this.tf("picker.accessRetry","Try again")}</button>`,this.els.boot.querySelector("button").addEventListener("click",()=>{let y=this.opts.container,S=this.opts;this.destroy(),new n({...S,container:y}).render()}),this;Object.assign(t,m.performanceProfile),this.els.boot.remove();let f=performance.now();if(this.startRealtime(),this.salesClosed=!!m.salesClosed||!!this.opts.readOnly,a.dataset.eventMode=m.mode==="test"?"test":"live",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),m.mode==="test"){let y=document.createElement("div");y.className="sl-testbadge",y.textContent=(0,g.t)("picker.testMode"),y.setAttribute("aria-label",(0,g.t)("picker.testMode")),this.regions["top-left"].appendChild(y)}let k=this.controller.doc?.theme;Object.entries(Xe(k,this.opts.theme)).forEach(([y,S])=>a.style.setProperty(y,S)),this.currency=m.currency??this.opts.currency??"USD",this.eventTimezone=m.timezone??null;let C=this.opts.theme?.logoUrl??k?.logoUrl??m.posterUrl??null;C?this.els.logo.innerHTML=`<img src="${C}" alt="">`:this.els.logo.textContent=(this.opts.theme?.brandName??k?.brandName??m.eventName??"?").slice(0,1).toUpperCase(),this.els.name.textContent=m.eventName??"";let w=m.startsAt?Be(m.startsAt,m.timezone??null,this.opts.locale):"";this.eventWhenText=w||null,this.els.meta.textContent=[m.venue,w].filter(Boolean).join(" \xB7 "),this.els.pricesHint&&(this.els.pricesHint.textContent=this.tf("picker.priceHint","Colours on the map are ticket types \u2014 tap one below to show just those seats.")),this.buildBadge(k);let x=new Set,T=!1;if(this.controller.doc)for(let y of(0,g.expandChart)(this.controller.doc)){for(let S of y.accessibility??[])x.add(S);y.accessible&&!y.accessibility?.length&&x.add("wheelchair"),(y.commercial?.restrictedView||y.commercial?.obstructedView)&&(T=!0)}let u=()=>{this.rungsEl&&this.controller.getRung()!=="seats"&&(this.controller.setRung("seats"),this.collapseSectionCard(),this.syncRung())};if(x.size||T){let y=document.createElement("div");if(y.className="sl-chips",this.regions["top-left"].appendChild(y),this.a11yChipsEl=y,x.size){let S=(I,P)=>`<button type="button" class="sl-chip-f${I==="all"?" on":""}" data-a11y="1" data-f="${I}">${P}</button>`;y.insertAdjacentHTML("beforeend",S("all",this.tf("picker.allSeats","All seats"))+g.ACCESSIBILITY_TYPES.filter(({key:I})=>x.has(I)).map(({key:I,short:P,icon:A})=>S(I,`${A} ${P}`)).join(""));let M=new Set,_=()=>{y.querySelectorAll("button[data-a11y]").forEach(P=>{let A=P.dataset.f,F=A==="all"?M.size===0:M.has(A);P.classList.toggle("on",F),P.setAttribute("aria-pressed",String(F))});let I=M.size?[...M]:null;this.controller.setAccessibilityFilter(I),I&&u()};y.querySelectorAll("button[data-a11y]").forEach(I=>{I.addEventListener("click",()=>{let P=I.dataset.f;P==="all"?M.clear():M.has(P)?M.delete(P):M.add(P),_()})})}if(T){let S=document.createElement("button");S.type="button",S.className="sl-chip-f",S.setAttribute("aria-pressed","false"),S.innerHTML=`\u25D0 ${this.tf("picker.hideLimitedView","Hide limited-view seats")}`,y.appendChild(S),S.addEventListener("click",()=>{let M=!this.limitedViewFilter;this.limitedViewFilter=M,S.classList.toggle("on",M),S.setAttribute("aria-pressed",String(M)),this.controller.setCommercialLimitedFilter(M),this.pushAvailabilityTo3d(),M&&u()})}}let v=document.createElement("button");v.type="button",v.className="sl-cbbtn",this.cbEl=v,v.setAttribute("aria-label",this.tf("picker.toggleColorblindColors","Toggle colorblind-friendly colors")),v.setAttribute("aria-pressed",String(this.cbSafe)),v.innerHTML='<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>',this.els.zfit.parentElement.appendChild(v),v.addEventListener("click",()=>{this.setColorblindSafe(!this.cbSafe)}),this.srEl=document.createElement("div"),this.srEl.className="sl-sr",this.srEl.setAttribute("aria-live","polite"),a.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=i(f);let L=performance.now();if(await this.restoreRememberedHold(),t.restoreHold=i(L),this.destroyed)return this;this.salesClosed&&this.applySalesClosed(),this.syncPrices(),this.syncTray(),this.resumeHostedOrder();let $=this.controller.doc;return this.emitAnalytics("chart_rendered",{renderingTimeMillis:i(e),performanceProfile:t,seatCount:this.allSeats().length,objectCount:$?.objects.length??0,sectionCount:$?.objects.filter(y=>y.type==="section").length??0,view:this.buyerView,eventKey:this.opts.event,chartName:$?.name,floorCount:this.controller.getFloors().length,transport:this.opts.transport?"custom":"pubapi",load:Wi(this.opts.event)?"repeat":"cold"}),this}resumeHostedOrder(){if(this.checkoutMode!=="hosted"||typeof location>"u")return;let e=new URLSearchParams(location.search),t=e.get("order");if(!t)return;let i=e.get("status");e.delete("order"),e.delete("status");try{let s=e.toString();history.replaceState(history.state,"",`${location.pathname}${s?`?${s}`:""}${location.hash}`)}catch{}i==="success"&&this.openCheckoutPanel({kind:"resume",orderId:t})}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()}dockLayoutChrome(){let e=this.root?.dataset.layout==="narrow";this.applyPanelCollapsed();let t=this.els.zfs,i=this.els.headInfo?.parentElement;t&&i&&t.parentElement!==i&&(t.classList.add("sl-fs-pill"),i.insertBefore(t,this.els.hold??null));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));let r=this.els.filters;if(r){this.cbEl&&this.els.zoom?.appendChild(this.cbEl),e?this.a11yChipsEl&&r.appendChild(this.a11yChipsEl):this.a11yChipsEl&&this.regions["top-left"]?.appendChild(this.a11yChipsEl);let o=e&&r.children.length>0;r.classList.toggle("has",o),this.els.filtersSec?.classList.toggle("has",o)}this.lastSection&&this.renderSectionCard(this.lastSection)}buildExtendPrompt(){let e=document.createElement("div");e.className="sl-extend",e.setAttribute("role","status"),e.innerHTML='<span class="sl-extend-txt" data-ref="extendTxt"></span><button type="button" class="sl-extend-btn" data-ref="extendBtn"></button>',(this.regions["bottom-center"]??this.els.map).appendChild(e),this.extendEl=e,this.els.extendTxt=e.querySelector('[data-ref="extendTxt"]'),this.els.extendBtn=e.querySelector('[data-ref="extendBtn"]'),this.els.extendBtn.textContent=this.tf("picker.addTime","Add time"),this.els.extendBtn.addEventListener("click",()=>{this.handleExtend()})}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>`,this.root.appendChild(e),this.bookedEl=e,this.els.bookedSub=e.querySelector('[data-ref="bookedSub"]')}tf(e,t){return E(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();e.innerHTML=`<div class="sl-soldout-eyebrow">${t}</div><div class="sl-soldout-title">${this.tf("picker.soldOutTitle","Sold out")}</div><p class="sl-soldout-copy">${this.tf("picker.soldOutCopy","No reserved seats are currently available for this event.")}</p>`,this.els.map.appendChild(e),this.soldoutEl=e}syncSoldout(e,t){let i=this.controller.getGAAreas().length>0,s=this.isSoldOut(e,t,i);s!==this.soldOut&&(this.soldOut=s,this.soldoutEl?.classList.toggle("on",s))}isSoldOut(e,t,i){return!i&&e.length>0&&e.every(s=>(t[s.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!!(this.opts.hideBadge||e?.hideBadge)}buildBadge(e){if(this.badgeHidden(e))return;let t=this.els.foot;if(!t)return;let i=document.createElement("a");i.className="sl-powered",i.href="https://seatlayer.io/?ref=picker",i.target="_blank",i.rel="noopener noreferrer",i.setAttribute("aria-label",this.tf("picker.poweredBy","Powered by SeatLayer")),i.innerHTML='<span class="sl-powered-mark" aria-hidden="true">'+Me+`</span><span>${this.tf("picker.poweredBy","Powered by SeatLayer")}</span>`,t.appendChild(i)}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 i=document.createElement("div");i.className="sl-anchor",i.dataset.region=t,this.els.map.appendChild(i),this.regions[t]=i}}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 i=setTimeout(()=>{this.motionTimers.delete(i),this.destroyed||e()},t);this.motionTimers.add(i)}animateOnce(e,t,i=600){!e||this.reducedMotion()||(e.classList.remove(t),e.offsetWidth,e.classList.add(t),this.scheduleMotion(()=>e.classList.remove(t),i))}flashPickedSeat(e){this.reducedMotion()||this.controller.flashSeat(e,this.cssVar("--sl-accent")||"#f4b740")}flashHeldSeats(e){if(this.reducedMotion())return;(e.items??[]).filter(i=>i.objectType!=="ga").map(i=>i.label).slice(0,10).forEach((i,s)=>{let r=this.controller.seatByLabel(i);r&&this.scheduleMotion(()=>this.controller.flashSeat(r.id,this.cssVar("--sl-accent")||"#f4b740"),s*55)})}committedSelection(){let e=this.confirmSeat?.id,t=this.tableDialog&&!this.tableDialogHeld?this.tableDialog.id:null;return this.controller.getSelection().filter(i=>i.id!==e&&i.id!==t)}pendingSelectionCount(){let e=this.hold?.items??[],t=new Set(e.map(s=>s.label));return this.committedSelection().filter(s=>!t.has(s.label)).reduce((s,r)=>s+(r.quantity??1),0)+this.pendingGACount()}heldGACounts(){let e=new Map;for(let t of(this.hold?.items??[]).filter(i=>i.objectType==="ga"))e.set(t.objectId,(e.get(t.objectId)??0)+(t.quantity??1));return e}pendingGACount(){let e=this.heldGACounts();return[...this.gaQty.entries()].reduce((t,[i,s])=>t+Math.max(0,s-(e.get(i)??0)),0)}heldTicketCount(){return(this.hold?.items??[]).reduce((e,t)=>e+(t.quantity??1),0)}totalTicketCount(){let e=new Set((this.hold?.items??[]).map(i=>i.label)),t=this.committedSelection().filter(i=>!e.has(i.label)).reduce((i,s)=>i+(s.quantity??1),0);return this.heldTicketCount()+t+this.pendingGACount()}updateSelectionCapacity(){let e=new Set((this.hold?.items??[]).map(s=>s.label)),t=this.committedSelection().filter(s=>e.has(s.label)).reduce((s,r)=>s+(r.quantity??1),0),i=Math.max(0,this.maxTickets-this.heldTicketCount()-this.pendingGACount());this.controller.setMaxSelection(t+i)}canAddTicket(){return this.totalTicketCount()<this.maxTickets?!0:(this.toast((0,g.t)("picker.maxTicketsForOrder",{count:this.maxTickets}),"warning"),!1)}pendingGATotal(e){let t=new Map;for(let i of(this.hold?.items??[]).filter(s=>s.objectType==="ga"))t.set(i.objectId,(t.get(i.objectId)??0)+(i.quantity??1));return e.reduce((i,s)=>i+this.paidPrice(s.categoryKey,null,s.price)*Math.max(0,(this.gaQty.get(s.id)??0)-(t.get(s.id)??0)),0)}syncCta(e=this.lastTrayCount,t=this.pendingSelectionCount()){let i=this.els.cta;if(i){if(this.salesClosed){i.disabled=!0,i.textContent=this.tf("picker.salesClosedCta","Sales closed");return}if(this.confirmSeat||this.tableDialog&&!this.tableDialogHeld){i.disabled=!0,i.textContent=this.tableDialog?this.tf("picker.confirmYourTable","Confirm your table"):this.tf("picker.confirmOrCancelSeat","Confirm or cancel this seat");return}if(this.ctaPhase==="holding"){i.disabled=!0,i.innerHTML=`<span class="sl-cta-spin" aria-hidden="true"></span>${this.tf("picker.securingSeats","Securing your seats\u2026")}`;return}if(this.ctaPhase==="checkout"){i.disabled=!0,i.innerHTML=`<span class="sl-cta-spin" aria-hidden="true"></span>${this.tf("picker.openingCheckout","Opening secure checkout\u2026")}`;return}i.disabled=e===0,i.textContent=this.hold?t?(0,g.t)("picker.secureMoreAndCheckout",{count:t}):this.tf("picker.continueToCheckout","Continue to checkout"):e?this.tf("picker.holdSeatsAndCheckout","Hold seats & checkout"):this.tf("picker.selectSeats","Select seats")}}setCtaPhase(e){this.ctaPhase=e,this.syncCta(),this.renderPeek(this.lastTrayCount,this.lastTrayTotal,this.pendingSelectionCount()),e==="checkout"&&this.scheduleMotion(()=>{this.ctaPhase==="checkout"&&(this.ctaPhase="idle",this.syncCta(),this.renderPeek(this.lastTrayCount,this.lastTrayTotal,this.pendingSelectionCount()))},1100)}holdStorageKey(){return`@seatlayer/hold/v1/${encodeURIComponent(this.apiBase)}/${encodeURIComponent(this.opts.event)}`}rememberedHoldId(){if(this.opts.initialHoldId)return this.opts.initialHoldId;if(this.opts.restoreHold===!1||typeof window>"u")return null;try{return window.sessionStorage.getItem(this.holdStorageKey())}catch{return null}}rememberHold(e){if(!(this.opts.restoreHold===!1||typeof window>"u"))try{window.sessionStorage.setItem(this.holdStorageKey(),e.holdId)}catch{}}forgetHold(){if(!(typeof window>"u"))try{window.sessionStorage.removeItem(this.holdStorageKey())}catch{}}async resumeHoldFromServer(e,t){try{let i=await this.controller.resumeHold(e);if(!i)return null;let s={holdId:i.holdId,expiresAt:i.expiresAt,seats:i.seats,items:i.items};return this.hold=s,this.handedOff=!0,this.bookedShown=!1,this.ctaPhase="idle",this.startHoldTimer(s.expiresAt),this.rememberHold(s),this.syncTray(),this.emitHoldChange(),this.opts.onHoldRestored?.(s,s.seats??[],this.buildHandoff(s)),t&&this.toast(this.tf("picker.heldTicketsRestored","Your held tickets have been restored."),"success"),s}catch(i){let s=i?.status;return s===404||s===409?this.forgetHold():this.opts.onError?.(i),null}}async restoreRememberedHold(){let e=this.rememberedHoldId();e&&await this.resumeHoldFromServer(e,!0)}activeFloorObjects(){let e=this.controller.doc;if(!e)return[];let t=e.floors;if(t?.length){let i=this.controller.getActiveFloorId();return(t.find(s=>s.id===i)??t[0]).objects??[]}return e.objects??[]}buildMinimap(){this.els.map&&(this.minimap=jt({controller:this.controller,root:()=>this.root,cssVar:e=>this.cssVar(e),focusedSectionLabel:()=>this.lastSection?.label},this.regions["bottom-left"]??this.els.map))}catPrice(e){let t=e.tiers?.length?e.tiers[0].price:e.price;return t===void 0||!e.key?t:this.paidPrice(e.key,e.tiers?.[0]?.id??null,t)}catPriceRange(e){let t=e.tiers?.length?e.tiers.map(i=>this.paidPrice(e.key,i.id??null,i.price)):e.price==null?[]:[this.paidPrice(e.key,null,e.price)];return t.length?{min:Math.min(...t),max:Math.max(...t)}:void 0}priceBands(){let e=this.controller.doc;if(!e)return[];let t=e.categories.map(a=>({key:a.key,range:this.catPriceRange(a)})).filter(a=>a.range!=null);if(!t.length)return[];let i=[...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(i.length<=5)return i.map(a=>({id:`p${a.min}-${a.max}`,label:a.min===a.max?this.money(a.min):`${this.money(a.min)}\u2013${this.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 s=[...t].sort((a,l)=>a.range.min-l.range.min||a.range.max-l.range.max),r=Math.ceil(s.length/4),o=[];for(let a=0;a<s.length;a+=r){let l=s.slice(a,a+r),c=Math.min(...l.map(d=>d.range.min)),p=Math.max(...l.map(d=>d.range.max));o.push({id:`b${a}`,label:c===p?this.money(c):`${this.money(c)}\u2013${this.money(p)}`,keys:l.map(d=>d.key),min:c,max:p})}return o}buildPriceFilter(){if(!this.els.prices||!this.els.pricesSec)return;let e=this.priceBands();if(e.length<2)return;let t=document.createElement("select");t.className="sl-price-select",t.setAttribute("aria-label",this.tf("picker.filterAndFocusByPrice","Filter and focus seats by price")),t.innerHTML=`<option value="all">${this.tf("picker.allPrices","All prices")}</option>`+e.map(i=>`<option value="${i.id}">${i.label}</option>`).join(""),this.els.pricesSec.appendChild(t),t.addEventListener("change",()=>{let s=e.find(r=>r.id===t.value)?.keys??null;this.focusedCatKey=null,this.priceBandKeys=s?new Set(s):null,this.controller.setCategoryFilter(s),this.controller.focusCategoryFilter(s),this.pushAvailabilityTo3d(),this.syncFloors(),this.syncRung(),this.minimap?.refreshMinimap(),this.syncPrices(),this.lastSection&&this.showSectionCard(this.lastSection)})}buildArenaChrome(){let e=this.controller.doc;if(!e||!this.els.map)return;let t=e.objects.some(i=>i.type==="section")||(e.floors??[]).some(i=>i.objects.some(s=>s.type==="section"));if(this.canOffer3d()){let i=document.createElement("div");i.className="sl-projection",i.setAttribute("role","group"),i.setAttribute("aria-label",this.tf("picker.venueView","Venue view")),i.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>`,i.querySelectorAll("button").forEach(s=>{s.addEventListener("click",()=>{this.setBuyerView(s.dataset.view)})}),this.regions["top-right"].appendChild(i),this.projectionEl=i,this.syncProjection()}if(t){let i=[...e.objects,...(e.floors??[]).flatMap(p=>p.objects)],s=new Set((e.zones??[]).map(p=>p.id)),o=i.some(p=>p.type==="section"&&typeof p.zone=="string"&&s.has(p.zone))?["zones","sections","seats"]:["sections","seats"],a=document.createElement("div");a.className="sl-rungs on",a.setAttribute("role","group"),a.setAttribute("aria-label",(0,g.t)("picker.zoomLevel"));let l={zones:(0,g.t)("picker.rungLabel.zones"),sections:(0,g.t)("picker.rungLabel.sections"),seats:(0,g.t)("picker.rungLabel.seats")},c={zones:(0,g.t)("picker.rungTip.zones"),sections:(0,g.t)("picker.rungTip.sections"),seats:(0,g.t)("picker.rungTip.seats")};a.innerHTML=o.map(p=>`<button type="button" data-rung="${p}" title="${c[p]}" aria-pressed="false">${l[p]}</button>`).join(""),a.querySelectorAll("button").forEach(p=>{p.addEventListener("click",()=>{let d=p.dataset.rung;this.controller.setRung(d),d==="seats"&&this.collapseSectionCard()})}),this.regions["top-center"].appendChild(a),this.rungsEl=a,this.syncRung()}if(this.controller.isMultiFloor()){let i=this.controller.getFloors(),s=document.createElement("div");s.className="sl-floors on";let r=document.createElement("select");r.setAttribute("aria-label",this.tf("picker.chooseLevel","Choose level"));let o=document.createElement("option");o.value="",o.textContent=this.tf("picker.allFloors","All floors"),r.appendChild(o);for(let c of i){let p=document.createElement("option");p.value=c.id,p.textContent=c.name,r.appendChild(p)}r.addEventListener("change",()=>{r.value===""?this.controller.setFloorOverview(!0):this.controller.setFloor(r.value),this.showSectionCard(null),this.syncFloors(),this.syncRung(),this.minimap?.refreshMinimap()}),s.appendChild(r);let a=document.createElement("button");a.type="button",a.className="sl-floor-info",a.textContent="i";let l=this.tf("picker.floorHelp","All floors shows the complete venue. Choose one level to inspect and select its seats.");a.setAttribute("aria-label",l),a.title=l,s.appendChild(a),this.regions["left-rail"].appendChild(s),this.floorsEl=s,this.syncFloors()}}syncRung(){if(!this.rungsEl)return;let e=this.controller.getRung();this.rungsEl.querySelectorAll("button").forEach(t=>{let i=t.dataset.rung===e;t.classList.toggle("on",i),t.setAttribute("aria-pressed",String(i))})}syncProjection(){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||!Pt()?!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)?Gt/2:Gt}syncFloors(){if(!this.floorsEl)return;let e=this.controller.getActiveFloorId(),t=this.controller.isFloorOverview(),i=this.floorsEl.querySelector("select");i&&(i.value=t?"":e)}showSectionCard(e){if(this.lastSection=e,this.secCardEl?.remove(),this.secCardEl=null,!e){this.minimap?.refreshMinimap();return}this.secCardCollapsed=this.controller.getRung()==="seats",this.secCardShownAt=Date.now(),this.renderSectionCard(e),this.minimap?.refreshMinimap()}sectionNeighbours(e){let t=this.activeFloorObjects().filter(s=>s.type==="section"&&!this.controller.isSectionClosed(s.id)&&this.controller.getSectionSeatCount(s.id)>0);if(t.length<2)return null;let i=t.findIndex(s=>s.id===e);return i<0?null:{previous:t[(i-1+t.length)%t.length],next:t[(i+1)%t.length]}}wireSectionNavigation(e){e.querySelectorAll("[data-section-nav]").forEach(t=>{t.addEventListener("click",i=>{i.preventDefault(),i.stopPropagation();let s=t.dataset.sectionNav;s&&this.controller.focusSection(s)})})}renderSectionCard(e){if(!this.els.map)return;if(this.secCardEl?.remove(),this.root?.dataset.layout==="narrow"&&(this.hold||this.committedSelection().length||this.pendingGACount())){this.lastSection=null;return}let t=e.categories.length?e.categories.map(d=>{let h=this.controller.doc?.categories.find(b=>b.key===d.key);return h?this.catPriceRange(h):{min:d.priceMin,max:d.priceMax}}).filter(d=>d!=null):[{min:e.priceMin,max:e.priceMax}],i=Math.min(...t.map(d=>d.min)),s=Math.max(...t.map(d=>d.max)),r=i===s?this.money(i):`${this.money(i)}\u2013${this.money(s)}`,o=(0,g.tCount)("picker.seatsLeftInSection",e.seatsLeft),a=`<button type="button" class="sl-seccard-x" aria-label="${(0,g.t)("picker.closeSectionSummary")}">\u2715</button>`,l=_t(this.sectionNeighbours(e.id)),c=document.createElement("div");if(this.root?.dataset.layout==="narrow")c.className="sl-seccard strip on",c.setAttribute("role","status"),c.setAttribute("aria-label",(0,g.t)("picker.sectionSummaryAria",{label:e.label})),c.innerHTML=`<span class="sl-seccard-dot" style="background:${e.color}"></span><span class="sl-seccard-name">${e.label}</span><span class="sl-seccard-left">${o}</span>`+(e.categories.length?`<span class="sl-seccard-price">${r}</span>`:"")+l+a,this.wireSectionNavigation(c),c.querySelector(".sl-seccard-x").addEventListener("click",()=>this.controller.overview()),(this.els.sheetHead??this.els.side??this.els.map).appendChild(c);else if(this.secCardCollapsed)c.className="sl-seccard mini on",c.setAttribute("role","button"),c.setAttribute("aria-label",(0,g.t)("picker.sectionSummaryAria",{label:e.label})),c.innerHTML=`<span class="sl-seccard-dot" style="background:${e.color}"></span><span class="sl-seccard-name">${e.label}</span><span class="sl-seccard-left">${o}</span>`+l+a,this.wireSectionNavigation(c),c.addEventListener("click",d=>{d.target.closest(".sl-seccard-x")||(this.secCardCollapsed=!1,this.secCardShownAt=Date.now(),this.renderSectionCard(e))}),c.querySelector(".sl-seccard-x").addEventListener("click",()=>this.controller.overview()),(this.regions["top-center"]??this.els.map).appendChild(c);else{c.className="sl-seccard on",c.setAttribute("role","dialog"),c.setAttribute("aria-label",(0,g.t)("picker.sectionSummaryAria",{label:e.label}));let d=e.categories.map(h=>{let b=this.priceBandKeys!=null&&!this.priceBandKeys.has(h.key),m=this.controller.doc?.categories.find(C=>C.key===h.key),f=m?this.catPriceRange(m):{min:h.priceMin,max:h.priceMax},k=f&&f.min!==f.max?`${this.money(f.min)}\u2013${this.money(f.max)}`:this.money(f?.min??h.price);return`<span class="sl-seccard-mix-item${b?" sl-dim":""}"><span class="sl-seccard-mix-dot" style="background:${h.color}"></span>${h.label} <span class="sl-seccard-mix-price">${k}</span></span>`}).join("");c.innerHTML=`<div class="sl-seccard-head"><span class="sl-seccard-dot" style="background:${e.color}"></span><span class="sl-seccard-name">${e.label}</span>`+(e.categories.length?`<span class="sl-seccard-price">${r}</span>`:"")+a+`</div><div class="sl-seccard-zone">${e.zoneLabel?`${e.zoneLabel} \xB7 `:""}<span class="sl-seccard-left">${o}</span></div>`+(e.entrance?`<div class="sl-seccard-entrance">${(0,g.t)("picker.entrance")} ${String(e.entrance).replace(/[&<>"]/g,h=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[h])}</div>`:"")+(d?`<div class="sl-seccard-mix">${d}</div>`:"")+`<div class="sl-seccard-foot"><button type="button" class="sl-seccard-overview">\u2190 ${(0,g.t)("picker.overview")}</button>`+l+`<span class="sl-seccard-hint">${(0,g.t)("picker.tapSeatHint")}</span></div>`,this.wireSectionNavigation(c),c.querySelector(".sl-seccard-x").addEventListener("click",()=>this.controller.overview()),c.querySelector(".sl-seccard-overview").addEventListener("click",()=>this.controller.overview()),(this.regions["top-center"]??this.els.map).appendChild(c)}this.secCardEl=c}collapseSectionCard(){!this.secCardEl||this.secCardCollapsed||!this.lastSection||this.root?.dataset.layout!=="narrow"&&(this.secCardCollapsed=!0,this.renderSectionCard(this.lastSection))}sectionCardOnView(){if(!(!this.secCardEl||this.secCardCollapsed||!this.lastSection)&&this.root?.dataset.layout!=="narrow"){if(this.controller.getRung()==="seats"){this.collapseSectionCard();return}if(Date.now()-this.secCardShownAt<1400){this.sectionCardCoverage()>.25&&this.collapseSectionCard();return}this.collapseSectionCard()}}sectionCardCoverage(){let e=this.secCardEl,t=this.lastSection;if(!e||!t||!this.els.map)return 0;let i=this.activeFloorObjects().find(C=>C.type==="section"&&C.id===t.id)?.outline;if(!i||i.length<3)return 0;let s=i.map(C=>this.controller.worldToScreen(C)),r=s.map(C=>C.x),o=s.map(C=>C.y),a=Math.min(...r),l=Math.min(...o),c=Math.max(...r)-a,p=Math.max(...o)-l;if(c<=0||p<=0)return 0;let d=this.els.map.getBoundingClientRect(),h=e.getBoundingClientRect(),b=h.left-d.left,m=h.top-d.top,f=Math.max(0,Math.min(b+h.width,a+c)-Math.max(b,a)),k=Math.max(0,Math.min(m+h.height,l+p)-Math.max(m,l));return f*k/(c*p)}announceSeat(e){if(!this.srEl)return;if(!e){this.srEl.textContent="";return}let t=this.controller.doc?.categories.find(h=>h.key===e.categoryKey),i=this.controller.getStatus(e.id)??"free",s=i==="free"?this.tf("picker.statusAvailable","available"):i==="held"?this.tf("picker.statusOnHold","on hold"):this.tf("picker.statusTaken2","taken"),r=t?this.catPriceRange(t):void 0,o=r?r.min===r.max?this.money(r.min):`${this.money(r.min)}\u2013${this.money(r.max)}`:void 0,a=this.controller.tableSelection(e.id),l=a??this.controller.seatDetails(e.id),c=this.rowTypeWord(l),p=l?.rowLabel??l?.displayLabel??e.displayLabel??e.label,d=a?`${c} ${p}, ${a.bookingMode==="variable"?(0,g.t)("picker.minToMaxGuests",{min:a.minOccupancy,max:a.maxOccupancy}):(0,g.t)("picker.capacityGuests",{count:a.capacity})}`:l?.objectType==="booth"?`${c} ${p}`:l?.objectType==="table"?`${c} ${p}, ${(0,g.t)("picker.seatNumberLower",{label:l.seatNumber??e.label})}`:(0,g.t)("picker.seatLabel",{label:l?.displayLabel??e.displayLabel??e.label});this.srEl.textContent=`${d}, ${t?.label??e.categoryKey}${o?`, ${o}`:""}, ${s}`}showTableDialog(e,t,i){this.dismissTableDialog(!1),this.tableDialog={...e},this.tableDialogHeld=t,this.tableDialogReturnFocus=i??document.activeElement;let s=c=>String(c??"").replace(/[&<>"']/g,p=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[p]),r=this.controller.doc?.categories.find(c=>c.key===e.categoryKey),o=e.bookingMode==="variable",a=this.rowTypeWord(e),l=document.createElement("div");l.className="sl-table-scrim",l.innerHTML=`<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">${s(o?(0,g.t)("picker.flexiblePartyTypeWord",{typeWord:a}):(0,g.t)("picker.wholeTypeWord",{typeWord:a}))}</div><h2 class="sl-table-title" id="sl-table-title">${s(e.displayLabel??e.label)}</h2><p class="sl-table-copy" id="sl-table-copy">${o?this.tf("picker.chooseGuestsCopy","Choose how many guests will sit together. This table is held exclusively for your party."):(0,g.t)("picker.allPlacesBookedTogether",{count:e.capacity})}</p></div><div class="sl-table-body"><div class="sl-table-summary"><span>${s(r?.label??e.categoryKey)}</span><b data-table-unit>${(0,g.t)("picker.perGuestPrice",{price:this.money(this.paidPrice(e.categoryKey,e.tierId??null,e.price))})}</b><span class="muted">${this.tf("picker.tableCapacity","Table capacity")}</span><span>${(0,g.t)("picker.guestsCount",{count:e.capacity})}</span><span class="muted">${this.tf("picker.total","Total")}</span><b data-table-total></b></div>`+(o?`<label class="sl-table-qtylabel" id="sl-table-qty-label">${this.tf("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="${this.tf("picker.fewerGuests","Fewer guests")}">\u2212</button><output aria-live="polite" data-table-qty>${e.quantity}</output><button type="button" data-table-step="1" aria-label="${this.tf("picker.moreGuests","More guests")}">+</button></div><div class="sl-table-range">${(0,g.t)("picker.chooseMinMaxGuests",{min:e.minOccupancy,max:e.maxOccupancy})}</div>`:`<input type="hidden" data-table-qty value="${e.capacity}">`)+`<div class="sl-table-actions"><button type="button" class="sl-table-cancel">${(0,g.t)("common.cancel")}</button><button type="button" class="sl-table-confirm">${t?this.tf("picker.updateTable","Update table"):o?this.tf("picker.selectTable","Select table"):this.tf("picker.selectWholeTable","Select whole table")}</button></div></div></section>`,this.root.appendChild(l),this.tableDialogEl=l,this.renderTableDialogState(),l.querySelectorAll("[data-table-step]").forEach(c=>{c.addEventListener("click",()=>{if(!this.tableDialog)return;let p=Math.max(this.tableDialog.minOccupancy,Math.min(this.tableDialog.maxOccupancy,this.tableDialog.quantity+Number(c.dataset.tableStep)));this.tableDialog={...this.tableDialog,quantity:p},this.renderTableDialogState()})}),l.querySelector(".sl-table-cancel").addEventListener("click",()=>this.cancelTableDialog()),l.querySelector(".sl-table-confirm").addEventListener("click",()=>{this.confirmTableDialog()}),l.addEventListener("mousedown",c=>{c.target===l&&this.cancelTableDialog()}),l.addEventListener("keydown",c=>{if(c.key!=="Tab")return;let p=[...l.querySelectorAll('button:not(:disabled),[tabindex]:not([tabindex="-1"])')];if(!p.length)return;let d=p[0],h=p[p.length-1];c.shiftKey&&document.activeElement===d?(c.preventDefault(),h.focus()):!c.shiftKey&&document.activeElement===h&&(c.preventDefault(),d.focus())}),requestAnimationFrame(()=>l.querySelector(o?'[data-table-step="-1"]':".sl-table-confirm")?.focus())}renderTableDialogState(){let e=this.tableDialog,t=this.tableDialogEl;if(!e||!t)return;let i=t.querySelector("output[data-table-qty]");i&&(i.value=String(e.quantity));let s=t.querySelector("input[data-table-qty]");s&&(s.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 r=this.paidPrice(e.categoryKey,e.tierId??null,e.price),o=t.querySelector("[data-table-total]");o&&(o.textContent=this.money(r*e.quantity))}async confirmTableDialog(){let e=this.tableDialog,t=this.tableDialogHeld;if(!e)return;let i=this.tableDialogEl?.querySelector(".sl-table-confirm");if(i&&(i.disabled=!0,i.textContent=t?this.tf("picker.updatingEllipsis","Updating\u2026"):this.tf("picker.selectingEllipsis","Selecting\u2026")),t){try{let s=await this.controller.replaceTableQuantity(e.label,e.quantity,this.opts.holdTtlMs);if(!s){this.toast(this.tf("picker.guestCountCouldNotBeSecured","That guest count could not be secured. Your current table hold is unchanged."),"warning"),this.renderTableDialogState(),i&&(i.disabled=!1,i.textContent=this.tf("picker.updateTable","Update table"));return}this.hold={holdId:s.holdId,expiresAt:s.expiresAt,seats:s.seats,items:s.items},this.startHoldTimer(s.expiresAt),this.dismissTableDialog(),this.syncTray(),this.emitHoldChange(),this.toast((0,g.t)("picker.tableUpdatedForGuests",{label:e.label,count:e.quantity}),"success")}catch(s){this.opts.onError?.(s),this.toast(this.tf("picker.guestCountNoLongerAvailable","That guest count is no longer available. Your current hold is unchanged."),"error"),i&&(i.disabled=!1,i.textContent=this.tf("picker.updateTable","Update table"))}return}if(!this.controller.setTableQuantity(e.label,e.quantity)){i&&(i.disabled=!1,i.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())}showConfirm(e){let t=this.confirmSeat?.id;this.confirmEl?.remove(),this.confirmEl=null,this.confirmSeat=e,this.root?.setAttribute("data-confirming","true"),this.els.side?.toggleAttribute("inert",!0),Object.values(this.regions).forEach(w=>w.toggleAttribute("inert",!0)),this.controller.setSelectionFocus(e.id),t&&t!==e.id&&this.controller.deselect([t]),this.tipEl&&(this.tipEl.style.display="none");let i=this.controller.seatDetails(e.id),s=this.controller.doc?.categories.find(w=>w.key===e.categoryKey),r=i?.price??(s?.tiers?.length?s.tiers[0].price:s?.price),o=r!=null?this.paidPrice(e.categoryKey,i?.tierId??s?.tiers?.[0]?.id??null,r):void 0,a=w=>String(w??"\u2014").replace(/[&<>"]/g,x=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[x]),l=[i?.sectionLabel?`<div class="sl-confirm-field"><span class="sl-confirm-key">${this.tf("picker.section","Section")}</span><span class="sl-confirm-value">${a(i.sectionLabel)}</span></div>`:"",i?.rowLabel||i?.objectType==="booth"?`<div class="sl-confirm-field"><span class="sl-confirm-key">${a(this.rowTypeWord(i))}</span><span class="sl-confirm-value">${a(re(i)??i?.displayLabel??e.displayLabel??e.label)}</span></div>`:"",i?.objectType!=="booth"?`<div class="sl-confirm-field"><span class="sl-confirm-key">${this.tf("picker.seat","Seat")}</span><span class="sl-confirm-value">${a(i?.seatNumber??i?.displayLabel??e.displayLabel??e.label)}</span></div>`:""].filter(Boolean).join(""),c=i?.tiers??s?.tiers??[],p=i?.tierId??c[0]?.id,d=w=>w.buyerMessage?.trim()||(w.restriction==="companion"?this.tf("picker.companionRequiresWheelchair","Requires the adjacent wheelchair place"):void 0),h=c.length>1?`<fieldset class="sl-confirm-tiers"><legend>${this.tf("picker.ticketType","Ticket type")}</legend>`+c.map(w=>{let x=d(w);return`<button type="button" class="sl-confirm-tier" data-confirm-tier="${a(w.id)}" aria-pressed="${w.id===p}"><span class="sl-confirm-tier-copy"><span class="sl-confirm-tier-name">${a(w.name)}</span>`+(x?`<small class="sl-confirm-tier-note">${a(x)}</small>`:"")+`</span><span class="sl-confirm-tier-price">${this.money(this.paidPrice(e.categoryKey,w.id,w.price))}</span></button>`}).join("")+"</fieldset>":c[0]&&d(c[0])?`<p class="sl-confirm-tier-note">${a(d(c[0]))}</p>`:"",b=this.buyerView==="venue3d",m=document.createElement("div");m.className="sl-confirm",m.setAttribute("role","dialog"),m.setAttribute("aria-label",(0,g.t)("picker.confirmSeatLabel",{label:e.label}));let f=s?.color??"#6e7bff",k=Ye(f,this.cssVar("--sl-surface")||"#1a2234",.76)??f;m.style.setProperty("--sl-cat",f),m.style.setProperty("--sl-cat-ink",ke(k,"#172033","#ffffff")),m.innerHTML='<div class="sl-confirm-grid">'+l+`</div><div class="sl-confirm-cat"><span class="sl-dot" style="background:${s?.color??"#6e7bff"}"></span><span class="sl-confirm-cat-name">${a(i?.categoryLabel??s?.label??e.categoryKey)}</span>`+(o!=null?`<span class="sl-confirm-price">${this.money(o)}</span>`:"")+'</div><div class="sl-confirm-body">'+h+Bt(i?.wheelchairSpaceType)+zt(e.commercial)+(this.seatViewEnabled()&&this.buyerView!=="venue3d"?this.confirmThumbHtml(e):"")+(b?`${Dt(e,`${i?.displayLabel??e.displayLabel??e.label} \xB7 ${o==null?this.tf("picker.priceNotSupplied","Price not supplied"):this.money(o)}`,b)}<div class="sl-confirm-inspect-row">${Ft(e,b?this.view3dCompareSeatIds:null)}${tt(this.canOffer3d(),b)}</div>`:tt(this.canOffer3d(),b))+`<div class="sl-confirm-row"><button type="button" class="sl-confirm-cancel">${(0,g.t)("common.cancel")}</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>${this.tf("picker.select","Select")}</button></div></div>`,this.els.map.appendChild(m),this.confirmEl=m;let C=m.querySelector(".sl-confirm-thumb");if(C&&e.viewUrl){let w=e.viewMeta?.previewUrl??e.viewUrl;this.buyerAssetUrls.resolve(w).then(x=>{x&&m.isConnected&&this.confirmEl===m&&(C.src=x)}).catch(x=>this.opts.onError?.(x))}this.reanchorConfirm(),m.querySelector(".sl-confirm-view")?.addEventListener("click",()=>{this.openSeatView(e)}),m.querySelector(".sl-confirm-confidence")?.addEventListener("click",w=>{this.openSeatConfidencePassport(e,w.currentTarget instanceof HTMLElement?w.currentTarget:null)}),m.querySelector(".sl-confirm-compare")?.addEventListener("click",()=>this.saveView3dComparisonSeat(e)),m.querySelectorAll("[data-confirm-tier]").forEach(w=>{w.addEventListener("click",()=>{let x=w.dataset.confirmTier,T=c.find(v=>v.id===x);if(!T)return;this.controller.setSeatTier(e.id,T.id),m.querySelectorAll("[data-confirm-tier]").forEach(v=>{v.setAttribute("aria-pressed",String(v===w))});let u=m.querySelector(".sl-confirm-price");u&&(u.textContent=this.money(this.paidPrice(e.categoryKey,T.id,T.price))),this.reanchorConfirm()})}),m.querySelector(".sl-confirm-3d")?.addEventListener("click",()=>{this.buyerView==="venue3d"?(this.dismissConfirm(),this.view3dHandle?.flyToSeat(e.id)):(this.view3dReturnSeat=e,this.dismissConfirm(),this.enter3d(e.id))}),m.querySelector(".sl-confirm-add").addEventListener("click",()=>this.commitConfirm()),m.querySelector(".sl-confirm-cancel").addEventListener("click",()=>this.cancelConfirm()),requestAnimationFrame(()=>m.querySelector(".sl-confirm-add")?.focus())}reanchorConfirm(){if(!this.confirmEl||!this.confirmSeat||this.root?.dataset.view3d==="on")return;let e=this.controller.worldToScreen({x:this.confirmSeat.x,y:this.confirmSeat.y});if(this.root?.dataset.layout==="narrow")return;let t=this.els.map.clientWidth,i=this.els.map.clientHeight,s=this.confirmEl.offsetWidth||276,r=this.confirmEl.offsetHeight||230,o=s/2+12,a=Math.max(o,Math.min(t-o,e.x)),l=e.y+r+24<=i,c=e.y<r+24&&l;this.confirmEl.dataset.placement=c?"below":"above",this.confirmEl.style.left=`${a}px`,this.confirmEl.style.top=`${Math.max(8,Math.min(i-8,e.y))}px`}dismissConfirm(){this.confirmEl?.remove(),this.confirmEl=null,this.confirmSeat=null,this.root?.removeAttribute("data-confirming"),Object.values(this.regions).forEach(e=>e.toggleAttribute("inert",!1)),this.applyPanelCollapsed(),this.controller.setSelectionFocus(null)}commitConfirm(){this.confirmSeat&&(this.dismissConfirm(),this.collapseSectionCard(),this.syncTray(),this.syncSelectionTo3d())}cancelConfirm(){let e=this.confirmSeat;e&&(this.controller.deselect([e.id]),this.confirmSeat&&this.dismissConfirm(),this.syncSelectionTo3d(),this.root?.focus({preventScroll:!0}))}closeConfirm(){this.dismissConfirm()}seatViewEnabled(){return this.opts.seatView!==!1}allSeats(){if(!this.allSeatsCache){let e=this.controller.doc;this.allSeatsCache=e?(0,g.expandChart)(e):[]}return this.allSeatsCache}async openSeatView(e){if(!this.root||!this.seatViewEnabled())return;let t=++this.seatViewGen,i=this.controller.doc,s=this.controller.getActiveFloorId(),r=e.focalPoint??i?.floors?.find(A=>A.id===s)?.focalPoint??i?.focalPoint??{x:0,y:0},o,a,l=!1;if(e.viewUrl){let A,F=null;try{let H=e.viewMeta?.previewUrl;H&&H!==e.viewUrl?(F=await this.buyerAssetUrls.resolve(H),A=e.viewUrl):A=await this.buyerAssetUrls.resolve(e.viewUrl)}catch(H){t===this.seatViewGen&&this.opts.onError?.(H);return}if(t!==this.seatViewGen||!A||e.viewMeta?.previewUrl&&e.viewMeta.previewUrl!==e.viewUrl&&!F||!this.root||!this.seatViewEnabled())return;let X={url:A,...F?{previewUrl:F}:{},...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?.coverage?{coverage:e.viewMeta.coverage}:{},...e.viewMeta?.capturedAt?{capturedAt:e.viewMeta.capturedAt}:{},...e.viewMeta?.sourceLabel?{sourceLabel:e.viewMeta.sourceLabel}:{}};o=X,a=(0,Ce.seatViewDisclosure)(X),l=(0,Ce.isAuthoredSeatView)(X)}else{let A;try{let{generateSeatPanorama:F}=await Rt();A=F(e,r,this.allSeats())}catch(F){t===this.seatViewGen&&this.opts.onError?.(F);return}if(t!==this.seatViewGen||!this.root||!this.seatViewEnabled())return;o={url:A.url,generated:!0},a=(0,g.t)("picker.illustrationCaption",{m:A.distanceM})}this.closeSeatView(!1);let c=document.createElement("div");c.className="sl-view",c.setAttribute("role","dialog"),c.setAttribute("aria-label",(0,g.t)("picker.viewFromSeat",{label:e.label})),c.innerHTML=`<div class="sl-view-head"><span class="sl-view-title">${(0,g.t)("picker.viewFromSeat",{label:e.label})}</span><span class="sl-view-cap">${a}</span><button type="button" class="sl-view-x" aria-label="${this.tf("picker.close","Close")}"><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">${l?(0,g.t)("picker.real360"):(0,g.t)("picker.preview")}</span><span class="sl-view-hint">${this.tf("picker.dragToLookAround","Drag to look around \xB7 scroll to zoom")}</span></div>`,this.root.appendChild(c),this.viewEl=c;let p=c.querySelector(".sl-view-pano"),d=(0,ee.planPanoramaDelivery)(o,(0,ee.browserPanoramaConstraints)()),h=new AbortController;p.style.backgroundImage=`url("${d.initialUrl}")`;let b=()=>{};d.upgradeUrl&&(b=(0,ee.schedulePanoramaUpgrade)(()=>{this.buyerAssetUrls.resolve(d.upgradeUrl).then(A=>!A||h.signal.aborted?null:(0,ee.loadPanoramaImage)(A,h.signal).then(()=>A)).then(A=>{!A||!c.isConnected||h.signal.aborted||(p.style.backgroundImage=`url("${A}")`)}).catch(()=>{})}));let m=70,f=35,k=1,C=p.clientHeight||1,w=p.clientWidth||1,x=-(C*(180/m)*2/2-w/2),T=0,u=()=>{let A=p.clientHeight||1,F=A*(180/m)*k,X=Math.max(0,F-A),H=Math.min(X/2,f/180*F);T=Math.min(H,Math.max(-H,T)),p.style.backgroundSize=`auto ${F}px`,p.style.backgroundPosition=`${x}px ${T-X/2}px`};u();let v=!1,L=0,$=0,y=A=>{v=!0,L=A.clientX,$=A.clientY,p.classList.add("drag"),p.setPointerCapture?.(A.pointerId)},S=A=>{v&&(x+=A.clientX-L,T+=A.clientY-$,L=A.clientX,$=A.clientY,u())},M=A=>{v=!1,p.classList.remove("drag"),p.releasePointerCapture?.(A.pointerId)},_=A=>{A.preventDefault(),k=Math.min(2.4,Math.max(1,k+(A.deltaY<0?.12:-.12))),u()};p.addEventListener("pointerdown",y),p.addEventListener("pointermove",S),p.addEventListener("pointerup",M),p.addEventListener("pointercancel",M),p.addEventListener("wheel",_,{passive:!1});let I=c.querySelector(".sl-view-x");I.addEventListener("click",()=>this.closeSeatView());let P=A=>{A.key==="Escape"&&(A.stopPropagation(),this.closeSeatView())};c.addEventListener("keydown",P),I.focus(),this.viewCleanup=()=>{b(),h.abort(),p.removeEventListener("pointerdown",y),p.removeEventListener("pointermove",S),p.removeEventListener("pointerup",M),p.removeEventListener("pointercancel",M),p.removeEventListener("wheel",_),c.removeEventListener("keydown",P)}}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);try{return new Intl.NumberFormat(this.opts.locale,{style:"currency",currency:this.currency}).format(e)}catch{return`${e} ${this.currency}`}}scheduleOfferBoundary(e){if(this.offerBoundaryTimer&&clearTimeout(this.offerBoundaryTimer),this.offerBoundaryTimer=null,!this.api.availability||this.destroyed)return;let t=Date.now(),i=xt(e,t);if(i==null)return;let s=6*36e5,r=Math.min(Math.max(i-t+1e3,1e3),s);this.offerBoundaryTimer=setTimeout(()=>{this.offerBoundaryTimer=null,!document.hidden&&this.refreshOfferAvailability(!1)},r)}scheduleOfferRefresh(e){!this.api.availability||this.destroyed||(this.offerRefreshTimer&&clearTimeout(this.offerRefreshTimer),this.offerRefreshTimer=setTimeout(()=>{this.offerRefreshTimer=null,this.refreshOfferAvailability(e)},e?180:0))}async refreshOfferAvailability(e){if(!(!this.api.availability||this.destroyed))try{let t=await this.api.availability(this.opts.event,e);if(this.destroyed)return;let i=Ie(t);if(!i)return;this.offerAvailability=i,this.scheduleOfferBoundary(i);let s=Oe(i),r={...this.hostPricing?.prices??{},...s},o=Object.keys(r).length>0||this.hostPricing?.formatter?{prices:r,...this.hostPricing?.formatter?{formatter:this.hostPricing.formatter}:{}}:void 0;this.setPricing(o),this.syncOffer(),this.opts.onOfferAvailabilityChange?.(i)}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}syncOffer(){let e=this.els.offer;if(!e)return;let t=this.offerAvailability,i=t?.release??null,s=i?null:t?.upcoming??null;if(!t||t.state==="closed"||t.state==="sold-out"||!i&&!s){e.classList.remove("has"),e.replaceChildren();return}let r=i??s,o=document.createElement("div");o.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=i?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=r.name||(i?this.tf("picker.currentOffer","Current offer"):this.tf("picker.scheduledOffer","Scheduled offer"));let p=document.createElement("span");p.className="sl-offer-line";let d=[];i&&t.fromPrice!=null&&d.push(this.money(t.fromPrice/100)),i&&r.remaining!=null&&d.push((0,g.t)("picker.offerRemainingAvailable",{count:r.remaining})),i&&r.endsAt!=null&&d.push((0,g.t)("picker.offerUntil",{time:Be(r.endsAt,this.eventTimezone,this.opts.locale)})),s?.startsAt!=null&&d.push((0,g.t)("picker.offerStarts",{time:Be(s.startsAt,this.eventTimezone,this.opts.locale)})),p.textContent=d.join(" \xB7 "),a.append(l,c,p);let h=document.createElement("details");h.className="sl-offer-info";let b=document.createElement("summary");b.setAttribute("aria-label",(0,g.t)("picker.howOfferWorks",{name:c.textContent??""})),b.textContent="i";let m=document.createElement("div");m.className="sl-offer-detail",m.textContent=i?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."),h.append(b,m),o.append(a,h),e.replaceChildren(o),e.classList.add("has")}paidPrice(e,t,i){let s=e?this.opts.pricing?.prices?.[e]:void 0;return s===void 0?i:typeof s=="number"?s:t&&s.tiers?.[t]!==void 0?s.tiers[t]:s.base??i}syncPrices(){let e=this.controller.doc;if(!e||!this.els.prices)return;let t=this.controller.categoryAvailability(),i=e.categories.filter(l=>!l.notForSale);this.narrateAvailability(i,t),this.syncSoldout(i,t);let s=5,r=i.length-s,o=r>1&&!this.pricesExpanded,a=o?i.slice(0,s):i;this.els.prices.classList.toggle("sl-expanded",r>1&&this.pricesExpanded),this.els.prices.innerHTML=a.map(l=>{let c=this.catPrice(l),p=this.catPriceRange(l),d=this.offerPrice(l.key),h=d?.previousPrice!=null&&d.previousPrice>d.price?d.previousPrice:null,b=this.focusedCatKey===l.key;return`<div class="sl-price-row${this.priceBandKeys!=null&&!this.priceBandKeys.has(l.key)?" sl-dim":""}${b?" sl-active":""}" data-cat="${D(l.key)}" role="button" tabindex="0" aria-pressed="${b}" title="${D(b?this.tf("picker.showAllSeats","Show all seats"):(0,g.t)("picker.showLabelSeatsOnMap",{label:l.label}))}"><span class="sl-dot" style="background:${D(l.color)}"></span><span class="sl-price-label">${D(l.label)}`+(d?.offerName?`<small class="sl-price-offer">${D(d.offerName)}</small>`:"")+`</span><span class="sl-price-left">${(0,g.tCount)("picker.leftCount",t[l.key]??0)}</span>`+(h!=null?`<span class="sl-price-was">${D(this.money(h))}</span>`:"")+(p!=null?`<span class="sl-price-amt">${p.min===p.max?this.money(p.min):`${this.money(p.min)}\u2013${this.money(p.max)}`}</span>`:c!=null?`<span class="sl-price-amt">${this.money(c)}</span>`:"")+"</div>"}).join("")+(r>1?`<button type="button" class="sl-price-more" aria-expanded="${!o}">`+(o?(0,g.t)("picker.showAllTicketTypes",{count:i.length}):this.tf("picker.showFewer","Show fewer"))+"</button>":"")+`<div class="sl-status-key" aria-label="${this.tf("picker.seatStatusLegend","Seat status legend")}"><span class="sl-status-item"><i class="sl-status-icon" aria-hidden="true"><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></i>${this.tf("picker.temporarilyHeld","Temporarily held")}</span><span class="sl-status-item"><i class="sl-status-icon sold" aria-hidden="true"><svg viewBox="0 0 24 24"><path d="M7 17L17 7"/></svg></i>${this.tf("picker.sold","Sold")}</span></div>`,this.els.prices.querySelectorAll(".sl-price-row").forEach(l=>{l.addEventListener("mouseenter",()=>this.controller.getRenderer()?.setCategoryHighlight?.(l.dataset.cat??null)),l.addEventListener("mouseleave",()=>this.controller.getRenderer()?.setCategoryHighlight?.(null));let c=()=>this.focusCategory(l.dataset.cat??"");l.addEventListener("click",c),l.addEventListener("keydown",p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),c())})}),this.els.prices.querySelector(".sl-price-more")?.addEventListener("click",()=>{this.pricesExpanded=!this.pricesExpanded,this.syncPrices()})}focusCategory(e){if(!e)return;let t=this.focusedCatKey===e?null:e;this.focusedCatKey=t,this.priceBandKeys=t?new Set([t]):null;let i=this.els.pricesSec?.querySelector(".sl-price-select");i&&(i.value="all"),this.controller.setCategoryFilter(t?[t]:null),this.controller.focusCategoryFilter(t?[t]:null),this.pushAvailabilityTo3d(),this.syncFloors(),this.syncRung(),this.minimap?.refreshMinimap(),this.syncPrices(),this.lastSection&&this.showSectionCard(this.lastSection)}narrateAvailability(e,t){let i=this.els.liveText,s=this.lastCatAvail;this.lastCatAvail={...t};let r=this.controller.getActiveFloorId();if(r!==this.lastAvailFloorId&&(this.lastAvailFloorId=r,this.availQuietUntil=performance.now()+2e3),!(!i||!s||performance.now()<this.availQuietUntil))for(let o of e){let a=s[o.key],l=t[o.key]??0;if(a===void 0||l>=a)continue;let c=a-l;i.textContent=(0,g.tCount)("picker.seatsJustTakenInCategory",c,{label:o.label,left:l}),this.els.live?.classList.remove("on"),this.els.live?.offsetWidth,this.els.live?.classList.add("on"),this.liveTimer&&clearTimeout(this.liveTimer),this.liveTimer=setTimeout(()=>this.els.live?.classList.remove("on"),8e3);return}}evictTakenSelections(){let e=new Set([...this.controller.currentHold()?.labels??[],...this.holdingLabels]),t=this.controller.getSelection().filter(i=>!e.has(i.label)&&(this.controller.getStatus(i.id)??"free")!=="free");t.length&&(this.controller.deselect(t.map(i=>i.id)),this.toast((0,g.t)("picker.seatJustTakenByAnother",{label:t[0].label}),"error"))}syncTray(){if(!this.els.tray)return;this.updateSelectionCapacity();let e=this.committedSelection();this.root?.dataset.layout==="narrow"&&this.secCardEl&&(this.hold||e.length||this.pendingGACount())&&(this.secCardEl.remove(),this.secCardEl=null,this.lastSection=null);let t=this.controller.getGAAreas(),i=this.hold?.items??[],s=[],r=new Set;if(this.salesClosed&&!e.length&&!i.length){let u=this.eventWhenText?`<span class="when">${String(this.eventWhenText).replace(/[&<>"]/g,v=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[v])}</span>`:"";s.push(`<div class="sl-closed-note" role="status"><b>${this.tf("picker.salesClosedPill","Sales are closed")}</b><span>${this.tf("picker.salesClosedCopy","Ticket sales for this event have ended.")}${u}</span></div>`)}else!e.length&&!i.length&&!t.length?s.push(`<div class="sl-tray-hint">${this.tf("picker.trayHintTapOrBest","Tap a seat on the map, or let us pick the best available for you.")}</div>`):!e.length&&!i.length&&s.push(`<div class="sl-tray-hint">${this.tf("picker.trayHintTapOrStanding","Tap a seat on the map \u2014 or grab standing tickets below.")}</div>`);let o=!e.length&&!i.length&&!this.pendingGACount();if(o&&(this.baReopen=!1),!this.salesClosed&&!this.hold&&(o||this.baReopen||this.bestAvailableBusy||this.bestAvailableConfirm)){let u=(this.controller.doc?.categories??[]).filter(L=>!L.notForSale),v=this.controller.getBestAvailableZones();this.baZone&&!v.some(L=>L.id===this.baZone)&&(this.baZone=""),s.push(this.bestAvailableConfirm?`<div class="sl-ba" role="alert"><div class="sl-ba-title"><span class="spark" aria-hidden="true">\u2726</span>${this.tf("picker.replaceCurrentChoices","Replace your current choices?")}</div><div class="sl-ba-replace"><b>${(0,g.t)("picker.willFindSeatsTogether",{count:this.baQty})}</b><span>${this.tf("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>${this.tf("picker.keepMine","Keep mine")}</button><button type="button" class="replace" data-ba-replace>${this.tf("picker.findNewSeats","Find new seats")}</button></div></div>`:`<div class="sl-ba"><div class="sl-ba-title"><span class="spark" aria-hidden="true">\u2726</span>${this.tf("picker.findBestSeatsTogether","Find the best seats together")}</div><div class="sl-ba-copy"><span class="wide">${this.tf("picker.willChooseClosestGroup","We\u2019ll choose the closest available group for you.")}</span><span class="narrow">${this.tf("picker.closestGroupChosenInstantly","Closest available group, chosen instantly.")}</span></div>`+(this.controller.hasPremiumSeats()?`<button type="button" class="sl-ba-premium${this.baPremium?" on":""}" data-ba-premium aria-pressed="${this.baPremium?"true":"false"}"><span class="star" aria-hidden="true">\u2605</span>${this.tf("picker.bestSeatsPremium","Best seats")}</button>`:"")+(u.length>1?`<select aria-label="${this.tf("picker.preferredTicketType","Preferred ticket type")}" data-ba-cat><option value="">${this.tf("picker.anyTicketType","Any ticket type")}</option>`+u.map(L=>`<option value="${L.key}"${this.baCat===L.key?" selected":""}>${L.label}</option>`).join("")+"</select>":'<span aria-hidden="true"></span>')+(v.length?`<select aria-label="${this.tf("picker.preferredVenueZone","Preferred venue zone")}" data-ba-zone><option value="">${this.tf("picker.anyVenueZone","Any venue zone")}</option>`+v.map(L=>`<option value="${D(L.id)}"${this.baZone===L.id?" selected":""}>${D(L.label)}</option>`).join("")+"</select>":"")+`<div class="sl-ba-qty"><button type="button" data-ba="-1" aria-label="${this.tf("picker.fewerSeats","Fewer seats")}">\u2212</button><span>${this.baQty}</span><button type="button" data-ba="1" aria-label="${this.tf("picker.moreSeats","More seats")}">+</button></div><button type="button" class="sl-ba-go${this.bestAvailableBusy?" sl-busy":""}"${this.bestAvailableBusy?" disabled":""}>`+(this.bestAvailableBusy?`<span class="sl-ba-spin" aria-hidden="true"></span>${this.tf("picker.findingBestSeats","Finding the best seats\u2026")}`:(0,g.tCount)("picker.findBestSeatsCount",this.baQty))+"</button>"+(this.baReopen?`<button type="button" class="sl-ba-back" data-ba-close>${this.tf("picker.keepMyPicks","Keep my picks")}</button>`:"")+"</div>")}let a=(u,v,L,$=1,y,S)=>Vt({d:u?this.controller.seatDetails(u):null,area:L==="ga"?t.find(M=>M.id===y):void 0,label:v,objectType:L,quantity:$,identity:S}),l=qt;for(let u of i){let v=`held:${u.label}`;r.add(v);let L=this.controller.doc?.categories.find(_=>_.key===u.categoryKey),$=u.tierId?L?.tiers?.find(_=>_.id===u.tierId)?.name:void 0,y=u.objectType!=="ga"?this.controller.seatByLabel(u.label):null,S=u.objectType==="table"?this.controller.tableSelection(u.label):null,M=this.seatViewEnabled()&&!!y&&u.objectType!=="table";s.push(`<div class="sl-chip sl-held${this.lastTrayKeys.has(v)?"":" sl-enter"}" data-key="${v}" data-held="${encodeURIComponent(u.label)}"${y?` data-locate="${y.id}"`:""}><div class="sl-chip-main">`+a(y?.id??null,u.label,u.objectType,u.quantity??1,u.objectId,S??void 0)+`<div class="sl-chip-sub"><span class="sl-ticket-state held" aria-label="${this.tf("picker.heldForYou","Held for you")}" title="${this.tf("picker.heldForYou","Held for you")}"><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><span class="cat">${L?.label??u.categoryKey}${$?` \xB7 ${$}`:""}</span>`+(S?.bookingMode==="variable"?`<button type="button" class="sl-table-edit" data-table-edit="${encodeURIComponent(u.label)}">${(0,g.t)("picker.guestsCountEdit",{count:u.quantity??1})}</button>`:"")+et(y?.wheelchairSpaceType)+Je(y?.commercial)+`<span class="amt">${this.money(this.paidPrice(u.categoryKey,u.tierId,u.unitPrice)*(u.quantity??1))}</span></div></div>`+l((0,g.t)("picker.removeHeldTicketLabel",{label:u.label}),M?u.label:null)+"</div>")}let c=new Set(i.map(u=>u.label)),p=this.seatViewEnabled();for(let u of e.filter(v=>!c.has(v.label))){let v=`seat:${u.id}`;r.add(v);let L=this.controller.doc?.categories.find(M=>M.key===u.categoryKey),$=u.tiers&&u.tiers.length?`<select class="tier" data-tier="${u.id}" aria-label="${(0,g.t)("picker.ticketTierFor",{label:u.label})}">`+u.tiers.map(M=>`<option value="${M.id}"${M.id===u.tierId?" selected":""}>${M.name} \xB7 ${this.money(this.paidPrice(u.categoryKey,M.id,M.price))}</option>`).join("")+"</select>":"",y=u.tiers?.find(M=>M.id===u.tierId)??u.tiers?.[0],S=y?.buyerMessage?.trim()||(y?.restriction==="companion"?this.tf("picker.companionRequiresWheelchair","Requires the adjacent wheelchair place"):"");s.push(`<div class="sl-chip${this.lastTrayKeys.has(v)?"":" sl-enter"}" data-key="${v}" data-seat="${u.id}" data-locate="${u.id}"><div class="sl-chip-main">`+a(u.id,u.label,u.objectType,u.quantity??1,u.objectId,u)+`<div class="sl-chip-sub"><span class="sl-ticket-state" aria-label="${this.tf("picker.selected","Selected")}" title="${this.tf("picker.selected","Selected")}"><svg viewBox="0 0 24 24"><path d="M5 12l4 4L19 6"/></svg></span><span class="cat">${L?.label??u.categoryKey}</span>`+(u.objectType==="table"&&u.bookingMode==="variable"?`<button type="button" class="sl-table-edit" data-table-edit="${encodeURIComponent(u.label)}">${(0,g.t)("picker.guestsCountEdit",{count:u.quantity??1})}</button>`:"")+`${et(u.wheelchairSpaceType)}${Je(u.commercial)}${$}<span class="amt">${this.money(this.paidPrice(u.categoryKey,u.tierId??null,u.price)*(u.quantity??1))}</span></div>`+(S?`<small class="sl-tier-note">${D(S)}</small>`:"")+"</div>"+l((0,g.t)("picker.removeSeatLabel",{label:u.label}),p&&u.objectType!=="table"?u.label:null)+"</div>")}for(let u of t){let v=this.gaQty.get(u.id)??0;s.push(`<div class="sl-ga" data-ga="${u.id}"><div class="sl-ga-info"><div class="sl-ga-name">${u.displayLabel??u.label}</div><div class="sl-ga-sub">${u.displayType??this.tf("picker.generalAdmission","General admission")} \xB7 ${this.money(this.paidPrice(u.categoryKey,null,u.price))} \xB7 ${(0,g.tCount)("picker.leftCount",u.available)}</div></div><div class="sl-ga-qty"><button type="button" data-d="-1" aria-label="${this.tf("picker.fewer","Fewer")}">\u2212</button><span>${v}</span><button type="button" data-d="1" aria-label="${this.tf("picker.more","More")}">+</button></div></div>`)}!this.salesClosed&&!this.hold&&!o&&!this.baReopen&&!this.bestAvailableBusy&&!this.bestAvailableConfirm&&s.push(`<button type="button" class="sl-ba-reopen" data-ba-reopen><span aria-hidden="true">\u2726</span>${this.tf("picker.findTogetherInstead","Find seats together instead")}</button>`),this.els.tray.innerHTML=s.join(""),this.lastTrayKeys=r,this.els.tray.querySelectorAll("[data-ba]").forEach(u=>{u.addEventListener("click",()=>{this.baQty=Math.max(1,Math.min(this.maxTickets,this.baQty+Number(u.dataset.ba))),this.syncTray()})}),this.els.tray.querySelector("[data-ba-cat]")?.addEventListener("change",u=>{this.baCat=u.target.value}),this.els.tray.querySelector("[data-ba-zone]")?.addEventListener("change",u=>{this.baZone=u.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-reopen]")?.addEventListener("click",()=>{this.baReopen=!0,this.syncTray(),this.els.tray.querySelector(".sl-ba-go")?.focus()}),this.els.tray.querySelector("[data-ba-close]")?.addEventListener("click",()=>{this.baReopen=!1,this.syncTray(),this.els.tray.querySelector("[data-ba-reopen]")?.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(u=>{u.addEventListener("click",()=>{let v=u.closest(".sl-chip");if(v.dataset.held){this.removeHeldLabel(decodeURIComponent(v.dataset.held),v);return}let L=v.dataset.seat,$=this.controller.getSelection().find(S=>S.id===L)?.label??this.tf("picker.seat","Seat"),y=()=>{this.controller.deselect([L]),this.toast((0,g.t)("picker.labelRemoved",{label:$}),"neutral",{label:this.tf("picker.undo","Undo"),onClick:()=>{let S=this.controller.select([L]);this.toast(S.length?(0,g.t)("picker.labelRestored",{label:$}):(0,g.t)("picker.labelNoLongerAvailable",{label:$}),S.length?"success":"warning")}})};if(this.reducedMotion()){y();return}v.classList.add("sl-leave"),this.scheduleMotion(y,150)})}),this.els.tray.querySelectorAll("[data-table-edit]").forEach(u=>{u.addEventListener("click",v=>{v.stopPropagation();let L=decodeURIComponent(u.dataset.tableEdit??""),$=this.controller.tableSelection(L);if(!$)return;let y=i.find(S=>S.label===L&&S.objectType==="table");this.showTableDialog({...$,quantity:y?.quantity??$.quantity},!!y,u)})}),this.els.tray.querySelectorAll(".sl-chip .tier").forEach(u=>{u.addEventListener("change",()=>this.controller.setSeatTier(u.dataset.tier,u.value||null))}),this.els.tray.querySelectorAll(".sl-chip .view[data-view-label]").forEach(u=>{u.addEventListener("click",()=>{let v=this.controller.seatByLabel(u.dataset.viewLabel);v&&this.openSeatView(v)})}),this.els.tray.querySelectorAll(".sl-chip[data-locate]").forEach(u=>{let v=()=>this.controller.flashSeat(u.dataset.locate,this.cssVar("--sl-accent")||"#f4b740");u.addEventListener("mouseenter",v),u.addEventListener("focusin",v)}),this.els.tray.querySelectorAll(".sl-ga button").forEach(u=>{u.addEventListener("click",()=>{let L=u.closest(".sl-ga").dataset.ga,$=t.find(M=>M.id===L),y=Number(u.dataset.d);if(y>0&&!this.canAddTicket())return;let S=Math.max(0,Math.min($?.available??0,(this.gaQty.get(L)??0)+y));this.gaQty.set(L,S),this.syncTray()})}),this.salesClosed&&this.els.tray.querySelectorAll(".sl-ba-go,[data-ba],[data-ba-cat],[data-ba-zone],[data-ba-replace],.sl-ga button").forEach(u=>{u.disabled=!0});let d=this.pendingGATotal(t),h=this.pendingGACount(),b=i.reduce((u,v)=>u+this.paidPrice(v.categoryKey,v.tierId,v.unitPrice)*(v.quantity??1),0),m=i.reduce((u,v)=>u+(v.quantity??1),0),f=e.filter(u=>!c.has(u.label)),k=f.reduce((u,v)=>u+this.paidPrice(v.categoryKey,v.tierId??null,v.price)*(v.quantity??1),0)+d+b,C=f.reduce((u,v)=>u+(v.quantity??1),0)+h+m,w=this.pendingSelectionCount(),x=this.lastTrayCount,T=this.lastTrayTotal;if(this.els.count.textContent=C?(0,g.tCount)("picker.ticketsCount",C):this.tf("picker.noSeatsSelected","No seats selected"),this.els.total.textContent=C?this.money(k):"",this.root?.setAttribute("data-has-selection",String(C>0)),this.root?.setAttribute("data-ba-active",String(this.bestAvailableConfirm||this.bestAvailableBusy||this.baReopen)),this.els.foot?.classList.toggle("empty",C===0),this.els.seatSummary&&(this.els.seatSummary.textContent=C?(0,g.tCount)("picker.seatsSelectedCount",C):""),this.syncCta(C,w),this.hold){let u=m||this.hold.seats?.length||0;this.els.holdTitle&&(this.els.holdTitle.textContent=(0,g.t)("picker.securedCount",{count:u})),this.els.holdCopy&&(this.holdCopyPending=w>0,this.els.holdCopy.textContent=w?(0,g.t)("picker.moreSelectedCount",{count:w}):rt(this.holdExpiresAt));let v=this.els.holdChange;v&&(v.disabled=this.releasingHold,v.textContent=this.releasingHold?this.tf("picker.releasingEllipsis","Releasing\u2026"):this.tf("picker.change","Change"))}C!==x&&this.animateOnce(this.els.count,"sl-value-pop",380),k!==T&&this.animateOnce(this.els.total,"sl-value-pop",380),x===0&&C>0&&(this.animateOnce(this.els.cta,"sl-ready",520),this.sideCollapsed&&this.root?.dataset.layout!=="narrow"&&this.setPanelCollapsed(!1)),this.renderPeek(C,k,w),this.lastTrayCount=C,this.lastTrayTotal=k,this.opts.onSelectionChange?.(e)}renderPeek(e,t,i){if(!this.els.peek)return;let s=(this.controller.doc?.categories??[]).map(r=>this.catPrice(r)).filter(r=>r!=null);this.els.peek.innerHTML=Kt({count:e,total:t,pendingCount:i,ctaPhase:this.ctaPhase,hasHold:!!this.hold,salesClosed:this.salesClosed,fromPrice:s.length?Math.min(...s):null,money:r=>this.money(r)})}async removeHeldLabel(e,t){if(!e||this.releasingLabels.has(e))return!1;this.releasingLabels.add(e),t?.setAttribute("aria-busy","true");let i=t?.querySelector(".rm");i&&(i.disabled=!0);try{let s=this.handedOff;if(!await this.controller.releaseLabels([e]))return this.toast((0,g.t)("picker.couldNotRemoveLabel",{label:e}),"error"),!1;let o=this.controller.currentHold();return this.hold=o?{holdId:o.holdId,expiresAt:o.expiresAt,seats:o.seats,items:o.items}:null,this.handedOff=!!this.hold&&s,this.bookedShown=!1,this.ctaPhase="idle",this.hold?this.startHoldTimer(this.hold.expiresAt):(this.stopHoldTimer(),this.forgetHold()),this.syncTray(),this.emitHoldChange(),this.toast((0,g.t)("picker.labelRemovedFromHold",{label:e}),"success"),!0}finally{this.releasingLabels.delete(e),t?.removeAttribute("aria-busy"),i?.isConnected&&(i.disabled=!1)}}async handleChangeSeats(){if(!this.hold||this.releasingHold)return;this.releasingHold=!0;let e=this.els.holdChange;e&&(e.disabled=!0,e.textContent=this.tf("picker.releasingEllipsis","Releasing\u2026"));try{await this.release(),this.hold||this.toast(this.tf("picker.heldTicketsReleased","Held tickets released. Choose your new seats."),"success")}finally{this.releasingHold=!1,e?.isConnected&&(e.disabled=!1,e.textContent=this.tf("picker.change","Change"))}}async handleCta(){if(this.salesClosed)return;if(this.totalTicketCount()>this.maxTickets){this.toast((0,g.t)("picker.removeTicketsUntilOrFewer",{count:this.maxTickets}),"warning");return}let e=this.committedSelection();if(this.hold&&!e.some(t=>!(this.hold.items??[]).some(i=>i.label===t.label))){let t=this.hold.seats??e;this.handedOff=!0,this.setCtaPhase("checkout"),this.checkoutHandoff(this.hold,t);return}this.holdingLabels=new Set(e.map(t=>t.label)),this.setCtaPhase("holding");try{let t=null,i=[...this.gaQty.entries()].filter(([,r])=>r>0),s=this.committedSelection();if(s.length){let r=await this.controller.hold(void 0,this.opts.holdTtlMs);t=r?{holdId:r.holdId,expiresAt:r.expiresAt,seats:r.seats,items:r.items}:null}for(let[r,o]of i){let a=await this.controller.holdGA(r,o,{ttlMs:this.opts.holdTtlMs});t=a?{holdId:a.holdId,expiresAt:a.expiresAt,seats:a.seats,items:a.items}:t}if(!t){this.toast(this.tf("picker.seatsJustTaken","One or more seats were just taken. Please pick again."),"error"),this.setCtaPhase("idle"),this.syncTray();return}this.hold=t,this.handedOff=!0,this.startHoldTimer(t.expiresAt),this.flashHeldSeats(t),this.setCtaPhase("checkout"),this.emitHoldChange(),this.checkoutHandoff(t,t.seats??s)}catch(t){this.opts.onError?.(t);let i=t,s=(i.conflicts??[]).map(o=>o.label).filter(Boolean).slice(0,3);i.reason==="event_closed"&&this.setSalesClosed(!0);let r=i.reason==="event_closed"?this.tf("picker.seatSalesClosedForEvent","Seat sales have closed for this event."):i.reason==="companion_pair_required"?this.tf("picker.companionPairRequired","Select the adjacent wheelchair place with each companion ticket."):i.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,g.t)("picker.labelsNoLongerAvailable.one",{labels:s.join(", ")}):(0,g.t)("picker.labelsNoLongerAvailable.other",{labels:s.join(", ")}):this.tf("picker.seatsJustTaken","One or more seats were just taken. Please pick again.");this.toast(r,"error"),this.setCtaPhase("idle")}finally{this.holdingLabels.clear(),this.ctaPhase==="holding"&&(this.ctaPhase="idle"),this.syncTray()}}startHoldTimer(e){this.stopHoldTimer(),this.holdExpiresAt=e,this.hold&&this.rememberHold(this.hold);let t=this.els.hold;t.innerHTML=`<span class="sl-hold-dot" aria-hidden="true"></span><span>${this.tf("picker.held","Held")}</span><span class="sl-hold-time" data-ref="holdTime"></span>`;let i=t.querySelector('[data-ref="holdTime"]');this.els.holdNote?.classList.add("on");let s=()=>{let r=Math.max(0,this.holdExpiresAt-Date.now());i&&(i.textContent=st(r)),!this.holdCopyPending&&this.els.holdCopy&&(this.els.holdCopy.textContent=rt(this.holdExpiresAt)),t.classList.add("on"),t.classList.toggle("is-expiring",r>0&&r<=Wt),this.setExtendPrompt(r>0&&r<=Wt,r),r<=0&&this.stopHoldTimer()};s(),this.holdTimer=setInterval(s,500)}stopHoldTimer(){this.holdTimer&&clearInterval(this.holdTimer),this.holdTimer=null,this.els.hold?.classList.remove("on","is-expiring"),this.els.holdNote?.classList.remove("on"),this.setExtendPrompt(!1,0)}setExtendPrompt(e,t){if(this.extendEl)if(e&&this.controller.currentHold()&&!this.bookedShown){let i=Math.ceil(t/1e3),s=Math.floor(i/60),r=String(i%60).padStart(2,"0");this.els.extendTxt.innerHTML=(0,g.t)("picker.seatsHeldForNeedMoreTime",{time:`${s}:${r}`}),this.extendEl.classList.add("on")}else this.extendEl.classList.remove("on")}async handleExtend(){let e=this.els.extendBtn;e.disabled=!0;let t=e.textContent;e.textContent=this.tf("picker.addingEllipsis","Adding\u2026");try{let i=await this.controller.extendHold(this.opts.holdTtlMs);i?(this.hold={holdId:i.holdId,expiresAt:i.expiresAt,seats:i.seats,items:i.items},this.holdExpiresAt=i.expiresAt,this.extendEl?.classList.remove("on"),this.rememberHold(this.hold),this.emitHoldChange(),this.toast(this.tf("picker.moreTimeAdded","More time added \u2014 your seats are still held."),"success")):this.toast(this.tf("picker.couldNotAddMoreTime","Couldn't add more time \u2014 please head to checkout now."),"warning")}catch(i){this.opts.onError?.(i),this.toast(this.tf("picker.couldNotAddMoreTime","Couldn't add more time \u2014 please head to checkout now."),"warning")}finally{e.disabled=!1,e.textContent=t}}detectBooked(){this.bookedShown||!this.handedOff||!this.hold||this.controller.currentHold()===null&&this.showBooked()}showBooked(){if(this.bookedShown||!this.hold)return;this.bookedShown=!0;let e=this.buildHandoff(this.hold);this.stopHoldTimer(),this.forgetHold();let t=e.lineItems.reduce((i,s)=>i+s.quantity,0);this.els.bookedSub&&(this.els.bookedSub.innerHTML=`<span class="sl-booked-seats">${(0,g.tCount)("picker.ticketsCount",t)}</span> ${this.tf("picker.confirmedAndOnWay","confirmed. A confirmation is on its way.")}`),this.bookedEl?.classList.add("on"),this.opts.onBooked?.(e)}checkoutHandoff(e,t){if(this.checkoutMode==="hosted"){this.startHostedCheckout(e,t);return}this.opts.onCheckout?.(e,t,this.buildHandoff(e))}async startHostedCheckout(e,t){let i=this.buildHandoff(e),s=null;try{s=await(this.paymentOptions??=this.pubApi.paymentOptions(this.opts.event))}catch(o){this.opts.onError?.(o)}if(this.destroyed)return;let r=s?.providers?.[0];if(!r){let o=It(s?.reason),a=!!this.opts.onCheckoutUnavailable||!!this.opts.onCheckout;this.opts.onCheckoutUnavailable?.({reason:o,handoff:i}),this.opts.onCheckout?.(e,t,i),a||this.openCheckoutPanel({kind:"unavailable",reason:o,seatCount:i.lineItems.reduce((l,c)=>l+c.quantity,0)});return}await this.openCheckoutPanel({kind:"pay",provider:r,order:{holdId:i.holdId,expiresAt:i.expiresAt,currency:i.currency,total:i.total,labels:i.lineItems.map(o=>o.displayLabel??o.label)}})}async openCheckoutPanel(e){let t;try{({mountCheckout:t}=await $t())}catch(i){this.opts.onError?.(i),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,startSession:i=>this.pubApi.startCheckout(this.opts.event,{...i,...this.opts.returnUrl?{returnUrl:this.opts.returnUrl}:{}}),orderStatus:i=>this.pubApi.orderStatus(i),onCancel:()=>{this.checkoutPanel=null,this.hold||this.setCtaPhase("idle")},onConfirmed:i=>{this.opts.onOrderConfirmed?.(i),this.controller.refresh()},onError:i=>this.opts.onError?.(i)}))}closeCheckoutPanel(){this.checkoutPanel?.destroy(),this.checkoutPanel=null}buildHandoff(e){let i=(e.items??[]).map(o=>{let a=this.controller.lineItemDisplay(o);return{label:o.label,...a.displayLabel?{displayLabel:a.displayLabel}:{},...a.displayType?{displayType:a.displayType}:{},objectId:o.objectId,objectType:o.objectType,categoryKey:o.categoryKey,tierId:o.tierId,unitPrice:this.paidPrice(o.categoryKey,o.tierId,o.unitPrice),currency:o.currency??this.currency,quantity:o.quantity??1}}),s=i[0]?.currency??this.currency,r=i.reduce((o,a)=>o+a.unitPrice*a.quantity,0);return{holdId:e.holdId,expiresAt:e.expiresAt,currency:s,lineItems:i,total:r}}emitHoldChange(){let e=this.hold;this.scheduleOfferRefresh(!0),this.opts.onHoldChange?.(e,e?.seats??[],e?this.buildHandoff(e):null)}toast(e,t="neutral",i){let s=this.els.toast;if(!s)return;s.replaceChildren();let r=document.createElement("span");if(r.textContent=e,s.appendChild(r),s.classList.toggle("has-action",!!i),i){let o=document.createElement("button");o.type="button",o.className="sl-toast-action",o.textContent=i.label,o.addEventListener("click",i.onClick,{once:!0}),s.appendChild(o)}s.dataset.tone=t,s.classList.add("on"),this.toastTimer&&clearTimeout(this.toastTimer),this.toastTimer=setTimeout(()=>{s.classList.remove("on"),s.classList.remove("has-action"),s.dataset.tone="neutral"},4200)}placeTooltip(){if(!this.tipEl)return;let e=this.els.map.clientWidth,t=this.tipEl.offsetWidth,i=this.tipEl.offsetHeight,s=this.tipPos.x+14,r=this.tipPos.y-i-12;s+t>e-8&&(s=this.tipPos.x-t-14),r<8&&(r=this.tipPos.y+18),this.tipEl.style.left=`${Math.max(8,s)}px`,this.tipEl.style.top=`${Math.max(8,r)}px`}rowTypeWord(e){let t=e?.displayType?.trim()||e?.rowType?.trim();return t||(e?.objectType==="table"?this.tf("picker.table","Table"):e?.objectType==="booth"?this.tf("picker.booth","Booth"):this.tf("picker.row","Row"))}updateTooltip(e){if(!this.tipEl)return;if(!e){this.tipEl.style.display="none";return}let t=m=>String(m??"\u2014").replace(/[&<>"]/g,f=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[f]),i=this.money(this.paidPrice(e.categoryKey,e.tierId??null,e.price)),s=e.objectType==="table"&&!!e.bookingMode,r=e.objectType==="booth",o=e.sectionLabel||e.rowLabel||e.seatNumber,a=s?`<div class="sl-tip-grid"><div class="sl-tip-field"><span class="sl-tip-key">${t(this.rowTypeWord(e))}</span><span class="sl-tip-val">${t(e.rowLabel??e.displayLabel??e.label)}</span></div><div class="sl-tip-field"><span class="sl-tip-key">${this.tf("picker.guests","Guests")}</span><span class="sl-tip-val">${e.bookingMode==="variable"?`${e.minOccupancy}\u2013${e.maxOccupancy}`:e.capacity}</span></div></div>`:r?'<div class="sl-tip-grid">'+(e.sectionLabel?`<div class="sl-tip-field"><span class="sl-tip-key">${this.tf("picker.section","Section")}</span><span class="sl-tip-val">${t(e.sectionLabel)}</span></div>`:"")+`<div class="sl-tip-field"><span class="sl-tip-key">${t(this.rowTypeWord(e))}</span><span class="sl-tip-val">${t(e.rowLabel??e.displayLabel??e.label)}</span></div></div>`:o?'<div class="sl-tip-grid">'+(e.sectionLabel?`<div class="sl-tip-field"><span class="sl-tip-key">${this.tf("picker.section","Section")}</span><span class="sl-tip-val">${t(e.sectionLabel)}</span></div>`:"")+(e.rowLabel?`<div class="sl-tip-field"><span class="sl-tip-key">${t(this.rowTypeWord(e))}</span><span class="sl-tip-val">${t(re(e))}</span></div>`:"")+(e.seatNumber?`<div class="sl-tip-field"><span class="sl-tip-key">${this.tf("picker.seat","Seat")}</span><span class="sl-tip-val">${t(e.seatNumber)}</span></div>`:"")+"</div>":`<div class="sl-tip-grid one"><div class="sl-tip-field"><span class="sl-tip-key">${this.tf("picker.seat","Seat")}</span><span class="sl-tip-val">${t(e.displayLabel??e.label)}</span></div></div>`,l=e.status==="not_for_sale",c=e.status==="free"?"":`<div class="sl-tip-status">${l?this.tf("picker.notAvailable","Not available"):e.status==="held"?(0,g.t)("map.statusHeld"):(0,g.t)("map.statusTaken")}</div>`,p=fe(e.commercial),d=p?`<div class="sl-tip-cx"><span class="g" aria-hidden="true">\u25D0</span>${t(p)}</div>`:"",h=Se(e.wheelchairSpaceType),b=h?`<div class="sl-tip-cx"><span class="g" aria-hidden="true">\u267F</span>${t(h)}</div>`:"";this.tipEl.style.setProperty("--sl-cat",e.categoryColor),this.tipEl.innerHTML=a+`<div class="sl-tip-cat"><span class="sl-tip-dot" style="background:${e.categoryColor}"></span><span class="sl-tip-name">${t(e.categoryLabel)}</span>`+(l?"":`<span class="sl-tip-amt">${i}</span>`)+"</div>"+b+d+c,this.tipEl.style.display="block",this.placeTooltip()}getSelection(){return this.committedSelection()}setMapTheme(e){this.destroyed||(this.opts.theme={...this.opts.theme??{},map:e??void 0},this.controller.setMapTheme(e))}setEventDetailsHidden(e){this.eventDetailsHidden=e,this.syncFullscreenButtons()}setPricing(e){let t=JSON.stringify(this.opts.pricing??null),i=JSON.stringify(e??null);t!==i&&(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)))}isColorblindSafe(){return this.cbSafe}setColorblindSafe(e){e!==this.cbSafe&&(this.cbSafe=e,this.cbEl?.setAttribute("aria-pressed",String(e)),this.controller.setColorblindSafe(e),Yi(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"}getBuyerView(){return this.buyerView}setBuyerView(e,t){if(e==="map"){this.exit3d();return}let i=t?.flyToSeatId;if(this.buyerView==="venue3d"){i?(this.opts.onBuyerViewChange?.({view:"venue3d",seatId:i}),this.view3dHandle?.flyToSeat(i)):t?.resetView&&this.view3dHandle?.focusOverview();return}this.enter3d(i)}seatState3dFor(e){switch(this.controller.getStatus(e.id)){case"held":return"held";case"booked":return"sold";case"not_for_sale":return"dimmed";default:break}return this.priceBandKeys!=null&&!this.priceBandKeys.has(e.categoryKey)||this.limitedViewFilter&&(e.commercial?.restrictedView||e.commercial?.obstructedView)?"dimmed":"available"}pushAvailabilityTo3d(){if(!this.view3dHandle)return;let e=this.allSeats().map(t=>({seatId:t.id,state:this.seatState3dFor(t)}));this.view3dHandle.setAvailability(e)}syncSelectionTo3d(){this.view3dHandle&&this.view3dHandle.setSelection(this.controller.getSelection().map(e=>e.id))}async seatViewFor3d(e){let t=this.allSeats().find(i=>i.id===e);if(!t)return null;if(t.viewUrl)try{let i=t.viewMeta?.previewUrl,s=!!i&&i!==t.viewUrl,r=s?await this.buyerAssetUrls.resolve(i):null,o=s?t.viewUrl:await this.buyerAssetUrls.resolve(t.viewUrl);return!o||s&&!r?null:{url:o,...r?{previewUrl:r}:{},...s?{resolveUrl:a=>this.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?.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(i){return this.opts.onError?.(i),null}return{url:"",generated:!0,mediaKind:"model",coverage:"exact-seat",sourceLabel:this.tf("picker.chartDerivedModel","Chart-derived model")}}emitAnalytics(e,t){try{this.opts.onAnalytics?.(e,{...t,surface:"buyer"})}catch{}}emit3dAnalytics(e,t){this.emitAnalytics(e,t)}onView3dSeatPick(e){if(this.salesClosed){this.toast(this.tf("picker.salesClosedToast","Sales are closed for this event."),"warning"),this.syncSelectionTo3d();return}let t=this.allSeats().find(a=>a.id===e);if(!t)return;let i=this.controller.tableSelection(e);if(this.committedSelection().some(a=>i?a.label===i.label:a.id===e)){this.controller.deselect([e]),this.dismissConfirm(),this.syncSelectionTo3d();return}let r=this.controller.getStatus(t.id);if(r==="held"||r==="booked"||r==="not_for_sale"){this.showUnavailable3dSeat(t,this.seatState3dFor(t),r),this.syncSelectionTo3d();return}if(this.dismissUnavailable3dSeat(),!this.controller.select([e]).length){this.syncSelectionTo3d(),this.dismissConfirm();return}if(this.opts.onBuyerViewChange?.({view:"venue3d",seatId:e}),this.flashPickedSeat(e),i){this.showTableDialog(i,!1),this.syncSelectionTo3d();return}this.opts.confirmSelection!==!1?this.showConfirm(t):this.syncTray(),this.syncSelectionTo3d()}showUnavailable3dSeat(e,t,i){let s=this.view3dEl;if(!s)return;this.dismissUnavailable3dSeat();let r=this.controller.seatDetails(e.id),o=r?.displayLabel??e.displayLabel??e.label,a=r?.sectionLabel,l=re(r),c=[a,l?(0,g.t)("picker.rowLabel",{label:l}):null,o].filter(Boolean).join(" \xB7 "),p=i==="held"?{title:this.tf("picker.temporarilyHeld","Temporarily held"),message:this.tf("picker.heldSeatExplanation","Another buyer is holding this seat. It may become available again.")}:i==="booked"?{title:this.tf("picker.sold","Sold"),message:this.tf("picker.soldSeatExplanation","This seat has already been booked.")}:{title:this.tf("picker.notForSale","Not for sale"),message:this.tf("picker.notForSaleExplanation","This seat is not included in the current sale.")},d=document.createElement("div");d.className="sl-view3d-unavailable",d.dataset.state=t,d.setAttribute("role","status"),d.setAttribute("aria-live","polite");let h=document.createElement("span");h.className="sl-view3d-unavailable-eyebrow",h.textContent=c||o;let b=document.createElement("strong");b.textContent=p.title;let m=document.createElement("div");m.className="sl-view3d-unavailable-copy",m.append(h,b);let f=document.createElement("button");f.type="button",f.setAttribute("aria-label",this.tf("picker.closeSeatStatus","Close seat status")),f.textContent="\xD7";let k=document.createElement("p");k.textContent=p.message,d.append(m,f,k),f.addEventListener("click",()=>d.remove()),s.appendChild(d),this.announceSeat(e)}dismissUnavailable3dSeat(){this.view3dEl?.querySelector(".sl-view3d-unavailable")?.remove()}saveView3dComparisonSeat(e){if(this.buyerView!=="venue3d")return;let t=this.view3dCompareSeatIds;t.includes(e.id)||(this.view3dCompareSeatIds=t.length===0?[e.id]:[t[0],e.id]),this.confirmSeat?.id===e.id&&(this.controller.deselect([e.id]),this.dismissConfirm(),this.syncSelectionTo3d(),this.syncTray()),this.view3dCompareChip.sync(),this.emit3dAnalytics("3d_comparison_saved",{seatId:e.id,count:this.view3dCompareSeatIds.length}),this.view3dCompareSeatIds.length>1?this.openView3dComparison():this.toast(this.tf("picker.chooseAnotherToCompare","Seat saved. Choose another seat to compare."),"success")}clearView3dComparison(){this.closeView3dComparison(!1),this.view3dCompareSeatIds=[],this.view3dCompareChip.remove(),this.emit3dAnalytics("3d_comparison_cleared")}view3dComparisonSnapshot(e){let t=this.allSeats().find(b=>b.id===e);if(!t)return null;let i=this.controller.seatDetails(t.id),s=this.controller.doc?.categories.find(b=>b.key===t.categoryKey),r=i?.price??(s?.tiers?.length?s.tiers[0].price:s?.price),o=r!=null?this.paidPrice(t.categoryKey,i?.tierId??s?.tiers?.[0]?.id??null,r):void 0,a=this.controller.getStatus(t.id),l=a==="held"?this.tf("picker.temporarilyHeld","Temporarily held"):a==="booked"?this.tf("picker.sold","Sold"):a==="not_for_sale"?this.tf("picker.notForSale","Not for sale"):this.tf("picker.available","Available"),c=t.viewUrl?(0,Ce.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}:{}}):this.tf("picker.chartDerivedSeatEye","Live 3D \xB7 chart-derived seat-eye \xB7 not surveyed"),p=fe(t.commercial)||this.tf("picker.noAuthoredRestriction","No organizer-authored restriction"),d=i?.wheelchairSpaceType?`${Se(i.wheelchairSpaceType)} \xB7 metadata, not access certification`:this.tf("picker.noAccessibilityMetadata","No accessibility metadata supplied"),h=(0,nt.seatConfidenceDisclosure)(t.confidenceEvidence);return{seat:t,label:i?.displayLabel??t.displayLabel??t.label,section:i?.sectionLabel??t.sectionId??"\u2014",row:re(i)??i?.rowLabel??"\u2014",category:i?.categoryLabel??s?.label??t.categoryKey,price:o==null?this.tf("picker.priceNotSupplied","Not supplied"):this.money(o),availability:l,selectable:a==null||a==="free",viewSource:c,limited:p,accessibility:d,confidence:h}}openSeatConfidencePassport(e,t=null){let i=this.view3dEl;if(!i)return;this.closeSeatConfidencePassport(!1);let s=(0,nt.seatConfidenceDisclosure)(e.confidenceEvidence),r=e.confidenceEvidence,o=this.controller.seatDetails(e.id),a=x=>G(x),l=s.limitations.length?`<h4>Known limits</h4><ul>${s.limitations.map(x=>`<li>${a(x)}</li>`).join("")}</ul>`:"",c=s.modeledTarget?`<div><dt>Modeled target</dt><dd>${a(s.modeledTarget)}</dd></div>`:"",p=r?`<div><dt>Evidence ID</dt><dd>${a(r.evidenceId)}</dd></div><div><dt>Model version</dt><dd>${a(r.modelVersion)}</dd></div><div><dt>Event configuration</dt><dd>${a(r.eventConfigurationId??"Not configuration-specific")}</dd></div><div><dt>Approval</dt><dd>${a(r.approvedByRole??"No external approval supplied")}</dd></div>`+(r.validUntil?`<div><dt>Valid until</dt><dd>${a(r.validUntil.slice(0,10))}</dd></div>`:""):"<div><dt>Evidence ID</dt><dd>None supplied</dd></div>",d=fe(e.commercial)||this.tf("picker.noAuthoredRestriction","No organizer-authored restriction"),h=`<div><dt>View restriction</dt><dd>${a(d)}</dd></div>`+(e.commercial?.note?`<div><dt>Organizer note</dt><dd>${a(e.commercial.note)}</dd></div>`:""),b=document.createElement("div");b.className="sl-view3d-passport-shell",b.innerHTML=`<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">${a(o?.displayLabel??e.displayLabel??e.label)}</strong></div><button type="button" data-close aria-label="Close seat confidence passport">\xD7</button></header><div class="sl-view3d-passport-summary"><strong>${a(s.headline)}</strong><span>${a(s.coverage)} \xB7 ${a(s.freshness)}</span></div><dl><div><dt>Model status</dt><dd>${a(s.model)}</dd></div><div><dt>Reality evidence</dt><dd>${a(s.reality)}</dd></div><div><dt>Source</dt><dd>${a(s.provenance)}</dd></div>`+h+c+p+`</dl>${l}<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></section>`;let m=[...new Set([...i.children,...[...this.els.map.children].filter(x=>x!==i)])].filter(x=>x instanceof HTMLElement),f=m.map(x=>({element:x,inert:x.inert,ariaHidden:x.getAttribute("aria-hidden")}));for(let x of m)x.inert=!0,x.setAttribute("aria-hidden","true");i.appendChild(b),i.classList.add("has-passport"),this.view3dPassportEl=b;let k=b.querySelector(".sl-view3d-passport"),C=()=>[...k.querySelectorAll('button:not(:disabled),[href],[tabindex]:not([tabindex="-1"])')],w=x=>{if(x.key==="Escape"){x.preventDefault(),x.stopPropagation(),x.stopImmediatePropagation(),this.closeSeatConfidencePassport();return}if(x.key!=="Tab")return;let T=C();if(!T.length)return;let u=T[0],v=T[T.length-1];x.shiftKey&&document.activeElement===u?(x.preventDefault(),v.focus()):!x.shiftKey&&document.activeElement===v&&(x.preventDefault(),u.focus())};window.addEventListener("keydown",w,!0),this.view3dPassportCleanup=()=>{window.removeEventListener("keydown",w,!0);for(let v of f)v.element.inert=v.inert,v.ariaHidden===null?v.element.removeAttribute("aria-hidden"):v.element.setAttribute("aria-hidden",v.ariaHidden);let x=t?.isConnected?t:this.confirmEl?.querySelector(".sl-confirm-confidence")??this.view3dCompareEl?.querySelector("[data-passport-seat]")??null,T=x?.closest(".sl-confirm,.sl-view3d-compare");T?.isConnected&&(T.inert=!1,T.removeAttribute("aria-hidden")),b.remove(),i.classList.remove("has-passport"),this.view3dPassportEl===b&&(this.view3dPassportEl=null);let u=x??this.view3dCompareEl?.querySelector("[data-passport-seat]")??this.confirmEl?.querySelector(".sl-confirm-confidence")??this.view3dCompareChip.mainButton();(t?.isConnected?t:u)?.focus()},b.addEventListener("click",x=>{let T=x.target instanceof HTMLElement?x.target:null;(T?.closest("[data-close]")||T?.classList.contains("sl-view3d-passport-scrim"))&&this.closeSeatConfidencePassport()}),requestAnimationFrame(()=>C()[0]?.focus()),this.emit3dAnalytics("3d_confidence_passport_opened",{seatId:e.id,evidenceId:r?.evidenceId??null,eventConfigurationId:r?.eventConfigurationId??null,modelLevel:r?.modelLevel??"unverified",realityLevel:r?.realityLevel??"none"})}closeSeatConfidencePassport(e=!0){let t=this.view3dPassportCleanup;if(this.view3dPassportCleanup=null,!t){this.view3dPassportEl?.remove(),this.view3dPassportEl=null,this.view3dEl?.classList.remove("has-passport");return}e||(document.activeElement instanceof HTMLElement?document.activeElement:null)?.blur(),t(),e||this.root?.focus({preventScroll:!0})}openView3dComparison(){let e=this.view3dEl;if(!e||this.view3dCompareSeatIds.length<2)return;this.closeView3dComparison(!1);let t=this.view3dCompareSeatIds.map(h=>this.view3dComparisonSnapshot(h)).filter(h=>!!h);if(t.length<2){this.clearView3dComparison();return}let i=h=>G(h),s=document.createElement("div");s.className="sl-view3d-compare-shell";let r=t.map((h,b)=>`<article><span>Seat ${b===0?"A":"B"}</span><strong>${i(h.label)}</strong><small>Section ${i(h.section)} \xB7 Row ${i(h.row)}</small><dl><div><dt>Current price</dt><dd>${i(h.price)}</dd></div><div><dt>Ticket type</dt><dd>${i(h.category)}</dd></div><div><dt>Availability</dt><dd>${i(h.availability)}</dd></div><div><dt>View source</dt><dd>${i(h.viewSource)}</dd></div><div><dt>View restriction</dt><dd>${i(h.limited)}</dd></div><div><dt>Seat confidence</dt><dd>${i(h.confidence.headline)}</dd></div><div><dt>Reality check</dt><dd>${i(h.confidence.reality)}</dd></div><div><dt>Accessibility</dt><dd>${i(h.accessibility)}</dd></div></dl><div class="sl-view3d-compare-actions"><button type="button" data-passport-seat="${i(h.seat.id)}">Passport</button><button type="button" data-view-seat="${i(h.seat.id)}">View seat</button><button type="button" class="select" data-select-seat="${i(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">Current price and availability come from this picker. Modeled views are chart-derived unless organizer media is labeled; SeatLayer does not invent why a seat has its price.</p><div class="sl-view3d-compare-grid">${r}</div></section>`;let o=document.activeElement instanceof HTMLElement?document.activeElement:null,a=[...e.children].filter(h=>h instanceof HTMLElement),l=a.map(h=>({element:h,inert:h.inert,ariaHidden:h.getAttribute("aria-hidden")}));for(let h of a)h.inert=!0,h.setAttribute("aria-hidden","true");e.appendChild(s),e.classList.add("has-comparison"),this.view3dCompareEl=s;let c=s.querySelector(".sl-view3d-compare"),p=()=>[...c.querySelectorAll('button:not(:disabled),[href],[tabindex]:not([tabindex="-1"])')],d=h=>{if(h.key==="Escape"){h.preventDefault(),this.closeView3dComparison();return}if(h.key!=="Tab")return;let b=p();if(!b.length)return;let m=b[0],f=b[b.length-1];h.shiftKey&&document.activeElement===m?(h.preventDefault(),f.focus()):!h.shiftKey&&document.activeElement===f&&(h.preventDefault(),m.focus())};window.addEventListener("keydown",d),this.view3dCompareCleanup=()=>{window.removeEventListener("keydown",d);for(let h of l)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"),this.view3dCompareEl===s&&(this.view3dCompareEl=null),o?.isConnected?o.focus():this.view3dCompareChip.mainButton()?.focus()},s.querySelector("[data-close]")?.addEventListener("click",()=>this.closeView3dComparison()),s.querySelectorAll("[data-passport-seat]").forEach(h=>h.addEventListener("click",()=>{let b=h.dataset.passportSeat,m=b?this.allSeats().find(f=>f.id===b):void 0;m&&this.openSeatConfidencePassport(m,h)})),s.querySelectorAll("[data-view-seat]").forEach(h=>h.addEventListener("click",()=>{let b=h.dataset.viewSeat;this.closeView3dComparison(!1),b&&this.view3dHandle?.flyToSeat(b)})),s.querySelectorAll("[data-select-seat]").forEach(h=>h.addEventListener("click",()=>{let b=h.dataset.selectSeat;b&&this.selectComparedSeat(b)})),requestAnimationFrame(()=>p()[0]?.focus()),this.emit3dAnalytics("3d_comparison_opened",{seatIds:this.view3dCompareSeatIds.slice()})}closeView3dComparison(e=!0){let t=this.view3dCompareCleanup;if(this.view3dCompareCleanup=null,!t){this.view3dCompareEl?.remove(),this.view3dCompareEl=null,this.view3dEl?.classList.remove("has-comparison");return}e||(document.activeElement instanceof HTMLElement?document.activeElement:null)?.blur(),t(),e||this.root?.focus({preventScroll:!0})}selectComparedSeat(e){if(this.salesClosed){this.toast(this.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}let t=this.allSeats().find(s=>s.id===e);if(!t)return;if(this.closeView3dComparison(!1),!this.controller.select([e]).length){this.syncSelectionTo3d(),this.toast(this.tf("picker.seatNoLongerAvailable","That seat is no longer available."),"warning");return}this.syncSelectionTo3d(),this.showConfirm(t),this.emit3dAnalytics("3d_comparison_selected",{seatId:e})}async enter3d(e){if(this.view3dEl||!this.canOffer3d()||!this.els.map)return;let t=this.controller.doc;if(!t)return;this.buyerView="venue3d",this.view3dTargetSeatId=null,this.opts.onBuyerViewChange?.({view:"venue3d",...e?{seatId:e}:{}}),this.root?.setAttribute("data-view3d","on"),this.dismissConfirm(),this.syncProjection();let i=document.createElement("div");i.className="sl-view3d",i.setAttribute("role","group"),i.setAttribute("aria-label",this.tf("picker.interactive3dVenueView","Interactive 3D venue view"));let s=document.createElement("button");s.type="button",s.className="sl-view3d-back",s.innerHTML=`<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M15 18l-6-6 6-6"/></svg><span>${this.tf("picker.backToMap","Back to map")}</span>`;let r=s.querySelector("span"),o=p=>{this.view3dTargetSeatId=p;let d=!!p;i.classList.toggle("is-seat-focused",d);let h=d?this.tf("picker.backToVenue","Back to venue"):this.tf("picker.backToMap","Back to map");r&&(r.textContent=h),s.setAttribute("aria-label",h)};s.addEventListener("click",()=>{if(this.view3dTargetSeatId&&this.view3dHandle){this.view3dHandle.focusOverview();return}this.exit3d()}),i.appendChild(s);let a=document.createElement("button");a.type="button",a.className="sl-view3d-fs",a.textContent="\u26F6",a.setAttribute("aria-label",this.tf("picker.fullScreen","Full screen")),a.setAttribute("aria-pressed",String(!!document.fullscreenElement||this.fsFallback||this.framedFs)),a.addEventListener("click",()=>this.toggleFullscreen()),i.appendChild(a);let l=document.createElement("div");l.className="sl-view3d-loading",l.setAttribute("role","status"),l.setAttribute("aria-live","polite"),l.textContent=this.tf("picker.loading3d","Building the 3D venue\u2026"),i.appendChild(l),this.els.map.appendChild(i),this.view3dEl=i,this.view3dCompareChip.sync(),requestAnimationFrame(()=>{i.style.opacity="1"});let c=++this.view3dGen;try{let p=(0,g.expandChart)(t),d=await Ht();if(c!==this.view3dGen||this.buyerView!=="venue3d"||this.view3dEl!==i)return;let h=await d.prepareVenue3D({doc:t,seats:p});if(c!==this.view3dGen||this.buyerView!=="venue3d"||this.view3dEl!==i)return;let b=d.mountVenue3D(i,{doc:t,seats:p,prepared:h},{portraitOverviewCrop:!0,arriveAtSeatEye:!0,seatViewActionLabel:m=>this.allSeats().find(f=>f.id===m)?.viewUrl?this.tf("picker.openAuthored360","Open venue 360\xB0"):this.tf("picker.lookAroundLive3d","Look around in live 3D"),onSeatPick:m=>this.onView3dSeatPick(m),onSeatInspect:m=>this.onView3dSeatPick(m),onSectionFocusChange:m=>{let f=i.querySelector('select[data-locator="section"]'),k=m??"";!f||f.value===k||(f.value=k,f.dispatchEvent(new Event("change")))},onViewTargetChange:m=>{i.querySelector(".sl-view3d-nav")?.classList.toggle("is-seat-focused",!!m),o(m),this.opts.onBuyerViewChange?.({view:"venue3d",...m?{seatId:m}:{}})},getSeatView:m=>new Promise((f,k)=>{let C=()=>{this.seatViewFor3d(m).then(x=>{x?f(x):k(new Error("seat_view_unavailable"))})},w=globalThis.requestIdleCallback;typeof w=="function"?w(C,{timeout:1500}):setTimeout(C,50)}),onAnalytics:(m,f)=>this.emit3dAnalytics(m,f)});this.view3dHandle=b,l.remove(),this.pushAvailabilityTo3d(),this.syncSelectionTo3d(),Ut(i,b),e&&b.flyToSeat(e)}catch(p){if(c!==this.view3dGen||this.buyerView!=="venue3d"||this.view3dEl!==i)return;this.opts.onError?.(p),this.toast(this.tf("picker.unavailable3d","3D could not start. The seat map is still available."),"warning"),this.exit3d()}}exit3d(){if(this.buyerView!=="venue3d"&&!this.view3dEl)return;this.view3dGen++,this.buyerView="map",this.view3dTargetSeatId=null,this.opts.onBuyerViewChange?.({view:"map"}),this.root?.removeAttribute("data-view3d"),this.closeSeatConfidencePassport(!1),this.closeView3dComparison(!1),this.view3dCompareChip.remove();try{this.view3dHandle?.dispose()}catch{}this.view3dHandle=null;let e=this.view3dEl;this.view3dEl=null,e&&(e.style.opacity="0",setTimeout(()=>e.remove(),320)),this.syncProjection();let t=this.view3dReturnSeat;this.view3dReturnSeat=null,t&&this.committedSelection().some(i=>i.id===t.id)&&this.opts.confirmSelection!==!1&&this.showConfirm(t)}getCurrentHold(){return this.hold}async resumeHold(e){return this.resumeHoldFromServer(e,!1)}async removeHeldTicket(e){return this.removeHeldLabel(e)}async bestAvailable(e,t,i={}){if(this.salesClosed||this.bestAvailableBusy)return null;e=Math.max(1,Math.min(this.maxTickets,Math.floor(e))),this.confirmSeat&&this.cancelConfirm(),this.bestAvailableConfirm=!1,this.bestAvailableBusy=!0;let s=this.els.tray?.querySelector(".sl-ba-go");s&&(s.disabled=!0,s.classList.add("sl-busy"),s.innerHTML=`<span class="sl-ba-spin" aria-hidden="true"></span>${this.tf("picker.findingEllipsis","Finding\u2026")}`);try{let r=await this.controller.bestAvailable(e,t,{...i,ttlMs:this.opts.holdTtlMs});return r?(this.hold={holdId:r.holdId,expiresAt:r.expiresAt,seats:r.seats,items:r.items},this.handedOff=!1,this.bookedShown=!1,this.gaQty.clear(),this.startHoldTimer(r.expiresAt),this.flashHeldSeats(this.hold),this.syncTray(),this.emitHoldChange(),i.preferPremium&&r.seats.length&&!r.seats.every(o=>o.commercial?.premium)&&this.toast((0,g.t)("picker.premiumFallbackNote",{count:e}),"neutral"),this.hold):null}catch(r){this.opts.onError?.(r);let o=r?.reason,a=o==="not_enough_together"?(0,g.t)("picker.couldNotFindSeatsTogether",{count:e}):o==="companion_pair_required"?this.tf("picker.companionPairRequired","Select the adjacent wheelchair place with each companion ticket."):o==="ticket_option_not_applicable"?this.tf("picker.ticketOptionNotApplicable","That ticket choice is not available for the selected seat."):o==="sold_out"?this.tf("picker.ticketTypeSoldOut","That ticket type is sold out. Try another ticket type."):o==="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(a,"error"),null}finally{this.bestAvailableBusy=!1,this.syncTray()}}async release(){let e=this.hold,t=this.controller.currentHold(),i=!0;if(t)i=await this.controller.release();else if(e){let s=[...new Set([...(e.items??[]).map(r=>r.label),...(e.seats??[]).map(r=>r.label)])];if(s.length)try{await this.api.release(this.opts.event,s,e.holdId)}catch(r){this.opts.onError?.(r),i=!1}}if(!i){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 Y({url:this.pubApi.subscribeUrl(e),mintTicket:()=>this.pubApi.subscribeTicket(e),onAccessUnavailable:t=>{this.opts.onAccessUnavailable?.(t),this.showAccessPanel(t)},sink:ae(this.controller,{flashOnLiveChange:!0,onStatusChange:()=>{this.syncPrices(),this.scheduleOfferRefresh(!0),this.detectBooked(),this.minimap?.refreshMinimap(),this.pushAvailabilityTo3d()},onSelectedObjectUnavailable:(t,i)=>{this.opts.onSelectedObjectUnavailable?.({labels:t,reason:i}),this.syncTray(),this.toast(i==="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)}showAccessPanel(e){if(this.destroyed||!this.root)return;let t=this.accessCopy(e.reason);this.dismissAccessPanel();let i=document.createElement("div");i.className="sl-access",i.setAttribute("role","status"),i.setAttribute("aria-live","polite");let s=document.createElement("div"),r=document.createElement("div");r.className="sl-access-title",r.textContent=t.title;let o=document.createElement("div");if(o.className="sl-access-body",o.textContent=t.body,s.appendChild(r),s.appendChild(o),t.action){let a=document.createElement("button");a.type="button",a.className="sl-access-act",a.textContent=t.action,a.addEventListener("click",()=>{this.refreshAccess()}),s.appendChild(a)}i.appendChild(s),(this.regions?.["bottom-center"]??this.root).appendChild(i),this.accessEl=i}dismissAccessPanel(){this.accessEl?.remove(),this.accessEl=null}accessCopy(e){switch(e){case"paused":return{title:this.tf("picker.accessPausedTitle","These seats are on hold right now"),body:this.tf("picker.accessPausedBody","The organizer has paused this selection. Try again in a few minutes."),action:this.tf("picker.accessRetry","Try again")};case"revoked":return{title:this.tf("picker.accessRevokedTitle","This access link is no longer active"),body:this.tf("picker.accessRevokedBody","Ask whoever sent you here for a new link to keep booking these seats.")};case"no_token":case"provider_failed":return{title:this.tf("picker.accessExpiredTitle","Your access session has ended"),body:this.tf("picker.accessExpiredBody","Sign in again, or reload the page, to keep browsing these seats. Anything you are already holding stays yours."),action:this.tf("picker.accessRetry","Try again")};default:return{title:this.tf("picker.accessInvalidTitle","We couldn\u2019t verify your access"),body:this.tf("picker.accessInvalidBody","You can still book anything shown as available. Contact whoever sent you here for access to the rest.")}}}destroy(){this.destroyed=!0,this.realtime?.stop(),this.realtime=null,this.dismissAccessPanel(),this.access?.clear(),this.hold&&!this.handedOff&&this.controller.release(),this.closeConfirm(),this.dismissTableDialog(!1),this.closeSeatView(),this.closeCheckoutPanel(),this.exit3d(),this.buyerAssetUrls.dispose(),this.stopHoldTimer(),this.toastTimer&&clearTimeout(this.toastTimer),this.liveTimer&&clearTimeout(this.liveTimer),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.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)}};function Qt(n,e={}){let t=e.origin??"";if(!t)try{t=new URL(n.src,window.location.href).origin}catch{t=""}let i=!1,s=null,r=null,o=null,a="",l=null,c=()=>{if(i)return;i=!0,s=n.getAttribute("style"),Object.assign(n.style,{position:"fixed",inset:"0",width:"100vw",height:"100vh",margin:"0",border:"0",zIndex:"2147483000",background:"#101625"});let h=document.documentElement;r=h.style.overflow,h.style.overflow="hidden",document.body&&(o=document.body.style.overflow,document.body.style.overflow="hidden"),l=b=>{b.key==="Escape"&&p()},window.addEventListener("keydown",l)},p=()=>{i&&(i=!1,s===null?n.removeAttribute("style"):n.setAttribute("style",s),s=null,a&&(n.style.height=a),r!==null&&(document.documentElement.style.overflow=r,r=null),o!==null&&document.body&&(document.body.style.overflow=o,o=null),l&&(window.removeEventListener("keydown",l),l=null))},d=h=>{if(h.source!==n.contentWindow||t&&h.origin!==t||!h.data||typeof h.data!="object")return;let b=h.data;if(b.type==="seatlayer:height"){typeof b.px=="number"&&Number.isFinite(b.px)&&b.px>0&&(a=`${Math.round(b.px)}px`,i||(n.style.height=a));return}b.type==="seatlayer:fullscreen"&&(b.on===!0?c():b.on===!1&&p())};return window.addEventListener("message",d),()=>{window.removeEventListener("message",d),p()}}0&&(module.exports={ApiError,BuyerAccessContext,BuyerAccessUnavailableError,BuyerRealtimeClient,EmbeddedDesigner,SEATING_CHART_CALLBACK_PROPS,SEATING_CHART_HANDLE_METHODS,SEATING_CHART_IDENTITY_PROPS,SEATING_CHART_VALUE_PROPS,SeatPicker,SeatingChart,attachPickerFrame,bindSeatingChartHandle,buildSeatingChartOptions,createBuyerAccessContext,createControllerSink,parseTicketOfferAvailability,ticketOfferPrices});
1281
+ </div>`;let s={};return i.querySelectorAll("[data-ref]").forEach(r=>{s[r.dataset.ref]=r}),{root:i,mapHost:s.map,els:s}}var Q=require("@seatlayer/core/view/panoramaDelivery");function Ct(n){let{root:e,source:t,caption:i,real:s,closeLabel:r,dragHint:o,viewFromSeatLabel:a,real360Label:l,previewLabel:d,resolveAsset:p,onClose:c}=n,h=document.createElement("div");h.className="sl-view",h.setAttribute("role","dialog"),h.setAttribute("aria-label",a),h.innerHTML=`<div class="sl-view-head"><span class="sl-view-title">${a}</span><span class="sl-view-cap">${i}</span><button type="button" class="sl-view-x" aria-label="${r}"><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">${s?l:d}</span><span class="sl-view-hint">${o}</span></div>`,e.appendChild(h);let f=h.querySelector(".sl-view-pano"),m=(0,Q.planPanoramaDelivery)(t,(0,Q.browserPanoramaConstraints)()),v=new AbortController;f.style.backgroundImage=`url("${m.initialUrl}")`;let k=()=>{};m.upgradeUrl&&(k=(0,Q.schedulePanoramaUpgrade)(()=>{p(m.upgradeUrl).then(T=>!T||v.signal.aborted?null:(0,Q.loadPanoramaImage)(T,v.signal).then(()=>T)).then(T=>{!T||!h.isConnected||v.signal.aborted||(f.style.backgroundImage=`url("${T}")`)}).catch(()=>{})}));let w=70,x=35,y=1,E=f.clientHeight||1,u=f.clientWidth||1,b=-(E*(180/w)*2/2-u/2),S=0,A=()=>{let T=f.clientHeight||1,I=T*(180/w)*y,R=Math.max(0,I-T),ve=Math.min(R/2,x/180*I);S=Math.min(ve,Math.max(-ve,S)),f.style.backgroundSize=`auto ${I}px`,f.style.backgroundPosition=`${b}px ${S-R/2}px`};A();let H=!1,L=0,P=0,j=T=>{H=!0,L=T.clientX,P=T.clientY,f.classList.add("drag"),f.setPointerCapture?.(T.pointerId)},K=T=>{H&&(b+=T.clientX-L,S+=T.clientY-P,L=T.clientX,P=T.clientY,A())},W=T=>{H=!1,f.classList.remove("drag"),f.releasePointerCapture?.(T.pointerId)},se=T=>{T.preventDefault(),y=Math.min(2.4,Math.max(1,y+(T.deltaY<0?.12:-.12))),A()};f.addEventListener("pointerdown",j),f.addEventListener("pointermove",K),f.addEventListener("pointerup",W),f.addEventListener("pointercancel",W),f.addEventListener("wheel",se,{passive:!1});let fe=h.querySelector(".sl-view-x");fe.addEventListener("click",c);let be=T=>{T.key==="Escape"&&(T.stopPropagation(),c())};return h.addEventListener("keydown",be),fe.focus(),{element:h,dispose(){k(),v.abort(),f.removeEventListener("pointerdown",j),f.removeEventListener("pointermove",K),f.removeEventListener("pointerup",W),f.removeEventListener("pointercancel",W),f.removeEventListener("wheel",se),h.removeEventListener("keydown",be),fe.removeEventListener("click",c)}}}var Bt=require("@seatlayer/core/core/seatConfidence");var Pt=require("@seatlayer/core"),qi={};function C(n,e){let t=(0,Pt.t)(n);return t===n?e:t}function Ht(n){if(typeof n=="string"){let e=document.querySelector(n);if(!e)throw new Error(`seatmap: container "${n}" not found`);return e}if(!(n instanceof HTMLElement))throw new Error("seatmap: container must be a CSS selector or an HTMLElement");return n}function z(n){return String(n??"").replace(/[&<>"']/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[e])}var Ui=(()=>{if(typeof document<"u"&&document.currentScript instanceof HTMLScriptElement&&document.currentScript.src)return document.currentScript.src;try{let n=qi.url;if(typeof n=="string"&&n)return n}catch{}})(),he=null;function Rt(){if(he!==null)return he;try{if(typeof document>"u")return he=!1;he=!!document.createElement("canvas").getContext("webgl2")}catch{he=!1}return he}function et(n){let e=Ui??(typeof location<"u"?location.href:void 0);if(!e)throw new Error(`seatlayer: cannot resolve the ${n} chunk URL`);return new URL(`./${n}`,e).href}async function Ot(){return typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?import(et("seatlayer-view3d.mjs")):import("@seatlayer/core/view3d")}async function $t(){return typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?import(et("seatlayer-panorama.mjs")):import("@seatlayer/core")}async function It(){return typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?import(et("seatlayer-checkout.mjs")):Promise.resolve().then(()=>(Mt(),Lt))}function zt(n){return n==="unavailable_for_event"||n==="payments_off_for_event"?n:"not_configured"}function De(n,e,t){let i={month:"short",day:"numeric",hour:"numeric",minute:"2-digit"},s=new Date(n);if(e)try{return s.toLocaleString(t,{...i,timeZone:e})}catch{}return s.toLocaleString(t,i)}function U(n){return String(n??"").replace(/[&<>"]/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[e])}function ue(n){return n?.restrictedView?C("picker.restrictedView","Restricted view"):n?.obstructedView?C("picker.obstructedView","Obstructed view"):""}function _t(n){if(!n)return"";let e=[];n.premium&&e.push(`<div class="sl-cx-premium"><span class="sl-cx-star" aria-hidden="true">\u2605</span>${C("picker.premiumSeat","Premium seat")}</div>`);let t=ue(n);return t?e.push(`<div class="sl-cx-warn"><span class="sl-cx-glyph" aria-hidden="true">\u25D0</span><span class="sl-cx-txt"><b>${t}</b>${n.note?`<span class="sl-cx-note">${U(n.note)}</span>`:""}</span></div>`):n.note&&e.push(`<div class="sl-cx-warn"><span class="sl-cx-glyph" aria-hidden="true">\u2139</span><span class="sl-cx-txt"><span class="sl-cx-note">${U(n.note)}</span></span></div>`),e.length?`<div class="sl-cx">${e.join("")}</div>`:""}function tt(n){let e=ue(n);if(!e)return"";let t=U(n?.note?n.note:e);return`<span class="sl-cx-mark" role="img" aria-label="${t}" title="${t}">\u25D0</span>`}function Ce(n){return n==="no-seat"?C("picker.emptyWheelchairSpace","Empty wheelchair space"):n==="seat-present"?C("picker.accessiblePhysicalSeat","Accessible physical seat"):""}function Ft(n){let e=Ce(n);return e?`<div class="sl-cx"><div class="sl-cx-warn"><span class="sl-cx-glyph" aria-hidden="true">\u267F</span><span class="sl-cx-txt"><b>${e}</b></span></div></div>`:""}function it(n){let e=Ce(n);return e?`<span class="sl-cx-mark" role="img" aria-label="${e}" title="${e}">\u267F</span>`:""}function st(n,e){if(!n)return"";let t=e?C("picker.viewFromThisSeat","View from this seat"):C("picker.seeItIn3d","See it in 3D");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>${t}</span></button>`}function Dt(n){if(!n)return"";let e=n.previous.label||n.previous.id,t=n.next.label||n.next.id;return`<span class="sl-seccard-nav" aria-label="${C("picker.browseSections","Browse sections")}"><button type="button" data-section-nav="${z(n.previous.id)}" aria-label="${C("picker.previousSection","Previous section")}: ${z(e)}" title="${z(e)}">\u2190</button><button type="button" data-section-nav="${z(n.next.id)}" aria-label="${C("picker.nextSection","Next section")}: ${z(t)}" title="${z(t)}">\u2192</button></span>`}function jt(n,e){if(!e)return"";let t=e,i=t.includes(n.id),s=i?t.length>1?C("picker.openComparison","Open comparison"):C("picker.savedForComparison","Saved for comparison"):t.length?C("picker.compareWithSaved","Compare with saved"):C("picker.saveToCompare","Save to compare");return`<button type="button" class="sl-confirm-compare"${i&&t.length===1?" disabled":""}><span aria-hidden="true">\u21C4</span><span>${U(s)}</span></button>`}function Nt(n,e,t){if(!t)return"";let i=(0,Bt.seatConfidenceDisclosure)(n.confidenceEvidence),s=i.modeledTarget??i.reality;return`<button type="button" class="sl-confirm-confidence" aria-label="Open seat confidence passport for ${U(n.displayLabel??n.label)}"><span><em>${U(e)}</em><strong>${U(i.headline)}</strong><small>${U(s)}</small></span><b>Passport</b></button>`}function te(n){let e=n?.rowLabel,t=n?.sectionLabel;if(!e||!t)return e;for(let i of["-"," ","\xB7","/","_"]){let s=`${t}${i}`;if(e.startsWith(s)&&e.length>s.length)return e.slice(s.length)}return e}var Vt=require("@seatlayer/core"),me=require("@seatlayer/core/picker/minimapGeometry");function Ut(n,e){let t=new rt(n);return t.build(e),t}var rt=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}build(e){if(!this.host.controller.getViewport())return;let i=document.createElement("button");i.type="button",i.className="sl-minimap-toggle",i.setAttribute("aria-label",C("picker.openVenueMap","Open venue overview map")),i.setAttribute("aria-expanded","false"),i.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(i),this.miniToggle=i;let s=document.createElement("div");s.className="sl-minimap",s.setAttribute("role","group");let r=document.createElement("div");r.className="sl-minimap-bar";let o=document.createElement("span");o.className="sl-minimap-label";let a=document.createElement("span");a.className="sl-minimap-key",a.setAttribute("aria-label",C("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",C("picker.closeVenueMap","Close venue overview map")),l.textContent="\xD7",r.append(o,a,l);let d=document.createElement("canvas");d.tabIndex=0,d.setAttribute("role","application"),d.setAttribute("aria-label",C("picker.venueMapInstructions","Venue overview map. Drag the viewport, click a section, or use arrow keys to pan.")),s.append(r,d),e.appendChild(s),this.miniWrap=s,this.miniLabel=o,this.miniCanvas=d;let p=document.createElement("canvas");this.miniBase=p,i.addEventListener("click",()=>this.setMinimapOpen(!0)),l.addEventListener("click",()=>this.setMinimapOpen(!1)),d.addEventListener("click",c=>{if(this.miniSuppressClick){this.miniSuppressClick=!1;return}this.minimapJump(c)}),d.addEventListener("pointerdown",c=>this.minimapPointerDown(c)),d.addEventListener("pointermove",c=>this.minimapPointerMove(c)),d.addEventListener("pointerup",c=>this.minimapPointerUp(c)),d.addEventListener("pointercancel",c=>this.minimapPointerUp(c)),d.addEventListener("keydown",c=>this.minimapKeydown(c)),this.layoutMinimap(),this.syncMinimapLabel(),this.drawMinimapStatic(),this.drawMinimapRect()}setMinimapOpen(e){this.host.root()?.setAttribute("data-minimap-open",String(e)),this.miniToggle?.setAttribute("aria-expanded",String(e)),e?this.miniCanvas?.focus():this.miniToggle?.focus()}layoutMinimap(){let e=this.miniCanvas,t=this.miniBase,i=this.host.controller.getViewport()?.bounds;if(!e||!t||!i||!(i.width>0&&i.height>0))return;let s=196,r=146,o=6,a=i.width/Math.max(1,i.height),l=s,d=Math.round(s/a);d>r&&(d=r,l=Math.round(r*a)),l=Math.max(64,l),d=Math.max(48,d);let p=Math.min(2,window.devicePixelRatio||1);e.width=Math.round(l*p),e.height=Math.round(d*p),e.style.width=`${l}px`,e.style.height=`${d}px`,t.width=e.width,t.height=e.height,this.miniTf=(0,me.createMinimapTransform)(i,e.width,e.height,p,o)}syncMinimapLabel(){if(!this.miniLabel||!this.miniWrap)return;let e=this.host.controller.getFloors(),t=this.host.controller.isFloorOverview()?C("picker.allFloors","All floors"):e.find(p=>p.id===this.host.controller.getActiveFloorId())?.name??C("picker.venueOverview","Venue overview"),i=this.host.controller.getMinimapSnapshot().sections,r=i.find(p=>p.active)?.label??this.host.focusedSectionLabel(),o=r?`${t} \xB7 ${r}`:t;this.miniLabel.textContent=o;let a=i.filter(p=>p.state==="selected").length,l=i.filter(p=>p.state==="available").length,d=i.filter(p=>p.state==="inactive").length;this.miniWrap.setAttribute("aria-label",i.length?`${o}. ${a} selected, ${l} available, ${d} inactive sections.`:o),this.miniCanvas?.setAttribute("aria-label",i.length?`${o}. ${a} selected, ${l} available, ${d} inactive sections. ${C("picker.venueMapInstructions","The outlined region is the visible map area. Drag it, click a section, or use arrow keys to pan.")}`:`${o}. ${C("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 i=e.getContext("2d");if(!i)return;i.clearRect(0,0,e.width,e.height);let s=c=>c*t.scale+t.offX,r=c=>c*t.scale+t.offY,o=this.host.cssVar("--sl-line")||"rgba(139,147,167,.5)",a=this.host.cssVar("--sl-muted")||"#8b93a7",l=this.host.cssVar("--sl-accent")||"#6e7bff",d=this.host.cssVar("--sl-success")||"#22a06b",p=this.host.controller.getMinimapSnapshot();for(let c of p.sections)c.outline.length<3||(i.beginPath(),c.outline.forEach((h,f)=>f===0?i.moveTo(s(h.x),r(h.y)):i.lineTo(s(h.x),r(h.y))),i.closePath(),i.globalAlpha=c.state==="inactive"?.18:c.state==="selected"?.72:.34,i.fillStyle=c.state==="inactive"?a:c.state==="selected"?l:d,i.fill(),i.globalAlpha=.82,i.lineWidth=Math.max(1,t.dpr),i.strokeStyle=o,i.stroke(),c.active&&(i.globalAlpha=1,i.lineJoin="round",i.lineWidth=Math.max(4,t.dpr*3.5),i.strokeStyle=this.host.cssVar("--sl-surface")||"#fff",i.stroke(),i.lineWidth=Math.max(2,t.dpr*1.75),i.strokeStyle=l,i.stroke()));if(i.globalAlpha=1,!p.sections.length){let c=Math.max(1,t.dpr);for(let h of p.seats)i.globalAlpha=h.state==="inactive"?.22:.78,i.fillStyle=h.state==="inactive"?a:h.state==="selected"?l:d,i.beginPath(),i.arc(s(h.x),r(h.y),c,0,Math.PI*2),i.fill();i.globalAlpha=1}}drawMinimapRect(){let e=this.miniCanvas,t=this.miniBase,i=this.miniTf;if(!e||!t||!i)return;let s=e.getContext("2d");if(!s)return;s.clearRect(0,0,e.width,e.height),s.drawImage(t,0,0);let r=this.host.controller.getViewport();if(!r)return;let o=(0,me.minimapViewportPlan)(r.visible,i,e.width,e.height,Math.max(2,i.dpr*2)),a=this.host.cssVar("--sl-text")||"#12151c",l=this.host.cssVar("--sl-surface")||"#fff";s.save(),s.globalAlpha=.1,s.fillStyle=a,s.fillRect(o.raw.x,o.raw.y,o.raw.width,o.raw.height),s.globalAlpha=.9,s.lineJoin="round",s.lineWidth=Math.max(4,i.dpr*3.25),s.strokeStyle=l,s.strokeRect(o.raw.x,o.raw.y,o.raw.width,o.raw.height),s.globalAlpha=1,s.lineWidth=Math.max(2,i.dpr*1.75),s.strokeStyle=a,s.strokeRect(o.raw.x,o.raw.y,o.raw.width,o.raw.height),o.clipped&&Object.values(o.clippedEdges).some(Boolean)&&(s.setLineDash([Math.max(3,i.dpr*3),Math.max(2,i.dpr*2)]),s.strokeRect(o.clipped.x,o.clipped.y,o.clipped.width,o.clipped.height)),s.restore()}minimapWorldPoint(e){let t=this.miniCanvas,i=this.miniTf;if(!t||!i)return null;let s=t.getBoundingClientRect(),r=(e.clientX-s.left)*(t.width/Math.max(1,s.width)),o=(e.clientY-s.top)*(t.height/Math.max(1,s.height));return{...(0,me.minimapPointToWorld)({x:r,y:o},i),px:r,py:o}}minimapPointerDown(e){let t=this.minimapWorldPoint(e),i=this.host.controller.getViewport()?.visible;!t||!i||!(t.x>=i.x&&t.x<=i.x+i.width&&t.y>=i.y&&t.y<=i.y+i.height)||(this.miniDrag={pointerId:e.pointerId,offsetX:t.x-(i.x+i.width/2),offsetY:t.y-(i.y+i.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 i=this.minimapWorldPoint(e);i&&(!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:i.x-t.offsetX,y:i.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 i=e.key==="ArrowLeft"?-t.width*.2:e.key==="ArrowRight"?t.width*.2:0,s=e.key==="ArrowUp"?-t.height*.2:e.key==="ArrowDown"?t.height*.2:0;!i&&!s||(this.host.controller.clearSectionFocus(),this.host.controller.panToWorld({x:t.x+t.width/2+i,y:t.y+t.height/2+s}),e.preventDefault())}minimapJump(e){let t=this.minimapWorldPoint(e);if(t){for(let i of this.host.controller.getMinimapSnapshot().sections)if(!(i.state==="inactive"||i.outline.length<3)&&(0,Vt.pointInPolygon)(t,i.outline)){this.host.controller.focusSection(i.id);return}this.host.controller.clearSectionFocus(),this.host.controller.panToWorld(t)}}};var je=require("@seatlayer/core");var Ki=12;function qt(n,e){let t=e.floors(),i=new Set(t.map(v=>v.label.trim().toLocaleLowerCase())),s=e.zones().filter(v=>v.seatCount>0&&!i.has(v.label.trim().toLocaleLowerCase())),r=e.sections().filter(v=>v.seatCount>0&&!i.has(v.label.trim().toLocaleLowerCase())),o=s.length>1?[]:r,a=t.length>1,l=s.length>1,d=o.length>1;if(!a&&!l&&!d)return;let p=document.createElement("div");p.className="sl-view3d-nav";let c=document.createElement("button");c.type="button",c.className="sl-view3d-nav-toggle",c.setAttribute("aria-expanded","false");let h=v=>{p.classList.toggle("is-open",v),c.setAttribute("aria-expanded",String(v)),c.textContent=v?C("picker.closeVenueNav","Close"):a&&(l||d)?C("picker.levelsAndAreas","Levels & areas"):a?C("picker.levels","Levels"):C("picker.areas","Areas")};c.addEventListener("click",()=>h(!p.classList.contains("is-open"))),p.addEventListener("keydown",v=>{v.key!=="Escape"||!p.classList.contains("is-open")||(v.preventDefault(),v.stopPropagation(),h(!1),c.focus())}),h(!1),p.appendChild(c);let f=v=>{},m=v=>{};if(a){let v=document.createElement("div");v.setAttribute("role","group"),v.setAttribute("aria-label",C("picker.levels","Levels"));let k=[];m=y=>{k.forEach(E=>{E.setAttribute("aria-pressed",String((E.dataset.floor===""?null:Number(E.dataset.floor))===y))})};let w=y=>{e.focusFloor(y)&&(m(y),f(y))},x=(y,E)=>{let u=document.createElement("button");u.type="button",u.textContent=y,u.dataset.floor=E===null?"":String(E),u.setAttribute("aria-pressed",String(E===null)),u.addEventListener("click",()=>{w(E),h(!1)}),k.push(u),v.appendChild(u)};x(C("picker.allLevels","All levels"),null);for(let y of t)x(y.label||(0,je.t)("picker.levelNumber",{number:y.index+1}),y.index);p.appendChild(v)}if(l||d){let v=document.createElement("div");v.setAttribute("role","group"),v.setAttribute("aria-label",C("picker.areas","Areas"));let k=l?s.map(x=>({id:x.id,label:x.label||x.id,go:()=>{e.focusZone(x.id)}})):o.map(x=>({id:x.id,label:x.label||x.id,floorIndex:x.floorIndex,go:()=>{e.focusSection(x.id),Number.isFinite(x.floorIndex)&&m(x.floorIndex)}})),w=x=>{let y=l||x===null?k:k.filter(E=>E.floorIndex===void 0||E.floorIndex===x);if(v.replaceChildren(),!y.length){v.remove();return}if(v.isConnected||p.appendChild(v),!l&&y.length>Ki){let E=document.createElement("select");E.setAttribute("aria-label",C("picker.jumpToSection","Jump to section"));let u=document.createElement("option");u.value="",u.textContent=C("picker.jumpToSection","Jump to section"),E.appendChild(u);for(let b of y){let S=document.createElement("option");S.value=b.id,S.textContent=b.label,E.appendChild(S)}E.addEventListener("change",()=>{y.find(b=>b.id===E.value)?.go()}),v.appendChild(E);return}for(let E of y){let u=document.createElement("button");u.type="button",u.textContent=E.label,u.addEventListener("click",()=>{E.go(),h(!1)}),v.appendChild(u)}};f=w,w(null)}n.appendChild(p)}var Ne=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",C("picker.savedSeatComparison","Saved seat comparison"));let r=document.createElement("button");r.type="button",r.className="main",r.addEventListener("click",()=>{this.host.savedSeatIds().length>1?this.host.openComparison():this.host.toast(C("picker.chooseAnotherToCompare","Choose another seat to compare."),"neutral")});let o=document.createElement("button");o.type="button",o.className="clear",o.textContent="\xD7",o.setAttribute("aria-label",C("picker.clearSavedSeatComparison","Clear saved seat comparison")),o.addEventListener("click",()=>this.host.clearComparison()),t.append(r,o),e.appendChild(t),this.chip=t}let i=this.host.savedSeatIds().length,s=t.querySelector(".main");s&&(s.textContent=i>1?(0,je.t)("picker.compareCount",{count:i}):C("picker.oneSeatSaved","1 seat saved"),s.setAttribute("aria-label",i>1?(0,je.t)("picker.openComparisonOfSeats",{count:i}):C("picker.oneSeatSavedChooseAnother","One seat saved; choose another to compare")))}remove(){this.chip?.remove(),this.chip=null}mainButton(){return this.chip?.querySelector(".main")??null}};var ie=require("@seatlayer/core");function nt(n){let e=Math.max(0,n),t=Math.floor(e/6e4),i=String(Math.floor(e%6e4/1e3)).padStart(2,"0");return`${t}:${i}`}function Kt({d:n,area:e,label:t,objectType:i,quantity:s=1,identity:r}){let o=p=>String(p??"\u2014").replace(/[&<>"]/g,c=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[c]),a=i==="ga"?"ga":n?.objectType??i,l=r?.displayType?.trim()||n?.displayType?.trim()||e?.displayType?.trim()||(a==="table"?C("picker.table","Table"):a==="booth"?C("picker.booth","Booth"):a==="ga"?C("picker.generalAdmission","General admission"):C("picker.row","Row")),d=r?.rowLabel??r?.displayLabel??n?.rowLabel??n?.displayLabel??e?.displayLabel??e?.label??t;return a==="table"&&r?.bookingMode?`<div class="sl-chip-id"><span class="fld sec"><span class="sl-chip-eb">${o(l)}</span><span class="val">${o(d)}</span></span><span class="fld mid"><span class="sl-chip-eb">${C("picker.guests","Guests")}</span><span class="val">${s}</span></span></div>`:a==="ga"?`<div class="sl-chip-id"><span class="fld sec"><span class="sl-chip-eb">${o(l)}</span><span class="val">${o(d)}</span></span>`+(s>1?`<span class="fld mid"><span class="sl-chip-eb">${C("picker.tickets","Tickets")}</span><span class="val">${s}</span></span>`:"")+"</div>":a==="booth"?'<div class="sl-chip-id">'+(n?.sectionLabel?`<span class="fld sec"><span class="sl-chip-eb">${C("picker.section","Section")}</span><span class="val">${o(n.sectionLabel)}</span></span>`:"")+`<span class="fld mid"><span class="sl-chip-eb">${o(l)}</span><span class="val">${o(d)}</span></span></div>`:!n?.sectionLabel&&!n?.rowLabel&&!n?.seatNumber?`<div class="sl-chip-id"><span class="fld sec"><span class="sl-chip-eb">${C("picker.seat","Seat")}</span><span class="val">${o(d)}</span></span></div>`:'<div class="sl-chip-id">'+(n.sectionLabel?`<span class="fld sec"><span class="sl-chip-eb">${C("picker.section","Section")}</span><span class="val">${o(n.sectionLabel)}</span></span>`:"")+(n.rowLabel?`<span class="fld mid"><span class="sl-chip-eb">${o(l)}</span><span class="val">${o(te(n))}</span></span>`:"")+(n.seatNumber?`<span class="fld mid"><span class="sl-chip-eb">${C("picker.seat","Seat")}</span><span class="val">${o(n.seatNumber)}</span></span>`:"")+"</div>"}function Wt(n,e){return`<div class="sl-chip-rail"><button type="button" class="rm" aria-label="${n}"><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>`+(e?`<button type="button" class="view" data-view-label="${e}" aria-label="${(0,ie.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>`:"")+"</div>"}function Gt({count:n,total:e,pendingCount:t,ctaPhase:i,hasHold:s,salesClosed:r,fromPrice:o,money:a}){if(n&&i==="holding")return`<span>${C("picker.securingSeats","Securing your seats\u2026")}</span>`;if(n&&i==="checkout")return`<span>${(0,ie.t)("picker.peekSecured",{count:n,total:a(e)})}</span>`;if(n){let l=!!s;return`<span>${(0,ie.tCount)("picker.peekTicketsTotal",n,{total:a(e)})}</span><button type="button" class="go sl-sheet-go" data-act="${l?"checkout":"open"}">${s?t?C("picker.secureMore","Secure more"):C("picker.continue","Continue"):C("picker.review","Review")}</button>`}else return r?`<span>${C("picker.salesClosedPill","Sales are closed")}</span>`:(o!=null?`<span>${(0,ie.t)("picker.peekFromPrice",{price:a(o)})}</span>`:`<span>${C("picker.pickYourSeats","Pick your seats")}</span>`)+`<button type="button" class="go sl-sheet-go" data-act="open">${C("picker.bestSeatsStar","\u2726 Best seats")}</button>`}function ot(n,e=Date.now()){return(0,ie.t)("picker.holdReassurance",{time:nt(n-e)})}var Wi="https://api.seatlayer.io",Gi=10,Yt=6e4,Xt=6e4,Qt=new Set;function Yi(n){let e=Qt.has(n);return Qt.add(n),e}var Zt="seatmap.a11y.cb";function Xi(){try{if(typeof window>"u")return null;let n=window.localStorage.getItem(Zt);return n==null?null:n==="1"}catch{return null}}function Qi(n){try{window.localStorage.setItem(Zt,n?"1":"0")}catch{}}var Ve=class n{constructor(e){this.realtime=null;this.accessEl=null;this.lastExactSelectionValidity=null;this.root=null;this.mapHost=null;this.rendered=!1;this.destroyed=!1;this.els={};this.regions={};this.ro=null;this.holdTimer=null;this.toastTimer=null;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.hold=null;this.holdExpiresAt=0;this.handedOff=!1;this.bookedShown=!1;this.paymentOptions=null;this.checkoutPanel=null;this.extendEl=null;this.bookedEl=null;this.gaQty=new Map;this.tipEl=null;this.tipPos={x:0,y:0};this.confirmEl=null;this.confirmSeat=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.baReopen=!1;this.bestAvailableConfirm=!1;this.releasingHold=!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 Ne({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.view3dPassportEl=null;this.view3dPassportCleanup=null;this.floorsEl=null;this.secCardEl=null;this.viewEl=null;this.viewCleanup=null;this.seatViewGen=0;this.allSeatsCache=null;this.minimap=null;this.pickerLayoutSize={width:0,height:0};this.priceBandKeys=null;this.focusedCatKey=null;this.limitedViewFilter=!1;this.pricesExpanded=!1;this.lastSection=null;this.secCardCollapsed=!1;this.secCardShownAt=0;this.lastTrayCount=0;this.lastTrayTotal=0;this.lastTrayKeys=new Set;this.bestAvailableBusy=!1;this.releasingLabels=new Set;this.holdingLabels=new Set;this.ctaPhase="idle";this.a11yChipsEl=null;this.fsFallback=!1;this.fsChangeHandler=null;this.fsEscHandler=null;this.eventDetailsHidden=!1;this.holdCopyPending=!1;this.sideCollapsed=!1;this.sideToggleEl=null;this.pricesBtnEl=null;this.framedFs=!1;this.lastPostedHeight=0;this.cbEl=null;this.modalScrim=null;this.prevFocus=null;this.escHandler=null;this.closeModal=null;this.lastCatAvail=null;this.lastAvailFloorId="";this.availQuietUntil=0;this.liveTimer=null;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.opts={...e,confirmSelection:e.confirmSelection??!0},this.eventDetailsHidden=!!e.hideEventDetails,this.hostPricing=e.pricing,this.apiBase=(e.apiBase??Wi).replace(/\/+$/,""),this.access=e.transport?null:pe(e,{onExpired:s=>{this.opts.onAccessExpired?.(s),s.refreshed||this.showAccessPanel({reason:"no_token",retryable:!1})},onUnavailable:s=>{this.opts.onAccessUnavailable?.(s),this.showAccessPanel(s)}}),this.pubApi=e.transport?null:new oe(this.apiBase,{access:this.access??void 0,onObjectUnavailable:s=>this.opts.onSelectedObjectUnavailable?.(s)}),this.api=e.transport??this.pubApi,this.buyerAssetUrls=new Oe(e.event,this.api.asset?(s,r)=>this.api.asset(s,r):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 t=e.numberOfPlacesToSelect;if(t!=null&&(!Number.isInteger(t)||t<1))throw new Error("seatmap: `numberOfPlacesToSelect` must be a positive integer");this.exactTickets=t??null;let i=Math.max(1,Math.floor(e.maxSelection??this.exactTickets??Gi));if(this.exactTickets!=null&&i<this.exactTickets)throw new Error("seatmap: `maxSelection` cannot be lower than `numberOfPlacesToSelect`");this.maxTickets=this.exactTickets??i,this.cbSafe=Xi()??!!e.colorblindSafe,this.controller=this.wireController(e)}chartHasStage(){let e=this.controller.doc;if(!e)return!1;let t=e.floors?.length?e.floors.map(i=>i.objects??[]):[e.objects??[]];for(let i of t)for(let s of i)if(s.type==="shape"&&(s.role==="stage"||s.stageKind))return!0;return!1}confirmThumbHtml(e){let t=this.controller.doc;if(!t)return"";let i=e.viewUrl??"",s=this.chartHasStage();if(!i&&!s)return"";let r=null;if(!i)try{r=(0,g.generateSeatThumb)(e,e.focalPoint??t.focalPoint).distanceM??null}catch{return""}let o=s&&r!=null?`<div class="sl-confirm-sight">${(0,g.t)("picker.sightline",{m:r})}</div>`:"";return(i?`<button type="button" class="sl-confirm-view sl-confirm-thumbwrap" aria-label="${(0,g.t)("picker.viewFromSeat",{label:e.label})}"><img class="sl-confirm-thumb" alt="" /><span class="sl-confirm-thumb-badge">\u{1F52D} ${this.tf("picker.viewFromHere","View from here")}</span></button>`:`<button type="button" class="sl-confirm-view sl-confirm-viewbtn" aria-label="${(0,g.t)("picker.viewFromSeat",{label:e.label})}"><span aria-hidden="true">\u{1F52D}</span><span>${this.tf("picker.viewFromHere","View from here")}</span></button>`)+o}isFramed(){return typeof window<"u"&&window.parent!==window}postToHost(e){if(this.isFramed())try{window.parent.postMessage(e,"*")}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 i=t<640?1.2:.62;return Math.max(420,Math.round(t*i))}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()}syncFullscreenButtons(){let e=!!document.fullscreenElement||this.fsFallback||this.framedFs,t=this.eventDetailsHidden&&!e;this.root?.setAttribute("data-event-details-hidden",String(t)),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 i=this.els.zfs?.querySelector(".sl-zfs-lbl");i&&(i.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))}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}),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){Qe();let t=document.activeElement instanceof HTMLElement?document.activeElement:null,i=document.createElement("div");i.className="sl-modal-scrim";let s=document.createElement("div");s.className="sl-modal-frame",s.setAttribute("role","dialog"),s.setAttribute("aria-modal","true"),s.setAttribute("aria-label",C("picker.seatSelection","Seat selection")),s.tabIndex=-1,i.appendChild(s),document.body.appendChild(i);let r=document.body.style.overflow;document.body.style.overflow="hidden";let o=new n({...e,container:s});o.modalScrim=i,o.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 m=[...s.querySelectorAll('[role="dialog"][aria-modal="true"]')].filter(v=>v.isConnected&&!v.closest('[hidden], [aria-hidden="true"], [inert]'));return m[m.length-1]??s},d=(m,v)=>{let k=m;for(;k;){let w=window.getComputedStyle(k);if(k.hidden||k.getAttribute("aria-hidden")==="true"||k.hasAttribute("inert")||w.display==="none"||w.visibility==="hidden"||w.visibility==="collapse")return!0;if(k===v)return!1;k=k.parentElement}return!0},p=m=>[...m.querySelectorAll(a)].filter(v=>v.tabIndex>=0&&!v.matches(":disabled")&&!d(v,m)),c=(m,v)=>{let k=p(m),w=v?k[k.length-1]:k[0];w?w.focus({preventScroll:!0}):(m.hasAttribute("tabindex")||(m.tabIndex=-1),m.focus({preventScroll:!0}))},h=!1,f=()=>{if(h)return;h=!0,document.body.style.overflow=r,o.escHandler&&document.removeEventListener("keydown",o.escHandler),i.remove(),o.modalScrim=null;let m=o.prevFocus;o.prevFocus=null,m?.isConnected&&m.focus({preventScroll:!0});let v=()=>{o.destroy(),e.onClose?.()};o.hold&&!o.handedOff?o.release().finally(v):v()};return o.closeModal=f,i.addEventListener("mousedown",m=>{m.target===i&&f()}),o.escHandler=m=>{if(m.key==="Tab"){if(m.defaultPrevented)return;let v=l(),k=p(v),w=k[0],x=k[k.length-1],y=document.activeElement;!w||!x?(m.preventDefault(),c(v,m.shiftKey)):y===v||!y||!v.contains(y)?(m.preventDefault(),(m.shiftKey?x:w).focus({preventScroll:!0})):m.shiftKey&&y===w?(m.preventDefault(),x.focus({preventScroll:!0})):!m.shiftKey&&y===x&&(m.preventDefault(),w.focus({preventScroll:!0}));return}m.key==="Escape"&&(o.tableDialog?(m.preventDefault(),o.cancelTableDialog()):o.confirmSeat?(m.preventDefault(),o.cancelConfirm()):o.bestAvailableConfirm?(m.preventDefault(),o.bestAvailableConfirm=!1,o.syncTray()):(m.preventDefault(),f()))},document.addEventListener("keydown",o.escHandler),await o.render(),o.els.close?.classList.add("on"),o.els.close?.addEventListener("click",f),c(l(),!1),o}wireController(e){return new g.PickerController({transport:this.api,eventKey:e.event,maxSelection:this.maxTickets,selectedObjects:e.selectedObjects,selectableObjects:e.selectableObjects,numberOfPlacesToSelect:e.numberOfPlacesToSelect,currency:e.currency,flashOnLiveChange:!0,colorblindSafe:this.cbSafe,mapTheme:e.theme?.map??null,onSelectionChange:()=>{this.syncTray(),this.minimap?.refreshMinimap(),this.committedSelection().length&&this.collapseSectionCard(),this.syncSelectionTo3d()},onStatusChange:()=>{this.syncPrices(),this.scheduleOfferRefresh(!0),this.evictTakenSelections(),this.detectBooked(),this.minimap?.refreshMinimap(),this.pushAvailabilityTo3d()},onHoldExpired:()=>{this.hold=null,this.forgetHold(),this.handedOff=!1,this.bookedShown=!1,this.ctaPhase="idle",this.stopHoldTimer(),this.gaQty.clear(),this.toast((0,g.t)("picker.holdExpired",void 0)||"Your hold expired \u2014 seats released. Pick again.","warning"),this.syncTray(),this.emitHoldChange(),this.opts.onHoldExpired?.()},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.flashPickedSeat(t.id),this.opts.confirmSelection&&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=>{this.confirmSeat?.id===t.id&&this.dismissConfirm(),this.tableDialog?.physicalSeatIds.includes(t.id)&&this.dismissTableDialog()},onSelectionLimit:()=>{this.toast((0,g.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),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={},i=b=>Math.round((performance.now()-b)*100)/100;this.rendered=!0,Qe();let s=performance.now();await(0,g.loadLocale)(this.opts.locale),t.loadLocale=i(s),this.opts.messages&&(0,g.setStringOverrides)(this.opts.messages),this.checkoutMode==="hosted"&&(this.paymentOptions=this.pubApi.paymentOptions(this.opts.event));let r=performance.now(),o=Ht(this.opts.container),{root:a,els:l,mapHost:d}=St(o,(b,S)=>this.tf(b,S),this.opts.theme);this.root=a,this.els=l,this.mapHost=d,a.addEventListener("keydown",b=>{b.key==="Escape"&&(this.tableDialog?(b.preventDefault(),b.stopPropagation(),this.cancelTableDialog()):this.confirmSeat?(b.preventDefault(),b.stopPropagation(),this.cancelConfirm()):this.bestAvailableConfirm&&(b.preventDefault(),b.stopPropagation(),this.bestAvailableConfirm=!1,this.syncTray()))}),this.syncFullscreenButtons(),this.wireBuyerShell(a);let p=document.createElement("div");p.style.cssText="position:absolute;inset:0",this.mapHost.appendChild(p),t.mountBuyerShell=i(r);let c=await this.loadChart(p,t,i);if(!c)return this;this.els.boot.remove();let h=performance.now();if(this.startRealtime(),this.salesClosed=!!c.salesClosed||!!this.opts.readOnly,a.dataset.eventMode=c.mode==="test"?"test":"live",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),c.mode==="test"){let b=document.createElement("div");b.className="sl-testbadge",b.textContent=(0,g.t)("picker.testMode"),b.setAttribute("aria-label",(0,g.t)("picker.testMode")),this.regions["top-left"].appendChild(b)}let f=this.controller.doc?.theme;Object.entries(Fe(f,this.opts.theme)).forEach(([b,S])=>a.style.setProperty(b,S)),this.currency=c.currency??this.opts.currency??"USD",this.eventTimezone=c.timezone??null;let m=this.opts.theme?.logoUrl??f?.logoUrl??c.posterUrl??null;m?this.els.logo.innerHTML=`<img src="${m}" alt="">`:this.els.logo.textContent=(this.opts.theme?.brandName??f?.brandName??c.eventName??"?").slice(0,1).toUpperCase(),this.els.name.textContent=c.eventName??"";let v=c.startsAt?De(c.startsAt,c.timezone??null,this.opts.locale):"";this.eventWhenText=v||null,this.els.meta.textContent=[c.venue,v].filter(Boolean).join(" \xB7 "),this.els.pricesHint&&(this.els.pricesHint.textContent=this.tf("picker.priceHint","Colours on the map are ticket types \u2014 tap one below to show just those seats.")),this.buildBadge(f);let k=new Set,w=!1;if(this.controller.doc)for(let b of(0,g.expandChart)(this.controller.doc)){for(let S of b.accessibility??[])k.add(S);b.accessible&&!b.accessibility?.length&&k.add("wheelchair"),(b.commercial?.restrictedView||b.commercial?.obstructedView)&&(w=!0)}let x=()=>{this.rungsEl&&this.controller.getRung()!=="seats"&&(this.controller.setRung("seats"),this.collapseSectionCard(),this.syncRung())};if(k.size||w){let b=document.createElement("div");if(b.className="sl-chips",this.regions["top-left"].appendChild(b),this.a11yChipsEl=b,k.size){let S=(L,P)=>`<button type="button" class="sl-chip-f${L==="all"?" on":""}" data-a11y="1" data-f="${L}">${P}</button>`;b.insertAdjacentHTML("beforeend",S("all",this.tf("picker.allSeats","All seats"))+g.ACCESSIBILITY_TYPES.filter(({key:L})=>k.has(L)).map(({key:L,short:P,icon:j})=>S(L,`${j} ${P}`)).join(""));let A=new Set,H=()=>{b.querySelectorAll("button[data-a11y]").forEach(P=>{let j=P.dataset.f,K=j==="all"?A.size===0:A.has(j);P.classList.toggle("on",K),P.setAttribute("aria-pressed",String(K))});let L=A.size?[...A]:null;this.controller.setAccessibilityFilter(L),L&&x()};b.querySelectorAll("button[data-a11y]").forEach(L=>{L.addEventListener("click",()=>{let P=L.dataset.f;P==="all"?A.clear():A.has(P)?A.delete(P):A.add(P),H()})})}if(w){let S=document.createElement("button");S.type="button",S.className="sl-chip-f",S.setAttribute("aria-pressed","false"),S.innerHTML=`\u25D0 ${this.tf("picker.hideLimitedView","Hide limited-view seats")}`,b.appendChild(S),S.addEventListener("click",()=>{let A=!this.limitedViewFilter;this.limitedViewFilter=A,S.classList.toggle("on",A),S.setAttribute("aria-pressed",String(A)),this.controller.setCommercialLimitedFilter(A),this.pushAvailabilityTo3d(),A&&x()})}}let y=document.createElement("button");y.type="button",y.className="sl-cbbtn",this.cbEl=y,y.setAttribute("aria-label",this.tf("picker.toggleColorblindColors","Toggle colorblind-friendly colors")),y.setAttribute("aria-pressed",String(this.cbSafe)),y.innerHTML='<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>',this.els.zfit.parentElement.appendChild(y),y.addEventListener("click",()=>{this.setColorblindSafe(!this.cbSafe)}),this.srEl=document.createElement("div"),this.srEl.className="sl-sr",this.srEl.setAttribute("aria-live","polite"),a.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=i(h);let E=performance.now();if(await this.restoreRememberedHold(),t.restoreHold=i(E),this.destroyed)return this;this.salesClosed&&this.applySalesClosed(),this.syncPrices(),this.syncTray(),this.resumeHostedOrder();let u=this.controller.doc;return this.emitAnalytics("chart_rendered",{renderingTimeMillis:i(e),performanceProfile:t,seatCount:this.allSeats().length,objectCount:u?.objects.length??0,sectionCount:u?.objects.filter(b=>b.type==="section").length??0,view:this.buyerView,eventKey:this.opts.event,chartName:u?.name,floorCount:this.controller.getFloors().length,transport:this.opts.transport?"custom":"pubapi",load:Yi(this.opts.event)?"repeat":"cold"}),this}wireBuyerShell(e){this.refreshOfferAvailability(!1),this.api.availability&&(this.offerVisibilityHandler=()=>{!document.hidden&&!this.destroyed&&this.refreshOfferAvailability(!1)},document.addEventListener("visibilitychange",this.offerVisibilityHandler)),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.zoomToFit()),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 r=this.els.sheetToggle,o=p=>{e.dataset.sheet=p?"open":"peek",r?.setAttribute("aria-expanded",String(p)),r?.setAttribute("aria-label",p?this.tf("picker.collapseTicketPanel","Collapse ticket panel"):this.tf("picker.openTicketPanel","Open ticket panel"))};o(e.dataset.sheet==="open"),r?.addEventListener("click",p=>{p.stopPropagation(),o(e.dataset.sheet!=="open")}),this.els.peek?.addEventListener("click",p=>{let c=p.target.closest(".sl-sheet-go");c&&(p.stopPropagation(),c.dataset.act==="checkout"?this.handleCta():o(!0))});let a=0,l=!1,d=!1;t.addEventListener("pointerdown",p=>{if(p.target.closest?.(".sl-seccard,.sl-sheet-toggle,.sl-sheet-go")){d=!1;return}d=!0,l=!1,a=p.clientY,t.setPointerCapture?.(p.pointerId)}),t.addEventListener("pointermove",p=>{if(!d||l)return;let c=p.clientY-a;c<-18?(o(!0),l=!0):c>18&&(o(!1),l=!0)}),t.addEventListener("pointerup",p=>{d&&!l&&Math.abs(p.clientY-a)<6&&o(e.dataset.sheet!=="open"),d=!1,t.releasePointerCapture?.(p.pointerId)})}let i=()=>{if(this.root?.dataset.layout!=="narrow")return;let r=this.root.getAttribute("data-prices-open")==="true";if(this.root.setAttribute("data-prices-open",String(!r)),this.els.pricesSec?.setAttribute("aria-expanded",String(!r)),this.pricesBtnEl?.setAttribute("aria-pressed",String(!r)),!r&&this.root.dataset.sheet!=="open"){this.root.dataset.sheet="open";let o=this.els.sheetToggle;o?.setAttribute("aria-expanded","true"),o?.setAttribute("aria-label","Collapse ticket panel")}};this.els.pricesSec?.addEventListener("click",r=>{r.target.closest("select,button")||i()}),this.els.pricesSec?.addEventListener("keydown",r=>{r.key!=="Enter"&&r.key!==" "||r.target.closest("select,button")||(r.preventDefault(),i())});let s=document.createElement("button");s.type="button",s.className="sl-prices-btn",s.setAttribute("aria-label",this.tf("picker.ticketPrices","Ticket prices")),s.setAttribute("title",this.tf("picker.ticketPrices","Ticket prices")),s.setAttribute("aria-pressed","false"),s.innerHTML='<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M20.6 13.4 13.4 20.6a2 2 0 0 1-2.8 0L3 13V5a2 2 0 0 1 2-2h8l7.6 7.6a2 2 0 0 1 0 2.8z"/><circle cx="7.5" cy="7.5" r="1.3"/></svg>',s.addEventListener("click",()=>i()),this.els.headInfo?.parentElement?.insertBefore(s,this.els.hold??null),this.pricesBtnEl=s,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("mousemove",r=>{let o=this.els.map.getBoundingClientRect();this.tipPos={x:r.clientX-o.left,y:r.clientY-o.top},this.tipEl&&this.tipEl.style.display!=="none"&&this.placeTooltip()}),this.els.cta.addEventListener("click",()=>{this.handleCta()}),this.els.holdChange?.addEventListener("click",()=>{this.handleChangeSeats()})}observeLayout(e){let t=()=>{let i=e.clientWidth;if(i<=0)return;let s=e.clientHeight,r=i!==this.pickerLayoutSize.width||s!==this.pickerLayoutSize.height;this.pickerLayoutSize={width:i,height:s},this.reportFramedHeight();let o=i<640?"narrow":"wide",a=s<560?"compact":"comfortable";(e.dataset.layout!==o||e.dataset.density!==a)&&(e.dataset.layout=o,e.dataset.density=a,o==="narrow"&&!e.dataset.sheet&&(e.dataset.sheet="peek"),this.dockLayoutChrome()),r&&this.minimap?.refreshMinimap()};this.ro=new ResizeObserver(t),this.ro.observe(e),t(),requestAnimationFrame(t)}async loadChart(e,t,i){let s=performance.now(),r=await this.controller.render(e);return t.loadChartAndStatuses=i(s),this.destroyed?null:r?(Object.assign(t,r.performanceProfile),r):(this.els.boot.innerHTML=`<div class="sl-boot-title">${this.tf("picker.mapDidNotLoad","The seat map didn\u2019t load")}</div><div>${this.tf("picker.checkConnection","Check your connection and try again.")}</div><button type="button" class="sl-boot-retry">${this.tf("picker.accessRetry","Try again")}</button>`,this.els.boot.querySelector("button").addEventListener("click",()=>{let o=this.opts.container,a=this.opts;this.destroy(),new n({...a,container:o}).render()}),null)}resumeHostedOrder(){if(this.checkoutMode!=="hosted"||typeof location>"u")return;let e=new URLSearchParams(location.search),t=e.get("order");if(!t)return;let i=e.get("status");e.delete("order"),e.delete("status");try{let s=e.toString();history.replaceState(history.state,"",`${location.pathname}${s?`?${s}`:""}${location.hash}`)}catch{}i==="success"&&this.openCheckoutPanel({kind:"resume",orderId:t})}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()}dockLayoutChrome(){let e=this.root?.dataset.layout==="narrow";this.applyPanelCollapsed();let t=this.els.zfs,i=this.els.headInfo?.parentElement;t&&i&&t.parentElement!==i&&(t.classList.add("sl-fs-pill"),i.insertBefore(t,this.els.hold??null));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));let r=this.els.filters;if(r){this.cbEl&&this.els.zoom?.appendChild(this.cbEl),e?this.a11yChipsEl&&r.appendChild(this.a11yChipsEl):this.a11yChipsEl&&this.regions["top-left"]?.appendChild(this.a11yChipsEl);let o=e&&r.children.length>0;r.classList.toggle("has",o),this.els.filtersSec?.classList.toggle("has",o)}this.lastSection&&this.renderSectionCard(this.lastSection)}buildExtendPrompt(){let e=document.createElement("div");e.className="sl-extend",e.setAttribute("role","status"),e.innerHTML='<span class="sl-extend-txt" data-ref="extendTxt"></span><button type="button" class="sl-extend-btn" data-ref="extendBtn"></button>',(this.regions["bottom-center"]??this.els.map).appendChild(e),this.extendEl=e,this.els.extendTxt=e.querySelector('[data-ref="extendTxt"]'),this.els.extendBtn=e.querySelector('[data-ref="extendBtn"]'),this.els.extendBtn.textContent=this.tf("picker.addTime","Add time"),this.els.extendBtn.addEventListener("click",()=>{this.handleExtend()})}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>`,this.root.appendChild(e),this.bookedEl=e,this.els.bookedSub=e.querySelector('[data-ref="bookedSub"]')}tf(e,t){return C(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();e.innerHTML=`<div class="sl-soldout-eyebrow">${t}</div><div class="sl-soldout-title">${this.tf("picker.soldOutTitle","Sold out")}</div><p class="sl-soldout-copy">${this.tf("picker.soldOutCopy","No reserved seats are currently available for this event.")}</p>`,this.els.map.appendChild(e),this.soldoutEl=e}syncSoldout(e,t){let i=this.controller.getGAAreas().length>0,s=this.isSoldOut(e,t,i);s!==this.soldOut&&(this.soldOut=s,this.soldoutEl?.classList.toggle("on",s))}isSoldOut(e,t,i){return!i&&e.length>0&&e.every(s=>(t[s.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!!(this.opts.hideBadge||e?.hideBadge)}buildBadge(e){if(this.badgeHidden(e))return;let t=this.els.foot;if(!t)return;let i=document.createElement("a");i.className="sl-powered",i.href="https://seatlayer.io/?ref=picker",i.target="_blank",i.rel="noopener noreferrer",i.setAttribute("aria-label",this.tf("picker.poweredBy","Powered by SeatLayer")),i.innerHTML='<span class="sl-powered-mark" aria-hidden="true">'+Pe+`</span><span>${this.tf("picker.poweredBy","Powered by SeatLayer")}</span>`,t.appendChild(i)}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 i=document.createElement("div");i.className="sl-anchor",i.dataset.region=t,this.els.map.appendChild(i),this.regions[t]=i}}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 i=setTimeout(()=>{this.motionTimers.delete(i),this.destroyed||e()},t);this.motionTimers.add(i)}animateOnce(e,t,i=600){!e||this.reducedMotion()||(e.classList.remove(t),e.offsetWidth,e.classList.add(t),this.scheduleMotion(()=>e.classList.remove(t),i))}flashPickedSeat(e){this.reducedMotion()||this.controller.flashSeat(e,this.cssVar("--sl-accent")||"#f4b740")}flashHeldSeats(e){if(this.reducedMotion())return;(e.items??[]).filter(i=>i.objectType!=="ga").map(i=>i.label).slice(0,10).forEach((i,s)=>{let r=this.controller.seatByLabel(i);r&&this.scheduleMotion(()=>this.controller.flashSeat(r.id,this.cssVar("--sl-accent")||"#f4b740"),s*55)})}committedSelection(){let e=this.confirmSeat?.id,t=this.tableDialog&&!this.tableDialogHeld?this.tableDialog.id:null;return this.controller.getSelection().filter(i=>i.id!==e&&i.id!==t)}pendingSelectionCount(){let e=this.hold?.items??[],t=new Set(e.map(s=>s.label));return this.committedSelection().filter(s=>!t.has(s.label)).reduce((s,r)=>s+(r.quantity??1),0)+this.pendingGACount()}heldGACounts(){let e=new Map;for(let t of(this.hold?.items??[]).filter(i=>i.objectType==="ga"))e.set(t.objectId,(e.get(t.objectId)??0)+(t.quantity??1));return e}pendingGACount(){let e=this.heldGACounts();return[...this.gaQty.entries()].reduce((t,[i,s])=>t+Math.max(0,s-(e.get(i)??0)),0)}heldTicketCount(){return(this.hold?.items??[]).reduce((e,t)=>e+(t.quantity??1),0)}totalTicketCount(){let e=new Set((this.hold?.items??[]).map(i=>i.label)),t=this.committedSelection().filter(i=>!e.has(i.label)).reduce((i,s)=>i+(s.quantity??1),0);return this.heldTicketCount()+t+this.pendingGACount()}updateSelectionCapacity(){let e=new Set((this.hold?.items??[]).map(s=>s.label)),t=this.committedSelection().filter(s=>e.has(s.label)).reduce((s,r)=>s+(r.quantity??1),0),i=Math.max(0,this.maxTickets-this.heldTicketCount()-this.pendingGACount());this.controller.setMaxSelection(t+i)}canAddTicket(){return this.totalTicketCount()<this.maxTickets?!0:(this.toast((0,g.t)("picker.maxTicketsForOrder",{count:this.maxTickets}),"warning"),!1)}pendingGATotal(e){let t=new Map;for(let i of(this.hold?.items??[]).filter(s=>s.objectType==="ga"))t.set(i.objectId,(t.get(i.objectId)??0)+(i.quantity??1));return e.reduce((i,s)=>i+this.paidPrice(s.categoryKey,null,s.price)*Math.max(0,(this.gaQty.get(s.id)??0)-(t.get(s.id)??0)),0)}syncCta(e=this.lastTrayCount,t=this.pendingSelectionCount()){let i=this.els.cta;if(i){if(this.salesClosed){i.disabled=!0,i.textContent=this.tf("picker.salesClosedCta","Sales closed");return}if(this.confirmSeat||this.tableDialog&&!this.tableDialogHeld){i.disabled=!0,i.textContent=this.tableDialog?this.tf("picker.confirmYourTable","Confirm your table"):this.tf("picker.confirmOrCancelSeat","Confirm or cancel this seat");return}if(this.ctaPhase==="holding"){i.disabled=!0,i.innerHTML=`<span class="sl-cta-spin" aria-hidden="true"></span>${this.tf("picker.securingSeats","Securing your seats\u2026")}`;return}if(this.ctaPhase==="checkout"){i.disabled=!0,i.innerHTML=`<span class="sl-cta-spin" aria-hidden="true"></span>${this.tf("picker.openingCheckout","Opening secure checkout\u2026")}`;return}if(this.exactTickets!=null&&e!==this.exactTickets){let s=Math.max(0,this.exactTickets-e);i.disabled=!0,i.textContent=s>0?(0,g.t)("picker.selectExactMore",{count:s}):(0,g.t)("picker.selectExactCount",{count:this.exactTickets});return}i.disabled=e===0,i.textContent=this.hold?t?(0,g.t)("picker.secureMoreAndCheckout",{count:t}):this.tf("picker.continueToCheckout","Continue to checkout"):e?this.tf("picker.holdSeatsAndCheckout","Hold seats & checkout"):this.tf("picker.selectSeats","Select seats")}}setCtaPhase(e){this.ctaPhase=e,this.syncCta(),this.renderPeek(this.lastTrayCount,this.lastTrayTotal,this.pendingSelectionCount()),e==="checkout"&&this.scheduleMotion(()=>{this.ctaPhase==="checkout"&&(this.ctaPhase="idle",this.syncCta(),this.renderPeek(this.lastTrayCount,this.lastTrayTotal,this.pendingSelectionCount()))},1100)}holdStorageKey(){return`@seatlayer/hold/v1/${encodeURIComponent(this.apiBase)}/${encodeURIComponent(this.opts.event)}`}rememberedHoldId(){if(this.opts.initialHoldId)return this.opts.initialHoldId;if(this.opts.restoreHold===!1||typeof window>"u")return null;try{return window.sessionStorage.getItem(this.holdStorageKey())}catch{return null}}rememberHold(e){if(!(this.opts.restoreHold===!1||typeof window>"u"))try{window.sessionStorage.setItem(this.holdStorageKey(),e.holdId)}catch{}}forgetHold(){if(!(typeof window>"u"))try{window.sessionStorage.removeItem(this.holdStorageKey())}catch{}}async resumeHoldFromServer(e,t){try{let i=await this.controller.resumeHold(e);if(!i)return null;let s={holdId:i.holdId,expiresAt:i.expiresAt,seats:i.seats,items:i.items};return this.hold=s,this.handedOff=!0,this.bookedShown=!1,this.ctaPhase="idle",this.startHoldTimer(s.expiresAt),this.rememberHold(s),this.syncTray(),this.emitHoldChange(),this.opts.onHoldRestored?.(s,s.seats??[],this.buildHandoff(s)),t&&this.toast(this.tf("picker.heldTicketsRestored","Your held tickets have been restored."),"success"),s}catch(i){let s=i?.status;return s===404||s===409?this.forgetHold():this.opts.onError?.(i),null}}async restoreRememberedHold(){let e=this.rememberedHoldId();e&&await this.resumeHoldFromServer(e,!0)}activeFloorObjects(){let e=this.controller.doc;if(!e)return[];let t=e.floors;if(t?.length){let i=this.controller.getActiveFloorId();return(t.find(s=>s.id===i)??t[0]).objects??[]}return e.objects??[]}buildMinimap(){this.els.map&&(this.minimap=Ut({controller:this.controller,root:()=>this.root,cssVar:e=>this.cssVar(e),focusedSectionLabel:()=>this.lastSection?.label},this.regions["bottom-left"]??this.els.map))}catPrice(e){let t=e.tiers?.length?e.tiers[0].price:e.price;return t===void 0||!e.key?t:this.paidPrice(e.key,e.tiers?.[0]?.id??null,t)}catPriceRange(e){let t=e.tiers?.length?e.tiers.map(i=>this.paidPrice(e.key,i.id??null,i.price)):e.price==null?[]:[this.paidPrice(e.key,null,e.price)];return t.length?{min:Math.min(...t),max:Math.max(...t)}:void 0}priceBands(){let e=this.controller.doc;if(!e)return[];let t=e.categories.map(a=>({key:a.key,range:this.catPriceRange(a)})).filter(a=>a.range!=null);if(!t.length)return[];let i=[...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(i.length<=5)return i.map(a=>({id:`p${a.min}-${a.max}`,label:a.min===a.max?this.money(a.min):`${this.money(a.min)}\u2013${this.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 s=[...t].sort((a,l)=>a.range.min-l.range.min||a.range.max-l.range.max),r=Math.ceil(s.length/4),o=[];for(let a=0;a<s.length;a+=r){let l=s.slice(a,a+r),d=Math.min(...l.map(c=>c.range.min)),p=Math.max(...l.map(c=>c.range.max));o.push({id:`b${a}`,label:d===p?this.money(d):`${this.money(d)}\u2013${this.money(p)}`,keys:l.map(c=>c.key),min:d,max:p})}return o}buildPriceFilter(){if(!this.els.prices||!this.els.pricesSec)return;let e=this.priceBands();if(e.length<2)return;let t=document.createElement("select");t.className="sl-price-select",t.setAttribute("aria-label",this.tf("picker.filterAndFocusByPrice","Filter and focus seats by price")),t.innerHTML=`<option value="all">${this.tf("picker.allPrices","All prices")}</option>`+e.map(i=>`<option value="${i.id}">${i.label}</option>`).join(""),this.els.pricesSec.appendChild(t),t.addEventListener("change",()=>{let s=e.find(r=>r.id===t.value)?.keys??null;this.focusedCatKey=null,this.priceBandKeys=s?new Set(s):null,this.controller.setCategoryFilter(s),this.controller.focusCategoryFilter(s),this.pushAvailabilityTo3d(),this.syncFloors(),this.syncRung(),this.minimap?.refreshMinimap(),this.syncPrices(),this.lastSection&&this.showSectionCard(this.lastSection)})}buildArenaChrome(){let e=this.controller.doc;if(!e||!this.els.map)return;let t=e.objects.some(i=>i.type==="section")||(e.floors??[]).some(i=>i.objects.some(s=>s.type==="section"));if(this.canOffer3d()){let i=document.createElement("div");i.className="sl-projection",i.setAttribute("role","group"),i.setAttribute("aria-label",this.tf("picker.venueView","Venue view")),i.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>`,i.querySelectorAll("button").forEach(s=>{s.addEventListener("click",()=>{this.setBuyerView(s.dataset.view)})}),this.regions["top-right"].appendChild(i),this.projectionEl=i,this.syncProjection()}if(t){let i=[...e.objects,...(e.floors??[]).flatMap(p=>p.objects)],s=new Set((e.zones??[]).map(p=>p.id)),o=i.some(p=>p.type==="section"&&typeof p.zone=="string"&&s.has(p.zone))?["zones","sections","seats"]:["sections","seats"],a=document.createElement("div");a.className="sl-rungs on",a.setAttribute("role","group"),a.setAttribute("aria-label",(0,g.t)("picker.zoomLevel"));let l={zones:(0,g.t)("picker.rungLabel.zones"),sections:(0,g.t)("picker.rungLabel.sections"),seats:(0,g.t)("picker.rungLabel.seats")},d={zones:(0,g.t)("picker.rungTip.zones"),sections:(0,g.t)("picker.rungTip.sections"),seats:(0,g.t)("picker.rungTip.seats")};a.innerHTML=o.map(p=>`<button type="button" data-rung="${p}" title="${d[p]}" aria-pressed="false">${l[p]}</button>`).join(""),a.querySelectorAll("button").forEach(p=>{p.addEventListener("click",()=>{let c=p.dataset.rung;this.controller.setRung(c),c==="seats"&&this.collapseSectionCard()})}),this.regions["top-center"].appendChild(a),this.rungsEl=a,this.syncRung()}if(this.controller.isMultiFloor()){let i=this.controller.getFloors(),s=document.createElement("div");s.className="sl-floors on";let r=document.createElement("select");r.setAttribute("aria-label",this.tf("picker.chooseLevel","Choose level"));let o=document.createElement("option");o.value="",o.textContent=this.tf("picker.allFloors","All floors"),r.appendChild(o);for(let d of i){let p=document.createElement("option");p.value=d.id,p.textContent=d.name,r.appendChild(p)}r.addEventListener("change",()=>{r.value===""?this.controller.setFloorOverview(!0):this.controller.setFloor(r.value),this.showSectionCard(null),this.syncFloors(),this.syncRung(),this.minimap?.refreshMinimap()}),s.appendChild(r);let a=document.createElement("button");a.type="button",a.className="sl-floor-info",a.textContent="i";let l=this.tf("picker.floorHelp","All floors shows the complete venue. Choose one level to inspect and select its seats.");a.setAttribute("aria-label",l),a.title=l,s.appendChild(a),this.regions["left-rail"].appendChild(s),this.floorsEl=s,this.syncFloors()}}syncRung(){if(!this.rungsEl)return;let e=this.controller.getRung();this.rungsEl.querySelectorAll("button").forEach(t=>{let i=t.dataset.rung===e;t.classList.toggle("on",i),t.setAttribute("aria-pressed",String(i))})}syncProjection(){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||!Rt()?!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)?Xt/2:Xt}syncFloors(){if(!this.floorsEl)return;let e=this.controller.getActiveFloorId(),t=this.controller.isFloorOverview(),i=this.floorsEl.querySelector("select");i&&(i.value=t?"":e)}showSectionCard(e){if(this.lastSection=e,this.secCardEl?.remove(),this.secCardEl=null,!e){this.minimap?.refreshMinimap();return}this.secCardCollapsed=this.controller.getRung()==="seats",this.secCardShownAt=Date.now(),this.renderSectionCard(e),this.minimap?.refreshMinimap()}sectionNeighbours(e){let t=this.activeFloorObjects().filter(s=>s.type==="section"&&!this.controller.isSectionClosed(s.id)&&this.controller.getSectionSeatCount(s.id)>0);if(t.length<2)return null;let i=t.findIndex(s=>s.id===e);return i<0?null:{previous:t[(i-1+t.length)%t.length],next:t[(i+1)%t.length]}}wireSectionNavigation(e){e.querySelectorAll("[data-section-nav]").forEach(t=>{t.addEventListener("click",i=>{i.preventDefault(),i.stopPropagation();let s=t.dataset.sectionNav;s&&this.controller.focusSection(s)})})}renderSectionCard(e){if(!this.els.map)return;if(this.secCardEl?.remove(),this.root?.dataset.layout==="narrow"&&(this.hold||this.committedSelection().length||this.pendingGACount())){this.lastSection=null;return}let t=e.categories.length?e.categories.map(c=>{let h=this.controller.doc?.categories.find(f=>f.key===c.key);return h?this.catPriceRange(h):{min:c.priceMin,max:c.priceMax}}).filter(c=>c!=null):[{min:e.priceMin,max:e.priceMax}],i=Math.min(...t.map(c=>c.min)),s=Math.max(...t.map(c=>c.max)),r=i===s?this.money(i):`${this.money(i)}\u2013${this.money(s)}`,o=(0,g.tCount)("picker.seatsLeftInSection",e.seatsLeft),a=`<button type="button" class="sl-seccard-x" aria-label="${(0,g.t)("picker.closeSectionSummary")}">\u2715</button>`,l=Dt(this.sectionNeighbours(e.id)),d=document.createElement("div");if(this.root?.dataset.layout==="narrow")d.className="sl-seccard strip on",d.setAttribute("role","status"),d.setAttribute("aria-label",(0,g.t)("picker.sectionSummaryAria",{label:e.label})),d.innerHTML=`<span class="sl-seccard-dot" style="background:${e.color}"></span><span class="sl-seccard-name">${e.label}</span><span class="sl-seccard-left">${o}</span>`+(e.categories.length?`<span class="sl-seccard-price">${r}</span>`:"")+l+a,this.wireSectionNavigation(d),d.querySelector(".sl-seccard-x").addEventListener("click",()=>this.controller.overview()),(this.els.sheetHead??this.els.side??this.els.map).appendChild(d);else if(this.secCardCollapsed)d.className="sl-seccard mini on",d.setAttribute("role","button"),d.setAttribute("aria-label",(0,g.t)("picker.sectionSummaryAria",{label:e.label})),d.innerHTML=`<span class="sl-seccard-dot" style="background:${e.color}"></span><span class="sl-seccard-name">${e.label}</span><span class="sl-seccard-left">${o}</span>`+l+a,this.wireSectionNavigation(d),d.addEventListener("click",c=>{c.target.closest(".sl-seccard-x")||(this.secCardCollapsed=!1,this.secCardShownAt=Date.now(),this.renderSectionCard(e))}),d.querySelector(".sl-seccard-x").addEventListener("click",()=>this.controller.overview()),(this.regions["top-center"]??this.els.map).appendChild(d);else{d.className="sl-seccard on",d.setAttribute("role","dialog"),d.setAttribute("aria-label",(0,g.t)("picker.sectionSummaryAria",{label:e.label}));let c=e.categories.map(h=>{let f=this.priceBandKeys!=null&&!this.priceBandKeys.has(h.key),m=this.controller.doc?.categories.find(w=>w.key===h.key),v=m?this.catPriceRange(m):{min:h.priceMin,max:h.priceMax},k=v&&v.min!==v.max?`${this.money(v.min)}\u2013${this.money(v.max)}`:this.money(v?.min??h.price);return`<span class="sl-seccard-mix-item${f?" sl-dim":""}"><span class="sl-seccard-mix-dot" style="background:${h.color}"></span>${h.label} <span class="sl-seccard-mix-price">${k}</span></span>`}).join("");d.innerHTML=`<div class="sl-seccard-head"><span class="sl-seccard-dot" style="background:${e.color}"></span><span class="sl-seccard-name">${e.label}</span>`+(e.categories.length?`<span class="sl-seccard-price">${r}</span>`:"")+a+`</div><div class="sl-seccard-zone">${e.zoneLabel?`${e.zoneLabel} \xB7 `:""}<span class="sl-seccard-left">${o}</span></div>`+(e.entrance?`<div class="sl-seccard-entrance">${(0,g.t)("picker.entrance")} ${String(e.entrance).replace(/[&<>"]/g,h=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[h])}</div>`:"")+(c?`<div class="sl-seccard-mix">${c}</div>`:"")+`<div class="sl-seccard-foot"><button type="button" class="sl-seccard-overview">\u2190 ${(0,g.t)("picker.overview")}</button>`+l+`<span class="sl-seccard-hint">${(0,g.t)("picker.tapSeatHint")}</span></div>`,this.wireSectionNavigation(d),d.querySelector(".sl-seccard-x").addEventListener("click",()=>this.controller.overview()),d.querySelector(".sl-seccard-overview").addEventListener("click",()=>this.controller.overview()),(this.regions["top-center"]??this.els.map).appendChild(d)}this.secCardEl=d}collapseSectionCard(){!this.secCardEl||this.secCardCollapsed||!this.lastSection||this.root?.dataset.layout!=="narrow"&&(this.secCardCollapsed=!0,this.renderSectionCard(this.lastSection))}sectionCardOnView(){if(!(!this.secCardEl||this.secCardCollapsed||!this.lastSection)&&this.root?.dataset.layout!=="narrow"){if(this.controller.getRung()==="seats"){this.collapseSectionCard();return}if(Date.now()-this.secCardShownAt<1400){this.sectionCardCoverage()>.25&&this.collapseSectionCard();return}this.collapseSectionCard()}}sectionCardCoverage(){let e=this.secCardEl,t=this.lastSection;if(!e||!t||!this.els.map)return 0;let i=this.activeFloorObjects().find(w=>w.type==="section"&&w.id===t.id)?.outline;if(!i||i.length<3)return 0;let s=i.map(w=>this.controller.worldToScreen(w)),r=s.map(w=>w.x),o=s.map(w=>w.y),a=Math.min(...r),l=Math.min(...o),d=Math.max(...r)-a,p=Math.max(...o)-l;if(d<=0||p<=0)return 0;let c=this.els.map.getBoundingClientRect(),h=e.getBoundingClientRect(),f=h.left-c.left,m=h.top-c.top,v=Math.max(0,Math.min(f+h.width,a+d)-Math.max(f,a)),k=Math.max(0,Math.min(m+h.height,l+p)-Math.max(m,l));return v*k/(d*p)}announceSeat(e){if(!this.srEl)return;if(!e){this.srEl.textContent="";return}let t=this.controller.doc?.categories.find(h=>h.key===e.categoryKey),i=this.controller.getStatus(e.id)??"free",s=i==="free"?this.tf("picker.statusAvailable","available"):i==="held"?this.tf("picker.statusOnHold","on hold"):this.tf("picker.statusTaken2","taken"),r=t?this.catPriceRange(t):void 0,o=r?r.min===r.max?this.money(r.min):`${this.money(r.min)}\u2013${this.money(r.max)}`:void 0,a=this.controller.tableSelection(e.id),l=a??this.controller.seatDetails(e.id),d=this.rowTypeWord(l),p=l?.rowLabel??l?.displayLabel??e.displayLabel??e.label,c=a?`${d} ${p}, ${a.bookingMode==="variable"?(0,g.t)("picker.minToMaxGuests",{min:a.minOccupancy,max:a.maxOccupancy}):(0,g.t)("picker.capacityGuests",{count:a.capacity})}`:l?.objectType==="booth"?`${d} ${p}`:l?.objectType==="table"?`${d} ${p}, ${(0,g.t)("picker.seatNumberLower",{label:l.seatNumber??e.label})}`:(0,g.t)("picker.seatLabel",{label:l?.displayLabel??e.displayLabel??e.label});this.srEl.textContent=`${c}, ${t?.label??e.categoryKey}${o?`, ${o}`:""}, ${s}`}showTableDialog(e,t,i){this.dismissTableDialog(!1),this.tableDialog={...e},this.tableDialogHeld=t,this.tableDialogReturnFocus=i??document.activeElement;let s=d=>String(d??"").replace(/[&<>"']/g,p=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[p]),r=this.controller.doc?.categories.find(d=>d.key===e.categoryKey),o=e.bookingMode==="variable",a=this.rowTypeWord(e),l=document.createElement("div");l.className="sl-table-scrim",l.innerHTML=`<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">${s(o?(0,g.t)("picker.flexiblePartyTypeWord",{typeWord:a}):(0,g.t)("picker.wholeTypeWord",{typeWord:a}))}</div><h2 class="sl-table-title" id="sl-table-title">${s(e.displayLabel??e.label)}</h2><p class="sl-table-copy" id="sl-table-copy">${o?this.tf("picker.chooseGuestsCopy","Choose how many guests will sit together. This table is held exclusively for your party."):(0,g.t)("picker.allPlacesBookedTogether",{count:e.capacity})}</p></div><div class="sl-table-body"><div class="sl-table-summary"><span>${s(r?.label??e.categoryKey)}</span><b data-table-unit>${(0,g.t)("picker.perGuestPrice",{price:this.money(this.paidPrice(e.categoryKey,e.tierId??null,e.price))})}</b><span class="muted">${this.tf("picker.tableCapacity","Table capacity")}</span><span>${(0,g.t)("picker.guestsCount",{count:e.capacity})}</span><span class="muted">${this.tf("picker.total","Total")}</span><b data-table-total></b></div>`+(o?`<label class="sl-table-qtylabel" id="sl-table-qty-label">${this.tf("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="${this.tf("picker.fewerGuests","Fewer guests")}">\u2212</button><output aria-live="polite" data-table-qty>${e.quantity}</output><button type="button" data-table-step="1" aria-label="${this.tf("picker.moreGuests","More guests")}">+</button></div><div class="sl-table-range">${(0,g.t)("picker.chooseMinMaxGuests",{min:e.minOccupancy,max:e.maxOccupancy})}</div>`:`<input type="hidden" data-table-qty value="${e.capacity}">`)+`<div class="sl-table-actions"><button type="button" class="sl-table-cancel">${(0,g.t)("common.cancel")}</button><button type="button" class="sl-table-confirm">${t?this.tf("picker.updateTable","Update table"):o?this.tf("picker.selectTable","Select table"):this.tf("picker.selectWholeTable","Select whole table")}</button></div></div></section>`,this.root.appendChild(l),this.tableDialogEl=l,this.renderTableDialogState(),l.querySelectorAll("[data-table-step]").forEach(d=>{d.addEventListener("click",()=>{if(!this.tableDialog)return;let p=Math.max(this.tableDialog.minOccupancy,Math.min(this.tableDialog.maxOccupancy,this.tableDialog.quantity+Number(d.dataset.tableStep)));this.tableDialog={...this.tableDialog,quantity:p},this.renderTableDialogState()})}),l.querySelector(".sl-table-cancel").addEventListener("click",()=>this.cancelTableDialog()),l.querySelector(".sl-table-confirm").addEventListener("click",()=>{this.confirmTableDialog()}),l.addEventListener("mousedown",d=>{d.target===l&&this.cancelTableDialog()}),l.addEventListener("keydown",d=>{if(d.key!=="Tab")return;let p=[...l.querySelectorAll('button:not(:disabled),[tabindex]:not([tabindex="-1"])')];if(!p.length)return;let c=p[0],h=p[p.length-1];d.shiftKey&&document.activeElement===c?(d.preventDefault(),h.focus()):!d.shiftKey&&document.activeElement===h&&(d.preventDefault(),c.focus())}),requestAnimationFrame(()=>l.querySelector(o?'[data-table-step="-1"]':".sl-table-confirm")?.focus())}renderTableDialogState(){let e=this.tableDialog,t=this.tableDialogEl;if(!e||!t)return;let i=t.querySelector("output[data-table-qty]");i&&(i.value=String(e.quantity));let s=t.querySelector("input[data-table-qty]");s&&(s.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 r=this.paidPrice(e.categoryKey,e.tierId??null,e.price),o=t.querySelector("[data-table-total]");o&&(o.textContent=this.money(r*e.quantity))}async confirmTableDialog(){let e=this.tableDialog,t=this.tableDialogHeld;if(!e)return;let i=this.tableDialogEl?.querySelector(".sl-table-confirm");if(i&&(i.disabled=!0,i.textContent=t?this.tf("picker.updatingEllipsis","Updating\u2026"):this.tf("picker.selectingEllipsis","Selecting\u2026")),t){try{let s=await this.controller.replaceTableQuantity(e.label,e.quantity,this.opts.holdTtlMs);if(!s){this.toast(this.tf("picker.guestCountCouldNotBeSecured","That guest count could not be secured. Your current table hold is unchanged."),"warning"),this.renderTableDialogState(),i&&(i.disabled=!1,i.textContent=this.tf("picker.updateTable","Update table"));return}this.hold={holdId:s.holdId,expiresAt:s.expiresAt,seats:s.seats,items:s.items},this.startHoldTimer(s.expiresAt),this.dismissTableDialog(),this.syncTray(),this.emitHoldChange(),this.toast((0,g.t)("picker.tableUpdatedForGuests",{label:e.label,count:e.quantity}),"success")}catch(s){this.opts.onError?.(s),this.toast(this.tf("picker.guestCountNoLongerAvailable","That guest count is no longer available. Your current hold is unchanged."),"error"),i&&(i.disabled=!1,i.textContent=this.tf("picker.updateTable","Update table"))}return}if(!this.controller.setTableQuantity(e.label,e.quantity)){i&&(i.disabled=!1,i.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())}showConfirm(e){let t=this.confirmSeat?.id;this.confirmEl?.remove(),this.confirmEl=null,this.confirmSeat=e,this.root?.setAttribute("data-confirming","true"),this.els.side?.toggleAttribute("inert",!0),Object.values(this.regions).forEach(x=>x.toggleAttribute("inert",!0)),this.controller.setSelectionFocus(e.id),t&&t!==e.id&&this.controller.deselect([t]),this.tipEl&&(this.tipEl.style.display="none");let i=this.controller.seatDetails(e.id),s=this.controller.doc?.categories.find(x=>x.key===e.categoryKey),r=i?.price??(s?.tiers?.length?s.tiers[0].price:s?.price),o=r!=null?this.paidPrice(e.categoryKey,i?.tierId??s?.tiers?.[0]?.id??null,r):void 0,a=x=>String(x??"\u2014").replace(/[&<>"]/g,y=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[y]),l=[i?.sectionLabel?`<div class="sl-confirm-field"><span class="sl-confirm-key">${this.tf("picker.section","Section")}</span><span class="sl-confirm-value">${a(i.sectionLabel)}</span></div>`:"",i?.rowLabel||i?.objectType==="booth"?`<div class="sl-confirm-field"><span class="sl-confirm-key">${a(this.rowTypeWord(i))}</span><span class="sl-confirm-value">${a(te(i)??i?.displayLabel??e.displayLabel??e.label)}</span></div>`:"",i?.objectType!=="booth"?`<div class="sl-confirm-field"><span class="sl-confirm-key">${this.tf("picker.seat","Seat")}</span><span class="sl-confirm-value">${a(i?.seatNumber??i?.displayLabel??e.displayLabel??e.label)}</span></div>`:""].filter(Boolean).join(""),d=i?.tiers??s?.tiers??[],p=i?.tierId??d[0]?.id,c=x=>x.buyerMessage?.trim()||(x.restriction==="companion"?this.tf("picker.companionRequiresWheelchair","Requires the adjacent wheelchair place"):void 0),h=d.length>1?`<fieldset class="sl-confirm-tiers"><legend>${this.tf("picker.ticketType","Ticket type")}</legend>`+d.map(x=>{let y=c(x);return`<button type="button" class="sl-confirm-tier" data-confirm-tier="${a(x.id)}" aria-pressed="${x.id===p}"><span class="sl-confirm-tier-copy"><span class="sl-confirm-tier-name">${a(x.name)}</span>`+(y?`<small class="sl-confirm-tier-note">${a(y)}</small>`:"")+`</span><span class="sl-confirm-tier-price">${this.money(this.paidPrice(e.categoryKey,x.id,x.price))}</span></button>`}).join("")+"</fieldset>":d[0]&&c(d[0])?`<p class="sl-confirm-tier-note">${a(c(d[0]))}</p>`:"",f=this.buyerView==="venue3d",m=document.createElement("div");m.className="sl-confirm",m.setAttribute("role","dialog"),m.setAttribute("aria-label",(0,g.t)("picker.confirmSeatLabel",{label:e.label}));let v=s?.color??"#6e7bff",k=Ze(v,this.cssVar("--sl-surface")||"#1a2234",.76)??v;m.style.setProperty("--sl-cat",v),m.style.setProperty("--sl-cat-ink",Se(k,"#172033","#ffffff")),m.innerHTML='<div class="sl-confirm-grid">'+l+`</div><div class="sl-confirm-cat"><span class="sl-dot" style="background:${s?.color??"#6e7bff"}"></span><span class="sl-confirm-cat-name">${a(i?.categoryLabel??s?.label??e.categoryKey)}</span>`+(o!=null?`<span class="sl-confirm-price">${this.money(o)}</span>`:"")+'</div><div class="sl-confirm-body">'+h+Ft(i?.wheelchairSpaceType)+_t(e.commercial)+(this.seatViewEnabled()&&this.buyerView!=="venue3d"?this.confirmThumbHtml(e):"")+(f?`${Nt(e,`${i?.displayLabel??e.displayLabel??e.label} \xB7 ${o==null?this.tf("picker.priceNotSupplied","Price not supplied"):this.money(o)}`,f)}<div class="sl-confirm-inspect-row">${jt(e,f?this.view3dCompareSeatIds:null)}${st(this.canOffer3d(),f)}</div>`:st(this.canOffer3d(),f))+`<div class="sl-confirm-row"><button type="button" class="sl-confirm-cancel">${(0,g.t)("common.cancel")}</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>${this.tf("picker.select","Select")}</button></div></div>`,this.els.map.appendChild(m),this.confirmEl=m;let w=m.querySelector(".sl-confirm-thumb");if(w&&e.viewUrl){let x=e.viewMeta?.previewUrl??e.viewUrl;this.buyerAssetUrls.resolve(x).then(y=>{y&&m.isConnected&&this.confirmEl===m&&(w.src=y)}).catch(y=>this.opts.onError?.(y))}this.reanchorConfirm(),m.querySelector(".sl-confirm-view")?.addEventListener("click",()=>{this.openSeatView(e)}),m.querySelector(".sl-confirm-confidence")?.addEventListener("click",x=>{this.openSeatConfidencePassport(e,x.currentTarget instanceof HTMLElement?x.currentTarget:null)}),m.querySelector(".sl-confirm-compare")?.addEventListener("click",()=>this.saveView3dComparisonSeat(e)),m.querySelectorAll("[data-confirm-tier]").forEach(x=>{x.addEventListener("click",()=>{let y=x.dataset.confirmTier,E=d.find(b=>b.id===y);if(!E)return;this.controller.setSeatTier(e.id,E.id),m.querySelectorAll("[data-confirm-tier]").forEach(b=>{b.setAttribute("aria-pressed",String(b===x))});let u=m.querySelector(".sl-confirm-price");u&&(u.textContent=this.money(this.paidPrice(e.categoryKey,E.id,E.price))),this.reanchorConfirm()})}),m.querySelector(".sl-confirm-3d")?.addEventListener("click",()=>{this.buyerView==="venue3d"?(this.dismissConfirm(),this.view3dHandle?.flyToSeat(e.id)):(this.view3dReturnSeat=e,this.dismissConfirm(),this.enter3d(e.id))}),m.querySelector(".sl-confirm-add").addEventListener("click",()=>this.commitConfirm()),m.querySelector(".sl-confirm-cancel").addEventListener("click",()=>this.cancelConfirm()),requestAnimationFrame(()=>m.querySelector(".sl-confirm-add")?.focus())}reanchorConfirm(){if(!this.confirmEl||!this.confirmSeat||this.root?.dataset.view3d==="on")return;let e=this.controller.worldToScreen({x:this.confirmSeat.x,y:this.confirmSeat.y});if(this.root?.dataset.layout==="narrow")return;let t=this.els.map.clientWidth,i=this.els.map.clientHeight,s=this.confirmEl.offsetWidth||276,r=this.confirmEl.offsetHeight||230,o=s/2+12,a=Math.max(o,Math.min(t-o,e.x)),l=e.y+r+24<=i,d=e.y<r+24&&l;this.confirmEl.dataset.placement=d?"below":"above",this.confirmEl.style.left=`${a}px`,this.confirmEl.style.top=`${Math.max(8,Math.min(i-8,e.y))}px`}dismissConfirm(){this.confirmEl?.remove(),this.confirmEl=null,this.confirmSeat=null,this.root?.removeAttribute("data-confirming"),Object.values(this.regions).forEach(e=>e.toggleAttribute("inert",!1)),this.applyPanelCollapsed(),this.controller.setSelectionFocus(null)}commitConfirm(){this.confirmSeat&&(this.dismissConfirm(),this.collapseSectionCard(),this.syncTray(),this.syncSelectionTo3d())}cancelConfirm(){let e=this.confirmSeat;e&&(this.controller.deselect([e.id]),this.confirmSeat&&this.dismissConfirm(),this.syncSelectionTo3d(),this.root?.focus({preventScroll:!0}))}closeConfirm(){this.dismissConfirm()}seatViewEnabled(){return this.opts.seatView!==!1}allSeats(){if(!this.allSeatsCache){let e=this.controller.doc;this.allSeatsCache=e?(0,g.expandChart)(e):[]}return this.allSeatsCache}async openSeatView(e){if(!this.root||!this.seatViewEnabled())return;let t=++this.seatViewGen,i=this.controller.doc,s=this.controller.getActiveFloorId(),r=e.focalPoint??i?.floors?.find(c=>c.id===s)?.focalPoint??i?.focalPoint??{x:0,y:0},o,a,l=!1;if(e.viewUrl){let c,h=null;try{let m=e.viewMeta?.previewUrl;m&&m!==e.viewUrl?(h=await this.buyerAssetUrls.resolve(m),c=e.viewUrl):c=await this.buyerAssetUrls.resolve(e.viewUrl)}catch(m){t===this.seatViewGen&&this.opts.onError?.(m);return}if(t!==this.seatViewGen||!c||e.viewMeta?.previewUrl&&e.viewMeta.previewUrl!==e.viewUrl&&!h||!this.root||!this.seatViewEnabled())return;let f={url:c,...h?{previewUrl:h}:{},...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?.coverage?{coverage:e.viewMeta.coverage}:{},...e.viewMeta?.capturedAt?{capturedAt:e.viewMeta.capturedAt}:{},...e.viewMeta?.sourceLabel?{sourceLabel:e.viewMeta.sourceLabel}:{}};o=f,a=(0,Te.seatViewDisclosure)(f),l=(0,Te.isAuthoredSeatView)(f)}else{let c;try{let{generateSeatPanorama:h}=await $t();c=h(e,r,this.allSeats())}catch(h){t===this.seatViewGen&&this.opts.onError?.(h);return}if(t!==this.seatViewGen||!this.root||!this.seatViewEnabled())return;o={url:c.url,generated:!0},a=(0,g.t)("picker.illustrationCaption",{m:c.distanceM})}this.closeSeatView(!1);let d=(0,g.t)("picker.viewFromSeat",{label:e.label}),p=Ct({root:this.root,source:o,caption:a,real:l,closeLabel:this.tf("picker.close","Close"),dragHint:this.tf("picker.dragToLookAround","Drag to look around \xB7 scroll to zoom"),viewFromSeatLabel:d,real360Label:(0,g.t)("picker.real360"),previewLabel:(0,g.t)("picker.preview"),resolveAsset:c=>this.buyerAssetUrls.resolve(c),onClose:()=>this.closeSeatView()});this.viewEl=p.element,this.viewCleanup=()=>p.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;return t?t(e,this.currency):(0,g.formatMoney)(e,this.currency,{locale:this.opts.locale,fallback:(i,s)=>`${i} ${s}`})}scheduleOfferBoundary(e){if(this.offerBoundaryTimer&&clearTimeout(this.offerBoundaryTimer),this.offerBoundaryTimer=null,!this.api.availability||this.destroyed)return;let t=Date.now(),i=wt(e,t);if(i==null)return;let s=6*36e5,r=Math.min(Math.max(i-t+1e3,1e3),s);this.offerBoundaryTimer=setTimeout(()=>{this.offerBoundaryTimer=null,!document.hidden&&this.refreshOfferAvailability(!1)},r)}scheduleOfferRefresh(e){!this.api.availability||this.destroyed||(this.offerRefreshTimer&&clearTimeout(this.offerRefreshTimer),this.offerRefreshTimer=setTimeout(()=>{this.offerRefreshTimer=null,this.refreshOfferAvailability(e)},e?180:0))}async refreshOfferAvailability(e){if(!(!this.api.availability||this.destroyed))try{let t=await this.api.availability(this.opts.event,e);if(this.destroyed)return;let i=Ie(t);if(!i)return;this.offerAvailability=i,this.scheduleOfferBoundary(i);let s=ze(i),r={...this.hostPricing?.prices??{},...s},o=Object.keys(r).length>0||this.hostPricing?.formatter?{prices:r,...this.hostPricing?.formatter?{formatter:this.hostPricing.formatter}:{}}:void 0;this.setPricing(o),this.syncOffer(),this.opts.onOfferAvailabilityChange?.(i)}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}syncOffer(){let e=this.els.offer;if(!e)return;let t=this.offerAvailability,i=t?.release??null,s=i?null:t?.upcoming??null;if(!t||t.state==="closed"||t.state==="sold-out"||!i&&!s){e.classList.remove("has"),e.replaceChildren();return}let r=i??s,o=document.createElement("div");o.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=i?this.tf("picker.currentTicketOffer","Current ticket offer"):this.tf("picker.upcomingTicketOffer","Upcoming ticket offer");let d=document.createElement("strong");d.className="sl-offer-name",d.textContent=r.name||(i?this.tf("picker.currentOffer","Current offer"):this.tf("picker.scheduledOffer","Scheduled offer"));let p=document.createElement("span");p.className="sl-offer-line";let c=[];i&&t.fromPrice!=null&&c.push(this.money(t.fromPrice/100)),i&&r.remaining!=null&&c.push((0,g.t)("picker.offerRemainingAvailable",{count:r.remaining})),i&&r.endsAt!=null&&c.push((0,g.t)("picker.offerUntil",{time:De(r.endsAt,this.eventTimezone,this.opts.locale)})),s?.startsAt!=null&&c.push((0,g.t)("picker.offerStarts",{time:De(s.startsAt,this.eventTimezone,this.opts.locale)})),p.textContent=c.join(" \xB7 "),a.append(l,d,p);let h=document.createElement("details");h.className="sl-offer-info";let f=document.createElement("summary");f.setAttribute("aria-label",(0,g.t)("picker.howOfferWorks",{name:d.textContent??""})),f.textContent="i";let m=document.createElement("div");m.className="sl-offer-detail",m.textContent=i?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."),h.append(f,m),o.append(a,h),e.replaceChildren(o),e.classList.add("has")}paidPrice(e,t,i){let s=e?this.opts.pricing?.prices?.[e]:void 0;return s===void 0?i:typeof s=="number"?s:t&&s.tiers?.[t]!==void 0?s.tiers[t]:s.base??i}syncPrices(){let e=this.controller.doc;if(!e||!this.els.prices)return;let t=this.controller.categoryAvailability(),i=e.categories.filter(l=>!l.notForSale);this.narrateAvailability(i,t),this.syncSoldout(i,t);let s=5,r=i.length-s,o=r>1&&!this.pricesExpanded,a=o?i.slice(0,s):i;this.els.prices.classList.toggle("sl-expanded",r>1&&this.pricesExpanded),this.els.prices.innerHTML=a.map(l=>{let d=this.catPrice(l),p=this.catPriceRange(l),c=this.offerPrice(l.key),h=c?.previousPrice!=null&&c.previousPrice>c.price?c.previousPrice:null,f=this.focusedCatKey===l.key;return`<div class="sl-price-row${this.priceBandKeys!=null&&!this.priceBandKeys.has(l.key)?" sl-dim":""}${f?" sl-active":""}" data-cat="${z(l.key)}" role="button" tabindex="0" aria-pressed="${f}" title="${z(f?this.tf("picker.showAllSeats","Show all seats"):(0,g.t)("picker.showLabelSeatsOnMap",{label:l.label}))}"><span class="sl-dot" style="background:${z(l.color)}"></span><span class="sl-price-label">${z(l.label)}`+(c?.offerName?`<small class="sl-price-offer">${z(c.offerName)}</small>`:"")+`</span><span class="sl-price-left">${(0,g.tCount)("picker.leftCount",t[l.key]??0)}</span>`+(h!=null?`<span class="sl-price-was">${z(this.money(h))}</span>`:"")+(p!=null?`<span class="sl-price-amt">${p.min===p.max?this.money(p.min):`${this.money(p.min)}\u2013${this.money(p.max)}`}</span>`:d!=null?`<span class="sl-price-amt">${this.money(d)}</span>`:"")+"</div>"}).join("")+(r>1?`<button type="button" class="sl-price-more" aria-expanded="${!o}">`+(o?(0,g.t)("picker.showAllTicketTypes",{count:i.length}):this.tf("picker.showFewer","Show fewer"))+"</button>":"")+`<div class="sl-status-key" aria-label="${this.tf("picker.seatStatusLegend","Seat status legend")}"><span class="sl-status-item"><i class="sl-status-icon" aria-hidden="true"><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></i>${this.tf("picker.temporarilyHeld","Temporarily held")}</span><span class="sl-status-item"><i class="sl-status-icon sold" aria-hidden="true"><svg viewBox="0 0 24 24"><path d="M7 17L17 7"/></svg></i>${this.tf("picker.sold","Sold")}</span></div>`,this.els.prices.querySelectorAll(".sl-price-row").forEach(l=>{l.addEventListener("mouseenter",()=>this.controller.getRenderer()?.setCategoryHighlight?.(l.dataset.cat??null)),l.addEventListener("mouseleave",()=>this.controller.getRenderer()?.setCategoryHighlight?.(null));let d=()=>this.focusCategory(l.dataset.cat??"");l.addEventListener("click",d),l.addEventListener("keydown",p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),d())})}),this.els.prices.querySelector(".sl-price-more")?.addEventListener("click",()=>{this.pricesExpanded=!this.pricesExpanded,this.syncPrices()})}focusCategory(e){if(!e)return;let t=this.focusedCatKey===e?null:e;this.focusedCatKey=t,this.priceBandKeys=t?new Set([t]):null;let i=this.els.pricesSec?.querySelector(".sl-price-select");i&&(i.value="all"),this.controller.setCategoryFilter(t?[t]:null),this.controller.focusCategoryFilter(t?[t]:null),this.pushAvailabilityTo3d(),this.syncFloors(),this.syncRung(),this.minimap?.refreshMinimap(),this.syncPrices(),this.lastSection&&this.showSectionCard(this.lastSection)}narrateAvailability(e,t){let i=this.els.liveText,s=this.lastCatAvail;this.lastCatAvail={...t};let r=this.controller.getActiveFloorId();if(r!==this.lastAvailFloorId&&(this.lastAvailFloorId=r,this.availQuietUntil=performance.now()+2e3),!(!i||!s||performance.now()<this.availQuietUntil))for(let o of e){let a=s[o.key],l=t[o.key]??0;if(a===void 0||l>=a)continue;let d=a-l;i.textContent=(0,g.tCount)("picker.seatsJustTakenInCategory",d,{label:o.label,left:l}),this.els.live?.classList.remove("on"),this.els.live?.offsetWidth,this.els.live?.classList.add("on"),this.liveTimer&&clearTimeout(this.liveTimer),this.liveTimer=setTimeout(()=>this.els.live?.classList.remove("on"),8e3);return}}evictTakenSelections(){let e=new Set([...this.controller.currentHold()?.labels??[],...this.holdingLabels]),t=this.controller.getSelection().filter(i=>!e.has(i.label)&&(this.controller.getStatus(i.id)??"free")!=="free");t.length&&(this.controller.deselect(t.map(i=>i.id)),this.toast((0,g.t)("picker.seatJustTakenByAnother",{label:t[0].label}),"error"))}syncTray(){if(!this.els.tray)return;this.updateSelectionCapacity();let e=this.committedSelection();this.root?.dataset.layout==="narrow"&&this.secCardEl&&(this.hold||e.length||this.pendingGACount())&&(this.secCardEl.remove(),this.secCardEl=null,this.lastSection=null);let t=this.controller.getGAAreas(),i=this.hold?.items??[],s=[],r=new Set;if(this.salesClosed&&!e.length&&!i.length){let u=this.eventWhenText?`<span class="when">${String(this.eventWhenText).replace(/[&<>"]/g,b=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[b])}</span>`:"";s.push(`<div class="sl-closed-note" role="status"><b>${this.tf("picker.salesClosedPill","Sales are closed")}</b><span>${this.tf("picker.salesClosedCopy","Ticket sales for this event have ended.")}${u}</span></div>`)}else!e.length&&!i.length&&!t.length?s.push(`<div class="sl-tray-hint">${this.tf("picker.trayHintTapOrBest","Tap a seat on the map, or let us pick the best available for you.")}</div>`):!e.length&&!i.length&&s.push(`<div class="sl-tray-hint">${this.tf("picker.trayHintTapOrStanding","Tap a seat on the map \u2014 or grab standing tickets below.")}</div>`);let o=!e.length&&!i.length&&!this.pendingGACount();if(o&&(this.baReopen=!1),!this.salesClosed&&!this.hold&&(o||this.baReopen||this.bestAvailableBusy||this.bestAvailableConfirm)){let u=(this.controller.doc?.categories??[]).filter(S=>!S.notForSale),b=this.controller.getBestAvailableZones();this.baZone&&!b.some(S=>S.id===this.baZone)&&(this.baZone=""),s.push(this.bestAvailableConfirm?`<div class="sl-ba" role="alert"><div class="sl-ba-title"><span class="spark" aria-hidden="true">\u2726</span>${this.tf("picker.replaceCurrentChoices","Replace your current choices?")}</div><div class="sl-ba-replace"><b>${(0,g.t)("picker.willFindSeatsTogether",{count:this.baQty})}</b><span>${this.tf("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>${this.tf("picker.keepMine","Keep mine")}</button><button type="button" class="replace" data-ba-replace>${this.tf("picker.findNewSeats","Find new seats")}</button></div></div>`:`<div class="sl-ba"><div class="sl-ba-title"><span class="spark" aria-hidden="true">\u2726</span>${this.tf("picker.findBestSeatsTogether","Find the best seats together")}</div><div class="sl-ba-copy"><span class="wide">${this.tf("picker.willChooseClosestGroup","We\u2019ll choose the closest available group for you.")}</span><span class="narrow">${this.tf("picker.closestGroupChosenInstantly","Closest available group, chosen instantly.")}</span></div>`+(this.controller.hasPremiumSeats()?`<button type="button" class="sl-ba-premium${this.baPremium?" on":""}" data-ba-premium aria-pressed="${this.baPremium?"true":"false"}"><span class="star" aria-hidden="true">\u2605</span>${this.tf("picker.bestSeatsPremium","Best seats")}</button>`:"")+(u.length>1?`<select aria-label="${this.tf("picker.preferredTicketType","Preferred ticket type")}" data-ba-cat><option value="">${this.tf("picker.anyTicketType","Any ticket type")}</option>`+u.map(S=>`<option value="${S.key}"${this.baCat===S.key?" selected":""}>${S.label}</option>`).join("")+"</select>":'<span aria-hidden="true"></span>')+(b.length?`<select aria-label="${this.tf("picker.preferredVenueZone","Preferred venue zone")}" data-ba-zone><option value="">${this.tf("picker.anyVenueZone","Any venue zone")}</option>`+b.map(S=>`<option value="${z(S.id)}"${this.baZone===S.id?" selected":""}>${z(S.label)}</option>`).join("")+"</select>":"")+`<div class="sl-ba-qty"><button type="button" data-ba="-1" aria-label="${this.tf("picker.fewerSeats","Fewer seats")}">\u2212</button><span>${this.baQty}</span><button type="button" data-ba="1" aria-label="${this.tf("picker.moreSeats","More seats")}">+</button></div><button type="button" class="sl-ba-go${this.bestAvailableBusy?" sl-busy":""}"${this.bestAvailableBusy?" disabled":""}>`+(this.bestAvailableBusy?`<span class="sl-ba-spin" aria-hidden="true"></span>${this.tf("picker.findingBestSeats","Finding the best seats\u2026")}`:(0,g.tCount)("picker.findBestSeatsCount",this.baQty))+"</button>"+(this.baReopen?`<button type="button" class="sl-ba-back" data-ba-close>${this.tf("picker.keepMyPicks","Keep my picks")}</button>`:"")+"</div>")}let a=(u,b,S,A=1,H,L)=>Kt({d:u?this.controller.seatDetails(u):null,area:S==="ga"?t.find(P=>P.id===H):void 0,label:b,objectType:S,quantity:A,identity:L}),l=Wt;for(let u of i){let b=`held:${u.label}`;r.add(b);let S=this.controller.doc?.categories.find(j=>j.key===u.categoryKey),A=u.tierId?S?.tiers?.find(j=>j.id===u.tierId)?.name:void 0,H=u.objectType!=="ga"?this.controller.seatByLabel(u.label):null,L=u.objectType==="table"?this.controller.tableSelection(u.label):null,P=this.seatViewEnabled()&&!!H&&u.objectType!=="table";s.push(`<div class="sl-chip sl-held${this.lastTrayKeys.has(b)?"":" sl-enter"}" data-key="${b}" data-held="${encodeURIComponent(u.label)}"${H?` data-locate="${H.id}"`:""}><div class="sl-chip-main">`+a(H?.id??null,u.label,u.objectType,u.quantity??1,u.objectId,L??void 0)+`<div class="sl-chip-sub"><span class="sl-ticket-state held" aria-label="${this.tf("picker.heldForYou","Held for you")}" title="${this.tf("picker.heldForYou","Held for you")}"><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><span class="cat">${S?.label??u.categoryKey}${A?` \xB7 ${A}`:""}</span>`+(L?.bookingMode==="variable"?`<button type="button" class="sl-table-edit" data-table-edit="${encodeURIComponent(u.label)}">${(0,g.t)("picker.guestsCountEdit",{count:u.quantity??1})}</button>`:"")+it(H?.wheelchairSpaceType)+tt(H?.commercial)+`<span class="amt">${this.money(this.paidPrice(u.categoryKey,u.tierId,u.unitPrice)*(u.quantity??1))}</span></div></div>`+l((0,g.t)("picker.removeHeldTicketLabel",{label:u.label}),P?u.label:null)+"</div>")}let d=new Set(i.map(u=>u.label)),p=this.seatViewEnabled();for(let u of e.filter(b=>!d.has(b.label))){let b=`seat:${u.id}`;r.add(b);let S=this.controller.doc?.categories.find(P=>P.key===u.categoryKey),A=u.tiers&&u.tiers.length?`<select class="tier" data-tier="${u.id}" aria-label="${(0,g.t)("picker.ticketTierFor",{label:u.label})}">`+u.tiers.map(P=>`<option value="${P.id}"${P.id===u.tierId?" selected":""}>${P.name} \xB7 ${this.money(this.paidPrice(u.categoryKey,P.id,P.price))}</option>`).join("")+"</select>":"",H=u.tiers?.find(P=>P.id===u.tierId)??u.tiers?.[0],L=H?.buyerMessage?.trim()||(H?.restriction==="companion"?this.tf("picker.companionRequiresWheelchair","Requires the adjacent wheelchair place"):"");s.push(`<div class="sl-chip${this.lastTrayKeys.has(b)?"":" sl-enter"}" data-key="${b}" data-seat="${u.id}" data-locate="${u.id}"><div class="sl-chip-main">`+a(u.id,u.label,u.objectType,u.quantity??1,u.objectId,u)+`<div class="sl-chip-sub"><span class="sl-ticket-state" aria-label="${this.tf("picker.selected","Selected")}" title="${this.tf("picker.selected","Selected")}"><svg viewBox="0 0 24 24"><path d="M5 12l4 4L19 6"/></svg></span><span class="cat">${S?.label??u.categoryKey}</span>`+(u.objectType==="table"&&u.bookingMode==="variable"?`<button type="button" class="sl-table-edit" data-table-edit="${encodeURIComponent(u.label)}">${(0,g.t)("picker.guestsCountEdit",{count:u.quantity??1})}</button>`:"")+`${it(u.wheelchairSpaceType)}${tt(u.commercial)}${A}<span class="amt">${this.money(this.paidPrice(u.categoryKey,u.tierId??null,u.price)*(u.quantity??1))}</span></div>`+(L?`<small class="sl-tier-note">${z(L)}</small>`:"")+"</div>"+l((0,g.t)("picker.removeSeatLabel",{label:u.label}),p&&u.objectType!=="table"?u.label:null)+"</div>")}for(let u of t){let b=this.gaQty.get(u.id)??0;s.push(`<div class="sl-ga" data-ga="${u.id}"><div class="sl-ga-info"><div class="sl-ga-name">${u.displayLabel??u.label}</div><div class="sl-ga-sub">${u.displayType??this.tf("picker.generalAdmission","General admission")} \xB7 ${this.money(this.paidPrice(u.categoryKey,null,u.price))} \xB7 ${(0,g.tCount)("picker.leftCount",u.available)}</div></div><div class="sl-ga-qty"><button type="button" data-d="-1" aria-label="${this.tf("picker.fewer","Fewer")}">\u2212</button><span>${b}</span><button type="button" data-d="1" aria-label="${this.tf("picker.more","More")}">+</button></div></div>`)}!this.salesClosed&&!this.hold&&!o&&!this.baReopen&&!this.bestAvailableBusy&&!this.bestAvailableConfirm&&s.push(`<button type="button" class="sl-ba-reopen" data-ba-reopen><span aria-hidden="true">\u2726</span>${this.tf("picker.findTogetherInstead","Find seats together instead")}</button>`),this.els.tray.innerHTML=s.join(""),this.lastTrayKeys=r,this.els.tray.querySelectorAll("[data-ba]").forEach(u=>{u.addEventListener("click",()=>{this.baQty=Math.max(1,Math.min(this.maxTickets,this.baQty+Number(u.dataset.ba))),this.syncTray()})}),this.els.tray.querySelector("[data-ba-cat]")?.addEventListener("change",u=>{this.baCat=u.target.value}),this.els.tray.querySelector("[data-ba-zone]")?.addEventListener("change",u=>{this.baZone=u.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-reopen]")?.addEventListener("click",()=>{this.baReopen=!0,this.syncTray(),this.els.tray.querySelector(".sl-ba-go")?.focus()}),this.els.tray.querySelector("[data-ba-close]")?.addEventListener("click",()=>{this.baReopen=!1,this.syncTray(),this.els.tray.querySelector("[data-ba-reopen]")?.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(u=>{u.addEventListener("click",()=>{let b=u.closest(".sl-chip");if(b.dataset.held){this.removeHeldLabel(decodeURIComponent(b.dataset.held),b);return}let S=b.dataset.seat,A=this.controller.getSelection().find(L=>L.id===S)?.label??this.tf("picker.seat","Seat"),H=()=>{this.controller.deselect([S]),this.toast((0,g.t)("picker.labelRemoved",{label:A}),"neutral",{label:this.tf("picker.undo","Undo"),onClick:()=>{let L=this.controller.select([S]);this.toast(L.length?(0,g.t)("picker.labelRestored",{label:A}):(0,g.t)("picker.labelNoLongerAvailable",{label:A}),L.length?"success":"warning")}})};if(this.reducedMotion()){H();return}b.classList.add("sl-leave"),this.scheduleMotion(H,150)})}),this.els.tray.querySelectorAll("[data-table-edit]").forEach(u=>{u.addEventListener("click",b=>{b.stopPropagation();let S=decodeURIComponent(u.dataset.tableEdit??""),A=this.controller.tableSelection(S);if(!A)return;let H=i.find(L=>L.label===S&&L.objectType==="table");this.showTableDialog({...A,quantity:H?.quantity??A.quantity},!!H,u)})}),this.els.tray.querySelectorAll(".sl-chip .tier").forEach(u=>{u.addEventListener("change",()=>this.controller.setSeatTier(u.dataset.tier,u.value||null))}),this.els.tray.querySelectorAll(".sl-chip .view[data-view-label]").forEach(u=>{u.addEventListener("click",()=>{let b=this.controller.seatByLabel(u.dataset.viewLabel);b&&this.openSeatView(b)})}),this.els.tray.querySelectorAll(".sl-chip[data-locate]").forEach(u=>{let b=()=>this.controller.flashSeat(u.dataset.locate,this.cssVar("--sl-accent")||"#f4b740");u.addEventListener("mouseenter",b),u.addEventListener("focusin",b)}),this.els.tray.querySelectorAll(".sl-ga button").forEach(u=>{u.addEventListener("click",()=>{let S=u.closest(".sl-ga").dataset.ga,A=t.find(P=>P.id===S),H=Number(u.dataset.d);if(H>0&&!this.canAddTicket())return;let L=Math.max(0,Math.min(A?.available??0,(this.gaQty.get(S)??0)+H));this.gaQty.set(S,L),this.syncTray()})}),this.salesClosed&&this.els.tray.querySelectorAll(".sl-ba-go,[data-ba],[data-ba-cat],[data-ba-zone],[data-ba-replace],.sl-ga button").forEach(u=>{u.disabled=!0});let c=this.pendingGATotal(t),h=this.pendingGACount(),f=i.reduce((u,b)=>u+this.paidPrice(b.categoryKey,b.tierId,b.unitPrice)*(b.quantity??1),0),m=i.reduce((u,b)=>u+(b.quantity??1),0),v=e.filter(u=>!d.has(u.label)),k=v.reduce((u,b)=>u+this.paidPrice(b.categoryKey,b.tierId??null,b.price)*(b.quantity??1),0)+c+f,w=v.reduce((u,b)=>u+(b.quantity??1),0)+h+m,x=this.pendingSelectionCount(),y=this.lastTrayCount,E=this.lastTrayTotal;if(this.els.count.textContent=w?(0,g.tCount)("picker.ticketsCount",w):this.tf("picker.noSeatsSelected","No seats selected"),this.els.total.textContent=w?this.money(k):"",this.root?.setAttribute("data-has-selection",String(w>0)),this.root?.setAttribute("data-ba-active",String(this.bestAvailableConfirm||this.bestAvailableBusy||this.baReopen)),this.els.foot?.classList.toggle("empty",w===0),this.els.seatSummary&&(this.els.seatSummary.textContent=w?(0,g.tCount)("picker.seatsSelectedCount",w):""),this.syncCta(w,x),this.hold){let u=m||this.hold.seats?.length||0;this.els.holdTitle&&(this.els.holdTitle.textContent=(0,g.t)("picker.securedCount",{count:u})),this.els.holdCopy&&(this.holdCopyPending=x>0,this.els.holdCopy.textContent=x?(0,g.t)("picker.moreSelectedCount",{count:x}):ot(this.holdExpiresAt));let b=this.els.holdChange;b&&(b.disabled=this.releasingHold,b.textContent=this.releasingHold?this.tf("picker.releasingEllipsis","Releasing\u2026"):this.tf("picker.change","Change"))}w!==y&&this.animateOnce(this.els.count,"sl-value-pop",380),k!==E&&this.animateOnce(this.els.total,"sl-value-pop",380),y===0&&w>0&&(this.animateOnce(this.els.cta,"sl-ready",520),this.sideCollapsed&&this.root?.dataset.layout!=="narrow"&&this.setPanelCollapsed(!1)),this.renderPeek(w,k,x),this.lastTrayCount=w,this.lastTrayTotal=k,this.opts.onSelectionChange?.(e),this.emitExactSelectionValidity(w,e)}emitExactSelectionValidity(e,t){let i=this.exactTickets;if(i==null)return;let s={isValid:e===i,count:e,required:i,remaining:Math.max(0,i-e),seats:t};this.opts.onSelectionValidityChange?.(s),s.isValid?this.lastExactSelectionValidity!==!0&&this.opts.onSelectionValid?.(t):this.lastExactSelectionValidity!==!1&&this.opts.onSelectionInvalid?.(s),this.lastExactSelectionValidity=s.isValid}renderPeek(e,t,i){if(!this.els.peek)return;let s=(this.controller.doc?.categories??[]).map(r=>this.catPrice(r)).filter(r=>r!=null);this.els.peek.innerHTML=Gt({count:e,total:t,pendingCount:i,ctaPhase:this.ctaPhase,hasHold:!!this.hold,salesClosed:this.salesClosed,fromPrice:s.length?Math.min(...s):null,money:r=>this.money(r)})}async removeHeldLabel(e,t){if(!e||this.releasingLabels.has(e))return!1;this.releasingLabels.add(e),t?.setAttribute("aria-busy","true");let i=t?.querySelector(".rm");i&&(i.disabled=!0);try{let s=this.handedOff;if(!await this.controller.releaseLabels([e]))return this.toast((0,g.t)("picker.couldNotRemoveLabel",{label:e}),"error"),!1;let o=this.controller.currentHold();return this.hold=o?{holdId:o.holdId,expiresAt:o.expiresAt,seats:o.seats,items:o.items}:null,this.handedOff=!!this.hold&&s,this.bookedShown=!1,this.ctaPhase="idle",this.hold?this.startHoldTimer(this.hold.expiresAt):(this.stopHoldTimer(),this.forgetHold()),this.syncTray(),this.emitHoldChange(),this.toast((0,g.t)("picker.labelRemovedFromHold",{label:e}),"success"),!0}finally{this.releasingLabels.delete(e),t?.removeAttribute("aria-busy"),i?.isConnected&&(i.disabled=!1)}}async handleChangeSeats(){if(!this.hold||this.releasingHold)return;this.releasingHold=!0;let e=this.els.holdChange;e&&(e.disabled=!0,e.textContent=this.tf("picker.releasingEllipsis","Releasing\u2026"));try{await this.release(),this.hold||this.toast(this.tf("picker.heldTicketsReleased","Held tickets released. Choose your new seats."),"success")}finally{this.releasingHold=!1,e?.isConnected&&(e.disabled=!1,e.textContent=this.tf("picker.change","Change"))}}async handleCta(){if(this.salesClosed)return;if(this.exactTickets!=null&&this.totalTicketCount()!==this.exactTickets){let t=Math.max(0,this.exactTickets-this.totalTicketCount());this.toast(t>0?(0,g.t)("picker.selectExactMore",{count:t}):(0,g.t)("picker.selectExactCount",{count:this.exactTickets}),"warning");return}if(this.totalTicketCount()>this.maxTickets){this.toast((0,g.t)("picker.removeTicketsUntilOrFewer",{count:this.maxTickets}),"warning");return}let e=this.committedSelection();if(this.hold&&!e.some(t=>!(this.hold.items??[]).some(i=>i.label===t.label))){let t=this.hold.seats??e;this.handedOff=!0,this.setCtaPhase("checkout"),this.checkoutHandoff(this.hold,t);return}this.holdingLabels=new Set(e.map(t=>t.label)),this.setCtaPhase("holding");try{let t=null,i=[...this.gaQty.entries()].filter(([,r])=>r>0),s=this.committedSelection();if(s.length){let r=await this.controller.hold(void 0,this.opts.holdTtlMs);t=r?{holdId:r.holdId,expiresAt:r.expiresAt,seats:r.seats,items:r.items}:null}for(let[r,o]of i){let a=await this.controller.holdGA(r,o,{ttlMs:this.opts.holdTtlMs});t=a?{holdId:a.holdId,expiresAt:a.expiresAt,seats:a.seats,items:a.items}:t}if(!t){this.toast(this.tf("picker.seatsJustTaken","One or more seats were just taken. Please pick again."),"error"),this.setCtaPhase("idle"),this.syncTray();return}this.hold=t,this.handedOff=!0,this.startHoldTimer(t.expiresAt),this.flashHeldSeats(t),this.setCtaPhase("checkout"),this.emitHoldChange(),this.checkoutHandoff(t,t.seats??s)}catch(t){this.opts.onError?.(t);let i=t,s=(i.conflicts??[]).map(o=>o.label).filter(Boolean).slice(0,3);i.reason==="event_closed"&&this.setSalesClosed(!0);let r=i.reason==="event_closed"?this.tf("picker.seatSalesClosedForEvent","Seat sales have closed for this event."):i.reason==="companion_pair_required"?this.tf("picker.companionPairRequired","Select the adjacent wheelchair place with each companion ticket."):i.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,g.t)("picker.labelsNoLongerAvailable.one",{labels:s.join(", ")}):(0,g.t)("picker.labelsNoLongerAvailable.other",{labels:s.join(", ")}):this.tf("picker.seatsJustTaken","One or more seats were just taken. Please pick again.");this.toast(r,"error"),this.setCtaPhase("idle")}finally{this.holdingLabels.clear(),this.ctaPhase==="holding"&&(this.ctaPhase="idle"),this.syncTray()}}startHoldTimer(e){this.stopHoldTimer(),this.holdExpiresAt=e,this.hold&&this.rememberHold(this.hold);let t=this.els.hold;t.innerHTML=`<span class="sl-hold-dot" aria-hidden="true"></span><span>${this.tf("picker.held","Held")}</span><span class="sl-hold-time" data-ref="holdTime"></span>`;let i=t.querySelector('[data-ref="holdTime"]');this.els.holdNote?.classList.add("on");let s=()=>{let r=Math.max(0,this.holdExpiresAt-Date.now());i&&(i.textContent=nt(r)),!this.holdCopyPending&&this.els.holdCopy&&(this.els.holdCopy.textContent=ot(this.holdExpiresAt)),t.classList.add("on"),t.classList.toggle("is-expiring",r>0&&r<=Yt),this.setExtendPrompt(r>0&&r<=Yt,r),r<=0&&this.stopHoldTimer()};s(),this.holdTimer=setInterval(s,500)}stopHoldTimer(){this.holdTimer&&clearInterval(this.holdTimer),this.holdTimer=null,this.els.hold?.classList.remove("on","is-expiring"),this.els.holdNote?.classList.remove("on"),this.setExtendPrompt(!1,0)}setExtendPrompt(e,t){if(this.extendEl)if(e&&this.controller.currentHold()&&!this.bookedShown){let i=Math.ceil(t/1e3),s=Math.floor(i/60),r=String(i%60).padStart(2,"0");this.els.extendTxt.innerHTML=(0,g.t)("picker.seatsHeldForNeedMoreTime",{time:`${s}:${r}`}),this.extendEl.classList.add("on")}else this.extendEl.classList.remove("on")}async handleExtend(){let e=this.els.extendBtn;e.disabled=!0;let t=e.textContent;e.textContent=this.tf("picker.addingEllipsis","Adding\u2026");try{let i=await this.controller.extendHold(this.opts.holdTtlMs);i?(this.hold={holdId:i.holdId,expiresAt:i.expiresAt,seats:i.seats,items:i.items},this.holdExpiresAt=i.expiresAt,this.extendEl?.classList.remove("on"),this.rememberHold(this.hold),this.emitHoldChange(),this.toast(this.tf("picker.moreTimeAdded","More time added \u2014 your seats are still held."),"success")):this.toast(this.tf("picker.couldNotAddMoreTime","Couldn't add more time \u2014 please head to checkout now."),"warning")}catch(i){this.opts.onError?.(i),this.toast(this.tf("picker.couldNotAddMoreTime","Couldn't add more time \u2014 please head to checkout now."),"warning")}finally{e.disabled=!1,e.textContent=t}}detectBooked(){this.bookedShown||!this.handedOff||!this.hold||this.controller.currentHold()===null&&this.showBooked()}showBooked(){if(this.bookedShown||!this.hold)return;this.bookedShown=!0;let e=this.buildHandoff(this.hold);this.stopHoldTimer(),this.forgetHold();let t=e.lineItems.reduce((i,s)=>i+s.quantity,0);this.els.bookedSub&&(this.els.bookedSub.innerHTML=`<span class="sl-booked-seats">${(0,g.tCount)("picker.ticketsCount",t)}</span> ${this.tf("picker.confirmedAndOnWay","confirmed. A confirmation is on its way.")}`),this.bookedEl?.classList.add("on"),this.opts.onBooked?.(e)}checkoutHandoff(e,t){if(this.checkoutMode==="hosted"){this.startHostedCheckout(e,t);return}this.opts.onCheckout?.(e,t,this.buildHandoff(e))}async startHostedCheckout(e,t){let i=this.buildHandoff(e),s=null;try{s=await(this.paymentOptions??=this.pubApi.paymentOptions(this.opts.event))}catch(o){this.opts.onError?.(o)}if(this.destroyed)return;let r=s?.providers?.[0];if(!r){let o=zt(s?.reason),a=!!this.opts.onCheckoutUnavailable||!!this.opts.onCheckout;this.opts.onCheckoutUnavailable?.({reason:o,handoff:i}),this.opts.onCheckout?.(e,t,i),a||this.openCheckoutPanel({kind:"unavailable",reason:o,seatCount:i.lineItems.reduce((l,d)=>l+d.quantity,0)});return}await this.openCheckoutPanel({kind:"pay",provider:r,order:{holdId:i.holdId,expiresAt:i.expiresAt,currency:i.currency,total:i.total,labels:i.lineItems.map(o=>o.displayLabel??o.label)}})}async openCheckoutPanel(e){let t;try{({mountCheckout:t}=await It())}catch(i){this.opts.onError?.(i),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,formatMoney:i=>this.money(i),startSession:i=>this.pubApi.startCheckout(this.opts.event,{...i,...this.opts.returnUrl?{returnUrl:this.opts.returnUrl}:{}}),orderStatus:i=>this.pubApi.orderStatus(i),onCancel:()=>{this.checkoutPanel=null,this.hold||this.setCtaPhase("idle")},onConfirmed:i=>{this.opts.onOrderConfirmed?.(i),this.controller.refresh()},onError:i=>this.opts.onError?.(i)}))}closeCheckoutPanel(){this.checkoutPanel?.destroy(),this.checkoutPanel=null}buildHandoff(e){let i=(e.items??[]).map(o=>{let a=this.controller.lineItemDisplay(o);return{label:o.label,...a.displayLabel?{displayLabel:a.displayLabel}:{},...a.displayType?{displayType:a.displayType}:{},objectId:o.objectId,objectType:o.objectType,categoryKey:o.categoryKey,tierId:o.tierId,unitPrice:this.paidPrice(o.categoryKey,o.tierId,o.unitPrice),currency:o.currency??this.currency,quantity:o.quantity??1}}),s=i[0]?.currency??this.currency,r=i.reduce((o,a)=>o+a.unitPrice*a.quantity,0);return{holdId:e.holdId,expiresAt:e.expiresAt,currency:s,lineItems:i,total:r}}emitHoldChange(){let e=this.hold;this.scheduleOfferRefresh(!0),this.opts.onHoldChange?.(e,e?.seats??[],e?this.buildHandoff(e):null)}toast(e,t="neutral",i){let s=this.els.toast;if(!s)return;s.replaceChildren();let r=document.createElement("span");if(r.textContent=e,s.appendChild(r),s.classList.toggle("has-action",!!i),i){let o=document.createElement("button");o.type="button",o.className="sl-toast-action",o.textContent=i.label,o.addEventListener("click",i.onClick,{once:!0}),s.appendChild(o)}s.dataset.tone=t,s.classList.add("on"),this.toastTimer&&clearTimeout(this.toastTimer),this.toastTimer=setTimeout(()=>{s.classList.remove("on"),s.classList.remove("has-action"),s.dataset.tone="neutral"},4200)}placeTooltip(){if(!this.tipEl)return;let e=this.els.map.clientWidth,t=this.tipEl.offsetWidth,i=this.tipEl.offsetHeight,s=this.tipPos.x+14,r=this.tipPos.y-i-12;s+t>e-8&&(s=this.tipPos.x-t-14),r<8&&(r=this.tipPos.y+18),this.tipEl.style.left=`${Math.max(8,s)}px`,this.tipEl.style.top=`${Math.max(8,r)}px`}rowTypeWord(e){let t=e?.displayType?.trim()||e?.rowType?.trim();return t||(e?.objectType==="table"?this.tf("picker.table","Table"):e?.objectType==="booth"?this.tf("picker.booth","Booth"):this.tf("picker.row","Row"))}updateTooltip(e){if(!this.tipEl)return;if(!e){this.tipEl.style.display="none";return}let t=m=>String(m??"\u2014").replace(/[&<>"]/g,v=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[v]),i=this.money(this.paidPrice(e.categoryKey,e.tierId??null,e.price)),s=e.objectType==="table"&&!!e.bookingMode,r=e.objectType==="booth",o=e.sectionLabel||e.rowLabel||e.seatNumber,a=s?`<div class="sl-tip-grid"><div class="sl-tip-field"><span class="sl-tip-key">${t(this.rowTypeWord(e))}</span><span class="sl-tip-val">${t(e.rowLabel??e.displayLabel??e.label)}</span></div><div class="sl-tip-field"><span class="sl-tip-key">${this.tf("picker.guests","Guests")}</span><span class="sl-tip-val">${e.bookingMode==="variable"?`${e.minOccupancy}\u2013${e.maxOccupancy}`:e.capacity}</span></div></div>`:r?'<div class="sl-tip-grid">'+(e.sectionLabel?`<div class="sl-tip-field"><span class="sl-tip-key">${this.tf("picker.section","Section")}</span><span class="sl-tip-val">${t(e.sectionLabel)}</span></div>`:"")+`<div class="sl-tip-field"><span class="sl-tip-key">${t(this.rowTypeWord(e))}</span><span class="sl-tip-val">${t(e.rowLabel??e.displayLabel??e.label)}</span></div></div>`:o?'<div class="sl-tip-grid">'+(e.sectionLabel?`<div class="sl-tip-field"><span class="sl-tip-key">${this.tf("picker.section","Section")}</span><span class="sl-tip-val">${t(e.sectionLabel)}</span></div>`:"")+(e.rowLabel?`<div class="sl-tip-field"><span class="sl-tip-key">${t(this.rowTypeWord(e))}</span><span class="sl-tip-val">${t(te(e))}</span></div>`:"")+(e.seatNumber?`<div class="sl-tip-field"><span class="sl-tip-key">${this.tf("picker.seat","Seat")}</span><span class="sl-tip-val">${t(e.seatNumber)}</span></div>`:"")+"</div>":`<div class="sl-tip-grid one"><div class="sl-tip-field"><span class="sl-tip-key">${this.tf("picker.seat","Seat")}</span><span class="sl-tip-val">${t(e.displayLabel??e.label)}</span></div></div>`,l=e.status==="not_for_sale",d=e.status==="free"?"":`<div class="sl-tip-status">${l?this.tf("picker.notAvailable","Not available"):e.status==="held"?(0,g.t)("map.statusHeld"):(0,g.t)("map.statusTaken")}</div>`,p=ue(e.commercial),c=p?`<div class="sl-tip-cx"><span class="g" aria-hidden="true">\u25D0</span>${t(p)}</div>`:"",h=Ce(e.wheelchairSpaceType),f=h?`<div class="sl-tip-cx"><span class="g" aria-hidden="true">\u267F</span>${t(h)}</div>`:"";this.tipEl.style.setProperty("--sl-cat",e.categoryColor),this.tipEl.innerHTML=a+`<div class="sl-tip-cat"><span class="sl-tip-dot" style="background:${e.categoryColor}"></span><span class="sl-tip-name">${t(e.categoryLabel)}</span>`+(l?"":`<span class="sl-tip-amt">${i}</span>`)+"</div>"+f+c+d,this.tipEl.style.display="block",this.placeTooltip()}getSelection(){return this.committedSelection()}selectObjects(e){return this.controller.select(e)}deselectObjects(e){this.controller.deselect(e)}clearSelection(){this.dismissConfirm(),this.dismissTableDialog(),this.controller.clearSelection()}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.exactTickets;if(e==null)return null;let t=this.totalTicketCount();return{isValid:t===e,count:t,required:e,remaining:Math.max(0,e-t),seats:this.committedSelection()}}setMapTheme(e){this.destroyed||(this.opts.theme={...this.opts.theme??{},map:e??void 0},this.controller.setMapTheme(e))}setEventDetailsHidden(e){this.eventDetailsHidden=e,this.syncFullscreenButtons()}setPricing(e){let t=JSON.stringify(this.opts.pricing??null),i=JSON.stringify(e??null);t!==i&&(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)))}isColorblindSafe(){return this.cbSafe}setColorblindSafe(e){e!==this.cbSafe&&(this.cbSafe=e,this.cbEl?.setAttribute("aria-pressed",String(e)),this.controller.setColorblindSafe(e),Qi(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"}getBuyerView(){return this.buyerView}setBuyerView(e,t){if(e==="map"){this.exit3d();return}let i=t?.flyToSeatId;if(this.buyerView==="venue3d"){i?(this.opts.onBuyerViewChange?.({view:"venue3d",seatId:i}),this.view3dHandle?.flyToSeat(i)):t?.resetView&&this.view3dHandle?.focusOverview();return}this.enter3d(i)}seatState3dFor(e){switch(this.controller.getStatus(e.id)){case"held":return"held";case"booked":return"sold";case"not_for_sale":return"dimmed";default:break}return this.priceBandKeys!=null&&!this.priceBandKeys.has(e.categoryKey)||this.limitedViewFilter&&(e.commercial?.restrictedView||e.commercial?.obstructedView)?"dimmed":"available"}pushAvailabilityTo3d(){if(!this.view3dHandle)return;let e=this.allSeats().map(t=>({seatId:t.id,state:this.seatState3dFor(t)}));this.view3dHandle.setAvailability(e)}syncSelectionTo3d(){this.view3dHandle&&this.view3dHandle.setSelection(this.controller.getSelection().map(e=>e.id))}async seatViewFor3d(e){let t=this.allSeats().find(i=>i.id===e);if(!t)return null;if(t.viewUrl)try{let i=t.viewMeta?.previewUrl,s=!!i&&i!==t.viewUrl,r=s?await this.buyerAssetUrls.resolve(i):null,o=s?t.viewUrl:await this.buyerAssetUrls.resolve(t.viewUrl);return!o||s&&!r?null:{url:o,...r?{previewUrl:r}:{},...s?{resolveUrl:a=>this.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?.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(i){return this.opts.onError?.(i),null}return{url:"",generated:!0,mediaKind:"model",coverage:"exact-seat",sourceLabel:this.tf("picker.chartDerivedModel","Chart-derived model")}}emitAnalytics(e,t){try{this.opts.onAnalytics?.(e,{...t,surface:"buyer"})}catch{}}emit3dAnalytics(e,t){this.emitAnalytics(e,t)}onView3dSeatPick(e){if(this.salesClosed){this.toast(this.tf("picker.salesClosedToast","Sales are closed for this event."),"warning"),this.syncSelectionTo3d();return}let t=this.allSeats().find(a=>a.id===e);if(!t)return;let i=this.controller.tableSelection(e);if(this.committedSelection().some(a=>i?a.label===i.label:a.id===e)){this.controller.deselect([e]),this.dismissConfirm(),this.syncSelectionTo3d();return}let r=this.controller.getStatus(t.id);if(r==="held"||r==="booked"||r==="not_for_sale"){this.showUnavailable3dSeat(t,this.seatState3dFor(t),r),this.syncSelectionTo3d();return}if(this.dismissUnavailable3dSeat(),!this.controller.select([e]).length){this.syncSelectionTo3d(),this.dismissConfirm();return}if(this.opts.onBuyerViewChange?.({view:"venue3d",seatId:e}),this.flashPickedSeat(e),i){this.showTableDialog(i,!1),this.syncSelectionTo3d();return}this.opts.confirmSelection!==!1?this.showConfirm(t):this.syncTray(),this.syncSelectionTo3d()}showUnavailable3dSeat(e,t,i){let s=this.view3dEl;if(!s)return;this.dismissUnavailable3dSeat();let r=this.controller.seatDetails(e.id),o=r?.displayLabel??e.displayLabel??e.label,a=r?.sectionLabel,l=te(r),d=[a,l?(0,g.t)("picker.rowLabel",{label:l}):null,o].filter(Boolean).join(" \xB7 "),p=i==="held"?{title:this.tf("picker.temporarilyHeld","Temporarily held"),message:this.tf("picker.heldSeatExplanation","Another buyer is holding this seat. It may become available again.")}:i==="booked"?{title:this.tf("picker.sold","Sold"),message:this.tf("picker.soldSeatExplanation","This seat has already been booked.")}:{title:this.tf("picker.notForSale","Not for sale"),message:this.tf("picker.notForSaleExplanation","This seat is not included in the current sale.")},c=document.createElement("div");c.className="sl-view3d-unavailable",c.dataset.state=t,c.setAttribute("role","status"),c.setAttribute("aria-live","polite");let h=document.createElement("span");h.className="sl-view3d-unavailable-eyebrow",h.textContent=d||o;let f=document.createElement("strong");f.textContent=p.title;let m=document.createElement("div");m.className="sl-view3d-unavailable-copy",m.append(h,f);let v=document.createElement("button");v.type="button",v.setAttribute("aria-label",this.tf("picker.closeSeatStatus","Close seat status")),v.textContent="\xD7";let k=document.createElement("p");k.textContent=p.message,c.append(m,v,k),v.addEventListener("click",()=>c.remove()),s.appendChild(c),this.announceSeat(e)}dismissUnavailable3dSeat(){this.view3dEl?.querySelector(".sl-view3d-unavailable")?.remove()}saveView3dComparisonSeat(e){if(this.buyerView!=="venue3d")return;let t=this.view3dCompareSeatIds;t.includes(e.id)||(this.view3dCompareSeatIds=t.length===0?[e.id]:[t[0],e.id]),this.confirmSeat?.id===e.id&&(this.controller.deselect([e.id]),this.dismissConfirm(),this.syncSelectionTo3d(),this.syncTray()),this.view3dCompareChip.sync(),this.emit3dAnalytics("3d_comparison_saved",{seatId:e.id,count:this.view3dCompareSeatIds.length}),this.view3dCompareSeatIds.length>1?this.openView3dComparison():this.toast(this.tf("picker.chooseAnotherToCompare","Seat saved. Choose another seat to compare."),"success")}clearView3dComparison(){this.closeView3dComparison(!1),this.view3dCompareSeatIds=[],this.view3dCompareChip.remove(),this.emit3dAnalytics("3d_comparison_cleared")}view3dComparisonSnapshot(e){let t=this.allSeats().find(f=>f.id===e);if(!t)return null;let i=this.controller.seatDetails(t.id),s=this.controller.doc?.categories.find(f=>f.key===t.categoryKey),r=i?.price??(s?.tiers?.length?s.tiers[0].price:s?.price),o=r!=null?this.paidPrice(t.categoryKey,i?.tierId??s?.tiers?.[0]?.id??null,r):void 0,a=this.controller.getStatus(t.id),l=a==="held"?this.tf("picker.temporarilyHeld","Temporarily held"):a==="booked"?this.tf("picker.sold","Sold"):a==="not_for_sale"?this.tf("picker.notForSale","Not for sale"):this.tf("picker.available","Available"),d=t.viewUrl?(0,Te.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}:{}}):this.tf("picker.chartDerivedSeatEye","Live 3D \xB7 chart-derived seat-eye \xB7 not surveyed"),p=ue(t.commercial)||this.tf("picker.noAuthoredRestriction","No organizer-authored restriction"),c=i?.wheelchairSpaceType?`${Ce(i.wheelchairSpaceType)} \xB7 metadata, not access certification`:this.tf("picker.noAccessibilityMetadata","No accessibility metadata supplied"),h=(0,at.seatConfidenceDisclosure)(t.confidenceEvidence);return{seat:t,label:i?.displayLabel??t.displayLabel??t.label,section:i?.sectionLabel??t.sectionId??"\u2014",row:te(i)??i?.rowLabel??"\u2014",category:i?.categoryLabel??s?.label??t.categoryKey,price:o==null?this.tf("picker.priceNotSupplied","Not supplied"):this.money(o),availability:l,selectable:a==null||a==="free",viewSource:d,limited:p,accessibility:c,confidence:h}}openSeatConfidencePassport(e,t=null){let i=this.view3dEl;if(!i)return;this.closeSeatConfidencePassport(!1);let s=(0,at.seatConfidenceDisclosure)(e.confidenceEvidence),r=e.confidenceEvidence,o=this.controller.seatDetails(e.id),a=y=>U(y),l=s.limitations.length?`<h4>Known limits</h4><ul>${s.limitations.map(y=>`<li>${a(y)}</li>`).join("")}</ul>`:"",d=s.modeledTarget?`<div><dt>Modeled target</dt><dd>${a(s.modeledTarget)}</dd></div>`:"",p=r?`<div><dt>Evidence ID</dt><dd>${a(r.evidenceId)}</dd></div><div><dt>Model version</dt><dd>${a(r.modelVersion)}</dd></div><div><dt>Event configuration</dt><dd>${a(r.eventConfigurationId??"Not configuration-specific")}</dd></div><div><dt>Approval</dt><dd>${a(r.approvedByRole??"No external approval supplied")}</dd></div>`+(r.validUntil?`<div><dt>Valid until</dt><dd>${a(r.validUntil.slice(0,10))}</dd></div>`:""):"<div><dt>Evidence ID</dt><dd>None supplied</dd></div>",c=ue(e.commercial)||this.tf("picker.noAuthoredRestriction","No organizer-authored restriction"),h=`<div><dt>View restriction</dt><dd>${a(c)}</dd></div>`+(e.commercial?.note?`<div><dt>Organizer note</dt><dd>${a(e.commercial.note)}</dd></div>`:""),f=document.createElement("div");f.className="sl-view3d-passport-shell",f.innerHTML=`<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">${a(o?.displayLabel??e.displayLabel??e.label)}</strong></div><button type="button" data-close aria-label="Close seat confidence passport">\xD7</button></header><div class="sl-view3d-passport-summary"><strong>${a(s.headline)}</strong><span>${a(s.coverage)} \xB7 ${a(s.freshness)}</span></div><dl><div><dt>Model status</dt><dd>${a(s.model)}</dd></div><div><dt>Reality evidence</dt><dd>${a(s.reality)}</dd></div><div><dt>Source</dt><dd>${a(s.provenance)}</dd></div>`+h+d+p+`</dl>${l}<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></section>`;let m=[...new Set([...i.children,...[...this.els.map.children].filter(y=>y!==i)])].filter(y=>y instanceof HTMLElement),v=m.map(y=>({element:y,inert:y.inert,ariaHidden:y.getAttribute("aria-hidden")}));for(let y of m)y.inert=!0,y.setAttribute("aria-hidden","true");i.appendChild(f),i.classList.add("has-passport"),this.view3dPassportEl=f;let k=f.querySelector(".sl-view3d-passport"),w=()=>[...k.querySelectorAll('button:not(:disabled),[href],[tabindex]:not([tabindex="-1"])')],x=y=>{if(y.key==="Escape"){y.preventDefault(),y.stopPropagation(),y.stopImmediatePropagation(),this.closeSeatConfidencePassport();return}if(y.key!=="Tab")return;let E=w();if(!E.length)return;let u=E[0],b=E[E.length-1];y.shiftKey&&document.activeElement===u?(y.preventDefault(),b.focus()):!y.shiftKey&&document.activeElement===b&&(y.preventDefault(),u.focus())};window.addEventListener("keydown",x,!0),this.view3dPassportCleanup=()=>{window.removeEventListener("keydown",x,!0);for(let b of v)b.element.inert=b.inert,b.ariaHidden===null?b.element.removeAttribute("aria-hidden"):b.element.setAttribute("aria-hidden",b.ariaHidden);let y=t?.isConnected?t:this.confirmEl?.querySelector(".sl-confirm-confidence")??this.view3dCompareEl?.querySelector("[data-passport-seat]")??null,E=y?.closest(".sl-confirm,.sl-view3d-compare");E?.isConnected&&(E.inert=!1,E.removeAttribute("aria-hidden")),f.remove(),i.classList.remove("has-passport"),this.view3dPassportEl===f&&(this.view3dPassportEl=null);let u=y??this.view3dCompareEl?.querySelector("[data-passport-seat]")??this.confirmEl?.querySelector(".sl-confirm-confidence")??this.view3dCompareChip.mainButton();(t?.isConnected?t:u)?.focus()},f.addEventListener("click",y=>{let E=y.target instanceof HTMLElement?y.target:null;(E?.closest("[data-close]")||E?.classList.contains("sl-view3d-passport-scrim"))&&this.closeSeatConfidencePassport()}),requestAnimationFrame(()=>w()[0]?.focus()),this.emit3dAnalytics("3d_confidence_passport_opened",{seatId:e.id,evidenceId:r?.evidenceId??null,eventConfigurationId:r?.eventConfigurationId??null,modelLevel:r?.modelLevel??"unverified",realityLevel:r?.realityLevel??"none"})}closeSeatConfidencePassport(e=!0){let t=this.view3dPassportCleanup;if(this.view3dPassportCleanup=null,!t){this.view3dPassportEl?.remove(),this.view3dPassportEl=null,this.view3dEl?.classList.remove("has-passport");return}e||(document.activeElement instanceof HTMLElement?document.activeElement:null)?.blur(),t(),e||this.root?.focus({preventScroll:!0})}openView3dComparison(){let e=this.view3dEl;if(!e||this.view3dCompareSeatIds.length<2)return;this.closeView3dComparison(!1);let t=this.view3dCompareSeatIds.map(h=>this.view3dComparisonSnapshot(h)).filter(h=>!!h);if(t.length<2){this.clearView3dComparison();return}let i=h=>U(h),s=document.createElement("div");s.className="sl-view3d-compare-shell";let r=t.map((h,f)=>`<article><span>Seat ${f===0?"A":"B"}</span><strong>${i(h.label)}</strong><small>Section ${i(h.section)} \xB7 Row ${i(h.row)}</small><dl><div><dt>Current price</dt><dd>${i(h.price)}</dd></div><div><dt>Ticket type</dt><dd>${i(h.category)}</dd></div><div><dt>Availability</dt><dd>${i(h.availability)}</dd></div><div><dt>View source</dt><dd>${i(h.viewSource)}</dd></div><div><dt>View restriction</dt><dd>${i(h.limited)}</dd></div><div><dt>Seat confidence</dt><dd>${i(h.confidence.headline)}</dd></div><div><dt>Reality check</dt><dd>${i(h.confidence.reality)}</dd></div><div><dt>Accessibility</dt><dd>${i(h.accessibility)}</dd></div></dl><div class="sl-view3d-compare-actions"><button type="button" data-passport-seat="${i(h.seat.id)}">Passport</button><button type="button" data-view-seat="${i(h.seat.id)}">View seat</button><button type="button" class="select" data-select-seat="${i(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">Current price and availability come from this picker. Modeled views are chart-derived unless organizer media is labeled; SeatLayer does not invent why a seat has its price.</p><div class="sl-view3d-compare-grid">${r}</div></section>`;let o=document.activeElement instanceof HTMLElement?document.activeElement:null,a=[...e.children].filter(h=>h instanceof HTMLElement),l=a.map(h=>({element:h,inert:h.inert,ariaHidden:h.getAttribute("aria-hidden")}));for(let h of a)h.inert=!0,h.setAttribute("aria-hidden","true");e.appendChild(s),e.classList.add("has-comparison"),this.view3dCompareEl=s;let d=s.querySelector(".sl-view3d-compare"),p=()=>[...d.querySelectorAll('button:not(:disabled),[href],[tabindex]:not([tabindex="-1"])')],c=h=>{if(h.key==="Escape"){h.preventDefault(),this.closeView3dComparison();return}if(h.key!=="Tab")return;let f=p();if(!f.length)return;let m=f[0],v=f[f.length-1];h.shiftKey&&document.activeElement===m?(h.preventDefault(),v.focus()):!h.shiftKey&&document.activeElement===v&&(h.preventDefault(),m.focus())};window.addEventListener("keydown",c),this.view3dCompareCleanup=()=>{window.removeEventListener("keydown",c);for(let h of l)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"),this.view3dCompareEl===s&&(this.view3dCompareEl=null),o?.isConnected?o.focus():this.view3dCompareChip.mainButton()?.focus()},s.querySelector("[data-close]")?.addEventListener("click",()=>this.closeView3dComparison()),s.querySelectorAll("[data-passport-seat]").forEach(h=>h.addEventListener("click",()=>{let f=h.dataset.passportSeat,m=f?this.allSeats().find(v=>v.id===f):void 0;m&&this.openSeatConfidencePassport(m,h)})),s.querySelectorAll("[data-view-seat]").forEach(h=>h.addEventListener("click",()=>{let f=h.dataset.viewSeat;this.closeView3dComparison(!1),f&&this.view3dHandle?.flyToSeat(f)})),s.querySelectorAll("[data-select-seat]").forEach(h=>h.addEventListener("click",()=>{let f=h.dataset.selectSeat;f&&this.selectComparedSeat(f)})),requestAnimationFrame(()=>p()[0]?.focus()),this.emit3dAnalytics("3d_comparison_opened",{seatIds:this.view3dCompareSeatIds.slice()})}closeView3dComparison(e=!0){let t=this.view3dCompareCleanup;if(this.view3dCompareCleanup=null,!t){this.view3dCompareEl?.remove(),this.view3dCompareEl=null,this.view3dEl?.classList.remove("has-comparison");return}e||(document.activeElement instanceof HTMLElement?document.activeElement:null)?.blur(),t(),e||this.root?.focus({preventScroll:!0})}selectComparedSeat(e){if(this.salesClosed){this.toast(this.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}let t=this.allSeats().find(s=>s.id===e);if(!t)return;if(this.closeView3dComparison(!1),!this.controller.select([e]).length){this.syncSelectionTo3d(),this.toast(this.tf("picker.seatNoLongerAvailable","That seat is no longer available."),"warning");return}this.syncSelectionTo3d(),this.showConfirm(t),this.emit3dAnalytics("3d_comparison_selected",{seatId:e})}async enter3d(e){if(this.view3dEl||!this.canOffer3d()||!this.els.map)return;let t=this.controller.doc;if(!t)return;this.buyerView="venue3d",this.view3dTargetSeatId=null,this.opts.onBuyerViewChange?.({view:"venue3d",...e?{seatId:e}:{}}),this.root?.setAttribute("data-view3d","on"),this.dismissConfirm(),this.syncProjection();let i=document.createElement("div");i.className="sl-view3d",i.setAttribute("role","group"),i.setAttribute("aria-label",this.tf("picker.interactive3dVenueView","Interactive 3D venue view"));let s=document.createElement("button");s.type="button",s.className="sl-view3d-back",s.innerHTML=`<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M15 18l-6-6 6-6"/></svg><span>${this.tf("picker.backToMap","Back to map")}</span>`;let r=s.querySelector("span"),o=p=>{this.view3dTargetSeatId=p;let c=!!p;i.classList.toggle("is-seat-focused",c);let h=c?this.tf("picker.backToVenue","Back to venue"):this.tf("picker.backToMap","Back to map");r&&(r.textContent=h),s.setAttribute("aria-label",h)};s.addEventListener("click",()=>{if(this.view3dTargetSeatId&&this.view3dHandle){this.view3dHandle.focusOverview();return}this.exit3d()}),i.appendChild(s);let a=document.createElement("button");a.type="button",a.className="sl-view3d-fs",a.textContent="\u26F6",a.setAttribute("aria-label",this.tf("picker.fullScreen","Full screen")),a.setAttribute("aria-pressed",String(!!document.fullscreenElement||this.fsFallback||this.framedFs)),a.addEventListener("click",()=>this.toggleFullscreen()),i.appendChild(a);let l=document.createElement("div");l.className="sl-view3d-loading",l.setAttribute("role","status"),l.setAttribute("aria-live","polite"),l.textContent=this.tf("picker.loading3d","Building the 3D venue\u2026"),i.appendChild(l),this.els.map.appendChild(i),this.view3dEl=i,this.view3dCompareChip.sync(),requestAnimationFrame(()=>{i.style.opacity="1"});let d=++this.view3dGen;try{let p=(0,g.expandChart)(t),c=await Ot();if(d!==this.view3dGen||this.buyerView!=="venue3d"||this.view3dEl!==i)return;let h=await c.prepareVenue3D({doc:t,seats:p});if(d!==this.view3dGen||this.buyerView!=="venue3d"||this.view3dEl!==i)return;let f=c.mountVenue3D(i,{doc:t,seats:p,prepared:h},{portraitOverviewCrop:!0,arriveAtSeatEye:!0,seatViewActionLabel:m=>this.allSeats().find(v=>v.id===m)?.viewUrl?this.tf("picker.openAuthored360","Open venue 360\xB0"):this.tf("picker.lookAroundLive3d","Look around in live 3D"),onSeatPick:m=>this.onView3dSeatPick(m),onSeatInspect:m=>this.onView3dSeatPick(m),onSectionFocusChange:m=>{let v=i.querySelector('select[data-locator="section"]'),k=m??"";!v||v.value===k||(v.value=k,v.dispatchEvent(new Event("change")))},onViewTargetChange:m=>{i.querySelector(".sl-view3d-nav")?.classList.toggle("is-seat-focused",!!m),o(m),this.opts.onBuyerViewChange?.({view:"venue3d",...m?{seatId:m}:{}})},getSeatView:m=>new Promise((v,k)=>{let w=()=>{this.seatViewFor3d(m).then(y=>{y?v(y):k(new Error("seat_view_unavailable"))})},x=globalThis.requestIdleCallback;typeof x=="function"?x(w,{timeout:1500}):setTimeout(w,50)}),onAnalytics:(m,v)=>this.emit3dAnalytics(m,v)});this.view3dHandle=f,l.remove(),this.pushAvailabilityTo3d(),this.syncSelectionTo3d(),qt(i,f),e&&f.flyToSeat(e)}catch(p){if(d!==this.view3dGen||this.buyerView!=="venue3d"||this.view3dEl!==i)return;this.opts.onError?.(p),this.toast(this.tf("picker.unavailable3d","3D could not start. The seat map is still available."),"warning"),this.exit3d()}}exit3d(){if(this.buyerView!=="venue3d"&&!this.view3dEl)return;this.view3dGen++,this.buyerView="map",this.view3dTargetSeatId=null,this.opts.onBuyerViewChange?.({view:"map"}),this.root?.removeAttribute("data-view3d"),this.closeSeatConfidencePassport(!1),this.closeView3dComparison(!1),this.view3dCompareChip.remove();try{this.view3dHandle?.dispose()}catch{}this.view3dHandle=null;let e=this.view3dEl;this.view3dEl=null,e&&(e.style.opacity="0",setTimeout(()=>e.remove(),320)),this.syncProjection();let t=this.view3dReturnSeat;this.view3dReturnSeat=null,t&&this.committedSelection().some(i=>i.id===t.id)&&this.opts.confirmSelection!==!1&&this.showConfirm(t)}getCurrentHold(){return this.hold}async resumeHold(e){return this.resumeHoldFromServer(e,!1)}async removeHeldTicket(e){return this.removeHeldLabel(e)}async bestAvailable(e,t,i={}){if(this.salesClosed||this.bestAvailableBusy)return null;e=Math.max(1,Math.min(this.maxTickets,Math.floor(e))),this.confirmSeat&&this.cancelConfirm(),this.bestAvailableConfirm=!1,this.bestAvailableBusy=!0;let s=this.els.tray?.querySelector(".sl-ba-go");s&&(s.disabled=!0,s.classList.add("sl-busy"),s.innerHTML=`<span class="sl-ba-spin" aria-hidden="true"></span>${this.tf("picker.findingEllipsis","Finding\u2026")}`);try{let r=await this.controller.bestAvailable(e,t,{...i,ttlMs:this.opts.holdTtlMs});return r?(this.hold={holdId:r.holdId,expiresAt:r.expiresAt,seats:r.seats,items:r.items},this.handedOff=!1,this.bookedShown=!1,this.gaQty.clear(),this.startHoldTimer(r.expiresAt),this.flashHeldSeats(this.hold),this.syncTray(),this.emitHoldChange(),i.preferPremium&&r.seats.length&&!r.seats.every(o=>o.commercial?.premium)&&this.toast((0,g.t)("picker.premiumFallbackNote",{count:e}),"neutral"),this.hold):null}catch(r){this.opts.onError?.(r);let o=r?.reason,a=o==="not_enough_together"?(0,g.t)("picker.couldNotFindSeatsTogether",{count:e}):o==="companion_pair_required"?this.tf("picker.companionPairRequired","Select the adjacent wheelchair place with each companion ticket."):o==="ticket_option_not_applicable"?this.tf("picker.ticketOptionNotApplicable","That ticket choice is not available for the selected seat."):o==="sold_out"?this.tf("picker.ticketTypeSoldOut","That ticket type is sold out. Try another ticket type."):o==="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(a,"error"),null}finally{this.bestAvailableBusy=!1,this.syncTray()}}async release(){let e=this.hold,t=this.controller.currentHold(),i=!0;if(t)i=await this.controller.release();else if(e){let s=[...new Set([...(e.items??[]).map(r=>r.label),...(e.seats??[]).map(r=>r.label)])];if(s.length)try{await this.api.release(this.opts.event,s,e.holdId)}catch(r){this.opts.onError?.(r),i=!1}}if(!i){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 q({url:this.pubApi.subscribeUrl(e),mintTicket:()=>this.pubApi.subscribeTicket(e),onAccessUnavailable:t=>{this.opts.onAccessUnavailable?.(t),this.showAccessPanel(t)},sink:ne(this.controller,{flashOnLiveChange:!0,onStatusChange:()=>{this.syncPrices(),this.scheduleOfferRefresh(!0),this.detectBooked(),this.minimap?.refreshMinimap(),this.pushAvailabilityTo3d()},onSelectedObjectUnavailable:(t,i)=>{this.opts.onSelectedObjectUnavailable?.({labels:t,reason:i}),this.syncTray(),this.toast(i==="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)}showAccessPanel(e){if(this.destroyed||!this.root)return;let t=this.accessCopy(e.reason);this.dismissAccessPanel();let i=document.createElement("div");i.className="sl-access",i.setAttribute("role","status"),i.setAttribute("aria-live","polite");let s=document.createElement("div"),r=document.createElement("div");r.className="sl-access-title",r.textContent=t.title;let o=document.createElement("div");if(o.className="sl-access-body",o.textContent=t.body,s.appendChild(r),s.appendChild(o),t.action){let a=document.createElement("button");a.type="button",a.className="sl-access-act",a.textContent=t.action,a.addEventListener("click",()=>{this.refreshAccess()}),s.appendChild(a)}i.appendChild(s),(this.regions?.["bottom-center"]??this.root).appendChild(i),this.accessEl=i}dismissAccessPanel(){this.accessEl?.remove(),this.accessEl=null}accessCopy(e){switch(e){case"paused":return{title:this.tf("picker.accessPausedTitle","These seats are on hold right now"),body:this.tf("picker.accessPausedBody","The organizer has paused this selection. Try again in a few minutes."),action:this.tf("picker.accessRetry","Try again")};case"revoked":return{title:this.tf("picker.accessRevokedTitle","This access link is no longer active"),body:this.tf("picker.accessRevokedBody","Ask whoever sent you here for a new link to keep booking these seats.")};case"no_token":case"provider_failed":return{title:this.tf("picker.accessExpiredTitle","Your access session has ended"),body:this.tf("picker.accessExpiredBody","Sign in again, or reload the page, to keep browsing these seats. Anything you are already holding stays yours."),action:this.tf("picker.accessRetry","Try again")};default:return{title:this.tf("picker.accessInvalidTitle","We couldn\u2019t verify your access"),body:this.tf("picker.accessInvalidBody","You can still book anything shown as available. Contact whoever sent you here for access to the rest.")}}}destroy(){this.destroyed=!0,this.realtime?.stop(),this.realtime=null,this.dismissAccessPanel(),this.access?.clear(),this.hold&&!this.handedOff&&this.controller.release(),this.closeConfirm(),this.dismissTableDialog(!1),this.closeSeatView(),this.closeCheckoutPanel(),this.exit3d(),this.buyerAssetUrls.dispose(),this.stopHoldTimer(),this.toastTimer&&clearTimeout(this.toastTimer),this.liveTimer&&clearTimeout(this.liveTimer),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.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)}};function Jt(n,e={}){let t=e.origin??"";if(!t)try{t=new URL(n.src,window.location.href).origin}catch{t=""}let i=!1,s=null,r=null,o=null,a="",l=null,d=()=>{if(i)return;i=!0,s=n.getAttribute("style"),Object.assign(n.style,{position:"fixed",inset:"0",width:"100vw",height:"100vh",margin:"0",border:"0",zIndex:"2147483000",background:"#101625"});let h=document.documentElement;r=h.style.overflow,h.style.overflow="hidden",document.body&&(o=document.body.style.overflow,document.body.style.overflow="hidden"),l=f=>{f.key==="Escape"&&p()},window.addEventListener("keydown",l)},p=()=>{i&&(i=!1,s===null?n.removeAttribute("style"):n.setAttribute("style",s),s=null,a&&(n.style.height=a),r!==null&&(document.documentElement.style.overflow=r,r=null),o!==null&&document.body&&(document.body.style.overflow=o,o=null),l&&(window.removeEventListener("keydown",l),l=null))},c=h=>{if(h.source!==n.contentWindow||t&&h.origin!==t||!h.data||typeof h.data!="object")return;let f=h.data;if(f.type==="seatlayer:height"){typeof f.px=="number"&&Number.isFinite(f.px)&&f.px>0&&(a=`${Math.round(f.px)}px`,i||(n.style.height=a));return}f.type==="seatlayer:fullscreen"&&(f.on===!0?d():f.on===!1&&p())};return window.addEventListener("message",c),()=>{window.removeEventListener("message",c),p()}}0&&(module.exports={ApiError,BuyerAccessContext,BuyerAccessUnavailableError,BuyerRealtimeClient,EmbeddedDesigner,SEATING_CHART_CALLBACK_PROPS,SEATING_CHART_HANDLE_METHODS,SEATING_CHART_IDENTITY_PROPS,SEATING_CHART_VALUE_PROPS,SeatPicker,SeatingChart,attachPickerFrame,bindSeatingChartHandle,buildSeatingChartOptions,createBuyerAccessContext,createControllerSink,parseTicketOfferAvailability,ticketOfferPrices});