@seatlayer/js 0.109.2 → 0.110.1

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 Gp=Object.create;var Pi=Object.defineProperty;var Up=Object.getOwnPropertyDescriptor;var qp=Object.getOwnPropertyNames;var Wp=Object.getPrototypeOf,Yp=Object.prototype.hasOwnProperty;var vs=n=>{throw TypeError(n)};var Mi=(n,e,t)=>()=>{if(t)throw t[0];try{return n&&(e=n(n=0)),e}catch(i){throw t=[i],i}};var Qo=(n,e)=>{for(var t in e)Pi(n,t,{get:e[t],enumerable:!0})},ws=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of qp(e))!Yp.call(n,o)&&o!==t&&Pi(n,o,{get:()=>e[o],enumerable:!(i=Up(e,o))||i.enumerable});return n};var xs=(n,e,t)=>(t=n!=null?Gp(Wp(n)):{},ws(e||!n||!n.__esModule?Pi(t,"default",{value:n,enumerable:!0}):t,n)),Xp=n=>ws(Pi({},"__esModule",{value:!0}),n);var Zo=(n,e,t)=>e.has(n)||vs("Cannot "+t);var m=(n,e,t)=>(Zo(n,e,"read from private field"),t?t.call(n):e.get(n)),R=(n,e,t)=>e.has(n)?vs("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,t),S=(n,e,t,i)=>(Zo(n,e,"write to private field"),i?i.call(n,t):e.set(n,t),t),x=(n,e,t)=>(Zo(n,e,"access private method"),t);function Ri(n){if(typeof n!="string"||!n)return null;try{let{protocol:e,hostname:t}=new URL(n);if(e==="https:"||e==="http:"&&(t==="localhost"||t==="127.0.0.1"))return n}catch{}return null}var Jo=Mi(()=>{"use strict"});function Fs(n){return n===void 0||n===""||n===!1||Array.isArray(n)&&!n.length}function Bs(n,e,t,i){if(Fs(t))return e?"required":null;let o=r=>!!i?.some(s=>s.id===r);if(n==="number")return typeof t=="number"&&Number.isFinite(t)?null:"invalid";if(n==="checkbox")return t===!0?null:"invalid";if(n==="select")return o(t)?null:"invalid";if(n==="multiselect")return Array.isArray(t)&&t.length<=50&&t.every(o)?null:"invalid";if(typeof t!="string")return"invalid";if(n==="phone")return Hh.test(t)?null:"invalid";if(t.length>500)return"too_long";if(n==="email")return Lh.test(t)?null:"invalid";if(n==="date"){let r=Rh.exec(t);if(!r)return"invalid";let[s,a,l]=[Number(r[1]),Number(r[2]),Number(r[3])],c=new Date(Date.UTC(s,a-1,l));return c.getUTCFullYear()===s&&c.getUTCMonth()===a-1&&c.getUTCDate()===l?null:"invalid"}return null}function ae(n,e,t){let i=document.createElement(n);return e&&(i.className=e),t!==void 0&&(i.textContent=t),i}function Ii(n,e){let t=n?.[e];return t==="optional"||t==="required"?t:"off"}function Vs(n){let{form:e,t,idPrefix:i}=n,o=(e?.questions??[]).filter(k=>k&&!k.archived).sort((k,A)=>k.position-A.position),r=Ds.filter(([k])=>Ii(e,k)!=="off"),s=o.filter(k=>k.scope==="ticket"),a=o.filter(k=>k.scope!=="ticket"),l=r.length>0||s.length>0;if(!l&&!a.length)return{details:null,element:null,validate:()=>!0,payload:()=>({}),showServerErrors:()=>!1};let c=r.filter(([,k])=>k!=="phone"),d=r.every(([k])=>Ii(e,k)!=="required")&&s.every(k=>!k.required),p=[...n.tickets],u=!0,h=!1,b=new Map,f=(k,A)=>A===void 0?k:`${k}|${A}`,T=[],w=0,v=ae("div","sl-hco-bf sl-hco-bf-inline"),M=ae("div","sl-hco-bf"),F=ae("p","sl-hco-alert is-error");F.setAttribute("role","alert"),F.hidden=!0;let X=(k,A)=>A==="required"?t("picker.bookingForm.required","This is required."):A==="too_long"?t("picker.bookingForm.tooLong","This is too long."):k==="email"?t("picker.bookingForm.invalidEmail","Enter a valid email address."):k==="phone"?t("picker.bookingForm.invalidPhone","Enter a valid phone number."):t("picker.bookingForm.invalid","Check this answer."),g=(k,A)=>{k.error.textContent=A?X(k.kind,A):"",k.error.hidden=!A;let B=k.kind==="multiselect"||k.control.closest(".sl-hco-chips")?k.control.closest("fieldset")??k.control:k.control;A?B.setAttribute("aria-invalid","true"):B.removeAttribute("aria-invalid"),k.control.closest(".sl-hco-block")?.classList.toggle("has-error",T.some(Q=>Q.ticketKey===k.ticketKey&&!Q.error.hidden))},_=(k,A)=>{let B=ae("span",void 0,k);if(A)return B;let Q=ae("span","sl-hco-label-row");return Q.append(B," ",ae("span","sl-hco-optional",t("checkout.optional","Optional"))),Q},G=(k,A)=>{let B=`${i}-bf${w++}`,Q=f(A.key,A.ticketKey),D=b.get(Q),K=ae("div","sl-hco-field"),$=A.help?ae("p","sl-hco-help",A.help):null;$&&($.id=`${B}-h`);let ne=ae("p","sl-hco-ferr");ne.id=`${B}-e`,ne.hidden=!0;let ge=se=>{se.setAttribute("aria-describedby",$?`${$.id} ${ne.id}`:ne.id),A.required&&se.tagName!=="FIELDSET"&&se.setAttribute("aria-required","true")},ce=A.kind==="select"&&(A.options??[]).length<=_h,He;if(A.kind==="checkbox"||A.kind==="multiselect"||ce){let se=A.kind==="checkbox"?null:ae("fieldset",ce?"sl-hco-group sl-hco-chips":"sl-hco-group"),Z=se?A.options??[]:[{id:"",label:A.label}];if(se){ce&&se.setAttribute("role","radiogroup");let pe=ae("legend");pe.appendChild(_(A.label,A.required)),se.appendChild(pe),$&&se.appendChild($),ge(se)}let ve=se?ae("div","sl-hco-choices"):null,be=Z.map((pe,it)=>{let Ei=ae("label",ce?"sl-hco-chip":"sl-hco-check"),me=ae("input");me.type=ce?"radio":"checkbox",me.value=pe.id,ce&&(me.name=B),se?(it===0&&(me.id=B),me.checked=ce?D===pe.id:Array.isArray(D)&&D.includes(pe.id)):(me.id=B,me.checked=D===!0,ge(me));let Qn=se?ae("span",void 0,pe.label):_(A.label,A.required);return Ei.append(me,Qn),(ve??K).appendChild(Ei),me});se&&ve?(se.appendChild(ve),K.appendChild(se)):$&&K.appendChild($),He={...A,control:be[0]??se??K,error:ne,read:ce?()=>be.find(pe=>pe.checked)?.value??"":se?()=>be.filter(pe=>pe.checked).map(pe=>pe.value):()=>!!be[0]?.checked}}else{let se=ae("label","sl-hco-label");se.appendChild(_(A.label,A.required)),se.htmlFor=B;let Z;if(A.kind==="textarea")Z=ae("textarea","sl-hco-input"),Z.rows=3,Z.maxLength=500;else if(A.kind==="select"){Z=ae("select","sl-hco-input"),Z.appendChild(new Option(t("picker.bookingForm.choose","Choose\u2026"),""));for(let be of A.options??[])Z.appendChild(new Option(be.label,be.id))}else Z=ae("input","sl-hco-input"),Z.type=Ih[A.kind]??"text",A.kind==="number"?(Z.step="any",Z.inputMode="decimal"):A.kind!=="date"&&(Z.maxLength=A.kind==="phone"?20:500),A.autocomplete&&(Z.autocomplete=A.autocomplete);Z.id=B,typeof D=="string"?Z.value=D:typeof D=="number"&&(Z.value=String(D)),ge(Z),K.append(se,...$?[$]:[],Z);let ve=Z;He={...A,control:Z,error:ne,read:()=>{let be=ve.value.trim();return A.kind!=="number"?be:ve.validity?.badInput?Number.NaN:be===""?void 0:Number(be)}}}K.appendChild(ne);let an=()=>{let se=He.read();se===void 0?b.delete(Q):b.set(Q,se),g(He,null)};return K.addEventListener("input",an),K.addEventListener("change",an),k.appendChild(K),T.push(He),He},N=(k,A,B)=>G(k,{key:`question:${A.id}`,...B!==void 0?{ticketKey:B}:{},kind:A.type,label:A.label,required:!!A.required,help:A.helpText,options:A.options}),j=(k,A,B,Q)=>{let D=Ds.find(([K])=>K===B);return G(k,{key:B,ticketKey:A.key,kind:D[1],label:t(D[2],D[3]),required:Ii(e,B)==="required",autocomplete:Q===0&&u?Oh[D[1]]:"off"})},P=(k,A,B="sl-hco-link")=>{let Q=ae("button",B,k);return Q.type="button",Q.addEventListener("click",A),Q},z=k=>ae("h3","sl-hco-h",k),ee=()=>ae("section","sl-hco-sec"),W=k=>{if(!k&&p[0]){let B=n.buyer();for(let[Q,D]of c){let K=B[D];K&&b.set(f(Q,p[0].key),K)}h=!0}u=k;for(let[,B]of c)n.buyerError?.(B,null);re(),(k?M.querySelector(".sl-hco-you .sl-hco-link"):M.querySelector(".sl-hco-block input"))?.focus()};function re(){T=[],v.replaceChildren(),M.replaceChildren();let k=p[0],A=p.length===1&&u;if(l&&A&&k){for(let[$,ne]of r)ne==="phone"&&j(v,k,$,0);c.length&&v.appendChild(P(t("checkout.forSomeoneElse","Ticket for someone else?"),()=>W(!1)))}let B=l&&!A&&(!d||h||Ee||!u);if(l&&!A&&!B){let $=ee(),ne=P("",()=>{h=!0,re(),M.querySelector(".sl-hco-block input")?.focus()},"sl-hco-disclosure");ne.setAttribute("aria-expanded","false"),ne.append(ae("span","sl-hco-plus","+"),ae("span",void 0,t("checkout.addNames","Add names for each ticket")),ae("span","sl-hco-optional",t("checkout.optional","Optional"))),$.appendChild(ne),M.appendChild($)}if(B){let $=ee();$.appendChild(z(t("bookingForm.ticketHolders","Ticket holders"))),p.forEach((ne,ge)=>{let ce=ae("fieldset","sl-hco-block"),He=ae("legend","sl-hco-legend",ne.title||t("picker.bookingForm.ticket","Ticket {number}",{number:ge+1}));ce.appendChild(He);let an=ge===0&&u&&c.length>0;if(an){let ve=n.buyer(),be=ae("p","sl-hco-you"),pe=ve.name||ve.email;be.append(ae("span",void 0,pe?t("checkout.holderYou","You \xB7 {name}",{name:pe}):t("checkout.holderYouPlain","You")));let it=P(t("checkout.change","Change"),()=>W(!1));it.setAttribute("aria-label",t("checkout.changeHolder","Change the holder of {ticket}",{ticket:He.textContent??""})),be.appendChild(it),ce.appendChild(be)}else ge===0&&!u&&c.length>0&&ce.appendChild(P(t("picker.bookingForm.useMyDetails","Use my details"),()=>W(!0),"sl-hco-link sl-hco-use"));let se=r.filter(([,ve])=>!(an&&ve!=="phone")),Z=se.length>1?ae("div","sl-hco-pair"):ce;for(let[ve]of se)j(Z,ne,ve,ge);Z!==ce&&ce.appendChild(Z);for(let ve of s)N(ce,ve,ne.key);$.appendChild(ce)}),M.appendChild($)}let D=[...l&&A&&k?s.map($=>({q:$,ticketKey:k.key})):[],...a.map($=>({q:$,ticketKey:void 0}))],K=[...D.filter(({q:$})=>$.type!=="checkbox"),...D.filter(({q:$})=>$.type==="checkbox")];if(K.length){let $=ee();$.appendChild(z(t("checkout.questions","A few questions")));for(let{q:ne,ticketKey:ge}of K)N($,ne,ge);M.appendChild($)}M.appendChild(F)}let Ee=!1;re();let ke=()=>{if(!p[0]||!u)return null;let A=n.buyer(),B=null;for(let[Q,D]of c){let K=Bs(D,Ii(e,Q)==="required",A[D]),$=n.buyerError?.(D,K?X(D,K):null)??null;K&&!B&&(B=$)}return B},Ce=k=>(F.textContent=k?t("picker.bookingForm.fix","Some details need attention."):"",F.hidden=!k,k?.focus(),!!k),ze=(k,A)=>k.compareDocumentPosition(A)&4?-1:1;return{details:v,element:M,validate(){let k=[],A=ke();A&&k.push(A);for(let B of T){let Q=Bs(B.kind,B.required,B.read(),B.options);g(B,Q),Q&&k.push(B.control)}return k.sort(ze),!Ce(k[0]??null)},payload(){let k=new Map,A=[],B=p[0];if(B&&u){let D=n.buyer(),K={ticketKey:B.key};for(let[,$]of c){let ne=D[$];ne&&(K[$]=ne)}(K.name||K.email)&&k.set(B.key,K)}for(let D of T){let K=D.read();if(!Fs(K)){if(D.key.startsWith("question:"))A.push({questionId:D.key.slice(9),...D.ticketKey!==void 0?{ticketKey:D.ticketKey}:{},value:K});else if(D.ticketKey!==void 0){let $=k.get(D.ticketKey)??{ticketKey:D.ticketKey},ne=D.key==="attendeeName"?"name":D.key==="attendeeEmail"?"email":"phone";$[ne]=String(K),k.set(D.ticketKey,$)}}}let Q=p.map(D=>k.get(D.key)).filter(D=>!!D);return{...Q.length?{attendees:Q}:{},...A.length?{answers:A}:{}}},showServerErrors(k){let A=(Array.isArray(k)?k:[]).filter(D=>!!D&&typeof D.key=="string");if(l){let D=!1;for(let K of A)typeof K.ticketKey=="string"&&!p.some($=>$.key===K.ticketKey)&&(p.push({key:K.ticketKey}),D=!0);Ee=A.some(K=>typeof K.ticketKey=="string"),(D||Ee)&&re()}let B=[],Q=p[0];for(let D of A){let K=D.key==="attendeeName"?"name":D.key==="attendeeEmail"?"email":null;if(K&&u&&Q&&D.ticketKey===Q.key&&c.some(([,$])=>$===K)){let $=n.buyerError?.(K,X(K,Ns.includes(D.code)?D.code:"invalid"));$&&B.push($)}}for(let D of T){let K=A.find(ne=>ne.key===D.key&&(ne.ticketKey??void 0)===(D.ticketKey??void 0)),$=K?Ns.includes(K.code)?K.code:"invalid":null;g(D,$),$&&B.push(D.control)}return B.length?(B.sort(ze),Ce(B[0])):(F.textContent=t("picker.bookingForm.fix","Some details need attention."),F.hidden=!1,!1)}}}var Lh,Hh,Rh,Ns,Ds,Ih,Oh,_h,$s=Mi(()=>{"use strict";Lh=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,Hh=/^[0-9 +()-]{6,20}$/,Rh=/^(\d{4})-(\d{2})-(\d{2})$/,Ns=["required","invalid","too_long"],Ds=[["attendeeName","name","picker.bookingForm.name","Name"],["attendeeEmail","email","picker.bookingForm.email","Email"],["attendeePhone","phone","picker.bookingForm.phone","Phone"]],Ih={email:"email",phone:"tel",number:"number",date:"date"};Oh={name:"name",email:"email",phone:"tel"},_h=5});var Ws={};Qo(Ws,{CHECKOUT_BUSY_MAX_RETRIES:()=>Gs,checkoutBusyDelayMs:()=>Us,errorCopy:()=>Bt,formatHoldClock:()=>qs,isCheckoutBusy:()=>er,mountCheckout:()=>qh,unavailableCopy:()=>Ks});function Fh(n,e){try{window.sessionStorage.setItem(Bh,JSON.stringify({orderId:n,...e?{eventKey:e}:{},storedAt:Date.now()}))}catch{}}function $h(){if(typeof document>"u"||document.getElementById(zs))return;let n=document.createElement("style");n.id=zs,n.textContent=Vh,document.head.appendChild(n)}function Ks(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, 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 er(n){if(!n||typeof n!="object")return!1;let e=n;return e.status!==503||e.code==="maintenance_mode"||e.reason==="maintenance_mode"?!1:e.code==="checkout_busy"||e.code==="database_busy"?!0:e.retryable===!0}function Us(n,e=Math.random){let t=n?.retryAfterS,i=typeof t=="number"&&Number.isFinite(t)&&t>=0?t:zh,o=Math.floor(Math.max(0,Math.min(1,e()))*jh);return Math.min(Kh,i*1e3+o)}function Gh(n){return`${(typeof n?.notice=="string"?n.notice.trim():"")||(()=>{let i=n?.retryAfterS;if(typeof i!="number"||!Number.isFinite(i)||i<0)return"Booking is paused for a few minutes for maintenance. Please try again shortly.";let o=Math.max(1,Math.ceil(i/60));return`Booking is paused for maintenance. Please try again in about ${o} minute${o===1?"":"s"}.`})()} Nothing was charged. Your seats are still held.`}function Bt(n,e){if(n==="maintenance_mode")return Gh(e);switch(n){case"checkout_busy":case"database_busy":return e?.free?"We couldn\u2019t confirm your booking yet because it\u2019s very busy. Nothing was charged. Please try again.":"We couldn\u2019t start the payment yet because it\u2019s very busy. Nothing was charged. Please try again.";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. Please try again.";case"hold_not_active":case"hold_not_found":return"Your seats were released before checkout started. Nothing was charged. 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. 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. Please contact the organiser.";case"provider_refused":return"The organiser\u2019s payment provider refused to start this payment. Nothing was charged. Please contact the organiser.";case"rate_limited":return"Too many attempts. Wait a moment and try again.";case"seats_unavailable":return"Those seats were taken while you were filling this in. Nothing was charged. Please pick again.";case"booking_form_incomplete":return"The details this event asks for changed while you were choosing. Nothing was charged. Please go back and try again.";default:return"We could not start the payment. Nothing was charged. Please try again."}}function I(n,e,t){let i=document.createElement(n);return e&&(i.className=e),t!==void 0&&(i.textContent=t),i}function Dt(n,e=18,t="0 0 20 20"){let i=document.createElementNS(js,"svg");i.setAttribute("viewBox",t),i.setAttribute("width",String(e)),i.setAttribute("height",String(e)),i.setAttribute("fill","none"),i.setAttribute("stroke","currentColor"),i.setAttribute("stroke-width","1.8"),i.setAttribute("stroke-linecap","round"),i.setAttribute("stroke-linejoin","round"),i.setAttribute("aria-hidden","true"),i.setAttribute("focusable","false");for(let o of n){let r=document.createElementNS(js,"path");r.setAttribute("d",o),i.appendChild(r)}return i}function qs(n){let e=Math.max(0,Math.ceil(n/1e3)),t=Math.floor(e/3600),i=Math.floor(e%3600/60),o=String(e%60).padStart(2,"0");return t>0?`${t}:${String(i).padStart(2,"0")}:${o}`:`${i}:${o}`}function qh(n){$h();let e=!0,t=!1,i=null,o=(C,H,U)=>{let Y=n.t?.(C,U);return Y&&Y!==C?Y:U?H.replace(/\{(\w+)\}/g,(Re,Ie)=>Ie in U?String(U[Ie]):Re):H},r=I("div","sl-hco");r.setAttribute("role","dialog"),r.setAttribute("aria-modal","true");let s=I("div","sl-hco-card");r.appendChild(s);let a=()=>{i&&clearInterval(i),i=null},l=()=>{e=!1,a(),r.remove(),document.removeEventListener("keydown",p,!0)},c=()=>{l(),n.onCancel()},d=!0;function p(C){if(r.isConnected){if(C.key==="Tab"){let H=[...s.querySelectorAll("a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled])")].filter(Re=>Re.offsetParent!==null||Re===document.activeElement),U=H[0],Y=H[H.length-1];if(!U||!Y)return;C.shiftKey&&document.activeElement===U?(C.preventDefault(),Y.focus()):!C.shiftKey&&document.activeElement===Y&&(C.preventDefault(),U.focus());return}C.key==="Escape"&&(C.stopPropagation(),C.preventDefault(),d&&c())}}document.addEventListener("keydown",p,!0);let u=`sl-hco-t-${Math.random().toString(36).slice(2,8)}`,h=I("header","sl-hco-head"),b=I("button","sl-hco-back-icon");b.type="button",b.setAttribute("aria-label",o("checkout.back","Back to seats")),b.appendChild(Dt([...yt.back])),b.addEventListener("click",()=>{d&&c()});let f=I("div","sl-hco-htext"),T=I("h2","sl-hco-title",n.event?.name?.trim()||o("checkout.title","Checkout"));T.id=u;let w=I("p","sl-hco-sub",n.event?.detail?.trim()??"");w.hidden=!w.textContent,f.append(T,w);let v=I("span","sl-hco-timer");v.setAttribute("role","timer");let M=I("span");M.setAttribute("aria-hidden","true"),v.append(Dt([...yt.clock],14),M),v.hidden=!0,h.append(b,f,v),r.setAttribute("aria-labelledby",u);let F=I("p","sl-hco-sr");F.setAttribute("aria-live","polite");let X=(...C)=>{s.replaceChildren(h,F,...C)},g=C=>{d=C,b.hidden=!C},_=C=>{let H=I("div","sl-hco-state");H.setAttribute("role",C.alert?"alert":"status");let U=I("div",`sl-hco-state-icon is-${C.tone}`);return U.setAttribute("aria-hidden","true"),U.appendChild(C.icon),H.appendChild(U),C.title&&H.appendChild(I("h3","sl-hco-state-title",C.title)),C.text&&H.appendChild(I("p",`sl-hco-status${C.alert?" sl-hco-error":""}`,C.text)),C.note&&H.appendChild(I("p","sl-hco-state-note",C.note)),H},G=(...C)=>{let H=I("div","sl-hco-body");return H.append(...C),H},N=(...C)=>{let H=I("footer","sl-hco-foot");return H.append(...C),H},j=()=>{let C=I("span","sl-hco-spin");return C.setAttribute("aria-hidden","true"),C},P=(C,H="error")=>{if(!e)return;a(),v.hidden=!0,g(!0);let U=I("button",H==="error"?"sl-hco-back sl-hco-ghost":"sl-hco-pay",H==="expired"?o("checkout.chooseAgain","Choose seats again"):H==="taken"?o("checkout.chooseOther","Choose other seats"):o("checkout.back","Back to seats"));if(U.type="button",U.addEventListener("click",c),H==="error"){let Y=I("p","sl-hco-alert is-error sl-hco-status sl-hco-error",C);Y.setAttribute("role","alert"),X(G(...W?[W]:[],Y),N(U))}else X(G(_({tone:H==="expired"?"warn":"error",icon:Dt([...H==="expired"?yt.hour:yt.seat],24,"0 0 24 24"),title:H==="expired"?o("checkout.expiredTitle","Your seats were released"):o("checkout.takenTitle","Those seats were just taken"),text:C,alert:!1})),N(U));U.focus()},z=(C,H)=>{e&&(a(),v.hidden=!0,g(!1),X(G(_({tone:"neutral",icon:j(),...H?{title:H}:{},text:C}))))},ee=async(C,H=!1)=>{z(H?o("checkout.confirmingSeats","Confirming your seats\u2026"):"Payment received. Confirming your seats\u2026");let U=Date.now()+Nh;for(;e&&Date.now()<U;){try{let Y=await n.orderStatus(C);if(!e)return;if(Y.status==="confirmed"){t=!0,g(!1),T.textContent=o("checkout.confirmedTitle","Your tickets are confirmed");let Re=I("p","sl-hco-status",`${Y.seatCount} ${Y.seatCount===1?"seat":"seats"} confirmed. Your tickets, with their door QR codes, are in your email.`),Ie=I("dl","sl-hco-receipt"),Ve=(Y.tickets??[]).map(Ot=>Ot.displayLabel||Ot.label);Ve.length&&Ie.append(I("dt",void 0,"Seats"),I("dd",void 0,Ve.join(", ")));let Xe=H||Y.totalMinor===0;Ie.append(I("dt",void 0,Xe?o("checkout.price","Price"):o("checkout.paid","Paid")),I("dd",void 0,Xe?o("checkout.free","Free"):`${Y.amountFormatted} ${Y.currency}`),I("dt",void 0,o("checkout.order","Order")),I("dd","sl-hco-ref",Y.orderId));let ln=I("button","sl-hco-back","Close");ln.type="button",ln.addEventListener("click",c);let gt=I("div","sl-hco-state");if(gt.append(Re,Ie),Y.ticketUrl){let Ot=I("a","sl-hco-tickets",o("checkout.viewTickets","View tickets & QR codes"));Ot.href=Y.ticketUrl,Ot.target="_blank",Ot.rel="noreferrer",gt.appendChild(Ot)}gt.appendChild(ln),X(G(gt)),d=!0,n.onConfirmed(Y);return}if(Y.status==="failed"||Y.status==="expired"){Y.status==="expired"?P("Your seats were released before payment completed. Nothing was charged. Please pick again.","expired"):P("The payment did not complete. If you were charged, it has been refunded automatically.");return}}catch{}await new Promise(Y=>setTimeout(Y,Dh))}!e||t||P(H?"Still confirming your booking. Once it is confirmed, your tickets will arrive by email. Nothing was charged.":"Still confirming with the payment provider. If your payment went through, your tickets will arrive by email shortly. You do not need to pay again.")},W=null;if(n.state.kind==="unavailable"){let C=Ks(n.state.reason,n.state.seatCount);T.textContent=C.title;let H=I("button","sl-hco-back sl-hco-ghost","Back to seat map");H.type="button",H.addEventListener("click",c);let U=I("p","sl-hco-label","Seats held");return X(G(U,_({tone:"neutral",icon:Dt([...yt.seat],24,"0 0 24 24"),text:C.body,note:C.detail})),N(H)),n.root.appendChild(r),H.focus(),{destroy:l}}if(n.state.kind==="resume")return n.root.appendChild(r),ee(n.state.orderId),{destroy:l};let{order:re,bookingForm:Ee}=n.state,ke=n.state.free===!0,Ce=C=>ke?o("checkout.free","Free"):n.formatMoney(C,re.currency),ze=Ce(re.total);W=I("section","sl-hco-sec sl-hco-order sl-hco-summary");let k=re.lines?.length?re.lines:re.labels.map(C=>({label:C,detail:null,amount:null})),A=k.length===1?[k[0].label,k[0].detail].filter(Boolean).join(" \xB7 "):`${re.tickets?.length||k.length} ${(re.tickets?.length||k.length)===1?"seat":"seats"}`,B=I("button","sl-hco-order-toggle");B.type="button",B.setAttribute("aria-expanded","false"),B.append(I("span",void 0,A),Dt([...yt.down])),B.addEventListener("click",()=>{let C=!W.hasAttribute("data-open");W.toggleAttribute("data-open",C),B.setAttribute("aria-expanded",String(C))});let Q=I("div","sl-hco-order-full"),D=I("ul","sl-hco-lines sl-hco-seats");for(let C of k){let H=I("li","sl-hco-line sl-hco-seat"),U=I("span","sl-hco-line-text");U.appendChild(I("span","sl-hco-where",C.label)),C.detail&&U.appendChild(I("span","sl-hco-what",C.detail)),H.appendChild(U),typeof C.amount=="number"&&H.appendChild(I("span","sl-hco-price",Ce(C.amount))),D.appendChild(H)}Q.append(I("h3","sl-hco-h",o("checkout.yourOrder","Your order")),D),W.append(B,Q);let K=I("form","sl-hco-form");K.noValidate=!0;let $=C=>{let H=I("div","sl-hco-field"),U=I("label","sl-hco-label"),Y=I("span","sl-hco-label-row");Y.appendChild(I("span",void 0,C.label));let Re=I("span","sl-hco-optional",o("checkout.optional","Optional"));C.optional&&Y.append(" ",Re),U.appendChild(Y),U.htmlFor=C.id;let Ie=C.hint?I("p","sl-hco-help",C.hint):null;Ie&&(Ie.id=`${C.id}-h`);let Ve=I("input","sl-hco-input");Ve.type=C.type,Ve.id=C.id,Ve.autocomplete=C.autocomplete,Ve.placeholder=C.placeholder;let Xe=I("p","sl-hco-ferr");Xe.id=`${C.id}-e`,Xe.hidden=!0,Ve.setAttribute("aria-describedby",Ie?`${Ie.id} ${Xe.id}`:Xe.id),H.append(U,...Ie?[Ie]:[],Ve,Xe);let ln=gt=>{Xe.textContent=gt??"",Xe.hidden=!gt,gt?Ve.setAttribute("aria-invalid","true"):Ve.removeAttribute("aria-invalid")};return Ve.addEventListener("input",()=>ln(null)),{wrap:H,input:Ve,optional:Re,setError:ln}},ne=$({id:`${u}-email`,label:o("checkout.email","Email"),type:"email",autocomplete:"email",placeholder:"you@example.com",hint:o("checkout.emailHint","Your tickets are sent here."),optional:!1}),ge=ne.input;ge.required=!0,ge.inputMode="email";let ce=$({id:`${u}-name`,label:o("checkout.name","Name"),type:"text",autocomplete:"name",placeholder:o("checkout.namePlaceholder","Your name"),optional:!0}),He=ce.input;Ee?.attendeeName==="required"&&(ce.optional.previousSibling?.remove(),ce.optional.remove(),He.setAttribute("aria-required","true"));let se=()=>/.+@.+\..+/.test(ge.value.trim()),Z=Vs({form:Ee,tickets:re.tickets??[],idPrefix:u,t:o,buyer:()=>({name:He.value.trim(),email:ge.value.trim()}),buyerError:(C,H)=>((C==="name"?ce:ne).setError(H),C==="name"?He:ge)}),ve=I("section","sl-hco-sec");ve.append(I("h3","sl-hco-h",o("checkout.yourDetails","Your details")),ne.wrap,ce.wrap,...Z.details?.childNodes.length?[Z.details]:[]);let be=I("p","sl-hco-note");be.append(`${o("checkout.privacy","The organizer and SeatLayer use your details to issue and manage your tickets.")} `);let pe=I("a",void 0,o("checkout.privacyLink","Privacy Policy"));pe.href="https://seatlayer.io/privacy/",pe.target="_blank",pe.rel="noreferrer",be.appendChild(pe);let it=I("fieldset","sl-hco-fields");it.append(W,ve,...Z.element?[Z.element]:[],be);let Ei=G(it),me=I("p","sl-hco-alert is-error sl-hco-status sl-hco-error");me.setAttribute("role","alert"),me.hidden=!0;let Qn=C=>{me.textContent=C,me.hidden=!1},Zn=I("p","sl-hco-alert is-warn");Zn.hidden=!0;let us=I("div","sl-hco-total"),ms=re.tickets?.length||re.labels.length;us.append(I("span",void 0,`${ms} ${ms===1?"seat":"seats"}`),I("strong",void 0,ze));let fs=ke?o("checkout.confirmBooking","Confirm booking"):o("checkout.continue","Continue to payment"),It=I("button","sl-hco-pay",fs);It.type="submit";let Ci=I("p","sl-hco-sr");Ci.setAttribute("role","status");let gs=C=>{It.replaceChildren(j(),C),Ci.textContent=C},Yo=I("p","sl-hco-trust");ke||Yo.appendChild(Dt([...yt.lock],12,"0 0 16 16")),Yo.append(ke?o("checkout.freeTrust","Free booking. Nothing is charged."):o("checkout.trust","Secure payment on the organizer\u2019s payment page. We never see your card.")),K.append(Ei,N(me,Zn,us,It,Ci,Yo));let bs=null,ys=()=>{let C=re.expiresAt-Date.now(),H=qs(C);M.textContent=H,v.setAttribute("aria-label",o("checkout.heldFor","Seats held for {time}",{time:H}));let U=C<=Uh;v.classList.toggle("is-warn",U),Zn.hidden=!U||!me.hidden,U&&(Zn.textContent=o("checkout.expiringSoon","Your seats are held for {time}. Finish soon to keep them.",{time:H}));let Y=C<=3e4?30:U?120:null;Y&&bs!==Y&&(bs=Y,F.textContent=Zn.textContent),C<=0&&P(o("checkout.expiredBody","The hold on {seats} ran out before payment started.",{seats:k.map(Re=>Re.label).join(", ")}),"expired")},jp=()=>{Number.isFinite(re.expiresAt)&&(a(),v.hidden=!1,ys(),i=setInterval(ys,1e3))},Ai=!1,Kp=async()=>{if(!Ai){Ai=!0,me.hidden=!0,it.disabled=!0,It.disabled=!0,gs(ke?o("checkout.confirmingBooking","Confirming your booking\u2026"):o("checkout.opening","Opening secure payment\u2026"));try{let C={holdId:re.holdId,buyerEmail:ge.value.trim(),...He.value.trim()?{buyerName:He.value.trim()}:{},...Z.payload(),bookingFormVersion:1},H=0,U;for(;;)try{U=await n.startSession(C);break}catch(Re){if(!e)return;if(H>=Gs||!er(Re))throw Re;if(H+=1,gs(ke?o("checkout.busyRetryingBooking","Busy right now. Still confirming your booking\u2026"):o("checkout.busyRetryingPayment","Busy right now. Still opening secure payment\u2026")),await new Promise(Ie=>setTimeout(Ie,Us(Re))),!e)return}if(!e)return;if(U.status==="confirmed"){ee(U.orderId,!0);return}let Y=Ri(U.redirectUrl);if(Y){Fh(U.orderId,n.eventKey),a(),v.hidden=!0,X(G(_({tone:"neutral",icon:Dt([...yt.card],24,"0 0 24 24"),title:o("checkout.redirectTitle","Taking you to secure payment"),text:o("checkout.redirectBody","You\u2019ll pay {amount} on the organizer\u2019s payment page, then come back here for your tickets.",{amount:ze}),note:o("checkout.dontClose","Don\u2019t close this tab.")}))),window.location.assign(Y);return}P(Bt("gateway_unavailable"))}catch(C){n.onError?.(C);let H=C;if(H?.code==="booking_form_incomplete"&&Z.element){Xo(),Z.showServerErrors(H.fields);return}if(er(H)){Xo(),Qn(ke?o("checkout.busyFailedBooking",Bt("checkout_busy",{free:!0})):o("checkout.busyFailedPayment",Bt("checkout_busy"))),It.textContent=o("checkout.tryAgain","Try again");return}if(H?.code==="hold_not_active"||H?.code==="hold_not_found"){P(Bt(H.code),"expired");return}if(H?.code==="seats_unavailable"){P(o("checkout.seatsUnavailable",Bt(H.code)),"taken");return}P(Bt(H?.code,H))}}};K.addEventListener("submit",C=>{if(C.preventDefault(),Ai)return;let H=se();ne.setError(H?null:o("checkout.error.email","Enter an email like name@example.com."));let U=Z.validate();if(!H){Qn(o("bookingForm.fixErrors","Some details need attention before you continue.")),ge.focus();return}if(!U){Qn(o("bookingForm.fixErrors","Some details need attention before you continue."));return}Kp()});let Xo=()=>{T.textContent=n.event?.name?.trim()||o("checkout.title","Checkout"),me.hidden=!0,me.textContent="",Ai=!1,it.disabled=!1,It.disabled=!1,It.textContent=fs,Ci.textContent="",g(!0),X(K),jp()};return Xo(),n.root.appendChild(r),(typeof window.matchMedia!="function"||window.matchMedia("(min-width: 561px)").matches)&&ge.focus(),{destroy:l}}var Nh,Dh,zs,Bh,Vh,Gs,zh,jh,Kh,js,yt,Uh,Ys=Mi(()=>{"use strict";Jo();$s();Nh=9e4,Dh=2e3,zs="seatlayer-checkout-style",Bh="@seatlayer/pending-checkout/v1";Vh=`
1
+ "use strict";var tu=Object.create;var no=Object.defineProperty;var nu=Object.getOwnPropertyDescriptor;var iu=Object.getOwnPropertyNames;var ou=Object.getPrototypeOf,ru=Object.prototype.hasOwnProperty;var la=n=>{throw TypeError(n)};var io=(n,e,t)=>()=>{if(t)throw t[0];try{return n&&(e=n(n=0)),e}catch(i){throw t=[i],i}};var Br=(n,e)=>{for(var t in e)no(n,t,{get:e[t],enumerable:!0})},ca=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of iu(e))!ru.call(n,o)&&o!==t&&no(n,o,{get:()=>e[o],enumerable:!(i=nu(e,o))||i.enumerable});return n};var da=(n,e,t)=>(t=n!=null?tu(ou(n)):{},ca(e||!n||!n.__esModule?no(t,"default",{value:n,enumerable:!0}):t,n)),su=n=>ca(no({},"__esModule",{value:!0}),n);var Fr=(n,e,t)=>e.has(n)||la("Cannot "+t);var h=(n,e,t)=>(Fr(n,e,"read from private field"),t?t.call(n):e.get(n)),P=(n,e,t)=>e.has(n)?la("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,t),k=(n,e,t,i)=>(Fr(n,e,"write to private field"),i?i.call(n,t):e.set(n,t),t),w=(n,e,t)=>(Fr(n,e,"access private method"),t);var pa=(n,e,t,i)=>({set _(o){k(n,e,o,t)},get _(){return h(n,e,i)}});function so(n){if(typeof n!="string"||!n)return null;try{let{protocol:e,hostname:t}=new URL(n);if(e==="https:"||e==="http:"&&(t==="localhost"||t==="127.0.0.1"))return n}catch{}return null}var Vr=io(()=>{"use strict"});function Ma(n){return n===void 0||n===""||n===!1||Array.isArray(n)&&!n.length}function Pa(n,e,t,i){if(Ma(t))return e?"required":null;let o=r=>!!i?.some(s=>s.id===r);if(n==="number")return typeof t=="number"&&Number.isFinite(t)?null:"invalid";if(n==="checkbox")return t===!0?null:"invalid";if(n==="select")return o(t)?null:"invalid";if(n==="multiselect")return Array.isArray(t)&&t.length<=50&&t.every(o)?null:"invalid";if(typeof t!="string")return"invalid";if(n==="phone")return $u.test(t)?null:"invalid";if(t.length>500)return"too_long";if(n==="email")return Vu.test(t)?null:"invalid";if(n==="date"){let r=zu.exec(t);if(!r)return"invalid";let[s,a,l]=[Number(r[1]),Number(r[2]),Number(r[3])],c=new Date(Date.UTC(s,a-1,l));return c.getUTCFullYear()===s&&c.getUTCMonth()===a-1&&c.getUTCDate()===l?null:"invalid"}return null}function ce(n,e,t){let i=document.createElement(n);return e&&(i.className=e),t!==void 0&&(i.textContent=t),i}function ao(n,e){let t=n?.[e];return t==="optional"||t==="required"?t:"off"}function La(n){let{form:e,t,idPrefix:i}=n,o=(e?.questions??[]).filter(S=>S&&!S.archived).sort((S,A)=>S.position-A.position),r=Aa.filter(([S])=>ao(e,S)!=="off"),s=o.filter(S=>S.scope==="ticket"),a=o.filter(S=>S.scope!=="ticket"),l=r.length>0||s.length>0;if(!l&&!a.length)return{details:null,element:null,validate:()=>!0,payload:()=>({}),showServerErrors:()=>!1};let c=r.filter(([,S])=>S!=="phone"),d=r.every(([S])=>ao(e,S)!=="required")&&s.every(S=>!S.required),p=[...n.tickets],m=!0,u=!1,f=new Map,b=(S,A)=>A===void 0?S:`${S}|${A}`,T=[],E=0,v=ce("div","sl-hco-bf sl-hco-bf-inline"),M=ce("div","sl-hco-bf"),F=ce("p","sl-hco-alert is-error");F.setAttribute("role","alert"),F.hidden=!0;let Q=(S,A)=>A==="required"?t("picker.bookingForm.required","This is required."):A==="too_long"?t("picker.bookingForm.tooLong","This is too long."):S==="email"?t("picker.bookingForm.invalidEmail","Enter a valid email address."):S==="phone"?t("picker.bookingForm.invalidPhone","Enter a valid phone number."):t("picker.bookingForm.invalid","Check this answer."),N=(S,A)=>{S.error.textContent=A?Q(S.kind,A):"",S.error.hidden=!A;let B=S.kind==="multiselect"||S.control.closest(".sl-hco-chips")?S.control.closest("fieldset")??S.control:S.control;A?B.setAttribute("aria-invalid","true"):B.removeAttribute("aria-invalid"),S.control.closest(".sl-hco-block")?.classList.toggle("has-error",T.some(ee=>ee.ticketKey===S.ticketKey&&!ee.error.hidden))},g=(S,A)=>{let B=ce("span",void 0,S);if(A)return B;let ee=ce("span","sl-hco-label-row");return ee.append(B," ",ce("span","sl-hco-optional",t("checkout.optional","Optional"))),ee},O=(S,A)=>{let B=`${i}-bf${E++}`,ee=b(A.key,A.ticketKey),K=f.get(ee),U=ce("div","sl-hco-field"),G=A.help?ce("p","sl-hco-help",A.help):null;G&&(G.id=`${B}-h`);let oe=ce("p","sl-hco-ferr");oe.id=`${B}-e`,oe.hidden=!0;let ke=le=>{le.setAttribute("aria-describedby",G?`${G.id} ${oe.id}`:oe.id),A.required&&le.tagName!=="FIELDSET"&&le.setAttribute("aria-required","true")},be=A.kind==="select"&&(A.options??[]).length<=Gu,Ie;if(A.kind==="checkbox"||A.kind==="multiselect"||be){let le=A.kind==="checkbox"?null:ce("fieldset",be?"sl-hco-group sl-hco-chips":"sl-hco-group"),ie=le?A.options??[]:[{id:"",label:A.label}];if(le){be&&le.setAttribute("role","radiogroup");let Ae=ce("legend");Ae.appendChild(g(A.label,A.required)),le.appendChild(Ae),G&&le.appendChild(G),ke(le)}let Ce=le?ce("div","sl-hco-choices"):null,Se=ie.map((Ae,Ge)=>{let Mn=ce("label",be?"sl-hco-chip":"sl-hco-check"),Oe=ce("input");Oe.type=be?"radio":"checkbox",Oe.value=Ae.id,be&&(Oe.name=B),le?(Ge===0&&(Oe.id=B),Oe.checked=be?K===Ae.id:Array.isArray(K)&&K.includes(Ae.id)):(Oe.id=B,Oe.checked=K===!0,ke(Oe));let Ji=le?ce("span",void 0,Ae.label):g(A.label,A.required);return Mn.append(Oe,Ji),(Ce??U).appendChild(Mn),Oe});le&&Ce?(le.appendChild(Ce),U.appendChild(le)):G&&U.appendChild(G),Ie={...A,control:Se[0]??le??U,error:oe,read:be?()=>Se.find(Ae=>Ae.checked)?.value??"":le?()=>Se.filter(Ae=>Ae.checked).map(Ae=>Ae.value):()=>!!Se[0]?.checked}}else{let le=ce("label","sl-hco-label");le.appendChild(g(A.label,A.required)),le.htmlFor=B;let ie;if(A.kind==="textarea")ie=ce("textarea","sl-hco-input"),ie.rows=3,ie.maxLength=500;else if(A.kind==="select"){ie=ce("select","sl-hco-input"),ie.appendChild(new Option(t("picker.bookingForm.choose","Choose\u2026"),""));for(let Se of A.options??[])ie.appendChild(new Option(Se.label,Se.id))}else ie=ce("input","sl-hco-input"),ie.type=ju[A.kind]??"text",A.kind==="number"?(ie.step="any",ie.inputMode="decimal"):A.kind!=="date"&&(ie.maxLength=A.kind==="phone"?20:500),A.autocomplete&&(ie.autocomplete=A.autocomplete);ie.id=B,typeof K=="string"?ie.value=K:typeof K=="number"&&(ie.value=String(K)),ke(ie),U.append(le,...G?[G]:[],ie);let Ce=ie;Ie={...A,control:ie,error:oe,read:()=>{let Se=Ce.value.trim();return A.kind!=="number"?Se:Ce.validity?.badInput?Number.NaN:Se===""?void 0:Number(Se)}}}U.appendChild(oe);let Pn=()=>{let le=Ie.read();le===void 0?f.delete(ee):f.set(ee,le),N(Ie,null)};return U.addEventListener("input",Pn),U.addEventListener("change",Pn),S.appendChild(U),T.push(Ie),Ie},R=(S,A,B)=>O(S,{key:`question:${A.id}`,...B!==void 0?{ticketKey:B}:{},kind:A.type,label:A.label,required:!!A.required,help:A.helpText,options:A.options}),V=(S,A,B,ee)=>{let K=Aa.find(([U])=>U===B);return O(S,{key:B,ticketKey:A.key,kind:K[1],label:t(K[2],K[3]),required:ao(e,B)==="required",autocomplete:ee===0&&m?Ku[K[1]]:"off"})},z=(S,A,B="sl-hco-link")=>{let ee=ce("button",B,S);return ee.type="button",ee.addEventListener("click",A),ee},D=S=>ce("h3","sl-hco-h",S),ne=()=>ce("section","sl-hco-sec"),J=S=>{if(!S&&p[0]){let B=n.buyer();for(let[ee,K]of c){let U=B[K];U&&f.set(b(ee,p[0].key),U)}u=!0}m=S;for(let[,B]of c)n.buyerError?.(B,null);X(),(S?M.querySelector(".sl-hco-you .sl-hco-link"):M.querySelector(".sl-hco-block input"))?.focus()};function X(){T=[],v.replaceChildren(),M.replaceChildren();let S=p[0],A=p.length===1&&m;if(l&&A&&S){for(let[G,oe]of r)oe==="phone"&&V(v,S,G,0);c.length&&v.appendChild(z(t("checkout.forSomeoneElse","Ticket for someone else?"),()=>J(!1)))}let B=l&&!A&&(!d||u||xe||!m);if(l&&!A&&!B){let G=ne(),oe=z("",()=>{u=!0,X(),M.querySelector(".sl-hco-block input")?.focus()},"sl-hco-disclosure");oe.setAttribute("aria-expanded","false"),oe.append(ce("span","sl-hco-plus","+"),ce("span",void 0,t("checkout.addNames","Add names for each ticket")),ce("span","sl-hco-optional",t("checkout.optional","Optional"))),G.appendChild(oe),M.appendChild(G)}if(B){let G=ne();G.appendChild(D(t("bookingForm.ticketHolders","Ticket holders"))),p.forEach((oe,ke)=>{let be=ce("fieldset","sl-hco-block"),Ie=ce("legend","sl-hco-legend",oe.title||t("picker.bookingForm.ticket","Ticket {number}",{number:ke+1}));be.appendChild(Ie);let Pn=ke===0&&m&&c.length>0;if(Pn){let Ce=n.buyer(),Se=ce("p","sl-hco-you"),Ae=Ce.name||Ce.email;Se.append(ce("span",void 0,Ae?t("checkout.holderYou","You \xB7 {name}",{name:Ae}):t("checkout.holderYouPlain","You")));let Ge=z(t("checkout.change","Change"),()=>J(!1));Ge.setAttribute("aria-label",t("checkout.changeHolder","Change the holder of {ticket}",{ticket:Ie.textContent??""})),Se.appendChild(Ge),be.appendChild(Se)}else ke===0&&!m&&c.length>0&&be.appendChild(z(t("picker.bookingForm.useMyDetails","Use my details"),()=>J(!0),"sl-hco-link sl-hco-use"));let le=r.filter(([,Ce])=>!(Pn&&Ce!=="phone")),ie=le.length>1?ce("div","sl-hco-pair"):be;for(let[Ce]of le)V(ie,oe,Ce,ke);ie!==be&&be.appendChild(ie);for(let Ce of s)R(be,Ce,oe.key);G.appendChild(be)}),M.appendChild(G)}let K=[...l&&A&&S?s.map(G=>({q:G,ticketKey:S.key})):[],...a.map(G=>({q:G,ticketKey:void 0}))],U=[...K.filter(({q:G})=>G.type!=="checkbox"),...K.filter(({q:G})=>G.type==="checkbox")];if(U.length){let G=ne();G.appendChild(D(t("checkout.questions","A few questions")));for(let{q:oe,ticketKey:ke}of U)R(G,oe,ke);M.appendChild(G)}M.appendChild(F)}let xe=!1;X();let ge=()=>{if(!p[0]||!m)return null;let A=n.buyer(),B=null;for(let[ee,K]of c){let U=Pa(K,ao(e,ee)==="required",A[K]),G=n.buyerError?.(K,U?Q(K,U):null)??null;U&&!B&&(B=G)}return B},Ee=S=>(F.textContent=S?t("picker.bookingForm.fix","Some details need attention."):"",F.hidden=!S,S?.focus(),!!S),Ke=(S,A)=>S.compareDocumentPosition(A)&4?-1:1;return{details:v,element:M,validate(){let S=[],A=ge();A&&S.push(A);for(let B of T){let ee=Pa(B.kind,B.required,B.read(),B.options);N(B,ee),ee&&S.push(B.control)}return S.sort(Ke),!Ee(S[0]??null)},payload(){let S=new Map,A=[],B=p[0];if(B&&m){let K=n.buyer(),U={ticketKey:B.key};for(let[,G]of c){let oe=K[G];oe&&(U[G]=oe)}(U.name||U.email)&&S.set(B.key,U)}for(let K of T){let U=K.read();if(!Ma(U)){if(K.key.startsWith("question:"))A.push({questionId:K.key.slice(9),...K.ticketKey!==void 0?{ticketKey:K.ticketKey}:{},value:U});else if(K.ticketKey!==void 0){let G=S.get(K.ticketKey)??{ticketKey:K.ticketKey},oe=K.key==="attendeeName"?"name":K.key==="attendeeEmail"?"email":"phone";G[oe]=String(U),S.set(K.ticketKey,G)}}}let ee=p.map(K=>S.get(K.key)).filter(K=>!!K);return{...ee.length?{attendees:ee}:{},...A.length?{answers:A}:{}}},showServerErrors(S){let A=(Array.isArray(S)?S:[]).filter(K=>!!K&&typeof K.key=="string");if(l){let K=!1;for(let U of A)typeof U.ticketKey=="string"&&!p.some(G=>G.key===U.ticketKey)&&(p.push({key:U.ticketKey}),K=!0);xe=A.some(U=>typeof U.ticketKey=="string"),(K||xe)&&X()}let B=[],ee=p[0];for(let K of A){let U=K.key==="attendeeName"?"name":K.key==="attendeeEmail"?"email":null;if(U&&m&&ee&&K.ticketKey===ee.key&&c.some(([,G])=>G===U)){let G=n.buyerError?.(U,Q(U,Ca.includes(K.code)?K.code:"invalid"));G&&B.push(G)}}for(let K of T){let U=A.find(oe=>oe.key===K.key&&(oe.ticketKey??void 0)===(K.ticketKey??void 0)),G=U?Ca.includes(U.code)?U.code:"invalid":null;N(K,G),G&&B.push(K.control)}return B.length?(B.sort(Ke),Ee(B[0])):(F.textContent=t("picker.bookingForm.fix","Some details need attention."),F.hidden=!1,!1)}}}var Vu,$u,zu,Ca,Aa,ju,Ku,Gu,Ha=io(()=>{"use strict";Vu=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,$u=/^[0-9 +()-]{6,20}$/,zu=/^(\d{4})-(\d{2})-(\d{2})$/,Ca=["required","invalid","too_long"],Aa=[["attendeeName","name","picker.bookingForm.name","Name"],["attendeeEmail","email","picker.bookingForm.email","Email"],["attendeePhone","phone","picker.bookingForm.phone","Phone"]],ju={email:"email",phone:"tel",number:"number",date:"date"};Ku={name:"name",email:"email",phone:"tel"},Gu=5});var Ba={};Br(Ba,{CHECKOUT_BUSY_MAX_RETRIES:()=>_a,checkoutBusyDelayMs:()=>Na,errorCopy:()=>nn,formatHoldClock:()=>Da,isCheckoutBusy:()=>$r,mountCheckout:()=>im,unavailableCopy:()=>Oa});function Yu(n,e){try{window.sessionStorage.setItem(Wu,JSON.stringify({orderId:n,...e?{eventKey:e}:{},storedAt:Date.now()}))}catch{}}function Zu(){if(typeof document>"u"||document.getElementById(Ra))return;let n=document.createElement("style");n.id=Ra,n.textContent=Xu,document.head.appendChild(n)}function Oa(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, 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 $r(n){if(!n||typeof n!="object")return!1;let e=n;return e.status!==503||e.code==="maintenance_mode"||e.reason==="maintenance_mode"?!1:e.code==="checkout_busy"||e.code==="database_busy"?!0:e.retryable===!0}function Na(n,e=Math.random){let t=n?.retryAfterS,i=typeof t=="number"&&Number.isFinite(t)&&t>=0?t:Qu,o=Math.floor(Math.max(0,Math.min(1,e()))*Ju);return Math.min(em,i*1e3+o)}function tm(n){return`${(typeof n?.notice=="string"?n.notice.trim():"")||(()=>{let i=n?.retryAfterS;if(typeof i!="number"||!Number.isFinite(i)||i<0)return"Booking is paused for a few minutes for maintenance. Please try again shortly.";let o=Math.max(1,Math.ceil(i/60));return`Booking is paused for maintenance. Please try again in about ${o} minute${o===1?"":"s"}.`})()} Nothing was charged. Your seats are still held.`}function nn(n,e){if(n==="maintenance_mode")return tm(e);switch(n){case"checkout_busy":case"database_busy":return e?.free?"We couldn\u2019t confirm your booking yet because it\u2019s very busy. Nothing was charged. Please try again.":"We couldn\u2019t start the payment yet because it\u2019s very busy. Nothing was charged. Please try again.";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. Please try again.";case"hold_not_active":case"hold_not_found":return"Your seats were released before checkout started. Nothing was charged. 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 tops up their balance. Nothing was charged. 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. Please contact the organiser.";case"provider_refused":return"The organiser\u2019s payment provider refused to start this payment. Nothing was charged. Please contact the organiser.";case"rate_limited":return"Too many attempts. Wait a moment and try again.";case"seats_unavailable":return"Those seats were taken while you were filling this in. Nothing was charged. Please pick again.";case"booking_form_incomplete":return"The details this event asks for changed while you were choosing. Nothing was charged. Please go back and try again.";default:return"We could not start the payment. Nothing was charged. Please try again."}}function $(n,e,t){let i=document.createElement(n);return e&&(i.className=e),t!==void 0&&(i.textContent=t),i}function tn(n,e=18,t="0 0 20 20"){let i=document.createElementNS(Ia,"svg");i.setAttribute("viewBox",t),i.setAttribute("width",String(e)),i.setAttribute("height",String(e)),i.setAttribute("fill","none"),i.setAttribute("stroke","currentColor"),i.setAttribute("stroke-width","1.8"),i.setAttribute("stroke-linecap","round"),i.setAttribute("stroke-linejoin","round"),i.setAttribute("aria-hidden","true"),i.setAttribute("focusable","false");for(let o of n){let r=document.createElementNS(Ia,"path");r.setAttribute("d",o),i.appendChild(r)}return i}function Da(n){let e=Math.max(0,Math.ceil(n/1e3)),t=Math.floor(e/3600),i=Math.floor(e%3600/60),o=String(e%60).padStart(2,"0");return t>0?`${t}:${String(i).padStart(2,"0")}:${o}`:`${i}:${o}`}function im(n){Zu();let e=!0,t=!1,i=null,o=(C,_,W)=>{let Z=n.t?.(C,W);return Z&&Z!==C?Z:W?_.replace(/\{(\w+)\}/g,(Ve,$e)=>$e in W?String(W[$e]):Ve):_},r=$("div","sl-hco");r.setAttribute("role","dialog"),r.setAttribute("aria-modal","true");let s=$("div","sl-hco-card");r.appendChild(s);let a=()=>{i&&clearInterval(i),i=null},l=()=>{e=!1,a(),r.remove(),document.removeEventListener("keydown",p,!0)},c=()=>{l(),n.onCancel()},d=!0;function p(C){if(r.isConnected){if(C.key==="Tab"){let _=[...s.querySelectorAll("a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled])")].filter(Ve=>Ve.offsetParent!==null||Ve===document.activeElement),W=_[0],Z=_[_.length-1];if(!W||!Z)return;C.shiftKey&&document.activeElement===W?(C.preventDefault(),Z.focus()):!C.shiftKey&&document.activeElement===Z&&(C.preventDefault(),W.focus());return}C.key==="Escape"&&(C.stopPropagation(),C.preventDefault(),d&&c())}}document.addEventListener("keydown",p,!0);let m=`sl-hco-t-${Math.random().toString(36).slice(2,8)}`,u=$("header","sl-hco-head"),f=$("button","sl-hco-back-icon");f.type="button",f.setAttribute("aria-label",o("checkout.back","Back to seats")),f.appendChild(tn([...Mt.back])),f.addEventListener("click",()=>{d&&c()});let b=$("div","sl-hco-htext"),T=$("h2","sl-hco-title",n.event?.name?.trim()||o("checkout.title","Checkout"));T.id=m;let E=$("p","sl-hco-sub",n.event?.detail?.trim()??"");E.hidden=!E.textContent,b.append(T,E);let v=$("span","sl-hco-timer");v.setAttribute("role","timer");let M=$("span");M.setAttribute("aria-hidden","true"),v.append(tn([...Mt.clock],14),M),v.hidden=!0,u.append(f,b,v),r.setAttribute("aria-labelledby",m);let F=$("p","sl-hco-sr");F.setAttribute("aria-live","polite");let Q=(...C)=>{s.replaceChildren(u,F,...C)},N=C=>{d=C,f.hidden=!C},g=C=>{let _=$("div","sl-hco-state");_.setAttribute("role",C.alert?"alert":"status");let W=$("div",`sl-hco-state-icon is-${C.tone}`);return W.setAttribute("aria-hidden","true"),W.appendChild(C.icon),_.appendChild(W),C.title&&_.appendChild($("h3","sl-hco-state-title",C.title)),C.text&&_.appendChild($("p",`sl-hco-status${C.alert?" sl-hco-error":""}`,C.text)),C.note&&_.appendChild($("p","sl-hco-state-note",C.note)),_},O=(...C)=>{let _=$("div","sl-hco-body");return _.append(...C),_},R=(...C)=>{let _=$("footer","sl-hco-foot");return _.append(...C),_},V=()=>{let C=$("span","sl-hco-spin");return C.setAttribute("aria-hidden","true"),C},z=(C,_="error")=>{if(!e)return;a(),v.hidden=!0,N(!0);let W=$("button",_==="error"?"sl-hco-back sl-hco-ghost":"sl-hco-pay",_==="expired"?o("checkout.chooseAgain","Choose seats again"):_==="taken"?o("checkout.chooseOther","Choose other seats"):o("checkout.back","Back to seats"));if(W.type="button",W.addEventListener("click",c),_==="error"){let Z=$("p","sl-hco-alert is-error sl-hco-status sl-hco-error",C);Z.setAttribute("role","alert"),Q(O(...J?[J]:[],Z),R(W))}else Q(O(g({tone:_==="expired"?"warn":"error",icon:tn([..._==="expired"?Mt.hour:Mt.seat],24,"0 0 24 24"),title:_==="expired"?o("checkout.expiredTitle","Your seats were released"):o("checkout.takenTitle","Those seats were just taken"),text:C,alert:!1})),R(W));W.focus()},D=(C,_)=>{e&&(a(),v.hidden=!0,N(!1),Q(O(g({tone:"neutral",icon:V(),..._?{title:_}:{},text:C}))))},ne=async(C,_=!1)=>{D(_?o("checkout.confirmingSeats","Confirming your seats\u2026"):"Payment received. Confirming your seats\u2026");let W=Date.now()+Uu;for(;e&&Date.now()<W;){try{let Z=await n.orderStatus(C);if(!e)return;if(Z.status==="confirmed"){t=!0,N(!1),T.textContent=o("checkout.confirmedTitle","Your tickets are confirmed");let Ve=$("p","sl-hco-status",`${Z.seatCount} ${Z.seatCount===1?"seat":"seats"} confirmed. Your tickets, with their door QR codes, are in your email.`),$e=$("dl","sl-hco-receipt"),qe=(Z.tickets??[]).map(Qt=>Qt.displayLabel||Qt.label);qe.length&&$e.append($("dt",void 0,"Seats"),$("dd",void 0,qe.join(", ")));let ot=_||Z.totalMinor===0;$e.append($("dt",void 0,ot?o("checkout.price","Price"):o("checkout.paid","Paid")),$("dd",void 0,ot?o("checkout.free","Free"):`${Z.amountFormatted} ${Z.currency}`),$("dt",void 0,o("checkout.order","Order")),$("dd","sl-hco-ref",Z.orderId));let Ln=$("button","sl-hco-back","Close");Ln.type="button",Ln.addEventListener("click",c);let At=$("div","sl-hco-state");if(At.append(Ve,$e),Z.ticketUrl){let Qt=$("a","sl-hco-tickets",o("checkout.viewTickets","View tickets & QR codes"));Qt.href=Z.ticketUrl,Qt.target="_blank",Qt.rel="noreferrer",At.appendChild(Qt)}At.appendChild(Ln),Q(O(At)),d=!0,n.onConfirmed(Z);return}if(Z.status==="failed"||Z.status==="expired"){Z.status==="expired"?z("Your seats were released before payment completed. Nothing was charged. Please pick again.","expired"):z("The payment did not complete. If you were charged, it has been refunded automatically.");return}}catch{}await new Promise(Z=>setTimeout(Z,qu))}!e||t||z(_?"Still confirming your booking. Once it is confirmed, your tickets will arrive by email. Nothing was charged.":"Still confirming with the payment provider. If your payment went through, your tickets will arrive by email shortly. You do not need to pay again.")},J=null;if(n.state.kind==="unavailable"){let C=Oa(n.state.reason,n.state.seatCount);T.textContent=C.title;let _=$("button","sl-hco-back sl-hco-ghost","Back to seat map");_.type="button",_.addEventListener("click",c);let W=$("p","sl-hco-label","Seats held");return Q(O(W,g({tone:"neutral",icon:tn([...Mt.seat],24,"0 0 24 24"),text:C.body,note:C.detail})),R(_)),n.root.appendChild(r),_.focus(),{destroy:l}}if(n.state.kind==="resume")return n.root.appendChild(r),ne(n.state.orderId),{destroy:l};let{order:X,bookingForm:xe}=n.state,ge=n.state.free===!0,Ee=C=>ge?o("checkout.free","Free"):n.formatMoney(C,X.currency),Ke=Ee(X.total);J=$("section","sl-hco-sec sl-hco-order sl-hco-summary");let S=X.lines?.length?X.lines:X.labels.map(C=>({label:C,detail:null,amount:null})),A=S.length===1?[S[0].label,S[0].detail].filter(Boolean).join(" \xB7 "):`${X.tickets?.length||S.length} ${(X.tickets?.length||S.length)===1?"seat":"seats"}`,B=$("button","sl-hco-order-toggle");B.type="button",B.setAttribute("aria-expanded","false"),B.append($("span",void 0,A),tn([...Mt.down])),B.addEventListener("click",()=>{let C=!J.hasAttribute("data-open");J.toggleAttribute("data-open",C),B.setAttribute("aria-expanded",String(C))});let ee=$("div","sl-hco-order-full"),K=$("ul","sl-hco-lines sl-hco-seats");for(let C of S){let _=$("li","sl-hco-line sl-hco-seat"),W=$("span","sl-hco-line-text");W.appendChild($("span","sl-hco-where",C.label)),C.detail&&W.appendChild($("span","sl-hco-what",C.detail)),_.appendChild(W),typeof C.amount=="number"&&_.appendChild($("span","sl-hco-price",Ee(C.amount))),K.appendChild(_)}ee.append($("h3","sl-hco-h",o("checkout.yourOrder","Your order")),K),J.append(B,ee);let U=$("form","sl-hco-form");U.noValidate=!0;let G=C=>{let _=$("div","sl-hco-field"),W=$("label","sl-hco-label"),Z=$("span","sl-hco-label-row");Z.appendChild($("span",void 0,C.label));let Ve=$("span","sl-hco-optional",o("checkout.optional","Optional"));C.optional&&Z.append(" ",Ve),W.appendChild(Z),W.htmlFor=C.id;let $e=C.hint?$("p","sl-hco-help",C.hint):null;$e&&($e.id=`${C.id}-h`);let qe=$("input","sl-hco-input");qe.type=C.type,qe.id=C.id,qe.autocomplete=C.autocomplete,qe.placeholder=C.placeholder;let ot=$("p","sl-hco-ferr");ot.id=`${C.id}-e`,ot.hidden=!0,qe.setAttribute("aria-describedby",$e?`${$e.id} ${ot.id}`:ot.id),_.append(W,...$e?[$e]:[],qe,ot);let Ln=At=>{ot.textContent=At??"",ot.hidden=!At,At?qe.setAttribute("aria-invalid","true"):qe.removeAttribute("aria-invalid")};return qe.addEventListener("input",()=>Ln(null)),{wrap:_,input:qe,optional:Ve,setError:Ln}},oe=G({id:`${m}-email`,label:o("checkout.email","Email"),type:"email",autocomplete:"email",placeholder:"you@example.com",hint:o("checkout.emailHint","Your tickets are sent here."),optional:!1}),ke=oe.input;ke.required=!0,ke.inputMode="email";let be=G({id:`${m}-name`,label:o("checkout.name","Name"),type:"text",autocomplete:"name",placeholder:o("checkout.namePlaceholder","Your name"),optional:!0}),Ie=be.input;n.buyer?.email&&(ke.value=n.buyer.email),n.buyer?.name&&(Ie.value=n.buyer.name),xe?.attendeeName==="required"&&(be.optional.previousSibling?.remove(),be.optional.remove(),Ie.setAttribute("aria-required","true"));let le=()=>/.+@.+\..+/.test(ke.value.trim()),ie=La({form:xe,tickets:X.tickets??[],idPrefix:m,t:o,buyer:()=>({name:Ie.value.trim(),email:ke.value.trim()}),buyerError:(C,_)=>((C==="name"?be:oe).setError(_),C==="name"?Ie:ke)}),Ce=$("section","sl-hco-sec");Ce.append($("h3","sl-hco-h",o("checkout.yourDetails","Your details")),oe.wrap,be.wrap,...ie.details?.childNodes.length?[ie.details]:[]);let Se=$("fieldset","sl-hco-fields");Se.append(J,Ce,...ie.element?[ie.element]:[]);let Ae=O(Se),Ge=$("p","sl-hco-alert is-error sl-hco-status sl-hco-error");Ge.setAttribute("role","alert"),Ge.hidden=!0;let Mn=C=>{Ge.textContent=C,Ge.hidden=!1},Oe=$("p","sl-hco-alert is-warn");Oe.hidden=!0;let Ji=$("div","sl-hco-total"),ia=X.tickets?.length||X.labels.length;Ji.append($("span",void 0,`${ia} ${ia===1?"seat":"seats"}`),$("strong",void 0,Ke));let oa=ge?o("checkout.confirmBooking","Confirm booking"):o("checkout.continue","Continue to payment"),Zt=$("button","sl-hco-pay",oa);Zt.type="submit";let eo=$("p","sl-hco-sr");eo.setAttribute("role","status");let ra=C=>{Zt.replaceChildren(V(),C),eo.textContent=C},Nr=$("p","sl-hco-trust");ge||Nr.appendChild(tn([...Mt.lock],12,"0 0 16 16")),Nr.append(ge?o("checkout.freeTrust","Free booking. Nothing is charged."):o("checkout.trust","Secure payment on the organizer\u2019s payment page. We never see your card.")),U.append(Ae,R(Ge,Oe,Ji,Zt,eo,Nr));let sa=null,aa=()=>{let C=X.expiresAt-Date.now(),_=Da(C);M.textContent=_,v.setAttribute("aria-label",o("checkout.heldFor","Seats held for {time}",{time:_}));let W=C<=nm;v.classList.toggle("is-warn",W),Oe.hidden=!W||!Ge.hidden,W&&(Oe.textContent=o("checkout.expiringSoon","Your seats are held for {time}. Finish soon to keep them.",{time:_}));let Z=C<=3e4?30:W?120:null;Z&&sa!==Z&&(sa=Z,F.textContent=Oe.textContent),C<=0&&z(o("checkout.expiredBody","The hold on {seats} ran out before payment started.",{seats:S.map(Ve=>Ve.label).join(", ")}),"expired")},Jh=()=>{Number.isFinite(X.expiresAt)&&(a(),v.hidden=!1,aa(),i=setInterval(aa,1e3))},to=!1,eu=async()=>{if(!to){to=!0,Ge.hidden=!0,Se.disabled=!0,Zt.disabled=!0,ra(ge?o("checkout.confirmingBooking","Confirming your booking\u2026"):o("checkout.opening","Opening secure payment\u2026"));try{let C={holdId:X.holdId,buyerEmail:ke.value.trim(),...Ie.value.trim()?{buyerName:Ie.value.trim()}:{},...ie.payload(),bookingFormVersion:1},_=0,W;for(;;)try{W=await n.startSession(C);break}catch(Ve){if(!e)return;if(_>=_a||!$r(Ve))throw Ve;if(_+=1,ra(ge?o("checkout.busyRetryingBooking","Busy right now. Still confirming your booking\u2026"):o("checkout.busyRetryingPayment","Busy right now. Still opening secure payment\u2026")),await new Promise($e=>setTimeout($e,Na(Ve))),!e)return}if(!e)return;if(W.status==="confirmed"){ne(W.orderId,!0);return}let Z=so(W.redirectUrl);if(Z){Yu(W.orderId,n.eventKey),a(),v.hidden=!0,Q(O(g({tone:"neutral",icon:tn([...Mt.card],24,"0 0 24 24"),title:o("checkout.redirectTitle","Taking you to secure payment"),text:o("checkout.redirectBody","You\u2019ll pay {amount} on the organizer\u2019s payment page, then come back here for your tickets.",{amount:Ke}),note:o("checkout.dontClose","Don\u2019t close this tab.")}))),window.location.assign(Z);return}z(nn("gateway_unavailable"))}catch(C){n.onError?.(C);let _=C;if(_?.code==="booking_form_incomplete"&&ie.element){Dr(),ie.showServerErrors(_.fields);return}if($r(_)){Dr(),Mn(ge?o("checkout.busyFailedBooking",nn("checkout_busy",{free:!0})):o("checkout.busyFailedPayment",nn("checkout_busy"))),Zt.textContent=o("checkout.tryAgain","Try again");return}if(_?.code==="hold_not_active"||_?.code==="hold_not_found"){z(nn(_.code),"expired");return}if(_?.code==="seats_unavailable"){z(o("checkout.seatsUnavailable",nn(_.code)),"taken");return}z(nn(_?.code,_))}}};U.addEventListener("submit",C=>{if(C.preventDefault(),to)return;let _=le();oe.setError(_?null:o("checkout.error.email","Enter an email like name@example.com."));let W=ie.validate();if(!_){Mn(o("bookingForm.fixErrors","Some details need attention before you continue.")),ke.focus();return}if(!W){Mn(o("bookingForm.fixErrors","Some details need attention before you continue."));return}eu()});let Dr=()=>{T.textContent=n.event?.name?.trim()||o("checkout.title","Checkout"),Ge.hidden=!0,Ge.textContent="",to=!1,Se.disabled=!1,Zt.disabled=!1,Zt.textContent=oa,eo.textContent="",N(!0),Q(U),Jh()};return Dr(),n.root.appendChild(r),(typeof window.matchMedia!="function"||window.matchMedia("(min-width: 561px)").matches)&&ke.focus(),{destroy:l}}var Uu,qu,Ra,Wu,Xu,_a,Qu,Ju,em,Ia,Mt,nm,Fa=io(()=>{"use strict";Vr();Ha();Uu=9e4,qu=2e3,Ra="seatlayer-checkout-style",Wu="@seatlayer/pending-checkout/v1";Xu=`
2
2
  /* Three rows: a header naming the event with the hold's countdown, a body that
3
3
  scrolls, and a footer that never does, so the total and the one primary
4
4
  button are always on screen however long the organizer's form is. On a
@@ -119,8 +119,6 @@ textarea.sl-hco-input{min-height:76px;resize:vertical}
119
119
  .sl-hco-check input{flex:none;width:18px;height:18px;margin:1px 0 0;accent-color:var(--sl-accent)}
120
120
  .sl-hco-check input:focus-visible{outline:2px solid transparent;box-shadow:0 0 0 1px var(--sl-accent),0 0 0 4px color-mix(in srgb, var(--sl-accent) 24%, transparent);border-radius:4px}
121
121
  .sl-hco-check .sl-hco-label-row{justify-content:flex-start}
122
- .sl-hco-note{margin:16px 0 0;font-size:11.5px;line-height:1.5;color:var(--sl-muted)}
123
- .sl-hco-note a{color:inherit;text-decoration:underline;text-underline-offset:2px}
124
122
  .sl-hco-foot{position:relative;z-index:1;flex:none;padding:12px 16px 14px;background:var(--sl-surface);border-top:1px solid var(--sl-line)}
125
123
  .sl-hco-alert{margin:0 0 10px;padding:9px 12px;font-size:13px;line-height:19px;border-radius:calc(var(--sl-radius) * .55)}
126
124
  .sl-hco-alert b{display:block;font-weight:650}
@@ -182,7 +180,7 @@ textarea.sl-hco-input{min-height:76px;resize:vertical}
182
180
  .sl-hco-order:not([data-open]) .sl-hco-order-full{display:none}
183
181
  .sl-hco-order{padding-top:0}
184
182
  }
185
- `;Gs=3,zh=1,jh=400,Kh=3e3;js="http://www.w3.org/2000/svg";yt={back:["M12.5 4.5 7 10l5.5 5.5"],clock:["M10 2.8a7.2 7.2 0 1 1 0 14.4a7.2 7.2 0 1 1 0-14.4","M10 6.2V10l2.6 1.7"],down:["m5 7.5 5 5 5-5"],lock:["M4.2 8.8h7.6a1.4 1.4 0 0 1 1.4 1.4v4.4a1.4 1.4 0 0 1-1.4 1.4H4.2a1.4 1.4 0 0 1-1.4-1.4v-4.4a1.4 1.4 0 0 1 1.4-1.4z","M5.4 8.8V6.6a2.6 2.6 0 0 1 5.2 0v2.2"],hour:["M12 3a9 9 0 1 1 0 18a9 9 0 1 1 0-18","M12 7v5l3 2"],seat:["M6 11V6a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v5M4 11h16v4H4zM6 15v4M18 15v4"],card:["M5 5.5h14a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-9a2 2 0 0 1 2-2z","M3 10h18M7 15h3"],alert:["M12 3a9 9 0 1 1 0 18a9 9 0 1 1 0-18","M12 7.5v5.5M12 16.5v.1"]},Uh=12e4});var ia={};Qo(ia,{applyNotice:()=>nu,bannerHtml:()=>na,eventEndedWhen:()=>ta,finishing:()=>Zh,note:()=>eu,salesView:()=>ea,sync:()=>tu,translate:()=>Wh,view:()=>Qh,words:()=>Jh});function Wh(n,e){rt=n,Js=e}function ea(n,e,t=!1){return!n||t?null:e==="ended"?"ended":e==="paused"||e==="live"?"closed":null}function Zh(n){return Ft(n)==="closed"&&!!n.hold}function Jh(n){let e=Ft(n);return e?{pill:rt(e==="ended"?"picker.eventEndedTitle":"picker.salesCloseTitle"),cta:rt("picker.salesClosedCta"),toast:rt(e==="ended"?"picker.eventEndedToast":"picker.salesCloseTap")}:null}function eu(n){let e=Ft(n);return e?{heading:rt(e==="ended"?"picker.eventEndedTitle":"picker.salesCloseTitle"),sentence:""}:null}function ta(n){let e=n.salesInfo?.startsAt;if(typeof e!="number"||!Number.isFinite(e))return"";let t=i=>{try{return new Date(e).toLocaleString(n.opts.locale,{...i,...n.eventTimezone?{timeZone:n.eventTimezone}:{}})}catch{return new Date(e).toLocaleString(n.opts.locale,i)}};return rt("picker.eventEndedWhen",{date:t({weekday:"short",day:"numeric",month:"short"}),time:t({hour:"numeric",minute:"2-digit"})})}function na(n,e){let t=e==="closed"&&n.hold?n.heldTicketCount():0,i=e==="ended"?"flag":t?"cart":"lock",o=rt(e==="ended"?"picker.eventEndedTitle":"picker.salesCloseTitle"),r=e==="ended"?ta(n):t?Js("picker.salesCloseHeld",t):n.salesInfo?.venueSelling?rt("picker.salesCloseVenue"):"";return`<span class="sl-sales-ic${t?" held":""}" aria-hidden="true"><svg viewBox="0 0 24 24">${Xh[i]}</svg></span><span class="sl-sales-copy"><b>${Qs(o)}</b>${r?`<span>${Qs(r)}</span>`:""}</span>`}function tu(n){let e=n.root;if(!e)return;let t=e.ownerDocument;if(!t.getElementById(Xs)){let a=t.createElement("style");a.id=Xs,a.textContent=Yh,t.head.appendChild(a)}let i=Ft(n),o=e.querySelector(".sl-sales-banner");if(!i){e.removeAttribute("data-sales-view"),o?.remove();return}e.setAttribute("data-sales-view",i);let r=n.els.map;if(!r)return;o||(o=t.createElement("div"),o.className="sl-sales-banner",o.setAttribute("role","status"),r.appendChild(o));let s=na(n,i);o.innerHTML!==s&&(o.innerHTML=s)}function nu(n,e){let t=e.state,i=Number(e.revision)||0;if(n.opts.readOnly||n.destroyed||i<(Zs.get(n)??-1/0)||t!=="live"&&t!=="paused"&&t!=="ended")return;if(Zs.set(n,i),t==="live"){n.salesState=t,n.salesClosed&&(n.salesClosed=!1,n.applySalesClosed());return}let o=Ft(n);if(n.salesState=t,!n.salesClosed){let s=new Set((n.hold?.items??[]).map(l=>l.label)),a=n.controller.getSelection().filter(l=>!s.has(l.label)).map(l=>l.id);a.length&&n.controller.deselect(a),n.dismissConfirm(),n.salesClosed=!0}n.applySalesClosed();let r=Ft(n);r&&r!==o&&n.toast(rt(r==="ended"?"picker.eventEndedToast":"picker.salesCloseSwitch"),"neutral")}var rt,Js,Xs,Yh,Xh,Qs,Ft,Qh,Zs,oa=Mi(()=>{"use strict";rt=n=>n,Js=n=>n;Xs="seatlayer-sales-style",Yh=`.sl-picker[data-sales-view] .sl-map-host canvas{filter:grayscale(1);opacity:.42}
183
+ `;_a=3,Qu=1,Ju=400,em=3e3;Ia="http://www.w3.org/2000/svg";Mt={back:["M12.5 4.5 7 10l5.5 5.5"],clock:["M10 2.8a7.2 7.2 0 1 1 0 14.4a7.2 7.2 0 1 1 0-14.4","M10 6.2V10l2.6 1.7"],down:["m5 7.5 5 5 5-5"],lock:["M4.2 8.8h7.6a1.4 1.4 0 0 1 1.4 1.4v4.4a1.4 1.4 0 0 1-1.4 1.4H4.2a1.4 1.4 0 0 1-1.4-1.4v-4.4a1.4 1.4 0 0 1 1.4-1.4z","M5.4 8.8V6.6a2.6 2.6 0 0 1 5.2 0v2.2"],hour:["M12 3a9 9 0 1 1 0 18a9 9 0 1 1 0-18","M12 7v5l3 2"],seat:["M6 11V6a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v5M4 11h16v4H4zM6 15v4M18 15v4"],card:["M5 5.5h14a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-9a2 2 0 0 1 2-2z","M3 10h18M7 15h3"],alert:["M12 3a9 9 0 1 1 0 18a9 9 0 1 1 0-18","M12 7.5v5.5M12 16.5v.1"]},nm=12e4});var qa={};Br(qa,{applyNotice:()=>hm,bannerHtml:()=>Ua,eventEndedWhen:()=>Ga,finishing:()=>lm,note:()=>dm,salesView:()=>Ka,sync:()=>pm,translate:()=>om,view:()=>am,words:()=>cm});function om(n,e){ut=n,ja=e}function Ka(n,e,t=!1){return!n||t?null:e==="ended"?"ended":e==="paused"||e==="live"?"closed":null}function lm(n){return on(n)==="closed"&&!!n.hold}function cm(n){let e=on(n);return e?{pill:ut(e==="ended"?"picker.eventEndedTitle":"picker.salesCloseTitle"),cta:ut("picker.salesClosedCta"),toast:ut(e==="ended"?"picker.eventEndedToast":"picker.salesCloseTap")}:null}function dm(n){let e=on(n);return e?{heading:ut(e==="ended"?"picker.eventEndedTitle":"picker.salesCloseTitle"),sentence:""}:null}function Ga(n){let e=n.salesInfo?.startsAt;if(typeof e!="number"||!Number.isFinite(e))return"";let t=i=>{try{return new Date(e).toLocaleString(n.opts.locale,{...i,...n.eventTimezone?{timeZone:n.eventTimezone}:{}})}catch{return new Date(e).toLocaleString(n.opts.locale,i)}};return ut("picker.eventEndedWhen",{date:t({weekday:"short",day:"numeric",month:"short"}),time:t({hour:"numeric",minute:"2-digit"})})}function Ua(n,e){let t=e==="closed"&&n.hold?n.heldTicketCount():0,i=e==="ended"?"flag":t?"cart":"lock",o=ut(e==="ended"?"picker.eventEndedTitle":"picker.salesCloseTitle"),r=e==="ended"?Ga(n):t?ja("picker.salesCloseHeld",t):n.salesInfo?.venueSelling?ut("picker.salesCloseVenue"):"";return`<span class="sl-sales-ic${t?" held":""}" aria-hidden="true"><svg viewBox="0 0 24 24">${sm[i]}</svg></span><span class="sl-sales-copy"><b>${$a(o)}</b>${r?`<span>${$a(r)}</span>`:""}</span>`}function pm(n){let e=n.root;if(!e)return;let t=e.ownerDocument;if(!t.getElementById(Va)){let a=t.createElement("style");a.id=Va,a.textContent=rm,t.head.appendChild(a)}let i=on(n),o=e.querySelector(".sl-sales-banner");if(!i){e.removeAttribute("data-sales-view"),o?.remove();return}e.setAttribute("data-sales-view",i);let r=n.els.map;if(!r)return;o||(o=t.createElement("div"),o.className="sl-sales-banner",o.setAttribute("role","status"),r.appendChild(o));let s=Ua(n,i);o.innerHTML!==s&&(o.innerHTML=s)}function hm(n,e){let t=e.state,i=Number(e.revision)||0;if(n.opts.readOnly||n.destroyed||i<(za.get(n)??-1/0)||t!=="live"&&t!=="paused"&&t!=="ended")return;if(za.set(n,i),t==="live"){n.salesState=t,n.salesClosed&&(n.salesClosed=!1,n.applySalesClosed());return}let o=on(n);if(n.salesState=t,!n.salesClosed){let s=new Set((n.hold?.items??[]).map(l=>l.label)),a=n.controller.getSelection().filter(l=>!s.has(l.label)).map(l=>l.id);a.length&&n.controller.deselect(a),n.dismissConfirm(),n.salesClosed=!0}n.applySalesClosed();let r=on(n);r&&r!==o&&n.toast(ut(r==="ended"?"picker.eventEndedToast":"picker.salesCloseSwitch"),"neutral")}var ut,ja,Va,rm,sm,$a,on,am,za,Wa=io(()=>{"use strict";ut=n=>n,ja=n=>n;Va="seatlayer-sales-style",rm=`.sl-picker[data-sales-view] .sl-map-host canvas{filter:grayscale(1);opacity:.42}
186
184
  .sl-picker[data-sales-view] .sl-prices,.sl-picker[data-sales-view] .sl-rail-scroll{filter:grayscale(1);opacity:.6}
187
185
  .sl-picker[data-sales-view] .sl-soldout{display:none}
188
186
  .sl-sales-banner{position:absolute;top:62px;left:50%;transform:translateX(-50%);z-index:8;box-sizing:border-box;width:min(420px,calc(100% - 32px));display:flex;gap:12px;align-items:flex-start;padding:14px 16px;border-radius:14px;background:var(--sl-surface);border:1px solid var(--sl-line);color:var(--sl-text);box-shadow:0 10px 30px rgba(15,23,42,.12)}
@@ -192,8 +190,8 @@ textarea.sl-hco-input{min-height:76px;resize:vertical}
192
190
  .sl-sales-ic svg{width:18px;height:18px;stroke:currentColor;stroke-width:2;fill:none;stroke-linecap:round;stroke-linejoin:round}
193
191
  .sl-sales-copy{flex:1;min-width:0}
194
192
  .sl-sales-copy b{display:block;font-size:15px;font-weight:750;line-height:1.3}
195
- .sl-sales-copy span{display:block;margin-top:3px;font-size:12.5px;line-height:1.45;color:var(--sl-muted)}`,Xh={lock:'<rect x="5" y="11" width="14" height="9" rx="2"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/>',flag:'<path d="M5 21V4M5 4h11l-2 4 2 4H5"/>',cart:'<circle cx="9" cy="20" r="1.4"/><circle cx="17" cy="20" r="1.4"/><path d="M3 4h2l2.4 11h10.2L20 8H6.2"/>'},Qs=n=>n.replace(/[&<>"']/g,e=>`&#${e.charCodeAt(0)};`);Ft=n=>ea(n.salesClosed,n.salesState,!!n.opts.readOnly),Qh=Ft;Zs=new WeakMap});var vg={};Qo(vg,{ApiError:()=>ie,BuyerAccessContext:()=>De,BuyerAccessUnavailableError:()=>he,BuyerRealtimeClient:()=>Ze,EmbeddedDesigner:()=>ko,PerformanceGroupDestroyedError:()=>ye,PerformanceGroupPicker:()=>Go,SEATING_CHART_CALLBACK_PROPS:()=>Mr,SEATING_CHART_HANDLE_METHODS:()=>Cr,SEATING_CHART_IDENTITY_PROPS:()=>Ar,SEATING_CHART_VALUE_PROPS:()=>Pr,SeasonApiError:()=>te,SeasonPicker:()=>Wo,SeasonPublicSessionRefused:()=>bi,SeasonRecoveryTimeoutError:()=>wi,SeatPicker:()=>dt,SeatingChart:()=>xo,attachPickerFrame:()=>zp,bindSeatingChartHandle:()=>Bl,buildSeatingChartOptions:()=>Fl,createBuyerAccessContext:()=>xn,createControllerSink:()=>cn,parseTicketOfferAvailability:()=>To,prewarmSeatPicker:()=>bp,shortOperationReference:()=>Bn,ticketOfferPrices:()=>Ir});module.exports=Xp(vg);var J=require("@seatlayer/core");var Qp=/^[0-9A-Za-z.+-]{1,24}$/,Zp=Qp.test("0.109.2")?"0.109.2":"",Jp={host:"web",platform:"web",bundle:Zp,protocol:0,chromeOwner:"web"},eh={...Jp},Li=null,ks=null;function th(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():0}function nh(){let n=e=>Math.max(0,Math.round(e*100)/100);return{bootMs:n(th()),documentMs:Li==null?0:n(Li),handshakeMs:Li==null||ks==null?0:n(ks-Li)}}function Ss(){let{host:n,platform:e,bundle:t,protocol:i,chromeOwner:o}=eh,r=nh();return{host:n,platform:e,...t?{bundle:t}:{},...i?{protocol:i}:{},chromeOwner:o,bootMs:r.bootMs,documentMs:r.documentMs,handshakeMs:r.handshakeMs}}var Ts=new Set,Es=new Map;function ot(n){return Ts.has(n)?"repeat":"cold"}function Hi(n){let e=ot(n);return Ts.add(n),e}function Be(n){return typeof n=="number"&&Number.isFinite(n)&&n>=0?Math.round(n):0}function Jn(){return typeof location>"u"?!1:/^(localhost|127\.0\.0\.1|\[::1\])$/i.test(location.hostname)}function ih(n){if(!/^[A-Za-z0-9_-]{1,80}$/.test(n.event))return null;let e=n.performanceProfile??{};return{event:n.event,scope:n.scope,surface:n.surface,outcome:n.outcome,stage:n.stage?.slice(0,32)??"",ms:Be(n.ms),api:Be(e.loadChartAndStatuses)||Be(e.loadChart),scene:Be(e.buildScene),panel:Be(e.buildBuyerControls),paint:Be(e.firstPaint),normalize:Be(e.normalizeBuyerModel),renderer:Be(e.createRenderer),seats:Be(n.seats),floors:Be(n.floors),view:n.view??"map",load:n.load??ot(n.event),transport:n.transport??"pubapi",...Ss(),availabilityMs:Be(e.loadStatuses),...typeof n.revealWaitMs=="number"?{revealWaitMs:Be(n.revealWaitMs)}:{},...typeof n.handoverMs=="number"?{handoverMs:Be(n.handoverMs)}:{},mounts:(Es.get(n.event)??0)+1,reconnects:Be(n.reconnects)}}var oh=new Set;function Qe(n){let e=ih(n);if(e){Es.set(n.event,e.mounts);for(let t of oh)try{t(e)}catch{}typeof fetch>"u"||Jn()||fetch(`${n.apiBase.replace(/\/+$/,"")}/pub/telemetry/chart-load`,{method:"POST",headers:{"Content-Type":"application/json","X-SeatLayer-Client":"1"},body:JSON.stringify(e),credentials:"omit",keepalive:!0}).catch(()=>{})}}var rh="realtime.fallback_polling",Cs=new Set;function sh(n){let e=/^(wss?):\/\/([^/]+)(.*?)\/pub\/events\/([^/?#]+)\/subscribe(?:[?#]|$)/.exec(n);if(!e)return null;let t;try{t=decodeURIComponent(e[4])}catch{return null}return/^[A-Za-z0-9_-]{1,80}$/.test(t)?{apiBase:`${e[1]==="wss"?"https":"http"}://${e[2]}${e[3]}`,eventKey:t}:null}function As(n){let e=sh(n);return!e||Cs.has(e.eventKey)||(Cs.add(e.eventKey),typeof fetch>"u"||Jn())?!1:(fetch(`${e.apiBase}/pub/telemetry/client-error`,{method:"POST",headers:{"Content-Type":"application/json","X-SeatLayer-Client":"1"},body:JSON.stringify({surface:"picker",errorCode:rh,eventKey:e.eventKey}),credentials:"omit",keepalive:!0}).catch(()=>{}),!0)}var _t="seatlayer.v1",Ps="\0",Ms=4401,ah=15e3,lh=25e3,ch=1e4,Ls=5e3,dh=JSON.stringify({type:"resume"}),ph=3e4,hh=6e4,uh=["pointermove","touchstart","keydown"],mh=3,fh=15e3,Hs=6e4;function gh(n){let e=typeof n.default=="string"?n.default:"free",t={};if(n.seats&&typeof n.seats=="object")for(let[i,o]of Object.entries(n.seats))typeof o=="string"&&o!==e&&(t[i]=o);return{default:e,exceptions:t}}function bh(n,e){if(!n||n.default!==e.default)return null;let t=[];for(let[i,o]of Object.entries(e.exceptions))n.exceptions[i]!==o&&t.push({label:i,status:o});for(let i of Object.keys(n.exceptions))i in e.exceptions||t.push({label:i,status:e.default});return t}function yh(n,e){for(let t of e)t.status===n.default?delete n.exceptions[t.label]:n.exceptions[t.label]=t.status}function Rs(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 Ze=class{constructor(e){this.ws=null;this.watched=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.failedUpgrades=0;this.pollTimer=null;this.fellBack=!1;this.lastWake=-1/0;this.lastInput=0;this.detachWake=null;this.reconnectCount=0;this.opts=e,typeof e.url=="string"&&Rs(e.url)}get polling(){return this.pollTimer!==null}get protocol(){return this.ws?this.v1?"v1":"legacy":null}get snapshotVersion(){return this.version}start(){this.stopped&&(this.stopped=!1,this.attachWake(),this.connect())}stop(){this.stopped=!0,this.clearTimers(),this.stopPolling(),this.detachWake?.(),this.detachWake=null;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.failedUpgrades=0,this.start()}async connect(){if(this.stopped)return;let e=[_t];if(this.opts.mintTicket){let a;try{a=await this.opts.mintTicket()}catch(l){this.reportIfAccessError(l),this.scheduleReconnect();return}if(this.stopped)return;a?.protocols?.length?(e=[...a.protocols],e.includes(_t)||e.unshift(_t)):a?.ticket&&(e=[_t,`tkt.${a.ticket}`])}let t=this.version!==null;t&&e.push(`sv.${this.version}`);let i=typeof this.opts.url=="function"?this.opts.url():this.opts.url,o=this.useQueryMarker?`${i}${i.includes("?")?"&":"?"}pv=1`:i;Rs(o);let r;try{r=(this.opts.socketFactory??((l,c)=>new WebSocket(l,c)))(o,e)}catch{this.upgradeFailed(),this.scheduleReconnect();return}this.ws=r;let s=!1;r.onopen=()=>{this.ws===r&&(s=!0,this.attempt=0,this.failedUpgrades=0,this.stopPolling(),this.v1=r.protocol===_t,this.v1||(this.useQueryMarker=!0),this.startKeepalive(r),this.watched=null,this.watchHold(this.opts.heldHoldId?.()??null),t?this.resumeTimer=setTimeout(()=>{this.resumeTimer=null,this.opts.sink.resync()},Ls):this.resumeTimer=setTimeout(()=>{this.resumeTimer=null,this.opts.sink.resync({reason:"connect"})},Ls))},r.onmessage=a=>{if(this.ws!==r)return;let l;try{l=JSON.parse(typeof a.data=="string"?a.data:"")}catch{return}!l||typeof l!="object"||this.handleFrame(l)},r.onclose=a=>{if(this.ws===r){if(this.ws=null,this.clearTimers(),!s&&a?.code!==Ms&&this.upgradeFailed(),a?.code===Ms){if(a.reason==="access_expired"){this.scheduleReconnect();return}if(a.reason==="idle_expired"&&this.opts.onIdleExpired){this.stopped=!0,this.stopPolling(),this.opts.onIdleExpired();return}this.stopped=!0,this.stopPolling(),this.opts.onAccessUnavailable?.({reason:"revoked",code:"access_revoked",retryable:!1});return}this.scheduleReconnect()}},r.onerror=()=>{try{r.close()}catch{}}}watchHold(e){let t=this.ws;if(!(!e||e===this.watched||!t||t.readyState!==1))try{t.send(JSON.stringify({type:"watch",holdId:e})),this.watched=e}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(t==="sales"){this.opts.sink.onSales?.(e);return}if(Array.isArray(e.hidden)||Array.isArray(e.closed)){let i=Array.isArray(e.hidden)?e.hidden:[],o=Array.isArray(e.closed)?e.closed:[],r=i.join(Ps),s=o.join(Ps);(r!==this.hidden||s!==this.closedSections)&&(this.hidden=r,this.closedSections=s,this.opts.sink.onSections?.(i,o,{withInventory:t==="snapshot"||!!e.seats}))}if(t!=="hidden"){if(t==="hold"){typeof e.holdId=="string"&&typeof e.state=="string"&&this.opts.onHoldState?.(e.holdId,e.state);return}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=gh(e),o=bh(this.projection,i);this.projection=i,o===null?this.opts.sink.applyProjection?this.opts.sink.applyProjection(i):this.opts.sink.resync():o.length&&this.opts.sink.applyStatuses(o);return}if(t==="delta"&&Array.isArray(e.changes)){this.answered();let i=e.changes.filter(o=>typeof o?.label=="string"&&typeof o?.status=="string").map(o=>({label:o.label,status:o.status}));if(!i.length)return;this.projection&&yh(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.stopPolling(),this.opts.onAccessUnavailable?.({reason:t??"invalid",code:e.code,status:e.status,retryable:t==="paused"}))}upgradeFailed(){this.failedUpgrades+=1,this.failedUpgrades>=mh&&this.startPolling()}startPolling(){if(!(this.pollTimer||this.stopped)){if(!this.fellBack){this.fellBack=!0;try{this.opts.onFallbackPolling?.()}catch{}let e=typeof this.opts.url=="function"?this.opts.url():this.opts.url;As(e)}this.pollTimer=setInterval(()=>{if(this.stopped){this.stopPolling();return}typeof document<"u"&&document.hidden||Promise.resolve().then(()=>this.opts.poll?this.opts.poll():this.opts.sink.resync({reason:"frame"})).catch(()=>{})},fh)}}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}now(){return this.opts.now?this.opts.now():Date.now()}attachWake(){if(this.detachWake||typeof document>"u"||typeof window>"u"||typeof document.addEventListener!="function"||typeof window.addEventListener!="function")return;this.lastInput=this.now();let e=()=>{document.visibilityState==="visible"&&this.wake()},t=()=>{let r=this.now(),s=r-this.lastInput>=hh;this.lastInput=r,s&&this.wake()},i={capture:!0,passive:!0},o=r=>{document[r]("visibilitychange",e),window[r]("focus",e);for(let s of uh)document[r](s,t,i)};o("addEventListener"),this.detachWake=()=>o("removeEventListener")}wake(){let e=this.ws;if(!e||e.readyState!==1)return;let t=this.now();if(!(t-this.lastWake<ph)){try{e.send(dh)}catch{return}this.lastWake=t}}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{}},ch)}},lh)}scheduleReconnect(){if(this.stopped||this.reconnectTimer)return;let e=Math.min(this.attempt++,5),t=Math.min(1e3*2**e,ah),i=this.pollTimer?Hs/2+Math.random()*Hs/2:Math.random()*t;this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.reconnectCount+=1,this.connect()},i)}get reconnects(){return this.reconnectCount}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 vh(n){return n==="blocked"?"not_for_sale":n==="unavailable"?"held":n==="held"||n==="booked"||n==="free"||n==="not_for_sale"?n:"free"}var wh="#f43f5e";function cn(n,e={}){let t=i=>{let o=n.tableSelection(i);if(o)return o.physicalSeatIds;let r=n.idForLabel(i);return r?[r]:[]};return{applyStatuses(i){let o=new Set([...n.currentHold()?.labels??[],...e.ownLabels?.()??[]]),r={free:[],held:[],booked:[],not_for_sale:[]},s=[],a=[],l=new Map(n.getSelection().map(c=>[c.label,c.id]));for(let c of i){let d=t(c.label);if(!d.length)continue;let p=vh(c.status);if(r[p].push(...d),e.flashOnLiveChange&&p!=="free"&&!o.has(c.label)&&d.some(u=>n.getStatus(u)==="free"))for(let u of d)s.push({id:u,color:wh});p!=="free"&&!o.has(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 s)n.flashSeat(c.id,c.color);if(a.length){let c=a.flatMap(p=>t(p));c.length&&n.deselect(c);let d=i.some(p=>p.status==="blocked"&&a.includes(p.label));e.onSelectedObjectUnavailable?.(a,d?"ineligible":"taken")}e.onStatusChange?.()},...n.applyProjection?{applyProjection:i=>{n.applyProjection(i)}}:{},async resync(i){await(n.resync?n.resync(i):n.refresh())},onSections(i,o,r){r?.withInventory||(n.resync?n.resync({reason:"frame"}):n.refresh()),e.onSections?.(i,o,r)}}}var Nt="pricingContract=matrix-v1&pricingContract=seat-v1",ie=class extends Error{constructor(e,t,i,o,r,s,a,l){super(t),this.name="ApiError",this.status=e,this.code=i,this.conflicts=o,this.reason=r,this.retryAfterS=s,this.notice=a,l?.fields&&(this.fields=l.fields),typeof l?.retryable=="boolean"&&(this.retryable=l.retryable),l?.hint&&(this.hint=l.hint),l?.serverMessage&&(this.serverMessage=l.serverMessage)}},Is=10,Os=1;function ei(n,e){let t=(n??"").trim();if(t){let i=Number(t);if(Number.isFinite(i)&&i>=0)return Math.ceil(i);let o=Date.parse(t);if(Number.isFinite(o))return Math.max(0,Math.ceil((o-Date.now())/1e3))}if(typeof e=="number"&&Number.isFinite(e)&&e>=0)return Math.ceil(e)}function xh(n){let e=n;return!!e&&typeof e.ticketKey=="string"&&typeof e.label=="string"&&Number.isFinite(e.unitIndex)&&Number.isFinite(e.quantity)&&(e.displayLabel===void 0||typeof e.displayLabel=="string")}var kh={seat_conflict:"taken",conflict:"taken",channel_assignment_conflict:"ineligible",allocation_exhausted:"exhausted"};function Sh(){return typeof crypto>"u"?null:typeof crypto.randomUUID=="function"?crypto.randomUUID():typeof crypto.getRandomValues!="function"?null:Array.from(crypto.getRandomValues(new Uint8Array(18)),n=>n.toString(16).padStart(2,"0")).join("")}function Th(n,e){let t=e.map(i=>[i.label,i.tierId??null,i.quantity??null]).sort((i,o)=>i[0]<o[0]?-1:i[0]>o[0]?1:0);return JSON.stringify([n,t])}function Eh(n){return n instanceof ie?n.status===408||n.status===429||n.status>=500:!0}function _s(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`viewer_${Math.random().toString(36).slice(2)}${Date.now().toString(36)}`}var bt=class{constructor(e,t={}){this.base=e;this.viewerId=_s();this.holdAttempt=null;this.holdIdempotency=!0;this.ticketKeysByHold=new Map;this.access=t.access,this.onObjectUnavailable=t.onObjectUnavailable;let i=t.referral?.trim();this.referral=i?i.slice(0,120):void 0}rotateViewerId(){this.viewerId=_s()}async pickerIdleMinutes(){return null}get accessScoped(){return!!this.access?.configured}async request(e,t={},i={}){let o=t.method??"GET",r={},s;t.body!==void 0&&(r["Content-Type"]="application/json",s=JSON.stringify(t.body));let a=await this.access?.authorization(i.auth?"unauthorized":"initial");if(a&&(r.Authorization=a),t.idempotency){let u=this.holdAttemptKey(`${t.idempotency.binding}\0${a??""}`);t.idempotency.used(u??void 0),u&&(r["Idempotency-Key"]=u)}let l=o==="GET"||e.endsWith("/hold/resume")?new AbortController:null,c=l?setTimeout(()=>l.abort(),4e4):null,d,p;try{d=await fetch(`${this.base}${e}`,{method:o,headers:r,body:s,credentials:"omit",...l?{signal:l.signal}:{}}),p=(d.headers.get("content-type")??"").includes("application/json")?await d.json().catch(h=>{if(l?.signal.aborted)throw h;return null}):null}finally{c!==null&&clearTimeout(c)}if(!d.ok){let u=p,h=u?.code??u?.error,b=d.status===401&&h==="buyer_access_invalid"&&e.endsWith("/hold/resume");if(this.access?.configured&&!b&&(d.status===401||d.status===403||d.status===422)&&await this.access.handleFailure(d.status,h)&&!i.auth)return this.request(e,t,{...i,auth:!0});if(d.status===409){let T=h?kh[h]:void 0,w=u?.conflicts?.map(v=>v.label)??t.labels??[];T&&this.onObjectUnavailable?.({labels:w,reason:T,code:h})}let f;if(d.status===429&&(f=ei(d.headers.get("Retry-After"),u?.retryAfterSeconds)??Os,o==="GET"&&!i.rateLimit&&f<=Is))return await new Promise(T=>setTimeout(T,f*1e3)),this.request(e,t,{...i,rateLimit:!0});throw d.status===503&&(f=ei(d.headers.get("Retry-After"),u?.retryAfterSeconds)),new ie(d.status,u?.error??`request_failed_${d.status}`,h,u?.conflicts,u?.reason,f,typeof u?.notice=="string"&&u.notice?u.notice:void 0,{...Array.isArray(u?.fields)?{fields:u.fields}:{},...typeof u?.retryable=="boolean"?{retryable:u.retryable}:{},...typeof u?.hint=="string"&&u.hint?{hint:u.hint}:{},...typeof u?.message=="string"&&u.message?{serverMessage:u.message}:{}})}return p}async requestBlob(e,t={}){let i={},o=await this.access?.authorization(t.auth?"unauthorized":"initial");o&&(i.Authorization=o);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=ei(r.headers.get("Retry-After"),a?.retryAfterSeconds)??Os,!t.rateLimit&&c<=Is))return await new Promise(d=>setTimeout(d,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`)}eventConfiguration(e){return this.request(`/pub/events/${encodeURIComponent(e)}/event-configuration`)}reportViewEvidence(e,t){return this.request(`/pub/events/${encodeURIComponent(e)}/view-evidence-reports`,{method:"POST",body:{seatId:t.seatId,...t.evidenceId?{evidenceId:t.evidenceId}:{},...t.message?{message:t.message}:{}}})}asset(e,t){return/^[a-zA-Z0-9._-]+$/.test(t)?this.requestBlob(`/pub/events/${encodeURIComponent(e)}/assets/${encodeURIComponent(t)}`):Promise.reject(new ie(404,"not_found","not_found"))}async objects(e){return{...await this.request(`/pub/events/${encodeURIComponent(e)}/objects?compact=1&${Nt}`),fetchedAt:Date.now()}}hold(e,t,i,o){let r=`/pub/events/${encodeURIComponent(e)}/hold?${Nt}`,s={method:"POST",body:{selections:t,...i?{ttlMs:i}:{},...o?{replaceHoldId:o}:{},...this.referral?{referral:this.referral}:{}},labels:t.map(l=>l.label)};return(o||!this.holdIdempotency?this.request(r,s):this.keyedHold(r,s,Th(e,t))).then(l=>this.noteTicketKeys(l,o))}holdAttemptKey(e){if(this.holdAttempt?.binding===e)return this.holdAttempt.key;let t=Sh();return this.holdAttempt=t?{binding:e,key:t}:null,t}endHoldAttempt(e){e&&this.holdAttempt?.key===e&&(this.holdAttempt=null)}async keyedHold(e,t,i,o=!1){let r;try{let s=await this.request(e,{...t,idempotency:{binding:i,used:a=>{r=a}}});return this.endHoldAttempt(r),s}catch(s){if(Eh(s))throw s;this.endHoldAttempt(r);let a=s.code;if(a==="idempotency_key_reused"&&!o)return this.keyedHold(e,t,i,!0);if(a==="invalid_idempotency_key")return this.holdIdempotency=!1,this.request(e,t);throw s}}noteTicketKeys(e,t){if(t&&this.ticketKeysByHold.delete(t),!e?.holdId)return e;let i=Array.isArray(e.ticketKeys)&&e.ticketKeys.every(r=>typeof r=="string")?[...e.ticketKeys]:null,o=Array.isArray(e.ticketKeyDetails)&&e.ticketKeyDetails.every(xh)?e.ticketKeyDetails.map(({ticketKey:r,label:s,unitIndex:a,quantity:l,displayLabel:c})=>({ticketKey:r,label:s,unitIndex:a,quantity:l,...c?{displayLabel:c}:{}})):null;return i||o?this.ticketKeysByHold.set(e.holdId,{...i?{ticketKeys:i}:{},...o?{ticketKeyDetails:o}:{}}):this.ticketKeysByHold.delete(e.holdId),e}ticketKeysFor(e){let t=this.ticketKeysByHold.get(e);return t?{...t}:null}bestAvailable(e,t,i,o,r){return this.request(`/pub/events/${encodeURIComponent(e)}/best-available?${Nt}`,{method:"POST",body:{qty:t,...i?{categoryKey:i}:{},...o?{zoneId:o}:{},...r?{ttlMs:r}:{},...this.referral?{referral:this.referral}:{}}}).then(s=>this.noteTicketKeys(s))}resume(e,t){return this.request(`/pub/events/${encodeURIComponent(e)}/hold/resume`,{method:"POST",body:{holdId:t}}).then(i=>this.noteTicketKeys(i))}release(e,t,i){return this.holdAttempt=null,this.request(`/pub/events/${encodeURIComponent(e)}/release`,{method:"POST",body:{labels:t,holdId:i}}).then(o=>{let r=this.ticketKeysByHold.get(i);if(r){let s=new Set(o?.released??t);this.ticketKeysByHold.set(i,{...r.ticketKeys?{ticketKeys:r.ticketKeys.filter(a=>!s.has(a))}:{},...r.ticketKeyDetails?{ticketKeyDetails:r.ticketKeyDetails.filter(a=>!s.has(a.ticketKey))}:{}})}return o})}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?${Nt}${t?"&live=1":""}`)}startCheckout(e,t){return this.holdAttempt=null,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}&${Nt}`}socketUrl(e){return this.accessScoped?"":this.subscribeUrl(e)}socketProtocols(e){return this.accessScoped?[]:[_t]}createRealtime(e,t){return this.accessScoped?null:new Ze({url:this.subscribeUrl(e),sink:t})}};var ii=require("@seatlayer/core");var Oe=require("@seatlayer/core"),ba=require("@seatlayer/core/core/seatConfidence");var tr=require("@seatlayer/core"),hn=require("@seatlayer/core/core/cdnAsset");var Ch=/^data:image\/(?:png|jpe?g|webp|gif|avif);base64,[a-z0-9+/]+={0,2}$/i,Ah=/[\s"'<>`\\]/;function Ph(n){return n.startsWith("//")?!1:n.startsWith("/")||n.startsWith("./")||n.startsWith("../")}function Mh(){try{let n=typeof location>"u"?"":location.origin;return n&&n!=="null"?n:null}catch{return null}}function dn(n){if(typeof n!="string"||!n||n.length>2e6||n!==n.trim())return!1;if(n.startsWith("data:"))return Ch.test(n);if(Ah.test(n))return!1;let e=Mh();if(Ph(n)){if(!e)return!1;try{let t=new URL(n,e);return t.origin===e&&!t.username&&!t.password}catch{return!1}}try{let t=new URL(n);return t.username||t.password?!1:t.protocol==="https:"||e!=null&&t.origin===e}catch{return!1}}var ru=require("@seatlayer/core/core/cdnAsset");function y(n,e){let t=(0,tr.t)(n);return t===n?e:t}function Vt(){return globalThis.matchMedia?.("(pointer: coarse)").matches??!1?y("picker.dragToLookTouch","Drag to look \xB7 pinch to zoom \xB7 tap \u2715 to close"):y("picker.dragToLookMouse","Drag to look \xB7 pinch or scroll to zoom \xB7 Esc to close")}function Oi(){return{rotate:y("picker.dragToRotateVenue","Drag to rotate the venue"),move:y("picker.dragToMoveVenue","Drag to move the venue"),zoomIn:y("picker.zoomIn","Zoom in"),zoomOut:y("picker.zoomOut","Zoom out"),fitView:y("picker.fitWholeVenue","Show whole venue")}}function sa(n,e){let t=e?n.toLocaleUpperCase(e):n.toLocaleUpperCase(),i=e?n.toLocaleLowerCase(e):n.toLocaleLowerCase();if(n!==t||t===i)return n;let o=[...i][0]??"";return(e?o.toLocaleUpperCase(e):o.toLocaleUpperCase())+i.slice(o.length)}function aa(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 q(n){return String(n??"").replace(/[&<>"']/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[e])}function la(n,e,t){let i=e.find(r=>dn(r))??null;if(n.replaceChildren(),!i)return n.textContent=t.slice(0,1).toUpperCase(),null;let o=document.createElement("img");return o.alt="",o.referrerPolicy="no-referrer",o.src=i,n.appendChild(o),i}var pn=null;function _i(){if(pn!==null)return pn;try{if(typeof document>"u")return pn=!1;pn=!!document.createElement("canvas").getContext("webgl2")}catch{pn=!1}return pn}var ti=null;function ni(){return ti||(ti=(typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?(0,hn.importCdnAsset)("seatlayer-view3d.mjs"):import("@seatlayer/core/view3d")).catch(e=>{throw ti=null,e}),ti)}function Ni(){(typeof navigator>"u"?void 0:navigator.connection)?.saveData||ni().catch(()=>{})}async function Di(){return typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?(0,hn.importCdnAsset)("seatlayer-panorama.mjs"):import("@seatlayer/core")}async function un(){return typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?(0,hn.importCdnAsset)("seatlayer-checkout.mjs"):Promise.resolve().then(()=>(Ys(),Ws))}async function ca(){return typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?(0,hn.importCdnAsset)("seatlayer-sales.mjs"):Promise.resolve().then(()=>(oa(),ia))}function da(n){return n==="unavailable_for_event"||n==="payments_off_for_event"?n:"not_configured"}function pa(n){return n.lineItems.reduce((e,t)=>e+t.quantity,0)}function nr(n,e){if(n.objectType!=="ga")return n.displayLabel??n.label;let t=e.find(i=>i.id===n.objectId);return n.displayLabel??t?.displayLabel??t?.label??y("picker.generalAdmission","General admission")}function iu(n,e){let t=new Map;for(let i of n){let o=i.rowLabel&&i.seatNumber?[i.sectionLabel,`${y("picker.row","Row")} ${i.rowLabel}`,`${y("picker.seat","Seat")} ${i.seatNumber}`].filter(Boolean).join(" \xB7 "):nr(i,e),r=[i.categoryLabel,i.tierLabel].filter(Boolean).join(" \xB7 "),s=Math.max(1,Math.floor(i.quantity||1)),a=`${o}\0${r}`,l=t.get(a)??{label:o,detail:r,units:0,amount:0};l.units+=s,l.amount+=i.unitPrice*s,t.set(a,l)}return[...t.values()].map(i=>({label:i.units>1?`${i.label} \xD7${i.units}`:i.label,...i.detail?{detail:i.detail}:{},amount:i.amount}))}var ra=(n,e,t)=>(0,tr.t)("picker.bookingForm.guestOfCount",{label:n,index:e,total:t});function ou(n,e,t=[]){let i=new Map,o=[];for(let d of n.lineItems){let p=nr(d,t),u=Math.max(1,Math.floor(d.quantity)||1);if(d.objectType!=="ga"&&!(d.objectType==="table"&&u>1)){o.push({key:d.label,name:p,unitIndex:1,quantity:1});continue}for(let h=1;h<=u;h+=1){let b=(i.get(d.label)??0)+1;i.set(d.label,b),o.push({key:`${d.label}#${b}`,name:p,unitIndex:h,quantity:u})}}let r=e?.ticketKeyDetails??[],s=e?.ticketKeys??r.map(d=>d.ticketKey),a=(s.length===o.length?s:o.map(d=>d.key)).map(d=>{let p=o.find(h=>h.key===d),u=r.find(h=>h.ticketKey===d);return{key:d,name:u?.displayLabel??p?.name,unitIndex:u?.unitIndex??p?.unitIndex??1,quantity:u?.quantity??p?.quantity??1}}),l=new Map;for(let d of a)d.name&&d.quantity<=1&&l.set(d.name,(l.get(d.name)??0)+1);let c=new Map;return a.map(({key:d,name:p,unitIndex:u,quantity:h})=>{if(!p)return{key:d};if(h>1)return{key:d,title:ra(p,u,h)};let b=(c.get(p)??0)+1;c.set(p,b);let f=l.get(p)??1;return{key:d,title:f>1?ra(p,b,f):p}})}function ha(n,e,t,i,o=[]){let r=new Map;for(let s of n.lineItems){let a=nr(s,o);r.set(a,(r.get(a)??0)+1)}return{kind:"pay",provider:e,order:{holdId:n.holdId,expiresAt:n.expiresAt,currency:n.currency,total:n.total,labels:[...r].map(([s,a])=>a>1?`${s} \xD7${a}`:s),tickets:ou(n,i,o),lines:iu(n.lineItems,o)},bookingForm:t?.bookingForm??null,...t?.bookingMode==="free"?{free:!0}:{}}}function ua(n){return String(n?.code).startsWith("booking_form_")}function Bi(n,e,t){let i={month:"short",day:"numeric",hour:"numeric",minute:"2-digit"},o=new Date(n);if(e)try{return o.toLocaleString(t,{...i,timeZone:e})}catch{}return o.toLocaleString(t,i)}function ir(n){return/early[\s-]*bird/i.test(n?.trim()??"")}function ma(n){return ir(n)?'<svg class="sl-offer-icon sl-offer-icon-discount" viewBox="0 0 32 32" aria-hidden="true"><defs><linearGradient id="sl-offer-discount-gradient" x1="29.492" y1="0" x2="20.028" y2="36.183" gradientUnits="userSpaceOnUse"><stop stop-color="#FD6D00"/><stop offset="1" stop-color="#F8B302"/></linearGradient></defs><path d="M16 22.751a1.071 1.071 0 1 0 0-2.142 1.071 1.071 0 0 0 0 2.142ZM16 11.39a1.071 1.071 0 1 0 0-2.141 1.071 1.071 0 0 0 0 2.141Z" fill="url(#sl-offer-discount-gradient)"/><path d="M31.137.863A2.928 2.928 0 0 0 29.054 0H17.836c-.787 0-1.527.307-2.083.863L.863 15.753A2.93 2.93 0 0 0 0 17.836c0 .787.307 1.527.863 2.083l11.218 11.218A2.927 2.927 0 0 0 14.164 32c.787 0 1.527-.307 2.083-.863l14.89-14.89A2.928 2.928 0 0 0 32 14.164V2.946c0-.788-.307-1.527-.863-2.083ZM16 7.374a2.946 2.946 0 1 1 0 5.891 2.946 2.946 0 0 1 0-5.891Zm0 17.252a2.946 2.946 0 1 1 0-5.891 2.946 2.946 0 0 1 0 5.891Zm6.025-7.689H9.975a.938.938 0 0 1 0-1.875h12.05a.938.938 0 0 1 0 1.875Zm4.017-10.041a.938.938 0 1 1 0-1.875.938.938 0 0 1 0 1.875Z" fill="url(#sl-offer-discount-gradient)"/></svg>':'<svg class="sl-offer-icon sl-offer-icon-tag" viewBox="0 0 24 24" aria-hidden="true"><path d="M20.6 13.6 13.7 20.5a2 2 0 0 1-2.8 0L3.5 13.1A2 2 0 0 1 3 11.7V4h7.7a2 2 0 0 1 1.4.6l8.5 8.5a.7.7 0 0 1 0 .5Z"/><circle cx="7.5" cy="8.5" r="1"/></svg>'}function Fi(n,e){return`<span class="sl-offer-mark" role="img" aria-label="${e(n)}" title="${e(n)}">${ma(n)}</span>`}function Vi(n,e){return`<span class="sl-offer-badge">${ma(n)}<span>${e(n)}</span></span>`}function fa(n,e=Date.now()){let t=n-e;if(t<=0)return null;let i=Math.max(1,Math.ceil(t/6e4)),o=Math.floor(i/1440),r=Math.floor(i%1440/60),s=i%60;return`${(o>0?[`${o}d`,...r?[`${r}h`]:[]]:[...r?[`${r}h`]:[],...s||!r?[`${s}m`]:[]]).join(" ")} left`}function or(n){return String(n??"\u2014").replace(/[&<>"]/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[e])}function L(n){return String(n??"").replace(/[&<>"]/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[e])}function rr(n){return n?(0,Oe.seatNoteRowModel)(n).map(e=>({...e,title:y(e.titleKey,e.titleFallback)})):[]}function ya(n){return rr(n).map(e=>e.title)}function $t(n,e={}){return sr(rr(n),e)}function sr(n,e={}){if(!n.length)return"";let t=e.compact?15:17,i=n.map(o=>`<div class="sl-note sl-note-${L(o.tone)}"><span class="sl-note-i">${(0,Oe.seatTypeIconSvg)(o.icon,{size:t})}</span><span class="sl-note-t"><b>${L(o.title)}</b>`+(o.note?`<span class="sl-note-n">${L(o.note)}</span>`:"")+"</span></div>").join("");return`<div class="sl-notes${e.compact?" compact":""}">${i}</div>`}function va(n){return rr(n).map(e=>{let t=L(e.note?`${e.title}: ${e.note}`:e.title);return`<span class="sl-cx-mark sl-cx-mark-${L(e.tone)}" role="img" aria-label="${t}" title="${t}">${(0,Oe.seatTypeIconSvg)(e.icon,{size:13})}</span>`}).join("")}function $i(n){let e=[];return n?.restrictedView&&e.push(y("picker.restrictedView","Restricted view")),n?.obstructedView&&e.push(y("picker.obstructedView","Obstructed view")),e}function ar(n,e){if(!n)return"";let t=e?y("picker.viewFromThisSeat","View from this seat"):y("picker.seeItIn3d","See it in 3D"),i=e?y("picker.viewFromHere","View from here"):t;return`<button type="button" class="sl-confirm-3d" aria-label="${t}"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2l9 5v10l-9 5-9-5V7z"/><path d="M12 12l9-5M12 12v10M12 12L3 7"/></svg><span>${i}</span></button>`}function wa(n,e){if(!e)return"";let t=e,i=t.includes(n.id),o=i?t.length>1?y("picker.openComparison","Open comparison"):y("picker.savedForComparison","Saved for comparison"):t.length?y("picker.compareWithSaved","Compare with saved"):y("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>${L(o)}</span></button>`}function xa(n,e,t){if(!t)return"";let i=(0,ba.seatConfidenceDisclosure)(n.confidenceEvidence),o=i.modeledTarget??i.reality;return`<button type="button" class="sl-confirm-confidence" aria-label="Open seat confidence passport for ${L(n.displayLabel??n.label)}"><span><em>${L(e)}</em><strong>${L(i.headline)}</strong><small>${L(o)}</small></span><b>Passport</b></button>`}function fe(n){let e=n?.rowLabel,t=n?.sectionLabel;if(!e||!t)return e;for(let i of["-"," ","\xB7","/","_"]){let o=`${t}${i}`;if(e.startsWith(o)&&e.length>o.length)return e.slice(o.length)}return(0,Oe.compactRowLabel)(e,t)}function su(n){switch(n){case"paused":return{title:y("picker.accessPausedTitle","These seats are on hold right now"),body:y("picker.accessPausedBody","The organizer has paused this selection. Try again in a few minutes."),action:y("picker.accessRetry","Try again")};case"revoked":return{title:y("picker.accessRevokedTitle","This access link is no longer active"),body:y("picker.accessRevokedBody","Ask whoever sent you here for a new link to keep booking these seats."),action:y("picker.accessRefresh","Refresh")};case"idle":return{title:y("picker.idlePausedTitle","Your session expired"),body:y("picker.idlePausedBody","You were away for a while. Refresh to see which seats are free now."),action:y("picker.idleRefresh","Show latest seats")};case"no_token":case"provider_failed":return{title:y("picker.accessExpiredTitle","The seat map timed out"),body:y("picker.accessExpiredBody","Any seats you\u2019re holding stay held. Refresh to see what\u2019s available now."),action:y("picker.accessRefresh","Refresh")};default:return{title:y("picker.accessInvalidTitle","We couldn\u2019t verify your access"),body:y("picker.accessInvalidBody","You can still book anything shown as available. Contact whoever sent you here for access to the rest."),action:y("picker.accessRefresh","Refresh")}}}var au=6;function ka(n,e,t){let i=or;return[n?.sectionLabel?`<div class="sl-confirm-field sl-confirm-sec${n.sectionLabel.length>au?" sl-confirm-sec-long":""}"><span class="sl-confirm-key">${y("picker.section","Section")}</span><span class="sl-confirm-value">${i(n.sectionLabel)}</span></div>`:"",n?.rowLabel||n?.objectType==="booth"?`<div class="sl-confirm-field"><span class="sl-confirm-key">${i(t)}</span><span class="sl-confirm-value">${i(fe(n)??n?.displayLabel??e)}</span></div>`:"",n?.objectType!=="booth"?`<div class="sl-confirm-field"><span class="sl-confirm-key">${y("picker.seat","Seat")}</span><span class="sl-confirm-value">${i(n?.seatNumber??n?.displayLabel??e)}</span></div>`:""].filter(Boolean).join("")}function Sa(n,e,t){let i=or,o=n?.objectType==="booth",r=n?.objectType==="table"&&!!n?.bookingMode,s=o||r||!n?.seatNumber,a=n?.sectionLabel??(s?void 0:n?.displayLabel),l=r?`${y("picker.guests","Guests")} ${n?.bookingMode==="variable"?`${n?.minOccupancy}\u2013${n?.maxOccupancy}`:n?.capacity}`:void 0,d=(s?[l,a?n?.rowLabel??n?.displayLabel:void 0]:[n?.rowLabel?`${t} ${fe(n)??""}`.trim():void 0,`${y("picker.seat","Seat")} ${n?.seatNumber??e}`]).filter(Boolean).join(" \xB7 ");return(a?`<span class="sl-confirm-place">${i(a)}</span>`:"")+(d?`<span class="sl-confirm-pos">${a?" \xB7 ":""}${i(d)}</span>`:"")+(a||d?"":`<span class="sl-confirm-pos">${i(e)}</span>`)}function Ta(n,e){if(!n)return"";let t=e?y("picker.viewFromThisSeat","View from this seat"):y("picker.seeItIn3d","See it in 3D");return`<button type="button" class="sl-confirm-pill sl-confirm-3dpill" aria-label="${t}" title="${t}"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2l9 5v10l-9 5-9-5V7z"/><path d="M12 12l9-5M12 12v10M12 12L3 7"/></svg><span aria-hidden="true">3D</span></button>`}function Ea(n,e){if(!n||e)return"";let t=y("picker.seeItIn3d","See it in 3D");return`<button type="button" class="sl-confirm-3drow" aria-label="${t}" title="${t}"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2l9 5v10l-9 5-9-5V7z"/><path d="M12 12l9-5M12 12v10M12 12L3 7"/></svg><span aria-hidden="true">3D</span></button>`}function ga(n){return n.buyerMessage?.trim()||(n.restriction==="companion"?y("picker.companionRequiresWheelchair","Requires the adjacent wheelchair place"):void 0)}function zi(n,e,t,i=()=>{}){let o=or;if(n.length>1)return`<fieldset class="sl-confirm-tiers"><legend><span>${y("picker.ticketType","Ticket type")}</span></legend>`+n.map(a=>{let l=ga(a),c=i(a);return`<button type="button" class="sl-confirm-tier" data-confirm-tier="${o(a.id)}"${c?` data-offer-name="${o(c)}"`:""} aria-pressed="${a.id===e}"><span class="sl-confirm-tier-copy"><span class="sl-confirm-tier-name">${o(a.name)}`+(c?`<span class="sl-confirm-tier-offer">${Vi(c,o)}</span>`:"")+"</span>"+(l?`<small class="sl-confirm-tier-note">${o(l)}</small>`:"")+`</span><span class="sl-confirm-tier-price">${o(t(a))}</span></button>`}).join("")+"</fieldset>";let r=n[0],s=r?ga(r):void 0;return s?`<p class="sl-confirm-tier-note">${o(s)}</p>`:""}function Ca(n){return'<div class="sl-confirm-grid">'+n.identityFields+`</div><div class="sl-confirm-cat"><span class="sl-confirm-cat-name">${L(n.categoryLabel)}</span>`+(n.priceLabel?`<span class="sl-confirm-price">${L(n.priceLabel)}</span>`:"")+'</div><div class="sl-confirm-id">'+n.marker+`<span class="sl-confirm-dot" style="background:${L(n.categoryColor)}" aria-hidden="true"></span><span class="sl-sr">${L(n.categoryLabel)}</span><span class="sl-confirm-who">`+n.identity+"</span>"+(n.priceLabel?`<span class="sl-confirm-idprice">${L(n.priceLabel)}</span>`:"")+'</div><div class="sl-confirm-body">'+n.commercial+n.tierChoices+n.groupDates+n.wheelchair+(n.thumb||n.see3dPill?`<div class="sl-confirm-strip">${n.thumb}<span class="sl-confirm-pills">${n.see3dPill}</span></div>`:"")+n.inspect+'<div class="sl-confirm-row">'+(n.see3dRow??"")+`<button type="button" class="sl-confirm-cancel">${L(n.cancelLabel)}</button><button type="button" class="sl-confirm-add"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M5 12.5l4 4L19 7"/></svg><span class="sl-confirm-add-t">${L(n.selectLabel)}</span></button></div></div>`}function Aa(n,e){let t=q,{variable:i}=e;return`<section class="sl-table-dialog" role="dialog" aria-modal="true" aria-labelledby="sl-table-title" aria-describedby="sl-table-copy"><div class="sl-table-head"><div class="sl-table-eyebrow">${t(i?(0,Oe.t)("picker.flexiblePartyTypeWord",{typeWord:e.typeWord}):(0,Oe.t)("picker.wholeTypeWord",{typeWord:e.typeWord}))}</div><h2 class="sl-table-title" id="sl-table-title">${t(n.displayLabel??n.label)}</h2><p class="sl-table-copy" id="sl-table-copy">${t(i?y("picker.chooseGuestsCopy","Choose how many guests will sit together. This table is held exclusively for your party."):(0,Oe.t)("picker.allPlacesBookedTogether",{count:n.capacity}))}</p></div><div class="sl-table-body"><div class="sl-table-summary"><span>${t(e.categoryLabel)}</span>`+(e.suppressPricing?"":`<b data-table-unit>${t((0,Oe.t)("picker.perGuestPrice",{price:e.unitPrice}))}</b>`)+`<span class="muted">${t(y("picker.tableCapacity","Table capacity"))}</span><span>${t((0,Oe.t)("picker.guestsCount",{count:n.capacity}))}</span>`+(n.entrance?`<span class="muted">${t(y("picker.entrance","Entrance"))}</span><span>${t(n.entrance)}</span>`:"")+(e.suppressPricing?"":`<span class="muted">${t(y("picker.total","Total"))}</span><b data-table-total></b>`)+"</div>"+(i?`<label class="sl-table-qtylabel" id="sl-table-qty-label">${t(y("picker.numberOfGuests","Number of guests"))}</label><div class="sl-table-stepper" role="group" aria-labelledby="sl-table-qty-label"><button type="button" data-table-step="-1" aria-label="${t(y("picker.fewerGuests","Fewer guests"))}">\u2212</button><output aria-live="polite" data-table-qty>${n.quantity}</output><button type="button" data-table-step="1" aria-label="${t(y("picker.moreGuests","More guests"))}">+</button></div><div class="sl-table-range">${t((0,Oe.t)("picker.chooseMinMaxGuests",{min:n.minOccupancy,max:n.maxOccupancy}))}</div>`:`<input type="hidden" data-table-qty value="${n.capacity}">`)+`<div class="sl-table-actions"><button type="button" class="sl-table-cancel">${t((0,Oe.t)("common.cancel"))}</button><button type="button" class="sl-table-confirm">${t(e.held?y("picker.updateTable","Update table"):i?y("picker.selectTable","Select table"):y("picker.selectWholeTable","Select whole table"))}</button></div></div></section>`}function Pa(n,e){let t=su(n),i=document.createElement("div");i.className="sl-interrupt sl-access",i.setAttribute("role","status"),i.setAttribute("aria-live","polite");let o=document.createElement("div");o.className="sl-interrupt-card";let r=document.createElement("div");r.className="sl-interrupt-title",r.textContent=t.title;let s=document.createElement("div");s.className="sl-interrupt-body",s.textContent=t.body,o.append(r,s);let a=document.createElement("div");a.className="sl-interrupt-actions";let l=document.createElement("button");l.type="button",l.className="sl-interrupt-act";let c=document.createElement("span");c.className="sl-interrupt-act-icon",c.setAttribute("aria-hidden","true"),c.textContent="\u21BB";let d=document.createElement("span");return d.textContent=t.action,l.append(c,d),l.addEventListener("click",async()=>{i.classList.add("is-reloading"),l.disabled=!0;try{await e()}catch{}finally{i.isConnected&&(i.classList.remove("is-reloading"),l.disabled=!1)}}),a.appendChild(l),o.appendChild(a),i.appendChild(o),i}function Ma(n,e){return`<div class="sl-a11yhead"><span class="sl-a11yhead-t">${L(n)}</span><button type="button" class="sl-a11yclose" data-a11y-close aria-label="${q(e)}"><svg viewBox="0 0 24 24" aria-hidden="true"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg></button></div>`}function La(n){return n.map(e=>{let t=`<button type="button" role="switch" class="sl-a11yrow${e.className?` ${e.className}`:""}${e.on?" on":""}" data-a11y-row="${L(e.key)}" aria-checked="${e.on}" aria-pressed="${e.on}"`+(e.disabled?' disabled aria-disabled="true"':"")+`><span class="sl-a11yrow-i" aria-hidden="true">${e.iconHtml}</span><span class="sl-a11yrow-t"><span class="sl-a11yrow-l">${L(e.label)}</span></span>`+(e.count?`<span class="sl-a11yrow-c">${L(e.count)}</span>`:"")+'<span class="sl-a11yrow-s" aria-hidden="true"></span></button>';return e.note?`<div class="sl-a11yrow-w">${t}${mn({id:`sl-info-${q(e.key.replace(/[^A-Za-z0-9]+/g,"-"))}`,label:e.note,text:L(e.note)})}</div>`:t}).join("")}function mn(n){return`<span class="sl-info"${n.wrapRef?` data-ref="${q(n.wrapRef)}"`:""}><button type="button" class="sl-info-btn" data-sl-info aria-label="${q(n.label)}" aria-describedby="${q(n.id)}" aria-expanded="false"><svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="12" r="9"/><path d="M12 11v5"/><path d="M12 8h.01"/></svg></button><span class="sl-info-pop" role="tooltip" id="${q(n.id)}"${n.ref?` data-ref="${q(n.ref)}"`:""}>${n.text}</span></span>`}function Ha(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 Ra(n){let e=n.performanceLabel?`<div class="sl-chip-when">${q(n.performanceLabel)}</div>`:"",t=n.performanceDates?.labels.length?`<div class="sl-chip-dates"><span class="sl-chip-dates-summary">${q(n.performanceDates.summary)}</span><span class="sl-chip-date-list">${n.performanceDates.labels.map(i=>`<span class="sl-chip-date">${q(i)}</span>`).join("")}</span></div>`:"";return e+lu(n)+t}function lu(n){let{d:e,area:t,label:i,objectType:o,quantity:r=1,identity:s}=n,a=F=>String(F??"\u2014").replace(/[&<>"]/g,X=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[X]),l=o==="ga"?"ga":e?.objectType??o,c=s?.displayType?.trim()||e?.displayType?.trim()||t?.displayType?.trim()||(l==="table"?y("picker.table","Table"):l==="booth"?y("picker.booth","Booth"):l==="ga"?y("picker.generalAdmission","General admission"):y("picker.row","Row")),d=s?.rowLabel??s?.displayLabel??e?.rowLabel??e?.displayLabel??t?.label??i,p=n.categoryLabel?.trim()??"",u="",h=[];l==="table"&&s?.bookingMode?(u=`${c} ${d}`,h.push([y("picker.guests","Guests"),String(r)])):l==="ga"?(u=String(t?.displayLabel??d),r>1&&h.push([y("picker.tickets","Tickets"),String(r)])):l==="booth"?(u=e?.sectionLabel??`${c} ${d}`,e?.sectionLabel&&h.push([c,String(d)])):!e?.sectionLabel&&!e?.rowLabel&&!e?.seatNumber?u=String(d):(u=e.sectionLabel??"",e.rowLabel&&h.push([c,String(fe(e)??e.rowLabel)]),e.seatNumber&&h.push([y("picker.seat","Seat"),String(e.seatNumber)]));let b=!u&&!!p,f=u||p||String(d),T=!!p&&!b&&p!==f,w=n.offerName?Fi(n.offerName,a):"",v=h.map(([F,X])=>`<span class="sl-chip-seg" data-fit-seg><span class="w">${a(F)}</span> <b>${a(X)}</b></span>`);T&&v.push(`<span class="sl-chip-seg" data-fit-seg data-fit-type><span class="w">${a(p)}</span>${w}</span>`);let M=[f,...h.map(([F,X])=>`${F} ${X}`),T?p:"",n.offerName??""].filter(Boolean).join(" \xB7 ");return`<div class="sl-chip-id"><span class="sl-sr">${a(M)}</span><span class="sl-chip-name" aria-hidden="true">${a(f)}${T?"":w}</span>`+(v.length?`<span class="sl-chip-pos" aria-hidden="true">${v.join("<i>\xB7</i>")}</span>`:"")+"</div>"}function lr(n,e,t){return n.map(i=>`<option value="${t(i.id)}"${i.id===e?" selected":""}>${t(i.name)}</option>`).join("")}function cu(n){let e=q;return` data-key="${e(n.key)}"`+(n.heldLabels.length?` data-held="${e(encodeURIComponent(n.heldLabels.join(`
196
- `)))}"`:"")+(n.seatIds.length?` data-seat="${e(n.seatIds.join(" "))}"`:"")+(n.locateId?` data-locate="${e(n.locateId)}"`:"")}function Ia(n){let e=q;return`<div class="sl-chip${n.held?" sl-held":""}${n.fresh?" sl-enter":""}"`+cu(n)+">"+(n.held?n.stateHtml:`<span class="sl-chip-dot" style="background:${L(n.categoryColor)}" aria-hidden="true"></span>`)+`<div class="sl-chip-main">${n.identityHtml}`+(n.extrasHtml?`<div class="sl-chip-sub">${n.extrasHtml}</div>`:"")+`${n.noteHtml}</div>`+(n.amountText?`<span class="amt">${e(n.amountText)}</span>`:"")+n.railHtml+"</div>"}function cr(n,e){let t=q(n),i=e?q(e):"";return'<div class="sl-chip-rail">'+(e?`<button type="button" class="view" data-view-label="${i}" aria-label="${q((0,ii.t)("picker.viewFromSeat",{label:e}))}"><svg viewBox="0 0 24 24"><path d="M1 12s4-7 11-7 11 7 11 7-4 7-11 7S1 12 1 12z"/><circle cx="12" cy="12" r="3"/></svg></button>`:"")+`<button type="button" class="rm" aria-label="${t}"><svg viewBox="0 0 24 24"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg></button></div>`}function ji(n,e){return new Set(n.filter(t=>(e[t.key]??0)<=0).map(t=>t.key))}function Ki(n,e){let t=(n.doc?.categories??[]).filter(s=>!s.notForSale),i=e?t.filter(s=>s.key===e):t;if(!i.length)return null;let o=ji(i,n.categoryAvailability());return o.size<i.length||(n.currentHold()?.items??[]).some(s=>o.has(s.categoryKey))?null:Object.assign(new Error("seatlayer: that ticket type is sold out"),{status:409,code:"sold_out",reason:"sold_out"})}function Oa(n){return n.confirming?`<div class="sl-ba" role="alert"><div class="sl-ba-title"><span class="spark" aria-hidden="true">\u2726</span>${y("picker.replaceCurrentChoices","Replace your current choices?")}</div><div class="sl-ba-replace"><b>${(0,ii.t)("picker.willFindSeatsTogether",{count:n.quantity})}</b><span>${y("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>${y("picker.keepMine","Keep mine")}</button><button type="button" class="replace" data-ba-replace>${y("picker.findNewSeats","Find new seats")}</button></div></div>`:`<div class="sl-ba"><div class="sl-ba-title"><span class="sl-ba-title-t">${y("picker.findSeatsTogether","Find seats together")}</span>`+mn({id:"sl-info-best-seats",label:y("picker.aboutBestSeats","About finding seats together"),text:y("picker.closestGroupChosenInstantly","Closest available group, chosen instantly.")})+(n.offerPremium?`<button type="button" class="sl-ba-premium${n.premium?" on":""}" data-ba-premium aria-pressed="${n.premium?"true":"false"}"><span class="star" aria-hidden="true">\u2605</span>${y("picker.bestSeatsPremium","Best seats")}</button>`:"")+`</div><div class="sl-ba-qty"><button type="button" data-ba="-1" aria-label="${y("picker.fewerSeats","Fewer seats")}">\u2212</button><span>${n.quantity}</span><button type="button" data-ba="1" aria-label="${y("picker.moreSeats","More seats")}">+</button></div>`+(n.categories.length>1?`<select class="sl-ba-cat" aria-label="${q(y("picker.preferredTicketType","Preferred ticket type"))}" data-ba-cat><option value="">${q(y("picker.anyTicketType","Any ticket type"))}</option>`+n.categories.map(e=>e.soldOut?`<option value="${q(e.key)}" disabled>${q(`${e.label} \xB7 ${y("picker.soldOutTitle","Sold out")}`)}</option>`:`<option value="${q(e.key)}"${n.selectedCategory===e.key?" selected":""}>${q(e.label)}</option>`).join("")+"</select>":'<span class="sl-ba-cat" aria-hidden="true"></span>')+(n.zones.length?`<select class="sl-ba-zone" aria-label="${y("picker.preferredVenueZone","Preferred venue zone")}" data-ba-zone><option value="">${y("picker.anyVenueZone","Any venue zone")}</option>`+n.zones.map(e=>`<option value="${q(e.id)}"${n.selectedZone===e.id?" selected":""}>${q(e.label)}</option>`).join("")+"</select>":"")+`<button type="button" class="sl-ba-go${n.busy?" sl-busy":""}"${n.busy?" disabled":""}>`+(n.busy?`<span class="sl-ba-spin" aria-hidden="true"></span>${y("picker.findingBestSeats","Finding the best seats\u2026")}`:(0,ii.tCount)("picker.findBestSeatsCount",n.quantity))+"</button>"+(n.reopened?`<button type="button" class="sl-ba-back" data-ba-close>${y("picker.keepMyPicks","Keep my picks")}</button>`:"")+"</div>"}function _a(n){return n==="setup"||n==="testable"?{heading:y("picker.salesNotOpenPill","Sales haven\u2019t opened yet"),sentence:y("picker.salesNotOpenCopy","Tickets for this event aren\u2019t on sale yet.")}:n==="paused"?{heading:y("picker.salesPausedPill","Sales are paused"),sentence:y("picker.salesPausedCopy","Ticket sales are paused for now.")}:{heading:y("picker.salesClosedPill","Sales are closed"),sentence:y("picker.salesClosedCopy","Ticket sales for this event have ended.")}}function Na(n,e=!1){if(!e&&(n==="setup"||n==="testable"||n==="paused")){let t=_a(n);return{pill:t.heading,cta:t.heading,toast:t.sentence}}return{pill:y("picker.salesClosedPill","Sales are closed"),cta:y("picker.salesClosedCta","Sales closed"),toast:y("picker.salesClosedToast","Sales are closed for this event.")}}function Da(n){if(n.salesClosed&&!n.hasPicks){let e=n.whenText?`<span class="when">${q(n.whenText)}</span>`:"",t=n.note??_a(n.salesState);return`<div class="sl-closed-note" role="status"><b>${t.heading}</b><span>${t.sentence}${e}</span></div>`}return""}function Ba(n){return n.hasGaAreas?n.seated?n.venue3d?y("picker.trayHintChoose3dOrStanding","Choose a seat in the 3D venue, or grab standing tickets below."):y("picker.trayHintTapOrStanding","Tap a seat on the map or grab standing tickets below."):n.venue3d?y("picker.gaTrayHintChoose3dArea","Choose an area in the 3D venue to select tickets."):y("picker.gaTrayHintTapArea","Tap an area on the map to choose tickets."):n.groupMode==="per_performance"?y("picker.groupPerPerformanceTrayHint","Choose seats for this performance, then complete every date above."):n.groupMode?y("picker.groupTrayHint","Choose seats once. The same seats will be held for every performance."):n.venue3d?y("picker.trayHintChoose3dOrBest","Choose a seat in the 3D venue, or let us pick the best available for you."):y("picker.trayHintTapOrBest","Tap a seat on the map, or let us pick the best available for you.")}var Ae=require("@seatlayer/core");var bn=require("@seatlayer/core");var qi=require("@seatlayer/core/core/color");function st(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 o=t.length<=4?[...t].map(r=>`${r}${r}`).join(""):t;return{r:Number.parseInt(o.slice(0,2),16),g:Number.parseInt(o.slice(2,4),16),b:Number.parseInt(o.slice(4,6),16)}}let 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 Gi(n){return(0,qi.relativeLuminance255)([n.r,n.g,n.b])}function Ue(n,e){let t=st(n),i=st(e);if(!t||!i)return null;let o=Math.max(Gi(t),Gi(i)),r=Math.min(Gi(t),Gi(i));return(o+.05)/(r+.05)}function zt(n,e="#172033",t="#eef1f8"){return(Ue(e,n)??0)>=(Ue(t,n)??0)?e:t}function du(n){return(0,qi.rgb255ToHex)(n.r,n.g,n.b)}function dr(n,e,t){let i=st(n),o=st(e);if(!i||!o)return null;let r=Math.max(0,Math.min(1,t));return du({r:i.r*r+o.r*(1-r),g:i.g*r+o.g*(1-r),b:i.b*r+o.b*(1-r)})}var Ui="#d8a425",pu=.18;function Fa(n,e){let t=dr(Ui,e,pu)??e;if((Ue(Ui,t)??0)>=4.5)return Ui;for(let i=.15;i<=1;i+=.05){let o=dr(Ui,n,1-i);if(o&&(Ue(o,t)??0)>=4.5)return o}return zt(t)}function Va(n,e,t,i){if((Ue(n,t)??4.5)>=4.5&&(Ue(n,i)??4.5)>=4.5)return n;if(!st(n)||!st(e))return e;for(let o=.15;o<=1;o+=.05){let r=dr(n,e,1-o);if(r&&(Ue(r,t)??0)>=4.5&&(Ue(r,i)??0)>=4.5)return r}return e}function $a(n){return{"--sl-chrome":n?"#d6dce6":"#556278","--sl-chrome-line":n?"rgba(23,32,51,.55)":"rgba(233,238,247,.55)"}}var za=["--sl-bg","--sl-surface","--sl-text","--sl-muted","--sl-line","--sl-accent-text","--sl-warn-text","--sl-chrome","--sl-chrome-line"];function ja(n,e){let t=e??n["--sl-bg"],i=st(t)?zt(t)==="#172033":!1,o=st(n["--sl-bg"])?zt(n["--sl-bg"])==="#172033":!1;if(i===o)return null;let r=i?"#ffffff":"#1a2234",s=zt(t),a=n["--sl-accent"];return{"--sl-bg":t,"--sl-surface":r,"--sl-text":s,"--sl-muted":i?"#667085":"#a5aec2","--sl-line":i?"rgba(23,32,51,.16)":"rgba(165,174,194,.24)","--sl-accent-text":Va(a,s,t,r),...$a(i),"--sl-warn-text":Fa(s,r)}}var hu="#f7f8fb",Ka={light:{background:"#ffffff",surface:"#f6f7fb",text:"#172033",muted:"#667085",line:"rgba(23,32,51,.16)",map:"#e9edf4"},dark:{background:"#0f1522",surface:"#1a2234",text:"#eef1f8",muted:"#a5aec2",line:"rgba(165,174,194,.24)",map:"#0f1522"}};function uu(){try{return window.matchMedia?.("(prefers-color-scheme: dark)").matches===!0}catch{return!1}}function oi(n){if(n)return n==="auto"?uu()?"dark":"light":n}function fn(n,e=n?.mode){if(n?.map)return n.map;let t=oi(e);return t?{background:Ka[t].map}:null}function Wi(n){let e;try{e=window.matchMedia?.("(prefers-color-scheme: dark)")}catch{return()=>{}}if(!e)return()=>{};let t=i=>n(i.matches);return typeof e.addEventListener=="function"?e.addEventListener("change",t):e.addListener?.(t),()=>{typeof e.removeEventListener=="function"?e.removeEventListener("change",t):e.removeListener?.(t)}}function gn(n,e,t){let i=t?Ka[t]:null,o=e?.background??i?.background??n?.background??hu,r=st(o)?zt(o)==="#172033":!1,s=e?.surface??i?.surface??(r?"#ffffff":"#1a2234"),a=e?.accent??n?.accent??"#f4b740",l=n?.accentInk,c=e?.accentInk??(l&&(Ue(l,a)??4.5)>=4.5?l:zt(a,"#1a1200","#ffffff")),d=i?void 0:n?.textColor,p=e?.text??i?.text??(d&&(Ue(d,o)??4.5)>=4.5&&(Ue(d,s)??4.5)>=4.5?d:zt(o));return{"--sl-accent":a,"--sl-accent-ink":c,"--sl-accent-text":Va(a,p,o,s),"--sl-warn-text":Fa(p,s),"--sl-bg":o,"--sl-surface":s,"--sl-text":p,"--sl-muted":e?.muted??i?.muted??(r?"#667085":"#a5aec2"),"--sl-line":e?.line??i?.line??(r?"rgba(23,32,51,.16)":"rgba(165,174,194,.24)"),...$a(r),"--sl-scrim-ink":r?"rgba(16,22,36,1)":"rgba(4,7,13,1)","--sl-font":e?.fontFamily??n?.fontFamily??"-apple-system,BlinkMacSystemFont,'Segoe UI',Inter,sans-serif","--sl-radius":`${e?.radius??14}px`}}function mu(){return`<svg class="sl-boot-venue" viewBox="0 0 200 140" preserveAspectRatio="xMidYMid meet" aria-hidden="true" focusable="false"><g class="sl-boot-shells">${["M20 92a80 52 0 0 1 160 0v14a94 62 0 0 0-160 0z","M32 74a68 42 0 0 1 136 0v12a80 50 0 0 0-136 0z","M46 58a54 32 0 0 1 108 0v10a64 38 0 0 0-108 0z"].map(e=>`<path d="${e}" />`).join("")}</g><rect class="sl-boot-stage" x="62" y="16" width="76" height="16" rx="4" /></svg>`}function Ga(n,e,t){let i=document.createElement("div");i.className="sl-picker",i.tabIndex=-1,i.lang=(0,bn.getLocale)(),i.dir=(0,bn.localeDirection)(),n.appendChild(i),Object.entries(gn(void 0,t)).forEach(([r,s])=>i.style.setProperty(r,s)),i.innerHTML=`
193
+ .sl-sales-copy span{display:block;margin-top:3px;font-size:12.5px;line-height:1.45;color:var(--sl-muted)}`,sm={lock:'<rect x="5" y="11" width="14" height="9" rx="2"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/>',flag:'<path d="M5 21V4M5 4h11l-2 4 2 4H5"/>',cart:'<circle cx="9" cy="20" r="1.4"/><circle cx="17" cy="20" r="1.4"/><path d="M3 4h2l2.4 11h10.2L20 8H6.2"/>'},$a=n=>n.replace(/[&<>"']/g,e=>`&#${e.charCodeAt(0)};`);on=n=>Ka(n.salesClosed,n.salesState,!!n.opts.readOnly),am=on;za=new WeakMap});var Db={};Br(Db,{ApiError:()=>re,BuyerAccessContext:()=>De,BuyerAccessUnavailableError:()=>we,BuyerRealtimeClient:()=>st,EmbeddedDesigner:()=>Qo,PerformanceGroupDestroyedError:()=>Te,PerformanceGroupPicker:()=>Tr,SEATING_CHART_CALLBACK_PROPS:()=>fs,SEATING_CHART_HANDLE_METHODS:()=>hs,SEATING_CHART_IDENTITY_PROPS:()=>us,SEATING_CHART_VALUE_PROPS:()=>ms,SeasonApiError:()=>q,SeasonPicker:()=>_r,SeasonPublicSessionRefused:()=>pi,SeasonRecoveryTimeoutError:()=>di,SeatPicker:()=>kt,SeatingChart:()=>Zo,attachPickerFrame:()=>Qh,bindSeatingChartHandle:()=>Cc,buildSeatingChartOptions:()=>Ac,createBuyerAccessContext:()=>zn,createControllerSink:()=>Hn,parseTicketOfferAvailability:()=>tr,prewarmSeatPicker:()=>ch,shortOperationReference:()=>ri,ticketOfferPrices:()=>vs});module.exports=su(Db);var pe=require("@seatlayer/core");var au=/^[0-9A-Za-z.+-]{1,24}$/,lu=au.test("0.110.1")?"0.110.1":"",cu={host:"web",platform:"web",bundle:lu,protocol:0,chromeOwner:"web"},du={...cu},oo=null,ha=null;function pu(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():0}function hu(){let n=e=>Math.max(0,Math.round(e*100)/100);return{bootMs:n(pu()),documentMs:oo==null?0:n(oo),handshakeMs:oo==null||ha==null?0:n(ha-oo)}}function ua(){let{host:n,platform:e,bundle:t,protocol:i,chromeOwner:o}=du,r=hu();return{host:n,platform:e,...t?{bundle:t}:{},...i?{protocol:i}:{},chromeOwner:o,bootMs:r.bootMs,documentMs:r.documentMs,handshakeMs:r.handshakeMs}}var ma=new Set,fa=new Map;function ht(n){return ma.has(n)?"repeat":"cold"}function ro(n){let e=ht(n);return ma.add(n),e}function Ue(n){return typeof n=="number"&&Number.isFinite(n)&&n>=0?Math.round(n):0}function Ti(){return typeof location>"u"?!1:/^(localhost|127\.0\.0\.1|\[::1\])$/i.test(location.hostname)}function uu(n){if(!/^[A-Za-z0-9_-]{1,80}$/.test(n.event))return null;let e=n.performanceProfile??{};return{event:n.event,scope:n.scope,surface:n.surface,outcome:n.outcome,stage:n.stage?.slice(0,32)??"",ms:Ue(n.ms),api:Ue(e.loadChartAndStatuses)||Ue(e.loadChart),scene:Ue(e.buildScene),panel:Ue(e.buildBuyerControls),paint:Ue(e.firstPaint),normalize:Ue(e.normalizeBuyerModel),renderer:Ue(e.createRenderer),seats:Ue(n.seats),floors:Ue(n.floors),view:n.view??"map",load:n.load??ht(n.event),transport:n.transport??"pubapi",...ua(),availabilityMs:Ue(e.loadStatuses),...typeof n.revealWaitMs=="number"?{revealWaitMs:Ue(n.revealWaitMs)}:{},...typeof n.handoverMs=="number"?{handoverMs:Ue(n.handoverMs)}:{},mounts:(fa.get(n.event)??0)+1,reconnects:Ue(n.reconnects)}}var mu=new Set;function rt(n){let e=uu(n);if(e){fa.set(n.event,e.mounts);for(let t of mu)try{t(e)}catch{}typeof fetch>"u"||Ti()||fetch(`${n.apiBase.replace(/\/+$/,"")}/pub/telemetry/chart-load`,{method:"POST",headers:{"Content-Type":"application/json","X-SeatLayer-Client":"1"},body:JSON.stringify(e),credentials:"omit",keepalive:!0}).catch(()=>{})}}var fu="realtime.fallback_polling",ga=new Set;function gu(n){let e=/^(wss?):\/\/([^/]+)(.*?)\/pub\/events\/([^/?#]+)\/subscribe(?:[?#]|$)/.exec(n);if(!e)return null;let t;try{t=decodeURIComponent(e[4])}catch{return null}return/^[A-Za-z0-9_-]{1,80}$/.test(t)?{apiBase:`${e[1]==="wss"?"https":"http"}://${e[2]}${e[3]}`,eventKey:t}:null}function ba(n){let e=gu(n);return!e||ga.has(e.eventKey)||(ga.add(e.eventKey),typeof fetch>"u"||Ti())?!1:(fetch(`${e.apiBase}/pub/telemetry/client-error`,{method:"POST",headers:{"Content-Type":"application/json","X-SeatLayer-Client":"1"},body:JSON.stringify({surface:"picker",errorCode:fu,eventKey:e.eventKey}),credentials:"omit",keepalive:!0}).catch(()=>{}),!0)}var Jt="seatlayer.v1",ya="\0",va=4401,bu=15e3,yu=25e3,vu=1e4,wa=5e3,wu=JSON.stringify({type:"resume"}),xu=3e4,ku=6e4,Su=["pointermove","touchstart","keydown"],Tu=3,Eu=15e3,xa=6e4;function Cu(n){let e=typeof n.default=="string"?n.default:"free",t={};if(n.seats&&typeof n.seats=="object")for(let[i,o]of Object.entries(n.seats))typeof o=="string"&&o!==e&&(t[i]=o);return{default:e,exceptions:t}}function Au(n,e){if(!n||n.default!==e.default)return null;let t=[];for(let[i,o]of Object.entries(e.exceptions))n.exceptions[i]!==o&&t.push({label:i,status:o});for(let i of Object.keys(n.exceptions))i in e.exceptions||t.push({label:i,status:e.default});return t}function Pu(n,e){for(let t of e)t.status===n.default?delete n.exceptions[t.label]:n.exceptions[t.label]=t.status}function ka(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 st=class{constructor(e){this.ws=null;this.watched=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.failedUpgrades=0;this.pollTimer=null;this.fellBack=!1;this.lastWake=-1/0;this.lastInput=0;this.detachWake=null;this.reconnectCount=0;this.opts=e,typeof e.url=="string"&&ka(e.url)}get polling(){return this.pollTimer!==null}get protocol(){return this.ws?this.v1?"v1":"legacy":null}get snapshotVersion(){return this.version}start(){this.stopped&&(this.stopped=!1,this.attachWake(),this.connect())}stop(){this.stopped=!0,this.clearTimers(),this.stopPolling(),this.detachWake?.(),this.detachWake=null;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.failedUpgrades=0,this.start()}async connect(){if(this.stopped)return;let e=[Jt];if(this.opts.mintTicket){let a;try{a=await this.opts.mintTicket()}catch(l){this.reportIfAccessError(l),this.scheduleReconnect();return}if(this.stopped)return;a?.protocols?.length?(e=[...a.protocols],e.includes(Jt)||e.unshift(Jt)):a?.ticket&&(e=[Jt,`tkt.${a.ticket}`])}let t=this.version!==null;t&&e.push(`sv.${this.version}`);let i=typeof this.opts.url=="function"?this.opts.url():this.opts.url,o=this.useQueryMarker?`${i}${i.includes("?")?"&":"?"}pv=1`:i;ka(o);let r;try{r=(this.opts.socketFactory??((l,c)=>new WebSocket(l,c)))(o,e)}catch{this.upgradeFailed(),this.scheduleReconnect();return}this.ws=r;let s=!1;r.onopen=()=>{this.ws===r&&(s=!0,this.attempt=0,this.failedUpgrades=0,this.stopPolling(),this.v1=r.protocol===Jt,this.v1||(this.useQueryMarker=!0),this.startKeepalive(r),this.watched=null,this.watchHold(this.opts.heldHoldId?.()??null),t?this.resumeTimer=setTimeout(()=>{this.resumeTimer=null,this.opts.sink.resync()},wa):this.resumeTimer=setTimeout(()=>{this.resumeTimer=null,this.opts.sink.resync({reason:"connect"})},wa))},r.onmessage=a=>{if(this.ws!==r)return;let l;try{l=JSON.parse(typeof a.data=="string"?a.data:"")}catch{return}!l||typeof l!="object"||this.handleFrame(l)},r.onclose=a=>{if(this.ws===r){if(this.ws=null,this.clearTimers(),!s&&a?.code!==va&&this.upgradeFailed(),a?.code===va){if(a.reason==="access_expired"){this.scheduleReconnect();return}if(a.reason==="idle_expired"&&this.opts.onIdleExpired){this.stopped=!0,this.stopPolling(),this.opts.onIdleExpired();return}this.stopped=!0,this.stopPolling(),this.opts.onAccessUnavailable?.({reason:"revoked",code:"access_revoked",retryable:!1});return}this.scheduleReconnect()}},r.onerror=()=>{try{r.close()}catch{}}}watchHold(e){let t=this.ws;if(!(!e||e===this.watched||!t||t.readyState!==1))try{t.send(JSON.stringify({type:"watch",holdId:e})),this.watched=e}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(t==="sales"){this.opts.sink.onSales?.(e);return}if(Array.isArray(e.hidden)||Array.isArray(e.closed)){let i=Array.isArray(e.hidden)?e.hidden:[],o=Array.isArray(e.closed)?e.closed:[],r=i.join(ya),s=o.join(ya);(r!==this.hidden||s!==this.closedSections)&&(this.hidden=r,this.closedSections=s,this.opts.sink.onSections?.(i,o,{withInventory:t==="snapshot"||!!e.seats}))}if(t!=="hidden"){if(t==="hold"){typeof e.holdId=="string"&&typeof e.state=="string"&&this.opts.onHoldState?.(e.holdId,e.state);return}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=Cu(e),o=Au(this.projection,i);this.projection=i,o===null?this.opts.sink.applyProjection?this.opts.sink.applyProjection(i):this.opts.sink.resync():o.length&&this.opts.sink.applyStatuses(o);return}if(t==="delta"&&Array.isArray(e.changes)){this.answered();let i=e.changes.filter(o=>typeof o?.label=="string"&&typeof o?.status=="string").map(o=>({label:o.label,status:o.status}));if(!i.length)return;this.projection&&Pu(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.stopPolling(),this.opts.onAccessUnavailable?.({reason:t??"invalid",code:e.code,status:e.status,retryable:t==="paused"}))}upgradeFailed(){this.failedUpgrades+=1,this.failedUpgrades>=Tu&&this.startPolling()}startPolling(){if(!(this.pollTimer||this.stopped)){if(!this.fellBack){this.fellBack=!0;try{this.opts.onFallbackPolling?.()}catch{}let e=typeof this.opts.url=="function"?this.opts.url():this.opts.url;ba(e)}this.pollTimer=setInterval(()=>{if(this.stopped){this.stopPolling();return}typeof document<"u"&&document.hidden||Promise.resolve().then(()=>this.opts.poll?this.opts.poll():this.opts.sink.resync({reason:"frame"})).catch(()=>{})},Eu)}}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}now(){return this.opts.now?this.opts.now():Date.now()}attachWake(){if(this.detachWake||typeof document>"u"||typeof window>"u"||typeof document.addEventListener!="function"||typeof window.addEventListener!="function")return;this.lastInput=this.now();let e=()=>{document.visibilityState==="visible"&&this.wake()},t=()=>{let r=this.now(),s=r-this.lastInput>=ku;this.lastInput=r,s&&this.wake()},i={capture:!0,passive:!0},o=r=>{document[r]("visibilitychange",e),window[r]("focus",e);for(let s of Su)document[r](s,t,i)};o("addEventListener"),this.detachWake=()=>o("removeEventListener")}wake(){let e=this.ws;if(!e||e.readyState!==1)return;let t=this.now();if(!(t-this.lastWake<xu)){try{e.send(wu)}catch{return}this.lastWake=t}}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{}},vu)}},yu)}scheduleReconnect(){if(this.stopped||this.reconnectTimer)return;let e=Math.min(this.attempt++,5),t=Math.min(1e3*2**e,bu),i=this.pollTimer?xa/2+Math.random()*xa/2:Math.random()*t;this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.reconnectCount+=1,this.connect()},i)}get reconnects(){return this.reconnectCount}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 Mu(n){return n==="blocked"?"not_for_sale":n==="unavailable"?"held":n==="held"||n==="booked"||n==="free"||n==="not_for_sale"?n:"free"}var Lu="#f43f5e";function Hn(n,e={}){let t=i=>{let o=n.tableSelection(i);if(o)return o.physicalSeatIds;let r=n.idForLabel(i);return r?[r]:[]};return{applyStatuses(i){let o=new Set([...n.currentHold()?.labels??[],...e.ownLabels?.()??[]]),r={free:[],held:[],booked:[],not_for_sale:[]},s=[],a=[],l=new Map(n.getSelection().map(c=>[c.label,c.id]));for(let c of i){let d=t(c.label);if(!d.length)continue;let p=Mu(c.status);if(r[p].push(...d),e.flashOnLiveChange&&p!=="free"&&!o.has(c.label)&&d.some(m=>n.getStatus(m)==="free"))for(let m of d)s.push({id:m,color:Lu});p!=="free"&&!o.has(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 s)n.flashSeat(c.id,c.color);if(a.length){let c=a.flatMap(p=>t(p));c.length&&n.deselect(c);let d=i.some(p=>p.status==="blocked"&&a.includes(p.label));e.onSelectedObjectUnavailable?.(a,d?"ineligible":"taken")}e.onStatusChange?.()},...n.applyProjection?{applyProjection:i=>{n.applyProjection(i)}}:{},async resync(i){await(n.resync?n.resync(i):n.refresh())},onSections(i,o,r){r?.withInventory||(n.resync?n.resync({reason:"frame"}):n.refresh()),e.onSections?.(i,o,r)}}}var en="pricingContract=matrix-v1&pricingContract=seat-v1",re=class extends Error{constructor(e,t,i,o,r,s,a,l){super(t),this.name="ApiError",this.status=e,this.code=i,this.conflicts=o,this.reason=r,this.retryAfterS=s,this.notice=a,l?.fields&&(this.fields=l.fields),typeof l?.retryable=="boolean"&&(this.retryable=l.retryable),l?.hint&&(this.hint=l.hint),l?.serverMessage&&(this.serverMessage=l.serverMessage)}},Sa=10,Ta=1;function Ei(n,e){let t=(n??"").trim();if(t){let i=Number(t);if(Number.isFinite(i)&&i>=0)return Math.ceil(i);let o=Date.parse(t);if(Number.isFinite(o))return Math.max(0,Math.ceil((o-Date.now())/1e3))}if(typeof e=="number"&&Number.isFinite(e)&&e>=0)return Math.ceil(e)}function Hu(n){let e=n;return!!e&&typeof e.ticketKey=="string"&&typeof e.label=="string"&&Number.isFinite(e.unitIndex)&&Number.isFinite(e.quantity)&&(e.displayLabel===void 0||typeof e.displayLabel=="string")}var Ru={seat_conflict:"taken",conflict:"taken",channel_assignment_conflict:"ineligible",allocation_exhausted:"exhausted"};function Iu(){return typeof crypto>"u"?null:typeof crypto.randomUUID=="function"?crypto.randomUUID():typeof crypto.getRandomValues!="function"?null:Array.from(crypto.getRandomValues(new Uint8Array(18)),n=>n.toString(16).padStart(2,"0")).join("")}function Ou(n,e){let t=e.map(i=>[i.label,i.tierId??null,i.quantity??null]).sort((i,o)=>i[0]<o[0]?-1:i[0]>o[0]?1:0);return JSON.stringify([n,t])}function _u(n){return n instanceof re?n.status===408||n.status===429||n.status>=500:!0}function Ea(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`viewer_${Math.random().toString(36).slice(2)}${Date.now().toString(36)}`}var Pt=class{constructor(e,t={}){this.base=e;this.viewerId=Ea();this.holdAttempt=null;this.holdIdempotency=!0;this.ticketKeysByHold=new Map;this.access=t.access,this.onObjectUnavailable=t.onObjectUnavailable;let i=t.referral?.trim();this.referral=i?i.slice(0,120):void 0}rotateViewerId(){this.viewerId=Ea()}async pickerIdleMinutes(){return null}get accessScoped(){return!!this.access?.configured}async request(e,t={},i={}){let o=t.method??"GET",r={},s;t.body!==void 0&&(r["Content-Type"]="application/json",s=JSON.stringify(t.body));let a=await this.access?.authorization(i.auth?"unauthorized":"initial");if(a&&(r.Authorization=a),t.idempotency){let m=this.holdAttemptKey(`${t.idempotency.binding}\0${a??""}`);t.idempotency.used(m??void 0),m&&(r["Idempotency-Key"]=m)}let l=o==="GET"||e.endsWith("/hold/resume")?new AbortController:null,c=l?setTimeout(()=>l.abort(),4e4):null,d,p;try{d=await fetch(`${this.base}${e}`,{method:o,headers:r,body:s,credentials:"omit",...l?{signal:l.signal}:{}}),p=(d.headers.get("content-type")??"").includes("application/json")?await d.json().catch(u=>{if(l?.signal.aborted)throw u;return null}):null}finally{c!==null&&clearTimeout(c)}if(!d.ok){let m=p,u=m?.code??m?.error,f=d.status===401&&u==="buyer_access_invalid"&&e.endsWith("/hold/resume");if(this.access?.configured&&!f&&(d.status===401||d.status===403||d.status===422)&&await this.access.handleFailure(d.status,u)&&!i.auth)return this.request(e,t,{...i,auth:!0});if(d.status===409){let T=u?Ru[u]:void 0,E=m?.conflicts?.map(v=>v.label)??t.labels??[];T&&this.onObjectUnavailable?.({labels:E,reason:T,code:u})}let b;if(d.status===429&&(b=Ei(d.headers.get("Retry-After"),m?.retryAfterSeconds)??Ta,o==="GET"&&!i.rateLimit&&b<=Sa))return await new Promise(T=>setTimeout(T,b*1e3)),this.request(e,t,{...i,rateLimit:!0});throw d.status===503&&(b=Ei(d.headers.get("Retry-After"),m?.retryAfterSeconds)),new re(d.status,m?.error??`request_failed_${d.status}`,u,m?.conflicts,m?.reason,b,typeof m?.notice=="string"&&m.notice?m.notice:void 0,{...Array.isArray(m?.fields)?{fields:m.fields}:{},...typeof m?.retryable=="boolean"?{retryable:m.retryable}:{},...typeof m?.hint=="string"&&m.hint?{hint:m.hint}:{},...typeof m?.message=="string"&&m.message?{serverMessage:m.message}:{}})}return p}async requestBlob(e,t={}){let i={},o=await this.access?.authorization(t.auth?"unauthorized":"initial");o&&(i.Authorization=o);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=Ei(r.headers.get("Retry-After"),a?.retryAfterSeconds)??Ta,!t.rateLimit&&c<=Sa))return await new Promise(d=>setTimeout(d,c*1e3)),this.requestBlob(e,{...t,rateLimit:!0});throw new re(r.status,a?.error??`request_failed_${r.status}`,l,void 0,void 0,c)}chart(e){return this.request(`/pub/events/${encodeURIComponent(e)}/chart`)}eventConfiguration(e){return this.request(`/pub/events/${encodeURIComponent(e)}/event-configuration`)}reportViewEvidence(e,t){return this.request(`/pub/events/${encodeURIComponent(e)}/view-evidence-reports`,{method:"POST",body:{seatId:t.seatId,...t.evidenceId?{evidenceId:t.evidenceId}:{},...t.message?{message:t.message}:{}}})}asset(e,t){return/^[a-zA-Z0-9._-]+$/.test(t)?this.requestBlob(`/pub/events/${encodeURIComponent(e)}/assets/${encodeURIComponent(t)}`):Promise.reject(new re(404,"not_found","not_found"))}async objects(e){return{...await this.request(`/pub/events/${encodeURIComponent(e)}/objects?compact=1&${en}`),fetchedAt:Date.now()}}hold(e,t,i,o){let r=`/pub/events/${encodeURIComponent(e)}/hold?${en}`,s={method:"POST",body:{selections:t,...i?{ttlMs:i}:{},...o?{replaceHoldId:o}:{},...this.referral?{referral:this.referral}:{}},labels:t.map(l=>l.label)};return(o||!this.holdIdempotency?this.request(r,s):this.keyedHold(r,s,Ou(e,t))).then(l=>this.noteTicketKeys(l,o))}holdAttemptKey(e){if(this.holdAttempt?.binding===e)return this.holdAttempt.key;let t=Iu();return this.holdAttempt=t?{binding:e,key:t}:null,t}endHoldAttempt(e){e&&this.holdAttempt?.key===e&&(this.holdAttempt=null)}async keyedHold(e,t,i,o=!1){let r;try{let s=await this.request(e,{...t,idempotency:{binding:i,used:a=>{r=a}}});return this.endHoldAttempt(r),s}catch(s){if(_u(s))throw s;this.endHoldAttempt(r);let a=s.code;if(a==="idempotency_key_reused"&&!o)return this.keyedHold(e,t,i,!0);if(a==="invalid_idempotency_key")return this.holdIdempotency=!1,this.request(e,t);throw s}}noteTicketKeys(e,t){if(t&&this.ticketKeysByHold.delete(t),!e?.holdId)return e;let i=Array.isArray(e.ticketKeys)&&e.ticketKeys.every(r=>typeof r=="string")?[...e.ticketKeys]:null,o=Array.isArray(e.ticketKeyDetails)&&e.ticketKeyDetails.every(Hu)?e.ticketKeyDetails.map(({ticketKey:r,label:s,unitIndex:a,quantity:l,displayLabel:c})=>({ticketKey:r,label:s,unitIndex:a,quantity:l,...c?{displayLabel:c}:{}})):null;return i||o?this.ticketKeysByHold.set(e.holdId,{...i?{ticketKeys:i}:{},...o?{ticketKeyDetails:o}:{}}):this.ticketKeysByHold.delete(e.holdId),e}ticketKeysFor(e){let t=this.ticketKeysByHold.get(e);return t?{...t}:null}bestAvailable(e,t,i,o,r){return this.request(`/pub/events/${encodeURIComponent(e)}/best-available?${en}`,{method:"POST",body:{qty:t,...i?{categoryKey:i}:{},...o?{zoneId:o}:{},...r?{ttlMs:r}:{},...this.referral?{referral:this.referral}:{}}}).then(s=>this.noteTicketKeys(s))}resume(e,t){return this.request(`/pub/events/${encodeURIComponent(e)}/hold/resume`,{method:"POST",body:{holdId:t}}).then(i=>this.noteTicketKeys(i))}release(e,t,i){return this.holdAttempt=null,this.request(`/pub/events/${encodeURIComponent(e)}/release`,{method:"POST",body:{labels:t,holdId:i}}).then(o=>{let r=this.ticketKeysByHold.get(i);if(r){let s=new Set(o?.released??t);this.ticketKeysByHold.set(i,{...r.ticketKeys?{ticketKeys:r.ticketKeys.filter(a=>!s.has(a))}:{},...r.ticketKeyDetails?{ticketKeyDetails:r.ticketKeyDetails.filter(a=>!s.has(a.ticketKey))}:{}})}return o})}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?${en}${t?"&live=1":""}`)}startCheckout(e,t){return this.holdAttempt=null,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}&${en}`}socketUrl(e){return this.accessScoped?"":this.subscribeUrl(e)}socketProtocols(e){return this.accessScoped?[]:[Jt]}createRealtime(e,t){return this.accessScoped?null:new st({url:this.subscribeUrl(e),sink:t})}};var mt=require("@seatlayer/core");var _e=require("@seatlayer/core"),sl=require("@seatlayer/core/core/seatConfidence");var zr=require("@seatlayer/core"),On=require("@seatlayer/core/core/cdnAsset");var Nu=/^data:image\/(?:png|jpe?g|webp|gif|avif);base64,[a-z0-9+/]+={0,2}$/i,Du=/[\s"'<>`\\]/;function Bu(n){return n.startsWith("//")?!1:n.startsWith("/")||n.startsWith("./")||n.startsWith("../")}function Fu(){try{let n=typeof location>"u"?"":location.origin;return n&&n!=="null"?n:null}catch{return null}}function Rn(n){if(typeof n!="string"||!n||n.length>2e6||n!==n.trim())return!1;if(n.startsWith("data:"))return Nu.test(n);if(Du.test(n))return!1;let e=Fu();if(Bu(n)){if(!e)return!1;try{let t=new URL(n,e);return t.origin===e&&!t.username&&!t.password}catch{return!1}}try{let t=new URL(n);return t.username||t.password?!1:t.protocol==="https:"||e!=null&&t.origin===e}catch{return!1}}var fm=require("@seatlayer/core/core/cdnAsset");function x(n,e){let t=(0,zr.t)(n);return t===n?e:t}function rn(){return globalThis.matchMedia?.("(pointer: coarse)").matches??!1?x("picker.dragToLookTouch","Drag to look \xB7 pinch to zoom \xB7 tap \u2715 to close"):x("picker.dragToLookMouse","Drag to look \xB7 pinch or scroll to zoom \xB7 Esc to close")}function lo(){return{rotate:x("picker.dragToRotateVenue","Drag to rotate the venue"),move:x("picker.dragToMoveVenue","Drag to move the venue"),zoomIn:x("picker.zoomIn","Zoom in"),zoomOut:x("picker.zoomOut","Zoom out"),fitView:x("picker.fitWholeVenue","Show whole venue")}}function Xa(n,e){let t=e?n.toLocaleUpperCase(e):n.toLocaleUpperCase(),i=e?n.toLocaleLowerCase(e):n.toLocaleLowerCase();if(n!==t||t===i)return n;let o=[...i][0]??"";return(e?o.toLocaleUpperCase(e):o.toLocaleUpperCase())+i.slice(o.length)}function Za(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 Y(n){return String(n??"").replace(/[&<>"']/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[e])}function co(n,e,t){let i=e.find(r=>Rn(r))??null;if(n.replaceChildren(),!i)return n.textContent=t.slice(0,1).toUpperCase(),null;let o=document.createElement("img");return o.alt="",o.referrerPolicy="no-referrer",o.src=i,n.appendChild(o),i}var In=null;function po(){if(In!==null)return In;try{if(typeof document>"u")return In=!1;In=!!document.createElement("canvas").getContext("webgl2")}catch{In=!1}return In}var Ci=null;function Ai(){return Ci||(Ci=(typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?(0,On.importCdnAsset)("seatlayer-view3d.mjs"):import("@seatlayer/core/view3d")).catch(e=>{throw Ci=null,e}),Ci)}function ho(){(typeof navigator>"u"?void 0:navigator.connection)?.saveData||Ai().catch(()=>{})}async function uo(){return typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?(0,On.importCdnAsset)("seatlayer-panorama.mjs"):import("@seatlayer/core")}async function _n(){return typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?(0,On.importCdnAsset)("seatlayer-checkout.mjs"):Promise.resolve().then(()=>(Fa(),Ba))}async function Qa(){return typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?(0,On.importCdnAsset)("seatlayer-sales.mjs"):Promise.resolve().then(()=>(Wa(),qa))}function Ja(n){return n==="unavailable_for_event"||n==="payments_off_for_event"?n:"not_configured"}function el(n){return n.lineItems.reduce((e,t)=>e+t.quantity,0)}function jr(n,e){if(n.objectType!=="ga")return n.displayLabel??n.label;let t=e.find(i=>i.id===n.objectId);return n.displayLabel??t?.displayLabel??t?.label??x("picker.generalAdmission","General admission")}function um(n,e){let t=new Map;for(let i of n){let o=i.rowLabel&&i.seatNumber?[i.sectionLabel,`${x("picker.row","Row")} ${i.rowLabel}`,`${x("picker.seat","Seat")} ${i.seatNumber}`].filter(Boolean).join(" \xB7 "):jr(i,e),r=[i.categoryLabel,i.tierLabel].filter(Boolean).join(" \xB7 "),s=Math.max(1,Math.floor(i.quantity||1)),a=`${o}\0${r}`,l=t.get(a)??{label:o,detail:r,units:0,amount:0};l.units+=s,l.amount+=i.unitPrice*s,t.set(a,l)}return[...t.values()].map(i=>({label:i.units>1?`${i.label} \xD7${i.units}`:i.label,...i.detail?{detail:i.detail}:{},amount:i.amount}))}var Ya=(n,e,t)=>(0,zr.t)("picker.bookingForm.guestOfCount",{label:n,index:e,total:t});function mm(n,e,t=[]){let i=new Map,o=[];for(let d of n.lineItems){let p=jr(d,t),m=Math.max(1,Math.floor(d.quantity)||1);if(d.objectType!=="ga"&&!(d.objectType==="table"&&m>1)){o.push({key:d.label,name:p,unitIndex:1,quantity:1});continue}for(let u=1;u<=m;u+=1){let f=(i.get(d.label)??0)+1;i.set(d.label,f),o.push({key:`${d.label}#${f}`,name:p,unitIndex:u,quantity:m})}}let r=e?.ticketKeyDetails??[],s=e?.ticketKeys??r.map(d=>d.ticketKey),a=(s.length===o.length?s:o.map(d=>d.key)).map(d=>{let p=o.find(u=>u.key===d),m=r.find(u=>u.ticketKey===d);return{key:d,name:m?.displayLabel??p?.name,unitIndex:m?.unitIndex??p?.unitIndex??1,quantity:m?.quantity??p?.quantity??1}}),l=new Map;for(let d of a)d.name&&d.quantity<=1&&l.set(d.name,(l.get(d.name)??0)+1);let c=new Map;return a.map(({key:d,name:p,unitIndex:m,quantity:u})=>{if(!p)return{key:d};if(u>1)return{key:d,title:Ya(p,m,u)};let f=(c.get(p)??0)+1;c.set(p,f);let b=l.get(p)??1;return{key:d,title:b>1?Ya(p,f,b):p}})}function tl(n,e,t,i,o=[]){let r=new Map;for(let s of n.lineItems){let a=jr(s,o);r.set(a,(r.get(a)??0)+1)}return{kind:"pay",provider:e,order:{holdId:n.holdId,expiresAt:n.expiresAt,currency:n.currency,total:n.total,labels:[...r].map(([s,a])=>a>1?`${s} \xD7${a}`:s),tickets:mm(n,i,o),lines:um(n.lineItems,o)},bookingForm:t?.bookingForm??null,...t?.bookingMode==="free"?{free:!0}:{}}}function nl(n){return String(n?.code).startsWith("booking_form_")}function mo(n,e,t){let i={month:"short",day:"numeric",hour:"numeric",minute:"2-digit"},o=new Date(n);if(e)try{return o.toLocaleString(t,{...i,timeZone:e})}catch{}return o.toLocaleString(t,i)}function Kr(n){return/early[\s-]*bird/i.test(n?.trim()??"")}function il(n){return Kr(n)?'<svg class="sl-offer-icon sl-offer-icon-discount" viewBox="0 0 32 32" aria-hidden="true"><defs><linearGradient id="sl-offer-discount-gradient" x1="29.492" y1="0" x2="20.028" y2="36.183" gradientUnits="userSpaceOnUse"><stop stop-color="#FD6D00"/><stop offset="1" stop-color="#F8B302"/></linearGradient></defs><path d="M16 22.751a1.071 1.071 0 1 0 0-2.142 1.071 1.071 0 0 0 0 2.142ZM16 11.39a1.071 1.071 0 1 0 0-2.141 1.071 1.071 0 0 0 0 2.141Z" fill="url(#sl-offer-discount-gradient)"/><path d="M31.137.863A2.928 2.928 0 0 0 29.054 0H17.836c-.787 0-1.527.307-2.083.863L.863 15.753A2.93 2.93 0 0 0 0 17.836c0 .787.307 1.527.863 2.083l11.218 11.218A2.927 2.927 0 0 0 14.164 32c.787 0 1.527-.307 2.083-.863l14.89-14.89A2.928 2.928 0 0 0 32 14.164V2.946c0-.788-.307-1.527-.863-2.083ZM16 7.374a2.946 2.946 0 1 1 0 5.891 2.946 2.946 0 0 1 0-5.891Zm0 17.252a2.946 2.946 0 1 1 0-5.891 2.946 2.946 0 0 1 0 5.891Zm6.025-7.689H9.975a.938.938 0 0 1 0-1.875h12.05a.938.938 0 0 1 0 1.875Zm4.017-10.041a.938.938 0 1 1 0-1.875.938.938 0 0 1 0 1.875Z" fill="url(#sl-offer-discount-gradient)"/></svg>':'<svg class="sl-offer-icon sl-offer-icon-tag" viewBox="0 0 24 24" aria-hidden="true"><path d="M20.6 13.6 13.7 20.5a2 2 0 0 1-2.8 0L3.5 13.1A2 2 0 0 1 3 11.7V4h7.7a2 2 0 0 1 1.4.6l8.5 8.5a.7.7 0 0 1 0 .5Z"/><circle cx="7.5" cy="8.5" r="1"/></svg>'}function fo(n,e){return`<span class="sl-offer-mark" role="img" aria-label="${e(n)}" title="${e(n)}">${il(n)}</span>`}function go(n,e){return`<span class="sl-offer-badge">${il(n)}<span>${e(n)}</span></span>`}function ol(n,e=Date.now()){let t=n-e;if(t<=0)return null;let i=Math.max(1,Math.ceil(t/6e4)),o=Math.floor(i/1440),r=Math.floor(i%1440/60),s=i%60;return`${(o>0?[`${o}d`,...r?[`${r}h`]:[]]:[...r?[`${r}h`]:[],...s||!r?[`${s}m`]:[]]).join(" ")} left`}function Gr(n){return String(n??"\u2014").replace(/[&<>"]/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[e])}function L(n){return String(n??"").replace(/[&<>"]/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[e])}function Ur(n){return n?(0,_e.seatNoteRowModel)(n).map(e=>({...e,title:x(e.titleKey,e.titleFallback)})):[]}function al(n){return Ur(n).map(e=>e.title)}function sn(n,e={}){return qr(Ur(n),e)}function qr(n,e={}){if(!n.length)return"";let t=e.compact?15:17,i=n.map(o=>`<div class="sl-note sl-note-${L(o.tone)}"><span class="sl-note-i">${(0,_e.seatTypeIconSvg)(o.icon,{size:t})}</span><span class="sl-note-t"><b>${L(o.title)}</b>`+(o.note?`<span class="sl-note-n">${L(o.note)}</span>`:"")+"</span></div>").join("");return`<div class="sl-notes${e.compact?" compact":""}">${i}</div>`}function ll(n){return Ur(n).map(e=>{let t=L(e.note?`${e.title}: ${e.note}`:e.title);return`<span class="sl-cx-mark sl-cx-mark-${L(e.tone)}" role="img" aria-label="${t}" title="${t}">${(0,_e.seatTypeIconSvg)(e.icon,{size:13})}</span>`}).join("")}function bo(n){let e=[];return n?.restrictedView&&e.push(x("picker.restrictedView","Restricted view")),n?.obstructedView&&e.push(x("picker.obstructedView","Obstructed view")),e}function Wr(n,e){if(!n)return"";let t=e?x("picker.viewFromThisSeat","View from this seat"):x("picker.seeItIn3d","See it in 3D"),i=e?x("picker.viewFromHere","View from here"):t;return`<button type="button" class="sl-confirm-3d" aria-label="${t}"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2l9 5v10l-9 5-9-5V7z"/><path d="M12 12l9-5M12 12v10M12 12L3 7"/></svg><span>${i}</span></button>`}function cl(n,e){if(!e)return"";let t=e,i=t.includes(n.id),o=i?t.length>1?x("picker.openComparison","Open comparison"):x("picker.savedForComparison","Saved for comparison"):t.length?x("picker.compareWithSaved","Compare with saved"):x("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>${L(o)}</span></button>`}function dl(n,e,t){if(!t)return"";let i=(0,sl.seatConfidenceDisclosure)(n.confidenceEvidence),o=i.modeledTarget??i.reality;return`<button type="button" class="sl-confirm-confidence" aria-label="Open seat confidence passport for ${L(n.displayLabel??n.label)}"><span><em>${L(e)}</em><strong>${L(i.headline)}</strong><small>${L(o)}</small></span><b>Passport</b></button>`}function ve(n){let e=n?.rowLabel,t=n?.sectionLabel;if(!e||!t)return e;for(let i of["-"," ","\xB7","/","_"]){let o=`${t}${i}`;if(e.startsWith(o)&&e.length>o.length)return e.slice(o.length)}return(0,_e.compactRowLabel)(e,t)}function gm(n){switch(n){case"paused":return{title:x("picker.accessPausedTitle","These seats are on hold right now"),body:x("picker.accessPausedBody","The organizer has paused this selection. Try again in a few minutes."),action:x("picker.accessRetry","Try again")};case"revoked":return{title:x("picker.accessRevokedTitle","This access link is no longer active"),body:x("picker.accessRevokedBody","Ask whoever sent you here for a new link to keep booking these seats."),action:x("picker.accessRefresh","Refresh")};case"idle":return{title:x("picker.idlePausedTitle","Your session expired"),body:x("picker.idlePausedBody","You were away for a while. Refresh to see which seats are free now."),action:x("picker.idleRefresh","Show latest seats")};case"no_token":case"provider_failed":return{title:x("picker.accessExpiredTitle","The seat map timed out"),body:x("picker.accessExpiredBody","Any seats you\u2019re holding stay held. Refresh to see what\u2019s available now."),action:x("picker.accessRefresh","Refresh")};default:return{title:x("picker.accessInvalidTitle","We couldn\u2019t verify your access"),body:x("picker.accessInvalidBody","You can still book anything shown as available. Contact whoever sent you here for access to the rest."),action:x("picker.accessRefresh","Refresh")}}}var bm=6;function pl(n,e,t){let i=Gr;return[n?.sectionLabel?`<div class="sl-confirm-field sl-confirm-sec${n.sectionLabel.length>bm?" sl-confirm-sec-long":""}"><span class="sl-confirm-key">${x("picker.section","Section")}</span><span class="sl-confirm-value">${i(n.sectionLabel)}</span></div>`:"",n?.rowLabel||n?.objectType==="booth"?`<div class="sl-confirm-field"><span class="sl-confirm-key">${i(t)}</span><span class="sl-confirm-value">${i(ve(n)??n?.displayLabel??e)}</span></div>`:"",n?.objectType!=="booth"?`<div class="sl-confirm-field"><span class="sl-confirm-key">${x("picker.seat","Seat")}</span><span class="sl-confirm-value">${i(n?.seatNumber??n?.displayLabel??e)}</span></div>`:""].filter(Boolean).join("")}function hl(n,e,t){let i=Gr,o=n?.objectType==="booth",r=n?.objectType==="table"&&!!n?.bookingMode,s=o||r||!n?.seatNumber,a=n?.sectionLabel??(s?void 0:n?.displayLabel),l=r?`${x("picker.guests","Guests")} ${n?.bookingMode==="variable"?`${n?.minOccupancy}\u2013${n?.maxOccupancy}`:n?.capacity}`:void 0,d=(s?[l,a?n?.rowLabel??n?.displayLabel:void 0]:[n?.rowLabel?`${t} ${ve(n)??""}`.trim():void 0,`${x("picker.seat","Seat")} ${n?.seatNumber??e}`]).filter(Boolean).join(" \xB7 ");return(a?`<span class="sl-confirm-place">${i(a)}</span>`:"")+(d?`<span class="sl-confirm-pos">${a?" \xB7 ":""}${i(d)}</span>`:"")+(a||d?"":`<span class="sl-confirm-pos">${i(e)}</span>`)}function ul(n,e){if(!n)return"";let t=e?x("picker.viewFromThisSeat","View from this seat"):x("picker.seeItIn3d","See it in 3D");return`<button type="button" class="sl-confirm-pill sl-confirm-3dpill" aria-label="${t}" title="${t}"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2l9 5v10l-9 5-9-5V7z"/><path d="M12 12l9-5M12 12v10M12 12L3 7"/></svg><span aria-hidden="true">3D</span></button>`}function ml(n,e){if(!n||e)return"";let t=x("picker.seeItIn3d","See it in 3D");return`<button type="button" class="sl-confirm-3drow" aria-label="${t}" title="${t}"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2l9 5v10l-9 5-9-5V7z"/><path d="M12 12l9-5M12 12v10M12 12L3 7"/></svg><span aria-hidden="true">3D</span></button>`}function rl(n){return n.buyerMessage?.trim()||(n.restriction==="companion"?x("picker.companionRequiresWheelchair","Requires the adjacent wheelchair place"):void 0)}function yo(n,e,t,i=()=>{}){let o=Gr;if(n.length>1)return`<fieldset class="sl-confirm-tiers"><legend><span>${(0,_e.t)("picker.ticketType")}</span></legend>`+n.map(a=>{let l=rl(a),c=i(a);return`<button type="button" class="sl-confirm-tier" data-confirm-tier="${o(a.id)}"${c?` data-offer-name="${o(c)}"`:""} aria-pressed="${a.id===e}"><span class="sl-confirm-tier-copy"><span class="sl-confirm-tier-name">${o(a.name)}`+(c?`<span class="sl-confirm-tier-offer">${go(c,o)}</span>`:"")+"</span>"+(l?`<small class="sl-confirm-tier-note">${o(l)}</small>`:"")+`</span><span class="sl-confirm-tier-price">${o(t(a))}</span></button>`}).join("")+"</fieldset>";let r=n[0],s=r?rl(r):void 0;return s?`<p class="sl-confirm-tier-note">${o(s)}</p>`:""}function fl(n){return'<div class="sl-confirm-grid">'+n.identityFields+`</div><div class="sl-confirm-cat"><span class="sl-confirm-cat-name">${L(n.categoryLabel)}</span>`+(n.priceLabel?`<span class="sl-confirm-price">${L(n.priceLabel)}</span>`:"")+"</div>"+(n.priceLabel&&n.feeNote?`<div class="sl-confirm-fee">${L(n.feeNote)}</div>`:"")+'<div class="sl-confirm-id">'+n.marker+`<span class="sl-confirm-dot" style="background:${L(n.categoryColor)}" aria-hidden="true"></span><span class="sl-sr">${L(n.categoryLabel)}</span><span class="sl-confirm-who">`+n.identity+"</span>"+(n.priceLabel?`<span class="sl-confirm-idprice">${L(n.priceLabel)}</span>`:"")+'</div><div class="sl-confirm-body">'+n.commercial+n.tierChoices+n.groupDates+n.wheelchair+(n.thumb||n.see3dPill?`<div class="sl-confirm-strip">${n.thumb}<span class="sl-confirm-pills">${n.see3dPill}</span></div>`:"")+n.inspect+'<div class="sl-confirm-row">'+(n.see3dRow??"")+`<button type="button" class="sl-confirm-cancel">${L(n.cancelLabel)}</button><button type="button" class="sl-confirm-add"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M5 12.5l4 4L19 7"/></svg><span class="sl-confirm-add-t">${L(n.selectLabel)}</span></button></div></div>`}function gl(n,e){let t=Y,{variable:i}=e;return`<section class="sl-table-dialog" role="dialog" aria-modal="true" aria-labelledby="sl-table-title" aria-describedby="sl-table-copy"><div class="sl-table-head"><div class="sl-table-eyebrow">${t(i?(0,_e.t)("picker.flexiblePartyTypeWord",{typeWord:e.typeWord}):(0,_e.t)("picker.wholeTypeWord",{typeWord:e.typeWord}))}</div><h2 class="sl-table-title" id="sl-table-title">${t(n.displayLabel??n.label)}</h2><p class="sl-table-copy" id="sl-table-copy">${t(i?x("picker.chooseGuestsCopy","Choose how many guests will sit together. This table is held exclusively for your party."):(0,_e.t)("picker.allPlacesBookedTogether",{count:n.capacity}))}</p></div><div class="sl-table-body"><div class="sl-table-summary"><span>${t(e.categoryLabel)}</span>`+(e.suppressPricing?"":`<b data-table-unit>${t((0,_e.t)("picker.perGuestPrice",{price:e.unitPrice}))}</b>`)+`<span class="muted">${t(x("picker.tableCapacity","Table capacity"))}</span><span>${t((0,_e.t)("picker.guestsCount",{count:n.capacity}))}</span>`+(n.entrance?`<span class="muted">${t(x("picker.entrance","Entrance"))}</span><span>${t(n.entrance)}</span>`:"")+(e.suppressPricing?"":`<span class="muted">${t(x("picker.total","Total"))}</span><b data-table-total></b>`)+"</div>"+(i?`<label class="sl-table-qtylabel" id="sl-table-qty-label">${t(x("picker.numberOfGuests","Number of guests"))}</label><div class="sl-table-stepper" role="group" aria-labelledby="sl-table-qty-label"><button type="button" data-table-step="-1" aria-label="${t(x("picker.fewerGuests","Fewer guests"))}">\u2212</button><output aria-live="polite" data-table-qty>${n.quantity}</output><button type="button" data-table-step="1" aria-label="${t(x("picker.moreGuests","More guests"))}">+</button></div><div class="sl-table-range">${t((0,_e.t)("picker.chooseMinMaxGuests",{min:n.minOccupancy,max:n.maxOccupancy}))}</div>`:`<input type="hidden" data-table-qty value="${n.capacity}">`)+`<div class="sl-table-actions"><button type="button" class="sl-table-cancel">${t((0,_e.t)("common.cancel"))}</button><button type="button" class="sl-table-confirm">${t(e.held?x("picker.updateTable","Update table"):i?x("picker.selectTable","Select table"):x("picker.selectWholeTable","Select whole table"))}</button></div></div></section>`}function bl(n,e){let t=gm(n),i=document.createElement("div");i.className="sl-interrupt sl-access",i.setAttribute("role","status"),i.setAttribute("aria-live","polite");let o=document.createElement("div");o.className="sl-interrupt-card";let r=document.createElement("div");r.className="sl-interrupt-title",r.textContent=t.title;let s=document.createElement("div");s.className="sl-interrupt-body",s.textContent=t.body,o.append(r,s);let a=document.createElement("div");a.className="sl-interrupt-actions";let l=document.createElement("button");l.type="button",l.className="sl-interrupt-act";let c=document.createElement("span");c.className="sl-interrupt-act-icon",c.setAttribute("aria-hidden","true"),c.textContent="\u21BB";let d=document.createElement("span");return d.textContent=t.action,l.append(c,d),l.addEventListener("click",async()=>{i.classList.add("is-reloading"),l.disabled=!0;try{await e()}catch{}finally{i.isConnected&&(i.classList.remove("is-reloading"),l.disabled=!1)}}),a.appendChild(l),o.appendChild(a),i.appendChild(o),i}function yl(n,e){return`<div class="sl-a11yhead"><span class="sl-a11yhead-t">${L(n)}</span><button type="button" class="sl-a11yclose" data-a11y-close aria-label="${Y(e)}"><svg viewBox="0 0 24 24" aria-hidden="true"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg></button></div>`}function vl(n){return n.map(e=>{let t=`<button type="button" role="switch" class="sl-a11yrow${e.className?` ${e.className}`:""}${e.on?" on":""}" data-a11y-row="${L(e.key)}" aria-checked="${e.on}" aria-pressed="${e.on}"`+(e.disabled?' disabled aria-disabled="true"':"")+`><span class="sl-a11yrow-i" aria-hidden="true">${e.iconHtml}</span><span class="sl-a11yrow-t"><span class="sl-a11yrow-l">${L(e.label)}</span></span>`+(e.count?`<span class="sl-a11yrow-c">${L(e.count)}</span>`:"")+'<span class="sl-a11yrow-s" aria-hidden="true"></span></button>';return e.note?`<div class="sl-a11yrow-w">${t}${Nn({id:`sl-info-${Y(e.key.replace(/[^A-Za-z0-9]+/g,"-"))}`,label:e.note,text:L(e.note)})}</div>`:t}).join("")}function Nn(n){return`<span class="sl-info"${n.wrapRef?` data-ref="${Y(n.wrapRef)}"`:""}><button type="button" class="sl-info-btn" data-sl-info aria-label="${Y(n.label)}" aria-describedby="${Y(n.id)}" aria-expanded="false"><svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="12" r="9"/><path d="M12 11v5"/><path d="M12 8h.01"/></svg></button><span class="sl-info-pop" role="tooltip" id="${Y(n.id)}"${n.ref?` data-ref="${Y(n.ref)}"`:""}>${n.text}</span></span>`}function wl(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 xl(n){let e=n.performanceLabel?`<div class="sl-chip-when">${Y(n.performanceLabel)}</div>`:"",t=n.performanceDates?.labels.length?`<div class="sl-chip-dates"><span class="sl-chip-dates-summary">${Y(n.performanceDates.summary)}</span><span class="sl-chip-date-list">${n.performanceDates.labels.map(i=>`<span class="sl-chip-date">${Y(i)}</span>`).join("")}</span></div>`:"";return e+ym(n)+t}function ym(n){let{d:e,area:t,label:i,objectType:o,quantity:r=1,identity:s}=n,a=F=>String(F??"\u2014").replace(/[&<>"]/g,Q=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[Q]),l=o==="ga"?"ga":e?.objectType??o,c=s?.displayType?.trim()||e?.displayType?.trim()||t?.displayType?.trim()||(l==="table"?x("picker.table","Table"):l==="booth"?x("picker.booth","Booth"):l==="ga"?x("picker.generalAdmission","General admission"):x("picker.row","Row")),d=s?.rowLabel??s?.displayLabel??e?.rowLabel??e?.displayLabel??t?.label??i,p=n.categoryLabel?.trim()??"",m="",u=[];l==="table"&&s?.bookingMode?(m=`${c} ${d}`,u.push([x("picker.guests","Guests"),String(r)])):l==="ga"?(m=String(t?.displayLabel??d),r>1&&u.push([x("picker.tickets","Tickets"),String(r)])):l==="booth"?(m=e?.sectionLabel??`${c} ${d}`,e?.sectionLabel&&u.push([c,String(d)])):!e?.sectionLabel&&!e?.rowLabel&&!e?.seatNumber?m=String(d):(m=e.sectionLabel??"",e.rowLabel&&u.push([c,String(ve(e)??e.rowLabel)]),e.seatNumber&&u.push([x("picker.seat","Seat"),String(e.seatNumber)]));let f=!m&&!!p,b=m||p||String(d),T=!!p&&!f&&p!==b,E=n.offerName?fo(n.offerName,a):"",v=u.map(([F,Q])=>`<span class="sl-chip-seg" data-fit-seg><span class="w">${a(F)}</span> <b>${a(Q)}</b></span>`);T&&v.push(`<span class="sl-chip-seg" data-fit-seg data-fit-type><span class="w">${a(p)}</span>${E}</span>`);let M=[b,...u.map(([F,Q])=>`${F} ${Q}`),T?p:"",n.offerName??""].filter(Boolean).join(" \xB7 ");return`<div class="sl-chip-id"><span class="sl-sr">${a(M)}</span><span class="sl-chip-name" aria-hidden="true">${a(b)}${T?"":E}</span>`+(v.length?`<span class="sl-chip-pos" aria-hidden="true">${v.join("<i>\xB7</i>")}</span>`:"")+"</div>"}function vo(n,e,t){return n.map(i=>`<option value="${t(i.id)}"${i.id===e?" selected":""}>${t(i.name)}</option>`).join("")}function vm(n){let e=Y;return` data-key="${e(n.key)}"`+(n.heldLabels.length?` data-held="${e(encodeURIComponent(n.heldLabels.join(`
194
+ `)))}"`:"")+(n.seatIds.length?` data-seat="${e(n.seatIds.join(" "))}"`:"")+(n.locateId?` data-locate="${e(n.locateId)}"`:"")}function kl(n){let e=Y;return`<div class="sl-chip${n.held?" sl-held":""}${n.fresh?" sl-enter":""}"`+vm(n)+">"+(n.held?n.stateHtml:`<span class="sl-chip-dot" style="background:${L(n.categoryColor)}" aria-hidden="true"></span>`)+`<div class="sl-chip-main">${n.identityHtml}`+(n.extrasHtml?`<div class="sl-chip-sub">${n.extrasHtml}</div>`:"")+`${n.noteHtml}</div>`+(n.amountText?`<span class="amt">${e(n.amountText)}</span>`:"")+n.railHtml+"</div>"}function Yr(n,e){let t=Y(n),i=e?Y(e):"";return'<div class="sl-chip-rail">'+(e?`<button type="button" class="view" data-view-label="${i}" aria-label="${Y((0,mt.t)("picker.viewFromSeat",{label:e}))}"><svg viewBox="0 0 24 24"><path d="M1 12s4-7 11-7 11 7 11 7-4 7-11 7S1 12 1 12z"/><circle cx="12" cy="12" r="3"/></svg></button>`:"")+`<button type="button" class="rm" aria-label="${t}"><svg viewBox="0 0 24 24"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg></button></div>`}function wo(n,e){return new Set(n.filter(t=>(e[t.key]??0)<=0).map(t=>t.key))}function xo(n,e){let t=(n.doc?.categories??[]).filter(s=>!s.notForSale),i=e?t.filter(s=>s.key===e):t;if(!i.length)return null;let o=wo(i,n.categoryAvailability());return o.size<i.length||(n.currentHold()?.items??[]).some(s=>o.has(s.categoryKey))?null:Object.assign(new Error("seatlayer: that ticket type is sold out"),{status:409,code:"sold_out",reason:"sold_out"})}function Sl(n){return n.confirming?`<div class="sl-ba" role="alert"><div class="sl-ba-title"><span class="spark" aria-hidden="true">\u2726</span>${x("picker.replaceCurrentChoices","Replace your current choices?")}</div><div class="sl-ba-replace"><b>${(0,mt.t)("picker.willFindSeatsTogether",{count:n.quantity})}</b><span>${x("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>${x("picker.keepMine","Keep mine")}</button><button type="button" class="replace" data-ba-replace>${x("picker.findNewSeats","Find new seats")}</button></div></div>`:`<div class="sl-ba"><div class="sl-ba-title"><span class="sl-ba-title-t">${x("picker.findSeatsTogether","Find seats together")}</span>`+Nn({id:"sl-info-best-seats",label:x("picker.aboutBestSeats","About finding seats together"),text:x("picker.closestGroupChosenInstantly","Closest available group, chosen instantly.")})+(n.offerPremium?`<button type="button" class="sl-ba-premium${n.premium?" on":""}" data-ba-premium aria-pressed="${n.premium?"true":"false"}"><span class="star" aria-hidden="true">\u2605</span>${x("picker.bestSeatsPremium","Best seats")}</button>`:"")+`</div><div class="sl-ba-qty"><button type="button" data-ba="-1" aria-label="${x("picker.fewerSeats","Fewer seats")}">\u2212</button><span>${n.quantity}</span><button type="button" data-ba="1" aria-label="${x("picker.moreSeats","More seats")}">+</button></div>`+(n.categories.length>1?`<select class="sl-ba-cat" aria-label="${Y(x("picker.preferredTicketType","Preferred ticket type"))}" data-ba-cat><option value="">${Y(x("picker.anyTicketType","Any ticket type"))}</option>`+n.categories.map(e=>e.soldOut?`<option value="${Y(e.key)}" disabled>${Y(`${e.label} \xB7 ${x("picker.soldOutTitle","Sold out")}`)}</option>`:`<option value="${Y(e.key)}"${n.selectedCategory===e.key?" selected":""}>${Y(e.label)}</option>`).join("")+"</select>":'<span class="sl-ba-cat" aria-hidden="true"></span>')+(n.zones.length?`<select class="sl-ba-zone" aria-label="${x("picker.preferredVenueZone","Preferred venue zone")}" data-ba-zone><option value="">${x("picker.anyVenueZone","Any venue zone")}</option>`+n.zones.map(e=>`<option value="${Y(e.id)}"${n.selectedZone===e.id?" selected":""}>${Y(e.label)}</option>`).join("")+"</select>":"")+`<button type="button" class="sl-ba-go${n.busy?" sl-busy":""}"${n.busy?" disabled":""}>`+(n.busy?`<span class="sl-ba-spin" aria-hidden="true"></span>${x("picker.findingBestSeats","Finding the best seats\u2026")}`:(0,mt.tCount)("picker.findBestSeatsCount",n.quantity))+"</button>"+(n.reopened?`<button type="button" class="sl-ba-back" data-ba-close>${x("picker.keepMyPicks","Keep my picks")}</button>`:"")+"</div>"}function Tl(n){return n==="setup"||n==="testable"?{heading:x("picker.salesNotOpenPill","Sales haven\u2019t opened yet"),sentence:x("picker.salesNotOpenCopy","Tickets for this event aren\u2019t on sale yet.")}:n==="paused"?{heading:x("picker.salesPausedPill","Sales are paused"),sentence:x("picker.salesPausedCopy","Ticket sales are paused for now.")}:{heading:x("picker.salesClosedPill","Sales are closed"),sentence:x("picker.salesClosedCopy","Ticket sales for this event have ended.")}}function El(n,e=!1){if(!e&&(n==="setup"||n==="testable"||n==="paused")){let t=Tl(n);return{pill:t.heading,cta:t.heading,toast:t.sentence}}return{pill:x("picker.salesClosedPill","Sales are closed"),cta:x("picker.salesClosedCta","Sales closed"),toast:x("picker.salesClosedToast","Sales are closed for this event.")}}function Cl(n){if(n.salesClosed&&!n.hasPicks){let e=n.whenText?`<span class="when">${Y(n.whenText)}</span>`:"",t=n.note??Tl(n.salesState);return`<div class="sl-closed-note" role="status"><b>${t.heading}</b><span>${t.sentence}${e}</span></div>`}return""}function Al(n){return n.hasGaAreas?n.seated?n.venue3d?(0,mt.t)("picker.trayHintChoose3dOrStanding"):x("picker.trayHintTapOrStanding","Tap a seat on the map or grab standing tickets below."):n.venue3d?(0,mt.t)("picker.gaTrayHintChoose3dArea"):x("picker.gaTrayHintTapArea","Tap an area on the map to choose tickets."):n.groupMode==="per_performance"?x("picker.groupPerPerformanceTrayHint","Choose seats for this performance, then complete every date above."):n.groupMode?n.season?(0,mt.t)("picker.season.trayHint"):x("picker.groupTrayHint","Choose seats once. The same seats will be held for every performance."):n.venue3d?(0,mt.t)("picker.trayHintChoose3dOrBest"):x("picker.trayHintTapOrBest","Tap a seat on the map, or let us pick the best available for you.")}var Ne=require("@seatlayer/core");var Bn=require("@seatlayer/core");var To=require("@seatlayer/core/core/color");function ft(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 o=t.length<=4?[...t].map(r=>`${r}${r}`).join(""):t;return{r:Number.parseInt(o.slice(0,2),16),g:Number.parseInt(o.slice(2,4),16),b:Number.parseInt(o.slice(4,6),16)}}let 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 ko(n){return(0,To.relativeLuminance255)([n.r,n.g,n.b])}function et(n,e){let t=ft(n),i=ft(e);if(!t||!i)return null;let o=Math.max(ko(t),ko(i)),r=Math.min(ko(t),ko(i));return(o+.05)/(r+.05)}function an(n,e="#172033",t="#eef1f8"){return(et(e,n)??0)>=(et(t,n)??0)?e:t}function wm(n){return(0,To.rgb255ToHex)(n.r,n.g,n.b)}function Xr(n,e,t){let i=ft(n),o=ft(e);if(!i||!o)return null;let r=Math.max(0,Math.min(1,t));return wm({r:i.r*r+o.r*(1-r),g:i.g*r+o.g*(1-r),b:i.b*r+o.b*(1-r)})}var So="#d8a425",xm=.18;function Pl(n,e){let t=Xr(So,e,xm)??e;if((et(So,t)??0)>=4.5)return So;for(let i=.15;i<=1;i+=.05){let o=Xr(So,n,1-i);if(o&&(et(o,t)??0)>=4.5)return o}return an(t)}function Ml(n,e,t,i){if((et(n,t)??4.5)>=4.5&&(et(n,i)??4.5)>=4.5)return n;if(!ft(n)||!ft(e))return e;for(let o=.15;o<=1;o+=.05){let r=Xr(n,e,1-o);if(r&&(et(r,t)??0)>=4.5&&(et(r,i)??0)>=4.5)return r}return e}function Ll(n){return{"--sl-chrome":n?"#d6dce6":"#556278","--sl-chrome-line":n?"rgba(23,32,51,.55)":"rgba(233,238,247,.55)"}}var Hl=["--sl-bg","--sl-surface","--sl-text","--sl-muted","--sl-line","--sl-accent-text","--sl-warn-text","--sl-chrome","--sl-chrome-line"];function Rl(n,e){let t=e??n["--sl-bg"],i=ft(t)?an(t)==="#172033":!1,o=ft(n["--sl-bg"])?an(n["--sl-bg"])==="#172033":!1;if(i===o)return null;let r=i?"#ffffff":"#1a2234",s=an(t),a=n["--sl-accent"];return{"--sl-bg":t,"--sl-surface":r,"--sl-text":s,"--sl-muted":i?"#667085":"#a5aec2","--sl-line":i?"rgba(23,32,51,.16)":"rgba(165,174,194,.24)","--sl-accent-text":Ml(a,s,t,r),...Ll(i),"--sl-warn-text":Pl(s,r)}}var km="#f7f8fb",Il={light:{background:"#ffffff",surface:"#f6f7fb",text:"#172033",muted:"#667085",line:"rgba(23,32,51,.16)",map:"#e9edf4"},dark:{background:"#0f1522",surface:"#1a2234",text:"#eef1f8",muted:"#a5aec2",line:"rgba(165,174,194,.24)",map:"#0f1522"}};function Sm(){try{return window.matchMedia?.("(prefers-color-scheme: dark)").matches===!0}catch{return!1}}function Pi(n){if(n)return n==="auto"?Sm()?"dark":"light":n}function Dn(n,e=n?.mode){if(n?.map)return n.map;let t=Pi(e);return t?{background:Il[t].map}:null}function Eo(n){let e;try{e=window.matchMedia?.("(prefers-color-scheme: dark)")}catch{return()=>{}}if(!e)return()=>{};let t=i=>n(i.matches);return typeof e.addEventListener=="function"?e.addEventListener("change",t):e.addListener?.(t),()=>{typeof e.removeEventListener=="function"?e.removeEventListener("change",t):e.removeListener?.(t)}}function gt(n,e,t,i){let o=t?Il[t]:null,r=e?.background??o?.background??n?.background??km,s=ft(r)?an(r)==="#172033":!1,a=e?.surface??o?.surface??(s?"#ffffff":"#1a2234"),l=i&&/^#[0-9a-f]{6}$/i.test(i)?i:void 0,c=e?.accent??n?.accent??l??"#f4b740",d=n?.accentInk,p=e?.accentInk??(d&&(et(d,c)??4.5)>=4.5?d:an(c,"#1a1200","#ffffff")),m=o?void 0:n?.textColor,u=e?.text??o?.text??(m&&(et(m,r)??4.5)>=4.5&&(et(m,a)??4.5)>=4.5?m:an(r));return{"--sl-accent":c,"--sl-accent-ink":p,"--sl-accent-text":Ml(c,u,r,a),"--sl-warn-text":Pl(u,a),"--sl-bg":r,"--sl-surface":a,"--sl-text":u,"--sl-muted":e?.muted??o?.muted??(s?"#667085":"#a5aec2"),"--sl-line":e?.line??o?.line??(s?"rgba(23,32,51,.16)":"rgba(165,174,194,.24)"),...Ll(s),"--sl-scrim-ink":s?"rgba(16,22,36,1)":"rgba(4,7,13,1)","--sl-font":e?.fontFamily??n?.fontFamily??"-apple-system,BlinkMacSystemFont,'Segoe UI',Inter,sans-serif","--sl-radius":`${e?.radius??14}px`}}function Tm(){return`<svg class="sl-boot-venue" viewBox="0 0 200 140" preserveAspectRatio="xMidYMid meet" aria-hidden="true" focusable="false"><g class="sl-boot-shells">${["M20 92a80 52 0 0 1 160 0v14a94 62 0 0 0-160 0z","M32 74a68 42 0 0 1 136 0v12a80 50 0 0 0-136 0z","M46 58a54 32 0 0 1 108 0v10a64 38 0 0 0-108 0z"].map(e=>`<path d="${e}" />`).join("")}</g><rect class="sl-boot-stage" x="62" y="16" width="76" height="16" rx="4" /></svg>`}function Ol(n,e,t){let i=document.createElement("div");i.className="sl-picker",i.tabIndex=-1,i.lang=(0,Bn.getLocale)(),i.dir=(0,Bn.localeDirection)(),n.appendChild(i),Object.entries(gt(void 0,t)).forEach(([r,s])=>i.style.setProperty(r,s)),i.innerHTML=`
197
195
  <div class="sl-head">
198
196
  <div class="sl-logo" data-ref="logo"></div>
199
197
  <div class="sl-head-info" data-ref="headInfo">
@@ -244,7 +242,7 @@ textarea.sl-hco-input{min-height:76px;resize:vertical}
244
242
  </div>
245
243
  <div class="sl-boot" data-ref="boot">
246
244
  <div class="sl-boot-bar" aria-hidden="true"></div>
247
- ${mu()}
245
+ ${Tm()}
248
246
  <span class="sl-boot-say" role="status" aria-live="polite" data-sl-t="picker.loadingSeatMap">${e("picker.loadingSeatMap","Loading seat map\u2026")}</span>
249
247
  </div>
250
248
  <div class="sl-toast" data-ref="toast" role="status" aria-live="polite"></div>
@@ -258,10 +256,10 @@ textarea.sl-hco-input{min-height:76px;resize:vertical}
258
256
  <div class="sl-sec sl-filtersec" data-ref="filtersSec" data-sl-t="picker.filters">${e("picker.filters","Filters")}</div>
259
257
  <div class="sl-filters" data-ref="filters"></div>
260
258
  <div class="sl-offer" data-ref="offer" role="status" aria-live="polite"></div>
261
- <div class="sl-sec sl-prices-sec" data-ref="pricesSec"><span data-sl-t="picker.ticketPrices">${e("picker.ticketPrices","Ticket prices")}</span>${mn({id:"sl-info-prices",label:e("picker.aboutTicketPrices","About ticket prices"),text:e("picker.priceHint","Colours on the map are ticket types. Tap one below to show just those seats."),ref:"pricesHint",wrapRef:"pricesInfo"})}</div>
259
+ <div class="sl-sec sl-prices-sec" data-ref="pricesSec"><span data-sl-t="picker.ticketPrices">${e("picker.ticketPrices","Ticket prices")}</span>${Nn({id:"sl-info-prices",label:e("picker.aboutTicketPrices","About ticket prices"),text:e("picker.priceHint","Colours on the map are ticket types. Tap one below to show just those seats."),ref:"pricesHint",wrapRef:"pricesInfo"})}</div>
262
260
  <div class="sl-prices" data-ref="prices"></div>
263
261
  <div class="sl-sec sl-seats-sec">
264
- <span class="sl-sec-title"><span data-sl-t="picker.yourSeats">${e("picker.yourSeats","Your seats")}</span>${mn({id:"sl-info-seats",label:e("picker.aboutYourSeats","How to choose seats"),text:e("picker.trayHintTapOrBest","Tap a seat on the map, or let us pick the best available for you."),ref:"trayHint",wrapRef:"seatsInfo"})}</span>
262
+ <span class="sl-sec-title"><span data-sl-t="picker.yourSeats">${e("picker.yourSeats","Your seats")}</span>${Nn({id:"sl-info-seats",label:e("picker.aboutYourSeats","How to choose seats"),text:e("picker.trayHintTapOrBest","Tap a seat on the map, or let us pick the best available for you."),ref:"trayHint",wrapRef:"seatsInfo"})}</span>
265
263
  <span class="sl-seat-summary" data-ref="seatSummary"></span>
266
264
  </div>
267
265
  <div class="sl-tray" data-ref="tray"></div>
@@ -270,9 +268,9 @@ textarea.sl-hco-input{min-height:76px;resize:vertical}
270
268
  <button type="button" class="sl-cta" data-ref="cta" disabled></button>
271
269
  </div>
272
270
  </div>
273
- </div>`;let o={};return i.querySelectorAll("[data-ref]").forEach(r=>{o[r.dataset.ref]=r}),{root:i,mapHost:o.map,els:o}}function Ua(n){let e=(t,i)=>{for(let o of n.querySelectorAll(`[${t}]`)){let r=o.getAttribute(t);if(!r)continue;let s=(0,bn.t)(r);s!==r&&i(o,s)}};e("data-sl-t",(t,i)=>{t.textContent=i}),e("data-sl-a",(t,i)=>{t.setAttribute("aria-label",i)}),e("data-sl-ti",(t,i)=>{t.setAttribute("title",i)})}function Yi(n,e){let t=(0,Ae.resolveLocale)(n),i=Ae.TRANSLATED_LOCALES.includes(t)?t:"en";return e&&(0,Ae.setStringOverrides)(e),{locale:i,direction:(0,Ae.localeDirection)(i),ready:(0,Ae.loadLocale)(n)}}function Xi(n,e,t){n.lang=e.locale,n.dir=e.direction,e.ready.then(t)}function qa(n,e){if(!n)return null;let t=(e.languages??[]).map(o=>(0,Ae.resolveLocale)(o)).filter((o,r,s)=>s.indexOf(o)===r);if(t.length<2)return null;let i=document.createElement("select");i.className="sl-langsel",i.setAttribute("aria-label",e.label);for(let o of t){let r=document.createElement("option");r.value=o,r.textContent=Ae.LOCALE_NAMES[o]??o,r.selected=o===(0,Ae.getLocale)(),i.appendChild(r)}return i.addEventListener("change",()=>e.onChange(i.value)),n.appendChild(i),i}function Wa(n,e){e.root.lang=n,e.root.dir=(0,Ae.localeDirection)(n),Ua(e.root);for(let i of e.painters)try{i()}catch{}e.refreshMapCopy();let t=e.languageSelect;t&&t.value!==n&&(t.value=n)}function yn(n,e,t,i=45e3){return new Promise(o=>{if(e.aborted){o({outcome:"cancelled"});return}let r=!1,s=d=>{r||(r=!0,clearTimeout(l),clearTimeout(c),e.removeEventListener("abort",a),o(d))},a=()=>s({outcome:"cancelled"}),l=setTimeout(()=>{r||t()},8e3),c=setTimeout(()=>s({outcome:"timeout"}),i);e.addEventListener("abort",a,{once:!0}),Promise.resolve().then(()=>r?void 0:n()).then(d=>{r||s({outcome:"loaded",value:d})},d=>s({outcome:"error",error:d}))})}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}},fu=new Set(["buyer_access_expired"]),gu=new Set(["paused","provider_failed","channel_denied","sales_not_open"]);function bu(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_group_mismatch":return"group_mismatch";case"buyer_access_mode_mismatch":return"mode_mismatch";case"buyer_access_environment_mismatch":return"environment_mismatch";case"channel_access_denied":return"channel_denied";case"channel_paused":return"paused";case"invalid_channel_scope":return"invalid_scope";case"audience_not_public":return"audience_not_public";case"sales_not_open":return"sales_not_open";case"origin_not_allowed":return"origin_not_allowed";default:break}return n===401?"invalid":null}function yu(n){return/^Bearer\s+(\S+)$/i.exec(n?.trim()??"")?.[1]??null}function Zi(n){return n instanceof he?n.reason!=="paused"&&n.reason!=="channel_denied":!n||typeof n!="object"?!1:n.status===401}function vu(n,e){return n===401&&!!e&&fu.has(e)}var wu=3e4,_e,Ne,jt,vn,ri,wt,xt,at,wn,si,ai,li,Kt,Se,pr,Qi,vt,De=class{constructor(e){R(this,Se);R(this,_e,null);R(this,Ne,0);R(this,jt,null);R(this,vn);R(this,ri);R(this,wt,null);R(this,xt,null);R(this,at,null);R(this,wn,null);R(this,si);R(this,ai);R(this,li,!1);R(this,Kt);if(S(this,vn,e.provider),S(this,ri,e.skewMs??wu),S(this,si,e.onExpired),S(this,ai,e.onUnavailable),e.token){let t=typeof e.token=="string"?{token:e.token}:e.token;x(this,Se,pr).call(this,t)}S(this,li,!!m(this,vn)||!!m(this,_e))}get configured(){return m(this,li)}onRenewed(e){S(this,Kt,e)}get unavailable(){return m(this,at)}get hasToken(){return!!m(this,_e)&&(m(this,Ne)===0||m(this,Ne)>Date.now())}get expiresAt(){return m(this,Ne)}async authorization(e="initial"){if(!this.configured)return null;if(m(this,at))throw new he(m(this,at));let t=Date.now();if(!m(this,_e)||m(this,Ne)>0&&m(this,Ne)-m(this,ri)<=t){let o=!!m(this,_e)&&m(this,Ne)>0&&m(this,Ne)<=t,r=m(this,_e)?o?"expired":"expiring":e,s=await x(this,Se,Qi).call(this,r);if(!s)throw new he(m(this,at)??m(this,wn)??x(this,Se,vt).call(this,"provider_failed"));return`Bearer ${s}`}return`Bearer ${m(this,_e)}`}async handleFailure(e,t,i){var r;if(!this.configured)return!1;if(vu(e,t)){let s=yu(i)??m(this,jt);S(this,_e,null),S(this,Ne,0);let a=await x(this,Se,Qi).call(this,"unauthorized",t),l=!!a&&a!==s;return(r=m(this,si))==null||r.call(this,{reason:"unauthorized",code:t,refreshed:l}),a&&!l&&x(this,Se,vt).call(this,"revoked",t,e),l}let o=bu(e,t);return o&&x(this,Se,vt).call(this,o,t,e),!1}async refresh(e="manual"){return S(this,at,null),S(this,wn,null),S(this,_e,null),S(this,Ne,0),!!await x(this,Se,Qi).call(this,e)}clear(){m(this,xt)?.abort(),S(this,xt,null),S(this,_e,null),S(this,jt,null),S(this,Ne,0),S(this,wt,null),S(this,Kt,void 0)}toJSON(){return{configured:this.configured,hasToken:this.hasToken}}toString(){return"[BuyerAccessContext redacted]"}};_e=new WeakMap,Ne=new WeakMap,jt=new WeakMap,vn=new WeakMap,ri=new WeakMap,wt=new WeakMap,xt=new WeakMap,at=new WeakMap,wn=new WeakMap,si=new WeakMap,ai=new WeakMap,li=new WeakMap,Kt=new WeakMap,Se=new WeakSet,pr=function(e){return!e||typeof e.token!="string"||!e.token?null:(S(this,jt,e.token),S(this,_e,e.token),S(this,Ne,typeof e.expiresAt=="number"?e.expiresAt:0),m(this,_e))},Qi=function(e,t){if(m(this,wt))return m(this,wt);let i=m(this,vn);if(!i)return x(this,Se,vt).call(this,"no_token",t),Promise.resolve(null);let o=m(this,jt),r=new AbortController;S(this,xt,r);let s=(async()=>{try{let a=await yn(()=>Promise.resolve(i({reason:e})),r.signal,()=>{},4e4);if(r.signal.aborted||a.outcome==="cancelled")return null;if(a.outcome!=="loaded")return x(this,Se,vt).call(this,"provider_failed",t),null;let l=a.value,c=x(this,Se,pr).call(this,l);if(!c)return x(this,Se,vt).call(this,"provider_failed",t),null;if(o&&o!==c&&m(this,Kt))try{await m(this,Kt).call(this,{previousToken:o,token:c,reason:e})}catch{}return r.signal.aborted?null:c}catch{return x(this,Se,vt).call(this,"provider_failed",t),null}finally{m(this,xt)===r&&(S(this,wt,null),S(this,xt,null))}})();return S(this,wt,s),s},vt=function(e,t,i){var r;let o={reason:e,code:t,status:i,retryable:e==="paused"||e==="channel_denied"||e==="sales_not_open"};return S(this,wn,o),gu.has(e)||(S(this,at,o),S(this,_e,null),S(this,Ne,0)),(r=m(this,ai))==null||r.call(this,o),o};function xn(n,e={}){return!n.buyerAccessTokenProvider&&!n.buyerAccessToken?null:new De({provider:n.buyerAccessTokenProvider,token:n.buyerAccessToken,...e})}function Ji(n){let e={state:"none"};return{transport:new Proxy(n,{get(i,o){let r=Reflect.get(i,o,i);return typeof r!="function"?r:o!=="chart"?r.bind(i):(...s)=>{let a;try{a=r.apply(i,s)}catch(l){throw e={state:"rejected",error:l},l}return Promise.resolve(a).then(l=>(e={state:"resolved"},l),l=>{throw e={state:"rejected",error:l},l})}}}),outcome:()=>e}}function eo(n,e){if(!e||!n)return null;if(n.state==="resolved")return"chart_load:transform_failed";if(n.state!=="rejected")return null;let t=n.error;return t instanceof ie?t.status>=500&&t.status<=599?"chart_load:chart_fetch_5xx":t.status>=400&&t.status<=499?"chart_load:chart_fetch_4xx":null:typeof t=="object"&&t!==null&&t.name==="AbortError"?"chart_load:chart_fetch_timeout":"chart_load:chart_fetch_network"}var Ya=new Set;function to(n){return Ya.has(n.reason)||(Ya.add(n.reason),typeof fetch>"u"||Jn())?!1:(fetch(`${n.apiBase.replace(/\/+$/,"")}/pub/telemetry/client-error`,{method:"POST",headers:{"Content-Type":"application/json","X-SeatLayer-Client":"1"},body:JSON.stringify({surface:"picker",errorCode:n.reason,eventKey:n.eventKey}),credentials:"omit",keepalive:!0}).catch(()=>{}),!0)}function ur(n){return!!n&&typeof n=="object"&&!Array.isArray(n)}function xu(n){return ur(n.availability)?n.availability:null}function ku(n){let e=n.subscribeTicket;if(!ur(e))return null;let t=e.ticket,i=e.protocols;return t!==void 0&&typeof t!="string"||i!==void 0&&(!Array.isArray(i)||i.some(o=>typeof o!="string"))||t===void 0&&i===void 0?null:{...t===void 0?{}:{ticket:t},...i===void 0?{}:{protocols:i}}}var Xa=3e4,Su=2e4;function Tu(n){if(!n||typeof n!="object"||Array.isArray(n))return!1;let e=n;return typeof e.token=="string"&&e.token.startsWith("bse_")&&typeof e.expiresAt=="number"&&Number.isFinite(e.expiresAt)&&e.expiresAt>Date.now()&&!!e.event&&typeof e.event=="object"&&!!e.doc&&typeof e.doc=="object"&&!!e.objects&&typeof e.objects=="object"&&!Array.isArray(e.objects)&&!!e.objects.seats&&typeof e.objects.seats=="object"}function Eu(n){return n>=400&&n<500&&n!==408&&n!==429}var no=class{constructor(e,t,i){this.base=e;this.event=t;this.publicKey=i;this.value=null;this.inflight=null;this.refusal=null;this.fetchedAt=0}usable(){return this.inflight?!0:!!this.value&&this.value.expiresAt-Xa>Date.now()}refused(){return this.refusal}async load(e=!1){if(e&&(this.value=null,this.refusal=null),this.refusal)throw this.refusal;if(this.value&&this.value.expiresAt-Xa>Date.now())return this.value;if(this.inflight)return this.inflight;let t=(async()=>{let i=new AbortController,o=setTimeout(()=>i.abort(),4e4);try{let r=await fetch(`${this.base}/pub/events/${encodeURIComponent(this.event)}/bootstrap?${Nt}`,{method:"POST",body:JSON.stringify({publicKey:this.publicKey}),credentials:"omit",signal:i.signal}),s=await r.json().catch(()=>null);if(!r.ok){let a=r.status===429?ei(r.headers.get("Retry-After"),s?.retryAfterSeconds):void 0,l=new ie(r.status,s?.error??`request_failed_${r.status}`,s?.code??s?.error,void 0,void 0,a,void 0,{...typeof s?.hint=="string"&&s.hint?{hint:s.hint}:{},...typeof s?.message=="string"&&s.message?{serverMessage:s.message}:{}});throw Eu(r.status)&&(this.refusal=l),l}if(!Tu(s))throw new ie(502,"invalid_bootstrap_response","invalid_bootstrap_response");return this.value=s,this.fetchedAt=Date.now(),s}finally{clearTimeout(o)}})();this.inflight=t;try{return await t}finally{this.inflight===t&&(this.inflight=null)}}async token(e){let t=e==="expiring"||e==="expired"||e==="unauthorized"||e==="manual",i=await this.load(t);return{token:i.token,expiresAt:i.expiresAt}}},hr=class extends bt{constructor(t,i,o,r,s){super(t,{...s,access:r});this.event=i;this.loader=o;this.bootstrapAccess=r;this.initialChartDelivered=!1;this.initialObjectsDelivered=!1;this.initialAvailabilityDelivered=!1;this.initialTicketDelivered=!1}assertEvent(t){if(t!==this.event)throw new ie(404,"not_found","not_found")}async bundle(t){this.assertEvent(t);let i=this.loader.refused();if(i)throw i;try{await this.bootstrapAccess.authorization("initial")}catch(o){throw this.loader.refused()??o}return this.loader.load()}async chart(t){if(this.assertEvent(t),this.initialChartDelivered)return super.chart(t);let i=await this.bundle(t);return this.initialChartDelivered=!0,{event:i.event,doc:i.doc}}async objects(t){if(this.assertEvent(t),this.initialObjectsDelivered)return super.objects(t);let i=await this.bundle(t);return this.initialObjectsDelivered=!0,{...i.objects,fetchedAt:this.loader.fetchedAt}}async availability(t,i=!1){if(this.assertEvent(t),i||this.initialAvailabilityDelivered)return super.availability(t,i);let o=await this.bundle(t);return this.initialAvailabilityDelivered=!0,xu(o)??super.availability(t,i)}async pickerIdleMinutes(){let t=await this.bundle(this.event),i=ur(t.realtime)?t.realtime.idleMinutes:void 0;return typeof i=="number"&&Number.isFinite(i)&&i>=0?i:null}async subscribeTicket(t){if(this.assertEvent(t),this.initialTicketDelivered)return super.subscribeTicket(t);let i=await this.bundle(t);return this.initialTicketDelivered=!0,Date.now()-this.loader.fetchedAt<Su?ku(i)??super.subscribeTicket(t):super.subscribeTicket(t)}},kn=new Map;function Qa(n,e,t){return`${n}
271
+ </div>`;let o={};return i.querySelectorAll("[data-ref]").forEach(r=>{o[r.dataset.ref]=r}),{root:i,mapHost:o.map,els:o}}function Co(n){let e=(t,i)=>{for(let o of n.querySelectorAll(`[${t}]`)){let r=o.getAttribute(t);if(!r)continue;let s=(0,Bn.t)(r);s!==r&&i(o,s)}};e("data-sl-t",(t,i)=>{t.textContent=i}),e("data-sl-a",(t,i)=>{t.setAttribute("aria-label",i)}),e("data-sl-ti",(t,i)=>{t.setAttribute("title",i)})}function Ao(n,e){let t=(0,Ne.resolveLocale)(n),i=Ne.TRANSLATED_LOCALES.includes(t)?t:"en";return e&&(0,Ne.setStringOverrides)(e),{locale:i,direction:(0,Ne.localeDirection)(i),ready:(0,Ne.loadLocale)(n)}}function Po(n,e,t){n.lang=e.locale,n.dir=e.direction,e.ready.then(t)}function _l(n,e){if(!n)return null;let t=(e.languages??[]).map(o=>(0,Ne.resolveLocale)(o)).filter((o,r,s)=>s.indexOf(o)===r);if(t.length<2)return null;let i=document.createElement("select");i.className="sl-langsel",i.setAttribute("aria-label",e.label);for(let o of t){let r=document.createElement("option");r.value=o,r.textContent=Ne.LOCALE_NAMES[o]??o,r.selected=o===(0,Ne.getLocale)(),i.appendChild(r)}return i.addEventListener("change",()=>e.onChange(i.value)),n.appendChild(i),i}function Nl(n,e){e.root.lang=n,e.root.dir=(0,Ne.localeDirection)(n),Co(e.root);for(let i of e.painters)try{i()}catch{}e.refreshMapCopy();let t=e.languageSelect;t&&t.value!==n&&(t.value=n)}function Fn(n,e,t,i=45e3){return new Promise(o=>{if(e.aborted){o({outcome:"cancelled"});return}let r=!1,s=d=>{r||(r=!0,clearTimeout(l),clearTimeout(c),e.removeEventListener("abort",a),o(d))},a=()=>s({outcome:"cancelled"}),l=setTimeout(()=>{r||t()},8e3),c=setTimeout(()=>s({outcome:"timeout"}),i);e.addEventListener("abort",a,{once:!0}),Promise.resolve().then(()=>r?void 0:n()).then(d=>{r||s({outcome:"loaded",value:d})},d=>s({outcome:"error",error:d}))})}var we=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}},Em=new Set(["buyer_access_expired"]),Cm=new Set(["paused","provider_failed","channel_denied","sales_not_open"]);function Am(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_group_mismatch":return"group_mismatch";case"buyer_access_mode_mismatch":return"mode_mismatch";case"buyer_access_environment_mismatch":return"environment_mismatch";case"channel_access_denied":return"channel_denied";case"channel_paused":return"paused";case"invalid_channel_scope":return"invalid_scope";case"audience_not_public":return"audience_not_public";case"sales_not_open":return"sales_not_open";case"origin_not_allowed":return"origin_not_allowed";default:break}return n===401?"invalid":null}function Pm(n){return/^Bearer\s+(\S+)$/i.exec(n?.trim()??"")?.[1]??null}function Lo(n){return n instanceof we?n.reason!=="paused"&&n.reason!=="channel_denied":!n||typeof n!="object"?!1:n.status===401}function Mm(n,e){return n===401&&!!e&&Em.has(e)}var Lm=3e4,ze,je,ln,Vn,Mi,Ht,Rt,bt,$n,Li,Hi,Ri,cn,Le,Zr,Mo,Lt,De=class{constructor(e){P(this,Le);P(this,ze,null);P(this,je,0);P(this,ln,null);P(this,Vn);P(this,Mi);P(this,Ht,null);P(this,Rt,null);P(this,bt,null);P(this,$n,null);P(this,Li);P(this,Hi);P(this,Ri,!1);P(this,cn);if(k(this,Vn,e.provider),k(this,Mi,e.skewMs??Lm),k(this,Li,e.onExpired),k(this,Hi,e.onUnavailable),e.token){let t=typeof e.token=="string"?{token:e.token}:e.token;w(this,Le,Zr).call(this,t)}k(this,Ri,!!h(this,Vn)||!!h(this,ze))}get configured(){return h(this,Ri)}onRenewed(e){k(this,cn,e)}get unavailable(){return h(this,bt)}get hasToken(){return!!h(this,ze)&&(h(this,je)===0||h(this,je)>Date.now())}get expiresAt(){return h(this,je)}async authorization(e="initial"){if(!this.configured)return null;if(h(this,bt))throw new we(h(this,bt));let t=Date.now();if(!h(this,ze)||h(this,je)>0&&h(this,je)-h(this,Mi)<=t){let o=!!h(this,ze)&&h(this,je)>0&&h(this,je)<=t,r=h(this,ze)?o?"expired":"expiring":e,s=await w(this,Le,Mo).call(this,r);if(!s)throw new we(h(this,bt)??h(this,$n)??w(this,Le,Lt).call(this,"provider_failed"));return`Bearer ${s}`}return`Bearer ${h(this,ze)}`}async handleFailure(e,t,i){var r;if(!this.configured)return!1;if(Mm(e,t)){let s=Pm(i)??h(this,ln);k(this,ze,null),k(this,je,0);let a=await w(this,Le,Mo).call(this,"unauthorized",t),l=!!a&&a!==s;return(r=h(this,Li))==null||r.call(this,{reason:"unauthorized",code:t,refreshed:l}),a&&!l&&w(this,Le,Lt).call(this,"revoked",t,e),l}let o=Am(e,t);return o&&w(this,Le,Lt).call(this,o,t,e),!1}async refresh(e="manual"){return k(this,bt,null),k(this,$n,null),k(this,ze,null),k(this,je,0),!!await w(this,Le,Mo).call(this,e)}clear(){h(this,Rt)?.abort(),k(this,Rt,null),k(this,ze,null),k(this,ln,null),k(this,je,0),k(this,Ht,null),k(this,cn,void 0)}toJSON(){return{configured:this.configured,hasToken:this.hasToken}}toString(){return"[BuyerAccessContext redacted]"}};ze=new WeakMap,je=new WeakMap,ln=new WeakMap,Vn=new WeakMap,Mi=new WeakMap,Ht=new WeakMap,Rt=new WeakMap,bt=new WeakMap,$n=new WeakMap,Li=new WeakMap,Hi=new WeakMap,Ri=new WeakMap,cn=new WeakMap,Le=new WeakSet,Zr=function(e){return!e||typeof e.token!="string"||!e.token?null:(k(this,ln,e.token),k(this,ze,e.token),k(this,je,typeof e.expiresAt=="number"?e.expiresAt:0),h(this,ze))},Mo=function(e,t){if(h(this,Ht))return h(this,Ht);let i=h(this,Vn);if(!i)return w(this,Le,Lt).call(this,"no_token",t),Promise.resolve(null);let o=h(this,ln),r=new AbortController;k(this,Rt,r);let s=(async()=>{try{let a=await Fn(()=>Promise.resolve(i({reason:e})),r.signal,()=>{},4e4);if(r.signal.aborted||a.outcome==="cancelled")return null;if(a.outcome!=="loaded")return w(this,Le,Lt).call(this,"provider_failed",t),null;let l=a.value,c=w(this,Le,Zr).call(this,l);if(!c)return w(this,Le,Lt).call(this,"provider_failed",t),null;if(o&&o!==c&&h(this,cn))try{await h(this,cn).call(this,{previousToken:o,token:c,reason:e})}catch{}return r.signal.aborted?null:c}catch{return w(this,Le,Lt).call(this,"provider_failed",t),null}finally{h(this,Rt)===r&&(k(this,Ht,null),k(this,Rt,null))}})();return k(this,Ht,s),s},Lt=function(e,t,i){var r;let o={reason:e,code:t,status:i,retryable:e==="paused"||e==="channel_denied"||e==="sales_not_open"};return k(this,$n,o),Cm.has(e)||(k(this,bt,o),k(this,ze,null),k(this,je,0)),(r=h(this,Hi))==null||r.call(this,o),o};function zn(n,e={}){return!n.buyerAccessTokenProvider&&!n.buyerAccessToken?null:new De({provider:n.buyerAccessTokenProvider,token:n.buyerAccessToken,...e})}function Ho(n){let e={state:"none"};return{transport:new Proxy(n,{get(i,o){let r=Reflect.get(i,o,i);return typeof r!="function"?r:o!=="chart"?r.bind(i):(...s)=>{let a;try{a=r.apply(i,s)}catch(l){throw e={state:"rejected",error:l},l}return Promise.resolve(a).then(l=>(e={state:"resolved"},l),l=>{throw e={state:"rejected",error:l},l})}}}),outcome:()=>e}}function Ro(n,e){if(!e||!n)return null;if(n.state==="resolved")return"chart_load:transform_failed";if(n.state!=="rejected")return null;let t=n.error;return t instanceof re?t.status>=500&&t.status<=599?"chart_load:chart_fetch_5xx":t.status>=400&&t.status<=499?"chart_load:chart_fetch_4xx":null:typeof t=="object"&&t!==null&&t.name==="AbortError"?"chart_load:chart_fetch_timeout":"chart_load:chart_fetch_network"}var Dl=new Set;function Io(n){return Dl.has(n.reason)||(Dl.add(n.reason),typeof fetch>"u"||Ti())?!1:(fetch(`${n.apiBase.replace(/\/+$/,"")}/pub/telemetry/client-error`,{method:"POST",headers:{"Content-Type":"application/json","X-SeatLayer-Client":"1"},body:JSON.stringify({surface:"picker",errorCode:n.reason,eventKey:n.eventKey}),credentials:"omit",keepalive:!0}).catch(()=>{}),!0)}function Jr(n){return!!n&&typeof n=="object"&&!Array.isArray(n)}function Hm(n){return Jr(n.availability)?n.availability:null}function Rm(n){let e=n.subscribeTicket;if(!Jr(e))return null;let t=e.ticket,i=e.protocols;return t!==void 0&&typeof t!="string"||i!==void 0&&(!Array.isArray(i)||i.some(o=>typeof o!="string"))||t===void 0&&i===void 0?null:{...t===void 0?{}:{ticket:t},...i===void 0?{}:{protocols:i}}}var Bl=3e4,Im=2e4;function Om(n){if(!n||typeof n!="object"||Array.isArray(n))return!1;let e=n;return typeof e.token=="string"&&e.token.startsWith("bse_")&&typeof e.expiresAt=="number"&&Number.isFinite(e.expiresAt)&&e.expiresAt>Date.now()&&!!e.event&&typeof e.event=="object"&&!!e.doc&&typeof e.doc=="object"&&!!e.objects&&typeof e.objects=="object"&&!Array.isArray(e.objects)&&!!e.objects.seats&&typeof e.objects.seats=="object"}function _m(n){return n>=400&&n<500&&n!==408&&n!==429}var Oo=class{constructor(e,t,i){this.base=e;this.event=t;this.publicKey=i;this.value=null;this.inflight=null;this.refusal=null;this.fetchedAt=0}usable(){return this.inflight?!0:!!this.value&&this.value.expiresAt-Bl>Date.now()}refused(){return this.refusal}async load(e=!1){if(e&&(this.value=null,this.refusal=null),this.refusal)throw this.refusal;if(this.value&&this.value.expiresAt-Bl>Date.now())return this.value;if(this.inflight)return this.inflight;let t=(async()=>{let i=new AbortController,o=setTimeout(()=>i.abort(),4e4);try{let r=await fetch(`${this.base}/pub/events/${encodeURIComponent(this.event)}/bootstrap?${en}`,{method:"POST",body:JSON.stringify({publicKey:this.publicKey}),credentials:"omit",signal:i.signal}),s=await r.json().catch(()=>null);if(!r.ok){let a=r.status===429?Ei(r.headers.get("Retry-After"),s?.retryAfterSeconds):void 0,l=new re(r.status,s?.error??`request_failed_${r.status}`,s?.code??s?.error,void 0,void 0,a,void 0,{...typeof s?.hint=="string"&&s.hint?{hint:s.hint}:{},...typeof s?.message=="string"&&s.message?{serverMessage:s.message}:{}});throw _m(r.status)&&(this.refusal=l),l}if(!Om(s))throw new re(502,"invalid_bootstrap_response","invalid_bootstrap_response");return this.value=s,this.fetchedAt=Date.now(),s}finally{clearTimeout(o)}})();this.inflight=t;try{return await t}finally{this.inflight===t&&(this.inflight=null)}}async token(e){let t=e==="expiring"||e==="expired"||e==="unauthorized"||e==="manual",i=await this.load(t);return{token:i.token,expiresAt:i.expiresAt}}},Qr=class extends Pt{constructor(t,i,o,r,s){super(t,{...s,access:r});this.event=i;this.loader=o;this.bootstrapAccess=r;this.initialChartDelivered=!1;this.initialObjectsDelivered=!1;this.initialAvailabilityDelivered=!1;this.initialTicketDelivered=!1}assertEvent(t){if(t!==this.event)throw new re(404,"not_found","not_found")}async bundle(t){this.assertEvent(t);let i=this.loader.refused();if(i)throw i;try{await this.bootstrapAccess.authorization("initial")}catch(o){throw this.loader.refused()??o}return this.loader.load()}async chart(t){if(this.assertEvent(t),this.initialChartDelivered)return super.chart(t);let i=await this.bundle(t);return this.initialChartDelivered=!0,{event:i.event,doc:i.doc}}async objects(t){if(this.assertEvent(t),this.initialObjectsDelivered)return super.objects(t);let i=await this.bundle(t);return this.initialObjectsDelivered=!0,{...i.objects,fetchedAt:this.loader.fetchedAt}}async availability(t,i=!1){if(this.assertEvent(t),i||this.initialAvailabilityDelivered)return super.availability(t,i);let o=await this.bundle(t);return this.initialAvailabilityDelivered=!0,Hm(o)??super.availability(t,i)}async pickerIdleMinutes(){let t=await this.bundle(this.event),i=Jr(t.realtime)?t.realtime.idleMinutes:void 0;return typeof i=="number"&&Number.isFinite(i)&&i>=0?i:null}async subscribeTicket(t){if(this.assertEvent(t),this.initialTicketDelivered)return super.subscribeTicket(t);let i=await this.bundle(t);return this.initialTicketDelivered=!0,Date.now()-this.loader.fetchedAt<Im?Rm(i)??super.subscribeTicket(t):super.subscribeTicket(t)}},jn=new Map;function Fl(n,e,t){return`${n}
274
272
  ${e}
275
- ${t}`}function Za(n){let{base:e,event:t,publicKey:i}=n;if(!e||!t||!i)return;let o=Qa(e,t,i);if(kn.get(o)?.usable())return;let s=new no(e,t,i);kn.set(o,s),s.load().catch(()=>{kn.get(o)===s&&kn.delete(o)})}function Cu(n,e,t){let i=Qa(n,e,t),o=kn.get(i);return o?(kn.delete(i),o.usable()?o:null):null}function io(n){let e=Cu(n.base,n.event,n.publicKey)??new no(n.base,n.event,n.publicKey),t=new De({provider:({reason:i})=>e.token(i),...n.accessHooks});return{access:t,api:new hr(n.base,n.event,e,t,n.apiOptions??{})}}var le=require("@seatlayer/core");var we={enter:260,exit:180,spring:320,flight:500,stagger:30,crossfade:120,collapse:150,rung:200,reducedFade:120,easeEnter:"cubic-bezier(.2,.8,.2,1)",easeExit:"cubic-bezier(.4,0,1,1)",easeSpring:"cubic-bezier(.34,1.56,.64,1)"};var Au=`.sl-picker,.sl-modal-scrim,.sl-mo-host{--sl-dur-enter:${we.enter}ms;--sl-dur-exit:${we.exit}ms;--sl-dur-spring:${we.spring}ms;--sl-dur-flight:${we.flight}ms;--sl-dur-stagger:${we.stagger}ms;--sl-dur-xfade:${we.crossfade}ms;--sl-dur-collapse:${we.collapse}ms;--sl-dur-rung:${we.rung}ms;--sl-ease-enter:${we.easeEnter};--sl-ease-exit:${we.easeExit};--sl-ease-spring:${we.easeSpring};--sl-mo-ox:50%;--sl-mo-oy:50%}`,Pu=`@media (prefers-reduced-motion:reduce){.sl-picker,.sl-modal-scrim,.sl-mo-host{--sl-dur-enter:0ms;--sl-dur-exit:0ms;--sl-dur-spring:0ms;--sl-dur-flight:0ms;--sl-dur-stagger:0ms;--sl-dur-collapse:0ms;--sl-dur-rung:0ms;--sl-dur-xfade:${we.reducedFade}ms}.sl-mo-in,.sl-mo-out,.sl-mo-slide-up,.sl-mo-slide-down,.sl-mo-spring,.sl-mo-rise,.sl-mo-zoom,.sl-mo-scrim,.sl-mo-stagger > *{animation-name:slMoFade;animation-duration:${we.reducedFade}ms;animation-delay:0ms}.sl-mo-hint,.sl-mo-rotate-in,.sl-mo-fly,.sl-mo-collapse{animation:none}.sl-confirm-add-invite,.sl-confirm-add-invite::after{animation:none}.sl-mo-indicator{transition:none}}`,Ja=Au+`
273
+ ${t}`}function Vl(n){let{base:e,event:t,publicKey:i}=n;if(!e||!t||!i)return;let o=Fl(e,t,i);if(jn.get(o)?.usable())return;let s=new Oo(e,t,i);jn.set(o,s),s.load().catch(()=>{jn.get(o)===s&&jn.delete(o)})}function Nm(n,e,t){let i=Fl(n,e,t),o=jn.get(i);return o?(jn.delete(i),o.usable()?o:null):null}function _o(n){let e=Nm(n.base,n.event,n.publicKey)??new Oo(n.base,n.event,n.publicKey),t=new De({provider:({reason:i})=>e.token(i),...n.accessHooks});return{access:t,api:new Qr(n.base,n.event,e,t,n.apiOptions??{})}}var de=require("@seatlayer/core");var Pe={enter:260,exit:180,spring:320,flight:500,stagger:30,crossfade:120,collapse:150,rung:200,reducedFade:120,easeEnter:"cubic-bezier(.2,.8,.2,1)",easeExit:"cubic-bezier(.4,0,1,1)",easeSpring:"cubic-bezier(.34,1.56,.64,1)"};var Dm=`.sl-picker,.sl-modal-scrim,.sl-mo-host{--sl-dur-enter:${Pe.enter}ms;--sl-dur-exit:${Pe.exit}ms;--sl-dur-spring:${Pe.spring}ms;--sl-dur-flight:${Pe.flight}ms;--sl-dur-stagger:${Pe.stagger}ms;--sl-dur-xfade:${Pe.crossfade}ms;--sl-dur-collapse:${Pe.collapse}ms;--sl-dur-rung:${Pe.rung}ms;--sl-ease-enter:${Pe.easeEnter};--sl-ease-exit:${Pe.easeExit};--sl-ease-spring:${Pe.easeSpring};--sl-mo-ox:50%;--sl-mo-oy:50%}`,Bm=`@media (prefers-reduced-motion:reduce){.sl-picker,.sl-modal-scrim,.sl-mo-host{--sl-dur-enter:0ms;--sl-dur-exit:0ms;--sl-dur-spring:0ms;--sl-dur-flight:0ms;--sl-dur-stagger:0ms;--sl-dur-collapse:0ms;--sl-dur-rung:0ms;--sl-dur-xfade:${Pe.reducedFade}ms}.sl-mo-in,.sl-mo-out,.sl-mo-slide-up,.sl-mo-slide-down,.sl-mo-spring,.sl-mo-rise,.sl-mo-zoom,.sl-mo-scrim,.sl-mo-stagger > *{animation-name:slMoFade;animation-duration:${Pe.reducedFade}ms;animation-delay:0ms}.sl-mo-hint,.sl-mo-rotate-in,.sl-mo-fly,.sl-mo-collapse{animation:none}.sl-confirm-add-invite,.sl-confirm-add-invite::after{animation:none}.sl-mo-indicator{transition:none}}`,$l=Dm+`
276
274
  /* Anchored open/close. The translate is 8px TOWARD the anchor, which is what
277
275
  makes the card look attached to the seat rather than dropped on the map. */
278
276
  .sl-mo-in{transform-origin:var(--sl-mo-ox) var(--sl-mo-oy);
@@ -339,7 +337,7 @@ ${t}`}function Za(n){let{base:e,event:t,publicKey:i}=n;if(!e||!t||!i)return;let
339
337
  @keyframes slMoZoom{from{opacity:0;transform:scale(1.02)}to{opacity:1;transform:none}}
340
338
  .sl-mo-rotate-in{animation:slMoSpin var(--sl-dur-spring) var(--sl-ease-spring) 1 both}
341
339
  @keyframes slMoSpin{from{opacity:0;transform:rotate(-140deg) scale(.8)}to{opacity:1;transform:none}}
342
- `+Pu;function oo(){try{return window.matchMedia?.("(prefers-reduced-motion: reduce)").matches===!0}catch{return!1}}function mr(n,e){if(!e){n.style.removeProperty("--sl-mo-ox"),n.style.removeProperty("--sl-mo-oy");return}ro(n,e,n.getBoundingClientRect())}function ro(n,e,t){let i=t.width||1,o=t.height||1,r=s=>Math.max(0,Math.min(100,s));n.style.setProperty("--sl-mo-ox",`${r((e.x-t.left)/i*100).toFixed(1)}%`),n.style.setProperty("--sl-mo-oy",`${r((e.y-t.top)/o*100).toFixed(1)}%`)}function el(n,e,t){let i=n.getBoundingClientRect(),o=t.getBoundingClientRect();ro(n,e,{left:i.left-o.left,top:i.top-o.top,width:i.width,height:i.height})}function tl(n,e){n.classList.remove("sl-mo-out"),e!==void 0&&mr(n,e),n.classList.remove("sl-mo-in"),n.offsetWidth,n.classList.add("sl-mo-in")}function nl(n){n.classList.add("sl-mo-stagger");let e=0;for(let t of Array.from(n.children))t.style.setProperty("--sl-mo-i",String(e)),e+=1}function so(n,e,t={className:"sl-mo-out",duration:we.exit}){let i=()=>{o||(o=!0,!(typeof window>"u")&&(clearTimeout(r),n.removeEventListener("animationend",i),e?e():n.remove()))},o=!1;n.classList.remove("sl-mo-in","sl-mo-slide-up","sl-mo-spring","sl-mo-zoom","sl-mo-rise"),n.classList.add(t.className),n.addEventListener("animationend",i);let r=setTimeout(i,oo()?0:t.duration+60)}var ab={className:"sl-mo-slide-down",duration:we.exit};function il(n){if(oo())return n.onArrive?.(),null;let e=document.createElement("div");e.className="sl-mo-fly sl-mo-host",e.setAttribute("aria-hidden","true"),e.textContent=n.label??"",e.style.left=`${n.from.x}px`,e.style.top=`${n.from.y}px`,e.style.background=n.color??"var(--sl-accent,#6e7bff)",e.style.color=n.ink??"#fff",e.style.setProperty("--sl-fly-dx",`${Math.round(n.to.x-n.from.x)}px`),e.style.setProperty("--sl-fly-dy",`${Math.round(n.to.y-n.from.y)}px`),document.body.appendChild(e);let t=!1,i=()=>{t||(t=!0,window.clearTimeout(o),e.remove(),n.onArrive?.())};e.addEventListener("animationend",i);let o=window.setTimeout(i,we.flight+80);return e}var oe=n=>String(n??"").replace(/[&<>"']/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[e]);function Cn(n,e){let t=0;for(let i of n.get(e)?.values()??[])t+=i;return t}function ol(n){let e=[];for(let[t,i]of n)for(let[o,r]of i)r>0&&e.push({areaId:t,tierId:o,qty:r});return e}function rl(n){let e=new Map;for(let t of n.keys())e.set(t,Cn(n,t));return e}function Tn(n,e,t,i){let o=n.get(e)??new Map;i>0?o.set(t,i):o.delete(t),o.size?n.set(e,o):n.delete(e)}function sl(n){let e=new Map;for(let t of n)t.objectType!=="ga"||!t.objectId||e.set(t.objectId,(e.get(t.objectId)??0)+(t.quantity??1));return e}function kt(n,e){let t=sl(e),i=0;for(let o of n.keys())i+=Math.max(0,Cn(n,o)-(t.get(o)??0));return i}function al(n,e,t){let i=sl(t),o=0;for(let r of e){let s=n.gaQty.get(r.id);if(!s)continue;let a=i.get(r.id)??0;for(let[l,c]of s){let d=Math.max(0,c-a);a=Math.max(0,a-c),o+=d*n.paidPrice(r.categoryKey,l,Mu(r,l),r.id)}}return o}function Mu(n,e){return e?n.tiers?.find(t=>t.id===e)?.price??n.price:n.price}function ll(n){let e=[],t=new Map;for(let i of n){if(i.objectType!=="ga"||!i.objectId){e.push({...i,labels:[i.label]});continue}let o=`${i.objectId}\0${i.tierId??""}`,r=t.get(o);if(r){r.quantity=(r.quantity??0)+(i.quantity??1),r.labels.push(i.label);continue}let s={...i,quantity:i.quantity??1,labels:[i.label]};t.set(o,s),e.push(s)}return e}function cl(n,e,t){let i=new Set(t);for(let o of e)o.objectType==="ga"&&o.objectId&&i.has(o.label)&&Tn(n,o.objectId,o.tierId??null,0)}function br(n,e){if(n.objectType!=="ga")return n.label;let t=e.find(i=>i.id===n.objectId);return t?.displayLabel??t?.label??n.label}function Lu(n){let e=new Map;for(let t of n){if(t.objectType!=="ga"||!t.objectId)continue;let i=`${t.objectId}\0${t.tierId??""}`;e.set(i,(e.get(i)??0)+(t.quantity??1))}return e}function yr(n){let e=n.tiers??[];return e.length>1?e.map(t=>({id:t.id,label:t.name||t.id,price:t.price})):[{id:null,label:n.displayType??(0,le.t)("picker.generalAdmission"),price:n.price}]}function dl(n,e){let t=n.totalTicketCount()-Cn(n.gaQty,e.id);return Math.max(0,Math.min(Gt(n,e),n.maxTickets-t))}function Gt(n,e){return vr(n)?En(e)?e.wheelchairPlaces?e.available:0:Math.min(e.available,e.wheelchairAvailable??0):e.available}function En(n){if(n.bookingMode!=="whole"&&n.bookingMode!=="variable")return null;let e=Math.max(0,Math.floor(n.maxOccupancy??n.capacity)),t=n.bookingMode==="whole"?e:Math.max(1,Math.min(e,Math.floor(n.minOccupancy??1)));return{mode:n.bookingMode,min:t,max:e}}function pl(n,e){return vr(n)&&e.available>0?n.tf("picker.noWheelchairSpace","No wheelchair space"):n.tf("picker.soldOutTitle","Sold out")}function vr(n){return n.controller?.getAccessibilityFilter?.()?.includes("wheelchair")===!0}function Hu(n){return`${(0,le.t)("picker.access.wheelchair")} \xB7 ${(0,le.tCount)("picker.leftCount",n.wheelchairAvailable??0)}`}function Ru(n){let e=[];return n.wheelchairPlaces&&e.push({icon:"wheelchair",title:(0,le.t)("picker.access.wheelchair"),tone:"access",note:(0,le.tCount)("picker.leftCount",n.wheelchairAvailable??0)}),n.entrance&&e.push({icon:"entrance",title:(0,le.t)("picker.entrance"),note:n.entrance,tone:"place"}),sr(e,{compact:!0})}function hl(n,e){let t=En(n),i=yr(n),o=Gt({controller:{getAccessibilityFilter:()=>e.wheelchairOnly?["wheelchair"]:null}},n),r=t?t.max:Math.max(0,Math.min(o,e.room));return{area:n,...t?{bookingMode:t.mode}:{},selected:{},min:t?t.min:0,max:r,tiers:i,confirm:s=>{if(typeof s=="number"){e.hold(s,t&&i.length>1?i[0].id:null);return}if(t){let a=Object.entries(s).find(([,l])=>l>0);a&&e.hold(a[1],a[0]||null);return}e.hold(Object.values(s).reduce((a,l)=>a+l,0),null)},cancel:()=>{}}}function wr(n,e,t,i){if(Je(n,!1),n.salesClosed){n.toast(n.closedWords?.().toast??n.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}let o=En(e),r=yr(e),s=n.gaQty.get(e.id),a=Cn(n.gaQty,e.id)>0,l=dl(n,e);if((o?l<o.min:l<=0)&&!a){n.toast(Gt(n,e)<=0||o&&Gt(n,e)<o.min?pl(n,e):(0,le.t)("picker.maxTicketsForOrder",{count:n.maxTickets}),"warning");return}let c=o?[...s??[]].find(([,b])=>b>0)?.[0]??r[0].id:null;if(n.onGAPromptHook){let b={};for(let[T,w]of s??[])b[T??""]=w;if(n.onGAPromptHook({area:e,...o?{bookingMode:o.mode}:{},selected:b,min:o?o.min:0,max:o?Math.min(o.max,l):l,tiers:r,confirm:T=>{Nu(n,e,r,T,l,o)},cancel:()=>Je(n)})===!0)return}let d=new Map;for(let b of r)d.set(b.id,s?.get(b.id)??0);!a&&l>0&&d.set(o?c:r[0].id,o?o.min:1);let p={area:e,tiers:r,draft:d,max:l,reopened:a,box:o,boxTier:c},u=n.root?.dataset.layout==="narrow",h=document.createElement("div");h.className=u?"sl-ga-scrim sl-mo-scrim":"sl-ga-pop-layer",h.innerHTML=Iu(n,p,u),n.root?.appendChild(h),n.gaPromptEl=h,n.gaPromptReturnFocus=i??document.activeElement,u||Du(n,h,t,i),n.reducedMotion()&&(h.dataset.motion="reduced"),fr(n,p),Ou(n,h,p),requestAnimationFrame(()=>h.querySelector('[data-ga-step="1"]')?.focus())}function Iu(n,e,t){let{area:i,tiers:o,box:r}=e,s=o.length>1,a=i.displayLabel??i.label,l=r&&s?zi(o.map(d=>({id:d.id??"",name:d.label,price:d.price})),e.boxTier??void 0,d=>n.money(n.paidPrice(i.categoryKey,d.id,d.price,i.id))):"",c=r?l+(`<div class="sl-ga-prompt-row" data-ga-tier="${oe(e.boxTier??"")}"><div class="sl-ga-prompt-label"><span>${oe(n.tf("picker.numberOfGuests","Number of guests"))}</span>`+(r.mode==="variable"?`<small data-ga-range>${oe((0,le.t)("picker.chooseMinMaxGuests",{min:r.min,max:r.max}))}</small>`:"")+"</div>"+(r.mode==="whole"?`<output data-ga-qty>${r.max}</output>`:`<div class="sl-ga-stepper" role="group" aria-label="${oe(a)}"><button type="button" data-ga-step="-1" aria-label="${oe(n.tf("picker.fewerGuests","Fewer guests"))}">\u2212</button><output data-ga-qty aria-live="polite">0</output><button type="button" data-ga-step="1" aria-label="${oe(n.tf("picker.moreGuests","More guests"))}">+</button></div>`)+"</div>"):o.map(d=>`<div class="sl-ga-prompt-row" data-ga-tier="${oe(d.id??"")}"><div class="sl-ga-prompt-label"><span>${oe(s?d.label:n.tf("picker.gaChooseTickets","How many tickets?"))}</span>`+(s?`<small>${oe(n.money(n.paidPrice(i.categoryKey,d.id,d.price,i.id)))}</small>`:"")+`</div><div class="sl-ga-stepper" role="group" aria-label="${oe(s?d.label:a)}"><button type="button" data-ga-step="-1" aria-label="${oe(n.tf("picker.fewer","Fewer"))}">\u2212</button><output data-ga-qty aria-live="polite">0</output><button type="button" data-ga-step="1" aria-label="${oe(n.tf("picker.more","More"))}">+</button></div></div>`).join("");return`<section class="${t?"sl-ga-sheet":"sl-ga-pop"}" role="dialog" aria-modal="true" aria-label="${oe((0,le.t)("picker.gaChooseForArea",{area:a}))}"><div class="sl-ga-prompt-head"><div class="sl-ga-prompt-eyebrow">${oe(i.displayType??n.tf("picker.generalAdmission","General admission"))}</div><h2 class="sl-ga-prompt-title">${oe(a)}</h2><p class="sl-ga-prompt-sub" data-ga-sub></p><button type="button" class="sl-ga-prompt-close" data-ga-cancel aria-label="${oe((0,le.t)("common.close"))}">\xD7</button></div>`+Ru(i)+`<div class="sl-ga-prompt-body">${c}`+(o.length>1||r?`<div class="sl-ga-prompt-total"><span>${oe(n.tf("picker.total","Total"))}</span><b data-ga-total></b></div>`:"")+'<p class="sl-ga-prompt-hint" data-ga-hint></p></div><div class="sl-ga-prompt-actions">'+(e.reopened?`<button type="button" class="sl-ga-prompt-remove" data-ga-remove>${oe(n.tf("picker.gaRemove","Remove"))}</button>`:`<button type="button" class="sl-ga-prompt-remove" data-ga-cancel>${oe((0,le.t)("common.cancel"))}</button>`)+'<button type="button" class="sl-ga-prompt-confirm" data-ga-confirm></button></div></section>'}function ao(n){let e=0;for(let t of n.draft.values())e+=t;return e}function ul(n,e){let t=0;for(let i of e.tiers)t+=(e.draft.get(i.id)??0)*n.paidPrice(e.area.categoryKey,i.id,i.price,e.area.id);return t}function fr(n,e){let t=n.gaPromptEl;if(!t)return;let i=ao(e),o=ul(n,e);t.querySelectorAll("[data-ga-tier]").forEach(c=>{let d=c.dataset.gaTier?c.dataset.gaTier:null,p=e.draft.get(d)??0,u=c.querySelector("[data-ga-qty]");u&&(u.value=String(p)),c.querySelectorAll("[data-ga-step]").forEach(h=>{h.disabled=Number(h.dataset.gaStep)<0?p<=(e.box?e.box.min:0):i>=(e.box?Math.min(e.box.max,e.max):e.max)})});let r=t.querySelector("[data-ga-sub]");if(r){let c=e.box&&e.tiers.find(p=>p.id===e.boxTier)||e.tiers[0],d=n.money(n.paidPrice(e.area.categoryKey,c.id,c.price,e.area.id));r.textContent=e.box?(0,le.t)("picker.perGuestPrice",{price:d}):`${d} \xB7 ${(0,le.tCount)("picker.leftCount",e.area.available)}`}let s=t.querySelector("[data-ga-total]");s&&(s.textContent=n.money(o));let a=t.querySelector("[data-ga-hint]");a&&(a.textContent=e.box?"":i>=e.max&&e.max>0?vr(n)&&e.area.wheelchairPlaces?Hu(e.area):e.area.available<=e.max?(0,le.tCount)("picker.leftCount",e.area.available):(0,le.t)("picker.maxTicketsForOrder",{count:n.maxTickets}):"");let l=t.querySelector("[data-ga-confirm]");if(l){let c=(0,le.t)("picker.guestsCount",{count:i});l.textContent=e.reopened?(0,le.tCount)("picker.gaUpdate",i,{count:i}):e.box?.mode==="whole"?n.tf("picker.gaBookWholeArea","Book the whole area"):e.box?`${n.tf("picker.gaBook","Book")} \xB7 ${c} \xB7 ${n.money(o)}`:(0,le.tCount)("picker.gaAdd",i,{count:i,price:n.money(o)}),l.disabled=(e.box?i<e.box.min:i<=0)&&!e.reopened}}function Ou(n,e,t){e.querySelectorAll("[data-confirm-tier]").forEach(i=>{i.addEventListener("click",()=>{let o=t.tiers.find(a=>(a.id??"")===i.dataset.confirmTier);if(!o||!t.box)return;let r=ao(t);for(let a of t.tiers)t.draft.set(a.id,0);t.draft.set(o.id,r),t.boxTier=o.id,e.querySelectorAll("[data-confirm-tier]").forEach(a=>{a.setAttribute("aria-pressed",String(a===i))});let s=e.querySelector("[data-ga-tier]");s&&(s.dataset.gaTier=o.id??""),fr(n,t)})}),e.querySelectorAll("[data-ga-step]").forEach(i=>{i.addEventListener("click",()=>{let o=i.closest("[data-ga-tier]");if(!o)return;let r=o.dataset.gaTier?o.dataset.gaTier:null,s=Number(i.dataset.gaStep),a=t.draft.get(r)??0,l=(t.box?Math.min(t.box.max,t.max):t.max)-ao(t),c=t.box?t.box.min:0;t.draft.set(r,Math.max(c,a+(s>0?Math.min(1,l):-1))),fr(n,t)})}),e.querySelectorAll("[data-ga-cancel]").forEach(i=>i.addEventListener("click",()=>Je(n))),e.querySelector("[data-ga-remove]")?.addEventListener("click",()=>{n.gaQty.delete(t.area.id),Je(n),n.syncTray(),gr(n,(0,le.t)("picker.gaRemoved",{area:t.area.displayLabel??t.area.label}))}),e.querySelector("[data-ga-confirm]")?.addEventListener("click",()=>{_u(n,t)}),e.addEventListener("mousedown",i=>{i.target===e&&Je(n)}),e.addEventListener("keydown",i=>{if(i.key==="Escape"){i.stopPropagation(),Je(n);return}if(i.key!=="Tab")return;let o=[...e.querySelectorAll('button:not(:disabled),[tabindex]:not([tabindex="-1"])')];if(!o.length)return;let r=o[0],s=o[o.length-1];i.shiftKey&&document.activeElement===r?(i.preventDefault(),s.focus()):!i.shiftKey&&document.activeElement===s&&(i.preventDefault(),r.focus())})}function _u(n,e){let t=ao(e),i=ul(n,e);for(let r of e.tiers)Tn(n.gaQty,e.area.id,r.id,e.draft.get(r.id)??0);Je(n),n.syncTray();let o=e.area.displayLabel??e.area.label;t>0?gr(n,(0,le.tCount)("picker.gaAdded",t,{count:t,area:o,price:n.money(i)})):gr(n,(0,le.t)("picker.gaRemoved",{area:o}))}function Nu(n,e,t,i,o,r=null){if(r){let s=typeof i=="number"?{tierId:t[0].id,wanted:i}:(()=>{let c=Object.entries(i).find(([,p])=>p>0);return{tierId:(t.find(p=>(p.id??"")===c?.[0])??t[0]).id,wanted:c?.[1]??0}})(),a=Math.floor(s.wanted),l=a<=0?0:r.mode==="whole"?r.max:Math.max(r.min,Math.min(r.max,o,a));n.gaQty.delete(e.id),Tn(n.gaQty,e.id,s.tierId,l<=o?l:0)}else if(typeof i=="number")Tn(n.gaQty,e.id,t[0].id,Math.max(0,Math.min(o,Math.floor(i))));else{n.gaQty.delete(e.id);let s=o;for(let a of t){let l=Math.max(0,Math.floor(i[a.id??""]??0)),c=Math.min(l,s);s-=c,Tn(n.gaQty,e.id,a.id,c)}}n.syncTray()}function Je(n,e=!0){let t=n.gaPromptReturnFocus;n.gaPromptEl&&so(n.gaPromptEl),n.gaPromptEl=null,n.gaPromptReturnFocus=null,e&&t&&requestAnimationFrame(()=>(t.isConnected?t:n.root)?.focus())}function Du(n,e,t,i){let o=n.root,r=e.querySelector(".sl-ga-pop");if(!o||!r)return;if(!t){i&&o.contains(i)&&Bu(o,r,i);return}let s=o.getBoundingClientRect(),a=t.x-s.left,l=t.y-s.top;e.style.setProperty("--sl-ga-anchor-x",`${a}px`),e.style.setProperty("--sl-ga-anchor-y",`${l}px`),requestAnimationFrame(()=>{let c=r.offsetWidth||260,d=r.offsetHeight||220,p=Math.max(8,Math.min(s.width-c-8,a-c/2)),u=l-d-14,h=u>=8?u:Math.min(s.height-d-8,l+14);r.style.left=`${p}px`,r.style.top=`${Math.max(8,h)}px`,r.dataset.side=u>=8?"above":"below",r.style.setProperty("--sl-ga-arrow-x",`${Math.max(12,Math.min(c-12,a-p))}px`)})}var Sn=14;function Bu(n,e,t){requestAnimationFrame(()=>{let i=n.getBoundingClientRect(),o=t.getBoundingClientRect(),r=e.offsetWidth||288,s=e.offsetHeight||220,a=o.left-i.left-Sn-8,l=i.right-o.right-Sn-8,c=a>=l?"left":"right";if(Math.max(a,l)<r){let h=o.left+o.width/2-i.left,b=o.top-i.top-s-Sn,f=b>=8?b:Math.min(i.height-s-8,o.bottom-i.top+Sn),T=Math.max(8,Math.min(i.width-r-8,h-r/2));e.style.left=`${T}px`,e.style.top=`${Math.max(8,f)}px`,e.dataset.side=b>=8?"above":"below",e.style.setProperty("--sl-ga-arrow-x",`${Math.max(12,Math.min(r-12,h-T))}px`);return}let d=o.top+o.height/2-i.top,p=Math.max(8,Math.min(i.height-s-8,d-s/2)),u=c==="left"?o.left-i.left-Sn-r:o.right-i.left+Sn;e.style.left=`${u}px`,e.style.top=`${p}px`,e.dataset.side=c,e.style.setProperty("--sl-ga-arrow-y",`${Math.max(16,Math.min(s-16,d-p))}px`)})}function gr(n,e){n.srEl&&(n.srEl.textContent=e)}function ml(n,e,t=[]){let i=[],o=Lu(t);for(let s of e){let a=n.gaQty.get(s.id);if(!a)continue;let l=yr(s);for(let c of l){let d=(a.get(c.id)??0)-(o.get(`${s.id}\0${c.id??""}`)??0);if(d<=0)continue;let p=n.paidPrice(s.categoryKey,c.id,c.price,s.id),u=En(s);i.push(`<div class="sl-ga" data-ga="${oe(s.id)}" data-ga-row-tier="${oe(c.id??"")}"><div class="sl-ga-info"><div class="sl-ga-name">${oe(s.displayLabel??s.label)}</div><div class="sl-ga-sub">${oe(u?[l.length>1?c.label:"",(0,le.t)("picker.perGuestPrice",{price:n.money(p)})].filter(Boolean).join(" \xB7 "):`${l.length>1?c.label:s.displayType??n.tf("picker.generalAdmission","General admission")} \xB7 ${n.money(p)} \xB7 ${(0,le.tCount)("picker.leftCount",s.available)}`)}</div></div>`+(u?`<button type="button" class="sl-table-edit" data-ga-open="${oe(s.id)}">${oe((0,le.t)("picker.guestsCountEdit",{count:d}))}</button></div>`:`<div class="sl-ga-qty"><button type="button" data-d="-1" aria-label="${oe(n.tf("picker.fewer","Fewer"))}">\u2212</button><span>${d}</span><button type="button" data-d="1" aria-label="${oe(n.tf("picker.more","More"))}">+</button></div></div>`))}}let r=e.filter(s=>Cn(n.gaQty,s.id)<=0&&!t.some(a=>a.objectId===s.id));return r.length&&i.push(`<div class="sl-ga-areas" data-ga-areas><button type="button" class="sl-ga-areas-toggle" data-ga-areas-toggle aria-expanded="${n.gaAreasExpanded}"><span>${oe(n.tf("picker.gaAreasHeading","Areas"))}</span><small>${r.length}</small></button>`+(n.gaAreasExpanded?`<div class="sl-ga-areas-list">${r.map(s=>`<button type="button" class="sl-ga-area-open" data-ga-open="${oe(s.id)}"${Gt(n,s)<=0?" disabled":""}><span class="name">${oe(s.displayLabel??s.label)}<small>${oe(s.displayType??n.tf("picker.generalAdmission","General admission"))}</small></span><span class="meta">${oe(Gt(n,s)<=0?pl(n,s):`${n.money(n.paidPrice(s.categoryKey,null,s.price,s.id))} \xB7 ${En(s)?(0,le.t)("picker.capacityGuests",{count:En(s).max}):(0,le.tCount)("picker.leftCount",Gt(n,s))}`)}</span></button>`).join("")}</div>`:"")+"</div>"),i.join("")}function fl(n,e,t){e.querySelectorAll(".sl-ga .sl-ga-qty button").forEach(i=>{i.addEventListener("click",()=>{let o=i.closest(".sl-ga");if(!o?.dataset.ga)return;let r=t.find(c=>c.id===o.dataset.ga);if(!r)return;let s=o.dataset.gaRowTier?o.dataset.gaRowTier:null,a=Number(i.dataset.d),l=n.gaQty.get(r.id)?.get(s)??0;if(a>0&&dl(n,r)-Cn(n.gaQty,r.id)<=0){n.toast((0,le.t)("picker.maxTicketsForOrder",{count:n.maxTickets}),"warning");return}Tn(n.gaQty,r.id,s,Math.max(0,l+a)),n.syncTray()})}),e.querySelector("[data-ga-areas-toggle]")?.addEventListener("click",()=>{n.gaAreasExpanded=!n.gaAreasExpanded,n.syncTray()}),e.querySelectorAll("[data-ga-open]").forEach(i=>{i.addEventListener("click",()=>{let o=t.find(r=>r.id===i.dataset.gaOpen);o&&wr(n,o,null,i)})})}var lo='<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 Fu=/^[a-zA-Z0-9._-]+$/;function xr(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]),o=decodeURIComponent(t[2]);return!i||!Fu.test(o)?null:{eventKey:i,asset:o}}catch{return null}}function Vu(n){try{return/^\/pub\/events\/[^/]+\/assets(?:\/|$)/.test(new URL(n,"https://seatlayer.invalid").pathname)}catch{return!1}}var An=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=xr(e);if(!t)return Promise.resolve(Vu(e)||!dn(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 o=this.load(this.eventKey,t.asset).then(r=>{let s=URL.createObjectURL(r);return this.disposed?(URL.revokeObjectURL(s),null):(this.created.add(s),s)}).catch(r=>{throw this.pending.delete(e),r});return this.pending.set(e,o),o}dispose(){if(!this.disposed){this.disposed=!0;for(let e of this.created)URL.revokeObjectURL(e);this.created.clear(),this.pending.clear()}}};var Ut=require("@seatlayer/core"),mo=require("@seatlayer/core/view3d/crossfade/panorama");var gl=`
340
+ `+Bm;function No(){try{return window.matchMedia?.("(prefers-reduced-motion: reduce)").matches===!0}catch{return!1}}function es(n,e){if(!e){n.style.removeProperty("--sl-mo-ox"),n.style.removeProperty("--sl-mo-oy");return}Do(n,e,n.getBoundingClientRect())}function Do(n,e,t){let i=t.width||1,o=t.height||1,r=s=>Math.max(0,Math.min(100,s));n.style.setProperty("--sl-mo-ox",`${r((e.x-t.left)/i*100).toFixed(1)}%`),n.style.setProperty("--sl-mo-oy",`${r((e.y-t.top)/o*100).toFixed(1)}%`)}function zl(n,e,t){let i=n.getBoundingClientRect(),o=t.getBoundingClientRect();Do(n,e,{left:i.left-o.left,top:i.top-o.top,width:i.width,height:i.height})}function jl(n,e){n.classList.remove("sl-mo-out"),e!==void 0&&es(n,e),n.classList.remove("sl-mo-in"),n.offsetWidth,n.classList.add("sl-mo-in")}function Kl(n){n.classList.add("sl-mo-stagger");let e=0;for(let t of Array.from(n.children))t.style.setProperty("--sl-mo-i",String(e)),e+=1}function Bo(n,e,t={className:"sl-mo-out",duration:Pe.exit}){let i=()=>{o||(o=!0,!(typeof window>"u")&&(clearTimeout(r),n.removeEventListener("animationend",i),e?e():n.remove()))},o=!1;n.classList.remove("sl-mo-in","sl-mo-slide-up","sl-mo-spring","sl-mo-zoom","sl-mo-rise"),n.classList.add(t.className),n.addEventListener("animationend",i);let r=setTimeout(i,No()?0:t.duration+60)}var Ey={className:"sl-mo-slide-down",duration:Pe.exit};function Gl(n){if(No())return n.onArrive?.(),null;let e=document.createElement("div");e.className="sl-mo-fly sl-mo-host",e.setAttribute("aria-hidden","true"),e.textContent=n.label??"",e.style.left=`${n.from.x}px`,e.style.top=`${n.from.y}px`,e.style.background=n.color??"var(--sl-accent,#6e7bff)",e.style.color=n.ink??"#fff",e.style.setProperty("--sl-fly-dx",`${Math.round(n.to.x-n.from.x)}px`),e.style.setProperty("--sl-fly-dy",`${Math.round(n.to.y-n.from.y)}px`),document.body.appendChild(e);let t=!1,i=()=>{t||(t=!0,window.clearTimeout(o),e.remove(),n.onArrive?.())};e.addEventListener("animationend",i);let o=window.setTimeout(i,Pe.flight+80);return e}var se=n=>String(n??"").replace(/[&<>"']/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[e]);function qn(n,e){let t=0;for(let i of n.get(e)?.values()??[])t+=i;return t}function Ul(n){let e=[];for(let[t,i]of n)for(let[o,r]of i)r>0&&e.push({areaId:t,tierId:o,qty:r});return e}function ql(n){let e=new Map;for(let t of n.keys())e.set(t,qn(n,t));return e}function Gn(n,e,t,i){let o=n.get(e)??new Map;i>0?o.set(t,i):o.delete(t),o.size?n.set(e,o):n.delete(e)}function Wl(n){let e=new Map;for(let t of n)t.objectType!=="ga"||!t.objectId||e.set(t.objectId,(e.get(t.objectId)??0)+(t.quantity??1));return e}function It(n,e){let t=Wl(e),i=0;for(let o of n.keys())i+=Math.max(0,qn(n,o)-(t.get(o)??0));return i}function Yl(n,e,t){let i=Wl(t),o=0;for(let r of e){let s=n.gaQty.get(r.id);if(!s)continue;let a=i.get(r.id)??0;for(let[l,c]of s){let d=Math.max(0,c-a);a=Math.max(0,a-c),o+=d*n.paidPrice(r.categoryKey,l,Fm(r,l),r.id)}}return o}function Fm(n,e){return e?n.tiers?.find(t=>t.id===e)?.price??n.price:n.price}function Xl(n){let e=[],t=new Map;for(let i of n){if(i.objectType!=="ga"||!i.objectId){e.push({...i,labels:[i.label]});continue}let o=`${i.objectId}\0${i.tierId??""}`,r=t.get(o);if(r){r.quantity=(r.quantity??0)+(i.quantity??1),r.labels.push(i.label);continue}let s={...i,quantity:i.quantity??1,labels:[i.label]};t.set(o,s),e.push(s)}return e}function Zl(n,e,t){let i=new Set(t);for(let o of e)o.objectType==="ga"&&o.objectId&&i.has(o.label)&&Gn(n,o.objectId,o.tierId??null,0)}function is(n,e){if(n.objectType!=="ga")return n.label;let t=e.find(i=>i.id===n.objectId);return t?.displayLabel??t?.label??n.label}function Vm(n){let e=new Map;for(let t of n){if(t.objectType!=="ga"||!t.objectId)continue;let i=`${t.objectId}\0${t.tierId??""}`;e.set(i,(e.get(i)??0)+(t.quantity??1))}return e}function os(n){let e=n.tiers??[];return e.length>1?e.map(t=>({id:t.id,label:t.name||t.id,price:t.price})):[{id:null,label:n.displayType??(0,de.t)("picker.generalAdmission"),price:n.price}]}function Ql(n,e){let t=n.totalTicketCount()-qn(n.gaQty,e.id);return Math.max(0,Math.min(dn(n,e),n.maxTickets-t))}function dn(n,e){return rs(n)?Un(e)?e.wheelchairPlaces?e.available:0:Math.min(e.available,e.wheelchairAvailable??0):e.available}function Un(n){if(n.bookingMode!=="whole"&&n.bookingMode!=="variable")return null;let e=Math.max(0,Math.floor(n.maxOccupancy??n.capacity)),t=n.bookingMode==="whole"?e:Math.max(1,Math.min(e,Math.floor(n.minOccupancy??1)));return{mode:n.bookingMode,min:t,max:e}}function Jl(n,e){return rs(n)&&e.available>0?n.tf("picker.noWheelchairSpace","No wheelchair space"):n.tf("picker.soldOutTitle","Sold out")}function rs(n){return n.controller?.getAccessibilityFilter?.()?.includes("wheelchair")===!0}function $m(n){return`${(0,de.t)("picker.access.wheelchair")} \xB7 ${(0,de.tCount)("picker.leftCount",n.wheelchairAvailable??0)}`}function zm(n){let e=[];return n.wheelchairPlaces&&e.push({icon:"wheelchair",title:(0,de.t)("picker.access.wheelchair"),tone:"access",note:(0,de.tCount)("picker.leftCount",n.wheelchairAvailable??0)}),n.entrance&&e.push({icon:"entrance",title:(0,de.t)("picker.entrance"),note:n.entrance,tone:"place"}),qr(e,{compact:!0})}function ec(n,e){let t=Un(n),i=os(n),o=dn({controller:{getAccessibilityFilter:()=>e.wheelchairOnly?["wheelchair"]:null}},n),r=t?t.max:Math.max(0,Math.min(o,e.room));return{area:n,...t?{bookingMode:t.mode}:{},selected:{},min:t?t.min:0,max:r,tiers:i,confirm:s=>{if(typeof s=="number"){e.hold(s,t&&i.length>1?i[0].id:null);return}if(t){let a=Object.entries(s).find(([,l])=>l>0);a&&e.hold(a[1],a[0]||null);return}e.hold(Object.values(s).reduce((a,l)=>a+l,0),null)},cancel:()=>{}}}function ss(n,e,t,i){if(at(n,!1),n.salesClosed){n.toast(n.closedWords?.().toast??n.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}let o=Un(e),r=os(e),s=n.gaQty.get(e.id),a=qn(n.gaQty,e.id)>0,l=Ql(n,e);if((o?l<o.min:l<=0)&&!a){n.toast(dn(n,e)<=0||o&&dn(n,e)<o.min?Jl(n,e):(0,de.t)("picker.maxTicketsForOrder",{count:n.maxTickets}),"warning");return}let c=o?[...s??[]].find(([,f])=>f>0)?.[0]??r[0].id:null;if(n.onGAPromptHook){let f={};for(let[T,E]of s??[])f[T??""]=E;if(n.onGAPromptHook({area:e,...o?{bookingMode:o.mode}:{},selected:f,min:o?o.min:0,max:o?Math.min(o.max,l):l,tiers:r,confirm:T=>{Um(n,e,r,T,l,o)},cancel:()=>at(n)})===!0)return}let d=new Map;for(let f of r)d.set(f.id,s?.get(f.id)??0);!a&&l>0&&d.set(o?c:r[0].id,o?o.min:1);let p={area:e,tiers:r,draft:d,max:l,reopened:a,box:o,boxTier:c},m=n.root?.dataset.layout==="narrow",u=document.createElement("div");u.className=m?"sl-ga-scrim sl-mo-scrim":"sl-ga-pop-layer",u.innerHTML=jm(n,p,m),n.root?.appendChild(u),n.gaPromptEl=u,n.gaPromptReturnFocus=i??document.activeElement,m||qm(n,u,t,i),n.reducedMotion()&&(u.dataset.motion="reduced"),ts(n,p),Km(n,u,p),requestAnimationFrame(()=>u.querySelector('[data-ga-step="1"]')?.focus())}function jm(n,e,t){let{area:i,tiers:o,box:r}=e,s=o.length>1,a=i.displayLabel??i.label,l=r&&s?yo(o.map(d=>({id:d.id??"",name:d.label,price:d.price})),e.boxTier??void 0,d=>n.money(n.paidPrice(i.categoryKey,d.id,d.price,i.id))):"",c=r?l+(`<div class="sl-ga-prompt-row" data-ga-tier="${se(e.boxTier??"")}"><div class="sl-ga-prompt-label"><span>${se(n.tf("picker.numberOfGuests","Number of guests"))}</span>`+(r.mode==="variable"?`<small data-ga-range>${se((0,de.t)("picker.chooseMinMaxGuests",{min:r.min,max:r.max}))}</small>`:"")+"</div>"+(r.mode==="whole"?`<output data-ga-qty>${r.max}</output>`:`<div class="sl-ga-stepper" role="group" aria-label="${se(a)}"><button type="button" data-ga-step="-1" aria-label="${se(n.tf("picker.fewerGuests","Fewer guests"))}">\u2212</button><output data-ga-qty aria-live="polite">0</output><button type="button" data-ga-step="1" aria-label="${se(n.tf("picker.moreGuests","More guests"))}">+</button></div>`)+"</div>"):o.map(d=>`<div class="sl-ga-prompt-row" data-ga-tier="${se(d.id??"")}"><div class="sl-ga-prompt-label"><span>${se(s?d.label:n.tf("picker.gaChooseTickets","How many tickets?"))}</span>`+(s?`<small>${se(n.money(n.paidPrice(i.categoryKey,d.id,d.price,i.id)))}</small>`:"")+`</div><div class="sl-ga-stepper" role="group" aria-label="${se(s?d.label:a)}"><button type="button" data-ga-step="-1" aria-label="${se(n.tf("picker.fewer","Fewer"))}">\u2212</button><output data-ga-qty aria-live="polite">0</output><button type="button" data-ga-step="1" aria-label="${se(n.tf("picker.more","More"))}">+</button></div></div>`).join("");return`<section class="${t?"sl-ga-sheet":"sl-ga-pop"}" role="dialog" aria-modal="true" aria-label="${se((0,de.t)("picker.gaChooseForArea",{area:a}))}"><div class="sl-ga-prompt-head"><div class="sl-ga-prompt-eyebrow">${se(i.displayType??n.tf("picker.generalAdmission","General admission"))}</div><h2 class="sl-ga-prompt-title">${se(a)}</h2><p class="sl-ga-prompt-sub" data-ga-sub></p><button type="button" class="sl-ga-prompt-close" data-ga-cancel aria-label="${se((0,de.t)("common.close"))}">\xD7</button></div>`+zm(i)+`<div class="sl-ga-prompt-body">${c}`+(o.length>1||r?`<div class="sl-ga-prompt-total"><span>${se(n.tf("picker.total","Total"))}</span><b data-ga-total></b></div>`:"")+'<p class="sl-ga-prompt-hint" data-ga-hint></p></div><div class="sl-ga-prompt-actions">'+(e.reopened?`<button type="button" class="sl-ga-prompt-remove" data-ga-remove>${se(n.tf("picker.gaRemove","Remove"))}</button>`:`<button type="button" class="sl-ga-prompt-remove" data-ga-cancel>${se((0,de.t)("common.cancel"))}</button>`)+'<button type="button" class="sl-ga-prompt-confirm" data-ga-confirm></button></div></section>'}function Fo(n){let e=0;for(let t of n.draft.values())e+=t;return e}function tc(n,e){let t=0;for(let i of e.tiers)t+=(e.draft.get(i.id)??0)*n.paidPrice(e.area.categoryKey,i.id,i.price,e.area.id);return t}function ts(n,e){let t=n.gaPromptEl;if(!t)return;let i=Fo(e),o=tc(n,e);t.querySelectorAll("[data-ga-tier]").forEach(c=>{let d=c.dataset.gaTier?c.dataset.gaTier:null,p=e.draft.get(d)??0,m=c.querySelector("[data-ga-qty]");m&&(m.value=String(p)),c.querySelectorAll("[data-ga-step]").forEach(u=>{u.disabled=Number(u.dataset.gaStep)<0?p<=(e.box?e.box.min:0):i>=(e.box?Math.min(e.box.max,e.max):e.max)})});let r=t.querySelector("[data-ga-sub]");if(r){let c=e.box&&e.tiers.find(p=>p.id===e.boxTier)||e.tiers[0],d=n.money(n.paidPrice(e.area.categoryKey,c.id,c.price,e.area.id));r.textContent=e.box?(0,de.t)("picker.perGuestPrice",{price:d}):`${d} \xB7 ${(0,de.tCount)("picker.leftCount",e.area.available)}`}let s=t.querySelector("[data-ga-total]");s&&(s.textContent=n.money(o));let a=t.querySelector("[data-ga-hint]");a&&(a.textContent=e.box?"":i>=e.max&&e.max>0?rs(n)&&e.area.wheelchairPlaces?$m(e.area):e.area.available<=e.max?(0,de.tCount)("picker.leftCount",e.area.available):(0,de.t)("picker.maxTicketsForOrder",{count:n.maxTickets}):"");let l=t.querySelector("[data-ga-confirm]");if(l){let c=(0,de.t)("picker.guestsCount",{count:i});l.textContent=e.reopened?(0,de.tCount)("picker.gaUpdate",i,{count:i}):e.box?.mode==="whole"?n.tf("picker.gaBookWholeArea","Book the whole area"):e.box?`${n.tf("picker.gaBook","Book")} \xB7 ${c} \xB7 ${n.money(o)}`:(0,de.tCount)("picker.gaAdd",i,{count:i,price:n.money(o)}),l.disabled=(e.box?i<e.box.min:i<=0)&&!e.reopened}}function Km(n,e,t){e.querySelectorAll("[data-confirm-tier]").forEach(i=>{i.addEventListener("click",()=>{let o=t.tiers.find(a=>(a.id??"")===i.dataset.confirmTier);if(!o||!t.box)return;let r=Fo(t);for(let a of t.tiers)t.draft.set(a.id,0);t.draft.set(o.id,r),t.boxTier=o.id,e.querySelectorAll("[data-confirm-tier]").forEach(a=>{a.setAttribute("aria-pressed",String(a===i))});let s=e.querySelector("[data-ga-tier]");s&&(s.dataset.gaTier=o.id??""),ts(n,t)})}),e.querySelectorAll("[data-ga-step]").forEach(i=>{i.addEventListener("click",()=>{let o=i.closest("[data-ga-tier]");if(!o)return;let r=o.dataset.gaTier?o.dataset.gaTier:null,s=Number(i.dataset.gaStep),a=t.draft.get(r)??0,l=(t.box?Math.min(t.box.max,t.max):t.max)-Fo(t),c=t.box?t.box.min:0;t.draft.set(r,Math.max(c,a+(s>0?Math.min(1,l):-1))),ts(n,t)})}),e.querySelectorAll("[data-ga-cancel]").forEach(i=>i.addEventListener("click",()=>at(n))),e.querySelector("[data-ga-remove]")?.addEventListener("click",()=>{n.gaQty.delete(t.area.id),at(n),n.syncTray(),ns(n,(0,de.t)("picker.gaRemoved",{area:t.area.displayLabel??t.area.label}))}),e.querySelector("[data-ga-confirm]")?.addEventListener("click",()=>{Gm(n,t)}),e.addEventListener("mousedown",i=>{i.target===e&&at(n)}),e.addEventListener("keydown",i=>{if(i.key==="Escape"){i.stopPropagation(),at(n);return}if(i.key!=="Tab")return;let o=[...e.querySelectorAll('button:not(:disabled),[tabindex]:not([tabindex="-1"])')];if(!o.length)return;let r=o[0],s=o[o.length-1];i.shiftKey&&document.activeElement===r?(i.preventDefault(),s.focus()):!i.shiftKey&&document.activeElement===s&&(i.preventDefault(),r.focus())})}function Gm(n,e){let t=Fo(e),i=tc(n,e);for(let r of e.tiers)Gn(n.gaQty,e.area.id,r.id,e.draft.get(r.id)??0);at(n),n.syncTray();let o=e.area.displayLabel??e.area.label;t>0?ns(n,(0,de.tCount)("picker.gaAdded",t,{count:t,area:o,price:n.money(i)})):ns(n,(0,de.t)("picker.gaRemoved",{area:o}))}function Um(n,e,t,i,o,r=null){if(r){let s=typeof i=="number"?{tierId:t[0].id,wanted:i}:(()=>{let c=Object.entries(i).find(([,p])=>p>0);return{tierId:(t.find(p=>(p.id??"")===c?.[0])??t[0]).id,wanted:c?.[1]??0}})(),a=Math.floor(s.wanted),l=a<=0?0:r.mode==="whole"?r.max:Math.max(r.min,Math.min(r.max,o,a));n.gaQty.delete(e.id),Gn(n.gaQty,e.id,s.tierId,l<=o?l:0)}else if(typeof i=="number")Gn(n.gaQty,e.id,t[0].id,Math.max(0,Math.min(o,Math.floor(i))));else{n.gaQty.delete(e.id);let s=o;for(let a of t){let l=Math.max(0,Math.floor(i[a.id??""]??0)),c=Math.min(l,s);s-=c,Gn(n.gaQty,e.id,a.id,c)}}n.syncTray()}function at(n,e=!0){let t=n.gaPromptReturnFocus;n.gaPromptEl&&Bo(n.gaPromptEl),n.gaPromptEl=null,n.gaPromptReturnFocus=null,e&&t&&requestAnimationFrame(()=>(t.isConnected?t:n.root)?.focus())}function qm(n,e,t,i){let o=n.root,r=e.querySelector(".sl-ga-pop");if(!o||!r)return;if(!t){i&&o.contains(i)&&Wm(o,r,i);return}let s=o.getBoundingClientRect(),a=t.x-s.left,l=t.y-s.top;e.style.setProperty("--sl-ga-anchor-x",`${a}px`),e.style.setProperty("--sl-ga-anchor-y",`${l}px`),requestAnimationFrame(()=>{let c=r.offsetWidth||260,d=r.offsetHeight||220,p=Math.max(8,Math.min(s.width-c-8,a-c/2)),m=l-d-14,u=m>=8?m:Math.min(s.height-d-8,l+14);r.style.left=`${p}px`,r.style.top=`${Math.max(8,u)}px`,r.dataset.side=m>=8?"above":"below",r.style.setProperty("--sl-ga-arrow-x",`${Math.max(12,Math.min(c-12,a-p))}px`)})}var Kn=14;function Wm(n,e,t){requestAnimationFrame(()=>{let i=n.getBoundingClientRect(),o=t.getBoundingClientRect(),r=e.offsetWidth||288,s=e.offsetHeight||220,a=o.left-i.left-Kn-8,l=i.right-o.right-Kn-8,c=a>=l?"left":"right";if(Math.max(a,l)<r){let u=o.left+o.width/2-i.left,f=o.top-i.top-s-Kn,b=f>=8?f:Math.min(i.height-s-8,o.bottom-i.top+Kn),T=Math.max(8,Math.min(i.width-r-8,u-r/2));e.style.left=`${T}px`,e.style.top=`${Math.max(8,b)}px`,e.dataset.side=f>=8?"above":"below",e.style.setProperty("--sl-ga-arrow-x",`${Math.max(12,Math.min(r-12,u-T))}px`);return}let d=o.top+o.height/2-i.top,p=Math.max(8,Math.min(i.height-s-8,d-s/2)),m=c==="left"?o.left-i.left-Kn-r:o.right-i.left+Kn;e.style.left=`${m}px`,e.style.top=`${p}px`,e.dataset.side=c,e.style.setProperty("--sl-ga-arrow-y",`${Math.max(16,Math.min(s-16,d-p))}px`)})}function ns(n,e){n.srEl&&(n.srEl.textContent=e)}function nc(n,e,t=[]){let i=[],o=Vm(t);for(let s of e){let a=n.gaQty.get(s.id);if(!a)continue;let l=os(s);for(let c of l){let d=(a.get(c.id)??0)-(o.get(`${s.id}\0${c.id??""}`)??0);if(d<=0)continue;let p=n.paidPrice(s.categoryKey,c.id,c.price,s.id),m=Un(s);i.push(`<div class="sl-ga" data-ga="${se(s.id)}" data-ga-row-tier="${se(c.id??"")}"><div class="sl-ga-info"><div class="sl-ga-name">${se(s.displayLabel??s.label)}</div><div class="sl-ga-sub">${se(m?[l.length>1?c.label:"",(0,de.t)("picker.perGuestPrice",{price:n.money(p)})].filter(Boolean).join(" \xB7 "):`${l.length>1?c.label:s.displayType??n.tf("picker.generalAdmission","General admission")} \xB7 ${n.money(p)} \xB7 ${(0,de.tCount)("picker.leftCount",s.available)}`)}</div></div>`+(m?`<button type="button" class="sl-table-edit" data-ga-open="${se(s.id)}">${se((0,de.t)("picker.guestsCountEdit",{count:d}))}</button></div>`:`<div class="sl-ga-qty"><button type="button" data-d="-1" aria-label="${se(n.tf("picker.fewer","Fewer"))}">\u2212</button><span>${d}</span><button type="button" data-d="1" aria-label="${se(n.tf("picker.more","More"))}">+</button></div></div>`))}}let r=e.filter(s=>qn(n.gaQty,s.id)<=0&&!t.some(a=>a.objectId===s.id));return r.length&&i.push(`<div class="sl-ga-areas" data-ga-areas><button type="button" class="sl-ga-areas-toggle" data-ga-areas-toggle aria-expanded="${n.gaAreasExpanded}"><span>${se(n.tf("picker.gaAreasHeading","Areas"))}</span><small>${r.length}</small></button>`+(n.gaAreasExpanded?`<div class="sl-ga-areas-list">${r.map(s=>`<button type="button" class="sl-ga-area-open" data-ga-open="${se(s.id)}"${dn(n,s)<=0?" disabled":""}><span class="name">${se(s.displayLabel??s.label)}<small>${se(s.displayType??n.tf("picker.generalAdmission","General admission"))}</small></span><span class="meta">${se(dn(n,s)<=0?Jl(n,s):`${n.money(n.paidPrice(s.categoryKey,null,s.price,s.id))} \xB7 ${Un(s)?(0,de.t)("picker.capacityGuests",{count:Un(s).max}):(0,de.tCount)("picker.leftCount",dn(n,s))}`)}</span></button>`).join("")}</div>`:"")+"</div>"),i.join("")}function ic(n,e,t){e.querySelectorAll(".sl-ga .sl-ga-qty button").forEach(i=>{i.addEventListener("click",()=>{let o=i.closest(".sl-ga");if(!o?.dataset.ga)return;let r=t.find(c=>c.id===o.dataset.ga);if(!r)return;let s=o.dataset.gaRowTier?o.dataset.gaRowTier:null,a=Number(i.dataset.d),l=n.gaQty.get(r.id)?.get(s)??0;if(a>0&&Ql(n,r)-qn(n.gaQty,r.id)<=0){n.toast((0,de.t)("picker.maxTicketsForOrder",{count:n.maxTickets}),"warning");return}Gn(n.gaQty,r.id,s,Math.max(0,l+a)),n.syncTray()})}),e.querySelector("[data-ga-areas-toggle]")?.addEventListener("click",()=>{n.gaAreasExpanded=!n.gaAreasExpanded,n.syncTray()}),e.querySelectorAll("[data-ga-open]").forEach(i=>{i.addEventListener("click",()=>{let o=t.find(r=>r.id===i.dataset.gaOpen);o&&ss(n,o,null,i)})})}var Ym=/^[a-zA-Z0-9._-]+$/;function as(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]),o=decodeURIComponent(t[2]);return!i||!Ym.test(o)?null:{eventKey:i,asset:o}}catch{return null}}function Xm(n){try{return/^\/pub\/events\/[^/]+\/assets(?:\/|$)/.test(new URL(n,"https://seatlayer.invalid").pathname)}catch{return!1}}var Wn=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=as(e);if(!t)return Promise.resolve(Xm(e)||!Rn(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 o=this.load(this.eventKey,t.asset).then(r=>{let s=URL.createObjectURL(r);return this.disposed?(URL.revokeObjectURL(s),null):(this.created.add(s),s)}).catch(r=>{throw this.pending.delete(e),r});return this.pending.set(e,o),o}dispose(){if(!this.disposed){this.disposed=!0;for(let e of this.created)URL.revokeObjectURL(e);this.created.clear(),this.pending.clear()}}};var _t=require("@seatlayer/core"),Ko=require("@seatlayer/core/view3d/crossfade/panorama");var oc=`
343
341
  /* confirm card: a candidate is not in the tray until Select. Map gestures and
344
342
  floating chrome pause while the card owns focus, keeping the camera stable. */
345
343
  .sl-picker[data-confirming="true"] .sl-map-host>:not(.sl-confirm){pointer-events:none}
@@ -409,6 +407,9 @@ ${t}`}function Za(n){let{base:e,event:t,publicKey:i}=n;if(!e||!t||!i)return;let
409
407
  background:var(--sl-cat);color:var(--sl-cat-ink,#fff)}
410
408
  .sl-confirm-cat-name{font-size:15px;font-weight:800;color:inherit;flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
411
409
  .sl-confirm-price{flex:none;font-size:18px;font-weight:850;color:inherit;font-variant-numeric:tabular-nums}
410
+ /* EH20: "includes \xA32.00 booking fee", the band's own last line under its price. */
411
+ .sl-confirm-fee{margin-top:-8px;padding:0 16px 10px 14px;text-align:end;font-size:11.5px;font-weight:650;
412
+ background:var(--sl-cat);color:var(--sl-cat-ink,#fff)}
412
413
  /* The 3D action's decision-row form: hidden by default, shown by the
413
414
  narrow no-photo rule below. Square, ghost, the same 44px as its neighbours. */
414
415
  .sl-confirm-3drow{display:none;flex:0 0 44px;width:44px;min-height:44px;padding:0!important;border-radius:9px;
@@ -613,7 +614,8 @@ ${t}`}function Za(n){let{base:e,event:t,publicKey:i}=n;if(!e||!t||!i)return;let
613
614
  .sl-picker[data-layout="narrow"] .sl-confirm-price{font-size:18px}
614
615
  .sl-picker[data-layout="narrow"] .sl-confirm-id{display:none;align-items:center;gap:7px;padding:10px 10px 0;min-height:28px}
615
616
  .sl-picker[data-layout="narrow"][data-density="compact"] .sl-confirm-grid,
616
- .sl-picker[data-layout="narrow"][data-density="compact"] .sl-confirm-cat{display:none}
617
+ .sl-picker[data-layout="narrow"][data-density="compact"] .sl-confirm-cat,
618
+ .sl-picker[data-layout="narrow"][data-density="compact"] .sl-confirm-fee{display:none}
617
619
  .sl-picker[data-layout="narrow"][data-density="compact"] .sl-confirm-id{display:flex}
618
620
  .sl-confirm-dot{flex:none;width:10px;height:10px;border-radius:50%;
619
621
  box-shadow:0 0 0 2px color-mix(in srgb,var(--sl-surface) 70%,transparent),0 0 0 3px color-mix(in srgb,var(--sl-line) 80%,transparent)}
@@ -718,7 +720,7 @@ ${t}`}function Za(n){let{base:e,event:t,publicKey:i}=n;if(!e||!t||!i)return;let
718
720
  color:var(--sl-text);font-weight:700;font-size:12px;display:flex;align-items:center;justify-content:center;gap:7px}
719
721
  .sl-confirm-view:hover{border-color:var(--sl-muted)}
720
722
  .sl-confirm-view svg{width:14px;height:14px;stroke:currentColor;stroke-width:2;fill:none;stroke-linecap:round;stroke-linejoin:round}
721
- `;var bl=`
723
+ `;var rc=`
722
724
  /* Test mode is environment context, not an action. The chip flows in the
723
725
  top-left anchor region: the old rotated corner ribbon sat at a negative
724
726
  offset and was clipped by the widget root's rounded overflow:hidden (its
@@ -878,6 +880,9 @@ ${t}`}function Za(n){let{base:e,event:t,publicKey:i}=n;if(!e||!t||!i)return;let
878
880
  is a line of its own, tucked under the row it belongs to. */
879
881
  .sl-tip-note{display:block;margin-top:-6px;padding:0 12px 9px 30px;
880
882
  font-size:10.5px;font-weight:700;color:var(--sl-muted)}
883
+ /* EH20: "includes \xA32.00 booking fee", under the price it qualifies. */
884
+ .sl-tip-fee{display:block;margin-top:-6px;padding:0 12px 9px 30px;text-align:end;
885
+ font-size:10.5px;font-weight:600;color:var(--sl-muted)}
881
886
 
882
887
  /* Why a tapped seat cannot be taken. Muted, wrapping, and separated from the
883
888
  card above it by a hairline \u2014 it is a sentence, not another status chip. */
@@ -979,7 +984,7 @@ ${t}`}function Za(n){let{base:e,event:t,publicKey:i}=n;if(!e||!t||!i)return;let
979
984
  .sl-pg-switch:hover{border-style:solid;color:var(--sl-text);border-color:var(--sl-accent)}
980
985
  @media(prefers-reduced-motion:reduce){.sl-tip{animation:none!important}.sl-tip,.sl-tip-switch,.sl-pg-switch{transition:none!important}}
981
986
  @media(max-width:639px){.sl-confirm-group-dates{width:min(340px,calc(100% - 20px))}.sl-confirm-date{min-height:32px}}
982
- `;var yl=`
987
+ `;var sc=`
983
988
  /* \u2500\u2500 Selects \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
984
989
  /* One chevron for every select the panel owns: same glyph, same weight, same
985
990
  inset from the edge. The platform's own arrow is a different size, colour
@@ -1079,7 +1084,7 @@ ${t}`}function Za(n){let{base:e,event:t,publicKey:i}=n;if(!e||!t||!i)return;let
1079
1084
  .sl-ba-qty button:active:not(:disabled),.sl-ga-qty button:active:not(:disabled),
1080
1085
  .sl-picker .sl-ba-go:active:not(:disabled){transform:none}
1081
1086
  }
1082
- `;var vl=`
1087
+ `;var ac=`
1083
1088
  /* 3D venue overlay \u2014 mounts over the (paused) Konva stage inside the map host.
1084
1089
  Carries its own gradient so it paints instantly before the scene builds, and
1085
1090
  cross-fades on enter/exit via a compositor-only opacity transition. Sits below
@@ -1448,7 +1453,7 @@ ${t}`}function Za(n){let{base:e,event:t,publicKey:i}=n;if(!e||!t||!i)return;let
1448
1453
  .sl-view3d-passport-shell{padding:max(10px,env(safe-area-inset-top)) 10px max(10px,env(safe-area-inset-bottom))}
1449
1454
  .sl-view3d-passport{width:100%;max-height:100%;padding:14px 14px max(24px,calc(14px + env(safe-area-inset-bottom)));border-radius:15px}
1450
1455
  }
1451
- `;var wl=`
1456
+ `;var lc=`
1452
1457
  .sl-notes{display:flex;flex-direction:column;gap:0;margin:0}
1453
1458
  /* No radius, no border, no inset: a band is the card's full width or it is a
1454
1459
  plate again. The hairline lives on the JOIN, so the first band sits flush
@@ -1483,7 +1488,7 @@ ${t}`}function Za(n){let{base:e,event:t,publicKey:i}=n;if(!e||!t||!i)return;let
1483
1488
  .sl-notes.compact .sl-note{padding:7px 12px 7px 15px}
1484
1489
  .sl-notes.compact .sl-note-t b{font-size:11.5px;font-weight:750}
1485
1490
  .sl-notes.compact .sl-note-n{font-size:10.5px}
1486
- `;var xl=`
1491
+ `;var cc=`
1487
1492
  /* The head is a bare 19.5px strip: the pill's upper half and nothing else. It
1488
1493
  used to reserve 26px (6px of ground above a 20px pill) and the sheet drew a
1489
1494
  border above that, so the chrome between the map and the cart was 33px of
@@ -1602,7 +1607,7 @@ ${t}`}function Za(n){let{base:e,event:t,publicKey:i}=n;if(!e||!t||!i)return;let
1602
1607
  above the line. The map now reaches the line, so the column keeps the same
1603
1608
  clearance from the pill's top rather than dropping onto the hairline. */
1604
1609
  .sl-picker[data-layout="narrow"] .sl-anchor[data-region="bottom-right"]{bottom:32px}
1605
- `;var kl=`
1610
+ `;var dc=`
1606
1611
  /* THE PHONE SHOWS THE DESKTOP CARD (owner call 2026-09-06: "cards should be
1607
1612
  the same design as desktop"). What used to be here was a second rendering of
1608
1613
  the cart \u2014 a bordered .sl-tlist box of 44px hairline-divided .sl-tline rows,
@@ -1810,13 +1815,13 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default;text-decoration-color:t
1810
1815
  .sl-picker .sl-fitpill.sl-fit-p2,.sl-picker .sl-fitpill.sl-fit-p3{font-size:11.5px}
1811
1816
  .sl-picker .sl-fitpill.sl-fit-p3{white-space:normal;text-align:center;
1812
1817
  padding-top:6px;padding-bottom:6px;line-height:1.2}
1813
- `;function kr(n){return n?[...n.children].filter(e=>e instanceof HTMLElement&&e.offsetWidth>0&&e.offsetHeight>0):[]}function Sl(n){return n.length?n.reduce((e,t)=>e+t.offsetWidth,0)+8*(n.length-1):0}function $u({mapWidth:n,leftWidth:e,centerWidth:t,rightWidth:i}){if(n<=0)return!0;let o=i>0?i+8:0;if(o>n*.38)return!1;if(t<=0)return!0;let r=n/2,s=r-12-(e>0?Math.min(e,n*.38)+8:0),a=r-12-(o>0?o+8:0);return t/2<=Math.min(s,a)}function Tl(n,e,t){if(!n)return;if(n.dataset.layout==="narrow"){delete n.dataset.topbar;return}let i=kr(t["top-right"]),o={mapWidth:e.clientWidth,leftWidth:Sl(kr(t["top-left"])),centerWidth:Math.max(0,...kr(t["top-center"]).filter(s=>s.classList.contains("sl-rungs")).map(s=>s.offsetWidth)),rightWidth:Sl(i)};!$u(o)?n.dataset.topbar="stacked":delete n.dataset.topbar,e.style.setProperty("--sl-topright-w",`${Math.ceil(o.rightWidth+8)}px`)}var El=`
1818
+ `;function ls(n){return n?[...n.children].filter(e=>e instanceof HTMLElement&&e.offsetWidth>0&&e.offsetHeight>0):[]}function pc(n){return n.length?n.reduce((e,t)=>e+t.offsetWidth,0)+8*(n.length-1):0}function Zm({mapWidth:n,leftWidth:e,centerWidth:t,rightWidth:i}){if(n<=0)return!0;let o=i>0?i+8:0;if(o>n*.38)return!1;if(t<=0)return!0;let r=n/2,s=r-12-(e>0?Math.min(e,n*.38)+8:0),a=r-12-(o>0?o+8:0);return t/2<=Math.min(s,a)}function hc(n,e,t){if(!n)return;if(n.dataset.layout==="narrow"){delete n.dataset.topbar;return}let i=ls(t["top-right"]),o={mapWidth:e.clientWidth,leftWidth:pc(ls(t["top-left"])),centerWidth:Math.max(0,...ls(t["top-center"]).filter(s=>s.classList.contains("sl-rungs")).map(s=>s.offsetWidth)),rightWidth:pc(i)};!Zm(o)?n.dataset.topbar="stacked":delete n.dataset.topbar,e.style.setProperty("--sl-topright-w",`${Math.ceil(o.rightWidth+8)}px`)}var uc=`
1814
1819
  .sl-picker[data-layout="wide"][data-topbar="stacked"] .sl-anchor[data-region="top-right"]{flex-wrap:nowrap;max-width:none}
1815
1820
  .sl-picker[data-layout="wide"][data-topbar="stacked"] .sl-anchor[data-region="top-left"]{
1816
1821
  max-width:calc(100% - 32px - var(--sl-topright-w,160px))}
1817
1822
  .sl-picker[data-layout="wide"][data-topbar="stacked"] .sl-anchor[data-region="top-center"]{
1818
1823
  top:64px;max-width:calc(100% - 24px)}
1819
- `;var Cl="seatlayer-picker-style",zu=`
1824
+ `;var mc="seatlayer-picker-style",Qm=`
1820
1825
  .sl-picker{position:relative;display:flex;flex-direction:column;width:100%;height:100%;min-height:420px;overflow:hidden;
1821
1826
  background:var(--sl-bg);color:var(--sl-text);font-family:var(--sl-font);border-radius:var(--sl-radius);
1822
1827
  /* iOS INFLATES FIXED-PX TYPE IN A HOST LAYOUT IT DECIDES IS TOO NARROW, and
@@ -2492,6 +2497,7 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default;text-decoration-color:t
2492
2497
  fill and alpha mirror render/seatStatusPaint's UNAVAILABLE_SEAT_FILL and
2493
2498
  UNAVAILABLE_SEAT_OPACITY, so the key teaches the language the canvas speaks. */
2494
2499
  .sl-status-icon.unavailable{background:#9ca3af;opacity:.55;outline:none}
2500
+ .sl-status-icon.partial{background:linear-gradient(90deg,var(--sl-accent) 50%,#9ca3af 50%);outline:none}
2495
2501
 
2496
2502
  /* tray */
2497
2503
  .sl-seats-sec{display:flex;align-items:center;justify-content:space-between;gap:10px;padding-top:13px}
@@ -2710,6 +2716,8 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default;text-decoration-color:t
2710
2716
  /* footer */
2711
2717
  .sl-foot{position:relative;z-index:2;padding:10px 16px 8px;border-top:1px solid var(--sl-line);flex:none;
2712
2718
  background:var(--sl-bg);box-shadow:0 -10px 24px -22px rgba(0,0,0,.72)}
2719
+ /* checkoutBar: false: the host draws its own button and holds via holdSelection(). */
2720
+ .sl-picker[data-checkout-bar="off"] .sl-foot{display:none}
2713
2721
  .sl-total{display:flex;justify-content:space-between;align-items:center;font-size:13px;margin-bottom:10px}
2714
2722
  .sl-total b{font-size:17px;font-variant-numeric:tabular-nums}
2715
2723
  /* A COUNT THAT GOES 6 \u2192 7 SHOULD LOOK LIKE 6 GOING TO 7 (owner, 2026-09-06:
@@ -3031,19 +3039,6 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default;text-decoration-color:t
3031
3039
  .sl-closed-pill.on{display:inline-flex}
3032
3040
  .sl-closed-pill svg{width:13px;height:13px;stroke:currentColor;stroke-width:2;fill:none;stroke-linecap:round;stroke-linejoin:round}
3033
3041
 
3034
- /* "Powered by SeatLayer" attribution badge (side-panel foot) \u2014 the canonical
3035
- Layered Rows mark + wordmark. Hidden when the host opts out or the org's paid
3036
- theme sets hideBadge. */
3037
- .sl-powered{display:flex;align-items:center;justify-content:center;gap:5px;margin-top:2px;
3038
- font-size:11px;font-weight:600;letter-spacing:.02em;color:var(--sl-text);opacity:.72;
3039
- text-decoration:none;padding:2px 8px;border-radius:999px;width:fit-content;margin-inline:auto;
3040
- transition:opacity .15s ease,background-color .15s ease}
3041
- .sl-powered:hover{opacity:1;background:color-mix(in srgb,var(--sl-text) 8%,transparent)}
3042
- .sl-powered:focus-visible{opacity:1;outline:2px solid var(--sl-accent);outline-offset:2px}
3043
- .sl-powered-mark{width:16px;height:16px;border-radius:4px;flex:none;display:flex;align-items:center;justify-content:center;
3044
- background:#0c1220;color:#fcf7ee}
3045
- .sl-powered-mark svg{width:12px;height:11px}
3046
-
3047
3042
  /* a11y filter chips (flow within the top-left region) */
3048
3043
  .sl-chips{display:flex;gap:6px;flex-wrap:wrap}
3049
3044
  .sl-chip-f{display:inline-flex;align-items:center;gap:6px;padding:7px 12px;border-radius:999px;font-size:12px;font-weight:700;
@@ -3519,7 +3514,7 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default;text-decoration-color:t
3519
3514
  Paint twelve pixels of the frame ground below its box to cover that seam;
3520
3515
  this does not enlarge the picker or move its checkout controls. */
3521
3516
  @media(max-width:640px){.sl-modal-scrim{padding:0}.sl-modal-frame{width:100%;height:100%;border-radius:0;box-shadow:0 12px 0 var(--sl-bg)}}
3522
- `;function Pn(){if(document.getElementById(Cl))return;let n=document.createElement("style");n.id=Cl,n.textContent=zu+xl+wl+gl+kl+yl+vl+El+bl+Ja,document.head.appendChild(n)}async function co(n,e){let t=n.overlay.productionElements;if(!t?.some(o=>o.contentImageUrl))return n;let i=await Promise.all(t.map(async o=>{if(!o.contentImageUrl)return o;try{let r=await e(o.contentImageUrl);if(!r){let{contentImageUrl:s,...a}=o;return a}return{...o,runtimeContentImageUrl:r}}catch{let{contentImageUrl:r,...s}=o;return s}}));return{...n,overlay:{...n.overlay,productionElements:i}}}async function po(n,e){if(n)try{let t=await e(n);return t?await(await fetch(t)).arrayBuffer():void 0}catch{return}}var St=require("@seatlayer/core/view/panoramaDelivery");function ho(n){let{root:e,source:t,caption:i,real:o,closeLabel:r,dragHint:s,viewFromSeatLabel:a,real360Label:l,previewLabel:c,resolveAsset:d,onClose:p}=n,u=n.chrome??{},h=document.createElement("div");h.className="sl-view sl-mo-zoom",h.setAttribute("role","dialog"),h.setAttribute("aria-label",a),h.innerHTML='<div class="sl-view-head"><span class="sl-view-title"></span><span class="sl-view-cap"></span><button type="button" class="sl-view-x"><svg viewBox="0 0 24 24"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg></button></div><div class="sl-view-pano"><span class="sl-view-badge"></span><span class="sl-view-hint"></span></div>';let b=k=>h.querySelector(k)?.remove();u.title===!1?b(".sl-view-title"):h.querySelector(".sl-view-title").textContent=a,u.caption===!1?b(".sl-view-cap"):h.querySelector(".sl-view-cap").textContent=i,h.querySelector(".sl-view-x").setAttribute("aria-label",r),u.badge===!1?b(".sl-view-badge"):h.querySelector(".sl-view-badge").textContent=o?l:c,h.querySelector(".sl-view-hint").textContent=s,e.appendChild(h);let f=h.querySelector(".sl-view-pano"),T=(0,St.planPanoramaDelivery)(t,(0,St.browserPanoramaConstraints)()),w=new AbortController;f.style.backgroundImage=`url(${JSON.stringify(T.initialUrl)})`;let v=()=>{};T.upgradeUrl&&(v=(0,St.schedulePanoramaUpgrade)(()=>{d(T.upgradeUrl).then(k=>!k||w.signal.aborted?null:(0,St.loadPanoramaImage)(k,w.signal).then(()=>k)).then(k=>{!k||!h.isConnected||w.signal.aborted||(f.style.backgroundImage=`url(${JSON.stringify(k)})`)}).catch(()=>{})}));let M=70,F=35,X=1,g=f.clientHeight||1,_=f.clientWidth||1,G=-(g*(180/M)*2/2-_/2),N=0,j=()=>{let k=f.clientHeight||1,A=k*(180/M)*X,B=Math.max(0,A-k),Q=Math.min(B/2,F/180*A);N=Math.min(Q,Math.max(-Q,N)),f.style.backgroundSize=`auto ${A}px`,f.style.backgroundPosition=`${G}px ${N-B/2}px`};j();let P=!1,z=0,ee=0,W=k=>{P=!0,z=k.clientX,ee=k.clientY,f.classList.add("drag"),f.setPointerCapture?.(k.pointerId)},re=k=>{P&&(G+=k.clientX-z,N+=k.clientY-ee,z=k.clientX,ee=k.clientY,j())},Ee=k=>{P=!1,f.classList.remove("drag"),f.releasePointerCapture?.(k.pointerId)},ke=k=>{k.preventDefault(),X=Math.min(2.4,Math.max(1,X+(k.deltaY<0?.12:-.12))),j()};f.addEventListener("pointerdown",W),f.addEventListener("pointermove",re),f.addEventListener("pointerup",Ee),f.addEventListener("pointercancel",Ee),f.addEventListener("wheel",ke,{passive:!1});let Ce=h.querySelector(".sl-view-x");Ce.addEventListener("click",p);let ze=k=>{k.key==="Escape"&&(k.stopPropagation(),p())};return h.addEventListener("keydown",ze),Ce.focus(),{element:h,dispose(){v(),w.abort(),f.removeEventListener("pointerdown",W),f.removeEventListener("pointermove",re),f.removeEventListener("pointerup",Ee),f.removeEventListener("pointercancel",Ee),f.removeEventListener("wheel",ke),h.removeEventListener("keydown",ze),Ce.removeEventListener("click",p)}}}function ju(n,e){if(!e)return{targetSeatId:null,previousSeatId:null,nextSeatId:null};let t=n.find(r=>r.id===e);if(!t?.rowId)return{targetSeatId:e,previousSeatId:null,nextSeatId:null};let i=n.filter(r=>r.rowId===t.rowId),o=i.findIndex(r=>r.id===e);return{targetSeatId:e,previousSeatId:o>0?i[o-1].id:null,nextSeatId:o>=0&&o+1<i.length?i[o+1].id:null}}var Al=6e4,uo=class{constructor(e){this.buyerView_="map";this.targetSeatId_=null;this.focusedSectionId_=null;this.navigationMode_="auto";this.overlay=null;this.handle=null;this.generation=0;this.seatViewGeneration=0;this.seatViewElement=null;this.seatViewDispose=null;this.navigationPinned_=!1;this.options=e}get buyerView(){return this.buyerView_}get targetSeatId(){return this.targetSeatId_}get focusedSectionId(){return this.focusedSectionId_}get seatPosition(){return ju(this.options.seats(),this.targetSeatId_)}get navigationMode(){return this.navigationMode_==="auto"?"orbit":this.navigationMode_}canOffer3D(){return this.options.enable3D?this.handle&&this.overlay?!0:!this.options.doc()||!_i()?!1:this.options.seats().length<=this.max3DSeats():!1}canOfferSeatView(){return this.options.enableSeatView?this.options.seats().some(e=>!!e.viewUrl)?!0:this.hasStage():!1}async setBuyerView(e,t={}){if(e==="map"){this.exit3D();return}if(!this.canOffer3D())throw new Error("venue_3d_unavailable");if(this.buyerView_==="venue3d"&&this.handle){t.flyToSeatId?(this.targetSeatId_=t.flyToSeatId,this.focusedSectionId_=this.findSeat(t.flyToSeatId)?.sectionId??null,this.options.onViewChange(this.buyerView_,this.targetSeatId_),await this.handle.flyToSeat(t.flyToSeatId)):t.resetView&&this.handle.focusOverview();return}if(this.handle&&this.overlay){await this.restore3D(t);return}await this.enter3D(t.flyToSeatId)}async openSeatView(e){if(!this.canOfferSeatView())throw new Error("seat_view_unavailable");let t=this.findSeat(e),i=this.options.host(),o=this.options.doc();if(!t||!i||!o)throw new Error("seat_view_unavailable");let r=++this.seatViewGeneration,s,a,l=!1;if(t.viewUrl){let b=t.viewMeta?.previewUrl,f=!!b&&b!==t.viewUrl,T=f?await this.options.resolveAsset(b):null,w=f?t.viewUrl:await this.options.resolveAsset(t.viewUrl);if(r!==this.seatViewGeneration||!w||f&&!T)return;s={url:w,...T?{previewUrl:T}:{},...f?{resolveUrl:this.options.resolveAsset}:{},...t.viewMeta?.sourceWidth!==void 0?{sourceWidth:t.viewMeta.sourceWidth}:{},...t.viewMeta?.sourceHeight!==void 0?{sourceHeight:t.viewMeta.sourceHeight}:{},...t.viewMeta?.previewWidth!==void 0?{previewWidth:t.viewMeta.previewWidth}:{},...t.viewMeta?.previewHeight!==void 0?{previewHeight:t.viewMeta.previewHeight}:{},...t.viewMeta?.variants?.length?{variants:t.viewMeta.variants}:{},...t.viewMeta?.coverage?{coverage:t.viewMeta.coverage}:{},...t.viewMeta?.capturedAt?{capturedAt:t.viewMeta.capturedAt}:{},...t.viewMeta?.sourceLabel?{sourceLabel:t.viewMeta.sourceLabel}:{}},a=(0,mo.seatViewDisclosure)(s),l=(0,mo.isAuthoredSeatView)(s)}else{if(!this.hasStage())throw new Error("seat_view_unavailable");let{generateSeatPanorama:b}=await Di();if(r!==this.seatViewGeneration)return;let f=o.floors?.find(v=>v.objects.some(M=>M.type==="row"&&M.id===t.rowId)),T=t.focalPoint??f?.focalPoint??o.focalPoint,w=b(t,T,[...this.options.seats()]);s={url:w.url,generated:!0},a=(0,Ut.t)("picker.illustrationCaption",{m:w.distanceM})}if(r!==this.seatViewGeneration)return;this.closeSeatView(!1),this.prepareHostTheme(i,o),Pn();let c=this.options.chrome??{},d=Vt(),p=(0,Ut.t)("picker.viewFromSeat",{label:t.displayLabel||t.label}),u=l?(0,Ut.t)("picker.real360"):(0,Ut.t)("picker.preview"),h=ho({root:i,source:s,caption:a,real:l,closeLabel:y("picker.close","Close"),dragHint:d,viewFromSeatLabel:p,real360Label:(0,Ut.t)("picker.real360"),previewLabel:(0,Ut.t)("picker.preview"),chrome:{title:c.seatViewTitle,caption:c.seatViewCaption,badge:c.seatViewBadge},resolveAsset:this.options.resolveAsset,onClose:()=>this.closeSeatView(!0,!0)});this.seatViewElement=h.element,this.seatViewDispose=h.dispose,this.options.onSeatViewChange?.({seatId:t.id,title:p,caption:a,badge:u,real:l,generated:!!s.generated,dragHint:d})}pushLiveState(){this.handle&&(this.handle.setAvailability(this.options.seats().map(e=>({seatId:e.id,state:this.seatState(e)}))),this.handle.setSelection(this.options.selection().map(e=>e.id)))}focusOverview(){return this.buyerView_!=="venue3d"||!this.handle?!1:(this.handle.focusOverview(),!0)}focusSection(e){return this.buyerView_==="venue3d"?this.handle?.focusSection(e)??!1:!1}focusFloor(e){let t=this.options.doc();if(this.buyerView_!=="venue3d"||!this.handle||!t?.floors?.length)return!1;let i=t.floors.findIndex(o=>o.id===e);return i>=0&&this.handle.focusFloor(i)}zoomIn(){return this.buyerView_!=="venue3d"||!this.handle?!1:(this.handle.zoomIn(),!0)}zoomOut(){return this.buyerView_!=="venue3d"||!this.handle?!1:(this.handle.zoomOut(),!0)}applyNavigationMode(e){this.navigationMode_==="auto"&&!this.navigationPinned_||e.setNavigationMode(this.navigationMode_)}setNavigationMode(e){return e!=="auto"&&(this.navigationPinned_=!0),this.navigationMode_=e,this.buyerView_!=="venue3d"||!this.handle?!1:(this.applyNavigationMode(this.handle),this.options.onViewChange(this.buyerView_,this.targetSeatId_),!0)}destroy(){this.generation+=1,this.closeSeatView(!0,!1);try{this.handle?.dispose()}catch{}this.handle=null,this.overlay?.remove(),this.overlay=null,this.buyerView_="map",this.targetSeatId_=null,this.focusedSectionId_=null}max3DSeats(){let e=this.options.max3DSeats;if(typeof e=="number"&&e>0)return e;let t=globalThis.navigator;return(t?.hardwareConcurrency??8)<=4||(t?.deviceMemory??8)<=4||(globalThis.matchMedia?.("(pointer: coarse)").matches??!1)?Al/2:Al}async enter3D(e){let t=this.options.host(),i=this.options.doc();if(!t||!i||this.overlay)throw new Error("venue_3d_unavailable");Pn(),this.prepareHostTheme(t,i);let o=document.createElement("div");o.className="sl-view3d",o.setAttribute("role","group"),o.setAttribute("aria-label",y("picker.interactive3dVenueView","Interactive 3D venue view")),Object.assign(o.style,{position:"absolute",inset:"0",zIndex:"4",opacity:"0",touchAction:"none",transition:this.reducedMotion()?"none":"opacity 260ms cubic-bezier(.2,.8,.2,1)",background:"radial-gradient(120% 120% at 50% 0%,#191f28 0%,#0d1014 70%)"});let r=document.createElement("div");r.className="sl-view3d-loading",r.setAttribute("role","status"),r.setAttribute("aria-live","polite"),r.textContent=y("picker.loading3d","Building the 3D venue\u2026"),o.appendChild(r),t.appendChild(o),this.overlay=o;let s=++this.generation;if(this.reducedMotion()?o.style.opacity="1":requestAnimationFrame(()=>{o.style.opacity="1"}),await this.nextPaint(),!(s!==this.generation||this.overlay!==o))try{let[a,l]=await Promise.all([ni(),this.options.loadEventConfiguration()]),c=l?await co(l,this.options.resolveAsset):null,d=await po(i.theme?.venue3d?.shellAssetUrl,this.options.resolveAsset);if(s!==this.generation||this.overlay!==o)return;let p={doc:i,seats:[...this.options.seats()],...c?{eventConfigurationId:c.id,eventConfiguration:c}:{},...d?{registeredShellGlb:d}:{}};r.textContent=y("picker.building3d","Building venue geometry\u2026");let u=await a.prepareVenue3D(p);if(s!==this.generation||this.overlay!==o)return;let h=this.options.chrome??{},b=a.mountVenue3D(o,{...p,prepared:u},{portraitOverviewCrop:!0,arriveAtSeatEye:!0,lookAroundHint:Vt(),navLabels:Oi(),...h.view3dCaption===!1||h.view3dSeatStepper===!1||h.view3dControlDock===!1?{chrome:{caption:h.view3dCaption!==!1,seatStepper:h.view3dSeatStepper!==!1,controlDock:h.view3dControlDock!==!1}}:{},seatViewActionLabel:f=>this.findSeat(f)?.viewUrl?y("picker.openAuthored360","Open venue 360\xB0"):y("picker.lookAroundLive3d","Look around in live 3D"),onSeatPick:f=>this.toggleSeat(f),onSeatInspect:f=>this.toggleSeat(f),onViewTargetChange:f=>{this.targetSeatId_=f,f&&(this.focusedSectionId_=this.findSeat(f)?.sectionId??null),this.options.onViewChange("venue3d",f)},onSectionFocusChange:f=>{this.focusedSectionId_=f,this.options.onViewChange("venue3d",this.targetSeatId_)},...this.options.enableSeatView?{getSeatView:f=>this.seatViewFor3D(f)}:{}});if(s!==this.generation||this.overlay!==o){b.dispose();return}this.handle=b,this.buyerView_="venue3d",this.targetSeatId_=e??null,this.focusedSectionId_=e?this.findSeat(e)?.sectionId??null:null,this.applyNavigationMode(b),requestAnimationFrame(()=>r.remove()),this.pushLiveState(),this.options.onViewChange("venue3d",this.targetSeatId_),e&&await b.flyToSeat(e)}catch(a){if(s!==this.generation)return;throw this.options.onError?.(a),this.remove3DOverlay(!1),a}}exit3D(){this.buyerView_==="map"&&!this.overlay||(this.generation+=1,this.buyerView_="map",this.targetSeatId_=null,this.focusedSectionId_=null,this.remove3DOverlay(!0,!!this.handle),this.options.onViewChange("map",null))}remove3DOverlay(e,t=!1){let i=this.handle,o=this.overlay;if(this.options.restoreMap(),t&&i&&o){o.style.pointerEvents="none";let r=()=>{this.buyerView_!=="map"||this.overlay!==o||(o.style.visibility="hidden",this.options.restoreMap())};!e||this.reducedMotion()?(o.style.opacity="0",r()):(requestAnimationFrame(()=>{o.style.opacity="0"}),setTimeout(r,280));return}if(this.handle=null,this.overlay=null,!o){try{i?.dispose()}catch{}this.options.restoreMap();return}if(!e||this.reducedMotion()){try{i?.dispose()}catch{}o.remove(),this.options.restoreMap();return}o.style.pointerEvents="none",requestAnimationFrame(()=>{o.style.opacity="0"}),setTimeout(()=>{try{i?.dispose()}catch{}o.remove(),this.options.restoreMap()},280)}async restore3D(e){let t=this.overlay,i=this.handle;if(!t||!i)throw new Error("venue_3d_unavailable");this.buyerView_="venue3d",this.targetSeatId_=e.flyToSeatId??null,this.focusedSectionId_=e.flyToSeatId?this.findSeat(e.flyToSeatId)?.sectionId??null:null,t.style.visibility="visible",t.style.pointerEvents="auto",this.reducedMotion()?t.style.opacity="1":requestAnimationFrame(()=>{t.style.opacity="1"}),i.resize(),this.applyNavigationMode(i),this.pushLiveState(),this.options.onViewChange("venue3d",this.targetSeatId_),e.flyToSeatId?await i.flyToSeat(e.flyToSeatId):e.resetView&&i.focusOverview()}nextPaint(){return this.reducedMotion()||typeof requestAnimationFrame!="function"?Promise.resolve():new Promise(e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))})}toggleSeat(e){if(!this.findSeat(e))return;this.options.selection().some(o=>o.id===e)?this.options.deselect(e):this.options.status(e)==="free"&&this.options.select(e),this.pushLiveState()}seatState(e){switch(this.options.status(e.id)){case"held":return"held";case"booked":return"sold";case"not_for_sale":return"dimmed";default:return"available"}}async seatViewFor3D(e){let t=this.findSeat(e);if(!t)throw new Error("seat_view_unavailable");if(t.viewUrl){let i=t.viewMeta?.previewUrl,o=!!i&&i!==t.viewUrl,r=o?await this.options.resolveAsset(i):null,s=o?t.viewUrl:await this.options.resolveAsset(t.viewUrl);if(!s||o&&!r)throw new Error("seat_view_unavailable");return{url:s,...r?{previewUrl:r}:{},...o?{resolveUrl:this.options.resolveAsset}:{},...t.viewMeta?.variants?.length?{variants:t.viewMeta.variants}:{},...t.viewMeta?.initialBearingDeg!==void 0?{initialBearingDeg:t.viewMeta.initialBearingDeg}:{},...t.viewMeta?.initialPitchDeg!==void 0?{initialPitchDeg:t.viewMeta.initialPitchDeg}:{},...t.viewMeta?.coverage?{coverage:t.viewMeta.coverage}:{},...t.viewMeta?.capturedAt?{capturedAt:t.viewMeta.capturedAt}:{},...t.viewMeta?.sourceLabel?{sourceLabel:t.viewMeta.sourceLabel}:{}}}return{url:"",generated:!0,mediaKind:"model",coverage:"exact-seat",sourceLabel:y("picker.chartDerivedModel","Chart-derived model")}}closeSeatView(e=!0,t=!1){e&&(this.seatViewGeneration+=1);let i=this.seatViewElement;if(this.seatViewDispose?.(),this.seatViewDispose=null,this.seatViewElement=null,!!i){if(this.options.onSeatViewChange?.(null),!t||this.reducedMotion()){i.remove();return}i.classList.add("is-leaving"),setTimeout(()=>i.remove(),190)}}findSeat(e){return this.options.seats().find(t=>t.id===e||t.label===e)}hasStage(){let e=this.options.doc();return e?(e.floors?.flatMap(i=>i.objects)??e.objects).some(i=>i.type==="shape"&&(i.role==="stage"||!!i.stageKind)):!1}prepareHostTheme(e,t){getComputedStyle(e).position==="static"&&(e.style.position="relative");let i=t.theme;e.style.setProperty("--sl-bg",i?.background??"#f6f7fb"),e.style.setProperty("--sl-surface","#ffffff"),e.style.setProperty("--sl-text",i?.textColor??"#10162a"),e.style.setProperty("--sl-muted","#697386"),e.style.setProperty("--sl-line","#d9deea"),e.style.setProperty("--sl-accent",i?.accent??"#ef4056"),e.style.setProperty("--sl-accent-ink",i?.accentInk??"#ffffff")}reducedMotion(){return globalThis.matchMedia?.("(prefers-reduced-motion: reduce)").matches??!1}};var Sr=require("@seatlayer/core");function lt(n,e,t,i){let o=e?n?.[e]:void 0;return o===void 0?i:typeof o=="number"?o:t&&o.tiers?.[t]!==void 0?o.tiers[t]:o.base??i}function fo(n,e,t,i,o){let r=(0,Sr.seatPriceFor)(n?.objects,e,i);return r!==void 0?r:(0,Sr.seatPriceFor)(n?.seatPrices,e,i)!==void 0?o:lt(n?.prices,t,i,o)}function go(n){if(!n)return null;let e=n.getBoundingClientRect();return e.width>0&&e.height>0?e:null}function Ku(n){return go(n.foot?.querySelector(".sl-total"))??go(n.tray)??go(n.sheetHead)}function Er(n,e,t,i,o){let r=n,s=r.map;if(!s||!e){o?.();return}let a=s.getBoundingClientRect(),l={x:a.left+e.x,y:a.top+e.y},c=t.displayLabel??t.label,d=i?.find(u=>u.key===t.categoryKey)?.color,p=()=>{let u=Ku(r);if(!u){o?.();return}il({from:l,to:{x:u.left+u.width/2,y:u.top+u.height/2},label:c,color:d,onArrive:o})};r.sheetHead&&go(r.sheetHead)?requestAnimationFrame(p):p()}var Tr=60,Gu=650;function Pl(n,e){if(!e.length||n.focusSeats?.(e.map(o=>o.id)))return;let t=e.find(o=>o.sectionId)?.sectionId;if(!t)return;let i=e.filter(o=>o.sectionId===t);n.focus(t,{x:i.reduce((o,r)=>o+r.x,0)/i.length,y:i.reduce((o,r)=>o+r.y,0)/i.length})}function Ml(n,e){let t=!oo();Pl({focusSeats:i=>n.focusSeats?.(i,{animate:t})===!0,focus:(i,o)=>n.focusSection(i,o)},(e?.items??[]).filter(i=>i.objectType!=="ga").slice(0,10).map(i=>n.seatByLabel(i.label)).filter(i=>!!i))}function Ll(n,e){if(!e.length)return;let t=n.reducedMotion===!0;t||e.forEach((s,a)=>{n.schedule(()=>n.pop(s.id),a*Tr)});let i=t?0:e.length*Tr,o=e.find(s=>s.sectionId)?.sectionId;if(n.schedule(()=>Pl(n,e),i),t)return;let r=i+(n.focusSeats||o?Gu:0);e.forEach((s,a)=>{n.schedule(()=>Er(n.regions,n.screenPoint(s),s,n.categories),r+a*Tr)})}function Uu(n,e,t){for(let i of n)if(e>=i.x&&t>=i.y&&e<=i.x+i.w&&t<=i.y+i.h)return!0;return!1}var bo=class{constructor(){this.rects=[];this.host=null;this.pointers=new Set;this.touches=new Set;this.mouseDown=!1;this.onPointerDown=e=>{this.inside(e.clientX,e.clientY)&&(this.pointers.add(e.pointerId),this.swallow(e))};this.onPointerFollow=e=>{this.pointers.has(e.pointerId)&&this.swallow(e)};this.onPointerEnd=e=>{this.pointers.delete(e.pointerId)&&this.swallow(e)};this.onTouchStart=e=>{let t=this.changed(e);if(!t.length)return;let i=!0;for(let o of t)this.inside(o.clientX,o.clientY)?this.touches.add(o.identifier):i=!1;i&&this.swallow(e)};this.onTouchFollow=e=>{let t=this.changed(e);t.length&&t.every(i=>this.touches.has(i.identifier))&&this.swallow(e)};this.onTouchEnd=e=>{let t=this.changed(e);if(!t.length)return;let i=t.every(o=>this.touches.has(o.identifier));for(let o of t)this.touches.delete(o.identifier);i&&this.swallow(e)};this.onMouseDown=e=>{this.inside(e.clientX,e.clientY)&&(this.mouseDown=!0,this.swallow(e))};this.onMouseFollow=e=>{this.mouseDown&&this.swallow(e)};this.onMouseUp=e=>{this.mouseDown&&(this.mouseDown=!1,this.swallow(e))};this.onClick=e=>{this.inside(e.clientX,e.clientY)&&this.swallow(e)}}set(e){this.rects=e.map(t=>({x:t.x,y:t.y,w:t.w,h:t.h})),this.rects.length||(this.pointers.clear(),this.touches.clear(),this.mouseDown=!1)}get(){return this.rects}attach(e){if(this.host===e)return;this.detach(),this.host=e;let t={capture:!0,passive:!1};e.addEventListener("pointerdown",this.onPointerDown,t),e.addEventListener("pointermove",this.onPointerFollow,t),e.addEventListener("pointerup",this.onPointerEnd,t),e.addEventListener("pointercancel",this.onPointerEnd,t),e.addEventListener("touchstart",this.onTouchStart,t),e.addEventListener("touchmove",this.onTouchFollow,t),e.addEventListener("touchend",this.onTouchEnd,t),e.addEventListener("touchcancel",this.onTouchEnd,t),e.addEventListener("mousedown",this.onMouseDown,t),e.addEventListener("mousemove",this.onMouseFollow,t),e.addEventListener("mouseup",this.onMouseUp,t),e.addEventListener("click",this.onClick,t),e.addEventListener("dblclick",this.onClick,t)}detach(){let e=this.host;if(!e)return;let t={capture:!0};e.removeEventListener("pointerdown",this.onPointerDown,t),e.removeEventListener("pointermove",this.onPointerFollow,t),e.removeEventListener("pointerup",this.onPointerEnd,t),e.removeEventListener("pointercancel",this.onPointerEnd,t),e.removeEventListener("touchstart",this.onTouchStart,t),e.removeEventListener("touchmove",this.onTouchFollow,t),e.removeEventListener("touchend",this.onTouchEnd,t),e.removeEventListener("touchcancel",this.onTouchEnd,t),e.removeEventListener("mousedown",this.onMouseDown,t),e.removeEventListener("mousemove",this.onMouseFollow,t),e.removeEventListener("mouseup",this.onMouseUp,t),e.removeEventListener("click",this.onClick,t),e.removeEventListener("dblclick",this.onClick,t),this.host=null,this.pointers.clear(),this.touches.clear(),this.mouseDown=!1}inside(e,t){if(!this.rects.length||!this.host)return!1;let i=this.host.getBoundingClientRect();return Uu(this.rects,e-i.left,t-i.top)}swallow(e){e.stopImmediatePropagation(),e.stopPropagation(),e.cancelable&&e.preventDefault()}changed(e){let t=e.changedTouches;return t?Array.from(t):[]}},Hl=.48,qu=8;function Wu(n,e,t,i=Hl){let o=Math.max(0,t.top),r=e.height-Math.max(0,t.bottom);if(!(r>o))return 0;let s=Number.isFinite(i)?Math.min(1,Math.max(0,i)):Hl,a=o+(r-o)*s-n;return Math.abs(a)<=qu?0:Math.round(a)}function Rl(n,e,t={}){let i=n.gestureCount();if(t.gestures!==void 0&&t.gestures!==i)return{dy:0,gestures:i};let o=n.seatPoint(e);if(!o)return{dy:0,gestures:i};let r=Wu(o.y,{height:n.mapHeight()},n.insets(),t.fraction);return r?{dy:n.panScreenBy({x:0,y:r},t.animate!==!1)?r:0,gestures:i}:{dy:0,gestures:i}}var ci=class n{constructor(e,t=null){this.seams=e;this.watch=null;this.mode=t,this.watchMode()}themeMode(){return this.mode}setThemeMode(e,t){let i=t!==void 0&&"mapTheme"in t;e===this.mode&&!i||(i&&this.seams.setHostMapTheme(t.mapTheme??void 0),this.mode=e,this.watchMode(),this.applyThemeMode())}static groundFor(e){return fn(null,e)}applyThemeMode(){let e=this.seams.mapTheme()??n.groundFor(this.mode);this.seams.applyMapTheme(e??null)&&this.seams.changed()}watchMode(){this.watch?.(),this.watch=null,this.mode==="auto"&&(this.watch=Wi(()=>this.applyThemeMode()))}setViewportInsets(e){this.seams.applyViewportInsets(e),this.seams.changed()}viewportInsets(){return this.seams.readViewportInsets()}dispose(){this.watch?.(),this.watch=null}};var Ol=require("@seatlayer/core"),_l=require("@seatlayer/core/core/seatConfidence");var Il=require("@seatlayer/core");function Mn(n){let e=n.viewMeta?.previewUrl??n.viewUrl;return e&&(xr(e)||dn(e))?e:null}function vo(n){if(!n)return!1;let e=n.floors?.length?n.floors.map(t=>t.objects??[]):[n.objects??[]];for(let t of e)for(let i of t)if(i.type==="shape"&&(i.role==="stage"||i.stageKind))return!0;return!1}var Yu=512,yo=new Map;function wo(n,e){if(!e)return null;let t=`${n.id}|${Math.round(e.x)},${Math.round(e.y)}`,i=yo.get(t);if(i!==void 0)return i;let o=null;try{o=(0,Il.generateSeatThumb)(n,e).distanceM??null}catch{o=null}return yo.size>=Yu&&yo.clear(),yo.set(t,o),o}function di(n){return n.getFocusedSection()!==null||n.seatsRevealed()}function Xu(n){let e=n.atVenueFit?.(),t=n.canZoomIn?.();return{...typeof e=="boolean"?{atVenueFit:e}:{},...typeof t=="boolean"?{canZoomIn:t}:{}}}function Qu(n,e){return{accessibilityFilter:n.length>0,limitedViewFilter:e.some(t=>t.commercial?.restrictedView||t.commercial?.obstructedView)}}function Zu(n,e,t,i){for(let o of e){if(o.count<=0)continue;let r=n.accessibilitySpread?.([o.key]);for(let s of r?.sections??[]){let a=t.get(s.id)??i.get(s.id);if(!a||s.free<=0)continue;let l=a.accessibleFree??(a.accessibleFree={});l[o.key]=s.free}}}function Nl(n,e,t){let i=n.doc,o=i?.theme??{},r=n.categoryAvailability(),s=n.getGAAreas(),a=n.getFloors(),l=n.getExpandedSeats(),c=n.getAccessNeeds(),d=Qu(c,l),p=e.seatPosition,u=p.targetSeatId?n.seatDetails(p.targetSeatId):null,h=new Map(l.map(v=>[v.id,v])),b=vo(i),f=i?.floors?.flatMap(v=>v.objects)??i?.objects??[],T=new Map,w=new Map;for(let v of f){if(v.type!=="section")continue;let M={id:v.id,label:v.label,...v.displayLabel?{displayLabel:v.displayLabel}:{},...v.zone?{zoneId:v.zone}:{}};T.set(v.id,M);let F=v.logicalSectionId??v.id;w.has(F)||w.set(F,M)}return Zu(n,c,T,w),{event:{key:t.event,name:t.eventInfo?.name??i?.name??t.event,venue:t.eventInfo?.venue??null,startsAt:t.eventInfo?.startsAt??null,timezone:t.eventInfo?.timezone??null,currency:t.eventInfo?.currency??t.currency??"USD",locale:(0,Ol.getLocale)()||t.eventLocale,posterUrl:t.eventInfo?.posterUrl??null,mode:t.mode_??"live",salesClosed:t.eventInfo?.salesClosed??!1},branding:{...o.accent?{accent:o.accent}:{},...o.accentInk?{accentInk:o.accentInk}:{},...o.background?{background:o.background}:{},...o.textColor?{textColor:o.textColor}:{},...o.brandName?{brandName:o.brandName}:{},...o.logoUrl?{logoUrl:o.logoUrl}:{},attributionRequired:!o.hideBadge},features:{ga:s.length>0,tiers:!!i?.categories.some(v=>v.tiers?.length),floors:a.length>1,zones:!!i?.zones?.length,sections:T.size>0,bestAvailable:!0,...d,venue3d:e.canOffer3D(),seatView:e.canOfferSeatView()},catalog:{categories:(i?.categories??[]).filter(v=>!v.notForSale).map(v=>({key:v.key,label:v.label,color:v.color,price:lt(t.hostPrices_,v.key,null,v.price??v.tiers?.[0]?.price??0),available:r[v.key]??0,...Object.prototype.hasOwnProperty.call(r,v.key)?{free:r[v.key]}:{},tiers:(v.tiers??[]).map(M=>({id:M.id,name:M.name,price:lt(t.hostPrices_,v.key,M.id,M.price),...M.currency?{currency:M.currency}:{}}))})),zones:(i?.zones??[]).map(v=>({id:v.id,label:v.label,...v.color?{color:v.color}:{}})),sections:[...T.values()],gaAreas:s,bestAvailableZones:n.getBestAvailableZones()},map:{floors:a,activeFloorId:n.getActiveFloorId()||a[0]?.id||null,floorMode:n.isFloorOverview()?"all":"single",floorLabelStyle:n.getRenderer()?.getFloorLabelStyle?.()??"number",rung:n.getRung(),canZoomOut:di(n)||t.focusedSection_!==null,...Xu(n),focusedSectionId:n.getFocusedSection(),focusedSection:t.focusedSection_,viewMode:n.getViewMode(),buyerView:e.buyerView,view3dTargetSeatId:p.targetSeatId,view3dTargetSeat:u,view3dPreviousSeatId:p.previousSeatId,view3dNextSeatId:p.nextSeatId,view3dFocusedSectionId:e.focusedSectionId,view3dNavigationMode:e.navigationMode,colorblindSafe:t.colorblindSafe_,viewportInsets:n.getViewportInsets(),categoryFilter:t.categoryFilter_?[...t.categoryFilter_]:null,accessibilityFilter:t.accessibilityFilter_?[...t.accessibilityFilter_]:null,hideLimitedView:t.hideLimitedView_,accessNeeds:c},selection:{seats:n.getSelection().map(v=>{let M=t.hostPrices_||t.hostObjects_?{...v,price:fo({prices:t.hostPrices_,objects:t.hostObjects_,seatPrices:i?.seatPrices},v.label,v.categoryKey,v.tierId,v.price)}:v,F=h.get(M.id);if(!F)return M;let X=n.worldToScreen({x:F.x,y:F.y}),g=Mn(F),_=b?wo(F,F.focalPoint??i?.focalPoint):null;return{...M,screenPoint:{x:X.x,y:X.y},...g?{seatViewThumb:{reference:g,kind:"real"}}:{},..._!=null?{sightlineMetres:_}:{},...F.confidenceEvidence?{seatViewConfidence:(0,_l.seatConfidenceDisclosure)(F.confidenceEvidence)}:{}}}),validity:n.getSelectionValidity(),maxSelection:t.maxSelection_},access:{...t.accessState_}}}var Ju="https://api.seatlayer.io",Dl=10;function em(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 xo=class{constructor(e){this.renderErrorEmitted=!1;this.mount=null;this.hostEl=null;this.interactionEnabled_=!0;this.eventLocale=null;this.localeGeneration=0;this.languageSelect=null;this.rendered=!1;this.mode_=null;this.eventInfo=null;this.categoryFilter_=null;this.accessibilityFilter_=null;this.hideLimitedView_=!1;this.focusedSection_=null;this.lastReportedViewRung_=null;this.lastReportedCanZoomOut_=!1;this.tipEl=null;this.tipPos={x:0,y:0};this.onTipMove=null;this.blockedRegions=null;this.realtime=null;this.holdingLabels=new Set;if(!e||typeof e!="object")throw new Error("seatmap: options object is required");if(!e.container)throw new Error("seatmap: `container` is required");if(!e.event||typeof e.event!="string")throw new Error("seatmap: `event` key is required");this.opts=e,this.maxSelection_=e.maxSelection??Dl,this.colorblindSafe_=e.colorblindSafe??!1,this.hostPrices_=e.pricing?.prices,this.hostObjects_=e.pricing?.objects;let t=!!(e.buyerAccessTokenProvider||e.buyerAccessToken||e.publicKey);this.accessState_={configured:t,status:t?"ready":"public"},this.publicKey=e.publicKey;let i={onExpired:a=>{this.accessState_={configured:!0,status:a.refreshed?"ready":"expired"},this.opts.onAccessExpired?.(a),this.notifyMapStateChange()},onUnavailable:a=>{this.accessState_={configured:!0,status:"unavailable",reason:a.reason},this.opts.onAccessUnavailable?.(a),this.notifyMapStateChange()}},o=(e.apiBase??Ju).replace(/\/+$/,"");this.apiBase=o;let r=e.publicKey&&!e.buyerAccessTokenProvider&&!e.buyerAccessToken?io({base:o,event:e.event,publicKey:e.publicKey,accessHooks:i,apiOptions:{onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)}}):null;this.access=r?.access??xn(e,i);let s=r?.api??new bt(o,{access:this.access??void 0,onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)});this.api=s,this.chartFetch=Ji(s),this.controller=new J.PickerController({transport:this.chartFetch.transport,eventKey:e.event,maxSelection:this.maxSelection_,selectedObjects:e.selectedObjects,selectableObjects:e.selectableObjects,numberOfPlacesToSelect:e.numberOfPlacesToSelect,selectionValidators:e.selectionValidators,currency:e.currency,categoryPriceRanges:()=>this.hostPriceRanges(),seatPriceLabel:a=>this.hostSeatPriceLabel(a.label),onSelectionChange:a=>{this.immersive?.pushLiveState(),this.opts.onSelectionChange?.(a)},onSelectionValidityChange:a=>this.opts.onSelectionValidityChange?.(a),onSelectionValid:a=>this.opts.onSelectionValid?.(a),onSelectionInvalid:a=>this.opts.onSelectionInvalid?.(a),onDeselect:a=>{this.controller.currentHold()?.labels.includes(a.label)&&this.controller.releaseLabels([a.label])},retapKeepsSelection:!0,onSeatRetap:a=>this.opts.onSeatRetap?.(a),onSelectionLimit:a=>this.opts.onSelectionLimit?.(a),onHold:a=>this.opts.onHold?.({holdId:a.holdId,expiresAt:a.expiresAt,seats:a.seats,items:a.items}),onHoldRestored:a=>this.opts.onHoldRestored?.({holdId:a.holdId,expiresAt:a.expiresAt,seats:a.seats,items:a.items}),onHoldExpired:()=>this.opts.onHoldExpired?.(),onGAClick:a=>{let l=this.controller.getGAAreas().find(c=>c.id===a);l&&(this.opts.onGAClick?.(l),this.opts.onGAPrompt?.(hl(l,{room:(this.opts.maxSelection??Dl)-this.controller.getSelection().length,wheelchairOnly:this.controller.getAccessibilityFilter()?.includes("wheelchair")===!0,hold:(c,d)=>{this.holdGA(l.id,c,d?{tierId:d}:{})}})))},onError:a=>{this.renderErrorEmitted=!0,this.opts.onError?.(a)},onDeckTap:a=>{this.opts.onDeckTap?.(a),this.notifyMapStateChange()},onHint:a=>this.opts.onHint?.(a),onSectionFocus:a=>{this.focusedSection_=a,this.opts.onSectionFocus?.(a),this.notifyMapStateChange()},onViewChange:()=>this.handleViewChange(),onStatusChange:()=>{this.immersive?.pushLiveState(),this.opts.onStatusChange?.()},onSalesClosed:()=>{this.eventInfo&&(this.eventInfo.salesClosed=!0),this.opts.onSalesClosed?.()},flashOnLiveChange:!0,onSeatHover:a=>{this.opts.onSeatHover?.(a),this.opts.seatTooltip!==!1&&this.updateTooltip(a)},colorblindSafe:e.colorblindSafe,mapTheme:e.mapTheme??ci.groundFor(e.theme?.mode)??null}),this.hostSurface=new ci({mapTheme:()=>this.opts.mapTheme,setHostMapTheme:a=>{this.opts.mapTheme=a},applyMapTheme:a=>this.controller.setMapTheme(a),applyViewportInsets:a=>this.controller.setViewportInsets(a),readViewportInsets:()=>this.controller.getViewportInsets(),changed:()=>this.notifyMapStateChange()},e.theme?.mode??null),this.buyerAssetUrls=new An(e.event,(a,l)=>s.asset(a,l)),this.immersive=new uo({host:()=>this.hostEl,doc:()=>this.controller.doc,seats:()=>this.controller.getExpandedSeats(),selection:()=>this.controller.getSelection(),status:a=>this.controller.getStatus(a),select:a=>this.controller.select([a]),deselect:a=>this.controller.deselect([a]),loadEventConfiguration:()=>this.controller.loadEventConfiguration(),resolveAsset:a=>this.buyerAssetUrls.resolve(a),enable3D:e.enable3D!==!1,enableSeatView:e.enableSeatView!==!1,max3DSeats:e.max3DSeats,...e.chrome?{chrome:e.chrome}:{},restoreMap:()=>this.controller.refitCurrentView(),onViewChange:(a,l)=>{this.opts.onBuyerViewChange?.({view:a,...l?{seatId:l}:{}}),this.notifyMapStateChange()},onSeatViewChange:a=>this.opts.onSeatViewChange?.(a),onError:a=>this.opts.onError?.(a)}),this.lastReportedViewRung_=this.controller.getRung(),this.lastReportedCanZoomOut_=di(this.controller)}handleViewChange(){this.opts.onViewChange?.();let e=this.controller.getRung(),t=di(this.controller);e===this.lastReportedViewRung_&&t===this.lastReportedCanZoomOut_||(this.lastReportedViewRung_=e,this.lastReportedCanZoomOut_=t,this.opts.onMapStateChange?.())}notifyMapStateChange(){this.lastReportedViewRung_=this.controller.getRung(),this.lastReportedCanZoomOut_=di(this.controller),this.opts.onMapStateChange?.()}async render(){if(this.rendered)return this;let e=performance.now();this.rendered=!0;let t=Yi(this.opts.locale,this.opts.messages),i=this.localeGeneration+=1,o=(0,J.getLocale)();this.mount=em(this.opts.container);let r=document.createElement("div");r.style.width="100%",r.style.height="100%",r.style.position="relative",this.mount.appendChild(r),this.hostEl=r,this.blockedRegions?.attach(r),Xi(r,t,a=>{a!==o&&this.applyActiveLocale(a,i)}),this.applyInteractionState(),this.renderErrorEmitted=!1;let s=await this.controller.render(r);if(!s){let a=eo(this.chartFetch?.outcome(),this.renderErrorEmitted);return a&&to({apiBase:this.apiBase,eventKey:this.opts.event,reason:a}),Qe({apiBase:this.apiBase,event:this.opts.event,scope:"event",surface:"seating_chart",outcome:"failure",stage:"load_chart",ms:performance.now()-e,load:ot(this.opts.event),transport:"pubapi"}),this.rendered=!1,this.opts.errorDisplay!=="none"&&this.showLoadFailure(r),this}if(this.eventLocale=s.locale??null,!this.opts.locale&&this.eventLocale&&this.setLocale(this.eventLocale),this.buildLanguageSwitcher(r),this.controller.setViewMode(this.opts.initialView??"flat"),this.opts.floorLabelStyle&&this.setFloorLabelStyle(this.opts.floorLabelStyle),this.startRealtime(),this.mode_=s.mode==="test"?"test":"live",this.eventInfo={name:s.eventName,venue:s.venue??null,startsAt:s.startsAt??null,timezone:s.timezone??null,currency:s.currency??this.opts.currency??"USD",posterUrl:s.posterUrl??null,salesClosed:s.salesClosed},this.opts.seatTooltip!==!1){let a=document.createElement("div");a.setAttribute("role","tooltip"),a.style.cssText='position:absolute;z-index:7;pointer-events:none;display:none;max-width:240px;background:#10162a;color:#fff;border-radius:10px;padding:9px 12px;font:500 12px/1.45 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;box-shadow:0 10px 30px -10px rgba(0,0,0,.5);',r.appendChild(a),this.tipEl=a,this.onTipMove=l=>{let c=r.getBoundingClientRect();this.tipPos={x:l.clientX-c.left,y:l.clientY-c.top},this.tipEl&&this.tipEl.style.display!=="none"&&this.placeTooltip()},r.addEventListener("mousemove",this.onTipMove)}if(s.mode==="test"&&this.opts.showTestModeIndicator!==!1){r.style.overflow="hidden";let a=document.createElement("div");a.dataset.slI18n="testMode",a.textContent=(0,J.t)("picker.testMode"),a.setAttribute("aria-label",(0,J.t)("picker.testMode")),a.style.cssText="position:absolute;top:18px;right:-34px;z-index:6;transform:rotate(45deg);width:140px;text-align:center;padding:4px 0;background:#f4b740;color:#1a1200;font:800 10.5px/1.4 -apple-system,BlinkMacSystemFont,sans-serif;letter-spacing:.12em;box-shadow:0 2px 8px rgba(0,0,0,.25);pointer-events:none;",r.appendChild(a)}return this.buildBadge(r),Qe({apiBase:this.apiBase,event:this.opts.event,scope:"event",surface:"seating_chart",outcome:"success",ms:performance.now()-e,performanceProfile:s.performanceProfile,seats:this.controller.getExpandedSeats().length,floors:this.controller.getFloors().length,view:"map",load:Hi(this.opts.event),transport:"pubapi"}),this}buildBadge(e){if(this.controller.doc?.theme?.hideBadge)return;let t=document.createElement("a");t.dataset.slI18n="badge",t.href="https://seatlayer.io",t.target="_blank",t.rel="noopener noreferrer",t.setAttribute("aria-label",(0,J.t)("picker.poweredBy")),t.style.cssText='position:absolute;bottom:10px;right:12px;z-index:5;display:inline-flex;align-items:center;gap:6px;padding:5px 9px;border-radius:999px;background:rgba(255,255,255,.92);color:#4a5163;text-decoration:none;font:600 11px/1 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;letter-spacing:.02em;box-shadow:0 2px 8px rgba(0,0,0,.12);';let i=document.createElement("span");i.setAttribute("aria-hidden","true"),i.style.cssText="width:16px;height:16px;border-radius:4px;flex:none;display:flex;align-items:center;justify-content:center;background:#0c1220;color:#fcf7ee",i.innerHTML=lo;let o=document.createElement("span");o.textContent=(0,J.t)("picker.poweredBy"),t.append(i,o),e.appendChild(t)}placeTooltip(){if(!this.tipEl||!this.hostEl)return;let e=this.hostEl.clientWidth,t=this.tipEl.offsetWidth,i=this.tipEl.offsetHeight,o=this.tipPos.x+14,r=this.tipPos.y-i-12;o+t>e-8&&(o=this.tipPos.x-t-14),r<8&&(r=this.tipPos.y+18),this.tipEl.style.left=`${Math.max(8,o)}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,J.formatMoney)(e.price,e.currency,{...Number.isInteger(e.price)?{minimumFractionDigits:0,maximumFractionDigits:0}:{},locale:this.opts.locale,fallback:(l,c)=>`${l} ${c}`}),i=document.createElement("div");i.style.cssText="font-weight:700;font-size:13px",i.textContent=e.label;let o=document.createElement("div");o.style.cssText="display:flex;align-items:center;gap:6px;margin-top:4px;color:#c7cddc";let r=document.createElement("span");r.style.cssText="width:9px;height:9px;border-radius:50%;flex:none",r.style.background=e.categoryColor;let s=document.createElement("span");s.textContent=e.categoryLabel;let a=document.createElement("span");if(a.style.cssText="margin-left:auto;font-weight:700;color:#fff",a.textContent=t,o.append(r,s,a),this.tipEl.replaceChildren(i,o),e.status!=="free"){let l=document.createElement("div");l.style.cssText="margin-top:5px;font-size:10.5px;letter-spacing:.08em;text-transform:uppercase;color:#fca5a5;font-weight:700",l.textContent=(0,J.t)("picker.group.legendUnavailable"),this.tipEl.appendChild(l)}this.tipEl.style.display="block",this.placeTooltip()}buildLanguageSwitcher(e){let t=(this.opts.languages??[]).map(o=>(0,J.resolveLocale)(o)).filter((o,r,s)=>s.indexOf(o)===r);if(t.length<2)return;let i=document.createElement("select");i.setAttribute("aria-label",(0,J.t)("picker.preferredTicketType")),i.style.cssText='position:absolute;bottom:10px;left:12px;z-index:5;appearance:none;padding:5px 9px;border-radius:999px;border:0;cursor:pointer;background:rgba(255,255,255,.92);color:#4a5163;font:600 11px/1 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;box-shadow:0 2px 8px rgba(0,0,0,.12);';for(let o of t){let r=document.createElement("option");r.value=o,r.textContent=J.LOCALE_NAMES[o]??o,r.selected=o===(0,J.getLocale)(),i.appendChild(r)}i.addEventListener("change",()=>{this.setLocale(i.value)}),e.appendChild(i),this.languageSelect=i}async setLocale(e){let t=(0,J.getLocale)(),i=this.localeGeneration+=1,o=await(0,J.loadLocale)(e);return this.opts.messages&&(0,J.setStringOverrides)(this.opts.messages),o===t||this.applyActiveLocale(o,i),o}applyActiveLocale(e,t){if(t!==this.localeGeneration)return;let i=this.hostEl;if(i){i.lang=e,i.dir=(0,J.localeDirection)(e);for(let o of i.querySelectorAll("[data-sl-i18n]"))if(o.dataset.slI18n==="testMode")o.textContent=(0,J.t)("picker.testMode"),o.setAttribute("aria-label",(0,J.t)("picker.testMode"));else if(o.dataset.slI18n==="badge"){o.setAttribute("aria-label",(0,J.t)("picker.poweredBy"));let r=o.querySelector("span:last-child");r&&(r.textContent=(0,J.t)("picker.poweredBy"))}this.languageSelect&&this.languageSelect.value!==e&&(this.languageSelect.value=e),this.controller.refreshMapCopy()}}getMode(){return this.mode_}getPickerState(){return Nl(this.controller,this.immersive,{event:this.opts.event,currency:this.opts.currency,mode_:this.mode_,eventInfo:this.eventInfo,eventLocale:this.eventLocale,focusedSection_:this.focusedSection_,colorblindSafe_:this.colorblindSafe_,categoryFilter_:this.categoryFilter_,accessibilityFilter_:this.accessibilityFilter_,hideLimitedView_:this.hideLimitedView_,maxSelection_:this.maxSelection_,accessState_:this.accessState_,hostPrices_:this.hostPrices_,hostObjects_:this.hostObjects_})}getHostPrices(){return this.hostPrices_}getHostPricing(){return{prices:this.hostPrices_,objects:this.hostObjects_,seatPrices:this.controller.doc?.seatPrices}}getCategoryAvailability(){return this.controller.categoryAvailability()}getBestAvailableZones(){return this.controller.getBestAvailableZones()}getActiveFloorId(){return this.controller.getActiveFloorId()||null}getRung(){return this.controller.getRung()}getFocusedSection(){return this.controller.getFocusedSection()}focusSection(e){if(this.immersive.buyerView==="venue3d"&&this.immersive.focusSection(e)){this.notifyMapStateChange();return}this.controller.focusSection(e),this.notifyMapStateChange()}overview(){if(this.immersive.focusOverview()){this.notifyMapStateChange();return}this.controller.overview(),this.notifyMapStateChange()}setRung(e){this.controller.setRung(e),this.notifyMapStateChange()}setCategoryFilter(e,t=!1){this.categoryFilter_=e?[...e]:null,this.controller.setCategoryFilter(e),t&&this.controller.focusCategoryFilter(e),this.notifyMapStateChange()}setAccessibilityFilter(e){this.accessibilityFilter_=e?[...e]:null,this.controller.setAccessibilityFilter(e),this.notifyMapStateChange(),e?.length&&this.focusAccessibilityFilter()}focusAccessibilityFilter(){this.controller.focusAccessibilityFilter?.(),this.notifyMapStateChange()}focusNextAccessibleSection(e){let t=this.controller.focusNextAccessibleSection?.(e)??null;return t&&this.notifyMapStateChange(),t}setCommercialLimitedFilter(e){this.hideLimitedView_=e,this.controller.setCommercialLimitedFilter(e),this.notifyMapStateChange()}getSelection(){return this.controller.getSelection()}selectObjects(e){let t=this.controller.select(e);return this.immersive.pushLiveState(),t}deselectObjects(e){this.controller.deselect(e),this.immersive.pushLiveState()}clearSelection(){this.controller.clearSelection(),this.immersive.pushLiveState()}selectCategories(e){return this.controller.selectCategories(e)}deselectCategories(e){this.controller.deselectCategories(e)}setSelectableObjects(e){this.controller.setSelectableObjects(e)}setMaxSelection(e){this.maxSelection_=e,this.controller.setMaxSelection(e),this.notifyMapStateChange()}getSelectionValidity(){return this.controller.getSelectionValidity()}async hold(e={}){try{return await this.holdOrThrow(e)}catch(t){return this.opts.onError?.(t),null}}async holdOrThrow(e={}){let t=this.controller.getSelectionValidity();if(t&&!t.isValid){let i=t.violations.includes("numberOfPlacesToSelect");throw Object.assign(new Error(i?`seatmap: select exactly ${t.required} places before holding`:"seatmap: adjust the ticket selection before holding"),{code:i?"selection_count_mismatch":"selection_invalid",selection:t})}this.holdingLabels=new Set(this.controller.getSelection().map(i=>i.label));try{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}finally{this.holdingLabels.clear()}}async resumeHold(e){try{return await this.resumeHoldOrThrow(e)}catch(t){return this.opts.onError?.(t),null}}async resumeHoldOrThrow(e){let t=await this.controller.resumeHold(e);return t?{holdId:t.holdId,expiresAt:t.expiresAt,seats:t.seats,items:t.items}:null}async extendHold(e){try{let t=await this.controller.extendHold(e);return t?{holdId:t.holdId,expiresAt:t.expiresAt,seats:t.seats,items:t.items}:null}catch(t){return this.opts.onError?.(t),null}}getCurrentHold(){let e=this.controller.currentHold();return e?{holdId:e.holdId,expiresAt:e.expiresAt,seats:e.seats,items:e.items}:null}getGAAreas(){return this.controller.getGAAreas()}async holdGA(e,t,i={}){try{return await this.holdGAOrThrow(e,t,i)}catch(o){return this.opts.onError?.(o),null}}async holdGAOrThrow(e,t,i={}){let o=await this.controller.holdGA(e,t,i);return o?{holdId:o.holdId,expiresAt:o.expiresAt,seats:o.seats,items:o.items}:null}async bestAvailable(e,t,i={}){try{return await this.bestAvailableOrThrow(e,t,i)}catch(o){return this.opts.onError?.(o),null}}async bestAvailableOrThrow(e,t,i={}){let o=Ki(this.controller,t);if(o)throw o;let r=await this.controller.bestAvailable(e,t,i);return Ml(this.controller,r),r?{holdId:r.holdId,expiresAt:r.expiresAt,labels:r.labels,seats:r.seats,items:r.items,...i.zoneId?{zoneId:i.zoneId}:{}}:null}setSeatTier(e,t){this.controller.setSeatTier(e,t)}setTableQuantity(e,t){return this.controller.setTableQuantity(e,t)}async replaceTableQuantity(e,t,i){try{return await this.replaceTableQuantityOrThrow(e,t,i)}catch(o){return this.opts.onError?.(o),null}}async replaceTableQuantityOrThrow(e,t,i){let o=await this.controller.replaceTableQuantity(e,t,i);return o?{holdId:o.holdId,expiresAt:o.expiresAt,seats:o.seats,items:o.items}:null}getFloors(){return this.controller.getFloors()}setFloor(e){if(this.immersive.buyerView==="venue3d"&&e!=="all"&&this.immersive.focusFloor(e)){this.notifyMapStateChange();return}if(this.controller.getFloors().length<=1){console.warn("seatmap: setFloor() ignored \u2014 this chart has a single floor");return}e==="all"?this.controller.setFloorOverview(!0):this.controller.setFloor(e),this.notifyMapStateChange()}setFloorLabelStyle(e){this.controller.getRenderer()?.setFloorLabelStyle?.(e),this.notifyMapStateChange()}setSectionFocusDim(e){this.controller.setSectionFocusDim(e)}setSelectionFocus(e){this.controller.setSelectionFocus(e)}setBlockedRegions(e){if(!this.blockedRegions){if(!e.length)return;this.blockedRegions=new bo,this.hostEl&&this.blockedRegions.attach(this.hostEl)}this.blockedRegions.set(e)}getBlockedRegions(){return this.blockedRegions?.get()??[]}frameSeat(e,t={}){let i=this.controller.getRenderer();return Rl({seatPoint:o=>{let r=this.controller.getExpandedSeats().find(s=>s.id===o);return r?this.controller.worldToScreen({x:r.x,y:r.y}):null},mapHeight:()=>this.hostEl?.clientHeight??0,insets:()=>this.controller.getViewportInsets(),gestureCount:()=>i?.getCameraGestureCount?.()??0,panScreenBy:(o,r)=>i?.panScreenBy?(i.panScreenBy(o,{animate:r}),!0):!1},e,t)}setPricing(e){let t=e?.prices&&Object.keys(e.prices).length?e.prices:void 0,i=e?.objects&&Object.keys(e.objects).length?e.objects:void 0;JSON.stringify([t??null,i??null])!==JSON.stringify([this.hostPrices_??null,this.hostObjects_??null])&&(this.hostPrices_=t,this.hostObjects_=i,this.controller.getRenderer()?.setCategoryPriceRanges?.(this.hostPriceRanges()),this.notifyMapStateChange())}hostSeatPriceLabel(e){let t=(0,J.seatPriceEntry)(this.hostObjects_,e);if(t===void 0)return;let i=typeof t=="number"?[t]:Object.values(t.tiers);if(!i.length)return;let o=this.eventInfo?.currency??this.opts.currency??"USD",r=Math.min(...i),s=Math.max(...i);return s>r?`${(0,J.formatMoney)(r,o)}\u2013${(0,J.formatMoney)(s,o)}`:(0,J.formatMoney)(r,o)}hostPriceRanges(){let e=this.hostPrices_;if(e)return Object.fromEntries((this.controller.doc?.categories??[]).flatMap(t=>{let i=t.tiers?.length?t.tiers.map(o=>lt(e,t.key,o.id,o.price)):t.price==null?[]:[lt(e,t.key,null,t.price)];return i.length?[[t.key,{min:Math.min(...i),max:Math.max(...i)}]]:[]}))}setColorblindSafe(e){this.colorblindSafe_=e,this.controller.setColorblindSafe(e),this.notifyMapStateChange()}setViewMode(e){this.controller.setViewMode(e),this.notifyMapStateChange()}getViewMode(){return this.controller.getViewMode()}zoomIn(){this.immersive.zoomIn()||(this.controller.zoomIn(),this.notifyMapStateChange())}zoomOut(){this.immersive.zoomOut()||(this.controller.zoomOut(),this.notifyMapStateChange())}zoomToFit(){this.immersive.focusOverview()||(this.controller.zoomToFit(),this.notifyMapStateChange())}setThemeMode(e,t){this.hostSurface.setThemeMode(e,t)}getThemeMode(){return this.hostSurface.themeMode()}setViewportInsets(e){this.hostSurface.setViewportInsets(e)}getViewportInsets(){return this.hostSurface.viewportInsets()}setBuyerView(e,t){return this.immersive.setBuyerView(e,t)}getBuyerView(){return this.immersive.buyerView}openSeatView(e){return this.immersive.openSeatView(e)}setVenue3DNavigationMode(e){if(!this.immersive.setNavigationMode(e))throw new Error("venue_3d_not_active")}setInteractionEnabled(e){this.interactionEnabled_=e,this.applyInteractionState()}applyInteractionState(){let e=this.hostEl;e&&(e.style.pointerEvents=this.interactionEnabled_?"":"none",e.toggleAttribute("inert",!this.interactionEnabled_),this.interactionEnabled_?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden","true"))}async release(){await this.controller.release()}async releaseLabels(e){return this.controller.releaseLabels(e)}startRealtime(){!this.access?.configured||this.realtime||(this.realtime=new Ze({url:this.api.subscribeUrl(this.opts.event),mintTicket:()=>this.api.subscribeTicket(this.opts.event),onAccessUnavailable:e=>this.opts.onAccessUnavailable?.(e),sink:cn(this.controller,{flashOnLiveChange:!0,ownLabels:()=>this.holdingLabels,onStatusChange:()=>{this.immersive.pushLiveState(),this.opts.onStatusChange?.()},onSelectedObjectUnavailable:(e,t)=>this.opts.onSelectedObjectUnavailable?.({labels:e,reason:t})})}),this.realtime.start())}async refreshAvailability(){let e=await this.controller.refreshAvailability();return this.immersive.pushLiveState(),this.opts.onStatusChange?.(),e.lost.length&&this.opts.onSelectedObjectUnavailable?.({labels:e.lost,reason:"taken"}),this.notifyMapStateChange(),e}async refreshAccess(){if(!this.access?.configured)return!1;let e=await this.access.refresh("manual");return e&&(this.accessState_={configured:!0,status:"ready"},await this.controller.refresh(),this.realtime?.restart(),this.realtime||this.startRealtime()),this.notifyMapStateChange(),e}showLoadFailure(e){let t=document.createElement("div");t.setAttribute("role","status"),t.style.cssText='display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;width:100%;height:100%;min-height:180px;box-sizing:border-box;padding:24px;text-align:center;font:500 14px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#3b4256;';let i=document.createElement("div");i.textContent="The seat map didn\u2019t load.",t.appendChild(i);let o=document.createElement("button");o.type="button",o.textContent="Try again",o.style.cssText="appearance:none;border:1px solid #c9cede;background:#fff;color:#10162a;border-radius:8px;padding:8px 16px;font:600 13px/1 inherit;cursor:pointer;",o.addEventListener("click",()=>{this.destroy(),this.render().catch(r=>this.opts.onError?.(r))}),t.appendChild(o),e.appendChild(t)}destroy(){this.blockedRegions?.detach(),this.hostSurface.dispose(),this.immersive.destroy(),this.buyerAssetUrls.dispose(),this.realtime?.stop(),this.realtime=null,this.access?.clear(),this.hostEl&&this.onTipMove&&this.hostEl.removeEventListener("mousemove",this.onTipMove),this.tipEl=null,this.onTipMove=null,this.languageSelect=null,this.controller.destroy(),this.hostEl&&this.hostEl.parentNode&&this.hostEl.parentNode.removeChild(this.hostEl),this.hostEl=null,this.mount=null,this.rendered=!1,this.mode_=null,this.eventInfo=null,this.focusedSection_=null}};var Cr=["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"],tm={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 Bl(n){let e={};for(let t of Cr)e[t]=(...i)=>{let o=n();return o?o[t](...i):tm[t]()};return e}var Ar=["event","apiBase","maxSelection","numberOfPlacesToSelect","selectionValidators","publicKey","locale","currency","colorblindSafe","initialView","errorDisplay"],Pr=[...Ar,"selectedObjects","selectableObjects","messages","seatTooltip","buyerAccessTokenProvider","buyerAccessToken"],Mr=["onSelectionChange","onSelectionValidityChange","onSelectionValid","onSelectionInvalid","onSelectionLimit","onHold","onHoldRestored","onHoldExpired","onGAClick","onGAPrompt","onError","onDeckTap","onHint","onSeatHover","onAccessExpired","onAccessUnavailable","onSelectedObjectUnavailable"];function Fl(n,e,t){let i={container:n};for(let o of Pr)i[o]=e[o];for(let o of Mr)i[o]=t[o];return i}var nm=new Set(["seatlayer.designer.ready","seatlayer.designer.saved","seatlayer.designer.published","seatlayer.designer.close","seatlayer.designer.error"]),im=2e4,om=0,rm=180*1e3,sm=900*1e3,am=.8,lm=30*1e3,cm=1e5,dm=4,pm=50;function Lr(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 hm(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 um={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."}},ko=class{constructor(e){this.frame=null;this.designerOrigin="";this.overlay=null;this.timeoutTimer=null;this.renewTimer=null;this.autoRecoverUsed=!1;this.phase="loading";this.identityEstablished=!1;this.restoreContainerPosition=null;this.pinned=!1;this.frameStyleBeforeFs=null;this.docOverflowBeforeFs=null;this.bodyOverflowBeforeFs=null;this.fsKeyHandler=null;this.lastAutoHeight="";this.fillRaf=null;this.reprobeRaf=null;this.fillListening=!1;this.containerEl=null;this.fillMode=null;this.resizeObs=null;this.scheduleFill=()=>{this.fillRaf===null&&(this.fillRaf=requestAnimationFrame(()=>{this.fillRaf=null,this.applyFill()}))};this.scheduleReprobe=()=>{this.reprobeRaf===null&&(this.reprobeRaf=requestAnimationFrame(()=>{this.reprobeRaf=null,!this.pinned&&(this.fillMode=this.detectFillMode(),this.syncContainerObserver(),this.applyFill())}))};this.handleMessage=e=>{if(!this.frame||e.origin!==this.designerOrigin||e.source!==this.frame.contentWindow||!e.data||typeof e.data!="object")return;let t=e.data;if(t.type==="seatlayer.designer.handshake"&&typeof t.nonce=="string"&&t.nonce.length<=128){this.frame.contentWindow?.postMessage({type:"seatlayer.designer.parent",nonce:t.nonce},this.designerOrigin);return}if(t.type==="seatlayer.designer.resize"){!this.fillEnabled()&&this.autoResizeEnabled()&&typeof t.px=="number"&&Number.isFinite(t.px)&&t.px>0&&(this.lastAutoHeight=`${Math.round(t.px)}px`,this.pinned||this.setFrameHeight(this.lastAutoHeight));return}if(t.type==="seatlayer.designer.fullscreen"){t.on===!0?this.pinFullscreen():t.on===!1&&this.unpinFullscreen();return}if(typeof t.type!="string"||!nm.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},o=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&&(o||i.chartId!==void 0),s=this.options.expectedWorkspaceId!==void 0&&i.workspaceId!==this.options.expectedWorkspaceId&&(o||i.workspaceId!==void 0);if(r||s){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=hm(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=Lr(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 o=this.options.loadingTimeoutMs??im;o>0&&Number.isFinite(o)&&(this.timeoutTimer=setTimeout(()=>{this.phase==="loading"&&this.showError("timeout")},o))}return t}setDesignerUrl(e){return this.options={...this.options,designerUrl:e},this.mount()}getIframe(){return this.frame}setSizing(e,t){this.options={...this.options,height:e,minHeight:t},this.frame&&(this.stopFill(),this.lastAutoHeight="",this.fillEnabled()?(this.pinned||this.setFrameHeight("100%"),this.startFill()):this.pinned||this.setFrameHeight(`${e}px`))}setRelaunchPolicy(e,t){this.options={...this.options,onRequestRelaunch:e,autoRenewSession:t},this.clearRenewTimer(),this.phase==="ready"&&this.scheduleRenewal(this.sessionExpiresAt)}destroy(){window.removeEventListener("message",this.handleMessage),this.stopFill(),this.unpinFullscreen(),this.clearTimeoutTimer(),this.clearRenewTimer(),this.removeOverlay(),this.restoreContainerStyle(),this.frame?.remove(),this.frame=null,this.containerEl=null,this.fillMode=null,this.designerOrigin="",this.phase="loading",this.identityEstablished=!1,this.sessionExpiresAt=void 0,this.lastAutoHeight=""}loadingStateEnabled(){return this.options.showLoadingState!==!1}autoResizeEnabled(){return this.options.autoResize!==!1}fillEnabled(){return typeof this.options.height!="number"}setFrameHeight(e){this.frame?.style.setProperty("height",e,"important")}detectFillMode(){let e=this.containerEl,t=this.frame;if(this.pinned||!e||!t)return this.fillMode??"viewport";let i=()=>e.getBoundingClientRect().height,o=t.style.getPropertyValue("height"),r=t.style.getPropertyPriority("height");t.style.setProperty("height","0px","important");let s=i();t.style.setProperty("height",`${cm}px`,"important");let a=i();return o?t.style.setProperty("height",o,r):t.style.removeProperty("height"),!(a-s>dm)&&s>=pm?"container":"viewport"}applyFill(){if(!this.frame||this.pinned)return;let e=this.options.minHeight??om;if(this.fillMode==="container"&&this.containerEl){let o=getComputedStyle(this.containerEl),r=["paddingTop","paddingBottom","borderTopWidth","borderBottomWidth"].reduce((a,l)=>a+(parseFloat(o[l])||0),0),s=Math.max(e,Math.floor(this.containerEl.getBoundingClientRect().height-r));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,o]of Object.entries(e))this.frame.style.setProperty(i,o,"important");let t=document.documentElement;this.docOverflowBeforeFs=t.style.overflow,t.style.overflow="hidden",document.body&&(this.bodyOverflowBeforeFs=document.body.style.overflow,document.body.style.overflow="hidden"),this.fsKeyHandler=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<sm?t*am:t-rm,o=Math.max(lm,i);this.renewTimer=setTimeout(()=>{this.renewTimer=null,this.autoRenewEnabled()&&this.options.onRequestRelaunch()},o)}ensureContainerPositioned(e){getComputedStyle(e).position==="static"&&(this.restoreContainerPosition=e.style.position,e.style.position="relative")}restoreContainerStyle(){if(this.restoreContainerPosition!==null){try{Lr(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=Lr(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 o=document.createElement("div");o.setAttribute("data-seatlayer-designer-overlay",t),o.setAttribute("role",t==="error"?"alert":"status"),o.setAttribute("aria-live","polite"),Object.assign(o.style,{position:"absolute",inset:"0",display:"flex",alignItems:"center",justifyContent:"center",background:t==="loading"?"#f7f8fb":"#101625",color:t==="loading"?"#0c1220":"#e6ebf5",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif',zIndex:"2",overflow:t==="error"?"auto":"hidden"}),t==="loading"?this.buildSkeleton(o):this.buildErrorCard(o,i??"load"),e.append(o),this.overlay=o}buildSkeleton(e){let t=document.createElement("style");t.textContent=`
3517
+ `;function yt(){if(document.getElementById(mc))return;let n=document.createElement("style");n.id=mc,n.textContent=Qm+cc+lc+oc+dc+sc+ac+uc+rc+$l,document.head.appendChild(n)}async function Vo(n,e){let t=n.overlay.productionElements;if(!t?.some(o=>o.contentImageUrl))return n;let i=await Promise.all(t.map(async o=>{if(!o.contentImageUrl)return o;try{let r=await e(o.contentImageUrl);if(!r){let{contentImageUrl:s,...a}=o;return a}return{...o,runtimeContentImageUrl:r}}catch{let{contentImageUrl:r,...s}=o;return s}}));return{...n,overlay:{...n.overlay,productionElements:i}}}async function $o(n,e){if(n)try{let t=await e(n);return t?await(await fetch(t)).arrayBuffer():void 0}catch{return}}var Ot=require("@seatlayer/core/view/panoramaDelivery");function zo(n){let{root:e,source:t,caption:i,real:o,closeLabel:r,dragHint:s,viewFromSeatLabel:a,real360Label:l,previewLabel:c,resolveAsset:d,onClose:p}=n,m=n.chrome??{},u=document.createElement("div");u.className="sl-view sl-mo-zoom",u.setAttribute("role","dialog"),u.setAttribute("aria-label",a),u.innerHTML='<div class="sl-view-head"><span class="sl-view-title"></span><span class="sl-view-cap"></span><button type="button" class="sl-view-x"><svg viewBox="0 0 24 24"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg></button></div><div class="sl-view-pano"><span class="sl-view-badge"></span><span class="sl-view-hint"></span></div>';let f=S=>u.querySelector(S)?.remove();m.title===!1?f(".sl-view-title"):u.querySelector(".sl-view-title").textContent=a,m.caption===!1?f(".sl-view-cap"):u.querySelector(".sl-view-cap").textContent=i,u.querySelector(".sl-view-x").setAttribute("aria-label",r),m.badge===!1?f(".sl-view-badge"):u.querySelector(".sl-view-badge").textContent=o?l:c,u.querySelector(".sl-view-hint").textContent=s,e.appendChild(u);let b=u.querySelector(".sl-view-pano"),T=(0,Ot.planPanoramaDelivery)(t,(0,Ot.browserPanoramaConstraints)()),E=new AbortController;b.style.backgroundImage=`url(${JSON.stringify(T.initialUrl)})`;let v=()=>{};T.upgradeUrl&&(v=(0,Ot.schedulePanoramaUpgrade)(()=>{d(T.upgradeUrl).then(S=>!S||E.signal.aborted?null:(0,Ot.loadPanoramaImage)(S,E.signal).then(()=>S)).then(S=>{!S||!u.isConnected||E.signal.aborted||(b.style.backgroundImage=`url(${JSON.stringify(S)})`)}).catch(()=>{})}));let M=70,F=35,Q=1,N=b.clientHeight||1,g=b.clientWidth||1,O=-(N*(180/M)*2/2-g/2),R=0,V=()=>{let S=b.clientHeight||1,A=S*(180/M)*Q,B=Math.max(0,A-S),ee=Math.min(B/2,F/180*A);R=Math.min(ee,Math.max(-ee,R)),b.style.backgroundSize=`auto ${A}px`,b.style.backgroundPosition=`${O}px ${R-B/2}px`};V();let z=!1,D=0,ne=0,J=S=>{z=!0,D=S.clientX,ne=S.clientY,b.classList.add("drag"),b.setPointerCapture?.(S.pointerId)},X=S=>{z&&(O+=S.clientX-D,R+=S.clientY-ne,D=S.clientX,ne=S.clientY,V())},xe=S=>{z=!1,b.classList.remove("drag"),b.releasePointerCapture?.(S.pointerId)},ge=S=>{S.preventDefault(),Q=Math.min(2.4,Math.max(1,Q+(S.deltaY<0?.12:-.12))),V()};b.addEventListener("pointerdown",J),b.addEventListener("pointermove",X),b.addEventListener("pointerup",xe),b.addEventListener("pointercancel",xe),b.addEventListener("wheel",ge,{passive:!1});let Ee=u.querySelector(".sl-view-x");Ee.addEventListener("click",p);let Ke=S=>{S.key==="Escape"&&(S.stopPropagation(),p())};return u.addEventListener("keydown",Ke),Ee.focus(),{element:u,dispose(){v(),E.abort(),b.removeEventListener("pointerdown",J),b.removeEventListener("pointermove",X),b.removeEventListener("pointerup",xe),b.removeEventListener("pointercancel",xe),b.removeEventListener("wheel",ge),u.removeEventListener("keydown",Ke),Ee.removeEventListener("click",p)}}}function Jm(n,e){if(!e)return{targetSeatId:null,previousSeatId:null,nextSeatId:null};let t=n.find(r=>r.id===e);if(!t?.rowId)return{targetSeatId:e,previousSeatId:null,nextSeatId:null};let i=n.filter(r=>r.rowId===t.rowId),o=i.findIndex(r=>r.id===e);return{targetSeatId:e,previousSeatId:o>0?i[o-1].id:null,nextSeatId:o>=0&&o+1<i.length?i[o+1].id:null}}var fc=6e4,jo=class{constructor(e){this.buyerView_="map";this.targetSeatId_=null;this.focusedSectionId_=null;this.navigationMode_="auto";this.overlay=null;this.handle=null;this.generation=0;this.seatViewGeneration=0;this.seatViewElement=null;this.seatViewDispose=null;this.navigationPinned_=!1;this.options=e}get buyerView(){return this.buyerView_}get targetSeatId(){return this.targetSeatId_}get focusedSectionId(){return this.focusedSectionId_}get seatPosition(){return Jm(this.options.seats(),this.targetSeatId_)}get navigationMode(){return this.navigationMode_==="auto"?"orbit":this.navigationMode_}canOffer3D(){return this.options.enable3D?this.handle&&this.overlay?!0:!this.options.doc()||!po()?!1:this.options.seats().length<=this.max3DSeats():!1}canOfferSeatView(){return this.options.enableSeatView?this.options.seats().some(e=>!!e.viewUrl)?!0:this.hasStage():!1}async setBuyerView(e,t={}){if(e==="map"){this.exit3D();return}if(!this.canOffer3D())throw new Error("venue_3d_unavailable");if(this.buyerView_==="venue3d"&&this.handle){t.flyToSeatId?(this.targetSeatId_=t.flyToSeatId,this.focusedSectionId_=this.findSeat(t.flyToSeatId)?.sectionId??null,this.options.onViewChange(this.buyerView_,this.targetSeatId_),await this.handle.flyToSeat(t.flyToSeatId)):t.resetView&&this.handle.focusOverview();return}if(this.handle&&this.overlay){await this.restore3D(t);return}await this.enter3D(t.flyToSeatId)}async openSeatView(e){if(!this.canOfferSeatView())throw new Error("seat_view_unavailable");let t=this.findSeat(e),i=this.options.host(),o=this.options.doc();if(!t||!i||!o)throw new Error("seat_view_unavailable");let r=++this.seatViewGeneration,s,a,l=!1;if(t.viewUrl){let f=t.viewMeta?.previewUrl,b=!!f&&f!==t.viewUrl,T=b?await this.options.resolveAsset(f):null,E=b?t.viewUrl:await this.options.resolveAsset(t.viewUrl);if(r!==this.seatViewGeneration||!E||b&&!T)return;s={url:E,...T?{previewUrl:T}:{},...b?{resolveUrl:this.options.resolveAsset}:{},...t.viewMeta?.sourceWidth!==void 0?{sourceWidth:t.viewMeta.sourceWidth}:{},...t.viewMeta?.sourceHeight!==void 0?{sourceHeight:t.viewMeta.sourceHeight}:{},...t.viewMeta?.previewWidth!==void 0?{previewWidth:t.viewMeta.previewWidth}:{},...t.viewMeta?.previewHeight!==void 0?{previewHeight:t.viewMeta.previewHeight}:{},...t.viewMeta?.variants?.length?{variants:t.viewMeta.variants}:{},...t.viewMeta?.coverage?{coverage:t.viewMeta.coverage}:{},...t.viewMeta?.capturedAt?{capturedAt:t.viewMeta.capturedAt}:{},...t.viewMeta?.sourceLabel?{sourceLabel:t.viewMeta.sourceLabel}:{}},a=(0,Ko.seatViewDisclosure)(s),l=(0,Ko.isAuthoredSeatView)(s)}else{if(!this.hasStage())throw new Error("seat_view_unavailable");let{generateSeatPanorama:f}=await uo();if(r!==this.seatViewGeneration)return;let b=o.floors?.find(v=>v.objects.some(M=>M.type==="row"&&M.id===t.rowId)),T=t.focalPoint??b?.focalPoint??o.focalPoint,E=f(t,T,[...this.options.seats()]);s={url:E.url,generated:!0},a=(0,_t.t)("picker.illustrationCaption",{m:E.distanceM})}if(r!==this.seatViewGeneration)return;this.closeSeatView(!1),this.prepareHostTheme(i,o),yt();let c=this.options.chrome??{},d=rn(),p=(0,_t.t)("picker.viewFromSeat",{label:t.displayLabel||t.label}),m=l?(0,_t.t)("picker.real360"):(0,_t.t)("picker.preview"),u=zo({root:i,source:s,caption:a,real:l,closeLabel:x("picker.close","Close"),dragHint:d,viewFromSeatLabel:p,real360Label:(0,_t.t)("picker.real360"),previewLabel:(0,_t.t)("picker.preview"),chrome:{title:c.seatViewTitle,caption:c.seatViewCaption,badge:c.seatViewBadge},resolveAsset:this.options.resolveAsset,onClose:()=>this.closeSeatView(!0,!0)});this.seatViewElement=u.element,this.seatViewDispose=u.dispose,this.options.onSeatViewChange?.({seatId:t.id,title:p,caption:a,badge:m,real:l,generated:!!s.generated,dragHint:d})}pushLiveState(){this.handle&&(this.handle.setAvailability(this.options.seats().map(e=>({seatId:e.id,state:this.seatState(e)}))),this.handle.setSelection(this.options.selection().map(e=>e.id)))}focusOverview(){return this.buyerView_!=="venue3d"||!this.handle?!1:(this.handle.focusOverview(),!0)}focusSection(e){return this.buyerView_==="venue3d"?this.handle?.focusSection(e)??!1:!1}focusFloor(e){let t=this.options.doc();if(this.buyerView_!=="venue3d"||!this.handle||!t?.floors?.length)return!1;let i=t.floors.findIndex(o=>o.id===e);return i>=0&&this.handle.focusFloor(i)}zoomIn(){return this.buyerView_!=="venue3d"||!this.handle?!1:(this.handle.zoomIn(),!0)}zoomOut(){return this.buyerView_!=="venue3d"||!this.handle?!1:(this.handle.zoomOut(),!0)}applyNavigationMode(e){this.navigationMode_==="auto"&&!this.navigationPinned_||e.setNavigationMode(this.navigationMode_)}setNavigationMode(e){return e!=="auto"&&(this.navigationPinned_=!0),this.navigationMode_=e,this.buyerView_!=="venue3d"||!this.handle?!1:(this.applyNavigationMode(this.handle),this.options.onViewChange(this.buyerView_,this.targetSeatId_),!0)}destroy(){this.generation+=1,this.closeSeatView(!0,!1);try{this.handle?.dispose()}catch{}this.handle=null,this.overlay?.remove(),this.overlay=null,this.buyerView_="map",this.targetSeatId_=null,this.focusedSectionId_=null}max3DSeats(){let e=this.options.max3DSeats;if(typeof e=="number"&&e>0)return e;let t=globalThis.navigator;return(t?.hardwareConcurrency??8)<=4||(t?.deviceMemory??8)<=4||(globalThis.matchMedia?.("(pointer: coarse)").matches??!1)?fc/2:fc}async enter3D(e){let t=this.options.host(),i=this.options.doc();if(!t||!i||this.overlay)throw new Error("venue_3d_unavailable");yt(),this.prepareHostTheme(t,i);let o=document.createElement("div");o.className="sl-view3d",o.setAttribute("role","group"),o.setAttribute("aria-label",x("picker.interactive3dVenueView","Interactive 3D venue view")),Object.assign(o.style,{position:"absolute",inset:"0",zIndex:"4",opacity:"0",touchAction:"none",transition:this.reducedMotion()?"none":"opacity 260ms cubic-bezier(.2,.8,.2,1)",background:"radial-gradient(120% 120% at 50% 0%,#191f28 0%,#0d1014 70%)"});let r=document.createElement("div");r.className="sl-view3d-loading",r.setAttribute("role","status"),r.setAttribute("aria-live","polite"),r.textContent=x("picker.loading3d","Building the 3D venue\u2026"),o.appendChild(r),t.appendChild(o),this.overlay=o;let s=++this.generation;if(this.reducedMotion()?o.style.opacity="1":requestAnimationFrame(()=>{o.style.opacity="1"}),await this.nextPaint(),!(s!==this.generation||this.overlay!==o))try{let[a,l]=await Promise.all([Ai(),this.options.loadEventConfiguration()]),c=l?await Vo(l,this.options.resolveAsset):null,d=await $o(i.theme?.venue3d?.shellAssetUrl,this.options.resolveAsset);if(s!==this.generation||this.overlay!==o)return;let p={doc:i,seats:[...this.options.seats()],...c?{eventConfigurationId:c.id,eventConfiguration:c}:{},...d?{registeredShellGlb:d}:{}};r.textContent=(0,_t.t)("picker.building3d");let m=await a.prepareVenue3D(p);if(s!==this.generation||this.overlay!==o)return;let u=this.options.chrome??{},f=a.mountVenue3D(o,{...p,prepared:m},{portraitOverviewCrop:!0,arriveAtSeatEye:!0,lookAroundHint:rn(),navLabels:lo(),...u.view3dCaption===!1||u.view3dSeatStepper===!1||u.view3dControlDock===!1?{chrome:{caption:u.view3dCaption!==!1,seatStepper:u.view3dSeatStepper!==!1,controlDock:u.view3dControlDock!==!1}}:{},seatViewActionLabel:b=>this.findSeat(b)?.viewUrl?x("picker.openAuthored360","Open venue 360\xB0"):x("picker.lookAroundLive3d","Look around in live 3D"),onSeatPick:b=>this.toggleSeat(b),onSeatInspect:b=>this.toggleSeat(b),onViewTargetChange:b=>{this.targetSeatId_=b,b&&(this.focusedSectionId_=this.findSeat(b)?.sectionId??null),this.options.onViewChange("venue3d",b)},onSectionFocusChange:b=>{this.focusedSectionId_=b,this.options.onViewChange("venue3d",this.targetSeatId_)},...this.options.enableSeatView?{getSeatView:b=>this.seatViewFor3D(b)}:{}});if(s!==this.generation||this.overlay!==o){f.dispose();return}this.handle=f,this.buyerView_="venue3d",this.targetSeatId_=e??null,this.focusedSectionId_=e?this.findSeat(e)?.sectionId??null:null,this.applyNavigationMode(f),requestAnimationFrame(()=>r.remove()),this.pushLiveState(),this.options.onViewChange("venue3d",this.targetSeatId_),e&&await f.flyToSeat(e)}catch(a){if(s!==this.generation)return;throw this.options.onError?.(a),this.remove3DOverlay(!1),a}}exit3D(){this.buyerView_==="map"&&!this.overlay||(this.generation+=1,this.buyerView_="map",this.targetSeatId_=null,this.focusedSectionId_=null,this.remove3DOverlay(!0,!!this.handle),this.options.onViewChange("map",null))}remove3DOverlay(e,t=!1){let i=this.handle,o=this.overlay;if(this.options.restoreMap(),t&&i&&o){o.style.pointerEvents="none";let r=()=>{this.buyerView_!=="map"||this.overlay!==o||(o.style.visibility="hidden",this.options.restoreMap())};!e||this.reducedMotion()?(o.style.opacity="0",r()):(requestAnimationFrame(()=>{o.style.opacity="0"}),setTimeout(r,280));return}if(this.handle=null,this.overlay=null,!o){try{i?.dispose()}catch{}this.options.restoreMap();return}if(!e||this.reducedMotion()){try{i?.dispose()}catch{}o.remove(),this.options.restoreMap();return}o.style.pointerEvents="none",requestAnimationFrame(()=>{o.style.opacity="0"}),setTimeout(()=>{try{i?.dispose()}catch{}o.remove(),this.options.restoreMap()},280)}async restore3D(e){let t=this.overlay,i=this.handle;if(!t||!i)throw new Error("venue_3d_unavailable");this.buyerView_="venue3d",this.targetSeatId_=e.flyToSeatId??null,this.focusedSectionId_=e.flyToSeatId?this.findSeat(e.flyToSeatId)?.sectionId??null:null,t.style.visibility="visible",t.style.pointerEvents="auto",this.reducedMotion()?t.style.opacity="1":requestAnimationFrame(()=>{t.style.opacity="1"}),i.resize(),this.applyNavigationMode(i),this.pushLiveState(),this.options.onViewChange("venue3d",this.targetSeatId_),e.flyToSeatId?await i.flyToSeat(e.flyToSeatId):e.resetView&&i.focusOverview()}nextPaint(){return this.reducedMotion()||typeof requestAnimationFrame!="function"?Promise.resolve():new Promise(e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))})}toggleSeat(e){if(!this.findSeat(e))return;this.options.selection().some(o=>o.id===e)?this.options.deselect(e):this.options.status(e)==="free"&&this.options.select(e),this.pushLiveState()}seatState(e){switch(this.options.status(e.id)){case"held":return"held";case"booked":return"sold";case"not_for_sale":return"dimmed";default:return"available"}}async seatViewFor3D(e){let t=this.findSeat(e);if(!t)throw new Error("seat_view_unavailable");if(t.viewUrl){let i=t.viewMeta?.previewUrl,o=!!i&&i!==t.viewUrl,r=o?await this.options.resolveAsset(i):null,s=o?t.viewUrl:await this.options.resolveAsset(t.viewUrl);if(!s||o&&!r)throw new Error("seat_view_unavailable");return{url:s,...r?{previewUrl:r}:{},...o?{resolveUrl:this.options.resolveAsset}:{},...t.viewMeta?.variants?.length?{variants:t.viewMeta.variants}:{},...t.viewMeta?.initialBearingDeg!==void 0?{initialBearingDeg:t.viewMeta.initialBearingDeg}:{},...t.viewMeta?.initialPitchDeg!==void 0?{initialPitchDeg:t.viewMeta.initialPitchDeg}:{},...t.viewMeta?.coverage?{coverage:t.viewMeta.coverage}:{},...t.viewMeta?.capturedAt?{capturedAt:t.viewMeta.capturedAt}:{},...t.viewMeta?.sourceLabel?{sourceLabel:t.viewMeta.sourceLabel}:{}}}return{url:"",generated:!0,mediaKind:"model",coverage:"exact-seat",sourceLabel:x("picker.chartDerivedModel","Chart-derived model")}}closeSeatView(e=!0,t=!1){e&&(this.seatViewGeneration+=1);let i=this.seatViewElement;if(this.seatViewDispose?.(),this.seatViewDispose=null,this.seatViewElement=null,!!i){if(this.options.onSeatViewChange?.(null),!t||this.reducedMotion()){i.remove();return}i.classList.add("is-leaving"),setTimeout(()=>i.remove(),190)}}findSeat(e){return this.options.seats().find(t=>t.id===e||t.label===e)}hasStage(){let e=this.options.doc();return e?(e.floors?.flatMap(i=>i.objects)??e.objects).some(i=>i.type==="shape"&&(i.role==="stage"||!!i.stageKind)):!1}prepareHostTheme(e,t){getComputedStyle(e).position==="static"&&(e.style.position="relative");let i=t.theme;e.style.setProperty("--sl-bg",i?.background??"#f6f7fb"),e.style.setProperty("--sl-surface","#ffffff"),e.style.setProperty("--sl-text",i?.textColor??"#10162a"),e.style.setProperty("--sl-muted","#697386"),e.style.setProperty("--sl-line","#d9deea"),e.style.setProperty("--sl-accent",i?.accent??"#ef4056"),e.style.setProperty("--sl-accent-ink",i?.accentInk??"#ffffff")}reducedMotion(){return globalThis.matchMedia?.("(prefers-reduced-motion: reduce)").matches??!1}};var cs=require("@seatlayer/core");function vt(n,e,t,i){let o=e?n?.[e]:void 0;return o===void 0?i:typeof o=="number"?o:t&&o.tiers?.[t]!==void 0?o.tiers[t]:o.base??i}function Go(n,e,t,i,o){let r=(0,cs.seatPriceFor)(n?.objects,e,i);return r!==void 0?r:(0,cs.seatPriceFor)(n?.seatPrices,e,i)!==void 0?o:vt(n?.prices,t,i,o)}function Uo(n){if(!n)return null;let e=n.getBoundingClientRect();return e.width>0&&e.height>0?e:null}function ef(n){return Uo(n.foot?.querySelector(".sl-total"))??Uo(n.tray)??Uo(n.sheetHead)}function ps(n,e,t,i,o){let r=n,s=r.map;if(!s||!e){o?.();return}let a=s.getBoundingClientRect(),l={x:a.left+e.x,y:a.top+e.y},c=t.displayLabel??t.label,d=i?.find(m=>m.key===t.categoryKey)?.color,p=()=>{let m=ef(r);if(!m){o?.();return}Gl({from:l,to:{x:m.left+m.width/2,y:m.top+m.height/2},label:c,color:d,onArrive:o})};r.sheetHead&&Uo(r.sheetHead)?requestAnimationFrame(p):p()}var ds=60,tf=650;function gc(n,e){if(!e.length||n.focusSeats?.(e.map(o=>o.id)))return;let t=e.find(o=>o.sectionId)?.sectionId;if(!t)return;let i=e.filter(o=>o.sectionId===t);n.focus(t,{x:i.reduce((o,r)=>o+r.x,0)/i.length,y:i.reduce((o,r)=>o+r.y,0)/i.length})}function bc(n,e){let t=!No();gc({focusSeats:i=>n.focusSeats?.(i,{animate:t})===!0,focus:(i,o)=>n.focusSection(i,o)},(e?.items??[]).filter(i=>i.objectType!=="ga").slice(0,10).map(i=>n.seatByLabel(i.label)).filter(i=>!!i))}function yc(n,e){if(!e.length)return;let t=n.reducedMotion===!0;t||e.forEach((s,a)=>{n.schedule(()=>n.pop(s.id),a*ds)});let i=t?0:e.length*ds,o=e.find(s=>s.sectionId)?.sectionId;if(n.schedule(()=>gc(n,e),i),t)return;let r=i+(n.focusSeats||o?tf:0);e.forEach((s,a)=>{n.schedule(()=>ps(n.regions,n.screenPoint(s),s,n.categories),r+a*ds)})}function nf(n,e,t){for(let i of n)if(e>=i.x&&t>=i.y&&e<=i.x+i.w&&t<=i.y+i.h)return!0;return!1}var qo=class{constructor(){this.rects=[];this.host=null;this.pointers=new Set;this.touches=new Set;this.mouseDown=!1;this.onPointerDown=e=>{this.inside(e.clientX,e.clientY)&&(this.pointers.add(e.pointerId),this.swallow(e))};this.onPointerFollow=e=>{this.pointers.has(e.pointerId)&&this.swallow(e)};this.onPointerEnd=e=>{this.pointers.delete(e.pointerId)&&this.swallow(e)};this.onTouchStart=e=>{let t=this.changed(e);if(!t.length)return;let i=!0;for(let o of t)this.inside(o.clientX,o.clientY)?this.touches.add(o.identifier):i=!1;i&&this.swallow(e)};this.onTouchFollow=e=>{let t=this.changed(e);t.length&&t.every(i=>this.touches.has(i.identifier))&&this.swallow(e)};this.onTouchEnd=e=>{let t=this.changed(e);if(!t.length)return;let i=t.every(o=>this.touches.has(o.identifier));for(let o of t)this.touches.delete(o.identifier);i&&this.swallow(e)};this.onMouseDown=e=>{this.inside(e.clientX,e.clientY)&&(this.mouseDown=!0,this.swallow(e))};this.onMouseFollow=e=>{this.mouseDown&&this.swallow(e)};this.onMouseUp=e=>{this.mouseDown&&(this.mouseDown=!1,this.swallow(e))};this.onClick=e=>{this.inside(e.clientX,e.clientY)&&this.swallow(e)}}set(e){this.rects=e.map(t=>({x:t.x,y:t.y,w:t.w,h:t.h})),this.rects.length||(this.pointers.clear(),this.touches.clear(),this.mouseDown=!1)}get(){return this.rects}attach(e){if(this.host===e)return;this.detach(),this.host=e;let t={capture:!0,passive:!1};e.addEventListener("pointerdown",this.onPointerDown,t),e.addEventListener("pointermove",this.onPointerFollow,t),e.addEventListener("pointerup",this.onPointerEnd,t),e.addEventListener("pointercancel",this.onPointerEnd,t),e.addEventListener("touchstart",this.onTouchStart,t),e.addEventListener("touchmove",this.onTouchFollow,t),e.addEventListener("touchend",this.onTouchEnd,t),e.addEventListener("touchcancel",this.onTouchEnd,t),e.addEventListener("mousedown",this.onMouseDown,t),e.addEventListener("mousemove",this.onMouseFollow,t),e.addEventListener("mouseup",this.onMouseUp,t),e.addEventListener("click",this.onClick,t),e.addEventListener("dblclick",this.onClick,t)}detach(){let e=this.host;if(!e)return;let t={capture:!0};e.removeEventListener("pointerdown",this.onPointerDown,t),e.removeEventListener("pointermove",this.onPointerFollow,t),e.removeEventListener("pointerup",this.onPointerEnd,t),e.removeEventListener("pointercancel",this.onPointerEnd,t),e.removeEventListener("touchstart",this.onTouchStart,t),e.removeEventListener("touchmove",this.onTouchFollow,t),e.removeEventListener("touchend",this.onTouchEnd,t),e.removeEventListener("touchcancel",this.onTouchEnd,t),e.removeEventListener("mousedown",this.onMouseDown,t),e.removeEventListener("mousemove",this.onMouseFollow,t),e.removeEventListener("mouseup",this.onMouseUp,t),e.removeEventListener("click",this.onClick,t),e.removeEventListener("dblclick",this.onClick,t),this.host=null,this.pointers.clear(),this.touches.clear(),this.mouseDown=!1}inside(e,t){if(!this.rects.length||!this.host)return!1;let i=this.host.getBoundingClientRect();return nf(this.rects,e-i.left,t-i.top)}swallow(e){e.stopImmediatePropagation(),e.stopPropagation(),e.cancelable&&e.preventDefault()}changed(e){let t=e.changedTouches;return t?Array.from(t):[]}},vc=.48,of=8;function rf(n,e,t,i=vc){let o=Math.max(0,t.top),r=e.height-Math.max(0,t.bottom);if(!(r>o))return 0;let s=Number.isFinite(i)?Math.min(1,Math.max(0,i)):vc,a=o+(r-o)*s-n;return Math.abs(a)<=of?0:Math.round(a)}function wc(n,e,t={}){let i=n.gestureCount();if(t.gestures!==void 0&&t.gestures!==i)return{dy:0,gestures:i};let o=n.seatPoint(e);if(!o)return{dy:0,gestures:i};let r=rf(o.y,{height:n.mapHeight()},n.insets(),t.fraction);return r?{dy:n.panScreenBy({x:0,y:r},t.animate!==!1)?r:0,gestures:i}:{dy:0,gestures:i}}var Ii=class n{constructor(e,t=null){this.seams=e;this.watch=null;this.mode=t,this.watchMode()}themeMode(){return this.mode}setThemeMode(e,t){let i=t!==void 0&&"mapTheme"in t;e===this.mode&&!i||(i&&this.seams.setHostMapTheme(t.mapTheme??void 0),this.mode=e,this.watchMode(),this.applyThemeMode())}static groundFor(e){return Dn(null,e)}applyThemeMode(){let e=this.seams.mapTheme()??n.groundFor(this.mode);this.seams.applyMapTheme(e??null)&&this.seams.changed()}watchMode(){this.watch?.(),this.watch=null,this.mode==="auto"&&(this.watch=Eo(()=>this.applyThemeMode()))}setViewportInsets(e){this.seams.applyViewportInsets(e),this.seams.changed()}viewportInsets(){return this.seams.readViewportInsets()}dispose(){this.watch?.(),this.watch=null}};var kc=require("@seatlayer/core"),Sc=require("@seatlayer/core/core/seatConfidence");var xc=require("@seatlayer/core");function Yn(n){let e=n.viewMeta?.previewUrl??n.viewUrl;return e&&(as(e)||Rn(e))?e:null}function Yo(n){if(!n)return!1;let e=n.floors?.length?n.floors.map(t=>t.objects??[]):[n.objects??[]];for(let t of e)for(let i of t)if(i.type==="shape"&&(i.role==="stage"||i.stageKind))return!0;return!1}var sf=512,Wo=new Map;function Xo(n,e){if(!e)return null;let t=`${n.id}|${Math.round(e.x)},${Math.round(e.y)}`,i=Wo.get(t);if(i!==void 0)return i;let o=null;try{o=(0,xc.generateSeatThumb)(n,e).distanceM??null}catch{o=null}return Wo.size>=sf&&Wo.clear(),Wo.set(t,o),o}function Oi(n){return n.getFocusedSection()!==null||n.seatsRevealed()}function af(n){let e=n.atVenueFit?.(),t=n.canZoomIn?.();return{...typeof e=="boolean"?{atVenueFit:e}:{},...typeof t=="boolean"?{canZoomIn:t}:{}}}function lf(n,e){return{accessibilityFilter:n.length>0,limitedViewFilter:e.some(t=>t.commercial?.restrictedView||t.commercial?.obstructedView)}}function cf(n,e,t,i){for(let o of e){if(o.count<=0)continue;let r=n.accessibilitySpread?.([o.key]);for(let s of r?.sections??[]){let a=t.get(s.id)??i.get(s.id);if(!a||s.free<=0)continue;let l=a.accessibleFree??(a.accessibleFree={});l[o.key]=s.free}}}function Tc(n,e,t){let i=n.doc,o=i?.theme??{},r=n.categoryAvailability(),s=n.getGAAreas(),a=n.getFloors(),l=n.getExpandedSeats(),c=n.getAccessNeeds(),d=lf(c,l),p=e.seatPosition,m=p.targetSeatId?n.seatDetails(p.targetSeatId):null,u=new Map(l.map(v=>[v.id,v])),f=Yo(i),b=i?.floors?.flatMap(v=>v.objects)??i?.objects??[],T=new Map,E=new Map;for(let v of b){if(v.type!=="section")continue;let M={id:v.id,label:v.label,...v.displayLabel?{displayLabel:v.displayLabel}:{},...v.zone?{zoneId:v.zone}:{}};T.set(v.id,M);let F=v.logicalSectionId??v.id;E.has(F)||E.set(F,M)}return cf(n,c,T,E),{event:{key:t.event,name:t.eventInfo?.name??i?.name??t.event,venue:t.eventInfo?.venue??null,startsAt:t.eventInfo?.startsAt??null,timezone:t.eventInfo?.timezone??null,currency:t.eventInfo?.currency??t.currency??"USD",locale:(0,kc.getLocale)()||t.eventLocale,posterUrl:t.eventInfo?.posterUrl??null,mode:t.mode_??"live",salesClosed:t.eventInfo?.salesClosed??!1},branding:{...o.accent?{accent:o.accent}:{},...o.accentInk?{accentInk:o.accentInk}:{},...o.background?{background:o.background}:{},...o.textColor?{textColor:o.textColor}:{},...o.brandName?{brandName:o.brandName}:{},...o.logoUrl?{logoUrl:o.logoUrl}:{},attributionRequired:!o.hideBadge},features:{ga:s.length>0,tiers:!!i?.categories.some(v=>v.tiers?.length),floors:a.length>1,zones:!!i?.zones?.length,sections:T.size>0,bestAvailable:!0,...d,venue3d:e.canOffer3D(),seatView:e.canOfferSeatView()},catalog:{categories:(i?.categories??[]).filter(v=>!v.notForSale).map(v=>({key:v.key,label:v.label,color:v.color,price:vt(t.hostPrices_,v.key,null,v.price??v.tiers?.[0]?.price??0),available:r[v.key]??0,...Object.prototype.hasOwnProperty.call(r,v.key)?{free:r[v.key]}:{},tiers:(v.tiers??[]).map(M=>({id:M.id,name:M.name,price:vt(t.hostPrices_,v.key,M.id,M.price),...M.currency?{currency:M.currency}:{}}))})),zones:(i?.zones??[]).map(v=>({id:v.id,label:v.label,...v.color?{color:v.color}:{}})),sections:[...T.values()],gaAreas:s,bestAvailableZones:n.getBestAvailableZones()},map:{floors:a,activeFloorId:n.getActiveFloorId()||a[0]?.id||null,floorMode:n.isFloorOverview()?"all":"single",floorLabelStyle:n.getRenderer()?.getFloorLabelStyle?.()??"number",rung:n.getRung(),canZoomOut:Oi(n)||t.focusedSection_!==null,...af(n),focusedSectionId:n.getFocusedSection(),focusedSection:t.focusedSection_,viewMode:n.getViewMode(),buyerView:e.buyerView,view3dTargetSeatId:p.targetSeatId,view3dTargetSeat:m,view3dPreviousSeatId:p.previousSeatId,view3dNextSeatId:p.nextSeatId,view3dFocusedSectionId:e.focusedSectionId,view3dNavigationMode:e.navigationMode,colorblindSafe:t.colorblindSafe_,viewportInsets:n.getViewportInsets(),categoryFilter:t.categoryFilter_?[...t.categoryFilter_]:null,accessibilityFilter:t.accessibilityFilter_?[...t.accessibilityFilter_]:null,hideLimitedView:t.hideLimitedView_,accessNeeds:c},selection:{seats:n.getSelection().map(v=>{let M=t.hostPrices_||t.hostObjects_?{...v,price:Go({prices:t.hostPrices_,objects:t.hostObjects_,seatPrices:i?.seatPrices},v.label,v.categoryKey,v.tierId,v.price)}:v,F=u.get(M.id);if(!F)return M;let Q=n.worldToScreen({x:F.x,y:F.y}),N=Yn(F),g=f?Xo(F,F.focalPoint??i?.focalPoint):null;return{...M,screenPoint:{x:Q.x,y:Q.y},...N?{seatViewThumb:{reference:N,kind:"real"}}:{},...g!=null?{sightlineMetres:g}:{},...F.confidenceEvidence?{seatViewConfidence:(0,Sc.seatConfidenceDisclosure)(F.confidenceEvidence)}:{}}}),validity:n.getSelectionValidity(),maxSelection:t.maxSelection_},access:{...t.accessState_}}}var df="https://api.seatlayer.io",Ec=10;function pf(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 Zo=class{constructor(e){this.renderErrorEmitted=!1;this.mount=null;this.hostEl=null;this.interactionEnabled_=!0;this.eventLocale=null;this.localeGeneration=0;this.paintedLocale=null;this.languageSelect=null;this.rendered=!1;this.mode_=null;this.eventInfo=null;this.categoryFilter_=null;this.accessibilityFilter_=null;this.hideLimitedView_=!1;this.focusedSection_=null;this.lastReportedViewRung_=null;this.lastReportedCanZoomOut_=!1;this.tipEl=null;this.tipPos={x:0,y:0};this.onTipMove=null;this.blockedRegions=null;this.realtime=null;this.holdingLabels=new Set;if(!e||typeof e!="object")throw new Error("seatmap: options object is required");if(!e.container)throw new Error("seatmap: `container` is required");if(!e.event||typeof e.event!="string")throw new Error("seatmap: `event` key is required");this.opts=e,this.maxSelection_=e.maxSelection??Ec,this.colorblindSafe_=e.colorblindSafe??!1,this.hostPrices_=e.pricing?.prices,this.hostObjects_=e.pricing?.objects;let t=!!(e.buyerAccessTokenProvider||e.buyerAccessToken||e.publicKey);this.accessState_={configured:t,status:t?"ready":"public"},this.publicKey=e.publicKey;let i={onExpired:a=>{this.accessState_={configured:!0,status:a.refreshed?"ready":"expired"},this.opts.onAccessExpired?.(a),this.notifyMapStateChange()},onUnavailable:a=>{this.accessState_={configured:!0,status:"unavailable",reason:a.reason},this.opts.onAccessUnavailable?.(a),this.notifyMapStateChange()}},o=(e.apiBase??df).replace(/\/+$/,"");this.apiBase=o;let r=e.publicKey&&!e.buyerAccessTokenProvider&&!e.buyerAccessToken?_o({base:o,event:e.event,publicKey:e.publicKey,accessHooks:i,apiOptions:{onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)}}):null;this.access=r?.access??zn(e,i);let s=r?.api??new Pt(o,{access:this.access??void 0,onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)});this.api=s,this.chartFetch=Ho(s),this.controller=new pe.PickerController({transport:this.chartFetch.transport,eventKey:e.event,maxSelection:this.maxSelection_,selectedObjects:e.selectedObjects,selectableObjects:e.selectableObjects,numberOfPlacesToSelect:e.numberOfPlacesToSelect,selectionValidators:e.selectionValidators,currency:e.currency,categoryPriceRanges:()=>this.hostPriceRanges(),seatPriceLabel:a=>this.hostSeatPriceLabel(a.label),onSelectionChange:a=>{this.immersive?.pushLiveState(),this.opts.onSelectionChange?.(a)},onSelectionValidityChange:a=>this.opts.onSelectionValidityChange?.(a),onSelectionValid:a=>this.opts.onSelectionValid?.(a),onSelectionInvalid:a=>this.opts.onSelectionInvalid?.(a),onDeselect:a=>{this.controller.currentHold()?.labels.includes(a.label)&&this.controller.releaseLabels([a.label])},retapKeepsSelection:!0,onSeatRetap:a=>this.opts.onSeatRetap?.(a),onSelectionLimit:a=>this.opts.onSelectionLimit?.(a),onHold:a=>this.opts.onHold?.({holdId:a.holdId,expiresAt:a.expiresAt,seats:a.seats,items:a.items}),onHoldRestored:a=>this.opts.onHoldRestored?.({holdId:a.holdId,expiresAt:a.expiresAt,seats:a.seats,items:a.items}),onHoldExpired:()=>this.opts.onHoldExpired?.(),onGAClick:a=>{let l=this.controller.getGAAreas().find(c=>c.id===a);l&&(this.opts.onGAClick?.(l),this.opts.onGAPrompt?.(ec(l,{room:(this.opts.maxSelection??Ec)-this.controller.getSelection().length,wheelchairOnly:this.controller.getAccessibilityFilter()?.includes("wheelchair")===!0,hold:(c,d)=>{this.holdGA(l.id,c,d?{tierId:d}:{})}})))},onError:a=>{this.renderErrorEmitted=!0,this.opts.onError?.(a)},onDeckTap:a=>{this.opts.onDeckTap?.(a),this.notifyMapStateChange()},onHint:a=>this.opts.onHint?.(a),onSectionFocus:a=>{this.focusedSection_=a,this.opts.onSectionFocus?.(a),this.notifyMapStateChange()},onViewChange:()=>this.handleViewChange(),onStatusChange:()=>{this.immersive?.pushLiveState(),this.opts.onStatusChange?.()},onSalesClosed:()=>{this.eventInfo&&(this.eventInfo.salesClosed=!0),this.opts.onSalesClosed?.()},flashOnLiveChange:!0,onSeatHover:a=>{this.opts.onSeatHover?.(a),this.opts.seatTooltip!==!1&&this.updateTooltip(a)},colorblindSafe:e.colorblindSafe,mapTheme:e.mapTheme??Ii.groundFor(e.theme?.mode)??null}),this.hostSurface=new Ii({mapTheme:()=>this.opts.mapTheme,setHostMapTheme:a=>{this.opts.mapTheme=a},applyMapTheme:a=>this.controller.setMapTheme(a),applyViewportInsets:a=>this.controller.setViewportInsets(a),readViewportInsets:()=>this.controller.getViewportInsets(),changed:()=>this.notifyMapStateChange()},e.theme?.mode??null),this.buyerAssetUrls=new Wn(e.event,(a,l)=>s.asset(a,l)),this.immersive=new jo({host:()=>this.hostEl,doc:()=>this.controller.doc,seats:()=>this.controller.getExpandedSeats(),selection:()=>this.controller.getSelection(),status:a=>this.controller.getStatus(a),select:a=>this.controller.select([a]),deselect:a=>this.controller.deselect([a]),loadEventConfiguration:()=>this.controller.loadEventConfiguration(),resolveAsset:a=>this.buyerAssetUrls.resolve(a),enable3D:e.enable3D!==!1,enableSeatView:e.enableSeatView!==!1,max3DSeats:e.max3DSeats,...e.chrome?{chrome:e.chrome}:{},restoreMap:()=>this.controller.refitCurrentView(),onViewChange:(a,l)=>{this.opts.onBuyerViewChange?.({view:a,...l?{seatId:l}:{}}),this.notifyMapStateChange()},onSeatViewChange:a=>this.opts.onSeatViewChange?.(a),onError:a=>this.opts.onError?.(a)}),this.lastReportedViewRung_=this.controller.getRung(),this.lastReportedCanZoomOut_=Oi(this.controller)}handleViewChange(){this.opts.onViewChange?.();let e=this.controller.getRung(),t=Oi(this.controller);e===this.lastReportedViewRung_&&t===this.lastReportedCanZoomOut_||(this.lastReportedViewRung_=e,this.lastReportedCanZoomOut_=t,this.opts.onMapStateChange?.())}notifyMapStateChange(){this.lastReportedViewRung_=this.controller.getRung(),this.lastReportedCanZoomOut_=Oi(this.controller),this.opts.onMapStateChange?.()}async render(){if(this.rendered)return this;let e=performance.now();this.rendered=!0;let t=Ao(this.opts.locale,this.opts.messages),i=this.localeGeneration+=1;this.paintedLocale=(0,pe.getLocale)(),this.mount=pf(this.opts.container);let o=document.createElement("div");o.style.width="100%",o.style.height="100%",o.style.position="relative",this.mount.appendChild(o),this.hostEl=o,this.blockedRegions?.attach(o),Po(o,t,s=>{s!==this.paintedLocale&&this.applyActiveLocale(s,i)}),this.applyInteractionState(),this.renderErrorEmitted=!1;let r=await this.controller.render(o);if(!r){let s=Ro(this.chartFetch?.outcome(),this.renderErrorEmitted);return s&&Io({apiBase:this.apiBase,eventKey:this.opts.event,reason:s}),rt({apiBase:this.apiBase,event:this.opts.event,scope:"event",surface:"seating_chart",outcome:"failure",stage:"load_chart",ms:performance.now()-e,load:ht(this.opts.event),transport:"pubapi"}),this.rendered=!1,this.opts.errorDisplay!=="none"&&this.showLoadFailure(o),this}if(this.eventLocale=r.locale??null,!this.opts.locale&&this.eventLocale&&this.setLocale(this.eventLocale),this.buildLanguageSwitcher(o),this.controller.setViewMode(this.opts.initialView??"flat"),this.opts.floorLabelStyle&&this.setFloorLabelStyle(this.opts.floorLabelStyle),this.startRealtime(),this.mode_=r.mode==="test"?"test":"live",this.eventInfo={name:r.eventName,venue:r.venue??null,startsAt:r.startsAt??null,timezone:r.timezone??null,currency:r.currency??this.opts.currency??"USD",posterUrl:r.posterUrl??null,salesClosed:r.salesClosed},this.opts.seatTooltip!==!1){let s=document.createElement("div");s.setAttribute("role","tooltip"),s.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);',o.appendChild(s),this.tipEl=s,this.onTipMove=a=>{let l=o.getBoundingClientRect();this.tipPos={x:a.clientX-l.left,y:a.clientY-l.top},this.tipEl&&this.tipEl.style.display!=="none"&&this.placeTooltip()},o.addEventListener("mousemove",this.onTipMove)}if(r.mode==="test"&&this.opts.showTestModeIndicator!==!1){o.style.overflow="hidden";let s=document.createElement("div");s.dataset.slI18n="testMode",s.textContent=(0,pe.t)("picker.testMode"),s.setAttribute("aria-label",(0,pe.t)("picker.testMode")),s.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;",o.appendChild(s)}return rt({apiBase:this.apiBase,event:this.opts.event,scope:"event",surface:"seating_chart",outcome:"success",ms:performance.now()-e,performanceProfile:r.performanceProfile,seats:this.controller.getExpandedSeats().length,floors:this.controller.getFloors().length,view:"map",load:ro(this.opts.event),transport:"pubapi"}),this}placeTooltip(){if(!this.tipEl||!this.hostEl)return;let e=this.hostEl.clientWidth,t=this.tipEl.offsetWidth,i=this.tipEl.offsetHeight,o=this.tipPos.x+14,r=this.tipPos.y-i-12;o+t>e-8&&(o=this.tipPos.x-t-14),r<8&&(r=this.tipPos.y+18),this.tipEl.style.left=`${Math.max(8,o)}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,pe.formatMoney)(e.price,e.currency,{...Number.isInteger(e.price)?{minimumFractionDigits:0,maximumFractionDigits:0}:{},locale:this.opts.locale,fallback:(l,c)=>`${l} ${c}`}),i=document.createElement("div");i.style.cssText="font-weight:700;font-size:13px",i.textContent=e.label;let o=document.createElement("div");o.style.cssText="display:flex;align-items:center;gap:6px;margin-top:4px;color:#c7cddc";let r=document.createElement("span");r.style.cssText="width:9px;height:9px;border-radius:50%;flex:none",r.style.background=e.categoryColor;let s=document.createElement("span");s.textContent=e.categoryLabel;let a=document.createElement("span");if(a.style.cssText="margin-left:auto;font-weight:700;color:#fff",a.textContent=t,o.append(r,s,a),this.tipEl.replaceChildren(i,o),e.status!=="free"){let l=document.createElement("div");l.style.cssText="margin-top:5px;font-size:10.5px;letter-spacing:.08em;text-transform:uppercase;color:#fca5a5;font-weight:700",l.textContent=(0,pe.t)("picker.group.legendUnavailable"),this.tipEl.appendChild(l)}this.tipEl.style.display="block",this.placeTooltip()}buildLanguageSwitcher(e){let t=(this.opts.languages??[]).map(o=>(0,pe.resolveLocale)(o)).filter((o,r,s)=>s.indexOf(o)===r);if(t.length<2)return;let i=document.createElement("select");i.setAttribute("aria-label",(0,pe.t)("picker.preferredTicketType")),i.style.cssText='position:absolute;bottom:10px;left:12px;z-index:5;appearance:none;padding:5px 9px;border-radius:999px;border:0;cursor:pointer;background:rgba(255,255,255,.92);color:#4a5163;font:600 11px/1 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;box-shadow:0 2px 8px rgba(0,0,0,.12);';for(let o of t){let r=document.createElement("option");r.value=o,r.textContent=pe.LOCALE_NAMES[o]??o,r.selected=o===(0,pe.getLocale)(),i.appendChild(r)}i.addEventListener("change",()=>{this.setLocale(i.value)}),e.appendChild(i),this.languageSelect=i}async setLocale(e){let t=this.localeGeneration+=1,i=await(0,pe.loadLocale)(e);return this.opts.messages&&(0,pe.setStringOverrides)(this.opts.messages),i===this.paintedLocale||this.applyActiveLocale(i,t),i}applyActiveLocale(e,t){if(t!==this.localeGeneration)return;let i=this.hostEl;if(i){this.paintedLocale=e,i.lang=e,i.dir=(0,pe.localeDirection)(e);for(let o of i.querySelectorAll("[data-sl-i18n]"))o.dataset.slI18n==="testMode"&&(o.textContent=(0,pe.t)("picker.testMode"),o.setAttribute("aria-label",(0,pe.t)("picker.testMode")));Co(i),this.languageSelect&&this.languageSelect.value!==e&&(this.languageSelect.value=e),this.controller.refreshMapCopy()}}getMode(){return this.mode_}getPickerState(){return Tc(this.controller,this.immersive,{event:this.opts.event,currency:this.opts.currency,mode_:this.mode_,eventInfo:this.eventInfo,eventLocale:this.eventLocale,focusedSection_:this.focusedSection_,colorblindSafe_:this.colorblindSafe_,categoryFilter_:this.categoryFilter_,accessibilityFilter_:this.accessibilityFilter_,hideLimitedView_:this.hideLimitedView_,maxSelection_:this.maxSelection_,accessState_:this.accessState_,hostPrices_:this.hostPrices_,hostObjects_:this.hostObjects_})}getHostPrices(){return this.hostPrices_}getHostPricing(){return{prices:this.hostPrices_,objects:this.hostObjects_,seatPrices:this.controller.doc?.seatPrices}}getCategoryAvailability(){return this.controller.categoryAvailability()}getBestAvailableZones(){return this.controller.getBestAvailableZones()}getActiveFloorId(){return this.controller.getActiveFloorId()||null}getRung(){return this.controller.getRung()}getFocusedSection(){return this.controller.getFocusedSection()}focusSection(e){if(this.immersive.buyerView==="venue3d"&&this.immersive.focusSection(e)){this.notifyMapStateChange();return}this.controller.focusSection(e),this.notifyMapStateChange()}overview(){if(this.immersive.focusOverview()){this.notifyMapStateChange();return}this.controller.overview(),this.notifyMapStateChange()}setRung(e){this.controller.setRung(e),this.notifyMapStateChange()}setCategoryFilter(e,t=!1){this.categoryFilter_=e?[...e]:null,this.controller.setCategoryFilter(e),t&&this.controller.focusCategoryFilter(e),this.notifyMapStateChange()}setAccessibilityFilter(e){this.accessibilityFilter_=e?[...e]:null,this.controller.setAccessibilityFilter(e),this.notifyMapStateChange(),e?.length&&this.focusAccessibilityFilter()}focusAccessibilityFilter(){this.controller.focusAccessibilityFilter?.(),this.notifyMapStateChange()}focusNextAccessibleSection(e){let t=this.controller.focusNextAccessibleSection?.(e)??null;return t&&this.notifyMapStateChange(),t}setCommercialLimitedFilter(e){this.hideLimitedView_=e,this.controller.setCommercialLimitedFilter(e),this.notifyMapStateChange()}getSelection(){return this.controller.getSelection()}selectObjects(e){let t=this.controller.select(e);return this.immersive.pushLiveState(),t}deselectObjects(e){this.controller.deselect(e),this.immersive.pushLiveState()}clearSelection(){this.controller.clearSelection(),this.immersive.pushLiveState()}selectCategories(e){return this.controller.selectCategories(e)}deselectCategories(e){this.controller.deselectCategories(e)}setSelectableObjects(e){this.controller.setSelectableObjects(e)}setMaxSelection(e){this.maxSelection_=e,this.controller.setMaxSelection(e),this.notifyMapStateChange()}getSelectionValidity(){return this.controller.getSelectionValidity()}async hold(e={}){try{return await this.holdOrThrow(e)}catch(t){return this.opts.onError?.(t),null}}async holdOrThrow(e={}){let t=this.controller.getSelectionValidity();if(t&&!t.isValid){let i=t.violations.includes("numberOfPlacesToSelect");throw Object.assign(new Error(i?`seatmap: select exactly ${t.required} places before holding`:"seatmap: adjust the ticket selection before holding"),{code:i?"selection_count_mismatch":"selection_invalid",selection:t})}this.holdingLabels=new Set(this.controller.getSelection().map(i=>i.label));try{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}finally{this.holdingLabels.clear()}}async resumeHold(e){try{return await this.resumeHoldOrThrow(e)}catch(t){return this.opts.onError?.(t),null}}async resumeHoldOrThrow(e){let t=await this.controller.resumeHold(e);return t?{holdId:t.holdId,expiresAt:t.expiresAt,seats:t.seats,items:t.items}:null}async extendHold(e){try{let t=await this.controller.extendHold(e);return t?{holdId:t.holdId,expiresAt:t.expiresAt,seats:t.seats,items:t.items}:null}catch(t){return this.opts.onError?.(t),null}}getCurrentHold(){let e=this.controller.currentHold();return e?{holdId:e.holdId,expiresAt:e.expiresAt,seats:e.seats,items:e.items}:null}getGAAreas(){return this.controller.getGAAreas()}async holdGA(e,t,i={}){try{return await this.holdGAOrThrow(e,t,i)}catch(o){return this.opts.onError?.(o),null}}async holdGAOrThrow(e,t,i={}){let o=await this.controller.holdGA(e,t,i);return o?{holdId:o.holdId,expiresAt:o.expiresAt,seats:o.seats,items:o.items}:null}async bestAvailable(e,t,i={}){try{return await this.bestAvailableOrThrow(e,t,i)}catch(o){return this.opts.onError?.(o),null}}async bestAvailableOrThrow(e,t,i={}){let o=xo(this.controller,t);if(o)throw o;let r=await this.controller.bestAvailable(e,t,i);return bc(this.controller,r),r?{holdId:r.holdId,expiresAt:r.expiresAt,labels:r.labels,seats:r.seats,items:r.items,...i.zoneId?{zoneId:i.zoneId}:{}}:null}setSeatTier(e,t){this.controller.setSeatTier(e,t)}setTableQuantity(e,t){return this.controller.setTableQuantity(e,t)}async replaceTableQuantity(e,t,i){try{return await this.replaceTableQuantityOrThrow(e,t,i)}catch(o){return this.opts.onError?.(o),null}}async replaceTableQuantityOrThrow(e,t,i){let o=await this.controller.replaceTableQuantity(e,t,i);return o?{holdId:o.holdId,expiresAt:o.expiresAt,seats:o.seats,items:o.items}:null}getFloors(){return this.controller.getFloors()}setFloor(e){if(this.immersive.buyerView==="venue3d"&&e!=="all"&&this.immersive.focusFloor(e)){this.notifyMapStateChange();return}if(this.controller.getFloors().length<=1){console.warn("seatmap: setFloor() ignored \u2014 this chart has a single floor");return}e==="all"?this.controller.setFloorOverview(!0):this.controller.setFloor(e),this.notifyMapStateChange()}setFloorLabelStyle(e){this.controller.getRenderer()?.setFloorLabelStyle?.(e),this.notifyMapStateChange()}setSectionFocusDim(e){this.controller.setSectionFocusDim(e)}setSelectionFocus(e){this.controller.setSelectionFocus(e)}setBlockedRegions(e){if(!this.blockedRegions){if(!e.length)return;this.blockedRegions=new qo,this.hostEl&&this.blockedRegions.attach(this.hostEl)}this.blockedRegions.set(e)}getBlockedRegions(){return this.blockedRegions?.get()??[]}frameSeat(e,t={}){let i=this.controller.getRenderer();return wc({seatPoint:o=>{let r=this.controller.getExpandedSeats().find(s=>s.id===o);return r?this.controller.worldToScreen({x:r.x,y:r.y}):null},mapHeight:()=>this.hostEl?.clientHeight??0,insets:()=>this.controller.getViewportInsets(),gestureCount:()=>i?.getCameraGestureCount?.()??0,panScreenBy:(o,r)=>i?.panScreenBy?(i.panScreenBy(o,{animate:r}),!0):!1},e,t)}setPricing(e){let t=e?.prices&&Object.keys(e.prices).length?e.prices:void 0,i=e?.objects&&Object.keys(e.objects).length?e.objects:void 0;JSON.stringify([t??null,i??null])!==JSON.stringify([this.hostPrices_??null,this.hostObjects_??null])&&(this.hostPrices_=t,this.hostObjects_=i,this.controller.getRenderer()?.setCategoryPriceRanges?.(this.hostPriceRanges()),this.notifyMapStateChange())}hostSeatPriceLabel(e){let t=(0,pe.seatPriceEntry)(this.hostObjects_,e);if(t===void 0)return;let i=typeof t=="number"?[t]:Object.values(t.tiers);if(!i.length)return;let o=this.eventInfo?.currency??this.opts.currency??"USD",r=Math.min(...i),s=Math.max(...i);return s>r?`${(0,pe.formatMoney)(r,o)}\u2013${(0,pe.formatMoney)(s,o)}`:(0,pe.formatMoney)(r,o)}hostPriceRanges(){let e=this.hostPrices_;if(e)return Object.fromEntries((this.controller.doc?.categories??[]).flatMap(t=>{let i=t.tiers?.length?t.tiers.map(o=>vt(e,t.key,o.id,o.price)):t.price==null?[]:[vt(e,t.key,null,t.price)];return i.length?[[t.key,{min:Math.min(...i),max:Math.max(...i)}]]:[]}))}setColorblindSafe(e){this.colorblindSafe_=e,this.controller.setColorblindSafe(e),this.notifyMapStateChange()}setViewMode(e){this.controller.setViewMode(e),this.notifyMapStateChange()}getViewMode(){return this.controller.getViewMode()}zoomIn(){this.immersive.zoomIn()||(this.controller.zoomIn(),this.notifyMapStateChange())}zoomOut(){this.immersive.zoomOut()||(this.controller.zoomOut(),this.notifyMapStateChange())}zoomToFit(){this.immersive.focusOverview()||(this.controller.zoomToFit(),this.notifyMapStateChange())}setThemeMode(e,t){this.hostSurface.setThemeMode(e,t)}getThemeMode(){return this.hostSurface.themeMode()}setViewportInsets(e){this.hostSurface.setViewportInsets(e)}getViewportInsets(){return this.hostSurface.viewportInsets()}setBuyerView(e,t){return this.immersive.setBuyerView(e,t)}getBuyerView(){return this.immersive.buyerView}openSeatView(e){return this.immersive.openSeatView(e)}setVenue3DNavigationMode(e){if(!this.immersive.setNavigationMode(e))throw new Error("venue_3d_not_active")}setInteractionEnabled(e){this.interactionEnabled_=e,this.applyInteractionState()}applyInteractionState(){let e=this.hostEl;e&&(e.style.pointerEvents=this.interactionEnabled_?"":"none",e.toggleAttribute("inert",!this.interactionEnabled_),this.interactionEnabled_?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden","true"))}async release(){await this.controller.release()}async releaseLabels(e){return this.controller.releaseLabels(e)}startRealtime(){!this.access?.configured||this.realtime||(this.realtime=new st({url:this.api.subscribeUrl(this.opts.event),mintTicket:()=>this.api.subscribeTicket(this.opts.event),onAccessUnavailable:e=>this.opts.onAccessUnavailable?.(e),sink:Hn(this.controller,{flashOnLiveChange:!0,ownLabels:()=>this.holdingLabels,onStatusChange:()=>{this.immersive.pushLiveState(),this.opts.onStatusChange?.()},onSelectedObjectUnavailable:(e,t)=>this.opts.onSelectedObjectUnavailable?.({labels:e,reason:t})})}),this.realtime.start())}async refreshAvailability(){let e=await this.controller.refreshAvailability();return this.immersive.pushLiveState(),this.opts.onStatusChange?.(),e.lost.length&&this.opts.onSelectedObjectUnavailable?.({labels:e.lost,reason:"taken"}),this.notifyMapStateChange(),e}async refreshAccess(){if(!this.access?.configured)return!1;let e=await this.access.refresh("manual");return e&&(this.accessState_={configured:!0,status:"ready"},await this.controller.refresh(),this.realtime?.restart(),this.realtime||this.startRealtime()),this.notifyMapStateChange(),e}showLoadFailure(e){let t=document.createElement("div");t.setAttribute("role","status"),t.style.cssText='display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;width:100%;height:100%;min-height:180px;box-sizing:border-box;padding:24px;text-align:center;font:500 14px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#3b4256;';let i=document.createElement("div");i.textContent=x("picker.mapDidNotLoad","The seat map didn\u2019t load"),i.dataset.slT="picker.mapDidNotLoad",t.appendChild(i);let o=document.createElement("button");o.type="button",o.textContent=x("picker.accessRetry","Try again"),o.dataset.slT="picker.accessRetry",o.style.cssText="appearance:none;border:1px solid #c9cede;background:#fff;color:#10162a;border-radius:8px;padding:8px 16px;font:600 13px/1 inherit;cursor:pointer;",o.addEventListener("click",()=>{this.destroy(),this.render().catch(r=>this.opts.onError?.(r))}),t.appendChild(o),e.appendChild(t)}destroy(){this.blockedRegions?.detach(),this.hostSurface.dispose(),this.immersive.destroy(),this.buyerAssetUrls.dispose(),this.realtime?.stop(),this.realtime=null,this.access?.clear(),this.hostEl&&this.onTipMove&&this.hostEl.removeEventListener("mousemove",this.onTipMove),this.tipEl=null,this.onTipMove=null,this.languageSelect=null,this.controller.destroy(),this.hostEl&&this.hostEl.parentNode&&this.hostEl.parentNode.removeChild(this.hostEl),this.hostEl=null,this.mount=null,this.rendered=!1,this.mode_=null,this.eventInfo=null,this.focusedSection_=null}};var hs=["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"],hf={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 Cc(n){let e={};for(let t of hs)e[t]=(...i)=>{let o=n();return o?o[t](...i):hf[t]()};return e}var us=["event","apiBase","maxSelection","numberOfPlacesToSelect","selectionValidators","publicKey","locale","currency","colorblindSafe","initialView","errorDisplay"],ms=[...us,"selectedObjects","selectableObjects","messages","seatTooltip","buyerAccessTokenProvider","buyerAccessToken"],fs=["onSelectionChange","onSelectionValidityChange","onSelectionValid","onSelectionInvalid","onSelectionLimit","onHold","onHoldRestored","onHoldExpired","onGAClick","onGAPrompt","onError","onDeckTap","onHint","onSeatHover","onAccessExpired","onAccessUnavailable","onSelectedObjectUnavailable"];function Ac(n,e,t){let i={container:n};for(let o of ms)i[o]=e[o];for(let o of fs)i[o]=t[o];return i}var uf=new Set(["seatlayer.designer.ready","seatlayer.designer.saved","seatlayer.designer.published","seatlayer.designer.close","seatlayer.designer.error"]),mf=2e4,ff=0,gf=180*1e3,bf=900*1e3,yf=.8,vf=30*1e3,wf=1e5,xf=4,kf=50;function gs(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 Sf(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 Tf={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."}},Qo=class{constructor(e){this.frame=null;this.designerOrigin="";this.overlay=null;this.timeoutTimer=null;this.renewTimer=null;this.autoRecoverUsed=!1;this.phase="loading";this.identityEstablished=!1;this.restoreContainerPosition=null;this.pinned=!1;this.frameStyleBeforeFs=null;this.docOverflowBeforeFs=null;this.bodyOverflowBeforeFs=null;this.fsKeyHandler=null;this.lastAutoHeight="";this.fillRaf=null;this.reprobeRaf=null;this.fillListening=!1;this.containerEl=null;this.fillMode=null;this.resizeObs=null;this.scheduleFill=()=>{this.fillRaf===null&&(this.fillRaf=requestAnimationFrame(()=>{this.fillRaf=null,this.applyFill()}))};this.scheduleReprobe=()=>{this.reprobeRaf===null&&(this.reprobeRaf=requestAnimationFrame(()=>{this.reprobeRaf=null,!this.pinned&&(this.fillMode=this.detectFillMode(),this.syncContainerObserver(),this.applyFill())}))};this.handleMessage=e=>{if(!this.frame||e.origin!==this.designerOrigin||e.source!==this.frame.contentWindow||!e.data||typeof e.data!="object")return;let t=e.data;if(t.type==="seatlayer.designer.handshake"&&typeof t.nonce=="string"&&t.nonce.length<=128){this.frame.contentWindow?.postMessage({type:"seatlayer.designer.parent",nonce:t.nonce},this.designerOrigin);return}if(t.type==="seatlayer.designer.resize"){!this.fillEnabled()&&this.autoResizeEnabled()&&typeof t.px=="number"&&Number.isFinite(t.px)&&t.px>0&&(this.lastAutoHeight=`${Math.round(t.px)}px`,this.pinned||this.setFrameHeight(this.lastAutoHeight));return}if(t.type==="seatlayer.designer.fullscreen"){t.on===!0?this.pinFullscreen():t.on===!1&&this.unpinFullscreen();return}if(typeof t.type!="string"||!uf.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},o=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&&(o||i.chartId!==void 0),s=this.options.expectedWorkspaceId!==void 0&&i.workspaceId!==this.options.expectedWorkspaceId&&(o||i.workspaceId!==void 0);if(r||s){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=Sf(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=gs(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 o=this.options.loadingTimeoutMs??mf;o>0&&Number.isFinite(o)&&(this.timeoutTimer=setTimeout(()=>{this.phase==="loading"&&this.showError("timeout")},o))}return t}setDesignerUrl(e){return this.options={...this.options,designerUrl:e},this.mount()}getIframe(){return this.frame}setSizing(e,t){this.options={...this.options,height:e,minHeight:t},this.frame&&(this.stopFill(),this.lastAutoHeight="",this.fillEnabled()?(this.pinned||this.setFrameHeight("100%"),this.startFill()):this.pinned||this.setFrameHeight(`${e}px`))}setRelaunchPolicy(e,t){this.options={...this.options,onRequestRelaunch:e,autoRenewSession:t},this.clearRenewTimer(),this.phase==="ready"&&this.scheduleRenewal(this.sessionExpiresAt)}destroy(){window.removeEventListener("message",this.handleMessage),this.stopFill(),this.unpinFullscreen(),this.clearTimeoutTimer(),this.clearRenewTimer(),this.removeOverlay(),this.restoreContainerStyle(),this.frame?.remove(),this.frame=null,this.containerEl=null,this.fillMode=null,this.designerOrigin="",this.phase="loading",this.identityEstablished=!1,this.sessionExpiresAt=void 0,this.lastAutoHeight=""}loadingStateEnabled(){return this.options.showLoadingState!==!1}autoResizeEnabled(){return this.options.autoResize!==!1}fillEnabled(){return typeof this.options.height!="number"}setFrameHeight(e){this.frame?.style.setProperty("height",e,"important")}detectFillMode(){let e=this.containerEl,t=this.frame;if(this.pinned||!e||!t)return this.fillMode??"viewport";let i=()=>e.getBoundingClientRect().height,o=t.style.getPropertyValue("height"),r=t.style.getPropertyPriority("height");t.style.setProperty("height","0px","important");let s=i();t.style.setProperty("height",`${wf}px`,"important");let a=i();return o?t.style.setProperty("height",o,r):t.style.removeProperty("height"),!(a-s>xf)&&s>=kf?"container":"viewport"}applyFill(){if(!this.frame||this.pinned)return;let e=this.options.minHeight??ff;if(this.fillMode==="container"&&this.containerEl){let o=getComputedStyle(this.containerEl),r=["paddingTop","paddingBottom","borderTopWidth","borderBottomWidth"].reduce((a,l)=>a+(parseFloat(o[l])||0),0),s=Math.max(e,Math.floor(this.containerEl.getBoundingClientRect().height-r));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,o]of Object.entries(e))this.frame.style.setProperty(i,o,"important");let t=document.documentElement;this.docOverflowBeforeFs=t.style.overflow,t.style.overflow="hidden",document.body&&(this.bodyOverflowBeforeFs=document.body.style.overflow,document.body.style.overflow="hidden"),this.fsKeyHandler=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<bf?t*yf:t-gf,o=Math.max(vf,i);this.renewTimer=setTimeout(()=>{this.renewTimer=null,this.autoRenewEnabled()&&this.options.onRequestRelaunch()},o)}ensureContainerPositioned(e){getComputedStyle(e).position==="static"&&(this.restoreContainerPosition=e.style.position,e.style.position="relative")}restoreContainerStyle(){if(this.restoreContainerPosition!==null){try{gs(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=gs(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 o=document.createElement("div");o.setAttribute("data-seatlayer-designer-overlay",t),o.setAttribute("role",t==="error"?"alert":"status"),o.setAttribute("aria-live","polite"),Object.assign(o.style,{position:"absolute",inset:"0",display:"flex",alignItems:"center",justifyContent:"center",background:t==="loading"?"#f7f8fb":"#101625",color:t==="loading"?"#0c1220":"#e6ebf5",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif',zIndex:"2",overflow:t==="error"?"auto":"hidden"}),t==="loading"?this.buildSkeleton(o):this.buildErrorCard(o,i??"load"),e.append(o),this.overlay=o}buildSkeleton(e){let t=document.createElement("style");t.textContent=`
3523
3518
  [data-seatlayer-designer-overlay="loading"]{container-type:inline-size}
3524
3519
  .sl-designer-skeleton{position:absolute;inset:0;display:flex;flex-direction:column;pointer-events:none}
3525
3520
  .sl-designer-skeleton *{box-sizing:border-box}
@@ -3541,8 +3536,8 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default;text-decoration-color:t
3541
3536
  <div class="sl-designer-skeleton-rail" aria-hidden="true"><i></i><i></i><i></i><i></i><i></i></div>
3542
3537
  <div class="sl-designer-skeleton-canvas"><div class="sl-designer-skeleton-caption"><span class="sl-designer-skeleton-spinner" aria-hidden="true"></span><span>Loading designer\u2026<small>Preparing your floor plan</small></span></div></div>
3543
3538
  <div class="sl-designer-skeleton-inspector" aria-hidden="true"><div class="sl-designer-skeleton-bar"></div></div>
3544
- </div>`,e.append(i)}buildErrorCard(e,t){let i=um[t],o=document.createElement("div");Object.assign(o.style,{maxWidth:"420px",margin:"auto 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 s=document.createElement("p");s.textContent=i.body,Object.assign(s.style,{margin:"0 0 20px",fontSize:"13.5px",lineHeight:"1.5",color:"#aab4c8"});let a=document.createElement("button");a.type="button",a.textContent="Try again",Object.assign(a.style,{appearance:"none",cursor:"pointer",border:"0",borderRadius:"10px",padding:"10px 22px",fontSize:"14px",fontWeight:"600",color:"#101625",background:"#7aa2ff"}),a.addEventListener("click",()=>this.handleTryAgain()),o.append(r,s,a),e.append(o)}};function Ln(n,e){let t=document.createElement("div");t.className="sl-loading-state";let i=document.createElement("div");if(i.setAttribute("role",e.busy?"status":"alert"),i.setAttribute("aria-atomic","true"),e.busy){let s=document.createElement("div");s.className="sl-boot-spin",s.setAttribute("aria-hidden","true"),t.append(s)}let o=document.createElement("div");if(o.className="sl-boot-title",o.textContent=e.title,i.append(o),e.description){let s=document.createElement("p");s.className="sl-loading-description",s.textContent=e.description,i.append(s)}t.append(i);let r=null;return e.actionLabel&&(r=document.createElement("button"),r.type="button",r.className="sl-boot-retry",r.textContent=e.actionLabel,t.append(r)),n.replaceChildren(t),r}function mm(n){let{viewportWidth:e,viewportHeight:t,offsetTop:i,offsetLeft:o,clientWidth:r,clientHeight:s,innerHeight:a,largeViewportHeight:l}=n;if(![e,t,i,o].every(Number.isFinite)||e<=0||t<=0)return null;let c=Number.isFinite(r)&&r>0?r:e,d=Number.isFinite(s)&&s>0?s:t,p=i;return Number.isFinite(l)&&a>l+1&&d<l-1&&(p=Math.max(p,l-d)),{width:Math.min(e,c),height:Math.min(t,d),top:p,left:o}}function Vl(n){let e=window.visualViewport;if(!e)return()=>{};let t=document.createElement("div");t.setAttribute("aria-hidden","true"),Object.assign(t.style,{position:"absolute",visibility:"hidden",pointerEvents:"none",width:"0",height:"100lvh",overflow:"hidden"}),document.body.appendChild(t);let i=()=>{let c=mm({viewportWidth:e.width,viewportHeight:e.height,offsetTop:e.offsetTop,offsetLeft:e.offsetLeft,clientWidth:document.documentElement.clientWidth,clientHeight:document.documentElement.clientHeight,innerHeight:window.innerHeight,largeViewportHeight:t.getBoundingClientRect().height});c&&Object.assign(n.style,{right:"auto",bottom:"auto",top:`${c.top}px`,left:`${c.left}px`,width:`${c.width}px`,height:`${c.height}px`})},o=0,r=0,s=0,a=()=>{o&&window.cancelAnimationFrame(o),r&&window.cancelAnimationFrame(r),s&&window.clearTimeout(s),o=window.requestAnimationFrame(()=>{o=0,r=window.requestAnimationFrame(()=>{r=0,i()})}),s=window.setTimeout(()=>{s=0,i()},250)},l=()=>{i(),a()};return l(),e.addEventListener("resize",l),e.addEventListener("scroll",l),window.addEventListener("resize",l),window.addEventListener("orientationchange",l),window.addEventListener("pageshow",l),()=>{o&&window.cancelAnimationFrame(o),r&&window.cancelAnimationFrame(r),s&&window.clearTimeout(s),e.removeEventListener("resize",l),e.removeEventListener("scroll",l),window.removeEventListener("resize",l),window.removeEventListener("orientationchange",l),window.removeEventListener("pageshow",l),t.remove()}}function $l(n,e){let t=new Set(["chart","objects","resume","availability"]),i=new Map;return new Proxy(Object.create(n),{get(o,r){let s=n,a=Reflect.get(s,r,s);return typeof a!="function"?a:(i.has(r)||i.set(r,t.has(String(r))?async(...l)=>{let c=await yn(()=>a.apply(s,l),e,()=>{});if(c.outcome==="loaded")return c.value;if(c.outcome==="error")throw c.error;let d=new Error(c.outcome==="timeout"?"request_timeout":"request_cancelled");throw d.name=c.outcome==="timeout"?"TimeoutError":"AbortError",d}:a.bind(s)),i.get(r))}})}var O=require("@seatlayer/core"),$o=require("@seatlayer/core/view3d/crossfade/panorama");function zl(n){return!!n&&n.clientWidth>0&&n.scrollWidth>n.clientWidth+1}function fm(n){return n.some(e=>zl(e))}var So="data-fit-gone",gm=12;function Hr(n,e,t=zl){if(!n)return 0;for(let i of e)n.classList.remove(i.cls);if(n.querySelectorAll(`[${So}]`).forEach(i=>{i.removeAttribute(So),i.hidden=!1}),n.dataset.fit="0",n.clientWidth<=0||!t(n))return 0;for(let i=0;i<e.length;i+=1){let o=e[i];i>0&&n.classList.remove(e[i-1].cls),n.classList.add(o.cls),n.dataset.fit=String(i+1);let r=o.give?o.give(n):!0;if(!t(n))return i+1;if(o.repeat&&o.give){for(let s=1;r&&s<gm;s+=1)if(r=o.give(n),!t(n))return i+1}}return e.length}function bm(n,e="[data-fit-seg]"){let t=[...n.querySelectorAll(e)].filter(i=>!i.hidden);return t.length<2?!1:jl(t[t.length-1])}function ym(n,e){let t=n.querySelector(e);return t&&!t.hidden?jl(t):!1}function jl(n){let e=n.previousElementSibling;return e instanceof HTMLElement&&e.tagName==="I"&&(e.setAttribute(So,""),e.hidden=!0),n.setAttribute(So,""),n.hidden=!0,!0}function vm(n){if(!n)return!1;let e=(n.getAttribute("aria-label")||n.textContent||"").trim();return e?(n.setAttribute("aria-label",e),n.setAttribute("title",e),!0):!1}function Kl(n){if(!n)return 0;let e=n.querySelector(".sl-confirm-cancel"),t=n.querySelector(".sl-confirm-add-t");return Hr(n,[{cls:"sl-fit-track"},{cls:"sl-fit-type"},{cls:"sl-fit-icon",give:()=>vm(e)}],()=>fm([e,t]))}function Gl(n){return Hr(n,[{cls:"sl-fit-notype",give:e=>ym(e,"[data-fit-type]")},{cls:"sl-fit-short",give:e=>bm(e),repeat:!0}])}function Ul(n){return n?(n.classList.add("sl-fitpill"),Hr(n,[{cls:"sl-fit-p1"},{cls:"sl-fit-p2"},{cls:"sl-fit-p3"}])):0}var Hn;function ql(n){if(!n)return!1;delete n.dataset.fit;let e=n.selectedOptions?.[0]?.textContent??n.options[n.selectedIndex]?.textContent??"",t=n.clientWidth;if(!e||!t)return!1;if(Hn===void 0)try{Hn=document.createElement("canvas").getContext("2d")}catch{Hn=null}if(!Hn)return!1;let i=getComputedStyle(n);Hn.font=`${i.fontStyle} ${i.fontWeight} ${i.fontSize} ${i.fontFamily}`;let o=Hn.measureText(e).width,r=(parseFloat(i.paddingLeft)||0)+(parseFloat(i.paddingRight)||0)+(parseFloat(i.borderLeftWidth)||0)+(parseFloat(i.borderRightWidth)||0);return o+r<=t?!1:(n.dataset.fit="row",!0)}var wm=["on-sale","low","sold-out","presale","closed"];function pi(n){return n==null?null:typeof n=="number"&&Number.isFinite(n)&&n>=0?n:void 0}function Rr(n){return n==null?null:typeof n=="number"&&Number.isFinite(n)&&n>=0?n:void 0}function Wl(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 o=e.remaining;if(o!=null&&(typeof o!="number"||!Number.isInteger(o)||o<0))return;let r={index:i,count:t,remaining:o??null};if(e.pricingMode!==void 0){if(e.pricingMode!=="matrix")return;r.pricingMode="matrix"}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 s of["startsAt","endsAt"]){if(e[s]===void 0)continue;let a=Rr(e[s]);if(a===void 0)return;r[s]=a}return r}function xm(n){if(n==null)return null;if(typeof n!="object"||Array.isArray(n))return;let e=n;if(!Number.isInteger(e.assignmentVersion)||e.assignmentVersion<0||!Array.isArray(e.channels)||!Array.isArray(e.objects))return;let t=[],i=new Set;for(let s of e.channels){if(!s||typeof s!="object"||Array.isArray(s))return;let a=s,l=typeof a.channelId=="string"?a.channelId.trim():"";if(!l||i.has(l)||!Number.isInteger(a.pricingVersion)||a.pricingVersion<0||!Array.isArray(a.priceOverrides))return;let c=[],d=new Set;for(let p of a.priceOverrides){if(!p||typeof p!="object"||Array.isArray(p))return;let u=p,h=typeof u.categoryKey=="string"?u.categoryKey.trim():"",b=u.tierId===null?null:typeof u.tierId=="string"&&u.tierId.trim()?u.tierId.trim():void 0,f=pi(u.price);if(!h||b===void 0||f===void 0||f===null)return;let T=`${h}\0${b??""}`;if(d.has(T))return;d.add(T),c.push({categoryKey:h,tierId:b,price:f})}i.add(l),t.push({channelId:l,pricingVersion:a.pricingVersion,priceOverrides:c})}let o=[],r=new Set;for(let s of e.objects){if(!s||typeof s!="object"||Array.isArray(s))return;let a=s,l=typeof a.label=="string"?a.label.trim():"",c=typeof a.channelId=="string"?a.channelId.trim():"";if(!l||r.has(l)||!i.has(c))return;r.add(l),o.push({label:l,channelId:c})}return{assignmentVersion:e.assignmentVersion,channels:t,objects:o}}function To(n){if(!n||typeof n!="object"||Array.isArray(n))return null;let e=n,t=wm.find(p=>p===e.state);if(!t)return null;let i=pi(e.fromPrice),o=pi(e.previousPrice);if(i===void 0||o===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 s=Wl(e.release);if(s===void 0)return null;let a=e.upcoming===void 0?null:Wl(e.upcoming);if(a===void 0)return null;let l=[];if(e.prices!=null){if(!Array.isArray(e.prices))return null;let p=[];for(let u of e.prices){if(!u||typeof u!="object"||Array.isArray(u))return null;let h=u,b=typeof h.categoryKey=="string"?h.categoryKey.trim():"";if(!b)return null;let f=pi(h.price),T=pi(h.previousPrice);if(f==null||T===void 0)return null;let w={categoryKey:b,price:f,previousPrice:T};if(h.tierId!==void 0){if(h.tierId!==null&&(typeof h.tierId!="string"||!h.tierId.trim()))return null;w.tierId=h.tierId===null?null:h.tierId.trim()}if(h.offerId!==void 0){if(typeof h.offerId!="string"||!h.offerId.trim())return null;w.offerId=h.offerId.trim()}if(h.offerName!==void 0){if(typeof h.offerName!="string"||!h.offerName.trim())return null;w.offerName=h.offerName.trim()}if(h.remaining!==void 0){if(h.remaining!==null&&(typeof h.remaining!="number"||!Number.isInteger(h.remaining)||h.remaining<0))return null;w.remaining=h.remaining==null?null:h.remaining}for(let v of["startsAt","endsAt"]){if(h[v]===void 0)continue;let M=Rr(h[v]);if(M===void 0)return null;w[v]=M}p.push(w)}l=p}let c=xm(e.channelPricing);if(c===void 0)return null;let d=Rr(e.nextPriceChangeAt);return d===void 0?null:{state:t,fromPrice:i,previousPrice:o,currency:r,release:s,upcoming:a,prices:l,channelPricing:c,...e.nextPriceChangeAt!==void 0?{nextPriceChangeAt:d}:{}}}function Yl(n){return n?.changed!==!1}function Xl(n,e){if(!n)return null;let t=null,i=o=>{o!=null&&o>e&&(t===null||o<t)&&(t=o)};for(let o of[n.release,n.upcoming])i(o?.startsAt),i(o?.endsAt);for(let o of n.prices)i(o.startsAt),i(o.endsAt);return i(n.nextPriceChangeAt),t}function Ir(n){let e={};for(let t of n?.prices??[])if(t.tierId==null)e[t.categoryKey]=t.price;else{let i=e[t.categoryKey],o=typeof i=="number"?{base:i}:i??{};e[t.categoryKey]={...o,tiers:{...o.tiers,[t.tierId]:t.price}}}return e}function Ql(n,e){let t={...n};for(let[i,o]of Object.entries(Ir(e))){let r=t[i];t[i]=typeof o=="number"?o:{...typeof r=="number"?{base:r}:r,...o,tiers:{...typeof r=="object"?r.tiers:{},...o.tiers}}}return t}var Jl=require("@seatlayer/core");var Zl="maintenance_mode";function km(n){if(!n||typeof n!="object")return!1;let e=n;return e.reason===Zl||e.code===Zl}function Sm(n){return typeof n!="number"||!Number.isFinite(n)||n<0?null:Math.max(1,Math.ceil(n/60))}function Or(n){if(!km(n))return null;if(typeof n.notice=="string"&&n.notice.trim())return n.notice.trim();let e=Sm(n.retryAfterS);if(e===null)return y("picker.maintenancePausedShortly","Booking is paused for a few minutes for maintenance. Please try again shortly.");let t=(0,Jl.tCount)("picker.maintenancePaused",e);return t==="picker.maintenancePaused"?`Booking is paused for maintenance. Please try again in about ${e} minute${e===1?"":"s"}.`:t}function ec(n){return n.focusedSection!==null?n.deeperThanSectionFrame===!1?"venue":"section":n.atVenueFit!==void 0?n.atVenueFit?"none":"venue":n.seatsRevealed?"venue":"none"}var tc=["pointerdown","pointermove","keydown","wheel","touchstart"],Eo=class{constructor(e){this.opts=e;this.timer=null;this.root=null;this.doc=null;this.disposed=!1;this.onInput=()=>this.touch();this.onVisibility=()=>{this.doc&&!this.doc.hidden&&this.check()};this.lastInput=this.now()}get enabled(){return this.opts.minutes>0}now(){return this.opts.now?this.opts.now():Date.now()}attach(e,t=e.ownerDocument){if(!(this.disposed||!this.enabled)){this.root=e,this.doc=t;for(let i of tc)e.addEventListener(i,this.onInput,{capture:!0,passive:!0});t.addEventListener("visibilitychange",this.onVisibility),this.touch()}}touch(){this.lastInput=this.now(),this.arm(this.opts.minutes*6e4)}recentlyActive(){return!this.enabled||this.now()-this.lastInput<this.opts.minutes*6e4}resume(){this.disposed||this.touch()}dispose(){if(this.disposed=!0,this.clear(),this.root)for(let e of tc)this.root.removeEventListener(e,this.onInput,{capture:!0});this.doc?.removeEventListener("visibilitychange",this.onVisibility),this.root=null,this.doc=null}arm(e){if(this.disposed||!this.enabled)return;this.clear();let t=this.opts.setTimeout??((i,o)=>setTimeout(i,o));this.timer=t(()=>{this.timer=null,this.check()},Math.max(0,e))}clear(){if(this.timer===null)return;(this.opts.clearTimeout??(t=>clearTimeout(t)))(this.timer),this.timer=null}check(){if(this.disposed||!this.enabled)return;let e=this.lastInput+this.opts.minutes*6e4-this.now();if(e>0){this.arm(e);return}if(this.opts.blocked()){this.arm(6e4);return}this.clear(),this.opts.onIdle()}};async function nc(n,e){let t=await n.pubApi?.pickerIdleMinutes().catch(()=>null)??null;if(n.destroyed||n.idleClock)return;let i=new Eo({minutes:t??30,blocked:()=>!!n.hold,onIdle:()=>ic(n)});i.enabled&&(n.idleClock=i,i.attach(e))}function ic(n){n.destroyed||!n.root||n.holdExpiredEl||(n.realtime?.stop(),n.realtime=null,n.showAccessPanel({reason:"idle",retryable:!0}))}async function oc(n){if(n.destroyed)return!1;if(n.pubApi?.rotateViewerId(),n.access?.configured){let e=await n.refreshAccess();return e&&n.idleClock?.resume(),e}return n.dismissAccessPanel(),await n.controller.refresh(),n.realtime?n.realtime.restart():n.startRealtime(),n.idleClock?.resume(),!0}function rc(n){if(!n.destroyed){if(n.hold||n.idleClock?.recentlyActive()){n.pubApi?.rotateViewerId(),n.realtime?.restart();return}ic(n)}}function sc(n,e,t=[],i=8,o=[]){let r=e.reduce((l,c)=>!c||c.width<=0||c.height<=0?l:Math.max(l,c.bottom-n.top+i),0),s=t.reduce((l,c)=>!c||c.width<=0||c.height<=0?l:Math.max(l,n.bottom-c.top+i),r>0?i:0),a=o.reduce((l,c)=>!c||c.width<=0||c.height<=0?l:Math.max(l,n.right-c.left+i),0);return{top:Math.max(0,Math.ceil(r)),right:Math.max(0,Math.ceil(a)),bottom:Math.max(0,Math.ceil(s)),left:0}}function ac(n){let e=document.createElement("div");e.className="sl-floors sl-levels on",e.setAttribute("role","group"),e.setAttribute("aria-label",n.tf("picker.chooseLevel","Choose level")),e.title=n.tf("picker.floorHelp","All levels shows the complete venue. Choose one level to inspect and select its seats.");let t=n.tf("picker.allLevels","All levels"),i=[...n.floors.map((o,r)=>({id:o.id,name:o.name,code:Tm(r)})).reverse(),{id:"",name:t,code:""}];for(let o of i){let r=document.createElement("button");if(r.type="button",r.className="sl-level",r.dataset.level=o.id,r.setAttribute("aria-pressed","false"),r.title=o.name,o.code){let a=document.createElement("b");a.className="sl-level-code",a.textContent=o.code,r.appendChild(a),r.setAttribute("aria-label",`${o.name} (${o.code})`)}let s=document.createElement("span");if(s.className="sl-level-name",s.textContent=o.name,r.appendChild(s),!o.code){let a=document.createElement("span");a.className="sl-level-short",a.setAttribute("aria-hidden","true"),a.textContent=n.tf("picker.allLevelsShort","All"),r.appendChild(a)}r.addEventListener("click",()=>n.onChoose(o.id)),e.appendChild(r)}return e.addEventListener("keydown",o=>{if(o.key!=="ArrowUp"&&o.key!=="ArrowDown")return;let r=[...e.querySelectorAll(".sl-level")],s=r.indexOf(document.activeElement);s<0||(o.preventDefault(),r[Math.max(0,Math.min(r.length-1,s+(o.key==="ArrowUp"?-1:1)))].focus())}),e}function Tm(n){return n===0?"G":String(n)}function lc(n,e,t){if(!n)return;let i=t?"":e;for(let o of n.querySelectorAll(".sl-level"))o.setAttribute("aria-pressed",String(o.dataset.level===i))}var Co=class{constructor(e){this.el=null;this.current=null;this.collapsed=!1;this.shownAt=0;this.host=e}get summary(){return this.current}adopt(e){this.current=e}get element(){return this.el}show(e){if(e&&e.id!==this.current?.id&&this.host.collapseSheet(),this.current=e,!e){this.el?.remove(),this.el=null,this.host.refreshMinimap();return}this.collapsed=this.host.controller.getRung()==="seats",this.shownAt=Date.now(),this.render(e),this.host.refreshMinimap()}render(e){this.el?.remove(),this.el=null}collapse(){!this.el||this.collapsed||!this.current||(this.collapsed=!0,this.render(this.current))}onView(){if(!(!this.el||this.collapsed||!this.current)){if(this.host.controller.getRung()==="seats"){this.collapse();return}if(Date.now()-this.shownAt<1400){this.coverage()>.25&&this.collapse();return}this.collapse()}}coverage(){let e=this.el,t=this.current,i=this.host.map();if(!e||!t||!i)return 0;let o=this.host.activeFloorObjects().find(v=>v.type==="section"&&v.id===t.id)?.outline;if(!o||o.length<3)return 0;let r=o.map(v=>this.host.controller.worldToScreen(v)),s=r.map(v=>v.x),a=r.map(v=>v.y),l=Math.min(...s),c=Math.min(...a),d=Math.max(...s)-l,p=Math.max(...a)-c;if(d<=0||p<=0)return 0;let u=i.getBoundingClientRect(),h=e.getBoundingClientRect(),b=h.left-u.left,f=h.top-u.top,T=Math.max(0,Math.min(b+h.width,l+d)-Math.max(b,l)),w=Math.max(0,Math.min(f+h.height,c+p)-Math.max(f,c));return T*w/(d*p)}};var In=require("@seatlayer/core"),Oc=require("@seatlayer/core/core/color");var Tt=require("@seatlayer/core");function _r(n,e,t){try{return new Intl.DateTimeFormat(e,{...t,...n.timezone?{timeZone:n.timezone}:{}}).format(new Date(n.startsAt))}catch{return new Date(n.startsAt).toLocaleString(e)}}var Ao=(n,e)=>_r(n,e,{dateStyle:"medium"}),Po=(n,e)=>_r(n,e,{timeStyle:"short"}),Rn=(n,e)=>_r(n,e,{weekday:"short",day:"numeric",month:"short"});function cc(n,e,t,i){return!n.length||n.length>=e?null:{summary:i,labels:n.map(o=>`${Ao(o,t)} \xB7 ${Po(o,t)}`)}}function Em(n,e){let t=new Set(e);return n.map(i=>({...i,free:!t.has(i.eventKey)}))}function dc(n,e){let t=[...n];if(t.length<=1)return t[0]??"";try{return new Intl.ListFormat(e,{style:"long",type:"conjunction"}).format(t)}catch{return t.join(", ")}}function Cm(n,e,t="",i=!1){if(!n.length)return"";let o=n.map(r=>{let s=r.free?e.free:e.blocked,a=i&&r.free?`<input class="sl-night-choice" type="checkbox" data-pg-event-key="${L(r.eventKey)}" aria-label="${L(`${r.shortDate}: ${s}`)}" checked>`:"";return`<li class="sl-night${r.free?" ok":" no"}" aria-label="${L(`${r.shortDate}: ${s}`)}">`+a+`<i class="sl-night-dot" aria-hidden="true"></i><span class="d">${L(r.shortDate)}</span><span class="st">${L(s)}</span></li>`}).join("");return`<div class="sl-tip-nights"><div class="sl-tip-nights-title">${L(e.title)}</div><ul class="sl-nightstrip">${o}</ul><p class="sl-tip-nights-note">${L(e.notAvailableOn)}</p>`+t+"</div>"}function Am(n){return n.selectPartialLabel&&n.pinned?`<button type="button" class="sl-tip-switch" data-pg-select-partial>${L(n.selectPartialLabel)}</button>`:n.switchLabel&&n.pinned?`<button type="button" class="sl-tip-switch" data-pg-switch-mode>${L(n.switchLabel)}</button>`:n.switchLabel||n.selectPartialLabel?"":`<p class="sl-tip-advice">${L(n.advice)}</p>`}function Pm(n){return Number(n.available)+Number(n.selected)+Number(n.partial)+Number(n.unavailable)}function pc(n,e,t){if(Pm(n)<2)return"";let i=(r,s,a="")=>`<li class="sl-pg-legend-item"><i class="sl-pg-sw ${r}"${a}></i>${L(s)}</li>`,o=[];return n.available&&o.push(i("sl-pg-sw-free",e.available,` style="background:${L(t)}"`)),n.selected&&o.push(i("sl-pg-sw-sel",e.selected)),n.partial&&o.push(i("sl-pg-sw-split",e.partial,` style="--sl-pg-sw-cat:${L(t)}"`)),n.unavailable&&o.push(i("sl-pg-sw-off",e.unavailable)),`<ul class="sl-pg-legend-list" aria-label="${L(e.title)}">${o.join("")}</ul>`}function hc(n,e){if(!n.length)return"";let t=n.map(i=>{let o=i.labels.length?i.labels.join(", "):e.empty;return`<li class="sl-pg-night-row${i.labels.length?"":" empty"}${i.active?" active":""}" role="button" tabindex="0"${i.active?' aria-current="true"':""} data-event-key="${L(i.eventKey)}"><span class="n">${L(i.name)}</span><span class="s">${L(o)}</span></li>`}).join("");return`<div class="sl-pg-nights" role="group" aria-label="${L(e.title)}"><div class="sl-pg-nights-title">${L(e.title)}</div><ul class="sl-pg-nights-list">${t}</ul></div>`}function Nr(n,e){if(n?.kind!=="partial"||!e?.length)return null;let t=n.data?.blockedEventKeys??[],i=Em(e,t);return{states:i,missing:i.filter(o=>!o.free).map(o=>o.shortDate)}}function uc(n,e){return n?Cm(n.states,{title:y("picker.group.partlyAvailableTitle","Free on some nights only"),free:y("picker.group.nightFree","Free"),blocked:y("picker.group.nightBlocked","Not available"),notAvailableOn:(0,Tt.t)("picker.group.notAvailableOn",{dates:dc(n.missing,e.locale)})},Am({switchLabel:e.switchLabel??null,selectPartialLabel:e.selectPartialLabel??null,pinned:e.pinned,advice:y("picker.group.pickSeatFreeEveryNight","Pick a seat that is free every night.")}),!!e.selectPartialLabel&&!!e.pinned):""}function Mm(n,e,t,i){if(!n.length)return"";let o=new Set(e),r=new Set(t),s=n.map(a=>{let l=o.has(a.eventKey);return`<li class="sl-confirm-date${l?"":" blocked"}"><label><input type="checkbox" data-pg-confirm-event-key="${L(a.eventKey)}" aria-label="${L(`${a.shortDate}: ${l?i.available:i.unavailable}`)}"${l&&r.has(a.eventKey)?" checked":""}${l?"":" disabled"}><span class="sl-confirm-date-label">${L(a.shortDate)}</span><span class="sl-confirm-date-state">${L(l?i.available:i.unavailable)}</span></label></li>`}).join("");return`<fieldset class="sl-confirm-dates" data-pg-confirm-dates><legend>${L(i.title)}</legend><p class="sl-confirm-dates-copy">${L(i.copy)}</p><label class="sl-confirm-date-all"><input type="checkbox" data-pg-confirm-all><span>${L(i.selectAll)}</span></label><ul>${s}</ul><p class="sl-confirm-dates-summary" data-pg-confirm-summary aria-live="polite"></p></fieldset>`}function mc(n,e,t,i){let o=e.availableEventKeys(t);return Mm(n,o,e.includedEventKeys(),{title:i("picker.group.confirmDatesTitle","Choose performance dates"),copy:o.length===n.length?i("picker.group.confirmAllDatesCopy","This seat is available for all {count} dates. Keep all selected, or remove dates you do not want.").replace("{count}",String(n.length)):i("picker.group.confirmPartialDatesCopy","This seat is available for {available} of {total} dates. Choose one date or keep every available date.").replace("{available}",String(o.length)).replace("{total}",String(n.length)),selectAll:i("picker.group.confirmSelectAll","Select all available dates"),available:i("picker.group.nightFree","Available"),unavailable:i("picker.group.nightBlocked","Unavailable")})}function fc(n){return[...n.querySelectorAll("[data-pg-confirm-event-key]")].filter(e=>e.checked&&!e.disabled).map(e=>e.dataset.pgConfirmEventKey).filter(Boolean)}function gc(n,e,t,i){let o=[...n.querySelectorAll("[data-pg-confirm-event-key]")];if(!e||!o.length)return;let r=n.querySelector(".sl-confirm-add"),s=n.querySelector("[data-pg-confirm-all]"),a=()=>{let l=o.filter(p=>!p.disabled),c=fc(n).length;s&&(s.checked=c===l.length,s.indeterminate=c>0&&c<l.length);let d=n.querySelector("[data-pg-confirm-summary]");d&&(d.textContent=c===l.length?t("picker.group.confirmAllSelected","All {count} available dates are selected.").replace("{count}",String(c)):t("picker.group.confirmSelectedOfAvailable","{selected} of {available} available dates selected.").replace("{selected}",String(c)).replace("{available}",String(l.length))),r.disabled=c===0,r.textContent=c?e.label(c):t("picker.group.confirmChooseOne","Choose at least 1 date"),i()};o.forEach(l=>l.addEventListener("change",a)),s?.addEventListener("change",()=>{o.filter(l=>!l.disabled).forEach(l=>{l.checked=s.checked}),a()}),a()}async function bc(n,e,t){if(!n||!t||!n.querySelector("[data-pg-confirm-event-key]"))return!0;let i=fc(n);if(!i.length)return!1;let o=n.querySelector(".sl-confirm-add");return o?.setAttribute("aria-busy","true"),o&&(o.disabled=!0),await t.apply(e,i)?!0:(o?.removeAttribute("aria-busy"),o?.isConnected&&(o.disabled=!1),!1)}function yc(n,e,t){return n?(0,Tt.t)("picker.group.seatPartlyAvailable",{label:e,free:n.states.length-n.missing.length,total:n.states.length,dates:dc(n.missing,t)}):""}function vc(n,e){let t=n.map((i,o)=>{let r=i.state==="done"?e.done:i.state==="current"?e.current:e.upcoming;return`<li class="sl-pg-step-item" data-step="${L(i.id)}" data-state="${L(i.state)}"${i.state==="current"?' aria-current="step"':""}><span class="i" aria-hidden="true">${i.state==="done"?"\u2713":String(o+1)}</span><span class="l">${L(i.label)}</span><span class="sl-pg-sr">${L(r)}</span></li>`}).join("");return`<ol class="sl-pg-steps" aria-label="${L(e.label)}">${t}</ol>`}function Dr(n,e){return`<ul class="sl-pg-cards">${n.map(i=>`<li class="sl-pg-card" data-event-key="${L(i.eventKey)}"><span class="n">${L(i.name)}</span><time datetime="${L(i.iso)}"><span class="d">${L(i.date)}</span><span class="t">${L(i.time)}</span></time></li>`).join("")}</ul><p class="sl-pg-included">${L(e)}</p>`}function wc(n){let e=n.rows.map(t=>`<li class="sl-pg-pane-row${t.labels.length?"":" empty"}" data-event-key="${L(t.eventKey)}"><span class="n">${L(t.name)}</span><span class="s">${L(t.labels.length?t.labels.join(", "):n.empty)}</span></li>`).join("");return`<div class="sl-pg-pane-title">${L(n.title)}</div><ul class="sl-pg-pane-list">${e}</ul>`+(n.note?`<p class="sl-pg-pane-note">${L(n.note)}</p>`:"")+(n.total?`<div class="sl-pg-pane-total"><span>${L(n.total.label)}</span><b>${L(n.total.amount)}</b></div>`:"")+(n.holdStatus?`<p class="sl-pg-hold-status" role="status">${L(n.holdStatus)}</p>`:"")}function xc(n){let e=Math.max(0,n);return`${Math.floor(e/6e4)}:${String(Math.floor(e/1e3)%60).padStart(2,"0")}`}function kc(n,e){if(!n||n.seats<=0)return"";if(e==="same_seat"){let t=n.perPerformance??n.seats;return n.totalPerformances&&n.performances<n.totalPerformances?(0,Tt.tCount)("picker.group.performancesChosenOf",t,{chosen:n.performances,total:n.totalPerformances}):(0,Tt.tCount)("picker.group.seatsEveryPerformance",t)}return n.perPerformance!=null&&n.performancesChosen===n.performances?(0,Tt.tCount)("picker.group.seatsPerPerformance",n.seats,{per:n.perPerformance}):(0,Tt.tCount)("picker.group.performancesChosenOf",n.seats,{chosen:n.performancesChosen,total:n.performances})}function Sc(n,e){n.querySelectorAll(".sl-pg-night-row[data-event-key]").forEach(t=>{let i=()=>e(t.dataset.eventKey);t.addEventListener("click",i),t.addEventListener("keydown",o=>{o.key!=="Enter"&&o.key!==" "||(o.preventDefault(),i())})})}function Et(n){return String(n??"\u2014").replace(/[&<>"]/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[e])}function Lm(n,e){let t=n.objectType==="table"&&!!n.bookingMode,i=n.objectType==="booth",o=t||i||!n.seatNumber,r=o?n.rowLabel??n.displayLabel??n.label:n.seatNumber,s=t?`${y("picker.guests","Guests")} ${n.bookingMode==="variable"?`${n.minOccupancy}\u2013${n.maxOccupancy}`:n.capacity}`:!i&&n.rowLabel?`${e} ${fe(n)??""}`.trim():"";return`<div class="sl-tip-head"><div class="sl-tip-id"><span class="sl-tip-seat${o?" name":""}">${Et(r)}</span>`+(s?`<span class="sl-tip-row">${Et(s)}</span>`:"")+"</div>"+(n.sectionLabel?`<div class="sl-tip-sec"><span class="sl-tip-eyebrow">${y("picker.section","Section")}</span><span class="sl-tip-secname">${Et(n.sectionLabel)}</span></div>`:"")+"</div>"}function Tc(n,e){let t=n.status==="not_for_sale",i=n.mark?.kind==="partial",o=n.status==="free"||i?"":`<span class="sl-tip-tag">${e.ownHold?y("picker.heldForYou","Held for you"):y("picker.group.legendUnavailable","Unavailable")}</span>`,r=t?"":e.price,s=r?`<span class="sl-tip-amt">${Et(r)}</span>`:"",a=!r&&e.priceNote?`<div class="sl-tip-note">${Et(e.priceNote)}</div>`:"",l=$t(n,{compact:!0}),c=e.reason?`<div class="sl-tip-reason">${Et(e.reason)}</div>`:"";return'<i class="sl-tip-rail" aria-hidden="true"></i>'+Lm(n,e.rowTypeWord)+`<div class="sl-tip-cat"><span class="sl-tip-dot" style="background:${Et(n.categoryColor)}"></span><span class="sl-tip-name">${Et(n.categoryLabel)}</span>`+o+s+"</div>"+a+c+l+(e.extra??"")}function Ec(n,e,t,i){let o=n.x+14,r=n.y-i.height-12,s=n.y+18,a=r;o+i.width>e-8&&(o=n.x-i.width-14),r<8&&s+i.height<=t-8&&(a=s);let l=Math.max(8,t-i.height-8);return{left:Math.max(8,Math.min(o,Math.max(8,e-i.width-8))),top:Math.max(8,Math.min(a,l))}}function Cc(n,e,t,i=22){let o=Math.max(8,Math.min(n.x-t.width/2,Math.max(8,e.width-t.width-8))),r=n.y-i-t.height,s=n.y+i;return r>=8?{left:o,top:r,placement:"above"}:s+t.height<=e.height-8?{left:o,top:s,placement:"below"}:{left:o,top:Math.max(8,Math.min(r<8?s:r,Math.max(8,e.height-t.height-8))),placement:r<8?"below":"above"}}var Br=14,Hm=12,Rm=12,Im=8;function Ac(n,e,t,i=Hm){let o=e.height-Br-t.height,r=Rm,s=o-i;if(s<=r)return{placement:"sheet",nudgeY:0};let a=(r+s)/2-n;return Math.abs(a)<=Im?{placement:"sheet",nudgeY:0}:{placement:"sheet",nudgeY:Math.round(a)}}function Pc(n,e,t,i,o=0){let r=t.width/2+12,s=Math.max(r,Math.min(e.width-r,n.x)),a=n.y+o+t.height+24<=e.height,l=n.y-o<t.height+24&&a?"below":"above",c=l==="above"?n.y-o:n.y+o,d=i&&l==="above"?Math.max(t.height+24,c):c;return{left:s,top:Math.max(8,Math.min(e.height-8,d)),placement:l}}function Mc(n,e,t){let i=n.querySelector("[data-pg-select-partial]"),o=[...n.querySelectorAll("[data-pg-event-key]")],r=()=>o.filter(a=>a.checked).map(a=>a.dataset.pgEventKey).filter(Boolean),s=()=>{if(!i)return;let a=r().length;i.disabled=a===0,i.textContent=e?.(a)??i.textContent};o.forEach(a=>{a.addEventListener("change",s);let l=a.closest(".sl-night");l?.classList.add("selectable"),l?.addEventListener("click",c=>{c.target!==a&&(a.checked=!a.checked,s())})}),i?.addEventListener("click",()=>{let a=r();a.length&&t?.(a)})}function qt(n){let e=n?.displayType?.trim()||n?.rowType?.trim();return e||(n?.objectType==="table"?y("picker.table","Table"):n?.objectType==="booth"?y("picker.booth","Booth"):y("picker.row","Row"))}var Om="sl-confirm-scrim",_m="--sl-scrim-mask";function Nm(n){let e=Math.round(n.x),t=Math.round(n.y);return`radial-gradient(circle at ${e}px ${t}px, transparent 0 56px, #000 88px)`}function Lc(n,e,t,i){let o=n??document.createElement("div");return n||(o.className=Om),o.style.setProperty(_m,Nm(i)),t.parentNode===e?o.nextSibling!==t&&e.insertBefore(o,t):o.parentNode!==e&&e.appendChild(o),o}function Fr(n){return n?.remove(),null}var Hc={passport:!1,compare:!1},Dm=360,Bm=160,Fm=700,Rc=450,Vm=8;function Ic(){try{return globalThis.matchMedia?.("(pointer: coarse)").matches??!1}catch{return!1}}function $m(n){return(0,Oc.contrastRatio)("#ffffff",n)>=3?"#ffffff":"#0b0f19"}var Mo=class{constructor(e){this.el=null;this.seat=null;this.outsideTap=null;this.scrim=null;this.shownAt=0;this.lift=null;this.framing=null;this.mode="add";this.host=e}get element(){return this.el}set element(e){this.el=e}get candidate(){return this.seat}set candidate(e){this.seat=e}thumbHtml(e){let t=this.host.controller.doc;if(!t)return"";let i=Mn(e)?e.viewUrl??"":"",o=vo(t);if(!i&&!o)return"";let r=i?null:wo(e,e.focalPoint??t.focalPoint);if(!i&&r==null)return"";let s="";if(!i)return s;let a=q((0,In.t)("picker.viewFromSeat",{label:e.label})),l=q(this.host.tf("picker.viewFromHere","View from here"));return`<button type="button" class="sl-confirm-view sl-confirm-thumbwrap" aria-label="${a}"><img class="sl-confirm-thumb" alt="" /><span class="sl-confirm-thumb-badge">\u{1F52D} ${l}</span></button>`+s}show(e,t="add"){let i=this.host;this.mode=t;let o=this.seat?.id;this.el?.remove(),this.el=null,this.seat=e,i.root()?.setAttribute("data-confirming","true"),i.els().side?.toggleAttribute("inert",!0),Object.values(i.regions()).forEach(P=>P.toggleAttribute("inert",!0)),i.controller.setSelectionFocus(e.id),o&&o!==e.id&&i.controller.deselect([o]),i.hideTooltip();let r=i.controller.seatDetails(e.id),s=i.controller.doc?.categories.find(P=>P.key===e.categoryKey),a=r?.price??(s?.tiers?.length?s.tiers[0].price:s?.price),l=a!=null?i.paidPrice(e.categoryKey,r?.tierId??s?.tiers?.[0]?.id??null,a,e.label):void 0,c=ka(r,e.displayLabel??e.label,qt(r)),d=r?.tiers??s?.tiers??[],p=r?.tierId??d[0]?.id,u=i.suppressPricing()?"":zi(d,p,P=>i.money(i.paidPrice(e.categoryKey,P.id,P.price,e.label)),P=>i.offerName(e.categoryKey,P.id)),h=i.buyerView()==="venue3d",b=i.performanceGroup()?.confirmDateSelection??void 0,f=b?i.performanceGroup()?.nights?.()??[]:[],T=b?mc(f,b,e.id,(P,z)=>i.tf(P,z)):"";this.shownAt=performance.now();let w=document.createElement("div");w.className="sl-confirm sl-mo-in",t==="remove"&&w.classList.add("sl-confirm-removing"),T&&w.classList.add("sl-confirm-group-dates"),w.setAttribute("role","dialog"),w.setAttribute("aria-label",(0,In.t)("picker.confirmSeatLabel",{label:e.label}));let v=i.controller.getRenderer?.()?.categoryDisplayColor?.(e.categoryKey)??s?.color??"#6e7bff";w.style.setProperty("--sl-cat",v),w.style.setProperty("--sl-cat-ink",$m(v));let M=String(r?.categoryLabel??s?.label??e.categoryKey),F=i.controller.categoryAvailability()[e.categoryKey],X=typeof F=="number"&&F>0?(0,In.tCount)("picker.leftCount",F):"",g=i.suppressPricing()?`${r?.displayLabel??e.displayLabel??e.label}`:`${r?.displayLabel??e.displayLabel??e.label} \xB7 ${l==null?i.tf("picker.priceNotSupplied","Price not supplied"):i.money(l)}`,_=Hc.passport?xa(e,g,h):"",G=Hc.compare?wa(e,h?i.view3dCompareSeatIds():null):"";w.innerHTML=Ca({identityFields:c,identity:Sa(r,e.displayLabel??e.label,qt(r)),marker:va({...r?.wheelchairSpaceType?{wheelchairSpaceType:r.wheelchairSpaceType}:{}}),see3dPill:Ta(i.canOffer3d(),h),categoryColor:v,categoryLabel:M,priceLabel:!i.suppressPricing()&&l!=null?i.money(l):"",categoryLeftLabel:X,tierChoices:u,groupDates:T,wheelchair:"",commercial:$t({...e.accessibility?.length?{accessibility:e.accessibility}:{},...r?.wheelchairSpaceType?{wheelchairSpaceType:r.wheelchairSpaceType}:{},...e.commercial?{commercial:e.commercial}:{},...r?.aisle?{aisle:!0}:{},...r?.boothType?{boothType:r.boothType}:{},...r?.entrance?{entrance:r.entrance}:{}}),thumb:i.seatViewEnabled()&&i.buyerView()!=="venue3d"?this.thumbHtml(e):"",inspect:h?`<div class="sl-confirm-inspect-row">${_}${G}${ar(i.canOffer3d(),h)}</div>`:ar(i.canOffer3d(),h),see3dRow:Ea(i.canOffer3d(),h),cancelLabel:(0,In.t)("common.cancel"),selectLabel:t==="remove"?i.tf("picker.removeSeat","Remove seat"):i.addSeatLabel(r?.objectType)}),t==="remove"&&w.querySelector(".sl-confirm-add svg path")?.setAttribute("d","M6 6l12 12M18 6L6 18"),i.els().map.appendChild(w),this.el=w;let N=w.querySelector(".sl-confirm-thumb"),j=N?.closest(".sl-confirm-thumbwrap")??null;if(N&&j){let P=!1,z=()=>{if(P||!j.isConnected)return;P=!0;let W=()=>{j.remove(),this.el===w&&i.reanchor()};if(i.reducedMotion()||typeof requestAnimationFrame!="function"){W();return}j.style.height=`${j.offsetHeight}px`,j.classList.add("sl-confirm-thumb-out"),requestAnimationFrame(()=>{j.style.height="0px",j.style.opacity="0"}),setTimeout(W,Bm)};N.addEventListener("error",z),N.addEventListener("load",()=>{N.naturalWidth||z()});let ee=e.viewMeta?.previewUrl??e.viewUrl;ee?i.resolveAssetUrl(ee).then(W=>{if(!(!w.isConnected||this.el!==w)){if(!W){z();return}N.src=W}}).catch(W=>{z(),i.onError(W)}):z()}i.reanchor(),this.liftSeatClearOfSheet(e),w.querySelector(".sl-confirm-view")?.addEventListener("click",()=>{i.openSeatView(e)}),w.querySelector(".sl-confirm-confidence")?.addEventListener("click",P=>{i.openSeatConfidencePassport(e,P.currentTarget instanceof HTMLElement?P.currentTarget:null)}),w.querySelector(".sl-confirm-compare")?.addEventListener("click",()=>i.saveView3dComparisonSeat(e)),w.querySelectorAll("[data-confirm-tier]").forEach(P=>{P.addEventListener("click",()=>{let z=P.dataset.confirmTier,ee=d.find(re=>re.id===z);if(!ee)return;i.controller.setSeatTier(e.id,ee.id),w.querySelectorAll("[data-confirm-tier]").forEach(re=>{re.setAttribute("aria-pressed",String(re===P))});let W=w.querySelector(".sl-confirm-price");W&&(W.textContent=i.money(i.paidPrice(e.categoryKey,ee.id,ee.price,e.label))),i.reanchor()})}),w.querySelectorAll(".sl-confirm-3d,.sl-confirm-3dpill,.sl-confirm-3drow").forEach(P=>{P.addEventListener("pointerdown",Ni,{once:!0}),P.addEventListener("click",()=>{i.buyerView()==="venue3d"?(i.dismiss(),i.view3dHandle()?.flyToSeat(e.id)):(i.rememberView3dReturnSeat(e),i.dismiss(),i.enter3d(e.id))})}),gc(w,b,(P,z)=>i.tf(P,z),()=>i.reanchor()),w.querySelector(".sl-confirm-add").addEventListener("click",()=>{if(!this.ghostActivation()){if(this.mode==="remove"){this.removeCommitted();return}this.commit()}}),w.querySelector(".sl-confirm-cancel").addEventListener("click",()=>{this.ghostActivation()||this.cancel()}),this.armOutsideTap(w),requestAnimationFrame(()=>{let P=w.querySelector(".sl-confirm-add");P?.focus(),i.liftToastOverConfirm(),i.fitTranslatedRows(),i.inviteCommit(w,P)})}liftSeatClearOfSheet(e){let t=this.host.controller.getRenderer();this.framing={gestures:t?.getCameraGestureCount?.()??0,quietUntil:0},this.frameSeatForSheet(e)}frameSeatForSheet(e){let t=this.host,i=t.root();if(!this.el||i?.dataset.layout!=="narrow"||i?.dataset.view3d==="on")return;let o=t.els().map;if(!o)return;let r=t.controller.worldToScreen({x:e.x,y:e.y}),s=t.controller.getRenderer(),a=s?.getCameraGestureCount?.()??0,{nudgeY:l}=Ac(r.y,{height:o.clientHeight},{height:this.el.offsetHeight||230}),c=this.lift&&this.lift.gestures===a?this.lift.dy:0;if(!l){this.lift=c?{dy:c,gestures:a}:null;return}let d=!t.reducedMotion();s?.panScreenBy?.({x:0,y:l},{animate:d}),this.lift={dy:c+l,gestures:a},this.framing&&(this.framing.gestures=a,this.framing.quietUntil=d?this.now()+Fm:0)}reframeSeatForSheet(){let e=this.framing,t=this.seat;!e||!t||e.quietUntil&&this.now()<e.quietUntil||(this.host.controller.getRenderer()?.getCameraGestureCount?.()??e.gestures)!==e.gestures||this.frameSeatForSheet(t)}now(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}settleLift(){let e=this.lift;if(this.lift=null,this.framing=null,!e)return;let t=this.host.controller.getRenderer();(t?.getCameraGestureCount?.()??e.gestures)===e.gestures&&t?.panScreenBy?.({x:0,y:-e.dy},{animate:!this.host.reducedMotion()})}reanchor(){let e=this.host;if(!this.el||!this.seat||e.root()?.dataset.view3d==="on")return;let t=e.controller.worldToScreen({x:this.seat.x,y:this.seat.y}),i=e.els().map;if(e.root()?.dataset.layout==="narrow"){this.el.removeAttribute("data-placement"),this.el.style.removeProperty("bottom"),this.scrim=Lc(this.scrim,i,this.el,t),el(this.el,t,i),e.liftToastOverConfirm(),this.reframeSeatForSheet();return}this.scrim=Fr(this.scrim);let o=i.clientWidth,r=i.clientHeight,s=this.el.offsetWidth||276,a=this.el.offsetHeight||230,l=this.el.classList.contains("sl-confirm-group-dates"),c=e.controller.seatScreenRadius()*1.5,d=Pc(t,{width:o,height:r},{width:s,height:a},l,c);this.el.dataset.placement=d.placement,this.el.style.left=`${d.left}px`,this.el.style.top=`${d.top}px`,ro(this.el,t,{left:d.left,top:d.top,width:s,height:a})}ghostActivation(){return Ic()?performance.now()-this.shownAt<Rc:!1}armOutsideTap(e){this.disarmOutsideTap();let t=this.host,i=new Map,o=s=>{if(this.el!==e){this.disarmOutsideTap();return}let a=s.target,l=s;if(s.type!=="pointerdown"){let d=i.get(l.pointerId);i.delete(l.pointerId),d&&s.type==="pointerup"&&i.size===0&&Math.hypot(l.clientX-d.x,l.clientY-d.y)<=Vm&&this.cancel();return}if(!(!a||e.contains(a)||t.els().tray?.contains(a))){if(a instanceof Element&&a.closest(".sl-view3d")){if(i.set(l.pointerId,{x:l.clientX,y:l.clientY}),i.size>1)for(let d of i.keys())i.set(d,{x:Number.NaN,y:Number.NaN});return}this.cancel()}};this.outsideTap=o;let r=t.root();setTimeout(()=>{this.outsideTap===o&&((r??document).addEventListener("pointerdown",o,!0),(r??document).addEventListener("pointerup",o,!0),(r??document).addEventListener("pointercancel",o,!0))},Ic()?Rc:0)}disarmOutsideTap(){if(!this.outsideTap)return;let e=this.outsideTap;this.outsideTap=null;for(let t of["pointerdown","pointerup","pointercancel"])(this.host.root()??document).removeEventListener(t,e,!0),document.removeEventListener(t,e,!0)}dismiss(){let e=this.host;this.disarmOutsideTap(),this.scrim=Fr(this.scrim),this.settleLift(),this.el&&so(this.el),this.el=null,this.seat=null,e.liftToastOverConfirm(),e.root()?.removeAttribute("data-confirming"),Object.values(e.regions()).forEach(t=>t.toggleAttribute("inert",!1)),e.applyPanelCollapsed(),e.controller.setSelectionFocus(null),e.syncTray()}async commit(){let e=this.host,t=this.seat;if(!t)return;let o=this.el?.querySelector(".sl-confirm-add")??null;if(o?.classList.contains("is-adding")||!await bc(this.el,t.id,e.performanceGroup()?.confirmDateSelection??void 0))return;e.collapseSectionCard(),this.seat=null,e.syncTray(),e.syncSelectionTo3d();let r=()=>{let l=e.root()?.dataset.layout==="narrow"?this.lift:null;l&&(this.lift=null),e.dismiss();let c=e.controller.worldToScreen(t);Er(e.els(),c,t,e.controller.doc?.categories,()=>{e.cartLanded?.(),l&&(this.lift=l,this.settleLift())})};if(!o||e.reducedMotion()){r();return}o.classList.remove("sl-confirm-add-invite"),o.classList.add("is-adding"),o.setAttribute("aria-disabled","true");let s=o.querySelector(".sl-confirm-add-t");s&&(s.textContent=e.tf("picker.added","Added")),e.scheduleMotion(r,Dm)}cancel(){let e=this.host,t=this.seat;t&&(this.mode!=="remove"&&e.controller.deselect([t.id]),this.seat&&e.dismiss(),e.syncSelectionTo3d(),e.root()?.focus({preventScroll:!0}))}removeCommitted(){let e=this.host,t=this.seat;if(!t)return;let i=e.releaseHeldSeat(t);i||e.controller.deselect([t.id]),e.dismiss(),e.syncTray(),e.syncSelectionTo3d(),e.root()?.focus({preventScroll:!0})}};function _c(n,e,t){if(!e||t||n.classList.contains("sl-confirm-removing"))return;e.classList.add("sl-confirm-add-invite");let i=()=>e.classList.remove("sl-confirm-add-invite");n.addEventListener("pointerdown",i,{once:!0}),n.addEventListener("keydown",i,{once:!0}),e.addEventListener("focus",i,{once:!0})}function Nc(n,e){return n&&n!=="seat"?e("picker.select","Select"):e("picker.addSeat","Add seat")}var Dc=require("@seatlayer/core"),On=require("@seatlayer/core/picker/minimapGeometry");function zm(n){let e={inactive:0,available:1,selected:2},t=new Map;for(let o of n){let r=t.get(o.id);(!r||e[o.state]>e[r])&&t.set(o.id,o.state)}let i={selected:0,available:0,inactive:0};for(let o of t.values())i[o]+=1;return i}function jm(n,e){return n.x<=e.x&&n.y<=e.y&&n.x+n.width>=e.x+e.width&&n.y+n.height>=e.y+e.height}function Bc(n,e){let t=new Vr(n);return t.build(e),t}var Vr=class{constructor(e){this.host=e;this.miniCanvas=null;this.miniBase=null;this.miniWrap=null;this.miniToggle=null;this.miniLabel=null;this.miniTf=null;this.miniDrag=null;this.miniSuppressClick=!1;this.userClosed=!1}dispose(){this.miniToggle?.remove(),this.miniWrap?.remove(),this.miniToggle=null,this.miniWrap=null,this.miniCanvas=null,this.miniBase=null,this.miniLabel=null,this.miniTf=null,this.miniDrag=null,this.host.root()?.removeAttribute("data-minimap-open")}build(e){if(!this.host.controller.getViewport())return;let i=document.createElement("button");i.type="button",i.className="sl-minimap-toggle",i.setAttribute("aria-label",y("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 o=document.createElement("div");o.className="sl-minimap",o.setAttribute("role","group");let r=document.createElement("div");r.className="sl-minimap-bar";let s=document.createElement("span");s.className="sl-minimap-label";let a=document.createElement("span");a.className="sl-minimap-key",a.setAttribute("aria-label",y("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",y("picker.closeVenueMap","Close venue overview map")),l.textContent="\xD7",r.append(s,a,l);let c=document.createElement("canvas");c.tabIndex=0,c.setAttribute("role","application"),c.setAttribute("aria-label",y("picker.venueMapInstructions","Venue overview map. Drag the viewport, click a section, or use arrow keys to pan.")),o.append(r,c),e.appendChild(o),this.miniWrap=o,this.miniLabel=s,this.miniCanvas=c;let d=document.createElement("canvas");this.miniBase=d,i.addEventListener("click",()=>{let p=this.host.root()?.dataset.minimapOpen==="true";this.userClosed=p,this.setMinimapOpen(!p)}),l.addEventListener("click",()=>{this.userClosed=!0,this.setMinimapOpen(!1)}),c.addEventListener("click",p=>{if(this.miniSuppressClick){this.miniSuppressClick=!1;return}this.minimapJump(p)}),c.addEventListener("pointerdown",p=>this.minimapPointerDown(p)),c.addEventListener("pointermove",p=>this.minimapPointerMove(p)),c.addEventListener("pointerup",p=>this.minimapPointerUp(p)),c.addEventListener("pointercancel",p=>this.minimapPointerUp(p)),c.addEventListener("keydown",p=>this.minimapKeydown(p)),this.layoutMinimap(),this.syncMinimapLabel(),this.drawMinimapStatic(),this.drawMinimapRect()}setAutoOpen(e){if(this.miniWrap){if(!e){this.userClosed=!1,this.host.root()?.dataset.minimapOpen==="true"&&this.setMinimapOpen(!1,!1);return}this.userClosed||this.host.root()?.dataset.minimapOpen==="true"||this.setMinimapOpen(!0,!1)}}setMinimapOpen(e,t=!0){this.host.root()?.setAttribute("data-minimap-open",String(e)),this.miniToggle?.setAttribute("aria-expanded",String(e)),t&&(e?this.miniCanvas?.focus():this.miniToggle?.focus())}layoutMinimap(){let e=this.miniCanvas,t=this.miniBase,i=this.host.controller.getViewport()?.bounds;if(!e||!t||!i||!(i.width>0&&i.height>0))return;let o=196,r=146,s=6,a=i.width/Math.max(1,i.height),l=o,c=Math.round(o/a);c>r&&(c=r,l=Math.round(r*a)),l=Math.max(64,l),c=Math.max(48,c);let d=Math.min(2,window.devicePixelRatio||1);e.width=Math.round(l*d),e.height=Math.round(c*d),e.style.width=`${l}px`,e.style.height=`${c}px`,t.width=e.width,t.height=e.height,this.miniTf=(0,On.createMinimapTransform)(i,e.width,e.height,d,s)}syncMinimapLabel(){if(!this.miniLabel||!this.miniWrap)return;let e=this.host.controller.getFloors(),t=this.host.controller.isFloorOverview()?y("picker.allFloors","All floors"):e.find(d=>d.id===this.host.controller.getActiveFloorId())?.name??y("picker.venueOverview","Venue overview"),i=this.host.controller.getMinimapSnapshot().sections,r=i.find(d=>d.active)?.label??this.host.focusedSectionLabel(),s=r?`${t} \xB7 ${r}`:t;this.miniLabel.textContent=s;let{selected:a,available:l,inactive:c}=zm(i);this.miniWrap.setAttribute("aria-label",i.length?`${s}. ${a} selected, ${l} available, ${c} inactive sections.`:s),this.miniCanvas?.setAttribute("aria-label",i.length?`${s}. ${a} selected, ${l} available, ${c} inactive sections. ${y("picker.venueMapInstructions","The outlined region is the visible map area. Drag it, click a section, or use arrow keys to pan.")}`:`${s}. ${y("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 o=p=>p*t.scale+t.offX,r=p=>p*t.scale+t.offY,s=this.host.cssVar("--sl-line")||"rgba(139,147,167,.5)",a=this.host.cssVar("--sl-muted")||"#8b93a7",l=this.host.cssVar("--sl-accent")||"#6e7bff",c=this.host.cssVar("--sl-success")||"#22a06b",d=this.host.controller.getMinimapSnapshot();for(let p of d.sections){if(p.outline.length<3)continue;i.beginPath(),p.outline.forEach((h,b)=>b===0?i.moveTo(o(h.x),r(h.y)):i.lineTo(o(h.x),r(h.y))),i.closePath();let u=p.paint;if(i.globalAlpha=p.state==="inactive"?.5:.92,u?i.fillStyle=u.fill:(i.globalAlpha=p.state==="inactive"?.18:p.state==="selected"?.72:.34,i.fillStyle=p.state==="inactive"?a:p.state==="selected"?l:c),i.fill(),i.globalAlpha=.82,i.lineWidth=Math.max(1,t.dpr),i.strokeStyle=u?.stroke||s,i.stroke(),p.owned){i.globalAlpha=1,i.lineWidth=Math.max(2,t.dpr*1.5),i.strokeStyle=l,i.stroke();let h=p.outline.reduce((b,f)=>({x:b.x+f.x,y:b.y+f.y}),{x:0,y:0});i.beginPath(),i.arc(o(h.x/p.outline.length),r(h.y/p.outline.length),Math.max(1.5,t.dpr*1.6),0,Math.PI*2),i.fillStyle=l,i.fill(),i.beginPath(),p.outline.forEach((b,f)=>f===0?i.moveTo(o(b.x),r(b.y)):i.lineTo(o(b.x),r(b.y))),i.closePath()}p.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,!d.sections.length){let p=Math.max(1,t.dpr),u=new Map,h=b=>{let f=u.get(b);if(f)return f;let T=this.host.tint?.(b)||c;return u.set(b,T),T};for(let b of d.seats)i.globalAlpha=b.state==="inactive"?.22:.78,i.fillStyle=b.state==="inactive"?a:b.state==="selected"?l:h(b.categoryKey),i.beginPath(),i.arc(o(b.x),r(b.y),p,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 o=e.getContext("2d");if(!o)return;o.clearRect(0,0,e.width,e.height),o.drawImage(t,0,0);let r=this.host.controller.getViewport();if(!r)return;let s=jm(r.visible,r.bounds);if(this.host.root()?.toggleAttribute("data-minimap-idle",s),s)return;let a=(0,On.minimapViewportPlan)(r.visible,i,e.width,e.height,Math.max(2,i.dpr*2)),l=this.host.cssVar("--sl-text")||"#12151c",c=this.host.cssVar("--sl-surface")||"#fff";o.save(),o.globalAlpha=.1,o.fillStyle=l,o.fillRect(a.raw.x,a.raw.y,a.raw.width,a.raw.height),o.globalAlpha=.9,o.lineJoin="round",o.lineWidth=Math.max(4,i.dpr*3.25),o.strokeStyle=c,o.strokeRect(a.raw.x,a.raw.y,a.raw.width,a.raw.height),o.globalAlpha=1,o.lineWidth=Math.max(2,i.dpr*1.75),o.strokeStyle=l,o.strokeRect(a.raw.x,a.raw.y,a.raw.width,a.raw.height),a.clipped&&Object.values(a.clippedEdges).some(Boolean)&&(o.setLineDash([Math.max(3,i.dpr*3),Math.max(2,i.dpr*2)]),o.strokeRect(a.clipped.x,a.clipped.y,a.clipped.width,a.clipped.height)),o.restore()}minimapWorldPoint(e){let t=this.miniCanvas,i=this.miniTf;if(!t||!i)return null;let o=t.getBoundingClientRect(),r=(e.clientX-o.left)*(t.width/Math.max(1,o.width)),s=(e.clientY-o.top)*(t.height/Math.max(1,o.height));return{...(0,On.minimapPointToWorld)({x:r,y:s},i),px:r,py:s}}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,o=e.key==="ArrowUp"?-t.height*.2:e.key==="ArrowDown"?t.height*.2:0;!i&&!o||(this.host.controller.clearSectionFocus(),this.host.controller.panToWorld({x:t.x+t.width/2+i,y:t.y+t.height/2+o}),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,Dc.pointInPolygon)(t,i.outline)){this.host.controller.focusSection(i.id);return}this.host.controller.clearSectionFocus(),this.host.controller.panToWorld(t)}}};var Lo=require("@seatlayer/core");var Km=12;function Fc(n,e){let t=e.floors(),i=new Set(t.map(g=>g.label.trim().toLocaleLowerCase())),o=e.zones().filter(g=>g.seatCount>0&&!i.has(g.label.trim().toLocaleLowerCase())),r=e.sections().filter(g=>g.seatCount>0&&!i.has(g.label.trim().toLocaleLowerCase())),s=o.length>1?[]:r,a=t.length>1,l=o.length>1,c=s.length>1;if(!a&&!l&&!c)return null;let d=document.createElement("div");d.className="sl-view3d-nav";let p=null,u=document.createElement("button");u.type="button",u.className="sl-view3d-nav-toggle",u.setAttribute("aria-expanded","false");let h='<svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="12" r="9"/><path d="M15.5 8.5l-2 5-5 2 2-5z"/></svg>',b=document.createElement("span");u.innerHTML=h,u.appendChild(b);let f=()=>{for(let g of d.querySelectorAll(":scope > div")){let _=g.querySelector('[aria-pressed="true"]');!_||g.scrollWidth<=g.clientWidth||_.scrollIntoView({block:"nearest",inline:"nearest"})}},T=()=>{if(p)return p;for(let g of d.querySelectorAll(":scope > div")){let _=g.querySelector('button[aria-pressed="true"]'),G=_?.textContent?.trim();if(G&&_?.dataset.floor!=="")return G}return a&&(l||c)?y("picker.levelsAndAreas","Levels & zones"):a?y("picker.levels","Levels"):y("picker.areas","Zones")},w=g=>{d.classList.toggle("is-open",g),u.setAttribute("aria-expanded",String(g)),g&&typeof requestAnimationFrame=="function"&&requestAnimationFrame(f),b.textContent=T()};u.addEventListener("click",()=>w(!d.classList.contains("is-open"))),d.addEventListener("keydown",g=>{g.key!=="Escape"||!d.classList.contains("is-open")||(g.preventDefault(),g.stopPropagation(),w(!1),u.focus())});let v=document.createElement("button");v.type="button",v.className="sl-view3d-nav-close",v.innerHTML='<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M18 6L6 18M6 6l12 12"/></svg>';let M=y("picker.closeVenueNavigation","Close venue navigation");v.setAttribute("aria-label",M),v.title=M,v.addEventListener("click",()=>{w(!1),u.focus()}),w(!1),d.appendChild(u);let F=g=>{},X=g=>{};if(a){let g=document.createElement("div");g.setAttribute("role","group"),g.setAttribute("aria-label",y("picker.levels","Levels"));let _=[];X=j=>{_.forEach(P=>{P.setAttribute("aria-pressed",String((P.dataset.floor===""?null:Number(P.dataset.floor))===j))})};let G=j=>{e.focusFloor(j)&&(X(j),F(j))},N=(j,P)=>{let z=document.createElement("button");z.type="button",z.textContent=j,z.dataset.floor=P===null?"":String(P),z.setAttribute("aria-pressed",String(P===null)),z.addEventListener("click",()=>{G(P),w(!1)}),_.push(z),g.appendChild(z)};N(y("picker.allLevels","All levels"),null);for(let j of t)N(j.label||(0,Lo.t)("picker.levelNumber",{number:j.index+1}),j.index);d.appendChild(g)}if(l||c){let g=document.createElement("div");g.setAttribute("role","group"),g.setAttribute("aria-label",y("picker.areas","Zones"));let _=l?o.map(N=>({id:N.id,label:N.label||N.id,go:()=>{e.focusZone(N.id)}})):s.map(N=>({id:N.id,label:N.label||N.id,floorIndex:N.floorIndex,go:()=>{e.focusSection(N.id),Number.isFinite(N.floorIndex)&&X(N.floorIndex)}})),G=N=>{let j=l||N===null?_:_.filter(P=>P.floorIndex===void 0||P.floorIndex===N);if(g.replaceChildren(),!j.length){g.remove();return}if(g.isConnected||d.insertBefore(g,v.isConnected?v:null),!l&&j.length>Km){let P=document.createElement("select");P.setAttribute("aria-label",y("picker.jumpToSection","Jump to section"));let z=document.createElement("option");z.value="",z.textContent=y("picker.jumpToSection","Jump to section"),P.appendChild(z);for(let ee of j){let W=document.createElement("option");W.value=ee.id,W.textContent=ee.label,P.appendChild(W)}P.addEventListener("change",()=>{j.find(ee=>ee.id===P.value)?.go()}),g.appendChild(P);return}for(let P of j){let z=document.createElement("button");z.type="button",z.textContent=P.label,z.dataset.area=P.id,z.addEventListener("click",()=>{p=P.label,P.go(),w(!1)}),g.appendChild(z)}};F=G,G(null)}return d.appendChild(v),n.appendChild(d),d}var Ho=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",y("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(y("picker.chooseAnotherToCompare","Choose another seat to compare."),"neutral")});let s=document.createElement("button");s.type="button",s.className="clear",s.textContent="\xD7",s.setAttribute("aria-label",y("picker.clearSavedSeatComparison","Clear saved seat comparison")),s.addEventListener("click",()=>this.host.clearComparison()),t.append(r,s),e.appendChild(t),this.chip=t}let i=this.host.savedSeatIds().length,o=t.querySelector(".main");o&&(o.textContent=i>1?(0,Lo.t)("picker.compareCount",{count:i}):y("picker.oneSeatSaved","1 seat saved"),o.setAttribute("aria-label",i>1?(0,Lo.t)("picker.openComparisonOfSeats",{count:i}):y("picker.oneSeatSavedChooseAnother","One seat saved; choose another to compare")))}remove(){this.chip?.remove(),this.chip=null}mainButton(){return this.chip?.querySelector(".main")??null}};function Vc(n){return!n?.querySelector('[data-ref="zfs"]')}var $c="sl:sheet-hint";function zc(n){let e=n.boot;if(!e?.isConnected)return;if(n.reducedMotion){e.remove();return}e.classList.add("is-going"),setTimeout(()=>e.remove(),200);let t=document.createElement("div");t.className="sl-shells-in",t.setAttribute("aria-hidden","true"),n.map?.appendChild(t),setTimeout(()=>t.remove(),450),n.rail?.classList.add("is-in"),n.root?.classList.add("is-arriving"),setTimeout(()=>{n.rail?.classList.remove("is-in"),n.root?.classList.remove("is-arriving"),Gm(n.root)},700)}function Gm(n){if(!n||n.dataset.layout!=="narrow")return;try{if(window.sessionStorage.getItem($c))return;window.sessionStorage.setItem($c,"1")}catch{}let e=n.querySelector(".sl-sheet-toggle");e&&(e.classList.add("sl-mo-hint"),e.addEventListener("animationend",()=>e.classList.remove("sl-mo-hint"),{once:!0}))}function jc(n,e){n.addEventListener("keydown",t=>{if(t.key==="Escape"){for(let i of e())if(i.open()){t.preventDefault(),t.stopPropagation(),i.close();return}}})}function Io(n){let e=n.committedSelection(),t=n.controller.getGAAreas(),i=n.hold?.items??[],o=new Set(i.map(u=>u.label)),r=al(n,t,i),s=kt(n.gaQty,i),a=i.reduce((u,h)=>u+n.heldPrice(h)*(h.quantity??1),0),l=i.reduce((u,h)=>u+(h.quantity??1),0),c=e.filter(u=>!o.has(u.label)),d=c.reduce((u,h)=>u+n.paidPrice(h.categoryKey,h.tierId??null,h.price,h.label)*(h.quantity??1),0)+r+a,p=c.reduce((u,h)=>u+(h.quantity??1),0)+s+l;return{seats:e,freshSeats:c,gaAreas:t,heldItems:i,heldLabels:o,heldCount:l,total:d,count:p}}function Oo(n,e){let t=e.tiers?.length?e.tiers[0].price:e.price;return t===void 0||!e.key?t:n.paidPrice(e.key,e.tiers?.[0]?.id??null,t)}function _o(n,e){let t=e.tiers?.length?e.tiers.map(i=>n.paidPrice(e.key,i.id??null,i.price)):e.price==null?[]:[n.paidPrice(e.key,null,e.price)];if(e.key){for(let i of n.pricesByChannel.values())for(let o of i)o.categoryKey===e.key&&t.push(o.price);t.push(...Um(n).get(e.key)??[])}return t.length?{min:Math.min(...t),max:Math.max(...t)}:void 0}var Ro=null;function Um(n){let e=n.controller.doc,t=n.hostObjectPrices();if(Ro?.doc!==e||Ro.host!==t){let i=new Map;for(let[o,r]of Object.entries({...e?.seatPrices,...t})){let s=n.controller.seatByLabel(o)?.categoryKey??n.controller.tableSelection(o)?.categoryKey;s&&(i.has(s)||i.set(s,[]),i.get(s).push(...typeof r=="number"?[r]:Object.values(r.tiers)))}Ro={doc:e,host:t,spread:i}}return Ro.spread}var hi="seatlayer_";function qm(){let n=globalThis;return n.document?.modelContext??n.navigator?.modelContext??null}function $e(n,e){return e?{ok:!1,reason:n,message:e}:{ok:!1,reason:n}}function Wm(n){return Array.isArray(n)?n.filter(e=>typeof e=="string"&&!!e):[]}function Ym(n,e){let t=n.event();if(!t)return $e("not_loaded","The seat map has not finished loading.");let i=n.selectionLimits();return{ok:!0,event:t,selection:{max:i.max,...i.required!=null?{required:i.required}:{}},categories:n.categories(),zones:n.zones(),hasPremiumSeats:n.hasPremiumSeats(),holdsAllowed:e}}function Kc(n,e){let t=o=>!!o&&o.toLowerCase()===e.toLowerCase(),i=n.find(o=>t(o.key??o.id))??n.find(o=>t(o.label));return i?.key??i?.id??null}function Gc(n,e){let t=e.map(i=>n.describeSeat(i.id));return{seatIds:e.map(i=>i.id),labels:e.map(i=>i.label),section:t[0]?.section??"",row:t[0]?.row??"",seats:e.map((i,o)=>t[o]?.seat||i.label),category:t[0]?.category??e[0].categoryKey,unitPrice:e[0].price,total:e.reduce((i,o)=>i+o.price,0)}}function Xm(n,e,t){let i=new Map;for(let r of e){let s=i.get(r.rowKey);s?s.push(r):i.set(r.rowKey,[r])}let o=[];for(let r of i.values()){let s=[...r].sort((l,c)=>l.index-c.index),a=0;for(let l=1;l<=s.length;l++)if(l===s.length||s[l].index!==s[l-1].index+1||s[l].categoryKey!==s[l-1].categoryKey){for(let d=a;d+t<=l;d+=t)o.push(Gc(n,s.slice(d,d+t)));a=l}}return o}function Qm(n,e,t){let i=new Map;for(let r of e){let s=i.get(r.sectionKey);s?s.push(r):i.set(r.sectionKey,[r])}let o=[];for(let r of i.values()){if(r.length<t)continue;let s=[...r].sort((a,l)=>a.price!==l.price?l.price-a.price:a.rowKey.localeCompare(l.rowKey)||a.index-l.index);o.push(Gc(n,s.slice(0,t)))}return o}function Zm(n,e){if(!n.event())return $e("not_loaded","The seat map has not finished loading.");let i=n.selectionLimits(),o=Math.floor(Number(e.count));if(!Number.isInteger(o)||o<1||o>i.max)return $e("bad_count",`count must be a whole number between 1 and ${i.max}.`);let r=Number.isInteger(Number(e.limit))?Math.max(1,Math.min(20,Number(e.limit))):5,s=e.together===void 0?!0:!!e.together,a=typeof e.max_price=="number"&&Number.isFinite(e.max_price)?e.max_price:null,l=typeof e.category=="string"&&e.category?e.category:null,c=typeof e.zone=="string"&&e.zone?e.zone:null,d=l?Kc(n.categories(),l):null;if(l&&!d)return $e("no_match",`No ticket type called "${l}".`);if(d&&n.categories().find(f=>f.key===d)?.available===0)return $e("sold_out",`"${l}" is sold out.`);let p=c?Kc(n.zones(),c):null;if(c&&!p)return $e("no_match",`No zone called "${c}".`);let u=n.seats().filter(f=>f.available);if(!u.length)return $e("sold_out");let h=u.filter(f=>(!d||f.categoryKey===d)&&(!p||f.zoneId===p)&&(a==null||f.price<=a));if(!h.length)return $e("no_match");let b=s?Xm(n,h,o):Qm(n,h,o);return b.length?(b.sort((f,T)=>T.unitPrice!==f.unitPrice?T.unitPrice-f.unitPrice:f.row.localeCompare(T.row)||f.labels[0].localeCompare(T.labels[0])),{ok:!0,groups:b.slice(0,r),searched:{count:o,filters:{...a!=null?{max_price:a}:{},...d?{category:d}:{},...p?{zone:p}:{},together:s}}}):$e(s?"not_enough_together":"no_match")}function Uc(n){return{ok:!0,...n.selection()}}function Jm(n,e){let t=n.event();if(!t)return $e("not_loaded","The seat map has not finished loading.");if(t.salesClosed)return $e("event_closed","Sales are closed for this event.");let i=Wm(e.seat_ids);return i.length?(n.clearSelection(),n.selectObjects(i),Uc(n)):$e("nothing_requested","Pass one or more seat ids or labels in seat_ids.")}function ef(n,e){let t=async o=>{try{return await o()}catch(r){return $e("error",r instanceof Error?r.message:String(r))}},i=[{name:`${hi}describe_event`,title:"Describe this seated event",description:"Read the event, its ticket types with live availability and prices, its zones, and how many seats this buyer may select. Call this first.",inputSchema:{type:"object",properties:{},additionalProperties:!1},annotations:{readOnlyHint:!0,untrustedContentHint:!0},execute:()=>t(()=>Ym(n,e))},{name:`${hi}find_seats`,title:"Find available seats",description:"Search the seat map for groups of available seats. Read-only: it never selects, holds or reserves anything. Returns candidate groups with their seat ids, prices and location.",inputSchema:{type:"object",properties:{count:{type:"integer",minimum:1,description:"How many seats are needed."},max_price:{type:"number",description:"Highest acceptable price per seat."},category:{type:"string",description:"Ticket type key or label to restrict the search to."},zone:{type:"string",description:"Zone id or label to restrict the search to."},together:{type:"boolean",description:"Require the seats to be side by side in one row (default true)."},limit:{type:"integer",minimum:1,maximum:20,description:"How many candidate groups to return (default 5)."}},required:["count"],additionalProperties:!1},annotations:{readOnlyHint:!0,untrustedContentHint:!0},execute:o=>t(()=>Zm(n,o))},{name:`${hi}select_seats`,title:"Select seats on the map",description:"Replace the current selection with the given seats, exactly as tapping them would. The buyer sees the seats light up and the basket update. No reservation is made.",inputSchema:{type:"object",properties:{seat_ids:{type:"array",items:{type:"string"},description:"Seat ids or labels, e.g. from find_seats."}},required:["seat_ids"],additionalProperties:!1},annotations:{readOnlyHint:!1,untrustedContentHint:!0},execute:o=>t(()=>Jm(n,o))},{name:`${hi}get_selection`,title:"Read the current selection",description:"Read the seats currently selected in the basket, their total, any open reservation, and whether the selection satisfies this event\u2019s rules.",inputSchema:{type:"object",properties:{},additionalProperties:!1},annotations:{readOnlyHint:!0,untrustedContentHint:!0},execute:()=>t(()=>Uc(n))}];return e&&i.push({name:`${hi}hold_selection`,title:"Reserve the selected seats",description:"Reserve the currently selected seats for this buyer for a limited time, exactly as pressing the checkout button would. Confirm with the buyer before calling this.",inputSchema:{type:"object",properties:{},additionalProperties:!1},annotations:{readOnlyHint:!1,untrustedContentHint:!0},execute:()=>t(()=>n.hold())}),i}async function qc(n,e={}){let t=qm();if(!t||typeof t.registerTool!="function")return null;let i=new AbortController,o=ef(n,!!e.holds),r=[],s=e.exposedTo?.length?[...new Set(e.exposedTo)]:void 0;try{for(let a of o)await t.registerTool(a,{signal:i.signal,...s?{exposedTo:s}:{}}),r.push(a.name)}catch(a){console.warn("seatmap: WebMCP tools could not be registered",a)}return r.length?{names:r,dispose:()=>{if(i.abort(),typeof t.unregisterTool=="function")for(let a of r)try{t.unregisterTool(a)}catch{}}}:null}async function Wc(n){let e=n.opts.webMcp;if(!e||n.destroyed)return;let t=typeof e=="object"&&!!e.holds,i=typeof e=="object"?e.exposedTo:void 0;try{n.webMcp=await qc(zr(n,t),{holds:t,exposedTo:i}),n.destroyed&&$r(n)}catch(o){console.warn("seatmap: WebMCP registration failed",o)}}function $r(n){n.webMcp?.dispose(),n.webMcp=null}function zr(n,e){let t=(i,o)=>{if(Number.isInteger(i.logicalSeatIndex))return i.logicalSeatIndex;let r=i.id.lastIndexOf(":"),s=r<0?NaN:Number(i.id.slice(r+1));return Number.isFinite(s)?s:o};return{event:()=>{let i=n.renderInfo;return i?{name:i.eventName??"",venue:i.venue??null,startsAt:i.startsAt??null,timezone:i.timezone??null,currency:n.currency,salesClosed:n.salesClosed}:null},selectionLimits:()=>({max:n.maxTickets,required:n.exactTickets}),categories:()=>{let i=n.controller.categoryAvailability();return(n.controller.doc?.categories??[]).filter(o=>!o.notForSale).map(o=>{let r=_o(n,o),s=Oo(n,o);return{key:o.key,label:o.label??o.key,...s===void 0?{}:{price:s},...r&&r.min!==r.max?{priceRange:r}:{},available:i[o.key]??0}})},zones:()=>n.controller.getBestAvailableZones(),hasPremiumSeats:()=>n.controller.hasPremiumSeats(),seats:()=>{let i=n.controller.getActiveFloorId(),o=[];return n.allSeats().forEach((r,s)=>{if(r.floorId&&i&&r.floorId!==i)return;let a=n.controller.getStatus(r.id)??"free",l=n.controller.doc?.categories.find(d=>d.key===r.categoryKey),c=l?.tiers?.length?l.tiers[0].price:l?.price??0;o.push({id:r.id,label:r.label,rowKey:r.logicalRowId??r.rowId,sectionKey:r.sectionId??r.rowId,index:t(r,s),categoryKey:r.categoryKey,price:n.paidPrice(r.categoryKey,l?.tiers?.[0]?.id??null,c,r.label),...r.zoneId?{zoneId:r.zoneId}:{},available:a==="free"&&!l?.notForSale})}),o},describeSeat:i=>{let o=n.controller.seatDetails(i);return o?{section:o.sectionLabel??"",row:fe(o)??"",seat:o.seatNumber??o.label,category:o.categoryLabel??o.categoryKey}:null},selection:()=>{let{freshSeats:i,total:o,count:r}=Io(n);return{seats:i.map(s=>({id:s.id,label:s.label,section:s.sectionLabel??"",row:fe(s)??"",seat:s.seatNumber??s.label,category:s.categoryKey,price:n.paidPrice(s.categoryKey,s.tierId??null,s.price,s.label)})),count:r,total:o,currency:n.currency,hold:n.hold?{id:n.hold.holdId,expiresAt:n.hold.expiresAt}:null,validity:n.getSelectionValidity()}},clearSelection:()=>n.clearSelection(),selectObjects:i=>{n.selectObjects(i)},hold:()=>e?tf(n):Promise.resolve({ok:!1,reason:"not_allowed"})}}async function tf(n){if(n.salesClosed)return{ok:!1,reason:"event_closed"};if(!n.totalTicketCount())return{ok:!1,reason:"nothing_selected"};let e=n.controller.getSelectionValidity(n.totalTicketCount());return e&&!e.isValid?{ok:!1,reason:"invalid_selection"}:(await n.handleCta(),n.hold?{ok:!0,hold:{id:n.hold.holdId,expiresAt:n.hold.expiresAt}}:{ok:!1,reason:"hold_failed"})}function Yc(n,e){if(e.objectType!=="seat"&&e.objectType!=="booth")return null;let t=n.seatByLabel(e.label),i=t?n.toSeat(t).tiers:void 0;return i&&i.length>1?i:null}async function Xc(n,e,t,i){let o=n.currentHold(),r=o?.items??[],s=r.find(c=>c.label===e);if(!o||!s||s.tierId===t)return null;let a=r.map(c=>({label:c.label,tierId:c.label===e?t:c.tierId,...c.quantity!=null?{quantity:c.quantity}:{}})),l=await n.api.hold(n.key,a,i,o.holdId);return n.setHold({holdId:l.holdId,labels:a.map(c=>c.label),expiresAt:l.expiresAt,items:l.items}),n.currentHold()}function jr(n){return{renderingTimeMillis:n.ms,performanceProfile:n.performanceProfile,seatCount:n.seatCount,objectCount:n.objectCount,sectionCount:n.sectionCount,view:n.view,eventKey:n.eventKey,chartName:n.chartName,floorCount:n.floorCount,transport:n.transport,load:n.load,metricScope:n.metricScope,operationalTelemetryReporter:"sdk"}}function Qc(n,e){Qe({apiBase:n.apiBase,event:n.eventKey,scope:n.metricScope,surface:n.surface,outcome:"success",ms:n.ms,performanceProfile:n.performanceProfile,seats:n.seatCount,floors:n.floorCount,view:n.view,load:n.load,transport:n.transport,revealWaitMs:n.revealWaitMs,handoverMs:n.handoverMs}),e("chart_rendered",jr(n))}var Zc=require("@seatlayer/core/core/seatConfidence");function Pe(n){return String(n??"").replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#39;")}function Jc(n){let e=(0,Zc.seatConfidenceDisclosure)(n.seat.confidenceEvidence),t=n.seat.confidenceEvidence,i=e.limitations.length?`<h4>Known limits</h4><ul>${e.limitations.map(c=>`<li>${Pe(c)}</li>`).join("")}</ul>`:"",o=e.modeledTarget?`<div><dt>Modeled target</dt><dd>${Pe(e.modeledTarget)}</dd></div>`:"",r=t?`<div><dt>Evidence ID</dt><dd>${Pe(t.evidenceId)}</dd></div><div><dt>Model version</dt><dd>${Pe(t.modelVersion)}</dd></div><div><dt>Event configuration</dt><dd>${Pe(t.eventConfigurationId??"Not configuration-specific")}</dd></div><div><dt>Approval</dt><dd>${Pe(t.approvedByRole??"No external approval supplied")}</dd></div>`+(t.validUntil?`<div><dt>Valid until</dt><dd>${Pe(t.validUntil.slice(0,10))}</dd></div>`:""):"<div><dt>Evidence ID</dt><dd>None supplied</dd></div>",s=$i(n.seat.commercial).join(" \xB7 ")||n.restrictionFallback,a=`<div><dt>View restriction</dt><dd>${Pe(s)}</dd></div>`+(n.seat.commercial?.note?`<div><dt>Organizer note</dt><dd>${Pe(n.seat.commercial.note)}</dd></div>`:""),l=n.canReport?'<button type="button" data-report>Report this view</button><p data-report-status role="status" aria-live="polite"></p>':"";return`<div class="sl-view3d-passport-scrim" aria-hidden="true"></div><section class="sl-view3d-passport" role="dialog" aria-modal="true" aria-labelledby="sl-view3d-passport-title"><header><div><span>Seat confidence passport</span><strong id="sl-view3d-passport-title">${Pe(n.title)}</strong></div><button type="button" data-close aria-label="Close seat confidence passport">\xD7</button></header><div class="sl-view3d-passport-summary"><strong>${Pe(e.headline)}</strong><span>${Pe(e.coverage)} \xB7 ${Pe(e.freshness)}</span></div><dl><div><dt>Model status</dt><dd>${Pe(e.model)}</dd></div><div><dt>Reality evidence</dt><dd>${Pe(e.reality)}</dd></div><div><dt>Source</dt><dd>${Pe(e.provenance)}</dd></div>`+a+o+r+`</dl>${i}<p class="sl-view3d-passport-note">This passport describes supplied evidence and known limits. It does not guarantee that every temporary obstruction or real-world condition is knowable before the event build.</p>`+l+"</section>"}function ed(n){return n?n.closest("[data-report]")?"report":n.closest("[data-close]")||n.classList.contains("sl-view3d-passport-scrim")?"close":null:null}function No(n,e,t){let i=n?.querySelector("[data-report]"),o=n?.querySelector("[data-report-status]");i&&(i.disabled=e!=="failed",i.textContent=e==="received"?"Report received":"Report this view"),o&&(o.setAttribute("role",e==="failed"?"alert":"status"),o.textContent=e==="sending"?"Sending report\u2026":e==="received"?`Report received. Reference ${t??""}.`:"The report could not be sent. Please try again.")}function Kr(n,e,t=null){let i=n.view3dEl;if(!i)return;ui(n,!1);let o=e.confidenceEvidence,r=n.controller.seatDetails(e.id),s=document.createElement("div");s.className="sl-view3d-passport-shell",s.innerHTML=Jc({seat:e,title:r?.displayLabel??e.displayLabel??e.label,restrictionFallback:n.tf("picker.noAuthoredRestriction","No organizer-authored restriction"),canReport:typeof n.api.reportViewEvidence=="function"});let a=[...new Set([...i.children,...[...n.els.map.children].filter(u=>u!==i)])].filter(u=>u instanceof HTMLElement),l=a.map(u=>({element:u,inert:u.inert,ariaHidden:u.getAttribute("aria-hidden")}));for(let u of a)u.inert=!0,u.setAttribute("aria-hidden","true");i.appendChild(s),i.classList.add("has-passport"),n.view3dPassportEl=s;let c=s.querySelector(".sl-view3d-passport"),d=()=>[...c.querySelectorAll('button:not(:disabled),[href],[tabindex]:not([tabindex="-1"])')],p=u=>{if(u.key==="Escape"){u.preventDefault(),u.stopPropagation(),u.stopImmediatePropagation(),ui(n);return}if(u.key!=="Tab")return;let h=d();if(!h.length)return;let b=h[0],f=h[h.length-1];u.shiftKey&&document.activeElement===b?(u.preventDefault(),f.focus()):!u.shiftKey&&document.activeElement===f&&(u.preventDefault(),b.focus())};window.addEventListener("keydown",p,!0),n.view3dPassportCleanup=()=>{window.removeEventListener("keydown",p,!0);for(let f of l)f.element.inert=f.inert,f.ariaHidden===null?f.element.removeAttribute("aria-hidden"):f.element.setAttribute("aria-hidden",f.ariaHidden);let u=t?.isConnected?t:n.confirmEl?.querySelector(".sl-confirm-confidence")??n.view3dCompareEl?.querySelector("[data-passport-seat]")??null,h=u?.closest(".sl-confirm,.sl-view3d-compare");h?.isConnected&&(h.inert=!1,h.removeAttribute("aria-hidden")),s.remove(),i.classList.remove("has-passport"),n.view3dPassportEl===s&&(n.view3dPassportEl=null);let b=u??n.view3dCompareEl?.querySelector("[data-passport-seat]")??n.confirmEl?.querySelector(".sl-confirm-confidence")??n.view3dCompareChip.mainButton();(t?.isConnected?t:b)?.focus()},s.addEventListener("click",u=>{let h=ed(u.target instanceof HTMLElement?u.target:null);h==="close"&&ui(n),h==="report"&&nf(n,e)}),requestAnimationFrame(()=>d()[0]?.focus()),n.emit3dAnalytics("3d_confidence_passport_opened",{seatId:e.id,evidenceId:o?.evidenceId??null,eventConfigurationId:o?.eventConfigurationId??null,modelLevel:o?.modelLevel??"unverified",realityLevel:o?.realityLevel??"none"})}async function nf(n,e){if(n.api.reportViewEvidence){No(n.view3dPassportEl,"sending");try{let t=await n.api.reportViewEvidence(n.opts.event,{seatId:e.id,evidenceId:e.confidenceEvidence?.evidenceId});n.emit3dAnalytics("3d_confidence_view_reported",{seatId:e.id,evidenceId:e.confidenceEvidence?.evidenceId??null}),No(n.view3dPassportEl,"received",t.report.id)}catch{No(n.view3dPassportEl,"failed")}}}function ui(n,e=!0){let t=n.view3dPassportCleanup;if(n.view3dPassportCleanup=null,!t){n.view3dPassportEl?.remove(),n.view3dPassportEl=null,n.view3dEl?.classList.remove("has-passport");return}e||(document.activeElement instanceof HTMLElement?document.activeElement:null)?.blur(),t(),e||n.root?.focus({preventScroll:!0})}function td(n){let e=n.view3dEl;if(!e||n.view3dCompareSeatIds.length<2)return;Wt(n,!1);let t=n.view3dCompareSeatIds.map(h=>n.view3dComparisonSnapshot(h)).filter(h=>!!h);if(t.length<2){n.clearView3dComparison();return}let i=h=>L(h),o=t.some(h=>!!h.price),r=document.createElement("div");r.className="sl-view3d-compare-shell";let s=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>`+(o?`<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("");r.innerHTML=`<div class="sl-view3d-compare-scrim" aria-hidden="true"></div><section class="sl-view3d-compare" role="dialog" aria-modal="true" aria-labelledby="sl-view3d-compare-title"><header><div><span>Seat inspection</span><strong id="sl-view3d-compare-title">Compare disclosed attributes</strong></div><button type="button" data-close aria-label="Close seat comparison">\xD7</button></header><p class="sl-view3d-compare-note">${o?"Current price and availability":"Availability"} comes from this picker. Modeled views are chart-derived unless organizer media is labeled.</p><div class="sl-view3d-compare-grid">${s}</div></section>`;let a=document.activeElement instanceof HTMLElement?document.activeElement:null,l=[...e.children].filter(h=>h instanceof HTMLElement),c=l.map(h=>({element:h,inert:h.inert,ariaHidden:h.getAttribute("aria-hidden")}));for(let h of l)h.inert=!0,h.setAttribute("aria-hidden","true");e.appendChild(r),e.classList.add("has-comparison"),n.view3dCompareEl=r;let d=r.querySelector(".sl-view3d-compare"),p=()=>[...d.querySelectorAll('button:not(:disabled),[href],[tabindex]:not([tabindex="-1"])')],u=h=>{if(h.key==="Escape"){h.preventDefault(),Wt(n);return}if(h.key!=="Tab")return;let b=p();if(!b.length)return;let f=b[0],T=b[b.length-1];h.shiftKey&&document.activeElement===f?(h.preventDefault(),T.focus()):!h.shiftKey&&document.activeElement===T&&(h.preventDefault(),f.focus())};window.addEventListener("keydown",u),n.view3dCompareCleanup=()=>{window.removeEventListener("keydown",u);for(let h of c)h.element.inert=h.inert,h.ariaHidden===null?h.element.removeAttribute("aria-hidden"):h.element.setAttribute("aria-hidden",h.ariaHidden);r.remove(),e.classList.remove("has-comparison"),n.view3dCompareEl===r&&(n.view3dCompareEl=null),a?.isConnected?a.focus():n.view3dCompareChip.mainButton()?.focus()},r.querySelector("[data-close]")?.addEventListener("click",()=>Wt(n)),r.querySelectorAll("[data-passport-seat]").forEach(h=>h.addEventListener("click",()=>{let b=h.dataset.passportSeat,f=b?n.allSeats().find(T=>T.id===b):void 0;f&&Kr(n,f,h)})),r.querySelectorAll("[data-view-seat]").forEach(h=>h.addEventListener("click",()=>{let b=h.dataset.viewSeat;Wt(n,!1),b&&n.view3dHandle?.flyToSeat(b)})),r.querySelectorAll("[data-select-seat]").forEach(h=>h.addEventListener("click",()=>{let b=h.dataset.selectSeat;b&&of(n,b)})),requestAnimationFrame(()=>p()[0]?.focus()),n.emit3dAnalytics("3d_comparison_opened",{seatIds:n.view3dCompareSeatIds.slice()})}function Wt(n,e=!0){let t=n.view3dCompareCleanup;if(n.view3dCompareCleanup=null,!t){n.view3dCompareEl?.remove(),n.view3dCompareEl=null,n.view3dEl?.classList.remove("has-comparison");return}e||(document.activeElement instanceof HTMLElement?document.activeElement:null)?.blur(),t(),e||n.root?.focus({preventScroll:!0})}function of(n,e){if(n.salesClosed){n.toast(n.closedWords?.().toast??n.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}let t=n.allSeats().find(o=>o.id===e);if(!t)return;if(Wt(n,!1),!n.controller.select([e]).length){n.syncSelectionTo3d(),n.toast(n.tf("picker.seatNoLongerAvailable","That seat is no longer available."),"warning");return}n.syncSelectionTo3d(),n.showConfirm(t),n.emit3dAnalytics("3d_comparison_selected",{seatId:e})}var od=require("@seatlayer/core/view3d/crossfade/panorama");var Gr=require("@seatlayer/core");var rf=900,sf=450;function af(n){switch(n){case"seat":return y("picker.stopYourSeat","Your seat");case"row":return y("picker.stopYourRow","Your row");case"section":return y("picker.stopYourSection","Your section");default:return y("picker.stopWholeVenue","Whole venue")}}function nd(n,e){let t=document.createElement("button");t.type="button",t.className="sl-view3d-recentre sl-mo-rotate-in",t.textContent="\u25CE";let i=y("picker.recentreOnStage","Recentre on the stage");t.setAttribute("aria-label",i),t.title=i,t.addEventListener("click",()=>{e.handle()?.recentreSeatView()});let o=document.createElement("div");o.className="sl-view3d-stop",o.setAttribute("role","status"),o.setAttribute("aria-live","polite"),n.append(t,o);let r=null,s=null;return{onStopChange(a){if(r&&(clearTimeout(r),r=null),s&&(clearTimeout(s),s=null),!a){o.classList.remove("is-shown"),o.textContent="",s=setTimeout(()=>{s=null,n.classList.remove("is-seat-view")},sf);return}n.classList.add("is-seat-view"),o.textContent=af(a),o.classList.add("is-shown"),r=setTimeout(()=>{r=null,o.classList.remove("is-shown")},rf)},dispose(){r&&(clearTimeout(r),r=null),s&&(clearTimeout(s),s=null),t.remove(),o.remove(),n.classList.remove("is-seat-view")}}}var lf=44,cf=92;function id(n,e,t,i={}){let o=n?.sectionLabel,r=fe(n),s=df(n,e),a=[o,r?(0,Gr.t)("picker.rowLabel",{label:r}):null,s?(0,Gr.t)("picker.seatLabel",{label:s}):null].filter(Boolean).join(" \xB7 "),l=i.maxChars??(i.narrow?lf:cf);for(let c of[t,i.shortTail??t,null]){let d=[a,c].filter(Boolean).join(" \xB7 ");if(d.length<=l||c==null)return d}return a}function df(n,e){if(n?.seatNumber)return n.seatNumber;let t=n?.displayLabel??e,i=o=>{!o||!t.startsWith(o)||t.length<=o.length||(t=t.slice(o.length).replace(/^[\s·\-\/_]+/,""))};return i(n?.sectionLabel),i(fe(n)),t}var rd=require("@seatlayer/core/core/seatConfidence");var pf=220;function hf(n,e,t){let i=null,o=null,r=null;return(s,a)=>{n()?.presentSeatHover?.(s,a,e),r=a,s!==o&&(o=s,i&&(clearTimeout(i),i=null),!(!s||!t)&&(i=setTimeout(()=>{if(i=null,o!==s)return;let c=t()?.(s)??null;c&&o===s&&n()?.presentSeatHover?.(s,r,e,c)},pf)))}}function sd(n){return n.buyerView}function ad(n,e,t){if(e==="map"){n.exit3d();return}let i=t?.flyToSeatId;if(n.buyerView==="venue3d"){i?(n.opts.onBuyerViewChange?.({view:"venue3d",seatId:i}),n.view3dHandle?.flyToSeat(i)):t?.resetView&&n.view3dHandle?.focusOverview();return}n.enter3d(i)}function ld(n,e){switch(n.controller.getStatus(e.id)){case"held":if(!dd(n,e))return"held";break;case"booked":case"not_for_sale":return"sold";default:break}return n.priceBandKeys!=null&&!n.priceBandKeys.has(e.categoryKey)||n.controller.accessibilityFilterDims?.(e)||n.limitedViewFilter&&(e.commercial?.restrictedView||e.commercial?.obstructedView)?"dimmed":"available"}function cd(n){if(!n.view3dHandle)return;let e=n.allSeats().map(t=>({seatId:t.id,state:n.seatState3dFor(t)}));n.view3dHandle.setAvailability(e),n.syncSelectionTo3d()}function dd(n,e){return n.controller.currentHold()?.labels.includes(e.label)===!0}function uf(n){return(n.controller.currentHold()?.labels??[]).map(e=>n.controller.seatByLabel(e)?.id).filter(e=>!!e)}function pd(n){if(!n.view3dHandle)return;let e=new Set(n.controller.getSelection().map(t=>t.id));for(let t of uf(n))e.add(t);n.view3dHandle.setSelection([...e])}function hd(n,e){let t=n.view3dHandle;if(!t)return;n.pushAvailabilityTo3d(),n.syncSelectionTo3d();let i=e[0];!i||e.every(r=>r.rowId===i.rowId)&&t.focusRow(i.rowId)||i.sectionId&&t.focusSection(i.sectionId)}async function ud(n,e){let t=n.allSeats().find(i=>i.id===e);if(!t)return null;if(t.viewUrl)try{let i=t.viewMeta?.previewUrl,o=!!i&&i!==t.viewUrl,r=o?await n.buyerAssetUrls.resolve(i):null,s=o?t.viewUrl:await n.buyerAssetUrls.resolve(t.viewUrl);return!s||o&&!r?null:{url:s,...r?{previewUrl:r}:{},...o?{resolveUrl:a=>n.buyerAssetUrls.resolve(a)}:{},...t.viewMeta?.sourceWidth!==void 0?{sourceWidth:t.viewMeta.sourceWidth}:{},...t.viewMeta?.sourceHeight!==void 0?{sourceHeight:t.viewMeta.sourceHeight}:{},...t.viewMeta?.previewWidth!==void 0?{previewWidth:t.viewMeta.previewWidth}:{},...t.viewMeta?.previewHeight!==void 0?{previewHeight:t.viewMeta.previewHeight}:{},...t.viewMeta?.variants?.length?{variants:t.viewMeta.variants}:{},...t.viewMeta?.initialBearingDeg!==void 0?{initialBearingDeg:t.viewMeta.initialBearingDeg}:{},...t.viewMeta?.initialPitchDeg!==void 0?{initialPitchDeg:t.viewMeta.initialPitchDeg}:{},...t.viewMeta?.coverage?{coverage:t.viewMeta.coverage}:{},...t.viewMeta?.capturedAt?{capturedAt:t.viewMeta.capturedAt}:{},...t.viewMeta?.sourceLabel?{sourceLabel:t.viewMeta.sourceLabel}:{}}}catch(i){return n.opts.onError?.(i),null}return{url:"",generated:!0,mediaKind:"model",coverage:"exact-seat",sourceLabel:n.tf("picker.chartDerivedModel","Chart-derived model")}}function md(n,e){if(n.salesClosed){n.toast(n.closedWords?.().toast??n.tf("picker.salesClosedToast","Sales are closed for this event."),"warning"),n.syncSelectionTo3d();return}let t=n.allSeats().find(a=>a.id===e);if(!t)return;let i=n.controller.tableSelection(e);if(n.committedSelection().some(a=>i?a.label===i.label:a.id===e)){n.controller.deselect([e]),n.dismissConfirm(),n.syncSelectionTo3d();return}let r=n.controller.getStatus(t.id);if(r==="held"||r==="booked"||r==="not_for_sale"){n.syncSelectionTo3d();return}if(!n.controller.select([e]).length){n.syncSelectionTo3d(),n.dismissConfirm();return}if(n.opts.onBuyerViewChange?.({view:"venue3d",seatId:e}),n.flashPickedSeat(e),i){n.showTableDialog(i,!1),n.syncSelectionTo3d();return}n.opts.confirmSelection!==!1?n.showConfirm(t):n.syncTray(),n.syncSelectionTo3d()}function fd(n,e){let t=n.allSeats().find(i=>i.id===e);return id(n.controller.seatDetails(e),t?.displayLabel??t?.label??e,n.tf("picker.viewFromYourSeat","view from your seat"),{narrow:n.root?.dataset.layout==="narrow",shortTail:n.tf("picker.fromYourSeat","from your seat")})}function gd(n,e){if(n.buyerView!=="venue3d")return;let t=n.view3dCompareSeatIds;t.includes(e.id)||(n.view3dCompareSeatIds=t.length===0?[e.id]:[t[0],e.id]),n.confirmSeat?.id===e.id&&(n.controller.deselect([e.id]),n.dismissConfirm(),n.syncSelectionTo3d(),n.syncTray()),n.view3dCompareChip.sync(),n.emit3dAnalytics("3d_comparison_saved",{seatId:e.id,count:n.view3dCompareSeatIds.length}),n.view3dCompareSeatIds.length>1?n.openView3dComparison():n.toast(n.tf("picker.chooseAnotherToCompare","Seat saved. Choose another seat to compare."),"success")}function bd(n){n.closeView3dComparison(!1),n.view3dCompareSeatIds=[],n.view3dCompareChip.remove(),n.emit3dAnalytics("3d_comparison_cleared")}function yd(n,e){let t=n.allSeats().find(b=>b.id===e);if(!t)return null;let i=n.controller.seatDetails(t.id),o=n.controller.doc?.categories.find(b=>b.key===t.categoryKey),r=i?.price??(o?.tiers?.length?o.tiers[0].price:o?.price),s=r!=null?n.paidPrice(t.categoryKey,i?.tierId??o?.tiers?.[0]?.id??null,r,t.label):void 0,a=n.controller.getStatus(t.id),l=a==="free"||!a?n.tf("picker.available","Available"):dd(n,t)?n.tf("picker.heldForYou","Held for you"):n.tf("picker.group.legendUnavailable","Unavailable"),c=t.viewUrl?(0,od.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}:{}}):n.tf("picker.chartDerivedSeatEye","Live 3D \xB7 chart-derived seat-eye \xB7 not surveyed"),d=$i(t.commercial).join(" \xB7 ")||n.tf("picker.noAuthoredRestriction","No organizer-authored restriction"),p=ya({...t.accessibility?.length?{accessibility:t.accessibility}:{},...i?.wheelchairSpaceType?{wheelchairSpaceType:i.wheelchairSpaceType}:{}}),u=p.length?`${p.join(" \xB7 ")} \xB7 metadata, not access certification`:n.tf("picker.noAccessibilityMetadata","No accessibility metadata supplied"),h=(0,rd.seatConfidenceDisclosure)(t.confidenceEvidence);return{seat:t,label:i?.displayLabel??t.displayLabel??t.label,section:i?.sectionLabel??t.sectionId??"\u2014",row:fe(i)??i?.rowLabel??"\u2014",category:i?.categoryLabel??o?.label??t.categoryKey,price:n.suppressPricing||s==null?"":n.money(s),availability:l,selectable:a==null||a==="free",viewSource:c,limited:d,accessibility:u,confidence:h}}async function vd(n,e){if(n.view3dEl||!n.canOffer3d()||!n.els.map)return;let t=n.controller.doc;if(!t)return;n.buyerView="venue3d",n.view3dTargetSeatId=null,n.opts.onBuyerViewChange?.({view:"venue3d",...e?{seatId:e}:{}}),n.root?.setAttribute("data-view3d","on"),n.dismissConfirm(),n.syncProjection(),n.syncTray();let i=document.createElement("div");i.className="sl-view3d sl-mo-zoom",i.setAttribute("role","group"),i.setAttribute("aria-label",n.tf("picker.interactive3dVenueView","Interactive 3D venue view"));let o=document.createElement("button");o.type="button",o.className="sl-view3d-back",o.innerHTML=`<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M15 18l-6-6 6-6"/></svg><span>${n.tf("picker.backToMap","Back to map")}</span>`;let r=o.querySelector("span"),s=c=>{n.view3dTargetSeatId=c;let d=!!c;i.classList.toggle("is-seat-focused",d),n.root&&(n.root.dataset.view3dSeat=d?"on":"off");let p=d?n.tf("picker.backToVenue","Back to venue"):n.tf("picker.backToMap","Back to map");r&&(r.textContent=p),o.setAttribute("aria-label",p)};if(o.addEventListener("click",()=>{if(n.view3dTargetSeatId&&n.view3dHandle){n.view3dHandle.focusOverview();return}n.exit3d()}),n.regions["top-left"]?.prepend(o),n.view3dBack=o,n.publish3dTopInset(),Vc(n.root)){let c=document.createElement("button");c.type="button",c.className="sl-view3d-fs",c.textContent="\u26F6";let d=n.tf("picker.fullScreen","Full screen");c.setAttribute("aria-label",d),c.title=d,c.setAttribute("aria-pressed",String(!!document.fullscreenElement||n.fsFallback||n.framedFs)),c.addEventListener("click",()=>n.toggleFullscreen()),i.appendChild(c)}let a=document.createElement("div");a.className="sl-view3d-loading",a.setAttribute("role","status"),a.setAttribute("aria-live","polite"),a.textContent=n.tf("picker.loading3d","Building the 3D venue\u2026"),i.appendChild(a),n.els.map.appendChild(i),n.view3dEl=i,n.view3dCompareChip.sync(),requestAnimationFrame(()=>{i.style.opacity="1"});let l=++n.view3dGen;try{let c=n.allSeats(),[d,p]=await Promise.all([ni(),n.controller.loadEventConfiguration()]),u=p?await co(p,v=>n.buyerAssetUrls.resolve(v)):null,h=t.theme?.venue3d?.shellAssetUrl,b=await po(h,v=>n.buyerAssetUrls.resolve(v));if(l!==n.view3dGen||n.buyerView!=="venue3d"||n.view3dEl!==i)return;let f={doc:t,seats:c,...u?{eventConfigurationId:u.id,eventConfiguration:u}:{},...b?{registeredShellGlb:b}:{}};a.textContent=n.tf("picker.building3d","Building venue geometry\u2026");let T=await d.prepareVenue3D(f);if(l!==n.view3dGen||n.buyerView!=="venue3d"||n.view3dEl!==i)return;let w=d.mountVenue3D(i,{...f,prepared:T},{portraitOverviewCrop:!0,arriveAtSeatEye:!0,lookAroundHint:Vt(),navLabels:Oi(),seatViewActionLabel:v=>n.allSeats().find(M=>M.id===v)?.viewUrl?n.tf("picker.openAuthored360","Open venue 360\xB0"):n.tf("picker.lookAroundLive3d","Look around in live 3D"),seatViewCaption:v=>n.seatViewCaption(v),onSeatViewStopChange:v=>n.view3dSeatViewChrome?.onStopChange(v),onSeatPick:v=>n.onView3dSeatPick(v),onSeatInspect:v=>n.onView3dSeatPick(v),onSeatHover:hf(()=>n.controller.getRenderer(),i,()=>{let v=w.captureSeatView;return v?M=>v.call(w,M):void 0}),onSectionFocusChange:v=>{let M=i.querySelector('select[data-locator="section"]'),F=v??"";!M||M.value===F||(M.value=F,M.dispatchEvent(new Event("change")))},onViewTargetChange:v=>{i.querySelector(".sl-view3d-nav")?.classList.toggle("is-seat-focused",!!v),s(v),n.opts.onBuyerViewChange?.({view:"venue3d",...v?{seatId:v}:{}})},...n.seatViewEnabled()?{getSeatView:v=>new Promise((M,F)=>{let X=()=>{n.seatViewFor3d(v).then(_=>{_?M(_):F(new Error("seat_view_unavailable"))})},g=globalThis.requestIdleCallback;typeof g=="function"?g(X,{timeout:1500}):setTimeout(X,50)})}:{},onAnalytics:(v,M)=>n.emit3dAnalytics(v,M)});n.view3dHandle=w,n.view3dSeatViewChrome=nd(i,{handle:()=>n.view3dHandle}),requestAnimationFrame(()=>a.remove()),n.pushAvailabilityTo3d(),n.syncSelectionTo3d(),n.view3dNav=Fc(n.regions["bottom-left"]??i,w),e&&w.flyToSeat(e)}catch(c){if(l!==n.view3dGen||n.buyerView!=="venue3d"||n.view3dEl!==i)return;n.opts.onError?.(c),n.toast(n.tf("picker.unavailable3d","3D could not start. The seat map is still available."),"warning"),n.exit3d()}}function wd(n){let e=n.regions["top-left"];if(!n.root||!e)return;let t=()=>{!n.root||n.root.dataset.view3d!=="on"||n.root.style.setProperty("--sl-3d-top-inset",`${Math.max(44,Math.ceil(e.offsetHeight))}px`)};t(),typeof requestAnimationFrame=="function"&&requestAnimationFrame(t)}function xd(n){if(n.buyerView!=="venue3d"&&!n.view3dEl)return;n.view3dGen++,n.buyerView="map",n.view3dTargetSeatId=null,n.opts.onBuyerViewChange?.({view:"map"}),n.root?.removeAttribute("data-view3d"),n.closeSeatConfidencePassport(!1),n.closeView3dComparison(!1),n.view3dCompareChip.remove(),n.view3dSeatViewChrome?.dispose(),n.view3dSeatViewChrome=null,n.view3dBack?.remove(),n.view3dBack=null,n.view3dNav?.remove(),n.view3dNav=null,n.root?.removeAttribute("data-view3d-seat"),n.root?.style.removeProperty("--sl-3d-top-inset");try{n.view3dHandle?.dispose()}catch{}n.view3dHandle=null;let e=n.view3dEl;n.view3dEl=null,e&&(e.style.opacity="0",setTimeout(()=>e.remove(),320)),n.syncProjection(),n.syncTray();let t=n.view3dReturnSeat;n.view3dReturnSeat=null,t&&n.committedSelection().some(i=>i.id===t.id)&&n.opts.confirmSelection!==!1&&n.showConfirm(t)}var Sd=require("@seatlayer/core");var mi=require("@seatlayer/core");function kd(n){return Array.isArray(n)?n.reduce((e,t)=>t.type==="minimumSelectedPlaces"?Math.max(e,t.minimum):e,0):0}function Do(n,e,t=!1){let i=n.violations[0];return i==="numberOfPlacesToSelect"?n.remaining>0?(0,mi.t)("picker.selectExactMore",{count:n.remaining}):(0,mi.t)("picker.selectExactCount",{count:n.required}):i==="minimumSelectedPlaces"?(0,mi.t)("picker.selectMinimumMore",{count:n.remaining}):t?e("picker.adjustSeatSelection","Adjust seat selection"):i==="consecutiveSeats"?e("picker.selectSeatsTogether","Choose seats together in the same row and ticket category."):(0,mi.t)("picker.orphanHint")}var Ur=6e4,Td=5*6e4,ff=String(Math.round(Td/6e4));function Ed(n){let e=document.createElement("div");e.className="sl-extend",e.dataset.dock="map",e.setAttribute("role","status"),e.innerHTML='<button type="button" class="sl-extend-btn" data-ref="extendBtn"></button><button type="button" class="sl-extend-x" data-ref="extendDismiss" aria-label=""><svg viewBox="0 0 16 16" width="12" height="12" aria-hidden="true" focusable="false"><path d="M3.5 3.5 12.5 12.5M12.5 3.5 3.5 12.5" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg></button>',(n.regions["bottom-center"]??n.els.map).appendChild(e),n.extendEl=e,n.els.extendBtn=e.querySelector('[data-ref="extendBtn"]'),n.els.extendDismiss=e.querySelector('[data-ref="extendDismiss"]'),n.els.extendBtn.textContent=Cd(n),n.els.extendDismiss.setAttribute("aria-label",n.tf("picker.close","Close")),n.els.extendBtn.addEventListener("click",()=>{n.handleExtend()}),n.els.extendDismiss.addEventListener("click",()=>{n.extendDismissed=!0,n.setExtendPrompt(!1,0)})}function Cd(n){return n.tf("picker.addMinutes","+{count} min").replace("{count}",ff)}function Ad(n){let e=n.hold?.items??[],t=new Set(e.map(o=>o.label));return n.committedSelection().filter(o=>!t.has(o.label)).reduce((o,r)=>o+(r.quantity??1),0)+kt(n.gaQty,n.hold?.items??[])}function Pd(n){return(n.hold?.items??[]).reduce((e,t)=>e+(t.quantity??1),0)}function Md(n){let e=new Set((n.hold?.items??[]).map(i=>i.label)),t=n.committedSelection().filter(i=>!e.has(i.label)).reduce((i,o)=>i+(o.quantity??1),0);return n.heldTicketCount()+t+kt(n.gaQty,n.hold?.items??[])}function Ld(n){let e=new Set((n.hold?.items??[]).map(o=>o.label)),t=n.committedSelection().filter(o=>e.has(o.label)).reduce((o,r)=>o+(r.quantity??1),0),i=Math.max(0,n.maxTickets-n.heldTicketCount()-kt(n.gaQty,n.hold?.items??[]));n.controller.setMaxSelection(t+i)}function Hd(n,e=n.lastTrayCount,t=n.pendingSelectionCount()){let i=n.els.cta;if(!i)return;if(delete i.dataset.act,n.salesClosed&&!n.finishingHold?.()){i.disabled=!0,i.textContent=n.closedWords?.().cta??n.tf("picker.salesClosedCta","Sales closed");return}if(n.ctaPhase==="holding"){i.disabled=!0,i.innerHTML=`<span class="sl-cta-spin" aria-hidden="true"></span>${n.tf("picker.securingSeats","Securing your seats\u2026")}`;return}if(n.ctaPhase==="checkout"){i.disabled=!0,i.innerHTML=`<span class="sl-cta-spin" aria-hidden="true"></span>${n.tf("picker.openingCheckout","Opening secure checkout\u2026")}`;return}let o=!n.hold&&n.performanceGroup?.selectionMode==="per_performance"?n.performanceGroup.submissionState?.():null;if(o&&!o.ready){i.disabled=!0,i.textContent=n.tf("picker.completeAllPerformances","Complete all performances ({complete}/{total})").replace("{complete}",String(o.complete)).replace("{total}",String(o.total));return}let r=n.controller.getSelectionValidity(e);if(r&&!r.isValid){i.disabled=!0,i.textContent=Do(r,(s,a)=>n.tf(s,a),!0);return}if(!e&&n.root?.dataset.layout==="narrow"&&!n.performanceGroup&&!n.hold&&!n.bestAvailableSoldOut){i.disabled=!1,i.dataset.act="find",i.textContent=n.tf("picker.findBestSeats","Find best seats");return}i.disabled=e===0,i.textContent=n.hold?t?(0,Sd.t)("picker.secureMoreAndCheckout",{count:t}):n.tf("picker.continueToCheckout","Continue to checkout"):e?n.performanceGroup?n.tf("picker.holdSeatsForAllPerformances","Hold seats for all {count} performances").replace("{count}",String(n.performanceGroup.performanceCount)):n.tf("picker.holdSeatsAndCheckout","Hold seats & checkout"):n.tf("picker.selectSeats","Select seats")}function Rd(n,e){n.ctaPhase=e,n.syncCta()}async function Id(n,e,t){n.setCtaPhase("checkout");try{await n.checkoutHandoff(e,t)}finally{n.ctaPhase==="checkout"&&!n.bookedShown&&n.setCtaPhase("idle")}}function Od(n){return`@seatlayer/hold/v1/${encodeURIComponent(n.apiBase)}/${encodeURIComponent(n.opts.event)}`}function _d(n){if(n.opts.initialHoldId)return n.opts.initialHoldId;if(n.opts.restoreHold===!1||typeof window>"u")return null;try{return window.sessionStorage.getItem(n.holdStorageKey())}catch{return null}}function Nd(n,e){if(!(n.opts.restoreHold===!1||typeof window>"u"))try{window.sessionStorage.setItem(n.holdStorageKey(),e.holdId)}catch{}}function Dd(n){if(!(typeof window>"u"))try{window.sessionStorage.removeItem(n.holdStorageKey())}catch{}}async function Bd(n,e,t=!1){try{let i=await n.controller.resumeHold(e);if(!i||n.destroyed)return null;let o={holdId:i.holdId,expiresAt:i.expiresAt,seats:i.seats,items:i.items};return n.hold=o,n.handedOff=!0,n.bookedShown=!1,n.ctaPhase="idle",n.startHoldTimer(o.expiresAt),n.rememberHold(o),n.syncTray(),n.emitHoldChange(),n.opts.onHoldRestored?.(o,o.seats??[],n.buildHandoff(o)),o}catch(i){let o=i?.status;if(o===404||o===409)n.forgetHold();else if(o===401&&i?.code==="buyer_access_invalid")n.forgetHold(),n.toast(n.tf("picker.savedSeatsNotRestored","Your earlier seats could not be restored. Please choose again."),"warning");else if(n.opts.onError?.(i),t)throw i;return null}}async function Fd(n){let e=n.rememberedHoldId();e&&await n.resumeHoldFromServer(e,!0)}function Vd(n,e){n.stopHoldTimer(),n.holdExpiresAt=e,n.extendDismissed=!1,n.extendUsed=!1,n.hold&&n.rememberHold(n.hold);let t=n.els.hold;t.innerHTML=`<span class="sl-hold-dot" aria-hidden="true"></span><span>${n.tf("picker.held","Held")}</span><span class="sl-hold-time" data-ref="holdTime"></span>`;let i=t.querySelector('[data-ref="holdTime"]'),o=()=>{let r=Math.max(0,n.holdExpiresAt-Date.now());i&&(i.textContent=Ha(r)),t.classList.add("on"),t.classList.toggle("is-expiring",r>0&&r<=Ur),n.setExtendPrompt(r>0&&r<=Ur,r),(r<=0||!n.controller.currentHold())&&n.stopHoldTimer()};n.holdTimer=setInterval(o,500),o()}function $d(n){n.holdTimer&&clearInterval(n.holdTimer),n.holdTimer=null,n.els.hold?.classList.remove("on","is-expiring"),n.setExtendPrompt(!1,0)}function zd(n,e,t){if(!n.extendEl)return;let i=e&&t>0&&n.root?.dataset.layout!=="narrow"&&!n.extendDismissed&&!n.extendUsed&&!!n.controller.currentHold()&&!n.bookedShown;n.extendEl.classList.toggle("on",i)}function jd(n){if(!n.holdTimer)return;let e=Math.max(0,n.holdExpiresAt-Date.now());n.setExtendPrompt(e>0&&e<=Ur,e)}async function Kd(n){let e=n.els.extendBtn,t=n.controller.currentHold();if(!(!t||!n.api.extend||n.extendUsed)){e.disabled=!0,e.textContent=n.tf("picker.addingEllipsis","Adding\u2026");try{let i=await n.api.extend(n.controller.key,t.holdId,Td);if(n.controller.currentHold()?.holdId!==t.holdId)return;n.controller.setHold({holdId:t.holdId,labels:t.labels,expiresAt:i.expiresAt,items:t.items});let o=n.controller.currentHold();if(!o)return;n.hold={holdId:o.holdId,expiresAt:o.expiresAt,seats:o.seats,items:o.items},n.holdExpiresAt=o.expiresAt,n.extendUsed=!0,n.extendEl?.classList.remove("on"),n.rememberHold(n.hold),n.emitHoldChange(),n.toast(n.tf("picker.moreTimeAdded","More time added. Your seats are still held."),"success")}catch(i){if(i?.reason==="extend_limit"){n.extendUsed=!0,n.setExtendPrompt(!1,0);return}n.opts.onError?.(i),n.toast(n.tf("picker.couldNotAddMoreTime","Couldn't add more time. Please head to checkout now."),"warning")}finally{e.disabled=!1,e.textContent=Cd(n)}}}function bf(n){let e=n;return e?.status===404?"ended":e?.status!==409||e.code!=="hold_not_active"?"unknown":e.reason==="booked"?"booked":"ended"}async function Gd(n,e){try{return await n(e),!1}catch(t){return bf(t)==="booked"}}var Wr=require("@seatlayer/core");function Ud(n){return n?.previousPrice!=null&&n.previousPrice>n.price?n.previousPrice:null}function qd(n){return yf(n)+(n.moreLabel?`<button type="button" class="sl-price-more" aria-expanded="${!n.collapsed}">${n.esc(n.moreLabel)}</button>`:"")+vf(n.status)}function yf(n){let{esc:e,money:t}=n;return n.categories.map(i=>{let o=n.priceOf(i),r=n.rangeOf(i),s=n.offerOf(i.key),a=Ud(s),l=n.activeKey===i.key;return`<div class="sl-price-row${n.bandKeys!=null&&!n.bandKeys.has(i.key)?" sl-dim":""}${l?" sl-active":""}" data-cat="${e(i.key)}" role="button" tabindex="0" aria-pressed="${l}" title="${e(n.titleFor(i,l))}"><span class="sl-dot" style="--sl-cat-dot:${e(n.colorOf(i))}"></span><span class="sl-price-label"><span class="sl-price-name">${e(i.label)}</span>`+(s?.offerName?Fi(s.offerName,e):"")+"</span>"+(a!=null?`<span class="sl-price-was">${e(t(a))}</span>`:"")+(r!=null?`<span class="sl-price-amt">${r.min===r.max?e(t(r.min)):`${e(t(r.min))}\u2013${e(t(r.max))}`}</span>`:o!=null?`<span class="sl-price-amt">${e(t(o))}</span>`:"")+"</div>"}).join("")}function vf(n){let e=t=>t.replace(/[&<>"']/g,i=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[i]);return`<div class="sl-status-key" aria-label="${e(n.legend)}"><span class="sl-status-item"><i class="sl-status-icon unavailable" aria-hidden="true"></i>${e(n.unavailable)}</span></div>`}function qr(n){let e=Math.abs(n.scrollLeft),t=e>2,i=e+n.clientWidth<n.scrollWidth-2;return n.dataset.fadeStart=String(t),n.dataset.fadeEnd=String(i),{start:t,end:i}}function Wd(n){let{esc:e,money:t}=n;return`<button type="button" class="sl-rc sl-rc-all" data-rail-all aria-pressed="${n.allActive}" title="${e(n.allWord)}"><span class="sl-rc-t">${e(n.allWord)}</span></button>`+n.categories.map(o=>{let r=n.rangeOf(o),s=n.priceOf(o),a=r?r.min===r.max?t(r.min):`${t(r.min)}+`:s!=null?t(s):null,l=Object.prototype.hasOwnProperty.call(n.left,o.key)&&n.left[o.key]<=0,c=Ud(n.offerOf(o.key)),d=a?`${o.label}: ${a}${l?` (${n.soldOutWord})`:""}`:o.label;return`<button type="button" class="sl-rc" data-cat="${e(o.key)}" aria-pressed="${n.activeKey===o.key}" aria-label="${e(d)}" title="${e(d)}"${l?" disabled":""}><i class="sl-rc-dot" style="--sl-cat-dot:${e(n.colorOf(o))}"></i>`+(c!=null?`<span class="sl-rc-was">${e(t(c))}</span>`:"")+`<span class="sl-rc-t">${e(a??o.label)}</span></button>`}).join("")}function Yd(n,e){let t=n.map(a=>({key:a.key,range:e.rangeOf(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?e.money(a.min):`${e.money(a.min)}\u2013${e.money(a.max)}`,keys:t.filter(l=>l.range.min===a.min&&l.range.max===a.max).map(l=>l.key),min:a.min,max:a.max}));let o=[...t].sort((a,l)=>a.range.min-l.range.min||a.range.max-l.range.max),r=Math.ceil(o.length/4),s=[];for(let a=0;a<o.length;a+=r){let l=o.slice(a,a+r),c=Math.min(...l.map(p=>p.range.min)),d=Math.max(...l.map(p=>p.range.max));s.push({id:`b${a}`,label:c===d?e.money(c):`${e.money(c)}\u2013${e.money(d)}`,keys:l.map(p=>p.key),min:c,max:d})}return s}function Xd(n){if(n.els.pricesSec?.querySelectorAll(".sl-price-select").forEach(o=>o.remove()),n.priceSelect=null,n.suppressPricing||!n.els.prices||!n.els.pricesSec)return;let e=Yd((n.controller.doc?.categories??[]).filter(o=>!o.notForSale),n.legendDeps());if(e.length<2)return;let t=document.createElement("select");t.className="sl-price-select",t.setAttribute("aria-label",n.tf("picker.filterAndFocusByPrice","Filter and focus seats by price"));let i=document.createElement("option");i.value="all",i.textContent=n.tf("picker.allPrices","All prices"),t.appendChild(i);for(let o of e){let r=document.createElement("option");r.value=o.id,r.textContent=o.label,t.appendChild(r)}n.els.pricesSec.appendChild(t),n.priceSelect=t,t.addEventListener("change",()=>{n.applyPriceBand(e.find(o=>o.id===t.value)?.keys??null)})}function Qd(n,e){if(n.focusedCatKey=null,n.priceBandKeys=e?new Set(e):null,n.priceSelect){let t=e?n.priceSelect.value:"all";n.priceSelect.value!==t&&(n.priceSelect.value=t)}n.controller.setCategoryFilter(e),n.controller.focusCategoryFilter(e),n.pushAvailabilityTo3d(),n.syncFloors(),n.syncRung(),n.minimap?.refreshMinimap(),n.syncPrices(),n.lastSection&&n.showSectionCard(n.lastSection)}function Zd(n){return{colorOf:e=>n.controller.getRenderer()?.categoryDisplayColor?.(e.key)??e.color,rangeOf:e=>n.catPriceRange(e),priceOf:e=>n.catPrice(e),offerOf:e=>n.offerPrice(e),money:e=>e?n.money(e):n.tf("checkout.free","Free"),esc:q}}function Jd(n,e,t,i=n.legendDeps()){let o=n.els.railScroll,r=e.length>1;if(n.els.rail?.classList.toggle("has",r),!o)return;o.innerHTML=r?Wd({...i,categories:e,left:t,activeKey:n.focusedCatKey,soldOutWord:n.tf("picker.soldOut","Sold out"),allWord:n.tf("picker.allPrices","All prices"),allActive:!n.focusedCatKey&&!n.priceBandKeys}):"";let s=e.map(a=>a.key).join("|");n.lastRailSignature!==s&&(n.lastRailSignature=s,o.scrollLeft=0),o.querySelectorAll(".sl-rc").forEach(a=>{a.addEventListener("click",()=>{if(a.hasAttribute("data-rail-all")){n.applyPriceBand(null);return}n.focusCategory(a.dataset.cat??"")})}),n.railEdgesBound||(n.railEdgesBound=!0,o.addEventListener("scroll",()=>qr(o),{passive:!0})),requestAnimationFrame(()=>qr(o))}function ep(n){let e=n.controller.doc;if(!e||!n.els.prices)return;let t=n.controller.categoryAvailability(),i=e.categories.filter(p=>!p.notForSale);n.syncSoldout(i,t);let o=n.legendDeps(),r=n.suppressPricing,s=r?{...o,priceOf:()=>{},rangeOf:()=>{},offerOf:()=>null}:o;r&&(n.els.pricesSec?.querySelector("span")?.replaceChildren(n.tf("picker.seatCategories","Seat categories")),n.els.pricesInfo?.remove()),n.syncPriceRail(i,t,s);let a=5,l=i.length-a,c=l>1&&!n.pricesExpanded,d=c?i.slice(0,a):i;n.els.prices.classList.toggle("sl-expanded",l>1&&n.pricesExpanded),n.els.prices.innerHTML=qd({...s,categories:d,left:t,collapsed:c,activeKey:n.focusedCatKey,bandKeys:n.priceBandKeys,titleFor:(p,u)=>u?n.tf("picker.showAllSeats","Show all seats"):(0,Wr.t)("picker.showLabelSeatsOnMap",{label:p.label}),moreLabel:l>1?c?r?n.tf("picker.showAllCategories","Show all categories"):(0,Wr.t)("picker.showAllTicketTypes",{count:i.length}):n.tf("picker.showFewer","Show fewer"):null,status:{legend:n.tf("picker.seatStatusLegend","Seat status legend"),unavailable:n.tf("picker.group.legendUnavailable","Unavailable")}}),n.els.prices.querySelectorAll(".sl-price-row").forEach(p=>{p.addEventListener("mouseenter",()=>n.controller.getRenderer()?.setCategoryHighlight?.(p.dataset.cat??null)),p.addEventListener("mouseleave",()=>n.controller.getRenderer()?.setCategoryHighlight?.(null));let u=()=>n.focusCategory(p.dataset.cat??"");p.addEventListener("click",u),p.addEventListener("keydown",h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),u())})}),n.els.prices.querySelector(".sl-price-more")?.addEventListener("click",()=>{n.pricesExpanded=!n.pricesExpanded,n.syncPrices()})}function tp(n,e){if(!e)return;let t=n.focusedCatKey===e?null:e;n.focusedCatKey=t,n.priceBandKeys=t?new Set([t]):null;let i=n.els.pricesSec?.querySelector(".sl-price-select");i&&(i.value="all"),n.controller.setCategoryFilter(t?[t]:null),n.controller.focusCategoryFilter(t?[t]:null),n.pushAvailabilityTo3d(),n.syncFloors(),n.syncRung(),n.minimap?.refreshMinimap(),n.syncPrices(),n.lastSection&&n.showSectionCard(n.lastSection)}var _n=require("@seatlayer/core");function je(n,e,t){let i=(0,_n.t)(n,t);return i&&i!==n?i:t?e.replace(/\{(\w+)\}/g,(o,r)=>r in t?String(t[r]):o):e}function xf(n){let e=(0,_n.tCount)("picker.seatCount",n);return e.includes("picker.seatCount")?`${n} ${n===1?"seat":"seats"}`:e}function kf(n){try{let e=Intl.ListFormat;if(e)return new e(void 0,{style:"long",type:"conjunction"}).format(n)}catch{}return n.join(", ")}function Sf(n){if(n.length<2)return!1;let e=[...n].sort((t,i)=>t-i);return new Set(e).size!==e.length?!1:e[e.length-1]-e[0]===e.length-1}function Tf(n){let e=n.filter(o=>o.objectType==="ga"),t=n.filter(o=>o.objectType!=="ga"),i=[];if(t.length){let o=xf(t.length),r=[...new Set(t.map(l=>l.sectionLabel).filter(Boolean))],s=[...new Set(t.map(l=>l.rowLabel).filter(Boolean))],a=t.map(l=>Number(l.seatNumber)).filter(l=>Number.isFinite(l));if(r.length===1&&s.length===1&&a.length===t.length){let l=t.length===1?je("picker.releasedSeatPlace","Section {section}, Row {row}, Seat {seat}",{section:r[0],row:s[0],seat:String(t[0].seatNumber??"")}):Sf(a)?je("picker.releasedSeatRange","Section {section}, Row {row}, Seats {from}\u2013{to}",{section:r[0],row:s[0],from:Math.min(...a),to:Math.max(...a)}):"";i.push(l?je("picker.releasedPair","{first} \xB7 {second}",{first:o,second:l}):je("picker.releasedInSection","{seats} in Section {section}",{seats:o,section:r[0]}))}else r.length===1?i.push(je("picker.releasedInSection","{seats} in Section {section}",{seats:o,section:r[0]})):r.length>1?i.push(je("picker.releasedInSections","{seats} in Sections {sections}",{seats:o,sections:kf(r)})):i.push(o)}for(let o of e)i.push(je("picker.releasedGa","{quantity} \xD7 {area}",{quantity:o.quantity??1,area:o.label}));return i.length?i.reduce((o,r)=>je("picker.releasedPair","{first} \xB7 {second}",{first:o,second:r})):""}function np(n){if(!n)return[];let e=new Map((n.seats??[]).map(o=>[o.label,o])),t=n.items??[];return(t.length?t.map(o=>({label:o.label,objectType:o.objectType,quantity:o.quantity})):[...e.keys()].map(o=>({label:o}))).map(o=>{let r=e.get(o.label);return{label:o.label,...o.objectType?{objectType:o.objectType}:{},...o.quantity==null?{}:{quantity:o.quantity},...r?.sectionLabel?{sectionLabel:r.sectionLabel}:{},...r?.rowLabel?{rowLabel:fe(r)??r.rowLabel}:{},...r?.seatNumber?{seatNumber:r.seatNumber}:{}}})}function ip(n,e){if(!n.reducedMotion)for(let t of e.slice(0,10)){if(t.objectType==="ga")continue;let i=n.seatByLabel(t.label);!i||n.statusOf(i.id)!=="free"||n.flash(i.id,n.accent)}}function op(n,e){if(!e.recoverable.length||!n.isConnected)return;let t=n.querySelector(".sl-hold-expired-next");t&&(e.taken.length?t.textContent=e.taken.slice(0,3).map(s=>(0,_n.t)("picker.seatJustTakenByAnother",{label:s})).join(" "):t.remove());let i=n.querySelector(".sl-interrupt-actions"),o=i?.querySelector(".sl-interrupt-act");if(!i||!o)return;o.classList.add("sl-interrupt-act-secondary");let r=document.createElement("button");r.type="button",r.className="sl-interrupt-act sl-hold-expired-recover",r.textContent=(0,_n.tCount)("picker.holdLapsedSelectAgain",e.recoverable.length),r.addEventListener("click",()=>e.onRecover([...e.recoverable])),i.insertBefore(r,o),n.classList.add("has-recovery"),r.focus()}function rp(n,e=[]){let t=document.createElement("div");t.className="sl-interrupt sl-hold-expired sl-mo-scrim",t.setAttribute("role","alertdialog"),t.setAttribute("aria-modal","true");let i=document.createElement("div");i.className="sl-interrupt-card sl-mo-in";let o=document.createElement("div");o.className="sl-interrupt-title",o.id="sl-hold-expired-title";let r=document.createElement("span");r.className="sl-interrupt-glyph",r.setAttribute("aria-hidden","true"),r.textContent="\u23F1";let s=document.createElement("span");s.textContent=je("picker.holdExpiredTitle","Your seats were released"),o.append(r,s);let a=document.createElement("div");a.className="sl-interrupt-body",a.id="sl-hold-expired-body",a.textContent=je("picker.holdExpiredBody","Your hold time ran out and the seats went back on sale."),i.append(o,a);let l=Tf(e);if(l){let u=document.createElement("div");u.className="sl-interrupt-body sl-interrupt-fact sl-hold-expired-seats",u.textContent=l,i.appendChild(u)}let c=document.createElement("div");c.className="sl-interrupt-body sl-hold-expired-next",c.textContent=je("picker.holdExpiredPickAgain","Pick your seats again to continue. They may already be taken."),i.appendChild(c),t.setAttribute("aria-labelledby",o.id),t.setAttribute("aria-describedby",a.id);let d=document.createElement("div");d.className="sl-interrupt-actions";let p=document.createElement("button");return p.type="button",p.className="sl-interrupt-act sl-hold-expired-restart",p.textContent=je("picker.holdExpiredRestart","Choose seats again"),p.addEventListener("click",()=>n.restart()),d.appendChild(p),i.appendChild(d),t.appendChild(i),t.addEventListener("pointerdown",u=>{u.target===t&&n.restart()}),t}var ct=require("@seatlayer/core");var sp={wheelchair:"Wheelchair space",companion:"Companion seat","semi-ambulatory":"Limited mobility","designated-aisle":"Aisle / transfer","step-free":"Step-free",hearing:"Assistive listening",cart:"Live captions","sign-language":"Sign language","low-vision":"Low vision","sensory-friendly":"Sensory-friendly","plus-size":"Plus-size","lift-armrest":"Lift-up armrest"},Ef='<svg viewBox="0 0 20 20" width="17" height="17" fill="none" stroke="currentColor" stroke-width="1.45" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><circle cx="10" cy="10" r="7.5" /><path d="M10 2.5a7.5 7.5 0 0 1 0 15Z" fill="currentColor" stroke="none" /></svg>',Cf='<svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="13" cy="4.4" r="1.9"/><path d="M11 8.2v5.1h5.1"/><path d="M16.6 13.3l1.9 6.3"/><path d="M15.4 14.9a5.6 5.6 0 1 1-5.9-3.4"/></svg>',Af=8,Pf=8,Mf=88;function Lf(n){let e=n.gap??Af,t=n.margin??Pf,i=n.min??Mf,o=Math.max(n.boundsTop,0);return Math.max(Math.round(n.buttonTop-o-e-t),i)}var Bo=class{constructor(e,t){this.active=new Set;this.deps=t,this.root=document.createElement("div"),this.root.className="sl-a11y",this.button=document.createElement("button"),this.button.type="button",this.button.className="sl-a11ybtn",this.button.setAttribute("aria-haspopup","true"),this.button.setAttribute("aria-expanded","false");let o=this.offered().length>0?t.tf("picker.accessibilityOptions","Accessibility and colour options"):t.tf("picker.displayOptions","Display options");this.button.setAttribute("aria-label",o),this.button.innerHTML=Cf,this.menu=document.createElement("div"),this.menu.className="sl-a11ymenu",this.menu.hidden=!0;for(let r of this.stored())this.offeredFree().has(r)&&this.active.add(r);if(this.menu.innerHTML=Ma(o,t.tf("picker.close","Close"))+La(this.rows()),this.root.append(this.menu,this.button),e.prepend(this.root),this.button.addEventListener("pointerdown",r=>r.stopPropagation()),this.button.addEventListener("click",r=>{r.stopPropagation(),this.open(this.menu.hidden)}),this.menu.querySelector("[data-a11y-close]")?.addEventListener("click",r=>{r.stopPropagation(),this.open(!1),this.button.focus({preventScroll:!0})}),this.menu.addEventListener("pointerdown",r=>r.stopPropagation()),this.menu.addEventListener("click",r=>r.stopPropagation()),this.menu.addEventListener("focusin",r=>{let s=r.target;s&&typeof s.scrollIntoView=="function"&&s.scrollIntoView({block:"nearest"})}),this.dismiss=()=>this.open(!1),this.escape=r=>{r.key==="Escape"&&this.open(!1)},this.reflow=()=>{this.menu.hidden||this.fit()},document.addEventListener("pointerdown",this.dismiss),document.addEventListener("keydown",this.escape),window.addEventListener("resize",this.reflow),this.promoteCounts(),this.wire(),this.active.size){this.applyFilter({focus:!1});let r=()=>this.deps.focusSeatsForFilter();typeof requestAnimationFrame=="function"?requestAnimationFrame(r):r()}}colorblindRow(){return this.menu.querySelector(".sl-cbbtn")}syncCounts(){let e=new Map(this.offered().map(({key:i,count:o})=>[i,o])),t=!1;for(let i of this.menu.querySelectorAll("[data-a11y-row]")){let o=i.dataset.a11yRow??"";if(!o.startsWith("a11y:"))continue;let r=o.slice(5),s=e.get(r);if(s===void 0)continue;let a=this.countNode(i),l=s==null?"":this.countText(s);a&&(a.textContent=l);let c=s===0;a instanceof HTMLButtonElement&&(a.disabled=c,a.setAttribute("aria-label",this.jumpLabel(r,l))),i.disabled=c,c?i.setAttribute("aria-disabled","true"):i.removeAttribute("aria-disabled"),c&&this.active.delete(r)&&(this.paint(i,!1),t=!0)}t&&this.applyFilter()}syncAccessibilityFilter(e){this.active.clear();for(let t of e??[])this.active.add(t);this.remember(e&&e.length?e:null);for(let t of this.menu.querySelectorAll("[data-a11y-row]")){let i=t.dataset.a11yRow??"";i.startsWith("a11y:")&&this.paint(t,this.active.has(i.slice(5)))}}refit(){this.menu.hidden||this.fit()}destroy(){document.removeEventListener("pointerdown",this.dismiss),document.removeEventListener("keydown",this.escape),window.removeEventListener("resize",this.reflow),this.root.remove()}fit(){this.menu.style.setProperty("--sl-a11ymenu-max",`${Lf({boundsTop:this.boundsTop(),buttonTop:this.button.getBoundingClientRect().top})}px`)}boundsTop(){let e=this.root.closest(".sl-map")??this.root.closest(".sl-picker");return e instanceof HTMLElement?e.getBoundingClientRect().top:0}open(e){if(e===!this.menu.hidden)return;if(this.button.setAttribute("aria-expanded",String(e)),!e){this.menu.hidden=!0,this.menu.classList.remove("sl-mo-in","sl-mo-stagger");return}this.menu.hidden=!1,this.fit(),this.menu.scrollTop=0;let t=this.button.getBoundingClientRect();mr(this.menu,{x:t.left+t.width/2,y:t.top}),nl(this.menu),tl(this.menu)}rows(){return[...this.filterRows(),...this.deps.hasLimitedView?[{key:"limited",iconHtml:(0,ct.seatTypeIconSvg)("restrictedView",{size:17}),label:this.deps.tf("picker.hideLimitedView","Hide limited-view seats"),on:this.deps.isLimitedViewHidden()}]:[],{key:"colorblind",iconHtml:Ef,className:"sl-cbbtn",label:this.deps.tf("picker.colorblindColors","Colourblind-friendly colours"),on:this.deps.isColorblindSafe()}]}offered(){let e=this.deps.needs?.();if(e)return e.map(({key:i,count:o})=>({key:i,count:o}));let t=this.deps.present;return t?ct.ACCESSIBILITY_TYPES.filter(({key:i})=>t.has(i)).map(({key:i})=>({key:i,count:null})):[]}offeredKeys(){return new Set(this.offered().map(({key:e})=>e))}offeredFree(){return new Set(this.offered().filter(({count:e})=>e!==0).map(({key:e})=>e))}filterRows(){let e=this.offeredKeys(),t=new Map(ct.ACCESSIBILITY_TYPES.map(i=>[i.key,i]));return this.offered().flatMap(({key:i,count:o})=>{let r=t.get(i);return r?[{key:`a11y:${i}`,iconHtml:(0,ct.seatTypeIconSvg)(i,{size:17}),label:this.deps.tf(`picker.accessShort.${i}`,sp[i]??r.label),...i==="wheelchair"&&e.has("companion")?{note:this.deps.tf("picker.companionSeatsNote","Companion places beside them stay selectable")}:{},...o==null?{}:{count:this.countText(o),disabled:o===0},on:this.active.has(i)}]:[]})}wire(){for(let e of this.menu.querySelectorAll("[data-sl-info]"))e.addEventListener("click",()=>{let t=e.closest(".sl-info"),i=!t?.classList.contains("open");for(let o of this.menu.querySelectorAll(".sl-info.open"))o.classList.remove("open"),o.querySelector("[data-sl-info]")?.setAttribute("aria-expanded","false");t?.classList.toggle("open",i),e.setAttribute("aria-expanded",String(i))});for(let e of this.menu.querySelectorAll("[data-a11y-row]"))e.addEventListener("click",()=>{let t=e.dataset.a11yRow??"";if(t==="colorblind"){let r=!this.deps.isColorblindSafe();this.deps.setColorblindSafe(r),this.paint(e,r);return}if(t==="limited"){let r=!this.deps.isLimitedViewHidden();this.deps.setLimitedViewHidden(r),r&&this.deps.focusSeatsForFilter(),this.paint(e,r);return}let i=t.slice(5),o=!this.active.has(i);o?this.active.add(i):this.active.delete(i),this.paint(e,o),this.applyFilter()})}promoteCounts(){if(this.deps.stepToAccessibleSection)for(let e of this.menu.querySelectorAll('[data-a11y-row^="a11y:"]')){let t=e.querySelector(".sl-a11yrow-c");if(!t)continue;let i=(e.dataset.a11yRow??"").slice(5),o=e.parentElement;o?.classList.contains("sl-a11yrow-w")||(o=document.createElement("div"),o.className="sl-a11yrow-w",e.replaceWith(o),o.appendChild(e));let r=document.createElement("button");r.type="button",r.className="sl-a11yrow-c sl-a11yjump",r.dataset.a11yJump=i,r.textContent=t.textContent,r.disabled=e.disabled,r.setAttribute("aria-label",this.jumpLabel(i,t.textContent??"")),t.remove(),e.setAttribute("aria-label",this.rowLabel(i,r.textContent??""));let s=o.querySelector(".sl-info");s?s.after(r):e.after(r),o.dataset.a11yTapThrough||(o.dataset.a11yTapThrough="true",o.addEventListener("click",a=>{a.target===o&&!e.disabled&&e.click()})),r.addEventListener("click",a=>{a.stopPropagation(),this.active.has(i)||(this.active.add(i),this.paint(e,!0),this.applyFilter({focus:!1}));let l=this.deps.stepToAccessibleSection?.(i);l&&r.setAttribute("aria-label",this.jumpLabel(i,r.textContent??"",l.label))})}}countText(e){return e>0?(0,ct.t)("picker.accessFreeCount",{count:e}):"0"}countNode(e){return e.querySelector(".sl-a11yrow-c")??e.parentElement?.querySelector(".sl-a11yrow-c")??null}typeLabel(e){let t=sp[e]??ct.ACCESSIBILITY_TYPES.find(i=>i.key===e)?.label??e;return this.deps.tf(`picker.accessShort.${e}`,t)}jumpLabel(e,t,i){return[this.deps.tf("picker.jumpToSection","Jump to section"),this.typeLabel(e),t,...i?[`${this.deps.tf("picker.section","Section")} ${i}`]:[]].filter(Boolean).join(" \xB7 ")}rowLabel(e,t){return[this.typeLabel(e),t].filter(Boolean).join(" \xB7 ")}paint(e,t){e.classList.toggle("on",t),e.setAttribute("aria-checked",String(t)),e.setAttribute("aria-pressed",String(t))}applyFilter(e={}){let t=this.active.size?[...this.active]:null;this.deps.applyAccessibilityFilter(t),this.remember(t),t&&e.focus!==!1&&this.deps.focusSeatsForFilter()}key(){let e=this.deps.chart?.();return`seatmap.a11y.filter.${this.deps.event}${e?`.${e}`:""}`}stored(){try{let e=window.sessionStorage.getItem(this.key()),t=e?JSON.parse(e):null;return Array.isArray(t)?t:[]}catch{return[]}}remember(e){try{e&&e.length?window.sessionStorage.setItem(this.key(),JSON.stringify(e)):window.sessionStorage.removeItem(this.key())}catch{}}};var ap=require("@seatlayer/core"),Hf=250;function lp(n,e=Hf){let t=null,i=()=>{t===null&&(t=setTimeout(()=>{t=null,n()},e))},o=(0,ap.attachVisibilityCatchUp)(i),r=typeof window<"u"&&typeof window.addEventListener=="function";return r&&window.addEventListener("focus",i),()=>{t!==null&&(clearTimeout(t),t=null),o(),r&&window.removeEventListener("focus",i)}}var Yt=require("@seatlayer/core");var Fo=class{constructor(e){this.note=null;this.told=!1;this.deps=e}deferExpiryToast(e){this.told=!1,queueMicrotask(()=>{this.told||e()})}handle(e){if(!e.holdLapsed)return;this.told=!0;let t=(0,Yt.holdRecoveryShape)(e),i=e.lapsedLabels.length,o=i-e.recoverable.length,r=t==="all"?(0,Yt.tCount)("picker.holdLapsedStillFree",i):t==="partial"?(0,Yt.tCount)("picker.holdLapsedSomeTaken",o):(0,Yt.tCount)("picker.holdLapsedAllTaken",i);this.note={message:r,recoverable:t==="none"?[]:[...e.recoverable]},this.deps.toast(r,t==="none"?"error":"warning",t==="none"?void 0:{label:this.actionLabel(),onClick:()=>this.recover()}),this.deps.syncTray()}noteHtml(){if(!this.note)return"";let e=this.note.recoverable.length?`<button type="button" data-lapse-again>${q(this.actionLabel())}</button>`:"";return`<div class="sl-lapse-note" role="status"><span>${q(this.note.message)}</span>${e}</div>`}wire(e){e?.querySelector("[data-lapse-again]")?.addEventListener("click",()=>this.recover())}clear(){this.note&&(this.note=null,this.deps.syncTray())}actionLabel(){return(0,Yt.tCount)("picker.holdLapsedSelectAgain",this.note?.recoverable.length??0)}recover(){let e=this.note?.recoverable??[];this.note=null,this.deps.syncTray(),e.length&&this.deps.reselect(e)}};var cp=Symbol("seatlayer.performance-group-picker");function Vo(n,e){return Object.defineProperty(n,cp,{configurable:!1,enumerable:!1,value:Object.freeze({...e})}),n}function dp(n){return n[cp]??null}var pp="@seatlayer/pending-checkout/v1";function Rf(n){return typeof n=="string"&&n.length<=160&&/^ord_[A-Za-z0-9_-]+$/.test(n)}function Nn(n){if(typeof location>"u")return null;let e=new URLSearchParams(location.search),t=e.get("seatlayer_checkout");if(t!=="success"&&t!=="cancelled")return null;let i=null;try{let o=window.sessionStorage.getItem(pp);if(o){let r=null;try{r=JSON.parse(o)}catch{}if(r&&Rf(r.orderId)){let s=Date.now()-Number(r.storedAt);if(s>=0&&s<=144e5){if(r.eventKey&&r.eventKey!==n)return null;i=r.orderId}}}window.sessionStorage.removeItem(pp)}catch{}e.delete("seatlayer_checkout");try{let o=e.toString();history.replaceState(history.state,"",`${location.pathname}${o?`?${o}`:""}${location.hash}`)}catch{}return{outcome:t,orderId:i}}function hp(n){if(!n.framed)return null;let e=n.ancestorOrigins?.length?n.ancestorOrigins[0]:null;for(let t of[e,n.referrer])if(t)try{return new URL(t).origin}catch{}return null}var up="https://api.seatlayer.io",If=10,Of=250,mp=6e4,fp=4,_f=10,Nf=40,Df=220,Yr=["mini","peek","open"],gp="seatmap.a11y.cb";function Bf(){try{if(typeof window>"u")return null;let n=window.localStorage.getItem(gp);return n==null?null:n==="1"}catch{return null}}function Ff(n){try{window.localStorage.setItem(gp,n?"1":"0")}catch{}}var dt=class n{constructor(e){this.renderErrorEmitted=!1;this.realtime=null;this.accessEl=null;this.idleClock=null;this.lastSelectionValidity=null;this.root=null;this.mapHost=null;this.rendered=!1;this.destroyed=!1;this.renderInfo=null;this.webMcp=null;this.localeGeneration=0;this.els={};this.regions={};this.ro=null;this.viewportResizeHandler=null;this.holdTimer=null;this.loadAbort=null;this.transportAbort=new AbortController;this.toastTimer=null;this.offerReadInFlight=null;this.offerReadSettledAt=0;this.offerRefreshTimer=null;this.offerBoundaryTimer=null;this.offerCountdownTimer=null;this.offerVisibilityHandler=null;this.motionTimers=new Set;this.currency="USD";this.currencyResolved=!1;this.eventTimezone=null;this.eventWhenText=null;this.offerAvailability=null;this.channelByObject=new Map;this.pricesByChannel=new Map;this.hold=null;this.holdExpiresAt=0;this.handedOff=!1;this.bookedShown=!1;this.holdConflicted=!1;this.paymentOptions=null;this.checkoutPanel=null;this.extendEl=null;this.extendDismissed=!1;this.extendUsed=!1;this.bookedEl=null;this.holdExpiredEl=null;this.holdExpiredFresh=!1;this.holdExpiredUnits=[];this.gaQty=new Map;this.gaPromptEl=null;this.gaPromptReturnFocus=null;this.gaAreasExpanded=!1;this.lastMapPoint=null;this.tipEl=null;this.tipPos={x:0,y:0};this.tipPinned=!1;this.tipMarkedHoverLabel=null;this.lastPointerType="mouse";this.themeMode=null;this.colorSchemeStop=null;this.seatsRevealed=!1;this.seatsRevealedWaiters=[];this.seatsRevealedReport=null;this.renderResolvedAt=null;this.revealWaitMs=null;this.handoverMs=null;this.confirmCardCache=null;this.suppressConfirmationSeatId=null;this.tableDialogEl=null;this.tableDialog=null;this.tableDialogHeld=!1;this.tableDialogReturnFocus=null;this.srEl=null;this.baQty=2;this.baCat="";this.baZone="";this.baPremium=!1;this.bestAvailableConfirm=!1;this.baSoldOutSig="";this.bestAvailableSoldOut=!1;this.salesClosed=!1;this.salesState=null;this.salesInfo=null;this.salesUi=null;this.salesUiLoad=null;this.soldOut=!1;this.soldoutEl=null;this.cbSafe=!1;this.rungsEl=null;this.testBadgeEl=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 Ho({overlay:()=>this.view3dEl,savedSeatIds:()=>this.view3dCompareSeatIds,openComparison:()=>this.openView3dComparison(),clearComparison:()=>this.clearView3dComparison(),toast:(e,t)=>this.toast(e,t)});this.view3dCompareEl=null;this.view3dCompareCleanup=null;this.view3dSeatViewChrome=null;this.view3dPassportEl=null;this.view3dPassportCleanup=null;this.floorsEl=null;this.arenaViewportInsets={top:0,right:0,bottom:0,left:0};this.viewEl=null;this.viewCleanup=null;this.seatViewGen=0;this.allSeatsCache=null;this.view3dBack=null;this.view3dNav=null;this.lastRailSignature="";this.priceSelect=null;this.minimap=null;this.pickerLayoutSize={width:0,height:0};this.fullscreenAffordanceSize={rootWidth:-1,rootHeight:-1,viewportWidth:-1,viewportHeight:-1};this.priceBandKeys=null;this.focusedCatKey=null;this.limitedViewFilter=!1;this.pricesExpanded=!1;this.sectionCardCache=null;this.lastTrayCount=0;this.langSel=null;this.lastTrayTotal=0;this.lastTrayKeys=new Set;this.bestAvailableBusy=!1;this.releasingLabels=new Set;this.holdingLabels=new Set;this.ctaPhase="idle";this.a11yMenu=null;this.detachAttention=null;this.lapse=new Fo({toast:(e,t,i)=>this.toast(e,t,i),reselect:e=>{this.controller.select(e),this.handleCta()},syncTray:()=>this.syncTray()});this.railEdgesBound=!1;this.fsFallback=!1;this.fsChangeHandler=null;this.fsEscHandler=null;this.eventDetailsHidden=!1;this.sideCollapsed=!1;this.sideToggleEl=null;this.framedFs=!1;this.lastPostedHeight=0;this.cbEl=null;this.modalCleanup=null;this.prevFocus=null;this.escHandler=null;this.closeModal=null;this.fitScheduled=!1;this.perspectiveWarned=!1;if(!e||typeof e!="object")throw new Error("seatmap: options object is required");if(!e.event||typeof e.event!="string")throw new Error("seatmap: `event` key is required");if(!e.container)throw new Error("seatmap: `container` is required (or use SeatPicker.open())");this.performanceGroup=dp(e),this.suppressPricing=!!this.performanceGroup?.suppressPricing,this.opts={...e,confirmSelection:e.confirmSelection??!0},this.eventDetailsHidden=!!e.hideEventDetails,this.hostPricing=e.pricing,this.apiBase=(e.apiBase??up).replace(/\/+$/,"");let t={onExpired:a=>{this.opts.onAccessExpired?.(a),a.refreshed||this.showAccessPanel({reason:"no_token",retryable:!1})},onUnavailable:a=>{this.opts.onAccessUnavailable?.(a),this.showAccessPanel(a)}},i=!e.transport&&e.publicKey&&!e.buyerAccessTokenProvider&&!e.buyerAccessToken?io({base:this.apiBase,event:e.event,publicKey:e.publicKey,accessHooks:t,apiOptions:{referral:e.referral,onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)}}):null;this.access=e.transport?null:i?.access??xn(e,t),this.pubApi=e.transport?null:i?.api??new bt(this.apiBase,{access:this.access??void 0,referral:e.referral,onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)}),this.api=$l(e.transport??this.pubApi,this.transportAbort.signal),this.chartFetch=Ji(this.api),this.buyerAssetUrls=new An(e.event,this.api.asset?(a,l)=>this.api.asset(a,l):void 0),e.checkout==="hosted"&&!this.pubApi&&console.warn('seatlayer: checkout: "hosted" needs the widget\'s own transport \u2014 a custom `transport` owns its backend, so the picker is staying on onCheckout for this mount.'),this.checkoutMode=e.checkout==="hosted"&&this.pubApi?"hosted":"handoff";let o=e.numberOfPlacesToSelect;if(o!=null&&(!Number.isInteger(o)||o<1))throw new Error("seatmap: `numberOfPlacesToSelect` must be a positive integer");this.exactTickets=o??null;let r=kd(e.selectionValidators);if(this.exactTickets!=null&&r>this.exactTickets)throw new Error("seatmap: `minimumSelectedPlaces.minimum` cannot exceed `numberOfPlacesToSelect`");let s=Math.max(1,Math.floor(e.maxSelection??this.exactTickets??Math.max(If,r)));if(this.exactTickets!=null&&s<this.exactTickets)throw new Error("seatmap: `maxSelection` cannot be lower than `numberOfPlacesToSelect`");if(e.maxSelection!=null&&s<r)throw new Error("seatmap: `maxSelection` cannot be lower than `minimumSelectedPlaces.minimum`");this.maxTickets=this.exactTickets??s,this.cbSafe=Bf()??!!e.colorblindSafe,this.controller=this.wireController(e)}get confirmEl(){return this.confirmCard.element}set confirmEl(e){this.confirmCard.element=e}get confirmSeat(){return this.confirmCard.candidate}set confirmSeat(e){this.confirmCard.candidate=e}get lastSection(){return this.sectionCard.summary}set lastSection(e){this.sectionCard.adopt(e)}deliverableViewReference(e){return Mn(e)}isFramed(){return typeof window<"u"&&window.parent!==window}postToHost(e){if(!this.isFramed())return;let t=hp({framed:!0,ancestorOrigins:window.location.ancestorOrigins,referrer:document.referrer});if(t)try{window.parent.postMessage(e,t)}catch{}}measureFramedHeight(){let e=this.root;if(!e)return 0;let t=e.clientWidth||(typeof window<"u"?window.innerWidth:0)||0;if(t<=0)return 0;let 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()}fillsViewport(){let e=this.root;if(!e||typeof window>"u")return!1;let t=e.getBoundingClientRect();return t.height>=window.innerHeight-fp&&t.width>=window.innerWidth-fp}syncFullscreenAffordance(){let e=this.els.zfs;if(!e)return;let i=!(!!document.fullscreenElement||this.fsFallback||this.framedFs)&&this.root?.dataset.layout==="narrow"&&this.fillsViewport();e.hidden=i,e.tabIndex=i?-1:0,e.setAttribute("aria-hidden",String(i))}fullscreenMeasurementChanged(e,t){let i=typeof window>"u"?0:window.innerWidth,o=typeof window>"u"?0:window.innerHeight,r=e!==this.fullscreenAffordanceSize.rootWidth||t!==this.fullscreenAffordanceSize.rootHeight||i!==this.fullscreenAffordanceSize.viewportWidth||o!==this.fullscreenAffordanceSize.viewportHeight;return this.fullscreenAffordanceSize={rootWidth:e,rootHeight:t,viewportWidth:i,viewportHeight:o},r}syncFullscreenButtons(){let e=!!document.fullscreenElement||this.fsFallback||this.framedFs,t=this.eventDetailsHidden&&!e;this.root?.setAttribute("data-event-details-hidden",String(t)),this.root?.setAttribute("data-fs",String(e)),this.els.zfs?.setAttribute("aria-pressed",String(e)),this.els.zfs?.setAttribute("title",e?this.tf("picker.exitFullScreen","Exit full screen"):this.tf("picker.fullScreen","Full screen"));let 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)),this.syncFullscreenAffordance()}enterFsFallback(){this.isFramed()?this.setFramedFs(!0):this.setFsFallback(!0)}setFramedFs(e){this.framedFs!==e&&(this.framedFs=e,this.syncFullscreenButtons(),this.postToHost({type:"seatlayer:fullscreen",on:e,background:this.cssVar("--sl-bg")||void 0}),e&&!this.fsEscHandler?(this.fsEscHandler=t=>{t.key==="Escape"&&!document.fullscreenElement&&this.setFramedFs(!1)},window.addEventListener("keydown",this.fsEscHandler)):!e&&this.fsEscHandler&&(window.removeEventListener("keydown",this.fsEscHandler),this.fsEscHandler=null),requestAnimationFrame(()=>this.controller.refitCurrentView()))}setFsFallback(e){this.fsFallback!==e&&(this.fsFallback=e,this.root?.classList.toggle("sl-fs",e),this.syncFullscreenButtons(),e&&!this.fsEscHandler?(this.fsEscHandler=t=>{t.key==="Escape"&&!document.fullscreenElement&&this.setFsFallback(!1)},window.addEventListener("keydown",this.fsEscHandler)):!e&&this.fsEscHandler&&(window.removeEventListener("keydown",this.fsEscHandler),this.fsEscHandler=null),requestAnimationFrame(()=>this.controller.refitCurrentView()))}close(){this.closeModal?this.closeModal():this.destroy()}static async open(e){Pn();let t=document.activeElement instanceof HTMLElement?document.activeElement:null,i=document.createElement("div");i.className="sl-modal-scrim";let o=document.createElement("div");o.className="sl-modal-frame",o.style.setProperty("--sl-bg",gn(void 0,e.theme)["--sl-bg"]),o.setAttribute("role","dialog"),o.setAttribute("aria-modal","true"),o.setAttribute("aria-label",y("picker.seatSelection","Seat selection")),o.tabIndex=-1,i.appendChild(o),document.body.appendChild(i);let r=document.body.style.overflow;document.body.style.overflow="hidden";let s=Vl(i),a;try{a=new n({...e,container:o})}catch(f){throw s(),i.remove(),document.body.style.overflow=r,f}a.prevFocus=t,a.modalCleanup=()=>{a.modalCleanup=null,s(),document.body.style.overflow=r,a.escHandler&&document.removeEventListener("keydown",a.escHandler),i.remove();let f=a.prevFocus;a.prevFocus=null,f?.isConnected&&f.focus({preventScroll:!0})};let l=["a[href]","area[href]","button","input","select","textarea","iframe","object","embed","summary","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"[tabindex]"].join(","),c=()=>{let f=[...o.querySelectorAll('[role="dialog"][aria-modal="true"]')].filter(T=>T.isConnected&&!T.closest('[hidden], [aria-hidden="true"], [inert]'));return f[f.length-1]??o},d=(f,T)=>{let w=f;for(;w;){let v=window.getComputedStyle(w);if(w.hidden||w.getAttribute("aria-hidden")==="true"||w.hasAttribute("inert")||v.display==="none"||v.visibility==="hidden"||v.visibility==="collapse")return!0;if(w===T)return!1;w=w.parentElement}return!0},p=f=>[...f.querySelectorAll(l)].filter(T=>T.tabIndex>=0&&!T.matches(":disabled")&&!d(T,f)),u=(f,T)=>{let w=p(f),v=T?w[w.length-1]:w[0];v?v.focus({preventScroll:!0}):(f.hasAttribute("tabindex")||(f.tabIndex=-1),f.focus({preventScroll:!0}))},h=!1,b=()=>{if(h)return;h=!0,a.modalCleanup?.();let f=()=>{a.destroy(),e.onClose?.()};a.hold&&!a.handedOff&&e.holdOnClose!=="keep"?a.release().finally(f):f()};a.closeModal=b,i.addEventListener("mousedown",f=>{f.target===i&&b()}),a.escHandler=f=>{if(f.key==="Tab"){if(f.defaultPrevented)return;let T=c(),w=p(T),v=w[0],M=w[w.length-1],F=document.activeElement;!v||!M?(f.preventDefault(),u(T,f.shiftKey)):F===T||!F||!T.contains(F)?(f.preventDefault(),(f.shiftKey?M:v).focus({preventScroll:!0})):f.shiftKey&&F===v?(f.preventDefault(),M.focus({preventScroll:!0})):!f.shiftKey&&F===M&&(f.preventDefault(),v.focus({preventScroll:!0}));return}f.key==="Escape"&&(a.tableDialog?(f.preventDefault(),a.cancelTableDialog()):a.confirmSeat?(f.preventDefault(),a.cancelConfirm()):a.bestAvailableConfirm?(f.preventDefault(),a.bestAvailableConfirm=!1,a.syncTray()):(f.preventDefault(),b()))},document.addEventListener("keydown",a.escHandler);try{let f=a.render();a.els.close?.classList.add("on"),a.els.close?.addEventListener("click",b),await f}catch(f){throw a.destroy(),f}return a.destroyed||u(c(),!1),a}static prewarm(e){try{if(!e||typeof e!="object"||typeof e.event!="string"||!e.event||typeof e.publicKey!="string"||!e.publicKey)return;Za({base:(e.apiBase??up).replace(/\/+$/,""),event:e.event,publicKey:e.publicKey})}catch{}}wireController(e){return new O.PickerController({sectionPreview:!0,transport:this.chartFetch.transport,eventKey:e.event,maxSelection:this.maxTickets,selectedObjects:e.selectedObjects,selectableObjects:e.selectableObjects,numberOfPlacesToSelect:e.numberOfPlacesToSelect,selectionValidators:e.selectionValidators,currency:e.currency,categoryPriceRanges:()=>this.mapPriceRanges(),seatPriceLabel:t=>{let i=this.seatPriceRangeOf(t.label,t.categoryKey);return i?this.moneyRange(i):void 0},flashOnLiveChange:!0,colorblindSafe:this.cbSafe,...e.loadingReveal?{loadingReveal:e.loadingReveal}:{},mapTheme:fn(e.theme),onSeatsRevealed:()=>{this.seatsRevealed=!0,this.drainSeatsRevealedWaiters(),this.revealWaitMs===null&&this.renderResolvedAt!==null&&(this.revealWaitMs=performance.now()-this.renderResolvedAt),e.onSeatsRevealed?.(),this.seatsRevealedReport?.()},onGAClick:t=>{let i=this.controller.getGAAreas().find(o=>o.id===t);i&&(this.collapseSheet(),wr(this,i,this.lastMapPoint))},onSelectionChange:()=>{this.syncTray(),this.minimap?.refreshMinimap(),this.committedSelection().length&&this.collapseSectionCard(),this.syncSelectionTo3d()},onStatusChange:(t=>{this.syncSeatMarks(),this.syncPrices(),this.a11yMenu?.syncCounts(),Yl(t)&&this.scheduleOfferRefresh(!0),this.evictTakenSelections(),this.detectBooked(),this.minimap?.refreshMinimap(),this.pushAvailabilityTo3d()}),onHoldExpired:()=>{let t=this.handedOff,i=this.holdConflicted;this.holdExpiredUnits=np(this.hold);let o=this.hold;this.hold=null,this.forgetHold(),this.handedOff=!1,this.bookedShown=!1,this.holdConflicted=!1,this.ctaPhase="idle",this.stopHoldTimer(),this.gaQty.clear();let r=this.api.resume,s=t&&!i&&o&&r?Gd(a=>r.call(this.api,this.opts.event,a),o.holdId):null;this.lapse.deferExpiryToast(()=>{if(t||i){let a=()=>this.toast((0,O.t)("picker.holdExpired",void 0)||"Your hold expired. Seats released. Pick again.","warning");if(!s){a();return}s.then(l=>{if(!(this.destroyed||this.hold)){if(!l){a();return}this.hold=o,this.showBooked()}});return}this.showHoldExpired()}),this.syncTray(),this.emitHoldChange(),s?s.then(a=>{a||this.opts.onHoldExpired?.()}):this.opts.onHoldExpired?.()},onAvailabilityRefresh:t=>this.lapse.handle(t),confirmSelection:this.opts.confirmSelection,onSelect:t=>{if(this.salesClosed){this.controller.deselect([t.id]),this.toast(this.closedWords().toast,"warning");return}this.controller.tableSelection(t.id)||(this.collapseSheet(),this.flashPickedSeat(t.id),this.opts.confirmSelection&&this.suppressConfirmationSeatId!==t.id&&this.showConfirm(t))},onTableSelectionRequest:t=>{if(this.salesClosed){this.controller.deselect(t.physicalSeatIds),this.toast(this.closedWords().toast,"warning");return}this.showTableDialog(t,!1)},onDeselect:t=>{if(this.controller.currentHold()?.labels.includes(t.label)){if(this.opts.confirmSelection===!1||this.salesClosed){this.removeHeldLabels([t.label]);return}if(this.confirmSeat?.id===t.id){this.dismissConfirm();return}this.showConfirm(t,"remove");return}if(this.confirmSeat?.id===t.id){this.dismissConfirm();return}if(this.tableDialog?.physicalSeatIds.includes(t.id)){this.dismissTableDialog();return}this.opts.confirmSelection===!1||this.salesClosed||this.controller.tableSelection(t.id)||(this.controller.select([t.id]),this.showConfirm(t,"remove"))},onSelectionLimit:()=>{this.toast((0,O.t)("picker.maxTicketsForOrder",{count:this.maxTickets}),"warning"),this.opts.onSelectionLimit?.(this.maxTickets)},onViewChange:()=>{this.reanchorConfirm(),this.syncRung(),this.syncProjection(),this.minimap?.drawMinimapRect(),this.sectionCardOnView()},onSectionFocus:t=>this.showSectionCard(t),onDeckTap:()=>{this.showSectionCard(null),this.syncFloors(),this.syncRung(),this.minimap?.refreshMinimap()},onFocusSeat:t=>this.announceSeat(t),onSeatHover:t=>this.updateTooltip(t),hostCardOpen:()=>this.tipPinned||!!this.confirmSeat,onHint:t=>{t&&this.toast(t)},onSalesClosed:()=>this.setSalesClosed(!0),onSalesNotice:t=>this.salesNotice(t),onError:t=>{this.renderErrorEmitted=!0,this.opts.onError?.(t)}})}async render(){if(this.rendered)return this;let e=performance.now(),t={},i=h=>Math.round((performance.now()-h)*100)/100;this.rendered=!0,Pn();let o=performance.now(),r=Yi(this.opts.locale,this.opts.messages),s=this.localeGeneration+=1;this.checkoutMode==="hosted"&&(this.paymentOptions=this.pubApi.paymentOptions(this.opts.event));let a=performance.now(),l=aa(this.opts.container),{root:c,els:d,mapHost:p}=Ga(l,(h,b)=>this.tf(h,b),this.opts.theme);this.root=c,this.els=d,this.mapHost=p,Xi(c,r,h=>{t.loadLocale=i(o),this.destroyed||this.applyActiveLocale(h,s)}),jc(c,()=>[{open:()=>!!this.holdExpiredEl,close:()=>this.restartAfterHoldExpiry()},{open:()=>this.tipPinned,close:()=>this.unpinTooltip()},{open:()=>!!this.tableDialog,close:()=>this.cancelTableDialog()},{open:()=>!!this.confirmSeat,close:()=>this.cancelConfirm()},{open:()=>this.bestAvailableConfirm,close:()=>{this.bestAvailableConfirm=!1,this.syncTray()}}]),this.syncFullscreenButtons(),this.wireBuyerShell(c);let u=document.createElement("div");return u.style.cssText="position:absolute;inset:0",this.mapHost.appendChild(u),t.mountBuyerShell=i(a),t.skeletonPaint=i(e),this.loadAndFinishChart(u,t,i,e,c)}async loadAndFinishChart(e,t,i,o,r){this.startRealtime(),this.startIdleClock(r);let s=await this.loadChart(e,t,i);if(!s)return this.realtime?.stop(),this.realtime=null,this;t.shellsPaint=i(o);let a=performance.now();if(this.salesClosed=!!s.salesClosed||!!this.opts.readOnly,this.salesState=s.salesState??null,this.salesInfo=s,r.dataset.eventMode=s.mode==="test"?"test":"live",!this.opts.locale&&s.locale&&this.setLocale(s.locale),this.controller.setViewMode(this.normalizeInitialView(this.opts.initialView)),this.buildRegions(),this.regions["bottom-right"].appendChild(this.els.zoom),this.regions["bottom-center"].appendChild(this.els.toast),s.mode==="test"){let v=document.createElement("div");v.className="sl-testbadge",this.testBadgeEl=v,this.syncTestBadge(),this.regions["top-left"].appendChild(v)}let l=this.controller.doc?.theme;this.themeMode=this.opts.theme?.mode??null,this.applyThemeTokens(r),this.watchThemeMode(),this.currency=s.currency??this.opts.currency??"USD",this.currencyResolved=!0,this.eventTimezone=s.timezone??null,la(this.els.logo,[this.opts.theme?.logoUrl,l?.logoUrl,s.posterUrl],this.opts.theme?.brandName??l?.brandName??s.eventName??"?"),this.els.name.textContent=s.eventName??"";let c=s.startsAt?Bi(s.startsAt,s.timezone??null,this.opts.locale):"";this.eventWhenText=c||null,this.els.meta.textContent=[s.venue,c].filter(Boolean).join(" \xB7 "),this.syncProjection(),this.buildBadge(l);let d=!!this.controller.doc&&this.controller.getExpandedSeats().some(v=>v.commercial?.restrictedView||v.commercial?.obstructedView);this.buildAccessibilityMenu(d),this.buildLanguageSwitcher(this.els.zoom??this.regions["bottom-right"]),this.srEl=document.createElement("div"),this.srEl.className="sl-sr",this.srEl.setAttribute("aria-live","polite"),r.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(a);let p=performance.now();if(!await this.restoreHoldForFirstPaint(t))return this;if(t.restoreHold=i(p),this.destroyed)return this;this.dismissSkeleton(),this.salesClosed&&this.applySalesClosed(),this.syncOffer(),this.syncPrices(),this.syncTray(),this.resumeHostedOrder();let u=this.controller.doc,h=Hi(this.opts.event),b=this.performanceGroup?.surface??(this.performanceGroup?"performance_group":null),f=b??"event",T={apiBase:this.apiBase,eventKey:this.opts.event,metricScope:f,surface:b==="season"?"season_picker":b==="performance_group"?"performance_group_picker":"seat_picker",ms:i(o),performanceProfile:t,seatCount:this.allSeats().length,objectCount:u?.objects.length??0,sectionCount:u?.objects.filter(v=>v.type==="section").length??0,floorCount:this.controller.getFloors().length,chartName:u?.name,view:this.buyerView,load:h,transport:this.opts.transport?"custom":"pubapi",revealWaitMs:this.revealWaitMs??this.sinceRenderResolved(),handoverMs:this.handoverMs??void 0};Qc(T,(v,M)=>this.emitAnalytics(v,M));let w=s.performanceProfile;return this.seatsRevealedReport=()=>this.emitAnalytics("chart_seats_revealed",jr({...T,performanceProfile:{...T.performanceProfile,...w}})),this.seatsRevealed&&this.seatsRevealedReport(),this.renderInfo=s,await this.registerAgentTools(),this}registerAgentTools(){return Wc(this)}webMcpHost(e){return zr(this,e)}wireBuyerShell(e){this.refreshOfferAvailability(!1),this.api.availability&&(this.offerVisibilityHandler=()=>{!document.hidden&&!this.destroyed&&this.refreshOfferAvailability(!1)},document.addEventListener("visibilitychange",this.offerVisibilityHandler)),this.detachAttention=lp(()=>{this.destroyed||this.controller.refreshAvailability()}),this.observeLayout(e),this.els.zin.addEventListener("click",()=>this.controller.zoomIn()),this.els.zout.addEventListener("click",()=>this.controller.zoomOut()),this.els.zfit?.addEventListener("click",()=>this.controller.overview()),this.els.zfs.addEventListener("click",()=>this.toggleFullscreen()),this.fsChangeHandler=()=>{document.fullscreenElement||this.setFsFallback(!1),this.syncFullscreenButtons(),requestAnimationFrame(()=>this.controller.refitCurrentView())},document.addEventListener("fullscreenchange",this.fsChangeHandler);let t=this.els.sheetHead;if(t){let o=this.els.sheetToggle;this.syncSheetAffordance();let r=0,s=!1,a=!1,l=!1;o?.addEventListener("click",c=>{c.stopPropagation(),!s&&this.cycleSheet()}),t.addEventListener("pointerdown",c=>{if(c.target.closest?.(".sl-seccard")){a=!1;return}l=!!c.target.closest?.(".sl-sheet-toggle"),a=!0,s=!1,r=c.clientY,(l&&o?o:t).setPointerCapture?.(c.pointerId)}),t.addEventListener("pointermove",c=>{if(!a||s)return;let d=c.clientY-r;d<-18?(this.stepSheet(1),s=!0):d>18&&(this.stepSheet(-1),s=!0)}),t.addEventListener("pointerup",c=>{a&&!s&&!l&&Math.abs(c.clientY-r)<6&&this.cycleSheet(),a=!1,(l&&o?o:t).releasePointerCapture?.(c.pointerId),l=!1})}this.els.foot?.addEventListener("click",o=>{this.root?.dataset.layout==="narrow"&&(o.target.closest?.('.sl-chip,button,a,input,select,label,[role="button"]')||this.cycleSheet())});let i=()=>{if(this.root?.dataset.layout!=="narrow")return;let o=this.root.getAttribute("data-prices-open")==="true";this.root.setAttribute("data-prices-open",String(!o)),this.els.pricesSec?.setAttribute("aria-expanded",String(!o)),!o&&this.root.dataset.sheet!=="open"&&this.setSheetOpen(!0)};this.els.pricesSec?.addEventListener("click",o=>{o.target.closest("select,button")||i()}),this.els.pricesSec?.addEventListener("keydown",o=>{o.key!=="Enter"&&o.key!==" "||o.target.closest("select,button")||(o.preventDefault(),i())}),e.addEventListener("click",o=>{let r=o.target.closest("[data-sl-info]");if(!r||!e.contains(r))return;o.stopPropagation();let s=r.closest(".sl-info"),a=!s?.classList.contains("open");this.closeInfoPops(s),s?.classList.toggle("open",a),r.setAttribute("aria-expanded",String(a))}),e.addEventListener("pointerdown",o=>{o.target.closest(".sl-info")||this.closeInfoPops()}),this.tipEl=document.createElement("div"),this.tipEl.setAttribute("role","tooltip"),this.tipEl.className="sl-tip",this.els.map.appendChild(this.tipEl),this.els.map.addEventListener("pointerdown",o=>{this.handleMapPointerDown(o)},!0),this.els.map.addEventListener("mousemove",o=>{if(this.tipPinned)return;let r=this.els.map.getBoundingClientRect();this.tipPos={x:o.clientX-r.left,y:o.clientY-r.top},this.tipEl&&this.tipEl.style.display!=="none"&&this.placeTooltip()}),this.els.cta.addEventListener("click",()=>{this.els.cta.dataset.act==="find"?this.openBestSeatsForm():this.handleCta()})}sheetState(){let e=this.root?.dataset.sheet;return e==="mini"||e==="open"?e:"peek"}sheetHasCards(){return this.root?.getAttribute("data-has-selection")==="true"}setSheetState(e){let t=this.root;if(!t)return;let i=t.dataset.sheet;t.dataset.sheet=e==="mini"&&!this.sheetHasCards()?"peek":e,this.syncSheetAffordance(),i==="mini"&&t.dataset.sheet!=="mini"&&this.scheduleFit()}syncSheetAffordance(){let e=this.sheetState(),t=e==="open"||e==="peek"&&this.sheetHasCards(),i=this.els.sheetToggle;i?.setAttribute("aria-expanded",String(e==="open")),i?.setAttribute("aria-label",t?this.tf("picker.collapseTicketPanel","Collapse ticket panel"):this.tf("picker.openTicketPanel","Open ticket panel"))}cycleSheet(){let e=this.sheetState();e==="open"||e==="mini"?this.setSheetState("peek"):this.setSheetState(this.sheetHasCards()?"mini":"open")}stepSheet(e){let t=Yr.indexOf(this.sheetState()),i=Math.min(Yr.length-1,Math.max(0,t+e));this.setSheetState(Yr[i])}setSheetOpen(e){this.setSheetState(e?"open":"peek")}openBestSeatsForm(){this.setSheetOpen(!0),this.els.tray?.querySelector(".sl-ba")?.scrollIntoView({block:"nearest",behavior:this.reducedMotion()?"auto":"smooth"}),this.els.tray?.querySelector(".sl-ba-go")?.focus()}collapseSheet(){let e=this.root;!e||e.dataset.layout!=="narrow"||e.dataset.sheet!=="open"||this.setSheetState("peek")}observeLayout(e){let t=()=>{let i=e.clientWidth;if(i<=0)return;let o=e.clientHeight,r=i!==this.pickerLayoutSize.width||o!==this.pickerLayoutSize.height;this.pickerLayoutSize={width:i,height:o};let s=this.fullscreenMeasurementChanged(i,o);this.reportFramedHeight();let a=i<640?"narrow":"wide",l=o<560?"compact":"comfortable",c=e.dataset.layout!==a||e.dataset.density!==l;c&&(e.dataset.layout=a,e.dataset.density=l,this.controller.setNarrowLayout?.(a==="narrow"),queueMicrotask(()=>this.syncFitClearance()),this.controller.getRenderer()?.setSectionFocusDim?.(a!=="narrow"),a==="narrow"&&!e.dataset.sheet&&(e.dataset.sheet="peek"),this.dockLayoutChrome(),this.syncMinimapForLayout(),this.lastTrayKeys.size&&this.syncTray(),this.syncMapStepBack(),this.refreshExtendPrompt()),(s||c)&&this.syncFullscreenAffordance(),this.syncArenaViewportInsets(),r&&(this.minimap?.refreshMinimap(),this.scheduleFit())};this.ro=new ResizeObserver(t),this.ro.observe(e),this.els.map&&this.ro.observe(this.els.map),this.viewportResizeHandler=()=>{this.fullscreenMeasurementChanged(e.clientWidth,e.clientHeight)&&this.syncFullscreenAffordance()},window.addEventListener("resize",this.viewportResizeHandler),t(),requestAnimationFrame(t)}async loadChart(e,t,i){let o=performance.now();this.seatsRevealed=!1,this.seatsRevealedWaiters=[],this.seatsRevealedReport=null,this.renderResolvedAt=null,this.revealWaitMs=null,this.handoverMs=null,this.loadAbort=new AbortController;let r=await yn(async()=>{this.renderErrorEmitted=!1;let l=await this.controller.render(e);return this.renderResolvedAt=performance.now(),this.seatsRevealed&&(this.revealWaitMs=0),this.viewportLoading()&&this.drainSeatsRevealedWaiters(),l},this.loadAbort.signal,()=>{let l=this.els.boot.querySelector(".sl-boot-say");l&&(l.classList.add("is-visible"),l.textContent=this.tf("picker.loadingTakingLonger","The seat map is taking longer to load. Please wait\u2026"))});if(this.loadAbort=null,r.outcome==="cancelled"||this.destroyed)return null;let s=r.outcome==="loaded"?r.value:null,a=r.outcome==="loaded"&&!s&&!this.opts.transport?eo(this.chartFetch?.outcome(),this.renderErrorEmitted):null;if(s||this.controller.destroy(),t.loadChartAndStatuses=i(o),this.destroyed)return null;if(!s){a&&to({apiBase:this.apiBase,eventKey:this.opts.event,reason:a}),Qe({apiBase:this.apiBase,event:this.opts.event,scope:this.performanceGroup?.surface??(this.performanceGroup?"performance_group":"event"),surface:this.performanceGroup?.surface==="season"?"season_picker":this.performanceGroup?"performance_group_picker":"seat_picker",outcome:"failure",stage:r.outcome==="timeout"?"load_timeout":r.outcome==="error"?"render_error":"load_chart",ms:t.loadChartAndStatuses,performanceProfile:t,view:"map",load:ot(this.opts.event),transport:this.opts.transport?"custom":"pubapi"});let l=this.opts.transport?void 0:this.chartFetch?.outcome();if(l?.state==="rejected"&&l.error?.status===404){let c=l.error;c.serverMessage&&console.warn(`[SeatLayer] ${c.serverMessage}`),this.opts.onError?.(c),Ln(this.els.boot,{title:this.tf("picker.eventUnavailableTitle","This event isn\u2019t available"),description:this.tf("picker.eventUnavailable","Tickets can\u2019t be booked here right now.")});for(let d of[this.els.side,this.els.rail])d&&(d.setAttribute("inert",""),d.style.display="none");return null}return Ln(this.els.boot,{title:this.tf("picker.mapDidNotLoad","The seat map didn\u2019t load"),description:this.tf("picker.checkConnection","Check your connection and try again."),actionLabel:this.tf("picker.accessRetry","Try again")}),this.els.boot.querySelector("button").addEventListener("click",()=>{if(this.destroyed||!this.root)return;this.controller=this.wireController(this.opts),Ln(this.els.boot,{title:this.tf("picker.loadingSeatMap","Loading seat map\u2026"),busy:!0});let c=performance.now();this.loadAndFinishChart(e,{},i,c,this.root)},{once:!0}),null}return Object.assign(t,s.performanceProfile),s}sinceRenderResolved(){return this.renderResolvedAt===null?void 0:performance.now()-this.renderResolvedAt}whenSeatsRevealed(e){if(!this.destroyed){if(this.seatsRevealed||this.viewportLoading()&&this.renderResolvedAt!==null){e();return}this.seatsRevealedWaiters.push(()=>{this.destroyed||e()})}}viewportLoading(){return this.opts.loadingReveal==="viewport"}drainSeatsRevealedWaiters(){let e=this.seatsRevealedWaiters;this.seatsRevealedWaiters=[];for(let t of e)try{t()}catch{}}async restoreHoldForFirstPaint(e){let t=[this.els.side,this.els.rail].filter(Boolean),i=t.map(o=>o.hasAttribute("inert"));t.forEach(o=>o.setAttribute("inert",""));try{for(;!this.destroyed;){let o=performance.now();try{return await this.restoreRememberedHold(),!this.destroyed}catch{if(this.destroyed)return!1;Qe({apiBase:this.apiBase,event:this.opts.event,reconnects:this.realtime?.reconnects??0,scope:this.performanceGroup?.surface??(this.performanceGroup?"performance_group":"event"),surface:this.performanceGroup?.surface==="season"?"season_picker":this.performanceGroup?"performance_group_picker":"seat_picker",outcome:"failure",stage:"restore_hold",ms:performance.now()-o,performanceProfile:e,view:"map",load:ot(this.opts.event),transport:this.opts.transport?"custom":"pubapi"});let s=Ln(this.els.boot,{title:this.tf("picker.restoreUnavailableTitle","Unable to check saved seats"),description:this.tf("picker.restoreUnavailable","Try again to check whether your saved seats are still held."),actionLabel:this.tf("picker.accessRetry","Try again")}),a=this.transportAbort.signal;if(await new Promise(l=>{let c=()=>{s.removeEventListener("click",c),a.removeEventListener("abort",c),l()};s.addEventListener("click",c,{once:!0}),a.addEventListener("abort",c,{once:!0}),a.aborted&&c()}),this.destroyed||a.aborted)return!1;Ln(this.els.boot,{title:this.tf("picker.restoringSeats","Checking your saved seats\u2026"),busy:!0})}}return!1}finally{t.forEach((o,r)=>{i[r]||o.removeAttribute("inert")})}}resumeHostedOrder(){if(this.checkoutMode!=="hosted")return;let e=Nn(this.opts.event);e?.outcome!=="success"||!e.orderId||this.openCheckoutPanel({kind:"resume",orderId:e.orderId})}buildPanelToggle(){if(!this.regions["top-right"])return;let e=document.createElement("button");e.type="button",e.className="sl-side-toggle",e.addEventListener("click",()=>this.setPanelCollapsed(!this.sideCollapsed)),this.sideToggleEl=e,this.regions["top-right"].appendChild(e),this.syncPanelToggle()}syncPanelToggle(){let e=this.sideToggleEl;if(!e)return;let t=this.sideCollapsed;e.setAttribute("aria-expanded",String(!t)),e.setAttribute("aria-label",t?this.tf("picker.showTicketPanel","Show the ticket panel"):this.tf("picker.hideTicketPanel","Hide the ticket panel")),e.title=t?this.tf("picker.showTicketPanel","Show the ticket panel"):this.tf("picker.hideTicketPanel","Hide the ticket panel"),e.innerHTML=t?`<svg viewBox="0 0 24 24"><path d="M15 6l-6 6 6 6"/></svg><span>${this.tf("picker.tickets","Tickets")}</span>`:'<svg viewBox="0 0 24 24"><path d="M9 6l6 6-6 6"/></svg>'}setPanelCollapsed(e){this.destroyed||(this.sideCollapsed=e,this.applyPanelCollapsed(),this.scheduleMotion(()=>this.controller.refitCurrentView(),340))}applyPanelCollapsed(){let e=this.root?.dataset.layout!=="narrow";this.root?.setAttribute("data-side-collapsed",String(this.sideCollapsed)),this.els.side?.toggleAttribute("inert",this.sideCollapsed&&e),this.syncPanelToggle()}buildAccessibilityMenu(e){let t=this.els.zoom??this.regions["bottom-right"]??this.els.map;t&&(this.a11yMenu=new Bo(t,{event:String(this.opts.event),chart:()=>this.controller.doc?.name??null,needs:()=>this.controller.getAccessNeeds(),hasLimitedView:e,tf:(i,o)=>this.tf(i,o),isColorblindSafe:()=>this.cbSafe,setColorblindSafe:i=>this.setColorblindSafe(i),isLimitedViewHidden:()=>this.limitedViewFilter,setLimitedViewHidden:i=>{this.limitedViewFilter=i,this.controller.setCommercialLimitedFilter(i),this.pushAvailabilityTo3d()},applyAccessibilityFilter:i=>this.applyAccessibilityFilter(i),focusSeatsForFilter:()=>this.whenSeatsRevealed(()=>this.focusSeatsForFilter()),stepToAccessibleSection:i=>this.controller.focusNextAccessibleSection?.([i])??null}),this.cbEl=this.a11yMenu.colorblindRow())}focusSeatsForFilter(){if(this.controller.focusAccessibilityFilter?.()){this.explainAccessibilitySpread();return}this.rungsEl&&this.controller.getRung()!=="seats"&&(this.controller.setRung("seats"),this.collapseSectionCard(),this.syncRung())}explainAccessibilitySpread(){let e=this.controller.accessibilitySpread?.();!e?.wholeVenue||e.sections.length<2||this.toast((0,O.t)("picker.accessSpreadHint",{count:e.spaces,sections:e.sections.length}),"neutral")}applyAccessibilityFilter(e){this.controller.setAccessibilityFilter(e),this.syncPrices(),this.minimap?.refreshMinimap(),this.pushAvailabilityTo3d()}setAccessibilityFilter(e){this.applyAccessibilityFilter(e),this.a11yMenu?.syncAccessibilityFilter(e),e?.length&&this.focusSeatsForFilter()}focusAccessibilityFilter(){this.focusSeatsForFilter()}dockLayoutChrome(){let e=this.root?.dataset.layout==="narrow";this.applyPanelCollapsed();let t=this.els.zfs,i=this.els.headInfo?.parentElement;t&&i&&t.parentElement!==i&&(t.classList.add("sl-fs-pill"),i.insertBefore(t,this.els.hold??null));let o=this.extendEl;if(o){let s=e?this.regions["bottom-center"]??this.els.map:i;s&&o.parentElement!==s&&(o.dataset.dock=e?"map":"head",s===i?s.insertBefore(o,this.els.close??null):s.appendChild(o))}let r=this.els.pricesSec;r&&(e?(r.setAttribute("role","button"),r.tabIndex=0,r.setAttribute("aria-expanded",String(this.root?.getAttribute("data-prices-open")==="true"))):(r.removeAttribute("role"),r.removeAttribute("aria-expanded"),r.tabIndex=-1)),this.lastSection&&this.renderSectionCard(this.lastSection)}buildExtendPrompt(){Ed(this)}buildBookedOverlay(){let e=document.createElement("div");e.className="sl-booked",e.setAttribute("role","status"),e.setAttribute("aria-live","polite"),e.innerHTML=`<div class="sl-booked-badge"><svg viewBox="0 0 24 24"><path d="M20 6L9 17l-5-5"/></svg></div><div class="sl-booked-title">${this.tf("picker.allSetTitle","You're all set")}</div><div class="sl-booked-sub" data-ref="bookedSub"></div><ul class="sl-booked-list" data-ref="bookedList"></ul><button type="button" class="sl-booked-back" data-ref="bookedBack"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M15 18l-6-6 6-6"/></svg><span>${q(this.tf("picker.backToMap","Back to map"))}</span></button>`,this.root.appendChild(e),this.bookedEl=e,this.els.bookedSub=e.querySelector('[data-ref="bookedSub"]'),this.els.bookedList=e.querySelector('[data-ref="bookedList"]'),e.querySelector('[data-ref="bookedBack"]')?.addEventListener("click",()=>this.dismissBooked())}get onGAPromptHook(){return this.opts.onGAPrompt}closedWords(){return this.salesUi?.words(this)??Na(this.salesState,!!this.opts.readOnly)}finishingHold(){return!!this.salesUi?.finishing(this)}withSalesUi(){return this.salesUiLoad??=ca().then(e=>(e.translate(O.t,O.tCount),this.salesUi=e,this.destroyed||this.applySalesClosed(),e),()=>null)}salesNotice(e){(this.salesUi||e.state!=="live")&&this.withSalesUi().then(t=>t?.applyNotice(this,e))}tf(e,t){return y(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(),i=document.createElement("div");i.className="sl-soldout-eyebrow",i.textContent=t;let o=document.createElement("div");o.className="sl-soldout-title",o.textContent=this.tf("picker.soldOutTitle","Sold out");let r=document.createElement("p");r.className="sl-soldout-copy",r.textContent=this.tf("picker.soldOutCopy","No reserved seats are currently available for this event."),e.append(i,o,r),this.els.map.appendChild(e),this.soldoutEl=e}syncSoldout(e,t){let i=this.controller.getGAAreas().length>0,o=this.isSoldOut(e,t,i),r=[...ji(e,t)].join("|");r!==this.baSoldOutSig&&(this.baSoldOutSig=r,this.syncTray()),o!==this.soldOut&&(this.soldOut=o,this.soldoutEl?.classList.toggle("on",o))}isSoldOut(e,t,i){return!i&&e.length>0&&e.every(o=>(t[o.key]??0)===0)}setSalesClosed(e){let t=e||!!this.opts.readOnly;this.salesClosed!==t&&(this.salesClosed=t,this.applySalesClosed())}applySalesClosed(){this.salesClosed&&this.tableDialog&&!this.tableDialogHeld&&this.cancelTableDialog(),this.salesClosed&&!this.salesUi&&this.withSalesUi();let e=this.els.closedPill;if(e){e.classList.toggle("on",this.salesClosed&&!this.salesUi?.view(this));let t=this.els.closedPillText??e;t.textContent=this.closedWords().pill}this.root?.setAttribute("data-sales-closed",String(this.salesClosed)),this.salesClosed&&this.srEl&&(this.srEl.textContent=this.closedWords().toast),this.syncCta(),this.syncTray()}badgeHidden(e){return!!e?.hideBadge}buildBadge(e){if(this.badgeHidden(e))return;let t=this.els.foot;if(!t)return;let 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.dataset.slA="picker.poweredBy";let o=document.createElement("span");o.className="sl-powered-mark",o.setAttribute("aria-hidden","true"),o.innerHTML=lo;let r=document.createElement("span");r.textContent=this.tf("picker.poweredBy","Powered by SeatLayer"),r.dataset.slT="picker.poweredBy",i.append(o,r),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){let t=this.reducedMotion(),i=(e.items??[]).filter(o=>o.objectType!=="ga").slice(0,10).map(o=>this.controller.seatByLabel(o.label)).filter(o=>!!o);if(this.buyerView==="venue3d"&&this.view3dHandle){hd(this,i);return}Ll({regions:this.els,categories:this.controller.doc?.categories,pop:o=>this.controller.flashSeat(o,this.cssVar("--sl-accent")||"#f4b740"),focus:(o,r)=>this.controller.focusSection(o,r),focusSeats:o=>this.controller.focusSeats?.(o,{animate:!t})===!0,reducedMotion:t,screenPoint:o=>this.controller.worldToScreen(o),schedule:(o,r)=>this.scheduleMotion(o,r)},i)}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(){return Ad(this)}heldTicketCount(){return Pd(this)}totalTicketCount(){return Md(this)}updateSelectionCapacity(){Ld(this)}syncCta(e=this.lastTrayCount,t=this.pendingSelectionCount()){Hd(this,e,t)}setCtaPhase(e){Rd(this,e)}runCheckoutHandoff(e,t){return Id(this,e,t)}holdStorageKey(){return Od(this)}rememberedHoldId(){return _d(this)}rememberHold(e){Nd(this,e)}forgetHold(){Dd(this)}resumeHoldFromServer(e,t=!1){return Bd(this,e,t)}restoreRememberedHold(){return Fd(this)}activeFloorObjects(){let e=this.controller.doc;if(!e)return[];let t=e.floors;if(t?.length){let i=this.controller.getActiveFloorId();return(t.find(o=>o.id===i)??t[0]).objects??[]}return e.objects??[]}buildMinimap(){!this.els.map||this.root?.dataset.layout==="narrow"||(this.minimap=Bc({controller:this.controller,root:()=>this.root,cssVar:e=>this.cssVar(e),focusedSectionLabel:()=>this.lastSection?.label,tint:e=>this.controller.getRenderer?.()?.categoryDisplayColor?.(e)||void 0},this.regions["bottom-left"]??this.els.map))}syncMinimapForLayout(){let e=this.root?.dataset.layout==="narrow";if(e&&this.minimap){this.minimap.dispose(),this.minimap=null;return}!e&&!this.minimap&&this.buildMinimap()}catPrice(e){return Oo(this,e)}catPriceRange(e){return _o(this,e)}buildPriceFilter(){Xd(this)}applyPriceBand(e){Qd(this,e)}buildArenaChrome(){let e=this.controller.doc;if(this.rungsEl=null,this.projectionEl=null,this.floorsEl=null,!e||!this.els.map){this.syncArenaViewportInsets();return}let t=e.objects.some(i=>i.type==="section")||(e.floors??[]).some(i=>i.objects.some(o=>o.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.dataset.slA="picker.venueView",i.innerHTML=`<button type="button" data-view="map" aria-pressed="true" data-sl-t="picker.map" data-sl-ti="picker.flat2dMap" title="${this.tf("picker.flat2dMap","Flat 2D map")}">${this.tf("picker.map","Map")}</button><button type="button" data-view="venue3d" aria-pressed="false" data-sl-ti="picker.interactive3dVenueView" title="${this.tf("picker.interactive3dVenueView","Interactive 3D venue view")}">3D</button>`,i.querySelectorAll("button").forEach(o=>{if(o.dataset.view==="venue3d")for(let r of["pointerenter","focus","pointerdown"])o.addEventListener(r,Ni,{once:!0});o.addEventListener("click",()=>{this.setBuyerView(o.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)],o=new Set((e.zones??[]).map(p=>p.id)),a=(0,O.effectiveFloorOverview)(e)==="combined"&&(e.floors?.length??0)>1&&o.size===0||i.some(p=>p.type==="section"&&typeof p.zone=="string"&&o.has(p.zone))?["zones","sections","seats"]:["sections","seats"],l=document.createElement("div");l.className="sl-rungs on sl-mo-indicator",l.setAttribute("role","group"),l.setAttribute("aria-label",(0,O.t)("picker.zoomLevel")),l.dataset.slA="picker.zoomLevel";let c={zones:(0,O.t)("picker.rungLabel.zones"),sections:(0,O.t)("picker.rungLabel.sections"),seats:(0,O.t)("picker.rungLabel.seats")},d={zones:(0,O.t)("picker.rungTip.zones"),sections:(0,O.t)("picker.rungTip.sections"),seats:(0,O.t)("picker.rungTip.seats")};l.innerHTML=a.map(p=>`<button type="button" data-rung="${p}" data-sl-t="picker.rungLabel.${p}" data-sl-ti="picker.rungTip.${p}" title="${d[p]}" aria-pressed="false">${c[p]}</button>`).join(""),l.querySelectorAll("button").forEach(p=>{p.addEventListener("click",()=>{let u=p.dataset.rung;this.controller.setRung(u),u==="seats"&&this.collapseSectionCard()})}),this.regions["top-center"].appendChild(l),this.rungsEl=l,this.syncRung()}if(this.controller.isMultiFloor()){let i=ac({floors:this.controller.getFloors(),tf:(o,r)=>this.tf(o,r),onChoose:o=>{o===""?this.controller.setFloorOverview(!0):this.controller.setFloor(o),this.showSectionCard(null),this.syncFloors(),this.syncRung(),this.minimap?.refreshMinimap()}});(this.regions["bottom-right"]??this.regions["top-left"]).prepend(i),this.floorsEl=i,this.syncFloors()}this.syncArenaViewportInsets()}syncArenaViewportInsets(){let e=this.els.map;e&&Tl(this.root,e,this.regions);let t=e?sc(e.getBoundingClientRect(),[this.rungsEl,this.projectionEl].map(i=>i?.isConnected?i.getBoundingClientRect():null),[],8,this.floorsEl?.isConnected?[this.floorsEl.getBoundingClientRect()]:[]):{top:0,right:0,bottom:0,left:0};Object.keys(t).every(i=>t[i]===this.arenaViewportInsets[i])||(this.arenaViewportInsets=t,this.controller.setViewportInsets(t),this.syncFitClearance())}syncFitClearance(){let e=this.els.map,t=this.els.zoom,i=this.root?.dataset.layout==="narrow",o=0;if(i&&e&&t?.isConnected){let r=e.getBoundingClientRect(),s=t.getBoundingClientRect();s.height>0&&(o=Math.max(0,r.bottom-s.top+8))}this.controller.setFitClearance?.(o)}syncTestBadge(){let e=this.testBadgeEl;e&&(e.textContent=sa((0,O.t)("picker.testMode"),(0,O.getLocale)()),e.setAttribute("aria-label",(0,O.t)("picker.testMode")),e.title=this.tf("picker.testModeExplained","Bookings here are not real and no card is charged"))}syncRung(){let e=this.controller.getRung(),t=this.controller.seatsRevealed?.()??(e==="seats"||!!this.controller.getFocusedSection?.());this.root&&(this.root.dataset.zoomed=String(t)),this.syncMapStepBack(),this.minimap?.setAutoOpen(!1),this.rungsEl&&this.rungsEl.querySelectorAll("button").forEach(i=>{let o=i.dataset.rung===e;i.classList.toggle("on",o),i.setAttribute("aria-pressed",String(o))})}syncMapStepBack(){let e=this.els?.zout,t=this.els?.zfit,i=this.els?.zin;if(!e||!this.root)return;let o=this.controller.getRenderer?.(),r=this.controller.canZoomIn?.()===!1||o?.seatsPickable?.()===!0,s=ec({focusedSection:this.controller.getFocusedSection?.()??null,seatsRevealed:this.controller.seatsRevealed?.()??!0,atVenueFit:this.controller.atVenueFit?.()})==="none",a=e.disabled!==s||!!t&&t.disabled!==s||!!i&&i.disabled!==r||e.hidden||!!i?.hidden||!!t?.hidden;e.disabled=s,e.hidden=!1,i&&(i.disabled=r,i.hidden=!1),t&&(t.disabled=s,t.hidden=!1),a&&this.a11yMenu?.refit()}syncProjection(){this.els.pricesHint&&(this.els.pricesHint.textContent=this.buyerView==="venue3d"?this.tf("picker.priceHint3d","Colours in the venue are ticket types. Choose one below to show just those seats."):this.tf("picker.priceHint","Colours on the map are ticket types. Tap one below to show just those seats.")),this.projectionEl&&this.projectionEl.querySelectorAll("button").forEach(e=>{let t=e.dataset.view===this.buyerView;e.classList.toggle("on",t),e.setAttribute("aria-pressed",String(t))})}canOffer3d(){return this.opts.enable3D===!1||!this.controller.doc||!_i()?!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)?mp/2:mp}syncFloors(){lc(this.floorsEl,this.controller.getActiveFloorId(),this.controller.isFloorOverview())}get sectionCard(){return this.sectionCardCache||(this.sectionCardCache=new Co({controller:this.controller,map:()=>this.els.map,root:()=>this.root,collapseSheet:()=>this.collapseSheet(),region:e=>this.regions[e],refreshMinimap:()=>this.minimap?.refreshMinimap(),activeFloorObjects:()=>this.activeFloorObjects(),sectionNeighbours:e=>this.sectionNeighbours(e),catPriceRange:e=>this.catPriceRange(e),money:e=>this.money(e),suppressPricing:()=>this.suppressPricing,priceBandKeys:()=>this.priceBandKeys})),this.sectionCardCache}showSectionCard(e){this.sectionCard.show(e)}renderSectionCard(e){this.sectionCard.render(e)}collapseSectionCard(){this.sectionCard.collapse()}sectionCardOnView(){this.sectionCard.onView()}sectionNeighbours(e){let t=this.activeFloorObjects().filter(o=>o.type==="section"&&!this.controller.isSectionClosed(o.id)&&this.controller.getSectionSeatCount(o.id)>0);if(t.length<2)return null;let i=t.findIndex(o=>o.id===e);return i<0?null:{previous:t[(i-1+t.length)%t.length],next:t[(i+1)%t.length]}}markedSeatAnnouncement(e){let t=Nr(this.controller.getRenderer()?.getSeatMark?.(e.id),this.performanceGroup?.nights?.());return yc(t,e.displayLabel??e.label,this.opts.locale)}seatPriceRangeOf(e,t){let i=this.controller.doc?.categories.find(r=>r.key===t),o=i?i.tiers?.length?i.tiers.map(r=>this.paidPrice(i.key,r.id??null,r.price,e)):i.price==null?[]:[this.paidPrice(i.key,null,i.price,e)]:[];return o.length?{min:Math.min(...o),max:Math.max(...o)}:void 0}moneyRange(e){return e.max>e.min?`${this.money(e.min)}\u2013${this.money(e.max)}`:this.money(e.min)}announceSeat(e){if(!this.srEl)return;if(!e){this.srEl.textContent="";return}let t=this.markedSeatAnnouncement(e);if(t){this.srEl.textContent=t;return}let i=this.controller.doc?.categories.find(h=>h.key===e.categoryKey),r=(this.controller.getStatus(e.id)??"free")==="free"?this.tf("picker.statusAvailable","available"):this.controller.currentHold()?.labels.includes(e.label)?this.tf("picker.heldForYou","Held for you").toLocaleLowerCase((0,O.getLocale)()):this.tf("picker.group.legendUnavailable","Unavailable").toLocaleLowerCase((0,O.getLocale)()),s=this.seatPriceRangeOf(e.label,e.categoryKey),a=!this.suppressPricing&&s?this.moneyRange(s):void 0,l=this.controller.tableSelection(e.id),c=l??this.controller.seatDetails(e.id),d=qt(c),p=c?.rowLabel??c?.displayLabel??e.displayLabel??e.label,u=l?`${d} ${p}, ${l.bookingMode==="variable"?(0,O.t)("picker.minToMaxGuests",{min:l.minOccupancy,max:l.maxOccupancy}):(0,O.t)("picker.capacityGuests",{count:l.capacity})}`:c?.objectType==="booth"?`${d} ${p}`:c?.objectType==="table"?`${d} ${p}, ${(0,O.t)("picker.seatNumberLower",{label:c.seatNumber??e.label})}`:(0,O.t)("picker.seatLabel",{label:c?.displayLabel??e.displayLabel??e.label});this.srEl.textContent=`${u}, ${i?.label??e.categoryKey}${a?`, ${a}`:""}, ${r}`}showTableDialog(e,t,i){this.dismissTableDialog(!1),this.tableDialog={...e},this.tableDialogHeld=t,this.tableDialogReturnFocus=i??document.activeElement;let o=this.controller.doc?.categories.find(a=>a.key===e.categoryKey),r=e.bookingMode==="variable",s=document.createElement("div");s.className="sl-table-scrim",s.innerHTML=Aa(e,{variable:r,held:t,typeWord:qt(e),categoryLabel:o?.label??e.categoryKey,suppressPricing:this.suppressPricing,unitPrice:this.money(this.paidPrice(e.categoryKey,e.tierId??null,e.price,e.label))}),this.root.appendChild(s),this.tableDialogEl=s,this.renderTableDialogState(),s.querySelectorAll("[data-table-step]").forEach(a=>{a.addEventListener("click",()=>{if(!this.tableDialog)return;let l=Math.max(this.tableDialog.minOccupancy,Math.min(this.tableDialog.maxOccupancy,this.tableDialog.quantity+Number(a.dataset.tableStep)));this.tableDialog={...this.tableDialog,quantity:l},this.renderTableDialogState()})}),s.querySelector(".sl-table-cancel").addEventListener("click",()=>this.cancelTableDialog()),s.querySelector(".sl-table-confirm").addEventListener("click",()=>{this.confirmTableDialog()}),s.addEventListener("mousedown",a=>{a.target===s&&this.cancelTableDialog()}),s.addEventListener("keydown",a=>{if(a.key!=="Tab")return;let l=[...s.querySelectorAll('button:not(:disabled),[tabindex]:not([tabindex="-1"])')];if(!l.length)return;let c=l[0],d=l[l.length-1];a.shiftKey&&document.activeElement===c?(a.preventDefault(),d.focus()):!a.shiftKey&&document.activeElement===d&&(a.preventDefault(),c.focus())}),requestAnimationFrame(()=>s.querySelector(r?'[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 o=t.querySelector("input[data-table-qty]");o&&(o.value=String(e.quantity)),t.querySelectorAll("[data-table-step]").forEach(a=>{let l=Number(a.dataset.tableStep);a.disabled=l<0?e.quantity<=e.minOccupancy:e.quantity>=e.maxOccupancy});let r=this.paidPrice(e.categoryKey,e.tierId??null,e.price,e.label),s=t.querySelector("[data-table-total]");s&&(s.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 o=await this.controller.replaceTableQuantity(e.label,e.quantity,this.opts.holdTtlMs);if(!o){this.toast(this.tf("picker.guestCountCouldNotBeSecured","That guest count could not be secured. Your current table hold is unchanged."),"warning"),this.renderTableDialogState(),i&&(i.disabled=!1,i.textContent=this.tf("picker.updateTable","Update table"));return}this.hold={holdId:o.holdId,expiresAt:o.expiresAt,seats:o.seats,items:o.items},this.startHoldTimer(o.expiresAt),this.dismissTableDialog(),this.syncTray(),this.emitHoldChange(),this.toast((0,O.t)("picker.tableUpdatedForGuests",{label:e.label,count:e.quantity}),"success")}catch(o){this.opts.onError?.(o),this.toast(this.tf("picker.guestCountNoLongerAvailable","That guest count is no longer available. Your current hold is unchanged."),"error"),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())}get confirmCard(){return this.confirmCardCache||(this.confirmCardCache=new Mo({controller:this.controller,root:()=>this.root,els:()=>this.els,regions:()=>this.regions,hideTooltip:()=>{this.tipEl&&(this.tipEl.style.display="none")},tf:(e,t)=>this.tf(e,t),money:e=>this.money(e),paidPrice:(e,t,i,o)=>this.paidPrice(e,t,i,o),offerName:(e,t)=>this.offerPrice(e,t)?.offerName,suppressPricing:()=>this.suppressPricing,reducedMotion:()=>this.reducedMotion(),scheduleMotion:(e,t)=>this.scheduleMotion(e,t),canOffer3d:()=>this.canOffer3d(),buyerView:()=>this.buyerView,view3dHandle:()=>this.view3dHandle,view3dCompareSeatIds:()=>this.view3dCompareSeatIds,rememberView3dReturnSeat:e=>{this.view3dReturnSeat=e},enter3d:e=>{this.enter3d(e)},performanceGroup:()=>this.performanceGroup,seatViewEnabled:()=>this.seatViewEnabled(),openSeatView:e=>{this.openSeatView(e)},openSeatConfidencePassport:(e,t)=>this.openSeatConfidencePassport(e,t),saveView3dComparisonSeat:e=>this.saveView3dComparisonSeat(e),resolveAssetUrl:e=>this.buyerAssetUrls.resolve(e),onError:e=>this.opts.onError?.(e),liftToastOverConfirm:()=>this.liftToastOverConfirm(),fitTranslatedRows:()=>this.fitTranslatedRows(),syncTray:()=>this.syncTray(),syncSelectionTo3d:()=>this.syncSelectionTo3d(),collapseSectionCard:()=>this.collapseSectionCard(),applyPanelCollapsed:()=>this.applyPanelCollapsed(),dismiss:()=>this.dismissConfirm(),releaseHeldSeat:e=>this.controller.currentHold()?.labels.includes(e.label)?this.removeHeldLabels([e.label]):null,reanchor:()=>this.reanchorConfirm(),inviteCommit:(e,t)=>this.inviteCommit(e,t),addSeatLabel:e=>this.addSeatLabel(e),cartLanded:()=>this.cartLanded()})),this.confirmCardCache}showConfirm(e,t="add"){this.confirmCard.show(e,t)}reanchorConfirm(){this.confirmCard.reanchor()}dismissConfirm(){this.confirmCard.dismiss()}cartLanded(){this.animateOnce(this.els.count,"sl-value-pop",380),this.animateOnce(this.els.total,"sl-value-pop",380)}async commitConfirm(){await this.confirmCard.commit()}cancelConfirm(){this.confirmCard.cancel()}closeConfirm(){this.dismissConfirm()}inviteCommit(e,t){_c(e,t,this.reducedMotion())}addSeatLabel(e){return Nc(e,(t,i)=>this.tf(t,i))}seatViewEnabled(){return this.opts.seatView!==!1}allSeats(){return this.allSeatsCache||(this.allSeatsCache=[...this.controller.getExpandedSeats()]),this.allSeatsCache}async openSeatView(e){if(!this.root||!this.seatViewEnabled())return;let t=++this.seatViewGen,i=this.controller.doc,o=this.controller.getActiveFloorId(),r=e.focalPoint??i?.floors?.find(p=>p.id===o)?.focalPoint??i?.focalPoint??{x:0,y:0},s,a,l=!1;if(e.viewUrl){let p,u=null;try{let b=e.viewMeta?.previewUrl;b&&b!==e.viewUrl?(u=await this.buyerAssetUrls.resolve(b),p=e.viewUrl):p=await this.buyerAssetUrls.resolve(e.viewUrl)}catch(b){t===this.seatViewGen&&this.opts.onError?.(b);return}if(t!==this.seatViewGen||!p||e.viewMeta?.previewUrl&&e.viewMeta.previewUrl!==e.viewUrl&&!u||!this.root||!this.seatViewEnabled())return;let h={url:p,...u?{previewUrl:u}:{},...e.viewMeta?.sourceWidth!==void 0?{sourceWidth:e.viewMeta.sourceWidth}:{},...e.viewMeta?.sourceHeight!==void 0?{sourceHeight:e.viewMeta.sourceHeight}:{},...e.viewMeta?.previewWidth!==void 0?{previewWidth:e.viewMeta.previewWidth}:{},...e.viewMeta?.previewHeight!==void 0?{previewHeight:e.viewMeta.previewHeight}:{},...e.viewMeta?.variants?.length?{variants:e.viewMeta.variants}:{},...e.viewMeta?.coverage?{coverage:e.viewMeta.coverage}:{},...e.viewMeta?.capturedAt?{capturedAt:e.viewMeta.capturedAt}:{},...e.viewMeta?.sourceLabel?{sourceLabel:e.viewMeta.sourceLabel}:{}};s=h,a=(0,$o.seatViewDisclosure)(h),l=(0,$o.isAuthoredSeatView)(h)}else{let p;try{let{generateSeatPanorama:u}=await Di();p=u(e,r,this.allSeats())}catch(u){t===this.seatViewGen&&this.opts.onError?.(u);return}if(t!==this.seatViewGen||!this.root||!this.seatViewEnabled())return;s={url:p.url,generated:!0},a=(0,O.t)("picker.illustrationCaption",{m:p.distanceM})}this.closeSeatView(!1);let c=(0,O.t)("picker.viewFromSeat",{label:e.label}),d=ho({root:this.root,source:s,caption:a,real:l,closeLabel:this.tf("picker.close","Close"),dragHint:Vt(),viewFromSeatLabel:c,real360Label:(0,O.t)("picker.real360"),previewLabel:(0,O.t)("picker.preview"),resolveAsset:p=>this.buyerAssetUrls.resolve(p),onClose:()=>this.closeSeatView()});this.viewEl=d.element,this.viewCleanup=()=>d.dispose()}closeSeatView(e=!0){e&&(this.seatViewGen+=1),this.viewCleanup?.(),this.viewCleanup=null,this.viewEl?.remove(),this.viewEl=null}money(e){let t=this.opts.pricing?.formatter;if(t)return t(e,this.currency);let i=Number.isInteger(e);return(0,O.formatMoney)(e,this.currency,{locale:this.opts.locale,fallback:(o,r)=>`${o} ${r}`,...i?{minimumFractionDigits:0,maximumFractionDigits:0}:{}})}scheduleOfferBoundary(e){if(this.offerBoundaryTimer&&clearTimeout(this.offerBoundaryTimer),this.offerBoundaryTimer=null,!this.api.availability||this.destroyed)return;let t=Date.now(),i=Xl(e,t);if(i==null)return;let o=6*36e5,r=Math.min(Math.max(i-t+1e3,1e3),o);this.offerBoundaryTimer=setTimeout(()=>{this.offerBoundaryTimer=null,!document.hidden&&this.refreshOfferAvailability(!1)},r)}offerReadIsCurrent(){return!!this.offerReadInFlight||Date.now()-this.offerReadSettledAt<Of}scheduleOfferRefresh(e){!this.api.availability||this.destroyed||this.offerReadIsCurrent()||(this.offerRefreshTimer&&clearTimeout(this.offerRefreshTimer),this.offerRefreshTimer=setTimeout(()=>{this.offerRefreshTimer=null,this.refreshOfferAvailability(e)},e?180:0))}refreshOfferAvailability(e){if(!this.api.availability||this.destroyed)return Promise.resolve();if(this.offerReadInFlight)return this.offerReadInFlight;if(this.offerReadIsCurrent())return Promise.resolve();let t=this.readOfferAvailability(e).finally(()=>{this.offerReadInFlight===t&&(this.offerReadInFlight=null)});return this.offerReadInFlight=t,t}async readOfferAvailability(e){if(!(!this.api.availability||this.destroyed))try{let t=await this.api.availability(this.opts.event,e);if(this.destroyed)return;this.offerReadSettledAt=Date.now();let i=To(t);if(!i)return;this.offerAvailability=i,this.applyChannelPricing(i.channelPricing),this.scheduleOfferBoundary(i),this.setPricing(this.hostPricing),this.syncMapPriceRanges(),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,t){if(!e)return null;let i=this.offerAvailability?.prices.filter(o=>o.categoryKey===e)??[];return t!==void 0?i.find(o=>(o.tierId??null)===t)??i.find(o=>o.tierId==null)??null:i[0]??null}mapPriceRanges(){if(this.api.availability&&!this.offerAvailability)return null;let e=this.offerAvailability?.prices.some(i=>i.tierId!==void 0)??!1,t=Object.keys(this.opts.pricing?.prices??{}).length>0||Object.keys(this.opts.pricing?.objects??{}).length>0||Object.keys(this.controller.doc?.seatPrices??{}).length>0;if(!(!e&&!t))return Object.fromEntries((this.controller.doc?.categories??[]).flatMap(i=>{let o=this.catPriceRange(i);return o?[[i.key,o]]:[]}))}syncMapPriceRanges(){this.controller.getRenderer()?.setCategoryPriceRanges?.(this.mapPriceRanges())}applyChannelPricing(e){this.channelByObject.clear(),this.pricesByChannel.clear();for(let t of e?.channels??[])this.pricesByChannel.set(t.channelId,t.priceOverrides);for(let t of e?.objects??[])this.pricesByChannel.has(t.channelId)&&this.channelByObject.set(t.label,t.channelId)}syncOffer(){let e=this.els.offer;if(!e)return;if(this.offerCountdownTimer&&clearTimeout(this.offerCountdownTimer),this.offerCountdownTimer=null,e.classList.remove("sl-offer-compact","sl-offer-early-bird"),!this.currencyResolved){e.classList.remove("has"),e.replaceChildren();return}if(this.suppressPricing){e.classList.remove("has"),e.replaceChildren();return}let t=this.offerAvailability,i=t?.release??null,o=!i&&t?.upcoming?.pricingMode!=="matrix"?t?.upcoming??null:null;if(!t||t.state==="closed"||t.state==="sold-out"||!i&&!o){e.classList.remove("has"),e.replaceChildren();return}let r=i??o,s=r.pricingMode==="matrix",a=document.createElement("div");a.className="sl-offer-main";let l=document.createElement("div");l.className="sl-offer-copy";let c=document.createElement("span");c.className="sl-offer-kicker",c.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";let p=r.name||(i?this.tf("picker.currentOffer","Current offer"):this.tf("picker.scheduledOffer","Scheduled offer"));ir(p)&&e.classList.add("sl-offer-early-bird"),d.innerHTML=Vi(p,q);let u=document.createElement("span");u.className="sl-offer-line";let h=[];if(!s&&i&&t.fromPrice!=null&&h.push(this.money(t.fromPrice/100)),!s&&i&&r.remaining!=null&&h.push((0,O.t)("picker.offerRemainingAvailable",{count:r.remaining})),i&&r.endsAt!=null){let v=!this.opts.locale||/^en(?:-|$)/i.test(this.opts.locale)?fa(r.endsAt):null;if(h.push(v??(0,O.t)("picker.offerUntil",{time:Bi(r.endsAt,this.eventTimezone,this.opts.locale)})),v){let M=Math.max(1e3,r.endsAt-Date.now()),F=M%6e4||6e4;this.offerCountdownTimer=setTimeout(()=>{this.offerCountdownTimer=null,Date.now()>=r.endsAt?this.refreshOfferAvailability(!1):this.syncOffer()},Math.min(F+25,M+25))}}if(o?.startsAt!=null&&h.push((0,O.t)("picker.offerStarts",{time:Bi(o.startsAt,this.eventTimezone,this.opts.locale)})),u.textContent=h.join(" \xB7 "),s||l.append(c),l.append(d,u),s){e.classList.add("sl-offer-compact"),a.append(l),e.replaceChildren(a),e.classList.add("has");return}let b=document.createElement("details");b.className="sl-offer-info";let f=document.createElement("summary");f.setAttribute("aria-label",(0,O.t)("picker.howOfferWorks",{name:d.textContent??""})),f.textContent="i";let T=document.createElement("div");T.className="sl-offer-detail",T.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."),b.append(f,T),a.append(l,b),e.replaceChildren(a),e.classList.add("has")}paidPrice(e,t,i,o){if(o){let s=(0,O.seatPriceFor)(this.opts.pricing?.objects,o,t)??(0,O.seatPriceFor)(this.controller.doc?.seatPrices,o,t);if(s!==void 0)return s}let r=o?this.channelByObject.get(o):void 0;if(r&&e){let s=this.pricesByChannel.get(r)?.find(a=>a.categoryKey===e&&a.tierId===(t??null));if(s)return s.price}return lt(this.opts.pricing?.prices,e,t,i)}heldPrice(e){return this.checkoutMode==="hosted"?e.unitPrice:fo({...this.hostPricing,seatPrices:this.controller.doc?.seatPrices},e.label,e.categoryKey,e.tierId,e.unitPrice)}hostObjectPrices(){return this.opts.pricing?.objects}legendDeps(){return Zd(this)}syncPriceRail(e,t,i=this.legendDeps()){Jd(this,e,t,i)}syncPrices(){this.currencyResolved&&ep(this)}focusCategory(e){tp(this,e)}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,O.t)("picker.seatJustTakenByAnother",{label:t[0].label}),"error"))}syncTray(){if(!this.els.tray)return;this.updateSelectionCapacity();let{seats:e,gaAreas:t,heldItems:i,heldLabels:o,total:r,count:s}=Io(this),a=[],l=new Set;if(!this.salesClosed){let g=this.performanceGroup?.nightSummary?.()??[];g.length&&a.push(hc(g,{title:this.tf("picker.group.yourSeatsByNight","Your seats by night"),empty:this.tf("picker.group.noSeatsChosenYet","No seats yet")}));let _=this.performanceGroup?.selectionModeSwitch;_&&a.push(`<button type="button" class="sl-pg-switch" data-pg-switch-mode>${q(_.label)}</button>`)}let c={salesClosed:this.salesClosed,salesState:this.salesState,note:this.salesUi?.note(this),hasPicks:e.length>0||i.length>0,hasGaAreas:t.length>0,groupMode:this.performanceGroup?this.performanceGroup.selectionMode??"same_seat":null,seated:!!this.controller.doc?.objects?.some(g=>g.type!=="gaArea"),venue3d:this.buyerView==="venue3d",whenText:this.eventWhenText?String(this.eventWhenText):void 0};a.push(Da(c)),this.els.trayHint&&(this.els.trayHint.textContent=Ba(c)),this.els.seatsInfo&&(this.els.seatsInfo.hidden=this.salesClosed),this.salesUi?.sync(this);let d=!e.length&&!i.length&&!kt(this.gaQty,this.hold?.items??[]);if(!this.performanceGroup&&!this.salesClosed&&!this.hold&&(d||this.bestAvailableBusy||this.bestAvailableConfirm)){let g=(this.controller.doc?.categories??[]).filter(N=>!N.notForSale),_=this.controller.getBestAvailableZones();this.baZone&&!_.some(N=>N.id===this.baZone)&&(this.baZone="");let G=ji(g,this.controller.categoryAvailability());this.baSoldOutSig=[...G].join("|"),this.bestAvailableSoldOut=g.length>0&&G.size===g.length,G.has(this.baCat)&&(this.baCat=""),(!this.bestAvailableSoldOut||this.bestAvailableBusy||this.bestAvailableConfirm)&&a.push(Oa({confirming:this.bestAvailableConfirm,busy:this.bestAvailableBusy,reopened:!1,quantity:this.baQty,premium:this.baPremium,offerPremium:this.controller.hasPremiumSeats(),categories:g.map(N=>G.has(N.key)?{...N,soldOut:!0}:N),zones:_,selectedCategory:this.baCat,selectedZone:this.baZone}))}let p=(g,_,G,N=1,j,P,z,ee)=>Ra({categoryLabel:z,offerName:ee,d:g?this.controller.seatDetails(g):null,area:G==="ga"?t.find(W=>W.id===j):void 0,label:_,objectType:G,quantity:N,identity:P,performanceLabel:this.performanceGroup?.activePerformanceLabel?.(),performanceDates:this.performanceGroup?.selectedPerformanceDates?.()}),u=q,h=[];for(let g of ll(i)){let _=g.objectType==="ga"?`held:ga:${g.objectId}:${g.tierId??""}`:`held:${g.label}`;l.add(_);let G=this.controller.doc?.categories.find(ze=>ze.key===g.categoryKey),N=this.performanceGroup||this.suppressPricing?null:Yc(this.controller,g),j=g.tierId&&!N?G?.tiers?.find(ze=>ze.id===g.tierId)?.name:void 0,P=this.offerPrice(g.categoryKey,g.tierId??null)?.offerName,z=g.objectType!=="ga"?this.controller.seatByLabel(g.label):null,ee=g.objectType==="table"?this.controller.tableSelection(g.label):null,W=z?this.controller.seatDetails(z.id):null,re=this.seatViewEnabled()&&!!z&&g.objectType!=="table"&&!!this.deliverableViewReference(z),Ee=u(this.tf("picker.heldForYou","Held for you")),ke=(ee?.bookingMode==="variable"?`<button type="button" class="sl-table-edit" data-table-edit="${u(encodeURIComponent(g.label))}">${u((0,O.t)("picker.guestsCountEdit",{count:g.quantity??1}))}</button>`:"")+(N?`<select class="tier" data-held-tier="${u(g.label)}" aria-label="${u((0,O.t)("picker.ticketTierFor",{label:g.label}))}">${lr(N,g.tierId??void 0,u)}</select>`:""),Ce=this.heldPrice(g)*(g.quantity??1);h.push({key:_,fresh:!this.lastTrayKeys.has(_),held:!0,seatIds:[],heldLabels:g.labels,removeAria:(0,O.t)("picker.removeHeldTicketLabel",{label:br(g,t)}),locateId:z?.id??null,section:W?.sectionLabel??"",rowLabel:W&&fe(W)||"",seatLabel:W?.seatNumber??g.label,categoryLabel:`${G?.label??g.categoryKey}${j?` \xB7 ${j}`:""}`,categoryColor:this.controller.getRenderer?.()?.categoryDisplayColor?.(g.categoryKey)??G?.color??"",identityHtml:p(z?.id??null,g.label,g.objectType,g.quantity??1,g.objectId,ee??void 0,`${G?.label??g.categoryKey}${j?` \xB7 ${j}`:""}`,P),stateHtml:`<span class="sl-ticket-state held" aria-label="${Ee}" title="${Ee}"><svg viewBox="0 0 24 24"><rect x="5" y="10" width="14" height="10" rx="2"/><path d="M8 10V7a4 4 0 0 1 8 0v3"/></svg></span>`,extrasHtml:ke,amount:Ce,amountText:this.suppressPricing?"":this.money(Ce),noteHtml:$t(z??void 0),railHtml:this.performanceGroup?"":cr((0,O.t)("picker.removeHeldTicketLabel",{label:br(g,t)}),re?g.label:null)})}let b=this.seatViewEnabled();for(let g of e.filter(_=>!o.has(_.label))){let _=`seat:${g.id}`;l.add(_);let G=this.controller.doc?.categories.find(Ce=>Ce.key===g.categoryKey),N=g.tiers&&g.tiers.length&&!this.suppressPricing?`<select class="tier" data-tier="${u(g.id)}" aria-label="${u((0,O.t)("picker.ticketTierFor",{label:g.label}))}">`+lr(g.tiers,g.tierId,u)+"</select>":"",j=g.tiers?.find(Ce=>Ce.id===g.tierId)??g.tiers?.[0],P=this.offerPrice(g.categoryKey,j?.id??null)?.offerName,z=j?.buyerMessage?.trim()||(j?.restriction==="companion"?this.tf("picker.companionRequiresWheelchair","Requires the adjacent wheelchair place"):""),ee=this.controller.seatDetails(g.id),W=u(this.tf("picker.selected","Selected")),re=(0,O.t)("picker.removeSeatLabel",{label:g.label}),Ee=(g.objectType==="table"&&g.bookingMode==="variable"?`<button type="button" class="sl-table-edit" data-table-edit="${u(encodeURIComponent(g.label))}">${u((0,O.t)("picker.guestsCountEdit",{count:g.quantity??1}))}</button>`:"")+N,ke=this.paidPrice(g.categoryKey,g.tierId??null,g.price,g.label)*(g.quantity??1);h.push({key:_,fresh:!this.lastTrayKeys.has(_),held:!1,seatIds:[g.id],heldLabels:[],locateId:g.id,section:ee?.sectionLabel??"",rowLabel:ee&&fe(ee)||"",seatLabel:ee?.seatNumber??g.label,categoryLabel:G?.label??g.categoryKey,identityHtml:p(g.id,g.label,g.objectType,g.quantity??1,g.objectId,g,G?.label??g.categoryKey,P),categoryColor:this.controller.getRenderer?.()?.categoryDisplayColor?.(g.categoryKey)??G?.color??"",stateHtml:`<span class="sl-ticket-state" aria-label="${W}" title="${W}"><svg viewBox="0 0 24 24"><path d="M5 12l4 4L19 6"/></svg></span>`,extrasHtml:Ee,amount:ke,amountText:this.suppressPricing?"":this.money(ke),removeAria:re,noteHtml:$t(g)+(z?`<small class="sl-tier-note">${u(z)}</small>`:""),railHtml:cr(re,b&&g.objectType!=="table"&&this.deliverableViewReference(this.controller.seatByLabel(g.label)??{})?g.label:null)})}h.length&&a.push(h.map(Ia).join("")),t.length&&a.push(ml(this,t,i)),this.els.tray.innerHTML=a.join("")+(this.salesClosed?"":this.lapse.noteHtml()),this.lastTrayKeys=l,this.lapse.wire(this.els.tray),this.els.tray.querySelector("[data-pg-switch-mode]")?.addEventListener("click",()=>this.performanceGroup?.selectionModeSwitch?.activate());let f=this.performanceGroup?.selectNight;f&&Sc(this.els.tray,g=>f(g)),this.els.tray.querySelectorAll("[data-ba]").forEach(g=>{g.addEventListener("click",()=>{this.baQty=Math.max(1,Math.min(this.maxTickets,this.baQty+Number(g.dataset.ba))),this.syncTray()})}),this.els.tray.querySelector("[data-ba-cat]")?.addEventListener("change",g=>{this.baCat=g.target.value,this.scheduleFit()}),this.els.tray.querySelector("[data-ba-zone]")?.addEventListener("change",g=>{this.baZone=g.target.value}),this.els.tray.querySelector("[data-ba-premium]")?.addEventListener("click",()=>{this.baPremium=!this.baPremium,this.syncTray()}),this.els.tray.querySelector(".sl-ba-go")?.addEventListener("click",()=>{if(this.pendingSelectionCount()>0){this.bestAvailableConfirm=!0,this.syncTray(),this.els.tray.querySelector("[data-ba-replace]")?.focus();return}this.bestAvailable(this.baQty,this.baCat||void 0,{preferPremium:this.baPremium,zoneId:this.baZone||void 0})}),this.els.tray.querySelector("[data-ba-cancel]")?.addEventListener("click",()=>{this.bestAvailableConfirm=!1,this.syncTray(),this.els.tray.querySelector(".sl-ba-go")?.focus()}),this.els.tray.querySelector("[data-ba-replace]")?.addEventListener("click",()=>{this.bestAvailableConfirm=!1,this.bestAvailable(this.baQty,this.baCat||void 0,{preferPremium:this.baPremium,zoneId:this.baZone||void 0})}),this.els.tray.querySelectorAll(".sl-chip .rm").forEach(g=>{g.addEventListener("click",()=>{let _=g.closest(".sl-chip");if(_.dataset.held){this.removeHeldLabels(decodeURIComponent(_.dataset.held).split(`
3545
- `),_);return}let G=_.dataset.seat.split(" "),N=()=>{this.controller.deselect(G)};if(this.reducedMotion()){N();return}_.classList.remove("sl-enter"),_.classList.add("sl-leave","sl-mo-collapse"),this.scheduleMotion(N,we.collapse)})}),this.els.tray.querySelectorAll("[data-table-edit]").forEach(g=>{g.addEventListener("click",_=>{_.stopPropagation();let G=decodeURIComponent(g.dataset.tableEdit??""),N=this.controller.tableSelection(G);if(!N)return;let j=i.find(P=>P.label===G&&P.objectType==="table");this.showTableDialog({...N,quantity:j?.quantity??N.quantity},!!j,g)})}),this.els.tray.querySelectorAll(".sl-chip .tier").forEach(g=>{g.addEventListener("change",()=>g.dataset.heldTier?void this.changeHeldTier(g,g.dataset.heldTier):this.controller.setSeatTier(g.dataset.tier,g.value||null))}),this.els.tray.querySelectorAll(".sl-chip .view[data-view-label]").forEach(g=>{g.addEventListener("click",()=>{let _=this.controller.seatByLabel(g.dataset.viewLabel);_&&this.openSeatView(_)})}),this.els.tray.querySelectorAll(".sl-chip[data-locate]").forEach(g=>{let _=()=>this.controller.flashSeat(g.dataset.locate,this.cssVar("--sl-accent")||"#f4b740");g.addEventListener("mouseenter",_),g.addEventListener("focusin",_),g.addEventListener("click",G=>{G.target.closest?.('button,a,select,[role="button"],input')||!this.controller.focusSeats?.([g.dataset.locate],{animate:!this.reducedMotion()})||_()})}),fl(this,this.els.tray,t),this.controller.setGASelection(rl(this.gaQty)),this.salesClosed&&this.els.tray.querySelectorAll(".sl-ba-go,[data-ba],[data-ba-cat],[data-ba-zone],[data-ba-replace],.sl-ga button").forEach(g=>{g.disabled=!0});let T=this.pendingSelectionCount(),w=this.lastTrayCount,v=this.lastTrayTotal,M=kc(this.performanceGroup?.groupSelectionSummary?.(),this.performanceGroup?.selectionMode??"same_seat");this.els.count.textContent=M||(s?(0,O.tCount)("picker.ticketsCount",s):this.salesUi?.view(this)?this.closedWords().pill:this.tf("picker.noSeatsSelected","No seats selected")),this.els.total.textContent=s&&!this.suppressPricing?this.money(r):"",this.root?.setAttribute("data-has-selection",String(s>0)),this.sheetState()==="mini"&&s===0?this.setSheetState("mini"):s>w&&this.root?.dataset.layout==="narrow"?this.setSheetState("mini"):this.syncSheetAffordance(),this.root?.setAttribute("data-ba-active",String(this.bestAvailableConfirm||this.bestAvailableBusy)),this.els.seatSummary&&(this.els.seatSummary.textContent=M||(s?(0,O.tCount)("picker.seatsSelectedCount",s):"")),this.syncCta(s,T);let X=this.root?.dataset.layout==="narrow"&&this.root?.dataset.confirming==="true";s!==w&&!X&&this.animateOnce(this.els.count,"sl-value-pop",380),r!==v&&!X&&this.animateOnce(this.els.total,"sl-value-pop",380),w===0&&s>0&&(this.animateOnce(this.els.cta,"sl-ready",520),this.sideCollapsed&&this.root?.dataset.layout!=="narrow"&&this.setPanelCollapsed(!1)),this.lastTrayCount=s,this.lastTrayTotal=r,this.opts.onSelectionChange?.(e),this.emitSelectionValidity(s,e),this.scheduleFit()}scheduleFit(){if(this.fitScheduled||this.destroyed)return;this.fitScheduled=!0;let e=()=>{this.fitScheduled=!1,this.destroyed||this.fitTranslatedRows()};typeof requestAnimationFrame=="function"?requestAnimationFrame(e):e()}fitTranslatedRows(){Kl(this.confirmEl?.querySelector(".sl-confirm-row")),this.els.tray?.querySelectorAll(".sl-chip-pos").forEach(Gl),this.els.tray?.querySelectorAll(".sl-ba-go").forEach(Ul),ql(this.els.tray?.querySelector("select.sl-ba-cat"))}emitSelectionValidity(e,t){let i=this.controller.getSelectionValidity(e);i&&(i.seats=t,this.opts.onSelectionValidityChange?.(i),i.isValid?this.lastSelectionValidity!==!0&&this.opts.onSelectionValid?.(t):this.lastSelectionValidity!==!1&&this.opts.onSelectionInvalid?.(i),this.lastSelectionValidity=i.isValid)}async removeHeldLabels(e,t){let i=e.filter(s=>s&&!this.releasingLabels.has(s));if(!i.length)return!1;let o=i[0];i.forEach(s=>this.releasingLabels.add(s)),t?.setAttribute("aria-busy","true");let r=t?.querySelector(".rm");r&&(r.disabled=!0);try{let s=this.handedOff;if(!await this.controller.releaseLabels(i))return this.toast((0,O.t)("picker.couldNotRemoveLabel",{label:o}),"error"),!1;cl(this.gaQty,this.hold?.items??[],i);let l=this.controller.currentHold();return this.hold=l?{holdId:l.holdId,expiresAt:l.expiresAt,seats:l.seats,items:l.items}:null,this.handedOff=!!this.hold&&s,this.bookedShown=!1,this.ctaPhase="idle",this.hold?this.startHoldTimer(this.hold.expiresAt):(this.stopHoldTimer(),this.forgetHold()),this.syncTray(),this.emitHoldChange(),!0}finally{i.forEach(s=>this.releasingLabels.delete(s)),t?.removeAttribute("aria-busy"),r?.isConnected&&(r.disabled=!1)}}async handleCta(){if(this.salesClosed&&!this.finishingHold())return;let e=this.controller.getSelectionValidity(this.totalTicketCount());if(e&&!e.isValid){this.toast(Do(e,(i,o)=>this.tf(i,o)),"warning");return}if(this.totalTicketCount()>this.maxTickets){this.toast((0,O.t)("picker.removeTicketsUntilOrFewer",{count:this.maxTickets}),"warning");return}let t=this.committedSelection();if(this.hold&&(this.salesClosed||!t.some(i=>!(this.hold.items??[]).some(o=>o.label===i.label)))){let i=this.hold.seats??t;this.handedOff=!0,this.holdConflicted=!1,await this.runCheckoutHandoff(this.hold,i);return}this.holdingLabels=new Set(t.map(i=>i.label)),this.setCtaPhase("holding");try{let i=null,o=ol(this.gaQty),r=this.committedSelection();if(r.length){let s=await this.controller.hold(void 0,this.opts.holdTtlMs);i=s?{holdId:s.holdId,expiresAt:s.expiresAt,seats:s.seats,items:s.items}:null}for(let{areaId:s,tierId:a,qty:l}of o){let c=await this.controller.holdGA(s,l,{tierId:a,ttlMs:this.opts.holdTtlMs});i=c?{holdId:c.holdId,expiresAt:c.expiresAt,seats:c.seats,items:c.items}:i}if(!i){this.raiseHoldConflict(this.tf("picker.seatsJustTaken","One or more seats were just taken. Please pick again.")),this.setCtaPhase("idle"),this.syncTray();return}this.hold=i,this.holdConflicted=!1,this.handedOff=!this.performanceGroup,this.startHoldTimer(i.expiresAt),this.flashHeldSeats(i),this.emitHoldChange(),this.performanceGroup?this.setCtaPhase("idle"):await this.runCheckoutHandoff(i,i.seats??r)}catch(i){this.opts.onError?.(i);let o=Or(i);if(o){this.toast(o,"warning"),this.setCtaPhase("idle");return}let r=i,s=(r.conflicts??[]).map(l=>l.label).filter(Boolean).slice(0,3);r.reason==="event_closed"&&this.setSalesClosed(!0);let a=r.reason==="event_closed"?this.tf("picker.seatSalesClosedForEvent","Seat sales have closed for this event."):r.reason==="companion_pair_required"?this.tf("picker.companionPairRequired","Select the adjacent wheelchair place with each companion ticket."):r.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,O.t)("picker.labelsNoLongerAvailable.one",{labels:s.join(", ")}):(0,O.t)("picker.labelsNoLongerAvailable.other",{labels:s.join(", ")}):this.tf("picker.seatsJustTaken","One or more seats were just taken. Please pick again.");this.raiseHoldConflict(a),this.setCtaPhase("idle")}finally{this.holdingLabels.clear(),this.ctaPhase==="holding"&&(this.ctaPhase="idle"),this.syncTray()}}startHoldTimer(e){Vd(this,e)}stopHoldTimer(){$d(this)}setExtendPrompt(e,t){zd(this,e,t)}refreshExtendPrompt(){jd(this)}handleExtend(){return Kd(this)}detectBooked(){this.bookedShown||!this.handedOff||!this.hold||this.holdConflicted||this.controller.currentHold()===null&&this.showBooked()}settleBookedHold(e){this.hold?.holdId!==e||this.bookedShown||this.holdConflicted||(this.controller.clearHold(),this.showBooked())}raiseHoldConflict(e){this.holdConflicted=!0,this.bookedShown&&(this.bookedShown=!1,this.bookedEl?.classList.remove("on")),this.toast(e,"error")}showBooked(){if(this.bookedShown||!this.hold||this.holdConflicted)return;this.bookedShown=!0;let e=this.buildHandoff(this.hold);this.stopHoldTimer(),this.forgetHold();let t=e.lineItems.reduce((o,r)=>o+r.quantity,0),i=this.performanceGroup?.groupSelectionSummary?.();this.els.bookedSub&&(this.els.bookedSub.innerHTML=i?.seats?`<span class="sl-booked-seats">${(0,O.tCount)("picker.group.ticketsConfirmedAcross",i.seats,{performances:i.performances})}</span>`:`<span class="sl-booked-seats">${(0,O.tCount)("picker.ticketsCount",t)}</span> ${this.tf("picker.confirmedAndOnWay","confirmed. A confirmation is on its way.")}`),this.els.bookedList&&(this.els.bookedList.innerHTML=e.lineItems.map(o=>{let s=[o.sectionLabel,o.rowLabel&&`${this.tf("picker.row","Row")} ${o.rowLabel}`,o.seatNumber&&`${this.tf("picker.seat","Seat")} ${o.seatNumber}`].filter(Boolean).join(" \xB7 ")||o.displayLabel||o.label,a=o.quantity>1?` <span class="sl-booked-qty">\xD7${o.quantity}</span>`:"";return`<li>${q(s)}${a}</li>`}).join(""),this.els.bookedList.hidden=e.lineItems.length===0),this.bookedEl?.classList.add("on"),requestAnimationFrame(()=>this.bookedEl?.querySelector(".sl-booked-back")?.focus()),this.opts.onBooked?.(e)}dismissBooked(){this.bookedEl?.classList.remove("on"),this.resetAfterBooking(),this.root?.focus({preventScroll:!0})}resetAfterBooking(){this.bookedShown=!1,this.hold=null,this.handedOff=!1,this.holdConflicted=!1,this.holdingLabels.clear(),this.gaQty.clear(),this.stopHoldTimer(),this.forgetHold(),this.clearSelection(),this.setCtaPhase("idle"),this.setSheetOpen(!1),this.syncTray(),this.syncCta(),this.emitHoldChange()}notifyGroupSettled(e){e==="booked"?this.showBooked():this.dismissConfirm(),this.hold=null,this.handedOff=!1,this.ctaPhase="idle",this.stopHoldTimer(),this.forgetHold(),this.syncTray(),this.syncCta()}async checkoutHandoff(e,t){if(this.checkoutMode==="hosted"){await this.startHostedCheckout(e,t);return}await this.opts.onCheckout?.(e,t,this.buildHandoff(e))}async startHostedCheckout(e,t){let i=this.buildHandoff(e),o=null;try{o=await(this.paymentOptions??=this.pubApi.paymentOptions(this.opts.event))}catch(a){this.opts.onError?.(a)}if(this.destroyed)return;let r=o?.bookingMode==="free",s=o?.providers?.[0]??null;if(!s&&!r){let a=da(o?.reason),l=!!this.opts.onCheckoutUnavailable||!!this.opts.onCheckout;this.opts.onCheckoutUnavailable?.({reason:a,handoff:i}),this.opts.onCheckout?.(e,t,i),l||this.openCheckoutPanel({kind:"unavailable",reason:a,seatCount:pa(i)});return}await this.openCheckoutPanel(ha(i,s,o,this.pubApi.ticketKeysFor(e.holdId),this.controller.getGAAreas()))}async openCheckoutPanel(e){let t;try{({mountCheckout:t}=await un())}catch(i){this.opts.onError?.(i),this.toast(this.tf("picker.checkoutCouldNotBeOpened","Checkout could not be opened. Your seats are still held. Please try again."),"error"),this.setCtaPhase("idle");return}this.destroyed||!this.root||(this.closeCheckoutPanel(),this.checkoutPanel=t({root:this.root,state:e,eventKey:this.opts.event,event:{name:this.els.name?.textContent||null,detail:this.els.meta?.textContent||null},formatMoney:i=>this.money(i),t:O.t,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=>{ua(i)&&(this.paymentOptions=null),i?.code==="seats_unavailable"&&this.controller.refresh(),this.opts.onError?.(i)}}))}closeCheckoutPanel(){this.checkoutPanel?.destroy(),this.checkoutPanel=null}buildHandoff(e){let i=(e.items??[]).map(s=>{let a=this.controller.lineItemDisplay(s),l=s.objectType==="seat"||s.objectType==="booth"?this.controller.seatByLabel(s.label):null,c=l?this.controller.seatDetails(l.id):null,d=c?fe(c):void 0,p=this.controller.doc?.categories.find(h=>h.key===s.categoryKey),u=s.tierId?p?.tiers?.find(h=>h.id===s.tierId)?.name:void 0;return{label:s.label,...a.displayLabel?{displayLabel:a.displayLabel}:{},...a.displayType?{displayType:a.displayType}:{},...c?.sectionLabel?{sectionLabel:c.sectionLabel}:{},...d?{rowLabel:d}:{},...c?.seatNumber?{seatNumber:c.seatNumber}:{},...p?.label?{categoryLabel:p.label}:{},...u?{tierLabel:u}:{},objectId:s.objectId,objectType:s.objectType,categoryKey:s.categoryKey,tierId:s.tierId,unitPrice:this.heldPrice(s),currency:s.currency??this.currency,quantity:s.quantity??1}}),o=i[0]?.currency??this.currency,r=i.reduce((s,a)=>s+a.unitPrice*a.quantity,0);return{holdId:e.holdId,expiresAt:e.expiresAt,currency:o,lineItems:i,total:r}}emitHoldChange(){let e=this.hold;this.realtime?.watchHold(e?.holdId??null),this.syncSelectionTo3d(),this.scheduleOfferRefresh(!0),this.opts.onHoldChange?.(e,e?.seats??[],e?this.buildHandoff(e):null)}toast(e,t="neutral",i){let o=this.els.toast;if(!o)return;o.replaceChildren();let r=document.createElement("span");if(r.textContent=e,o.appendChild(r),o.classList.toggle("has-action",!!i),i){let s=document.createElement("button");s.type="button",s.className="sl-toast-action",s.textContent=i.label,s.addEventListener("click",i.onClick,{once:!0}),o.appendChild(s)}o.dataset.tone=t,o.classList.add("on","sl-mo-rise"),this.liftToastOverConfirmSoon(),this.toastTimer&&clearTimeout(this.toastTimer),this.toastTimer=setTimeout(()=>{o.classList.remove("on","sl-mo-rise"),o.classList.remove("has-action"),o.dataset.tone="neutral",this.liftToastOverConfirm()},4200)}liftToastOverConfirm(){let e=this.regions["bottom-center"];if(!e)return;let t=this.els.toast?.classList.contains("on")||this.extendEl?.classList.contains("on"),i=this.confirmEl;if(!t||!i?.isConnected){e.style.removeProperty("bottom");return}let o=this.els.map.clientHeight;if(o<=0)return;let r=i.getBoundingClientRect(),s=r.height||i.offsetHeight||Df,a=r.height?r.top-this.els.map.getBoundingClientRect().top:o-Br-s,l=Math.round(o-a+_f);if(l+Nf>o){e.style.removeProperty("bottom");return}e.style.bottom=`${l}px`}liftToastOverConfirmSoon(){this.liftToastOverConfirm(),typeof requestAnimationFrame=="function"&&requestAnimationFrame(()=>{this.destroyed||this.liftToastOverConfirm()})}dismissSkeleton(){this.handoverMs===null&&this.renderResolvedAt!==null&&(this.handoverMs=performance.now()-this.renderResolvedAt),zc({boot:this.els.boot,map:this.els.map,rail:this.els.rail,root:this.root,reducedMotion:this.reducedMotion()})}placeTooltip(){if(!this.tipEl)return;let e={width:this.els.map.clientWidth,height:this.els.map.clientHeight},t={width:this.tipEl.offsetWidth,height:this.tipEl.offsetHeight},i=this.tipPinned?Cc(this.tipPos,e,t):null,o=i??Ec(this.tipPos,e.width,e.height,t);this.tipEl.style.left=`${o.left}px`,this.tipEl.style.top=`${o.top}px`,i?this.tipEl.dataset.placement=i.placement:delete this.tipEl.dataset.placement}nightStripFor(e,t){let i=this.performanceGroup,o=Nr(e.mark,i?.nights?.()),r=o?.states.filter(s=>s.free).length??0;return uc(o,{locale:this.opts.locale,switchLabel:i?.selectionModeSwitch?.label??null,selectPartialLabel:i?.partialSeatSelection?.label(r)??null,pinned:t})}unpinTooltip(){this.tipPinned&&(this.tipPinned=!1,this.tipEl?.classList.remove("sl-tip-pinned"),this.tipEl&&(this.tipEl.style.display="none"))}handleMapPointerDown(e){if(this.tipEl?.contains(e.target))return;this.lastMapPoint={x:e.clientX,y:e.clientY},this.lastPointerType=e.pointerType||"mouse";let t=this.els.map.getBoundingClientRect();this.tipPos={x:e.clientX-t.left,y:e.clientY-t.top},this.unpinTooltip()}closeInfoPops(e){this.root?.querySelectorAll(".sl-info.open").forEach(t=>{t!==e&&(t.classList.remove("open"),t.querySelector("[data-sl-info]")?.setAttribute("aria-expanded","false"))})}updateTooltip(e){if(!this.tipEl)return;if(this.confirmSeat){this.tipEl.style.display="none";return}if(this.tipPinned&&e?.interaction!=="press")return;if(!e){this.tipPinned||(this.tipEl.style.display="none",this.tipMarkedHoverLabel=null);return}let t=e.mark?.kind==="partial"&&this.tipMarkedHoverLabel===e.label;if(e.interaction!=="press"&&this.lastPointerType==="mouse"&&!e.mark&&!this.tipPinned){this.tipEl.style.display="none",this.tipMarkedHoverLabel=null;return}if(e.unavailable&&e.status==="free"&&e.interaction==="press"){this.toast(this.tf("picker.turnOffAccessibilityFilter","Turn off the wheelchair filter to pick this seat"),"neutral"),this.tipEl.style.display="none";return}if(e.unavailable&&!e.mark){this.tipEl.style.display="none",this.tipMarkedHoverLabel=null;return}let i=e.mark?.kind==="partial"&&(e.interaction==="press"||this.lastPointerType!=="mouse"||t);this.tipMarkedHoverLabel=e.mark?.kind==="partial"?e.label:null;let o=this.nightStripFor(e,i);this.tipEl.style.setProperty("--sl-cat",e.categoryColor),this.tipEl.innerHTML=Tc(e,{price:this.suppressPricing?"":this.money(this.paidPrice(e.categoryKey,e.tierId??null,e.price,e.label)),priceNote:this.suppressPricing?this.performanceGroup?.surface==="season"?this.tf("picker.season.includedInPackage","Included in the Season package"):this.tf("picker.group.pricesPerPerformance","Prices shown per performance"):"",rowTypeWord:qt(e),ownHold:this.controller.currentHold()?.labels.includes(e.label)===!0,extra:o+(i?`<button type="button" class="sl-tip-close" data-pg-tip-close aria-label="${q(this.tf("picker.group.closeSeatDetails","Close seat details"))}">\xD7</button>`:"")}),this.tipPinned=i,this.tipEl.classList.toggle("sl-tip-pinned",i),this.tipEl.querySelector("[data-pg-tip-close]")?.addEventListener("click",()=>this.unpinTooltip()),this.tipEl.querySelector("[data-pg-switch-mode]")?.addEventListener("click",()=>{this.unpinTooltip(),this.performanceGroup?.selectionModeSwitch?.activate()}),Mc(this.tipEl,this.performanceGroup?.partialSeatSelection?.label,r=>{this.unpinTooltip(),this.performanceGroup?.partialSeatSelection?.activate(e.id,r)}),this.tipEl.style.display="block",this.placeTooltip()}syncSeatMarks(){let e=this.performanceGroup?.seatMarks,t=this.controller.getRenderer();if(!e||!t?.setSeatMarks)return;let i={};for(let[o,r]of Object.entries(e())){let s=this.controller.idForLabel(o);s&&(i[s]=r)}Object.keys(i).length&&t.setSeatMarks(i)}getSelection(){return this.committedSelection()}selectObjects(e){return this.controller.select(e)}selectObjectsWithoutConfirmation(e){let t=new Set(e),i=this.controller.getSelection().filter(o=>t.has(o.id)||t.has(o.label));if(i.length===t.size)return i;this.suppressConfirmationSeatId=e[0]??null;try{return this.controller.select(e)}finally{this.suppressConfirmationSeatId=null}}deselectObjects(e){this.controller.deselect(e)}clearSelection(){this.dismissConfirm(),this.dismissTableDialog(),this.controller.clearSelection()}categoryLegendColor(){let e=(this.controller.doc?.categories??[]).find(t=>!t.notForSale);return(e?this.controller.getRenderer()?.categoryDisplayColor?.(e.key):null)||e?.color||"#2563eb"}async refreshAvailability(){await this.controller.refresh(),this.syncSeatMarks(),this.syncTray()}refreshPerformanceGroupComposition(){this.syncTray()}async adoptRestoredHold(e){!e||this.hold||await this.resumeHoldFromServer(e)}selectCategories(e){return this.controller.selectCategories(e)}deselectCategories(e){this.controller.deselectCategories(e)}setSelectableObjects(e){this.controller.setSelectableObjects(e)}setMaxSelection(e){this.maxTickets=Math.max(this.exactTickets??1,Math.floor(e)),this.controller.setMaxSelection(this.maxTickets),this.updateSelectionCapacity(),this.syncTray()}getSelectionValidity(){let e=this.controller.getSelectionValidity(this.totalTicketCount());return e&&(e.seats=this.committedSelection()),e}setMapTheme(e){this.destroyed||(this.opts.theme={...this.opts.theme??{},map:e??void 0},this.controller.setMapTheme(e),this.applyMapChromeTokens(),this.minimap?.refreshMinimap())}applyThemeTokens(e){let t=oi(this.themeMode),i=gn(this.controller.doc?.theme,this.opts.theme,t);for(let[o,r]of Object.entries(i))e.style.setProperty(o,r);t?e.dataset.theme=t:delete e.dataset.theme,this.applyMapChromeTokens()}watchThemeMode(){this.colorSchemeStop?.(),this.colorSchemeStop=null,this.themeMode==="auto"&&(this.colorSchemeStop=Wi(()=>{this.destroyed||this.repaintForThemeMode()}))}repaintForThemeMode(){this.root&&(this.applyThemeTokens(this.root),this.controller.setMapTheme(fn(this.opts.theme,this.themeMode)),this.applyMapChromeTokens(),this.minimap?.refreshMinimap(),this.syncPrices())}setThemeMode(e){this.destroyed||e===this.themeMode||(this.themeMode=e,this.opts.theme={...this.opts.theme??{},...e?{mode:e}:{mode:void 0}},this.watchThemeMode(),this.repaintForThemeMode(),this.emitAnalytics("theme_mode_changed",{mode:e,resolved:oi(e)??null}))}getThemeMode(){return this.themeMode}applyMapChromeTokens(){let e=this.els.map?.parentElement;if(!e||!this.root)return;let t=oi(this.themeMode),i=gn(this.controller.doc?.theme,this.opts.theme,t),o=fn(this.opts.theme,this.themeMode)?.background??this.controller.doc?.theme?.background??void 0,r=ja(i,o);for(let s of za)r?e.style.setProperty(s,r[s]):e.style.removeProperty(s)}setEventDetailsHidden(e){this.eventDetailsHidden=e,this.syncFullscreenButtons()}setPricing(e){this.hostPricing=e;let t=Ql(e?.prices,this.offerAvailability),i=Object.keys(t).length>0||e?.formatter||e?.objects?{prices:t,...e?.objects?{objects:e.objects}:{},...e?.formatter?{formatter:e.formatter}:{}}:void 0;JSON.stringify(this.opts.pricing??null)!==JSON.stringify(i??null)&&(this.opts.pricing=i,!(this.destroyed||!this.els.prices||!this.currencyResolved)&&(this.syncMapPriceRanges(),this.els.pricesSec?.querySelector(".sl-price-select")?.remove(),this.buildPriceFilter(),this.syncPrices(),this.syncTray(),this.lastSection&&this.showSectionCard(this.lastSection)))}buildLanguageSwitcher(e){this.langSel=qa(e,{languages:this.opts.languages,label:this.tf("picker.preferredTicketType","Language"),onChange:t=>{this.setLocale(t)}})}async setLocale(e){let t=(0,O.getLocale)(),i=this.localeGeneration+=1,o=await(0,O.loadLocale)(e);return this.opts.messages&&(0,O.setStringOverrides)(this.opts.messages),o===t||this.applyActiveLocale(o,i),o}applyActiveLocale(e,t){t===this.localeGeneration&&this.root&&(Wa(e,{root:this.root,painters:[()=>this.syncTray(),()=>this.syncPrices(),()=>this.syncOffer(),()=>this.syncRung(),()=>this.syncFloors(),()=>this.syncPanelToggle(),()=>this.syncFullscreenButtons(),()=>this.syncTestBadge()],refreshMapCopy:()=>this.controller.refreshMapCopy(),languageSelect:this.langSel}),this.scheduleFit())}isColorblindSafe(){return this.cbSafe}setColorblindSafe(e){e!==this.cbSafe&&(this.cbSafe=e,this.cbEl?.setAttribute("aria-pressed",String(e)),this.controller.setColorblindSafe(e),this.syncPrices(),this.minimap?.refreshMinimap(),Ff(e))}setViewMode(e){this.controller.setViewMode(this.normalizeInitialView(e)),this.syncProjection(),this.dismissConfirm()}getViewMode(){return this.controller.getViewMode()}normalizeInitialView(e){return e==="perspective"?(this.perspectiveWarned||(this.perspectiveWarned=!0,console.warn("[seatlayer] initialView:'perspective' (2.5D) is deprecated for the buyer picker and was coerced to 'flat'. Use the Map | 3D control for the immersive view.")),"flat"):e??"flat"}emitAnalytics(e,t){try{this.opts.onAnalytics?.(e,t??{})}catch{}}emit3dAnalytics(e,t){this.emitAnalytics(e,t)}getBuyerView(){return sd(this)}setBuyerView(e,t){ad(this,e,t)}seatState3dFor(e){return ld(this,e)}pushAvailabilityTo3d(){cd(this)}syncSelectionTo3d(){pd(this)}seatViewFor3d(e){return ud(this,e)}onView3dSeatPick(e){md(this,e)}seatViewCaption(e){return fd(this,e)}saveView3dComparisonSeat(e){gd(this,e)}clearView3dComparison(){bd(this)}view3dComparisonSnapshot(e){return yd(this,e)}enter3d(e){return vd(this,e)}publish3dTopInset(){wd(this)}exit3d(){xd(this)}openSeatConfidencePassport(e,t=null){Kr(this,e,t)}closeSeatConfidencePassport(e=!0){ui(this,e)}openView3dComparison(){td(this)}closeView3dComparison(e=!0){Wt(this,e)}getCurrentHold(){return this.hold}async resumeHold(e){return this.resumeHoldFromServer(e)}async changeHeldTier(e,t){e.disabled=!0;try{let i=await Xc(this.controller,t,e.value,this.opts.holdTtlMs);i&&(this.hold={holdId:i.holdId,expiresAt:i.expiresAt,seats:i.seats,items:i.items},this.startHoldTimer(i.expiresAt),this.emitHoldChange())}catch(i){this.opts.onError?.(i),this.toast(this.tf("picker.ticketTypeNotChanged","That ticket type is not available for this seat. Your hold is unchanged."),"error")}finally{this.syncTray()}}async removeHeldTicket(e){return this.removeHeldLabels([e])}async bestAvailable(e,t,i={}){if(this.salesClosed||this.bestAvailableBusy)return null;e=Math.max(1,Math.min(this.maxTickets,Math.floor(e)));try{return await this.bestAvailableOrThrow(e,t,i)}catch(o){this.opts.onError?.(o);let r=Or(o);if(r)return this.toast(r,"warning"),null;let s=o?.reason,a=s==="not_enough_together"?(0,O.t)("picker.couldNotFindSeatsTogether",{count:e}):s==="companion_pair_required"?this.tf("picker.companionPairRequired","Select the adjacent wheelchair place with each companion ticket."):s==="ticket_option_not_applicable"?this.tf("picker.ticketOptionNotApplicable","That ticket choice is not available for the selected seat."):s==="sold_out"?this.tf("picker.ticketTypeSoldOut","That ticket type is sold out. Try another ticket type."):s==="event_closed"?this.tf("picker.seatSalesClosedForEvent","Seat sales have closed for this event."):this.tf("picker.seatsNoLongerAvailableTryAnother","Those seats are no longer available. Try another quantity or ticket type.");return this.toast(a,"error"),null}}async bestAvailableOrThrow(e,t,i={}){if(this.salesClosed)throw new Error("seatlayer: seat sales are closed");if(this.bestAvailableBusy)throw new Error("seatlayer: Best Available is already in progress");if(!Number.isInteger(e)||e<1)throw new Error("seatlayer: Best Available quantity must be a positive integer");let o=Ki(this.controller,t);if(o)throw o;this.confirmSeat&&this.cancelConfirm(),this.bestAvailableConfirm=!1,this.bestAvailableBusy=!0;let r=this.els.tray?.querySelector(".sl-ba-go");r&&(r.disabled=!0,r.classList.add("sl-busy"),r.innerHTML=`<span class="sl-ba-spin" aria-hidden="true"></span>${this.tf("picker.findingEllipsis","Finding\u2026")}`);try{let s=await this.controller.bestAvailable(e,t,{...i,ttlMs:this.opts.holdTtlMs});return s?(this.hold={holdId:s.holdId,expiresAt:s.expiresAt,seats:s.seats,items:s.items},this.handedOff=!1,this.bookedShown=!1,this.gaQty.clear(),this.startHoldTimer(s.expiresAt),this.flashHeldSeats(this.hold),this.syncTray(),this.emitHoldChange(),i.preferPremium&&s.seats.length&&!s.seats.every(a=>a.commercial?.premium)&&this.toast((0,O.t)("picker.premiumFallbackNote",{count:e}),"neutral"),this.hold):null}finally{this.bestAvailableBusy=!1,this.syncTray()}}async release(){let e=this.hold,t=this.controller.currentHold(),i=!0;if(t)i=await this.controller.release();else if(e){let o=[...new Set([...(e.items??[]).map(r=>r.label),...(e.seats??[]).map(r=>r.label)])];if(o.length)try{await this.api.release(this.opts.event,o,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 Ze({url:()=>this.pubApi.subscribeUrl(e),mintTicket:()=>this.pubApi.subscribeTicket(e),onAccessUnavailable:t=>{this.opts.onAccessUnavailable?.(t),this.showAccessPanel(t)},onIdleExpired:()=>rc(this.idlePauseHost),heldHoldId:()=>this.hold?.holdId??null,onHoldState:(t,i)=>{i==="booked"&&this.settleBookedHold(t)},sink:{...cn(this.controller,{flashOnLiveChange:!0,ownLabels:()=>this.holdingLabels,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")}}),onSales:t=>this.salesNotice(t)}}),this.realtime.start()}async refreshAccess(){return!this.access?.configured||!await this.access.refresh("manual")?!1:(this.dismissAccessPanel(),await this.controller.refresh(),this.realtime?this.realtime.restart():this.startRealtime(),!0)}clearDecisionSurfaces(){this.dismissConfirm(),this.dismissTableDialog(!1),Je(this,!1)}showAccessPanel(e){if(this.loadAbort&&e.reason==="provider_failed"||this.destroyed||!this.root)return;this.dismissAccessPanel(),this.clearDecisionSurfaces();let t=Pa(e.reason,e.reason==="idle"?()=>this.resumeFromIdle():()=>this.recoverAccess());(this.root.querySelector(".sl-body")??this.root).appendChild(t),this.accessEl=t}async recoverAccess(){return await this.refreshAccess()?!0:(this.opts.onAccessUnavailable||typeof window>"u"||window.location.reload(),!1)}dismissAccessPanel(){this.accessEl?.remove(),this.accessEl=null}get idlePauseHost(){return this}startIdleClock(e){return nc(this.idlePauseHost,e)}resumeFromIdle(){return oc(this.idlePauseHost)}showHoldExpired(){if(this.destroyed||!this.root||this.holdExpiredEl)return;this.clearDecisionSurfaces();let e=rp({restart:()=>this.restartAfterHoldExpiry()},this.holdExpiredUnits);this.root.appendChild(e),this.holdExpiredEl=e,requestAnimationFrame(()=>e.querySelector(".sl-interrupt-act")?.focus());let t=this.holdExpiredUnits;this.holdExpiredFresh=!1,this.refreshAvailability().then(()=>{if(this.destroyed||this.holdExpiredEl!==e)return;this.holdExpiredFresh=!0;let i=t.filter(s=>s.objectType!=="ga"),o=[],r=[];for(let s of i){let a=this.controller.seatByLabel(s.label);(a&&this.controller.getStatus(a.id)==="free"?o:r).push(s.label)}op(e,{recoverable:o,taken:r,onRecover:s=>this.recoverAfterHoldExpiry(s)})}).catch(()=>{})}recoverAfterHoldExpiry(e){this.holdExpiredUnits=[],this.dismissHoldExpired(),this.lapse.clear(),this.clearSelection(),this.controller.select(e),this.syncTray(),this.handleCta()}dismissHoldExpired(){this.holdExpiredEl?.remove(),this.holdExpiredEl=null}restartAfterHoldExpiry(){let e=this.holdExpiredUnits;this.holdExpiredUnits=[],this.dismissHoldExpired(),this.lapse.clear(),this.clearSelection(),this.controller.overview(),this.syncTray(),this.syncCta(),this.root?.focus({preventScroll:!0});let t=this.holdExpiredFresh;this.holdExpiredFresh=!1,(t?Promise.resolve():this.refreshAvailability()).then(()=>{this.destroyed||ip({reducedMotion:this.reducedMotion(),accent:this.cssVar("--sl-accent")||"#f4b740",seatByLabel:i=>this.controller.seatByLabel(i),statusOf:i=>this.controller.getStatus(i),flash:(i,o)=>this.controller.flashSeat(i,o)},e)}).catch(()=>{})}destroy(){this.transportAbort.abort(),this.loadAbort?.abort(),this.loadAbort=null,this.destroyed=!0,$r(this),this.colorSchemeStop?.(),this.colorSchemeStop=null,this.realtime?.stop(),this.realtime=null,this.idleClock?.dispose(),this.idleClock=null,this.dismissAccessPanel(),this.dismissHoldExpired(),this.access?.clear(),this.hold&&!this.handedOff&&this.opts.holdOnClose!=="keep"&&this.controller.release(),this.closeConfirm(),this.dismissTableDialog(!1),Je(this,!1),this.closeSeatView(),this.closeCheckoutPanel(),this.exit3d(),this.buyerAssetUrls.dispose(),this.stopHoldTimer(),this.detachAttention?.(),this.toastTimer&&clearTimeout(this.toastTimer),this.offerRefreshTimer&&clearTimeout(this.offerRefreshTimer),this.offerBoundaryTimer&&clearTimeout(this.offerBoundaryTimer),this.offerCountdownTimer&&clearTimeout(this.offerCountdownTimer),this.offerRefreshTimer=null,this.offerBoundaryTimer=null,this.offerCountdownTimer=null,this.offerVisibilityHandler&&(document.removeEventListener("visibilitychange",this.offerVisibilityHandler),this.offerVisibilityHandler=null);for(let e of this.motionTimers)clearTimeout(e);this.motionTimers.clear(),this.ro?.disconnect(),this.ro=null,this.viewportResizeHandler&&window.removeEventListener("resize",this.viewportResizeHandler),this.viewportResizeHandler=null,this.framedFs&&this.setFramedFs(!1),this.escHandler&&document.removeEventListener("keydown",this.escHandler),this.fsChangeHandler&&document.removeEventListener("fullscreenchange",this.fsChangeHandler),this.fsEscHandler&&window.removeEventListener("keydown",this.fsEscHandler),this.controller.destroy(),this.projectionEl=null,this.root?.remove(),this.root=null,this.modalCleanup?.(),this.closeModal=null}};function bp(n){dt.prewarm(n)}var Mt=require("@seatlayer/core");var yp="seatlayer-performance-group-picker-style";function vp(){if(document.getElementById(yp))return;let n=document.createElement("style");n.id=yp,n.textContent=`
3539
+ </div>`,e.append(i)}buildErrorCard(e,t){let i=Tf[t],o=document.createElement("div");Object.assign(o.style,{maxWidth:"420px",margin:"auto 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 s=document.createElement("p");s.textContent=i.body,Object.assign(s.style,{margin:"0 0 20px",fontSize:"13.5px",lineHeight:"1.5",color:"#aab4c8"});let a=document.createElement("button");a.type="button",a.textContent="Try again",Object.assign(a.style,{appearance:"none",cursor:"pointer",border:"0",borderRadius:"10px",padding:"10px 22px",fontSize:"14px",fontWeight:"600",color:"#101625",background:"#7aa2ff"}),a.addEventListener("click",()=>this.handleTryAgain()),o.append(r,s,a),e.append(o)}};function Xn(n,e){let t=(a,[l,c])=>{a.textContent=x(l,c??l),a.dataset.slT=l},i=document.createElement("div");i.className="sl-loading-state";let o=document.createElement("div");if(o.setAttribute("role",e.busy?"status":"alert"),o.setAttribute("aria-atomic","true"),e.busy){let a=document.createElement("div");a.className="sl-boot-spin",a.setAttribute("aria-hidden","true"),i.append(a)}let r=document.createElement("div");if(r.className="sl-boot-title",t(r,e.title),o.append(r),e.description){let a=document.createElement("p");a.className="sl-loading-description",t(a,e.description),o.append(a)}i.append(o);let s=null;return e.action&&(s=document.createElement("button"),s.type="button",s.className="sl-boot-retry",t(s,e.action),i.append(s)),n.replaceChildren(i),s}function Ef(n){let{viewportWidth:e,viewportHeight:t,offsetTop:i,offsetLeft:o,clientWidth:r,clientHeight:s,innerHeight:a,largeViewportHeight:l}=n;if(![e,t,i,o].every(Number.isFinite)||e<=0||t<=0)return null;let c=Number.isFinite(r)&&r>0?r:e,d=Number.isFinite(s)&&s>0?s:t,p=i;return Number.isFinite(l)&&a>l+1&&d<l-1&&(p=Math.max(p,l-d)),{width:Math.min(e,c),height:Math.min(t,d),top:p,left:o}}function Pc(n){let e=window.visualViewport;if(!e)return()=>{};let t=document.createElement("div");t.setAttribute("aria-hidden","true"),Object.assign(t.style,{position:"absolute",visibility:"hidden",pointerEvents:"none",width:"0",height:"100lvh",overflow:"hidden"}),document.body.appendChild(t);let i=()=>{let c=Ef({viewportWidth:e.width,viewportHeight:e.height,offsetTop:e.offsetTop,offsetLeft:e.offsetLeft,clientWidth:document.documentElement.clientWidth,clientHeight:document.documentElement.clientHeight,innerHeight:window.innerHeight,largeViewportHeight:t.getBoundingClientRect().height});c&&Object.assign(n.style,{right:"auto",bottom:"auto",top:`${c.top}px`,left:`${c.left}px`,width:`${c.width}px`,height:`${c.height}px`})},o=0,r=0,s=0,a=()=>{o&&window.cancelAnimationFrame(o),r&&window.cancelAnimationFrame(r),s&&window.clearTimeout(s),o=window.requestAnimationFrame(()=>{o=0,r=window.requestAnimationFrame(()=>{r=0,i()})}),s=window.setTimeout(()=>{s=0,i()},250)},l=()=>{i(),a()};return l(),e.addEventListener("resize",l),e.addEventListener("scroll",l),window.addEventListener("resize",l),window.addEventListener("orientationchange",l),window.addEventListener("pageshow",l),()=>{o&&window.cancelAnimationFrame(o),r&&window.cancelAnimationFrame(r),s&&window.clearTimeout(s),e.removeEventListener("resize",l),e.removeEventListener("scroll",l),window.removeEventListener("resize",l),window.removeEventListener("orientationchange",l),window.removeEventListener("pageshow",l),t.remove()}}var Cf=["a[href]","area[href]","button","input","select","textarea","iframe","object","embed","summary","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"[tabindex]"].join(",");function Jo(n,e){let t=document.activeElement instanceof HTMLElement?document.activeElement:null,i=document.createElement("div");i.className="sl-modal-scrim";let o=document.createElement("div");o.className="sl-modal-frame",o.style.setProperty("--sl-bg",e),o.setAttribute("role","dialog"),o.setAttribute("aria-modal","true"),o.setAttribute("aria-label",n),o.tabIndex=-1,i.appendChild(o),document.body.appendChild(i);let r=document.body.style.overflow;document.body.style.overflow="hidden";let s=Pc(i),a=()=>{let u=[...o.querySelectorAll('[role="dialog"][aria-modal="true"]')].filter(f=>f.isConnected&&!f.closest('[hidden], [aria-hidden="true"], [inert]'));return u[u.length-1]??o},l=(u,f)=>{let b=u;for(;b;){let T=window.getComputedStyle(b);if(b.hidden||b.getAttribute("aria-hidden")==="true"||b.hasAttribute("inert")||T.display==="none"||T.visibility==="hidden"||T.visibility==="collapse")return!0;if(b===f)return!1;b=b.parentElement}return!0},c=u=>[...u.querySelectorAll(Cf)].filter(f=>f.tabIndex>=0&&!f.matches(":disabled")&&!l(f,u)),d=(u,f)=>{let b=c(u),T=f?b[b.length-1]:b[0];T?T.focus({preventScroll:!0}):(u.hasAttribute("tabindex")||(u.tabIndex=-1),u.focus({preventScroll:!0}))},p=null,m=!0;return{scrim:i,frame:o,trapKeys(u){let f=b=>{if(b.key==="Tab"){if(b.defaultPrevented)return;let T=a(),E=c(T),v=E[0],M=E[E.length-1],F=document.activeElement;!v||!M?(b.preventDefault(),d(T,b.shiftKey)):F===T||!F||!T.contains(F)?(b.preventDefault(),(b.shiftKey?M:v).focus({preventScroll:!0})):b.shiftKey&&F===v?(b.preventDefault(),M.focus({preventScroll:!0})):!b.shiftKey&&F===M&&(b.preventDefault(),v.focus({preventScroll:!0}));return}b.key==="Escape"&&u(b)};return p=f,document.addEventListener("keydown",f),f},onScrimPress(u){i.addEventListener("mousedown",f=>{f.target===i&&u()})},focusFirst(){d(a(),!1)},teardown(u=!0){m&&(m=!1,s(),document.body.style.overflow=r,p&&document.removeEventListener("keydown",p),p=null,i.remove(),u&&t?.isConnected&&t.focus({preventScroll:!0}))}}}function Mc(n,e){let t=new Set(["chart","objects","resume","availability"]),i=new Map;return new Proxy(Object.create(n),{get(o,r){let s=n,a=Reflect.get(s,r,s);return typeof a!="function"?a:(i.has(r)||i.set(r,t.has(String(r))?async(...l)=>{let c=await Fn(()=>a.apply(s,l),e,()=>{});if(c.outcome==="loaded")return c.value;if(c.outcome==="error")throw c.error;let d=new Error(c.outcome==="timeout"?"request_timeout":"request_cancelled");throw d.name=c.outcome==="timeout"?"TimeoutError":"AbortError",d}:a.bind(s)),i.get(r))}})}var H=require("@seatlayer/core"),wr=require("@seatlayer/core/view3d/crossfade/panorama");function Lc(n){return!!n&&n.clientWidth>0&&n.scrollWidth>n.clientWidth+1}function Af(n){return n.some(e=>Lc(e))}var er="data-fit-gone",Pf=12;function bs(n,e,t=Lc){if(!n)return 0;for(let i of e)n.classList.remove(i.cls);if(n.querySelectorAll(`[${er}]`).forEach(i=>{i.removeAttribute(er),i.hidden=!1}),n.dataset.fit="0",n.clientWidth<=0||!t(n))return 0;for(let i=0;i<e.length;i+=1){let o=e[i];i>0&&n.classList.remove(e[i-1].cls),n.classList.add(o.cls),n.dataset.fit=String(i+1);let r=o.give?o.give(n):!0;if(!t(n))return i+1;if(o.repeat&&o.give){for(let s=1;r&&s<Pf;s+=1)if(r=o.give(n),!t(n))return i+1}}return e.length}function Mf(n,e="[data-fit-seg]"){let t=[...n.querySelectorAll(e)].filter(i=>!i.hidden);return t.length<2?!1:Hc(t[t.length-1])}function Lf(n,e){let t=n.querySelector(e);return t&&!t.hidden?Hc(t):!1}function Hc(n){let e=n.previousElementSibling;return e instanceof HTMLElement&&e.tagName==="I"&&(e.setAttribute(er,""),e.hidden=!0),n.setAttribute(er,""),n.hidden=!0,!0}function Hf(n){if(!n)return!1;let e=(n.getAttribute("aria-label")||n.textContent||"").trim();return e?(n.setAttribute("aria-label",e),n.setAttribute("title",e),!0):!1}function Rc(n){if(!n)return 0;let e=n.querySelector(".sl-confirm-cancel"),t=n.querySelector(".sl-confirm-add-t");return bs(n,[{cls:"sl-fit-track"},{cls:"sl-fit-type"},{cls:"sl-fit-icon",give:()=>Hf(e)}],()=>Af([e,t]))}function Ic(n){return bs(n,[{cls:"sl-fit-notype",give:e=>Lf(e,"[data-fit-type]")},{cls:"sl-fit-short",give:e=>Mf(e),repeat:!0}])}function Oc(n){return n?(n.classList.add("sl-fitpill"),bs(n,[{cls:"sl-fit-p1"},{cls:"sl-fit-p2"},{cls:"sl-fit-p3"}])):0}var Zn;function _c(n){if(!n)return!1;delete n.dataset.fit;let e=n.selectedOptions?.[0]?.textContent??n.options[n.selectedIndex]?.textContent??"",t=n.clientWidth;if(!e||!t)return!1;if(Zn===void 0)try{Zn=document.createElement("canvas").getContext("2d")}catch{Zn=null}if(!Zn)return!1;let i=getComputedStyle(n);Zn.font=`${i.fontStyle} ${i.fontWeight} ${i.fontSize} ${i.fontFamily}`;let o=Zn.measureText(e).width,r=(parseFloat(i.paddingLeft)||0)+(parseFloat(i.paddingRight)||0)+(parseFloat(i.borderLeftWidth)||0)+(parseFloat(i.borderRightWidth)||0);return o+r<=t?!1:(n.dataset.fit="row",!0)}function Rf(n){if(!n||typeof n!="object"||Array.isArray(n))return null;let{amountMinor:e,currency:t}=n;return typeof e!="number"||!Number.isSafeInteger(e)||e<=0||typeof t!="string"||!/^[A-Za-z]{3}$/.test(t)?null:{amountMinor:e,currency:t.toUpperCase()}}var If=["on-sale","low","sold-out","presale","closed"];function _i(n){return n==null?null:typeof n=="number"&&Number.isFinite(n)&&n>=0?n:void 0}function ys(n){return n==null?null:typeof n=="number"&&Number.isFinite(n)&&n>=0?n:void 0}function Nc(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 o=e.remaining;if(o!=null&&(typeof o!="number"||!Number.isInteger(o)||o<0))return;let r={index:i,count:t,remaining:o??null};if(e.pricingMode!==void 0){if(e.pricingMode!=="matrix")return;r.pricingMode="matrix"}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 s of["startsAt","endsAt"]){if(e[s]===void 0)continue;let a=ys(e[s]);if(a===void 0)return;r[s]=a}return r}function Of(n){if(n==null)return null;if(typeof n!="object"||Array.isArray(n))return;let e=n;if(!Number.isInteger(e.assignmentVersion)||e.assignmentVersion<0||!Array.isArray(e.channels)||!Array.isArray(e.objects))return;let t=[],i=new Set;for(let s of e.channels){if(!s||typeof s!="object"||Array.isArray(s))return;let a=s,l=typeof a.channelId=="string"?a.channelId.trim():"";if(!l||i.has(l)||!Number.isInteger(a.pricingVersion)||a.pricingVersion<0||!Array.isArray(a.priceOverrides))return;let c=[],d=new Set;for(let p of a.priceOverrides){if(!p||typeof p!="object"||Array.isArray(p))return;let m=p,u=typeof m.categoryKey=="string"?m.categoryKey.trim():"",f=m.tierId===null?null:typeof m.tierId=="string"&&m.tierId.trim()?m.tierId.trim():void 0,b=_i(m.price);if(!u||f===void 0||b===void 0||b===null)return;let T=`${u}\0${f??""}`;if(d.has(T))return;d.add(T),c.push({categoryKey:u,tierId:f,price:b})}i.add(l),t.push({channelId:l,pricingVersion:a.pricingVersion,priceOverrides:c})}let o=[],r=new Set;for(let s of e.objects){if(!s||typeof s!="object"||Array.isArray(s))return;let a=s,l=typeof a.label=="string"?a.label.trim():"",c=typeof a.channelId=="string"?a.channelId.trim():"";if(!l||r.has(l)||!i.has(c))return;r.add(l),o.push({label:l,channelId:c})}return{assignmentVersion:e.assignmentVersion,channels:t,objects:o}}function tr(n){if(!n||typeof n!="object"||Array.isArray(n))return null;let e=n,t=If.find(p=>p===e.state);if(!t)return null;let i=_i(e.fromPrice),o=_i(e.previousPrice);if(i===void 0||o===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 s=Nc(e.release);if(s===void 0)return null;let a=e.upcoming===void 0?null:Nc(e.upcoming);if(a===void 0)return null;let l=[];if(e.prices!=null){if(!Array.isArray(e.prices))return null;let p=[];for(let m of e.prices){if(!m||typeof m!="object"||Array.isArray(m))return null;let u=m,f=typeof u.categoryKey=="string"?u.categoryKey.trim():"";if(!f)return null;let b=_i(u.price),T=_i(u.previousPrice);if(b==null||T===void 0)return null;let E={categoryKey:f,price:b,previousPrice:T};if(u.tierId!==void 0){if(u.tierId!==null&&(typeof u.tierId!="string"||!u.tierId.trim()))return null;E.tierId=u.tierId===null?null:u.tierId.trim()}if(u.offerId!==void 0){if(typeof u.offerId!="string"||!u.offerId.trim())return null;E.offerId=u.offerId.trim()}if(u.offerName!==void 0){if(typeof u.offerName!="string"||!u.offerName.trim())return null;E.offerName=u.offerName.trim()}if(u.remaining!==void 0){if(u.remaining!==null&&(typeof u.remaining!="number"||!Number.isInteger(u.remaining)||u.remaining<0))return null;E.remaining=u.remaining==null?null:u.remaining}for(let v of["startsAt","endsAt"]){if(u[v]===void 0)continue;let M=ys(u[v]);if(M===void 0)return null;E[v]=M}p.push(E)}l=p}let c=Of(e.channelPricing);if(c===void 0)return null;let d=ys(e.nextPriceChangeAt);return d===void 0?null:{state:t,fromPrice:i,previousPrice:o,currency:r,release:s,upcoming:a,prices:l,channelPricing:c,...e.nextPriceChangeAt!==void 0?{nextPriceChangeAt:d}:{},...e.bookingFee!==void 0?{bookingFee:Rf(e.bookingFee)}:{}}}function Dc(n){return n?.changed!==!1}function Bc(n,e){if(!n)return null;let t=null,i=o=>{o!=null&&o>e&&(t===null||o<t)&&(t=o)};for(let o of[n.release,n.upcoming])i(o?.startsAt),i(o?.endsAt);for(let o of n.prices)i(o.startsAt),i(o.endsAt);return i(n.nextPriceChangeAt),t}function vs(n){let e={};for(let t of n?.prices??[])if(t.tierId==null)e[t.categoryKey]=t.price;else{let i=e[t.categoryKey],o=typeof i=="number"?{base:i}:i??{};e[t.categoryKey]={...o,tiers:{...o.tiers,[t.tierId]:t.price}}}return e}function Fc(n,e){let t={...n};for(let[i,o]of Object.entries(vs(e))){let r=t[i];t[i]=typeof o=="number"?o:{...typeof r=="number"?{base:r}:r,...o,tiers:{...typeof r=="object"?r.tiers:{},...o.tiers}}}return t}var Ni=require("@seatlayer/core"),_f={seat:()=>"",tray:n=>$c(n)?zc():""};function Vc(n,e,t){let i=n?.bookingFee;return!i||i.amountMinor<=0||i.currency!==e.toUpperCase()||t?.prices&&Object.keys(t.prices).length||t?.objects&&Object.keys(t.objects).length?null:i}function $c(n){return n.some(e=>(e.bookingFeeMinor??0)>0)}function zc(){return` \xB7 ${(0,Ni.t)("picker.fee.included")}`}function jc(n,e,t){return n?{seat:i=>i>0?(0,Ni.t)("picker.fee.includesAmount",{amount:t((0,Ni.fromMinorUnits)(n.amountMinor,e))}):"",tray:(i,o,r)=>{let s=i.reduce((a,l)=>a+(l.quantity??1),0);return $c(i)||o>s&&r>0?zc():""}}:_f}function Kc(n,e){let t=n.bookingFeeMinor;return typeof t!="number"||!Number.isSafeInteger(t)||t<=0?{}:typeof n.basePrice!="number"||!Number.isFinite(n.basePrice)||n.basePrice<0?{}:e!==n.unitPrice?{}:{basePrice:n.basePrice,bookingFeeMinor:t}}var Uc=require("@seatlayer/core");var Gc="maintenance_mode";function Nf(n){if(!n||typeof n!="object")return!1;let e=n;return e.reason===Gc||e.code===Gc}function Df(n){return typeof n!="number"||!Number.isFinite(n)||n<0?null:Math.max(1,Math.ceil(n/60))}function ws(n){if(!Nf(n))return null;if(typeof n.notice=="string"&&n.notice.trim())return n.notice.trim();let e=Df(n.retryAfterS);if(e===null)return x("picker.maintenancePausedShortly","Booking is paused for a few minutes for maintenance. Please try again shortly.");let t=(0,Uc.tCount)("picker.maintenancePaused",e);return t==="picker.maintenancePaused"?`Booking is paused for maintenance. Please try again in about ${e} minute${e===1?"":"s"}.`:t}function qc(n){return n.focusedSection!==null?n.deeperThanSectionFrame===!1?"venue":"section":n.atVenueFit!==void 0?n.atVenueFit?"none":"venue":n.seatsRevealed?"venue":"none"}var Wc=["pointerdown","pointermove","keydown","wheel","touchstart"],nr=class{constructor(e){this.opts=e;this.timer=null;this.root=null;this.doc=null;this.disposed=!1;this.onInput=()=>this.touch();this.onVisibility=()=>{this.doc&&!this.doc.hidden&&this.check()};this.lastInput=this.now()}get enabled(){return this.opts.minutes>0}now(){return this.opts.now?this.opts.now():Date.now()}attach(e,t=e.ownerDocument){if(!(this.disposed||!this.enabled)){this.root=e,this.doc=t;for(let i of Wc)e.addEventListener(i,this.onInput,{capture:!0,passive:!0});t.addEventListener("visibilitychange",this.onVisibility),this.touch()}}touch(){this.lastInput=this.now(),this.arm(this.opts.minutes*6e4)}recentlyActive(){return!this.enabled||this.now()-this.lastInput<this.opts.minutes*6e4}resume(){this.disposed||this.touch()}dispose(){if(this.disposed=!0,this.clear(),this.root)for(let e of Wc)this.root.removeEventListener(e,this.onInput,{capture:!0});this.doc?.removeEventListener("visibilitychange",this.onVisibility),this.root=null,this.doc=null}arm(e){if(this.disposed||!this.enabled)return;this.clear();let t=this.opts.setTimeout??((i,o)=>setTimeout(i,o));this.timer=t(()=>{this.timer=null,this.check()},Math.max(0,e))}clear(){if(this.timer===null)return;(this.opts.clearTimeout??(t=>clearTimeout(t)))(this.timer),this.timer=null}check(){if(this.disposed||!this.enabled)return;let e=this.lastInput+this.opts.minutes*6e4-this.now();if(e>0){this.arm(e);return}if(this.opts.blocked()){this.arm(6e4);return}this.clear(),this.opts.onIdle()}};async function Yc(n,e){let t=await n.pubApi?.pickerIdleMinutes().catch(()=>null)??null;if(n.destroyed||n.idleClock)return;let i=new nr({minutes:t??30,blocked:()=>!!n.hold,onIdle:()=>Xc(n)});i.enabled&&(n.idleClock=i,i.attach(e))}function Xc(n){n.destroyed||!n.root||n.holdExpiredEl||(n.realtime?.stop(),n.realtime=null,n.showAccessPanel({reason:"idle",retryable:!0}))}async function Zc(n){if(n.destroyed)return!1;if(n.pubApi?.rotateViewerId(),n.access?.configured){let e=await n.refreshAccess();return e&&n.idleClock?.resume(),e}return n.dismissAccessPanel(),await n.controller.refresh(),n.realtime?n.realtime.restart():n.startRealtime(),n.idleClock?.resume(),!0}function Qc(n){if(!n.destroyed){if(n.hold||n.idleClock?.recentlyActive()){n.pubApi?.rotateViewerId(),n.realtime?.restart();return}Xc(n)}}var ir=require("@seatlayer/core");function Jc(n,e,t=[],i=8,o=[]){let r=e.reduce((l,c)=>!c||c.width<=0||c.height<=0?l:Math.max(l,c.bottom-n.top+i),0),s=t.reduce((l,c)=>!c||c.width<=0||c.height<=0?l:Math.max(l,n.bottom-c.top+i),r>0?i:0),a=o.reduce((l,c)=>!c||c.width<=0||c.height<=0?l:Math.max(l,n.right-c.left+i),0);return{top:Math.max(0,Math.ceil(r)),right:Math.max(0,Math.ceil(a)),bottom:Math.max(0,Math.ceil(s)),left:0}}function ed(n){let e=document.createElement("div");e.className="sl-floors sl-levels on",e.setAttribute("role","group"),e.setAttribute("aria-label",(0,ir.t)("picker.chooseLevel")),e.title=(0,ir.t)("picker.floorHelp");let t=n.tf("picker.allLevels","All levels"),i=[...n.floors.map((o,r)=>({id:o.id,name:o.name,code:Bf(r)})).reverse(),{id:"",name:t,code:""}];for(let o of i){let r=document.createElement("button");if(r.type="button",r.className="sl-level",r.dataset.level=o.id,r.setAttribute("aria-pressed","false"),r.title=o.name,o.code){let a=document.createElement("b");a.className="sl-level-code",a.textContent=o.code,r.appendChild(a),r.setAttribute("aria-label",`${o.name} (${o.code})`)}let s=document.createElement("span");if(s.className="sl-level-name",s.textContent=o.name,r.appendChild(s),!o.code){let a=document.createElement("span");a.className="sl-level-short",a.setAttribute("aria-hidden","true"),a.textContent=(0,ir.t)("picker.allLevelsShort"),r.appendChild(a)}r.addEventListener("click",()=>n.onChoose(o.id)),e.appendChild(r)}return e.addEventListener("keydown",o=>{if(o.key!=="ArrowUp"&&o.key!=="ArrowDown")return;let r=[...e.querySelectorAll(".sl-level")],s=r.indexOf(document.activeElement);s<0||(o.preventDefault(),r[Math.max(0,Math.min(r.length-1,s+(o.key==="ArrowUp"?-1:1)))].focus())}),e}function Bf(n){return n===0?"G":String(n)}function td(n,e,t){if(!n)return;let i=t?"":e;for(let o of n.querySelectorAll(".sl-level"))o.setAttribute("aria-pressed",String(o.dataset.level===i))}var or=class{constructor(e){this.el=null;this.current=null;this.collapsed=!1;this.shownAt=0;this.host=e}get summary(){return this.current}adopt(e){this.current=e}get element(){return this.el}show(e){if(e&&e.id!==this.current?.id&&this.host.collapseSheet(),this.current=e,!e){this.el?.remove(),this.el=null,this.host.refreshMinimap();return}this.collapsed=this.host.controller.getRung()==="seats",this.shownAt=Date.now(),this.render(e),this.host.refreshMinimap()}render(e){this.el?.remove(),this.el=null}collapse(){!this.el||this.collapsed||!this.current||(this.collapsed=!0,this.render(this.current))}onView(){if(!(!this.el||this.collapsed||!this.current)){if(this.host.controller.getRung()==="seats"){this.collapse();return}if(Date.now()-this.shownAt<1400){this.coverage()>.25&&this.collapse();return}this.collapse()}}coverage(){let e=this.el,t=this.current,i=this.host.map();if(!e||!t||!i)return 0;let o=this.host.activeFloorObjects().find(v=>v.type==="section"&&v.id===t.id)?.outline;if(!o||o.length<3)return 0;let r=o.map(v=>this.host.controller.worldToScreen(v)),s=r.map(v=>v.x),a=r.map(v=>v.y),l=Math.min(...s),c=Math.min(...a),d=Math.max(...s)-l,p=Math.max(...a)-c;if(d<=0||p<=0)return 0;let m=i.getBoundingClientRect(),u=e.getBoundingClientRect(),f=u.left-m.left,b=u.top-m.top,T=Math.max(0,Math.min(f+u.width,l+d)-Math.max(f,l)),E=Math.max(0,Math.min(b+u.height,c+p)-Math.max(b,c));return T*E/(d*p)}};var Jn=require("@seatlayer/core"),Ad=require("@seatlayer/core/core/color");var He=require("@seatlayer/core");function xs(n,e,t){try{return new Intl.DateTimeFormat(e,{...t,...n.timezone?{timeZone:n.timezone}:{}}).format(new Date(n.startsAt))}catch{return new Date(n.startsAt).toLocaleString(e)}}var rr=(n,e)=>xs(n,e,{dateStyle:"medium"}),sr=(n,e)=>xs(n,e,{timeStyle:"short"}),Qn=(n,e)=>xs(n,e,{weekday:"short",day:"numeric",month:"short"});function nd(n,e,t,i){return!n.length||n.length>=e?null:{summary:i,labels:n.map(o=>`${rr(o,t)} \xB7 ${sr(o,t)}`)}}function Ff(n,e){let t=new Set(e);return n.map(i=>({...i,free:!t.has(i.eventKey)}))}function id(n,e){let t=[...n];if(t.length<=1)return t[0]??"";try{return new Intl.ListFormat(e,{style:"long",type:"conjunction"}).format(t)}catch{return t.join(", ")}}function Vf(n,e,t="",i=!1){if(!n.length)return"";let o=n.map(r=>{let s=r.free?e.free:e.blocked,a=i&&r.free?`<input class="sl-night-choice" type="checkbox" data-pg-event-key="${L(r.eventKey)}" aria-label="${L(`${r.shortDate}: ${s}`)}" checked>`:"";return`<li class="sl-night${r.free?" ok":" no"}" aria-label="${L(`${r.shortDate}: ${s}`)}">`+a+`<i class="sl-night-dot" aria-hidden="true"></i><span class="d">${L(r.shortDate)}</span><span class="st">${L(s)}</span></li>`}).join("");return`<div class="sl-tip-nights"><div class="sl-tip-nights-title">${L(e.title)}</div><ul class="sl-nightstrip">${o}</ul><p class="sl-tip-nights-note">${L(e.notAvailableOn)}</p>`+t+"</div>"}function $f(n){return n.selectPartialLabel&&n.pinned?`<button type="button" class="sl-tip-switch" data-pg-select-partial>${L(n.selectPartialLabel)}</button>`:n.switchLabel&&n.pinned?`<button type="button" class="sl-tip-switch" data-pg-switch-mode>${L(n.switchLabel)}</button>`:n.switchLabel||n.selectPartialLabel?"":`<p class="sl-tip-advice">${L(n.advice)}</p>`}function zf(n){return Number(n.available)+Number(n.selected)+Number(n.partial)+Number(n.unavailable)}function od(n,e,t){if(zf(n)<2)return"";let i=(r,s,a="")=>`<li class="sl-pg-legend-item"><i class="sl-pg-sw ${r}"${a}></i>${L(s)}</li>`,o=[];return n.available&&o.push(i("sl-pg-sw-free",e.available,` style="background:${L(t)}"`)),n.selected&&o.push(i("sl-pg-sw-sel",e.selected)),n.partial&&o.push(i("sl-pg-sw-split",e.partial,` style="--sl-pg-sw-cat:${L(t)}"`)),n.unavailable&&o.push(i("sl-pg-sw-off",e.unavailable)),`<ul class="sl-pg-legend-list" aria-label="${L(e.title)}">${o.join("")}</ul>`}function rd(n,e){if(!n.length)return"";let t=n.map(i=>{let o=i.labels.length?i.labels.join(", "):e.empty;return`<li class="sl-pg-night-row${i.labels.length?"":" empty"}${i.active?" active":""}" role="button" tabindex="0"${i.active?' aria-current="true"':""} data-event-key="${L(i.eventKey)}"><span class="n">${L(i.name)}</span><span class="s">${L(o)}</span></li>`}).join("");return`<div class="sl-pg-nights" role="group" aria-label="${L(e.title)}"><div class="sl-pg-nights-title">${L(e.title)}</div><ul class="sl-pg-nights-list">${t}</ul></div>`}function ks(n,e){if(n?.kind!=="partial"||!e?.length)return null;let t=n.data?.blockedEventKeys??[],i=Ff(e,t);return{states:i,missing:i.filter(o=>!o.free).map(o=>o.shortDate)}}function sd(n,e){return n?Vf(n.states,{title:e.words?.title??x("picker.group.partlyAvailableTitle","Free on some nights only"),free:x("picker.group.nightFree","Free"),blocked:x("picker.group.nightBlocked","Not available"),notAvailableOn:(0,He.t)("picker.group.notAvailableOn",{dates:id(n.missing,e.locale)})},$f({switchLabel:e.switchLabel??null,selectPartialLabel:e.selectPartialLabel??null,pinned:e.pinned,advice:e.words?.advice??x("picker.group.pickSeatFreeEveryNight","Pick a seat that is free every night.")}),!!e.selectPartialLabel&&!!e.pinned):""}function jf(n,e,t,i){if(!n.length)return"";let o=new Set(e),r=new Set(t),s=n.map(a=>{let l=o.has(a.eventKey);return`<li class="sl-confirm-date${l?"":" blocked"}"><label><input type="checkbox" data-pg-confirm-event-key="${L(a.eventKey)}" aria-label="${L(`${a.shortDate}: ${l?i.available:i.unavailable}`)}"${l&&r.has(a.eventKey)?" checked":""}${l?"":" disabled"}><span class="sl-confirm-date-label">${L(a.shortDate)}</span><span class="sl-confirm-date-state">${L(l?i.available:i.unavailable)}</span></label></li>`}).join("");return`<fieldset class="sl-confirm-dates" data-pg-confirm-dates><legend>${L(i.title)}</legend><p class="sl-confirm-dates-copy">${L(i.copy)}</p><label class="sl-confirm-date-all"><input type="checkbox" data-pg-confirm-all><span>${L(i.selectAll)}</span></label><ul>${s}</ul><p class="sl-confirm-dates-summary" data-pg-confirm-summary aria-live="polite"></p></fieldset>`}function ad(n,e,t,i){let o=e.availableEventKeys(t);return jf(n,o,e.includedEventKeys(),{title:(0,He.t)("picker.group.confirmDatesTitle"),copy:o.length===n.length?(0,He.t)("picker.group.confirmAllDatesCopy").replace("{count}",String(n.length)):(0,He.t)("picker.group.confirmPartialDatesCopy").replace("{available}",String(o.length)).replace("{total}",String(n.length)),selectAll:(0,He.t)("picker.group.confirmSelectAll"),available:i("picker.group.nightFree","Available"),unavailable:i("picker.group.nightBlocked","Unavailable")})}function ld(n){return[...n.querySelectorAll("[data-pg-confirm-event-key]")].filter(e=>e.checked&&!e.disabled).map(e=>e.dataset.pgConfirmEventKey).filter(Boolean)}function cd(n,e,t){let i=[...n.querySelectorAll("[data-pg-confirm-event-key]")];if(!e||!i.length)return;let o=n.querySelector(".sl-confirm-add"),r=n.querySelector("[data-pg-confirm-all]"),s=()=>{let a=i.filter(d=>!d.disabled),l=ld(n).length;r&&(r.checked=l===a.length,r.indeterminate=l>0&&l<a.length);let c=n.querySelector("[data-pg-confirm-summary]");c&&(c.textContent=l===a.length?(0,He.t)("picker.group.confirmAllSelected").replace("{count}",String(l)):(0,He.t)("picker.group.confirmSelectedOfAvailable").replace("{selected}",String(l)).replace("{available}",String(a.length))),o.disabled=l===0,o.textContent=l?e.label(l):(0,He.t)("picker.group.confirmChooseOne"),t()};i.forEach(a=>a.addEventListener("change",s)),r?.addEventListener("change",()=>{i.filter(a=>!a.disabled).forEach(a=>{a.checked=r.checked}),s()}),s()}async function dd(n,e,t){if(!n||!t||!n.querySelector("[data-pg-confirm-event-key]"))return!0;let i=ld(n);if(!i.length)return!1;let o=n.querySelector(".sl-confirm-add");return o?.setAttribute("aria-busy","true"),o&&(o.disabled=!0),await t.apply(e,i)?!0:(o?.removeAttribute("aria-busy"),o?.isConnected&&(o.disabled=!1),!1)}function pd(n,e,t,i=!1){if(!n)return"";let o={label:e,free:n.states.length-n.missing.length,total:n.states.length,dates:id(n.missing,t)};return i?(0,He.t)("picker.season.seatPartlyAvailable",o):(0,He.t)("picker.group.seatPartlyAvailable",o)}function hd(n,e){let t=n.map((i,o)=>{let r=i.state==="done"?e.done:i.state==="current"?e.current:e.upcoming;return`<li class="sl-pg-step-item" data-step="${L(i.id)}" data-state="${L(i.state)}"${i.state==="current"?' aria-current="step"':""}><span class="i" aria-hidden="true">${i.state==="done"?"\u2713":String(o+1)}</span><span class="l">${L(i.label)}</span><span class="sl-pg-sr">${L(r)}</span></li>`}).join("");return`<ol class="sl-pg-steps" aria-label="${L(e.label)}">${t}</ol>`}function Ss(n,e){return`<ul class="sl-pg-cards">${n.map(i=>`<li class="sl-pg-card" data-event-key="${L(i.eventKey)}"><span class="n">${L(i.name)}</span><time datetime="${L(i.iso)}"><span class="d">${L(i.date)}</span><span class="t">${L(i.time)}</span></time></li>`).join("")}</ul><p class="sl-pg-included">${L(e)}</p>`}function ud(n){let e=n.rows.map(t=>`<li class="sl-pg-pane-row${t.labels.length?"":" empty"}" data-event-key="${L(t.eventKey)}"><span class="n">${L(t.name)}</span><span class="s">${L(t.labels.length?t.labels.join(", "):n.empty)}</span></li>`).join("");return`<div class="sl-pg-pane-title">${L(n.title)}</div><ul class="sl-pg-pane-list">${e}</ul>`+(n.note?`<p class="sl-pg-pane-note">${L(n.note)}</p>`:"")+(n.total?`<div class="sl-pg-pane-total"><span>${L(n.total.label)}</span><b>${L(n.total.amount)}</b></div>`:"")+(n.holdStatus?`<p class="sl-pg-hold-status" role="status">${L(n.holdStatus)}</p>`:"")}function md(n){let e=Math.max(0,n);return`${Math.floor(e/6e4)}:${String(Math.floor(e/1e3)%60).padStart(2,"0")}`}function fd(n,e,t=!1){if(!n||n.seats<=0)return"";if(e==="same_seat"){let i=n.perPerformance??n.seats;return n.totalPerformances&&n.performances<n.totalPerformances?(0,He.tCount)("picker.group.performancesChosenOf",i,{chosen:n.performances,total:n.totalPerformances}):t?(0,He.tCount)("picker.season.seatsEveryDate",i):(0,He.tCount)("picker.group.seatsEveryPerformance",i)}return n.perPerformance!=null&&n.performancesChosen===n.performances?(0,He.tCount)("picker.group.seatsPerPerformance",n.seats,{per:n.perPerformance}):(0,He.tCount)("picker.group.performancesChosenOf",n.seats,{chosen:n.performancesChosen,total:n.performances})}function gd(n,e){n.querySelectorAll(".sl-pg-night-row[data-event-key]").forEach(t=>{let i=()=>e(t.dataset.eventKey);t.addEventListener("click",i),t.addEventListener("keydown",o=>{o.key!=="Enter"&&o.key!==" "||(o.preventDefault(),i())})})}function wt(n){return String(n??"\u2014").replace(/[&<>"]/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[e])}function Kf(n,e){let t=n.objectType==="table"&&!!n.bookingMode,i=n.objectType==="booth",o=t||i||!n.seatNumber,r=o?n.rowLabel??n.displayLabel??n.label:n.seatNumber,s=t?`${x("picker.guests","Guests")} ${n.bookingMode==="variable"?`${n.minOccupancy}\u2013${n.maxOccupancy}`:n.capacity}`:!i&&n.rowLabel?`${e} ${ve(n)??""}`.trim():"";return`<div class="sl-tip-head"><div class="sl-tip-id"><span class="sl-tip-seat${o?" name":""}">${wt(r)}</span>`+(s?`<span class="sl-tip-row">${wt(s)}</span>`:"")+"</div>"+(n.sectionLabel?`<div class="sl-tip-sec"><span class="sl-tip-eyebrow">${x("picker.section","Section")}</span><span class="sl-tip-secname">${wt(n.sectionLabel)}</span></div>`:"")+"</div>"}function bd(n,e){let t=n.status==="not_for_sale",i=n.mark?.kind==="partial",o=n.status==="free"||i?"":`<span class="sl-tip-tag">${e.ownHold?x("picker.heldForYou","Held for you"):x("picker.group.legendUnavailable","Unavailable")}</span>`,r=t?"":e.price,s=r?`<span class="sl-tip-amt">${wt(r)}</span>`:"",a=!r&&e.priceNote?`<div class="sl-tip-note">${wt(e.priceNote)}</div>`:"",l=r&&e.feeNote?`<div class="sl-tip-fee">${wt(e.feeNote)}</div>`:"",c=sn(n,{compact:!0}),d=e.reason?`<div class="sl-tip-reason">${wt(e.reason)}</div>`:"";return'<i class="sl-tip-rail" aria-hidden="true"></i>'+Kf(n,e.rowTypeWord)+`<div class="sl-tip-cat"><span class="sl-tip-dot" style="background:${wt(n.categoryColor)}"></span><span class="sl-tip-name">${wt(n.categoryLabel)}</span>`+o+s+"</div>"+l+a+d+c+(e.extra??"")}function yd(n,e,t,i){let o=n.x+14,r=n.y-i.height-12,s=n.y+18,a=r;o+i.width>e-8&&(o=n.x-i.width-14),r<8&&s+i.height<=t-8&&(a=s);let l=Math.max(8,t-i.height-8);return{left:Math.max(8,Math.min(o,Math.max(8,e-i.width-8))),top:Math.max(8,Math.min(a,l))}}function vd(n,e,t,i=22){let o=Math.max(8,Math.min(n.x-t.width/2,Math.max(8,e.width-t.width-8))),r=n.y-i-t.height,s=n.y+i;return r>=8?{left:o,top:r,placement:"above"}:s+t.height<=e.height-8?{left:o,top:s,placement:"below"}:{left:o,top:Math.max(8,Math.min(r<8?s:r,Math.max(8,e.height-t.height-8))),placement:r<8?"below":"above"}}var Ts=14,Gf=12,Uf=12,qf=8;function wd(n,e,t,i=Gf){let o=e.height-Ts-t.height,r=Uf,s=o-i;if(s<=r)return{placement:"sheet",nudgeY:0};let a=(r+s)/2-n;return Math.abs(a)<=qf?{placement:"sheet",nudgeY:0}:{placement:"sheet",nudgeY:Math.round(a)}}function xd(n,e,t,i,o=0){let r=t.width/2+12,s=Math.max(r,Math.min(e.width-r,n.x)),a=n.y+o+t.height+24<=e.height,l=n.y-o<t.height+24&&a?"below":"above",c=l==="above"?n.y-o:n.y+o,d=i&&l==="above"?Math.max(t.height+24,c):c;return{left:s,top:Math.max(8,Math.min(e.height-8,d)),placement:l}}function kd(n,e,t){let i=n.querySelector("[data-pg-select-partial]"),o=[...n.querySelectorAll("[data-pg-event-key]")],r=()=>o.filter(a=>a.checked).map(a=>a.dataset.pgEventKey).filter(Boolean),s=()=>{if(!i)return;let a=r().length;i.disabled=a===0,i.textContent=e?.(a)??i.textContent};o.forEach(a=>{a.addEventListener("change",s);let l=a.closest(".sl-night");l?.classList.add("selectable"),l?.addEventListener("click",c=>{c.target!==a&&(a.checked=!a.checked,s())})}),i?.addEventListener("click",()=>{let a=r();a.length&&t?.(a)})}function pn(n){let e=n?.displayType?.trim()||n?.rowType?.trim();return e||(n?.objectType==="table"?x("picker.table","Table"):n?.objectType==="booth"?x("picker.booth","Booth"):x("picker.row","Row"))}var Wf="sl-confirm-scrim",Yf="--sl-scrim-mask";function Xf(n){let e=Math.round(n.x),t=Math.round(n.y);return`radial-gradient(circle at ${e}px ${t}px, transparent 0 56px, #000 88px)`}function Sd(n,e,t,i){let o=n??document.createElement("div");return n||(o.className=Wf),o.style.setProperty(Yf,Xf(i)),t.parentNode===e?o.nextSibling!==t&&e.insertBefore(o,t):o.parentNode!==e&&e.appendChild(o),o}function Es(n){return n?.remove(),null}var Td={passport:!1,compare:!1},Zf=360,Qf=160,Jf=700,Ed=450,eg=8;function Cd(){try{return globalThis.matchMedia?.("(pointer: coarse)").matches??!1}catch{return!1}}function tg(n){return(0,Ad.contrastRatio)("#ffffff",n)>=3?"#ffffff":"#0b0f19"}var ar=class{constructor(e){this.el=null;this.seat=null;this.outsideTap=null;this.scrim=null;this.shownAt=0;this.lift=null;this.framing=null;this.mode="add";this.host=e}get element(){return this.el}set element(e){this.el=e}get candidate(){return this.seat}set candidate(e){this.seat=e}thumbHtml(e){let t=this.host.controller.doc;if(!t)return"";let i=Yn(e)?e.viewUrl??"":"",o=Yo(t);if(!i&&!o)return"";let r=i?null:Xo(e,e.focalPoint??t.focalPoint);if(!i&&r==null)return"";let s="";if(!i)return s;let a=Y((0,Jn.t)("picker.viewFromSeat",{label:e.label})),l=Y(this.host.tf("picker.viewFromHere","View from here"));return`<button type="button" class="sl-confirm-view sl-confirm-thumbwrap" aria-label="${a}"><img class="sl-confirm-thumb" alt="" /><span class="sl-confirm-thumb-badge">\u{1F52D} ${l}</span></button>`+s}show(e,t="add"){let i=this.host;this.mode=t;let o=this.seat?.id;this.el?.remove(),this.el=null,this.seat=e,i.root()?.setAttribute("data-confirming","true"),i.els().side?.toggleAttribute("inert",!0),Object.values(i.regions()).forEach(D=>D.toggleAttribute("inert",!0)),i.controller.setSelectionFocus(e.id),o&&o!==e.id&&i.controller.deselect([o]),i.hideTooltip();let r=i.controller.seatDetails(e.id),s=i.controller.doc?.categories.find(D=>D.key===e.categoryKey),a=r?.price??(s?.tiers?.length?s.tiers[0].price:s?.price),l=a!=null?i.paidPrice(e.categoryKey,r?.tierId??s?.tiers?.[0]?.id??null,a,e.label):void 0,c=pl(r,e.displayLabel??e.label,pn(r)),d=r?.tiers??s?.tiers??[],p=r?.tierId??d[0]?.id,m=i.suppressPricing()?"":yo(d,p,D=>i.money(i.paidPrice(e.categoryKey,D.id,D.price,e.label)),D=>i.offerName(e.categoryKey,D.id)),u=i.buyerView()==="venue3d",f=i.performanceGroup()?.confirmDateSelection??void 0,b=f?i.performanceGroup()?.nights?.()??[]:[],T=f?ad(b,f,e.id,(D,ne)=>i.tf(D,ne)):"";this.shownAt=performance.now();let E=document.createElement("div");E.className="sl-confirm sl-mo-in",t==="remove"&&E.classList.add("sl-confirm-removing"),T&&E.classList.add("sl-confirm-group-dates"),E.setAttribute("role","dialog"),E.setAttribute("aria-label",(0,Jn.t)("picker.confirmSeatLabel",{label:e.label}));let v=i.controller.getRenderer?.()?.categoryDisplayColor?.(e.categoryKey)??s?.color??"#6e7bff";E.style.setProperty("--sl-cat",v),E.style.setProperty("--sl-cat-ink",tg(v));let M=String(r?.categoryLabel??s?.label??e.categoryKey),F=i.controller.categoryAvailability()[e.categoryKey],Q=typeof F=="number"&&F>0?(0,Jn.tCount)("picker.leftCount",F):"",N=i.packagePrice?.(e.categoryKey)??null,g=i.suppressPricing()?`${r?.displayLabel??e.displayLabel??e.label}`:`${r?.displayLabel??e.displayLabel??e.label} \xB7 ${l==null?i.tf("picker.priceNotSupplied","Price not supplied"):i.money(l)}`,O=Td.passport?dl(e,g,u):"",R=Td.compare?cl(e,u?i.view3dCompareSeatIds():null):"";E.innerHTML=fl({identityFields:c,identity:hl(r,e.displayLabel??e.label,pn(r)),marker:ll({...r?.wheelchairSpaceType?{wheelchairSpaceType:r.wheelchairSpaceType}:{}}),see3dPill:ul(i.canOffer3d(),u),categoryColor:v,categoryLabel:M,priceLabel:N?N.price:!i.suppressPricing()&&l!=null?i.money(l):"",feeNote:N?N.note:!i.suppressPricing()&&l!=null?i.feeNote?.(l)??"":"",categoryLeftLabel:Q,tierChoices:m,groupDates:T,wheelchair:"",commercial:sn({...e.accessibility?.length?{accessibility:e.accessibility}:{},...r?.wheelchairSpaceType?{wheelchairSpaceType:r.wheelchairSpaceType}:{},...e.commercial?{commercial:e.commercial}:{},...r?.aisle?{aisle:!0}:{},...r?.boothType?{boothType:r.boothType}:{},...r?.entrance?{entrance:r.entrance}:{}}),thumb:i.seatViewEnabled()&&i.buyerView()!=="venue3d"?this.thumbHtml(e):"",inspect:u?`<div class="sl-confirm-inspect-row">${O}${R}${Wr(i.canOffer3d(),u)}</div>`:Wr(i.canOffer3d(),u),see3dRow:ml(i.canOffer3d(),u),cancelLabel:(0,Jn.t)("common.cancel"),selectLabel:t==="remove"?i.tf("picker.removeSeat","Remove seat"):i.addSeatLabel(r?.objectType)}),t==="remove"&&E.querySelector(".sl-confirm-add svg path")?.setAttribute("d","M6 6l12 12M18 6L6 18"),i.els().map.appendChild(E),this.el=E;let V=E.querySelector(".sl-confirm-thumb"),z=V?.closest(".sl-confirm-thumbwrap")??null;if(V&&z){let D=!1,ne=()=>{if(D||!z.isConnected)return;D=!0;let X=()=>{z.remove(),this.el===E&&i.reanchor()};if(i.reducedMotion()||typeof requestAnimationFrame!="function"){X();return}z.style.height=`${z.offsetHeight}px`,z.classList.add("sl-confirm-thumb-out"),requestAnimationFrame(()=>{z.style.height="0px",z.style.opacity="0"}),setTimeout(X,Qf)};V.addEventListener("error",ne),V.addEventListener("load",()=>{V.naturalWidth||ne()});let J=e.viewMeta?.previewUrl??e.viewUrl;J?i.resolveAssetUrl(J).then(X=>{if(!(!E.isConnected||this.el!==E)){if(!X){ne();return}V.src=X}}).catch(X=>{ne(),i.onError(X)}):ne()}i.reanchor(),this.liftSeatClearOfSheet(e),E.querySelector(".sl-confirm-view")?.addEventListener("click",()=>{i.openSeatView(e)}),E.querySelector(".sl-confirm-confidence")?.addEventListener("click",D=>{i.openSeatConfidencePassport(e,D.currentTarget instanceof HTMLElement?D.currentTarget:null)}),E.querySelector(".sl-confirm-compare")?.addEventListener("click",()=>i.saveView3dComparisonSeat(e)),E.querySelectorAll("[data-confirm-tier]").forEach(D=>{D.addEventListener("click",()=>{let ne=D.dataset.confirmTier,J=d.find(Ee=>Ee.id===ne);if(!J)return;i.controller.setSeatTier(e.id,J.id),E.querySelectorAll("[data-confirm-tier]").forEach(Ee=>{Ee.setAttribute("aria-pressed",String(Ee===D))});let X=E.querySelector(".sl-confirm-price"),xe=i.paidPrice(e.categoryKey,J.id,J.price,e.label);X&&(X.textContent=i.money(xe));let ge=E.querySelector(".sl-confirm-fee");ge&&(ge.textContent=i.feeNote?.(xe)??""),i.reanchor()})}),E.querySelectorAll(".sl-confirm-3d,.sl-confirm-3dpill,.sl-confirm-3drow").forEach(D=>{D.addEventListener("pointerdown",ho,{once:!0}),D.addEventListener("click",()=>{i.buyerView()==="venue3d"?(i.dismiss(),i.view3dHandle()?.flyToSeat(e.id)):(i.rememberView3dReturnSeat(e),i.dismiss(),i.enter3d(e.id))})}),cd(E,f,()=>i.reanchor()),E.querySelector(".sl-confirm-add").addEventListener("click",()=>{if(!this.ghostActivation()){if(this.mode==="remove"){this.removeCommitted();return}this.commit()}}),E.querySelector(".sl-confirm-cancel").addEventListener("click",()=>{this.ghostActivation()||this.cancel()}),this.armOutsideTap(E),requestAnimationFrame(()=>{let D=E.querySelector(".sl-confirm-add");D?.focus(),i.liftToastOverConfirm(),i.fitTranslatedRows(),i.inviteCommit(E,D)})}liftSeatClearOfSheet(e){let t=this.host.controller.getRenderer();this.framing={gestures:t?.getCameraGestureCount?.()??0,quietUntil:0},this.frameSeatForSheet(e)}frameSeatForSheet(e){let t=this.host,i=t.root();if(!this.el||i?.dataset.layout!=="narrow"||i?.dataset.view3d==="on")return;let o=t.els().map;if(!o)return;let r=t.controller.worldToScreen({x:e.x,y:e.y}),s=t.controller.getRenderer(),a=s?.getCameraGestureCount?.()??0,{nudgeY:l}=wd(r.y,{height:o.clientHeight},{height:this.el.offsetHeight||230}),c=this.lift&&this.lift.gestures===a?this.lift.dy:0;if(!l){this.lift=c?{dy:c,gestures:a}:null;return}let d=!t.reducedMotion();s?.panScreenBy?.({x:0,y:l},{animate:d}),this.lift={dy:c+l,gestures:a},this.framing&&(this.framing.gestures=a,this.framing.quietUntil=d?this.now()+Jf:0)}reframeSeatForSheet(){let e=this.framing,t=this.seat;!e||!t||e.quietUntil&&this.now()<e.quietUntil||(this.host.controller.getRenderer()?.getCameraGestureCount?.()??e.gestures)!==e.gestures||this.frameSeatForSheet(t)}now(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}settleLift(){let e=this.lift;if(this.lift=null,this.framing=null,!e)return;let t=this.host.controller.getRenderer();(t?.getCameraGestureCount?.()??e.gestures)===e.gestures&&t?.panScreenBy?.({x:0,y:-e.dy},{animate:!this.host.reducedMotion()})}reanchor(){let e=this.host;if(!this.el||!this.seat||e.root()?.dataset.view3d==="on")return;let t=e.controller.worldToScreen({x:this.seat.x,y:this.seat.y}),i=e.els().map;if(e.root()?.dataset.layout==="narrow"){this.el.removeAttribute("data-placement"),this.el.style.removeProperty("bottom"),this.scrim=Sd(this.scrim,i,this.el,t),zl(this.el,t,i),e.liftToastOverConfirm(),this.reframeSeatForSheet();return}this.scrim=Es(this.scrim);let o=i.clientWidth,r=i.clientHeight,s=this.el.offsetWidth||276,a=this.el.offsetHeight||230,l=this.el.classList.contains("sl-confirm-group-dates"),c=e.controller.seatScreenRadius()*1.5,d=xd(t,{width:o,height:r},{width:s,height:a},l,c);this.el.dataset.placement=d.placement,this.el.style.left=`${d.left}px`,this.el.style.top=`${d.top}px`,Do(this.el,t,{left:d.left,top:d.top,width:s,height:a})}ghostActivation(){return Cd()?performance.now()-this.shownAt<Ed:!1}armOutsideTap(e){this.disarmOutsideTap();let t=this.host,i=new Map,o=s=>{if(this.el!==e){this.disarmOutsideTap();return}let a=s.target,l=s;if(s.type!=="pointerdown"){let d=i.get(l.pointerId);i.delete(l.pointerId),d&&s.type==="pointerup"&&i.size===0&&Math.hypot(l.clientX-d.x,l.clientY-d.y)<=eg&&this.cancel();return}if(!(!a||e.contains(a)||t.els().tray?.contains(a))){if(a instanceof Element&&a.closest(".sl-view3d")){if(i.set(l.pointerId,{x:l.clientX,y:l.clientY}),i.size>1)for(let d of i.keys())i.set(d,{x:Number.NaN,y:Number.NaN});return}this.cancel()}};this.outsideTap=o;let r=t.root();setTimeout(()=>{this.outsideTap===o&&((r??document).addEventListener("pointerdown",o,!0),(r??document).addEventListener("pointerup",o,!0),(r??document).addEventListener("pointercancel",o,!0))},Cd()?Ed:0)}disarmOutsideTap(){if(!this.outsideTap)return;let e=this.outsideTap;this.outsideTap=null;for(let t of["pointerdown","pointerup","pointercancel"])(this.host.root()??document).removeEventListener(t,e,!0),document.removeEventListener(t,e,!0)}dismiss(){let e=this.host;this.disarmOutsideTap(),this.scrim=Es(this.scrim),this.settleLift(),this.el&&Bo(this.el),this.el=null,this.seat=null,e.liftToastOverConfirm(),e.root()?.removeAttribute("data-confirming"),Object.values(e.regions()).forEach(t=>t.toggleAttribute("inert",!1)),e.applyPanelCollapsed(),e.controller.setSelectionFocus(null),e.syncTray()}async commit(){let e=this.host,t=this.seat;if(!t)return;let o=this.el?.querySelector(".sl-confirm-add")??null;if(o?.classList.contains("is-adding")||!await dd(this.el,t.id,e.performanceGroup()?.confirmDateSelection??void 0))return;e.collapseSectionCard(),this.seat=null,e.syncTray(),e.syncSelectionTo3d();let r=()=>{let l=e.root()?.dataset.layout==="narrow"?this.lift:null;l&&(this.lift=null),e.dismiss();let c=e.controller.worldToScreen(t);ps(e.els(),c,t,e.controller.doc?.categories,()=>{e.cartLanded?.(),l&&(this.lift=l,this.settleLift())})};if(!o||e.reducedMotion()){r();return}o.classList.remove("sl-confirm-add-invite"),o.classList.add("is-adding"),o.setAttribute("aria-disabled","true");let s=o.querySelector(".sl-confirm-add-t");s&&(s.textContent=e.tf("picker.added","Added")),e.scheduleMotion(r,Zf)}cancel(){let e=this.host,t=this.seat;t&&(this.mode!=="remove"&&e.controller.deselect([t.id]),this.seat&&e.dismiss(),e.syncSelectionTo3d(),e.root()?.focus({preventScroll:!0}))}removeCommitted(){let e=this.host,t=this.seat;if(!t)return;let i=e.releaseHeldSeat(t);i||e.controller.deselect([t.id]),e.dismiss(),e.syncTray(),e.syncSelectionTo3d(),e.root()?.focus({preventScroll:!0})}};function Pd(n,e,t){if(!e||t||n.classList.contains("sl-confirm-removing"))return;e.classList.add("sl-confirm-add-invite");let i=()=>e.classList.remove("sl-confirm-add-invite");n.addEventListener("pointerdown",i,{once:!0}),n.addEventListener("keydown",i,{once:!0}),e.addEventListener("focus",i,{once:!0})}function Md(n,e){return n&&n!=="seat"?e("picker.select","Select"):e("picker.addSeat","Add seat")}var We=require("@seatlayer/core"),ei=require("@seatlayer/core/picker/minimapGeometry");function ng(n){let e={inactive:0,available:1,selected:2},t=new Map;for(let o of n){let r=t.get(o.id);(!r||e[o.state]>e[r])&&t.set(o.id,o.state)}let i={selected:0,available:0,inactive:0};for(let o of t.values())i[o]+=1;return i}function ig(n,e){return n.x<=e.x&&n.y<=e.y&&n.x+n.width>=e.x+e.width&&n.y+n.height>=e.y+e.height}function Ld(n,e){let t=new Cs(n);return t.build(e),t}var Cs=class{constructor(e){this.host=e;this.miniCanvas=null;this.miniBase=null;this.miniWrap=null;this.miniToggle=null;this.miniLabel=null;this.miniTf=null;this.miniDrag=null;this.miniSuppressClick=!1;this.userClosed=!1}dispose(){this.miniToggle?.remove(),this.miniWrap?.remove(),this.miniToggle=null,this.miniWrap=null,this.miniCanvas=null,this.miniBase=null,this.miniLabel=null,this.miniTf=null,this.miniDrag=null,this.host.root()?.removeAttribute("data-minimap-open")}build(e){if(!this.host.controller.getViewport())return;let i=document.createElement("button");i.type="button",i.className="sl-minimap-toggle",i.setAttribute("aria-label",(0,We.t)("picker.openVenueMap")),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 o=document.createElement("div");o.className="sl-minimap",o.setAttribute("role","group");let r=document.createElement("div");r.className="sl-minimap-bar";let s=document.createElement("span");s.className="sl-minimap-label";let a=document.createElement("span");a.className="sl-minimap-key",a.setAttribute("aria-label",(0,We.t)("picker.minimapStateKey")),a.append(...[["focused","picker.minimapStateFocused"],["selected","picker.minimapStateSelected"],["","picker.minimapStateAvailable"],["inactive","picker.minimapStateInactive"]].map(([p,m])=>{let u=document.createElement("i");return p&&(u.className=p),u.title=(0,We.t)(m),u}));let l=document.createElement("button");l.type="button",l.className="sl-minimap-close",l.setAttribute("aria-label",(0,We.t)("picker.closeVenueMap")),l.textContent="\xD7",r.append(s,a,l);let c=document.createElement("canvas");c.tabIndex=0,c.setAttribute("role","application"),c.setAttribute("aria-label",(0,We.t)("picker.venueMapLabel")),o.append(r,c),e.appendChild(o),this.miniWrap=o,this.miniLabel=s,this.miniCanvas=c;let d=document.createElement("canvas");this.miniBase=d,i.addEventListener("click",()=>{let p=this.host.root()?.dataset.minimapOpen==="true";this.userClosed=p,this.setMinimapOpen(!p)}),l.addEventListener("click",()=>{this.userClosed=!0,this.setMinimapOpen(!1)}),c.addEventListener("click",p=>{if(this.miniSuppressClick){this.miniSuppressClick=!1;return}this.minimapJump(p)}),c.addEventListener("pointerdown",p=>this.minimapPointerDown(p)),c.addEventListener("pointermove",p=>this.minimapPointerMove(p)),c.addEventListener("pointerup",p=>this.minimapPointerUp(p)),c.addEventListener("pointercancel",p=>this.minimapPointerUp(p)),c.addEventListener("keydown",p=>this.minimapKeydown(p)),this.layoutMinimap(),this.syncMinimapLabel(),this.drawMinimapStatic(),this.drawMinimapRect()}setAutoOpen(e){if(this.miniWrap){if(!e){this.userClosed=!1,this.host.root()?.dataset.minimapOpen==="true"&&this.setMinimapOpen(!1,!1);return}this.userClosed||this.host.root()?.dataset.minimapOpen==="true"||this.setMinimapOpen(!0,!1)}}setMinimapOpen(e,t=!0){this.host.root()?.setAttribute("data-minimap-open",String(e)),this.miniToggle?.setAttribute("aria-expanded",String(e)),t&&(e?this.miniCanvas?.focus():this.miniToggle?.focus())}layoutMinimap(){let e=this.miniCanvas,t=this.miniBase,i=this.host.controller.getViewport()?.bounds;if(!e||!t||!i||!(i.width>0&&i.height>0))return;let o=196,r=146,s=6,a=i.width/Math.max(1,i.height),l=o,c=Math.round(o/a);c>r&&(c=r,l=Math.round(r*a)),l=Math.max(64,l),c=Math.max(48,c);let d=Math.min(2,window.devicePixelRatio||1);e.width=Math.round(l*d),e.height=Math.round(c*d),e.style.width=`${l}px`,e.style.height=`${c}px`,t.width=e.width,t.height=e.height,this.miniTf=(0,ei.createMinimapTransform)(i,e.width,e.height,d,s)}syncMinimapLabel(){if(!this.miniLabel||!this.miniWrap)return;let e=this.host.controller.getFloors(),t=this.host.controller.isFloorOverview()?(0,We.t)("picker.allFloors"):e.find(l=>l.id===this.host.controller.getActiveFloorId())?.name??(0,We.t)("picker.venueOverview"),i=this.host.controller.getMinimapSnapshot().sections,r=i.find(l=>l.active)?.label??this.host.focusedSectionLabel(),s=r?`${t} \xB7 ${r}`:t;this.miniLabel.textContent=s;let a=(0,We.t)("picker.venueMapSummary",ng(i));this.miniWrap.setAttribute("aria-label",i.length?`${s}. ${a}`:s),this.miniCanvas?.setAttribute("aria-label",i.length?`${s}. ${a} ${(0,We.t)("picker.venueMapPanSections")}`:`${s}. ${(0,We.t)("picker.venueMapPanEmpty")}`)}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 o=p=>p*t.scale+t.offX,r=p=>p*t.scale+t.offY,s=this.host.cssVar("--sl-line")||"rgba(139,147,167,.5)",a=this.host.cssVar("--sl-muted")||"#8b93a7",l=this.host.cssVar("--sl-accent")||"#6e7bff",c=this.host.cssVar("--sl-success")||"#22a06b",d=this.host.controller.getMinimapSnapshot();for(let p of d.sections){if(p.outline.length<3)continue;i.beginPath(),p.outline.forEach((u,f)=>f===0?i.moveTo(o(u.x),r(u.y)):i.lineTo(o(u.x),r(u.y))),i.closePath();let m=p.paint;if(i.globalAlpha=p.state==="inactive"?.5:.92,m?i.fillStyle=m.fill:(i.globalAlpha=p.state==="inactive"?.18:p.state==="selected"?.72:.34,i.fillStyle=p.state==="inactive"?a:p.state==="selected"?l:c),i.fill(),i.globalAlpha=.82,i.lineWidth=Math.max(1,t.dpr),i.strokeStyle=m?.stroke||s,i.stroke(),p.owned){i.globalAlpha=1,i.lineWidth=Math.max(2,t.dpr*1.5),i.strokeStyle=l,i.stroke();let u=p.outline.reduce((f,b)=>({x:f.x+b.x,y:f.y+b.y}),{x:0,y:0});i.beginPath(),i.arc(o(u.x/p.outline.length),r(u.y/p.outline.length),Math.max(1.5,t.dpr*1.6),0,Math.PI*2),i.fillStyle=l,i.fill(),i.beginPath(),p.outline.forEach((f,b)=>b===0?i.moveTo(o(f.x),r(f.y)):i.lineTo(o(f.x),r(f.y))),i.closePath()}p.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,!d.sections.length){let p=Math.max(1,t.dpr),m=new Map,u=f=>{let b=m.get(f);if(b)return b;let T=this.host.tint?.(f)||c;return m.set(f,T),T};for(let f of d.seats)i.globalAlpha=f.state==="inactive"?.22:.78,i.fillStyle=f.state==="inactive"?a:f.state==="selected"?l:u(f.categoryKey),i.beginPath(),i.arc(o(f.x),r(f.y),p,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 o=e.getContext("2d");if(!o)return;o.clearRect(0,0,e.width,e.height),o.drawImage(t,0,0);let r=this.host.controller.getViewport();if(!r)return;let s=ig(r.visible,r.bounds);if(this.host.root()?.toggleAttribute("data-minimap-idle",s),s)return;let a=(0,ei.minimapViewportPlan)(r.visible,i,e.width,e.height,Math.max(2,i.dpr*2)),l=this.host.cssVar("--sl-text")||"#12151c",c=this.host.cssVar("--sl-surface")||"#fff";o.save(),o.globalAlpha=.1,o.fillStyle=l,o.fillRect(a.raw.x,a.raw.y,a.raw.width,a.raw.height),o.globalAlpha=.9,o.lineJoin="round",o.lineWidth=Math.max(4,i.dpr*3.25),o.strokeStyle=c,o.strokeRect(a.raw.x,a.raw.y,a.raw.width,a.raw.height),o.globalAlpha=1,o.lineWidth=Math.max(2,i.dpr*1.75),o.strokeStyle=l,o.strokeRect(a.raw.x,a.raw.y,a.raw.width,a.raw.height),a.clipped&&Object.values(a.clippedEdges).some(Boolean)&&(o.setLineDash([Math.max(3,i.dpr*3),Math.max(2,i.dpr*2)]),o.strokeRect(a.clipped.x,a.clipped.y,a.clipped.width,a.clipped.height)),o.restore()}minimapWorldPoint(e){let t=this.miniCanvas,i=this.miniTf;if(!t||!i)return null;let o=t.getBoundingClientRect(),r=(e.clientX-o.left)*(t.width/Math.max(1,o.width)),s=(e.clientY-o.top)*(t.height/Math.max(1,o.height));return{...(0,ei.minimapPointToWorld)({x:r,y:s},i),px:r,py:s}}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,o=e.key==="ArrowUp"?-t.height*.2:e.key==="ArrowDown"?t.height*.2:0;!i&&!o||(this.host.controller.clearSectionFocus(),this.host.controller.panToWorld({x:t.x+t.width/2+i,y:t.y+t.height/2+o}),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,We.pointInPolygon)(t,i.outline)){this.host.controller.focusSection(i.id);return}this.host.controller.clearSectionFocus(),this.host.controller.panToWorld(t)}}};var lr=require("@seatlayer/core");var og=12;function Hd(n,e){let t=e.floors(),i=new Set(t.map(N=>N.label.trim().toLocaleLowerCase())),o=e.zones().filter(N=>N.seatCount>0&&!i.has(N.label.trim().toLocaleLowerCase())),r=e.sections().filter(N=>N.seatCount>0&&!i.has(N.label.trim().toLocaleLowerCase())),s=o.length>1?[]:r,a=t.length>1,l=o.length>1,c=s.length>1;if(!a&&!l&&!c)return null;let d=document.createElement("div");d.className="sl-view3d-nav";let p=null,m=document.createElement("button");m.type="button",m.className="sl-view3d-nav-toggle",m.setAttribute("aria-expanded","false");let u='<svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="12" r="9"/><path d="M15.5 8.5l-2 5-5 2 2-5z"/></svg>',f=document.createElement("span");m.innerHTML=u,m.appendChild(f);let b=()=>{for(let N of d.querySelectorAll(":scope > div")){let g=N.querySelector('[aria-pressed="true"]');!g||N.scrollWidth<=N.clientWidth||g.scrollIntoView({block:"nearest",inline:"nearest"})}},T=()=>{if(p)return p;for(let N of d.querySelectorAll(":scope > div")){let g=N.querySelector('button[aria-pressed="true"]'),O=g?.textContent?.trim();if(O&&g?.dataset.floor!=="")return O}return a&&(l||c)?x("picker.levelsAndAreas","Levels & zones"):a?x("picker.levels","Levels"):x("picker.areas","Zones")},E=N=>{d.classList.toggle("is-open",N),m.setAttribute("aria-expanded",String(N)),N&&typeof requestAnimationFrame=="function"&&requestAnimationFrame(b),f.textContent=T()};m.addEventListener("click",()=>E(!d.classList.contains("is-open"))),d.addEventListener("keydown",N=>{N.key!=="Escape"||!d.classList.contains("is-open")||(N.preventDefault(),N.stopPropagation(),E(!1),m.focus())});let v=document.createElement("button");v.type="button",v.className="sl-view3d-nav-close",v.innerHTML='<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M18 6L6 18M6 6l12 12"/></svg>';let M=x("picker.closeVenueNavigation","Close venue navigation");v.setAttribute("aria-label",M),v.title=M,v.addEventListener("click",()=>{E(!1),m.focus()}),E(!1),d.appendChild(m);let F=N=>{},Q=N=>{};if(a){let N=document.createElement("div");N.setAttribute("role","group"),N.setAttribute("aria-label",x("picker.levels","Levels"));let g=[];Q=V=>{g.forEach(z=>{z.setAttribute("aria-pressed",String((z.dataset.floor===""?null:Number(z.dataset.floor))===V))})};let O=V=>{e.focusFloor(V)&&(Q(V),F(V))},R=(V,z)=>{let D=document.createElement("button");D.type="button",D.textContent=V,D.dataset.floor=z===null?"":String(z),D.setAttribute("aria-pressed",String(z===null)),D.addEventListener("click",()=>{O(z),E(!1)}),g.push(D),N.appendChild(D)};R(x("picker.allLevels","All levels"),null);for(let V of t)R(V.label||(0,lr.t)("picker.levelNumber",{number:V.index+1}),V.index);d.appendChild(N)}if(l||c){let N=document.createElement("div");N.setAttribute("role","group"),N.setAttribute("aria-label",x("picker.areas","Zones"));let g=l?o.map(R=>({id:R.id,label:R.label||R.id,go:()=>{e.focusZone(R.id)}})):s.map(R=>({id:R.id,label:R.label||R.id,floorIndex:R.floorIndex,go:()=>{e.focusSection(R.id),Number.isFinite(R.floorIndex)&&Q(R.floorIndex)}})),O=R=>{let V=l||R===null?g:g.filter(z=>z.floorIndex===void 0||z.floorIndex===R);if(N.replaceChildren(),!V.length){N.remove();return}if(N.isConnected||d.insertBefore(N,v.isConnected?v:null),!l&&V.length>og){let z=document.createElement("select");z.setAttribute("aria-label",x("picker.jumpToSection","Jump to section"));let D=document.createElement("option");D.value="",D.textContent=x("picker.jumpToSection","Jump to section"),z.appendChild(D);for(let ne of V){let J=document.createElement("option");J.value=ne.id,J.textContent=ne.label,z.appendChild(J)}z.addEventListener("change",()=>{V.find(ne=>ne.id===z.value)?.go()}),N.appendChild(z);return}for(let z of V){let D=document.createElement("button");D.type="button",D.textContent=z.label,D.dataset.area=z.id,D.addEventListener("click",()=>{p=z.label,z.go(),E(!1)}),N.appendChild(D)}};F=O,O(null)}return d.appendChild(v),n.appendChild(d),d}var cr=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",x("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(x("picker.chooseAnotherToCompare","Choose another seat to compare."),"neutral")});let s=document.createElement("button");s.type="button",s.className="clear",s.textContent="\xD7",s.setAttribute("aria-label",x("picker.clearSavedSeatComparison","Clear saved seat comparison")),s.addEventListener("click",()=>this.host.clearComparison()),t.append(r,s),e.appendChild(t),this.chip=t}let i=this.host.savedSeatIds().length,o=t.querySelector(".main");o&&(o.textContent=i>1?(0,lr.t)("picker.compareCount",{count:i}):x("picker.oneSeatSaved","1 seat saved"),o.setAttribute("aria-label",i>1?(0,lr.t)("picker.openComparisonOfSeats",{count:i}):x("picker.oneSeatSavedChooseAnother","One seat saved; choose another to compare")))}remove(){this.chip?.remove(),this.chip=null}mainButton(){return this.chip?.querySelector(".main")??null}};function Rd(n){return!n?.querySelector('[data-ref="zfs"]')}var Id="sl:sheet-hint";function Od(n){let e=n.boot;if(!e?.isConnected)return;if(n.reducedMotion){e.remove();return}e.classList.add("is-going"),setTimeout(()=>e.remove(),200);let t=document.createElement("div");t.className="sl-shells-in",t.setAttribute("aria-hidden","true"),n.map?.appendChild(t),setTimeout(()=>t.remove(),450),n.rail?.classList.add("is-in"),n.root?.classList.add("is-arriving"),setTimeout(()=>{n.rail?.classList.remove("is-in"),n.root?.classList.remove("is-arriving"),rg(n.root)},700)}function rg(n){if(!n||n.dataset.layout!=="narrow")return;try{if(window.sessionStorage.getItem(Id))return;window.sessionStorage.setItem(Id,"1")}catch{}let e=n.querySelector(".sl-sheet-toggle");e&&(e.classList.add("sl-mo-hint"),e.addEventListener("animationend",()=>e.classList.remove("sl-mo-hint"),{once:!0}))}function _d(n,e){n.addEventListener("keydown",t=>{if(t.key==="Escape"){for(let i of e())if(i.open()){t.preventDefault(),t.stopPropagation(),i.close();return}}})}function pr(n){let e=n.committedSelection(),t=n.controller.getGAAreas(),i=n.hold?.items??[],o=new Set(i.map(m=>m.label)),r=Yl(n,t,i),s=It(n.gaQty,i),a=i.reduce((m,u)=>m+n.heldPrice(u)*(u.quantity??1),0),l=i.reduce((m,u)=>m+(u.quantity??1),0),c=e.filter(m=>!o.has(m.label)),d=c.reduce((m,u)=>m+n.paidPrice(u.categoryKey,u.tierId??null,u.price,u.label)*(u.quantity??1),0)+r+a,p=c.reduce((m,u)=>m+(u.quantity??1),0)+s+l;return{seats:e,freshSeats:c,gaAreas:t,heldItems:i,heldLabels:o,heldCount:l,total:d,count:p}}function hr(n,e){let t=e.tiers?.length?e.tiers[0].price:e.price;return t===void 0||!e.key?t:n.paidPrice(e.key,e.tiers?.[0]?.id??null,t)}function ur(n,e){let t=e.tiers?.length?e.tiers.map(i=>n.paidPrice(e.key,i.id??null,i.price)):e.price==null?[]:[n.paidPrice(e.key,null,e.price)];if(e.key){for(let i of n.pricesByChannel.values())for(let o of i)o.categoryKey===e.key&&t.push(o.price);t.push(...sg(n).get(e.key)??[])}return t.length?{min:Math.min(...t),max:Math.max(...t)}:void 0}var dr=null;function sg(n){let e=n.controller.doc,t=n.hostObjectPrices();if(dr?.doc!==e||dr.host!==t){let i=new Map;for(let[o,r]of Object.entries({...e?.seatPrices,...t})){let s=n.controller.seatByLabel(o)?.categoryKey??n.controller.tableSelection(o)?.categoryKey;s&&(i.has(s)||i.set(s,[]),i.get(s).push(...typeof r=="number"?[r]:Object.values(r.tiers)))}dr={doc:e,host:t,spread:i}}return dr.spread}var Di="seatlayer_";function ag(){let n=globalThis;return n.document?.modelContext??n.navigator?.modelContext??null}function Ye(n,e){return e?{ok:!1,reason:n,message:e}:{ok:!1,reason:n}}function lg(n){return Array.isArray(n)?n.filter(e=>typeof e=="string"&&!!e):[]}function cg(n,e){let t=n.event();if(!t)return Ye("not_loaded","The seat map has not finished loading.");let i=n.selectionLimits();return{ok:!0,event:t,selection:{max:i.max,...i.required!=null?{required:i.required}:{}},categories:n.categories(),zones:n.zones(),hasPremiumSeats:n.hasPremiumSeats(),holdsAllowed:e}}function Nd(n,e){let t=o=>!!o&&o.toLowerCase()===e.toLowerCase(),i=n.find(o=>t(o.key??o.id))??n.find(o=>t(o.label));return i?.key??i?.id??null}function Dd(n,e){let t=e.map(i=>n.describeSeat(i.id));return{seatIds:e.map(i=>i.id),labels:e.map(i=>i.label),section:t[0]?.section??"",row:t[0]?.row??"",seats:e.map((i,o)=>t[o]?.seat||i.label),category:t[0]?.category??e[0].categoryKey,unitPrice:e[0].price,total:e.reduce((i,o)=>i+o.price,0)}}function dg(n,e,t){let i=new Map;for(let r of e){let s=i.get(r.rowKey);s?s.push(r):i.set(r.rowKey,[r])}let o=[];for(let r of i.values()){let s=[...r].sort((l,c)=>l.index-c.index),a=0;for(let l=1;l<=s.length;l++)if(l===s.length||s[l].index!==s[l-1].index+1||s[l].categoryKey!==s[l-1].categoryKey){for(let d=a;d+t<=l;d+=t)o.push(Dd(n,s.slice(d,d+t)));a=l}}return o}function pg(n,e,t){let i=new Map;for(let r of e){let s=i.get(r.sectionKey);s?s.push(r):i.set(r.sectionKey,[r])}let o=[];for(let r of i.values()){if(r.length<t)continue;let s=[...r].sort((a,l)=>a.price!==l.price?l.price-a.price:a.rowKey.localeCompare(l.rowKey)||a.index-l.index);o.push(Dd(n,s.slice(0,t)))}return o}function hg(n,e){if(!n.event())return Ye("not_loaded","The seat map has not finished loading.");let i=n.selectionLimits(),o=Math.floor(Number(e.count));if(!Number.isInteger(o)||o<1||o>i.max)return Ye("bad_count",`count must be a whole number between 1 and ${i.max}.`);let r=Number.isInteger(Number(e.limit))?Math.max(1,Math.min(20,Number(e.limit))):5,s=e.together===void 0?!0:!!e.together,a=typeof e.max_price=="number"&&Number.isFinite(e.max_price)?e.max_price:null,l=typeof e.category=="string"&&e.category?e.category:null,c=typeof e.zone=="string"&&e.zone?e.zone:null,d=l?Nd(n.categories(),l):null;if(l&&!d)return Ye("no_match",`No ticket type called "${l}".`);if(d&&n.categories().find(b=>b.key===d)?.available===0)return Ye("sold_out",`"${l}" is sold out.`);let p=c?Nd(n.zones(),c):null;if(c&&!p)return Ye("no_match",`No zone called "${c}".`);let m=n.seats().filter(b=>b.available);if(!m.length)return Ye("sold_out");let u=m.filter(b=>(!d||b.categoryKey===d)&&(!p||b.zoneId===p)&&(a==null||b.price<=a));if(!u.length)return Ye("no_match");let f=s?dg(n,u,o):pg(n,u,o);return f.length?(f.sort((b,T)=>T.unitPrice!==b.unitPrice?T.unitPrice-b.unitPrice:b.row.localeCompare(T.row)||b.labels[0].localeCompare(T.labels[0])),{ok:!0,groups:f.slice(0,r),searched:{count:o,filters:{...a!=null?{max_price:a}:{},...d?{category:d}:{},...p?{zone:p}:{},together:s}}}):Ye(s?"not_enough_together":"no_match")}function Bd(n){return{ok:!0,...n.selection()}}function ug(n,e){let t=n.event();if(!t)return Ye("not_loaded","The seat map has not finished loading.");if(t.salesClosed)return Ye("event_closed","Sales are closed for this event.");let i=lg(e.seat_ids);return i.length?(n.clearSelection(),n.selectObjects(i),Bd(n)):Ye("nothing_requested","Pass one or more seat ids or labels in seat_ids.")}function mg(n,e){let t=async o=>{try{return await o()}catch(r){return Ye("error",r instanceof Error?r.message:String(r))}},i=[{name:`${Di}describe_event`,title:"Describe this seated event",description:"Read the event, its ticket types with live availability and prices, its zones, and how many seats this buyer may select. Call this first.",inputSchema:{type:"object",properties:{},additionalProperties:!1},annotations:{readOnlyHint:!0,untrustedContentHint:!0},execute:()=>t(()=>cg(n,e))},{name:`${Di}find_seats`,title:"Find available seats",description:"Search the seat map for groups of available seats. Read-only: it never selects, holds or reserves anything. Returns candidate groups with their seat ids, prices and location.",inputSchema:{type:"object",properties:{count:{type:"integer",minimum:1,description:"How many seats are needed."},max_price:{type:"number",description:"Highest acceptable price per seat."},category:{type:"string",description:"Ticket type key or label to restrict the search to."},zone:{type:"string",description:"Zone id or label to restrict the search to."},together:{type:"boolean",description:"Require the seats to be side by side in one row (default true)."},limit:{type:"integer",minimum:1,maximum:20,description:"How many candidate groups to return (default 5)."}},required:["count"],additionalProperties:!1},annotations:{readOnlyHint:!0,untrustedContentHint:!0},execute:o=>t(()=>hg(n,o))},{name:`${Di}select_seats`,title:"Select seats on the map",description:"Replace the current selection with the given seats, exactly as tapping them would. The buyer sees the seats light up and the basket update. No reservation is made.",inputSchema:{type:"object",properties:{seat_ids:{type:"array",items:{type:"string"},description:"Seat ids or labels, e.g. from find_seats."}},required:["seat_ids"],additionalProperties:!1},annotations:{readOnlyHint:!1,untrustedContentHint:!0},execute:o=>t(()=>ug(n,o))},{name:`${Di}get_selection`,title:"Read the current selection",description:"Read the seats currently selected in the basket, their total, any open reservation, and whether the selection satisfies this event\u2019s rules.",inputSchema:{type:"object",properties:{},additionalProperties:!1},annotations:{readOnlyHint:!0,untrustedContentHint:!0},execute:()=>t(()=>Bd(n))}];return e&&i.push({name:`${Di}hold_selection`,title:"Reserve the selected seats",description:"Reserve the currently selected seats for this buyer for a limited time, exactly as pressing the checkout button would. Confirm with the buyer before calling this.",inputSchema:{type:"object",properties:{},additionalProperties:!1},annotations:{readOnlyHint:!1,untrustedContentHint:!0},execute:()=>t(()=>n.hold())}),i}async function Fd(n,e={}){let t=ag();if(!t||typeof t.registerTool!="function")return null;let i=new AbortController,o=mg(n,!!e.holds),r=[],s=e.exposedTo?.length?[...new Set(e.exposedTo)]:void 0;try{for(let a of o)await t.registerTool(a,{signal:i.signal,...s?{exposedTo:s}:{}}),r.push(a.name)}catch(a){console.warn("seatmap: WebMCP tools could not be registered",a)}return r.length?{names:r,dispose:()=>{if(i.abort(),typeof t.unregisterTool=="function")for(let a of r)try{t.unregisterTool(a)}catch{}}}:null}async function Vd(n){let e=n.opts.webMcp;if(!e||n.destroyed)return;let t=typeof e=="object"&&!!e.holds,i=typeof e=="object"?e.exposedTo:void 0;try{n.webMcp=await Fd(Ps(n,t),{holds:t,exposedTo:i}),n.destroyed&&As(n)}catch(o){console.warn("seatmap: WebMCP registration failed",o)}}function As(n){n.webMcp?.dispose(),n.webMcp=null}function Ps(n,e){let t=(i,o)=>{if(Number.isInteger(i.logicalSeatIndex))return i.logicalSeatIndex;let r=i.id.lastIndexOf(":"),s=r<0?NaN:Number(i.id.slice(r+1));return Number.isFinite(s)?s:o};return{event:()=>{let i=n.renderInfo;return i?{name:i.eventName??"",venue:i.venue??null,startsAt:i.startsAt??null,timezone:i.timezone??null,currency:n.currency,salesClosed:n.salesClosed}:null},selectionLimits:()=>({max:n.maxTickets,required:n.exactTickets}),categories:()=>{let i=n.controller.categoryAvailability();return(n.controller.doc?.categories??[]).filter(o=>!o.notForSale).map(o=>{let r=ur(n,o),s=hr(n,o);return{key:o.key,label:o.label??o.key,...s===void 0?{}:{price:s},...r&&r.min!==r.max?{priceRange:r}:{},available:i[o.key]??0}})},zones:()=>n.controller.getBestAvailableZones(),hasPremiumSeats:()=>n.controller.hasPremiumSeats(),seats:()=>{let i=n.controller.getActiveFloorId(),o=[];return n.allSeats().forEach((r,s)=>{if(r.floorId&&i&&r.floorId!==i)return;let a=n.controller.getStatus(r.id)??"free",l=n.controller.doc?.categories.find(d=>d.key===r.categoryKey),c=l?.tiers?.length?l.tiers[0].price:l?.price??0;o.push({id:r.id,label:r.label,rowKey:r.logicalRowId??r.rowId,sectionKey:r.sectionId??r.rowId,index:t(r,s),categoryKey:r.categoryKey,price:n.paidPrice(r.categoryKey,l?.tiers?.[0]?.id??null,c,r.label),...r.zoneId?{zoneId:r.zoneId}:{},available:a==="free"&&!l?.notForSale})}),o},describeSeat:i=>{let o=n.controller.seatDetails(i);return o?{section:o.sectionLabel??"",row:ve(o)??"",seat:o.seatNumber??o.label,category:o.categoryLabel??o.categoryKey}:null},selection:()=>{let{freshSeats:i,total:o,count:r}=pr(n);return{seats:i.map(s=>({id:s.id,label:s.label,section:s.sectionLabel??"",row:ve(s)??"",seat:s.seatNumber??s.label,category:s.categoryKey,price:n.paidPrice(s.categoryKey,s.tierId??null,s.price,s.label)})),count:r,total:o,currency:n.currency,hold:n.hold?{id:n.hold.holdId,expiresAt:n.hold.expiresAt}:null,validity:n.getSelectionValidity()}},clearSelection:()=>n.clearSelection(),selectObjects:i=>{n.selectObjects(i)},hold:()=>e?fg(n):Promise.resolve({ok:!1,reason:"not_allowed"})}}async function fg(n){if(n.salesClosed)return{ok:!1,reason:"event_closed"};if(!n.totalTicketCount())return{ok:!1,reason:"nothing_selected"};let e=n.controller.getSelectionValidity(n.totalTicketCount());return e&&!e.isValid?{ok:!1,reason:"invalid_selection"}:(await n.handleCta(),n.hold?{ok:!0,hold:{id:n.hold.holdId,expiresAt:n.hold.expiresAt}}:{ok:!1,reason:"hold_failed"})}function $d(n,e){if(e.objectType!=="seat"&&e.objectType!=="booth")return null;let t=n.seatByLabel(e.label),i=t?n.toSeat(t).tiers:void 0;return i&&i.length>1?i:null}async function zd(n,e,t,i){let o=n.currentHold(),r=o?.items??[],s=r.find(c=>c.label===e);if(!o||!s||s.tierId===t)return null;let a=r.map(c=>({label:c.label,tierId:c.label===e?t:c.tierId,...c.quantity!=null?{quantity:c.quantity}:{}})),l=await n.api.hold(n.key,a,i,o.holdId);return n.setHold({holdId:l.holdId,labels:a.map(c=>c.label),expiresAt:l.expiresAt,items:l.items}),n.currentHold()}function Ms(n){return{renderingTimeMillis:n.ms,performanceProfile:n.performanceProfile,seatCount:n.seatCount,objectCount:n.objectCount,sectionCount:n.sectionCount,view:n.view,eventKey:n.eventKey,chartName:n.chartName,floorCount:n.floorCount,transport:n.transport,load:n.load,metricScope:n.metricScope,operationalTelemetryReporter:"sdk"}}function jd(n,e){rt({apiBase:n.apiBase,event:n.eventKey,scope:n.metricScope,surface:n.surface,outcome:"success",ms:n.ms,performanceProfile:n.performanceProfile,seats:n.seatCount,floors:n.floorCount,view:n.view,load:n.load,transport:n.transport,revealWaitMs:n.revealWaitMs,handoverMs:n.handoverMs}),e("chart_rendered",Ms(n))}var Kd=require("@seatlayer/core/core/seatConfidence");function Be(n){return String(n??"").replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#39;")}function Gd(n){let e=(0,Kd.seatConfidenceDisclosure)(n.seat.confidenceEvidence),t=n.seat.confidenceEvidence,i=e.limitations.length?`<h4>Known limits</h4><ul>${e.limitations.map(c=>`<li>${Be(c)}</li>`).join("")}</ul>`:"",o=e.modeledTarget?`<div><dt>Modeled target</dt><dd>${Be(e.modeledTarget)}</dd></div>`:"",r=t?`<div><dt>Evidence ID</dt><dd>${Be(t.evidenceId)}</dd></div><div><dt>Model version</dt><dd>${Be(t.modelVersion)}</dd></div><div><dt>Event configuration</dt><dd>${Be(t.eventConfigurationId??"Not configuration-specific")}</dd></div><div><dt>Approval</dt><dd>${Be(t.approvedByRole??"No external approval supplied")}</dd></div>`+(t.validUntil?`<div><dt>Valid until</dt><dd>${Be(t.validUntil.slice(0,10))}</dd></div>`:""):"<div><dt>Evidence ID</dt><dd>None supplied</dd></div>",s=bo(n.seat.commercial).join(" \xB7 ")||n.restrictionFallback,a=`<div><dt>View restriction</dt><dd>${Be(s)}</dd></div>`+(n.seat.commercial?.note?`<div><dt>Organizer note</dt><dd>${Be(n.seat.commercial.note)}</dd></div>`:""),l=n.canReport?'<button type="button" data-report>Report this view</button><p data-report-status role="status" aria-live="polite"></p>':"";return`<div class="sl-view3d-passport-scrim" aria-hidden="true"></div><section class="sl-view3d-passport" role="dialog" aria-modal="true" aria-labelledby="sl-view3d-passport-title"><header><div><span>Seat confidence passport</span><strong id="sl-view3d-passport-title">${Be(n.title)}</strong></div><button type="button" data-close aria-label="Close seat confidence passport">\xD7</button></header><div class="sl-view3d-passport-summary"><strong>${Be(e.headline)}</strong><span>${Be(e.coverage)} \xB7 ${Be(e.freshness)}</span></div><dl><div><dt>Model status</dt><dd>${Be(e.model)}</dd></div><div><dt>Reality evidence</dt><dd>${Be(e.reality)}</dd></div><div><dt>Source</dt><dd>${Be(e.provenance)}</dd></div>`+a+o+r+`</dl>${i}<p class="sl-view3d-passport-note">This passport describes supplied evidence and known limits. It does not guarantee that every temporary obstruction or real-world condition is knowable before the event build.</p>`+l+"</section>"}function Ud(n){return n?n.closest("[data-report]")?"report":n.closest("[data-close]")||n.classList.contains("sl-view3d-passport-scrim")?"close":null:null}function mr(n,e,t){let i=n?.querySelector("[data-report]"),o=n?.querySelector("[data-report-status]");i&&(i.disabled=e!=="failed",i.textContent=e==="received"?"Report received":"Report this view"),o&&(o.setAttribute("role",e==="failed"?"alert":"status"),o.textContent=e==="sending"?"Sending report\u2026":e==="received"?`Report received. Reference ${t??""}.`:"The report could not be sent. Please try again.")}function Ls(n,e,t=null){let i=n.view3dEl;if(!i)return;Bi(n,!1);let o=e.confidenceEvidence,r=n.controller.seatDetails(e.id),s=document.createElement("div");s.className="sl-view3d-passport-shell",s.innerHTML=Gd({seat:e,title:r?.displayLabel??e.displayLabel??e.label,restrictionFallback:n.tf("picker.noAuthoredRestriction","No organizer-authored restriction"),canReport:typeof n.api.reportViewEvidence=="function"});let a=[...new Set([...i.children,...[...n.els.map.children].filter(m=>m!==i)])].filter(m=>m instanceof HTMLElement),l=a.map(m=>({element:m,inert:m.inert,ariaHidden:m.getAttribute("aria-hidden")}));for(let m of a)m.inert=!0,m.setAttribute("aria-hidden","true");i.appendChild(s),i.classList.add("has-passport"),n.view3dPassportEl=s;let c=s.querySelector(".sl-view3d-passport"),d=()=>[...c.querySelectorAll('button:not(:disabled),[href],[tabindex]:not([tabindex="-1"])')],p=m=>{if(m.key==="Escape"){m.preventDefault(),m.stopPropagation(),m.stopImmediatePropagation(),Bi(n);return}if(m.key!=="Tab")return;let u=d();if(!u.length)return;let f=u[0],b=u[u.length-1];m.shiftKey&&document.activeElement===f?(m.preventDefault(),b.focus()):!m.shiftKey&&document.activeElement===b&&(m.preventDefault(),f.focus())};window.addEventListener("keydown",p,!0),n.view3dPassportCleanup=()=>{window.removeEventListener("keydown",p,!0);for(let b of l)b.element.inert=b.inert,b.ariaHidden===null?b.element.removeAttribute("aria-hidden"):b.element.setAttribute("aria-hidden",b.ariaHidden);let m=t?.isConnected?t:n.confirmEl?.querySelector(".sl-confirm-confidence")??n.view3dCompareEl?.querySelector("[data-passport-seat]")??null,u=m?.closest(".sl-confirm,.sl-view3d-compare");u?.isConnected&&(u.inert=!1,u.removeAttribute("aria-hidden")),s.remove(),i.classList.remove("has-passport"),n.view3dPassportEl===s&&(n.view3dPassportEl=null);let f=m??n.view3dCompareEl?.querySelector("[data-passport-seat]")??n.confirmEl?.querySelector(".sl-confirm-confidence")??n.view3dCompareChip.mainButton();(t?.isConnected?t:f)?.focus()},s.addEventListener("click",m=>{let u=Ud(m.target instanceof HTMLElement?m.target:null);u==="close"&&Bi(n),u==="report"&&gg(n,e)}),requestAnimationFrame(()=>d()[0]?.focus()),n.emit3dAnalytics("3d_confidence_passport_opened",{seatId:e.id,evidenceId:o?.evidenceId??null,eventConfigurationId:o?.eventConfigurationId??null,modelLevel:o?.modelLevel??"unverified",realityLevel:o?.realityLevel??"none"})}async function gg(n,e){if(n.api.reportViewEvidence){mr(n.view3dPassportEl,"sending");try{let t=await n.api.reportViewEvidence(n.opts.event,{seatId:e.id,evidenceId:e.confidenceEvidence?.evidenceId});n.emit3dAnalytics("3d_confidence_view_reported",{seatId:e.id,evidenceId:e.confidenceEvidence?.evidenceId??null}),mr(n.view3dPassportEl,"received",t.report.id)}catch{mr(n.view3dPassportEl,"failed")}}}function Bi(n,e=!0){let t=n.view3dPassportCleanup;if(n.view3dPassportCleanup=null,!t){n.view3dPassportEl?.remove(),n.view3dPassportEl=null,n.view3dEl?.classList.remove("has-passport");return}e||(document.activeElement instanceof HTMLElement?document.activeElement:null)?.blur(),t(),e||n.root?.focus({preventScroll:!0})}function qd(n){let e=n.view3dEl;if(!e||n.view3dCompareSeatIds.length<2)return;hn(n,!1);let t=n.view3dCompareSeatIds.map(u=>n.view3dComparisonSnapshot(u)).filter(u=>!!u);if(t.length<2){n.clearView3dComparison();return}let i=u=>L(u),o=t.some(u=>!!u.price),r=document.createElement("div");r.className="sl-view3d-compare-shell";let s=t.map((u,f)=>`<article><span>Seat ${f===0?"A":"B"}</span><strong>${i(u.label)}</strong><small>Section ${i(u.section)} \xB7 Row ${i(u.row)}</small><dl>`+(o?`<div><dt>Current price</dt><dd>${i(u.price)}</dd></div>`:"")+`<div><dt>Ticket type</dt><dd>${i(u.category)}</dd></div><div><dt>Availability</dt><dd>${i(u.availability)}</dd></div><div><dt>View source</dt><dd>${i(u.viewSource)}</dd></div><div><dt>View restriction</dt><dd>${i(u.limited)}</dd></div><div><dt>Seat confidence</dt><dd>${i(u.confidence.headline)}</dd></div><div><dt>Reality check</dt><dd>${i(u.confidence.reality)}</dd></div><div><dt>Accessibility</dt><dd>${i(u.accessibility)}</dd></div></dl><div class="sl-view3d-compare-actions"><button type="button" data-passport-seat="${i(u.seat.id)}">Passport</button><button type="button" data-view-seat="${i(u.seat.id)}">View seat</button><button type="button" class="select" data-select-seat="${i(u.seat.id)}"${u.selectable?"":" disabled"}>Select seat</button></div></article>`).join("");r.innerHTML=`<div class="sl-view3d-compare-scrim" aria-hidden="true"></div><section class="sl-view3d-compare" role="dialog" aria-modal="true" aria-labelledby="sl-view3d-compare-title"><header><div><span>Seat inspection</span><strong id="sl-view3d-compare-title">Compare disclosed attributes</strong></div><button type="button" data-close aria-label="Close seat comparison">\xD7</button></header><p class="sl-view3d-compare-note">${o?"Current price and availability":"Availability"} comes from this picker. Modeled views are chart-derived unless organizer media is labeled.</p><div class="sl-view3d-compare-grid">${s}</div></section>`;let a=document.activeElement instanceof HTMLElement?document.activeElement:null,l=[...e.children].filter(u=>u instanceof HTMLElement),c=l.map(u=>({element:u,inert:u.inert,ariaHidden:u.getAttribute("aria-hidden")}));for(let u of l)u.inert=!0,u.setAttribute("aria-hidden","true");e.appendChild(r),e.classList.add("has-comparison"),n.view3dCompareEl=r;let d=r.querySelector(".sl-view3d-compare"),p=()=>[...d.querySelectorAll('button:not(:disabled),[href],[tabindex]:not([tabindex="-1"])')],m=u=>{if(u.key==="Escape"){u.preventDefault(),hn(n);return}if(u.key!=="Tab")return;let f=p();if(!f.length)return;let b=f[0],T=f[f.length-1];u.shiftKey&&document.activeElement===b?(u.preventDefault(),T.focus()):!u.shiftKey&&document.activeElement===T&&(u.preventDefault(),b.focus())};window.addEventListener("keydown",m),n.view3dCompareCleanup=()=>{window.removeEventListener("keydown",m);for(let u of c)u.element.inert=u.inert,u.ariaHidden===null?u.element.removeAttribute("aria-hidden"):u.element.setAttribute("aria-hidden",u.ariaHidden);r.remove(),e.classList.remove("has-comparison"),n.view3dCompareEl===r&&(n.view3dCompareEl=null),a?.isConnected?a.focus():n.view3dCompareChip.mainButton()?.focus()},r.querySelector("[data-close]")?.addEventListener("click",()=>hn(n)),r.querySelectorAll("[data-passport-seat]").forEach(u=>u.addEventListener("click",()=>{let f=u.dataset.passportSeat,b=f?n.allSeats().find(T=>T.id===f):void 0;b&&Ls(n,b,u)})),r.querySelectorAll("[data-view-seat]").forEach(u=>u.addEventListener("click",()=>{let f=u.dataset.viewSeat;hn(n,!1),f&&n.view3dHandle?.flyToSeat(f)})),r.querySelectorAll("[data-select-seat]").forEach(u=>u.addEventListener("click",()=>{let f=u.dataset.selectSeat;f&&bg(n,f)})),requestAnimationFrame(()=>p()[0]?.focus()),n.emit3dAnalytics("3d_comparison_opened",{seatIds:n.view3dCompareSeatIds.slice()})}function hn(n,e=!0){let t=n.view3dCompareCleanup;if(n.view3dCompareCleanup=null,!t){n.view3dCompareEl?.remove(),n.view3dCompareEl=null,n.view3dEl?.classList.remove("has-comparison");return}e||(document.activeElement instanceof HTMLElement?document.activeElement:null)?.blur(),t(),e||n.root?.focus({preventScroll:!0})}function bg(n,e){if(n.salesClosed){n.toast(n.closedWords?.().toast??n.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}let t=n.allSeats().find(o=>o.id===e);if(!t)return;if(hn(n,!1),!n.controller.select([e]).length){n.syncSelectionTo3d(),n.toast(n.tf("picker.seatNoLongerAvailable","That seat is no longer available."),"warning");return}n.syncSelectionTo3d(),n.showConfirm(t),n.emit3dAnalytics("3d_comparison_selected",{seatId:e})}var Xd=require("@seatlayer/core"),Zd=require("@seatlayer/core/view3d/crossfade/panorama");var Hs=require("@seatlayer/core");var yg=900,vg=450;function wg(n){switch(n){case"seat":return x("picker.stopYourSeat","Your seat");case"row":return x("picker.stopYourRow","Your row");case"section":return x("picker.stopYourSection","Your section");default:return x("picker.stopWholeVenue","Whole venue")}}function Wd(n,e){let t=document.createElement("button");t.type="button",t.className="sl-view3d-recentre sl-mo-rotate-in",t.textContent="\u25CE";let i=x("picker.recentreOnStage","Recentre on the stage");t.setAttribute("aria-label",i),t.title=i,t.addEventListener("click",()=>{e.handle()?.recentreSeatView()});let o=document.createElement("div");o.className="sl-view3d-stop",o.setAttribute("role","status"),o.setAttribute("aria-live","polite"),n.append(t,o);let r=null,s=null;return{onStopChange(a){if(r&&(clearTimeout(r),r=null),s&&(clearTimeout(s),s=null),!a){o.classList.remove("is-shown"),o.textContent="",s=setTimeout(()=>{s=null,n.classList.remove("is-seat-view")},vg);return}n.classList.add("is-seat-view"),o.textContent=wg(a),o.classList.add("is-shown"),r=setTimeout(()=>{r=null,o.classList.remove("is-shown")},yg)},dispose(){r&&(clearTimeout(r),r=null),s&&(clearTimeout(s),s=null),t.remove(),o.remove(),n.classList.remove("is-seat-view")}}}var xg=44,kg=92;function Yd(n,e,t,i={}){let o=n?.sectionLabel,r=ve(n),s=Sg(n,e),a=[o,r?(0,Hs.t)("picker.rowLabel",{label:r}):null,s?(0,Hs.t)("picker.seatLabel",{label:s}):null].filter(Boolean).join(" \xB7 "),l=i.maxChars??(i.narrow?xg:kg);for(let c of[t,i.shortTail??t,null]){let d=[a,c].filter(Boolean).join(" \xB7 ");if(d.length<=l||c==null)return d}return a}function Sg(n,e){if(n?.seatNumber)return n.seatNumber;let t=n?.displayLabel??e,i=o=>{!o||!t.startsWith(o)||t.length<=o.length||(t=t.slice(o.length).replace(/^[\s·\-\/_]+/,""))};return i(n?.sectionLabel),i(ve(n)),t}var Qd=require("@seatlayer/core/core/seatConfidence");var Tg=220;function Eg(n,e,t){let i=null,o=null,r=null;return(s,a)=>{n()?.presentSeatHover?.(s,a,e),r=a,s!==o&&(o=s,i&&(clearTimeout(i),i=null),!(!s||!t)&&(i=setTimeout(()=>{if(i=null,o!==s)return;let c=t()?.(s)??null;c&&o===s&&n()?.presentSeatHover?.(s,r,e,c)},Tg)))}}function Jd(n){return n.buyerView}function ep(n,e,t){if(e==="map"){n.exit3d();return}let i=t?.flyToSeatId;if(n.buyerView==="venue3d"){i?(n.opts.onBuyerViewChange?.({view:"venue3d",seatId:i}),n.view3dHandle?.flyToSeat(i)):t?.resetView&&n.view3dHandle?.focusOverview();return}n.enter3d(i)}function tp(n,e){switch(n.controller.getStatus(e.id)){case"held":if(!ip(n,e))return"held";break;case"booked":case"not_for_sale":return"sold";default:break}return n.priceBandKeys!=null&&!n.priceBandKeys.has(e.categoryKey)||n.controller.accessibilityFilterDims?.(e)||n.limitedViewFilter&&(e.commercial?.restrictedView||e.commercial?.obstructedView)?"dimmed":"available"}function np(n){if(!n.view3dHandle)return;let e=n.allSeats().map(t=>({seatId:t.id,state:n.seatState3dFor(t)}));n.view3dHandle.setAvailability(e),n.syncSelectionTo3d()}function ip(n,e){return n.controller.currentHold()?.labels.includes(e.label)===!0}function Cg(n){return(n.controller.currentHold()?.labels??[]).map(e=>n.controller.seatByLabel(e)?.id).filter(e=>!!e)}function op(n){if(!n.view3dHandle)return;let e=new Set(n.controller.getSelection().map(t=>t.id));for(let t of Cg(n))e.add(t);n.view3dHandle.setSelection([...e])}function rp(n,e){let t=n.view3dHandle;if(!t)return;n.pushAvailabilityTo3d(),n.syncSelectionTo3d();let i=e[0];!i||e.every(r=>r.rowId===i.rowId)&&t.focusRow(i.rowId)||i.sectionId&&t.focusSection(i.sectionId)}async function sp(n,e){let t=n.allSeats().find(i=>i.id===e);if(!t)return null;if(t.viewUrl)try{let i=t.viewMeta?.previewUrl,o=!!i&&i!==t.viewUrl,r=o?await n.buyerAssetUrls.resolve(i):null,s=o?t.viewUrl:await n.buyerAssetUrls.resolve(t.viewUrl);return!s||o&&!r?null:{url:s,...r?{previewUrl:r}:{},...o?{resolveUrl:a=>n.buyerAssetUrls.resolve(a)}:{},...t.viewMeta?.sourceWidth!==void 0?{sourceWidth:t.viewMeta.sourceWidth}:{},...t.viewMeta?.sourceHeight!==void 0?{sourceHeight:t.viewMeta.sourceHeight}:{},...t.viewMeta?.previewWidth!==void 0?{previewWidth:t.viewMeta.previewWidth}:{},...t.viewMeta?.previewHeight!==void 0?{previewHeight:t.viewMeta.previewHeight}:{},...t.viewMeta?.variants?.length?{variants:t.viewMeta.variants}:{},...t.viewMeta?.initialBearingDeg!==void 0?{initialBearingDeg:t.viewMeta.initialBearingDeg}:{},...t.viewMeta?.initialPitchDeg!==void 0?{initialPitchDeg:t.viewMeta.initialPitchDeg}:{},...t.viewMeta?.coverage?{coverage:t.viewMeta.coverage}:{},...t.viewMeta?.capturedAt?{capturedAt:t.viewMeta.capturedAt}:{},...t.viewMeta?.sourceLabel?{sourceLabel:t.viewMeta.sourceLabel}:{}}}catch(i){return n.opts.onError?.(i),null}return{url:"",generated:!0,mediaKind:"model",coverage:"exact-seat",sourceLabel:n.tf("picker.chartDerivedModel","Chart-derived model")}}function ap(n,e){if(n.salesClosed){n.toast(n.closedWords?.().toast??n.tf("picker.salesClosedToast","Sales are closed for this event."),"warning"),n.syncSelectionTo3d();return}let t=n.allSeats().find(a=>a.id===e);if(!t)return;let i=n.controller.tableSelection(e);if(n.committedSelection().some(a=>i?a.label===i.label:a.id===e)){n.controller.deselect([e]),n.dismissConfirm(),n.syncSelectionTo3d();return}let r=n.controller.getStatus(t.id);if(r==="held"||r==="booked"||r==="not_for_sale"){n.syncSelectionTo3d();return}if(!n.controller.select([e]).length){n.syncSelectionTo3d(),n.dismissConfirm();return}if(n.opts.onBuyerViewChange?.({view:"venue3d",seatId:e}),n.flashPickedSeat(e),i){n.showTableDialog(i,!1),n.syncSelectionTo3d();return}n.opts.confirmSelection!==!1?n.showConfirm(t):n.syncTray(),n.syncSelectionTo3d()}function lp(n,e){let t=n.allSeats().find(i=>i.id===e);return Yd(n.controller.seatDetails(e),t?.displayLabel??t?.label??e,n.tf("picker.viewFromYourSeat","view from your seat"),{narrow:n.root?.dataset.layout==="narrow",shortTail:n.tf("picker.fromYourSeat","from your seat")})}function cp(n,e){if(n.buyerView!=="venue3d")return;let t=n.view3dCompareSeatIds;t.includes(e.id)||(n.view3dCompareSeatIds=t.length===0?[e.id]:[t[0],e.id]),n.confirmSeat?.id===e.id&&(n.controller.deselect([e.id]),n.dismissConfirm(),n.syncSelectionTo3d(),n.syncTray()),n.view3dCompareChip.sync(),n.emit3dAnalytics("3d_comparison_saved",{seatId:e.id,count:n.view3dCompareSeatIds.length}),n.view3dCompareSeatIds.length>1?n.openView3dComparison():n.toast(n.tf("picker.chooseAnotherToCompare","Seat saved. Choose another seat to compare."),"success")}function dp(n){n.closeView3dComparison(!1),n.view3dCompareSeatIds=[],n.view3dCompareChip.remove(),n.emit3dAnalytics("3d_comparison_cleared")}function pp(n,e){let t=n.allSeats().find(f=>f.id===e);if(!t)return null;let i=n.controller.seatDetails(t.id),o=n.controller.doc?.categories.find(f=>f.key===t.categoryKey),r=i?.price??(o?.tiers?.length?o.tiers[0].price:o?.price),s=r!=null?n.paidPrice(t.categoryKey,i?.tierId??o?.tiers?.[0]?.id??null,r,t.label):void 0,a=n.controller.getStatus(t.id),l=a==="free"||!a?n.tf("picker.available","Available"):ip(n,t)?n.tf("picker.heldForYou","Held for you"):n.tf("picker.group.legendUnavailable","Unavailable"),c=t.viewUrl?(0,Zd.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}:{}}):n.tf("picker.chartDerivedSeatEye","Live 3D \xB7 chart-derived seat-eye \xB7 not surveyed"),d=bo(t.commercial).join(" \xB7 ")||n.tf("picker.noAuthoredRestriction","No organizer-authored restriction"),p=al({...t.accessibility?.length?{accessibility:t.accessibility}:{},...i?.wheelchairSpaceType?{wheelchairSpaceType:i.wheelchairSpaceType}:{}}),m=p.length?`${p.join(" \xB7 ")} \xB7 metadata, not access certification`:n.tf("picker.noAccessibilityMetadata","No accessibility metadata supplied"),u=(0,Qd.seatConfidenceDisclosure)(t.confidenceEvidence);return{seat:t,label:i?.displayLabel??t.displayLabel??t.label,section:i?.sectionLabel??t.sectionId??"\u2014",row:ve(i)??i?.rowLabel??"\u2014",category:i?.categoryLabel??o?.label??t.categoryKey,price:n.suppressPricing||s==null?"":n.money(s),availability:l,selectable:a==null||a==="free",viewSource:c,limited:d,accessibility:m,confidence:u}}async function hp(n,e){if(n.view3dEl||!n.canOffer3d()||!n.els.map)return;let t=n.controller.doc;if(!t)return;n.buyerView="venue3d",n.view3dTargetSeatId=null,n.opts.onBuyerViewChange?.({view:"venue3d",...e?{seatId:e}:{}}),n.root?.setAttribute("data-view3d","on"),n.dismissConfirm(),n.syncProjection(),n.syncTray();let i=document.createElement("div");i.className="sl-view3d sl-mo-zoom",i.setAttribute("role","group"),i.setAttribute("aria-label",n.tf("picker.interactive3dVenueView","Interactive 3D venue view"));let o=document.createElement("button");o.type="button",o.className="sl-view3d-back",o.innerHTML=`<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M15 18l-6-6 6-6"/></svg><span>${n.tf("picker.backToMap","Back to map")}</span>`;let r=o.querySelector("span"),s=c=>{n.view3dTargetSeatId=c;let d=!!c;i.classList.toggle("is-seat-focused",d),n.root&&(n.root.dataset.view3dSeat=d?"on":"off");let p=d?n.tf("picker.backToVenue","Back to venue"):n.tf("picker.backToMap","Back to map");r&&(r.textContent=p),o.setAttribute("aria-label",p)};if(o.addEventListener("click",()=>{if(n.view3dTargetSeatId&&n.view3dHandle){n.view3dHandle.focusOverview();return}n.exit3d()}),n.regions["top-left"]?.prepend(o),n.view3dBack=o,n.publish3dTopInset(),Rd(n.root)){let c=document.createElement("button");c.type="button",c.className="sl-view3d-fs",c.textContent="\u26F6";let d=n.tf("picker.fullScreen","Full screen");c.setAttribute("aria-label",d),c.title=d,c.setAttribute("aria-pressed",String(!!document.fullscreenElement||n.fsFallback||n.framedFs)),c.addEventListener("click",()=>n.toggleFullscreen()),i.appendChild(c)}let a=document.createElement("div");a.className="sl-view3d-loading",a.setAttribute("role","status"),a.setAttribute("aria-live","polite"),a.textContent=n.tf("picker.loading3d","Building the 3D venue\u2026"),i.appendChild(a),n.els.map.appendChild(i),n.view3dEl=i,n.view3dCompareChip.sync(),requestAnimationFrame(()=>{i.style.opacity="1"});let l=++n.view3dGen;try{let c=n.allSeats(),[d,p]=await Promise.all([Ai(),n.controller.loadEventConfiguration()]),m=p?await Vo(p,v=>n.buyerAssetUrls.resolve(v)):null,u=t.theme?.venue3d?.shellAssetUrl,f=await $o(u,v=>n.buyerAssetUrls.resolve(v));if(l!==n.view3dGen||n.buyerView!=="venue3d"||n.view3dEl!==i)return;let b={doc:t,seats:c,...m?{eventConfigurationId:m.id,eventConfiguration:m}:{},...f?{registeredShellGlb:f}:{}};a.textContent=(0,Xd.t)("picker.building3d");let T=await d.prepareVenue3D(b);if(l!==n.view3dGen||n.buyerView!=="venue3d"||n.view3dEl!==i)return;let E=d.mountVenue3D(i,{...b,prepared:T},{portraitOverviewCrop:!0,arriveAtSeatEye:!0,lookAroundHint:rn(),navLabels:lo(),seatViewActionLabel:v=>n.allSeats().find(M=>M.id===v)?.viewUrl?n.tf("picker.openAuthored360","Open venue 360\xB0"):n.tf("picker.lookAroundLive3d","Look around in live 3D"),seatViewCaption:v=>n.seatViewCaption(v),onSeatViewStopChange:v=>n.view3dSeatViewChrome?.onStopChange(v),onSeatPick:v=>n.onView3dSeatPick(v),onSeatInspect:v=>n.onView3dSeatPick(v),onSeatHover:Eg(()=>n.controller.getRenderer(),i,()=>{let v=E.captureSeatView;return v?M=>v.call(E,M):void 0}),onSectionFocusChange:v=>{let M=i.querySelector('select[data-locator="section"]'),F=v??"";!M||M.value===F||(M.value=F,M.dispatchEvent(new Event("change")))},onViewTargetChange:v=>{i.querySelector(".sl-view3d-nav")?.classList.toggle("is-seat-focused",!!v),s(v),n.opts.onBuyerViewChange?.({view:"venue3d",...v?{seatId:v}:{}})},...n.seatViewEnabled()?{getSeatView:v=>new Promise((M,F)=>{let Q=()=>{n.seatViewFor3d(v).then(g=>{g?M(g):F(new Error("seat_view_unavailable"))})},N=globalThis.requestIdleCallback;typeof N=="function"?N(Q,{timeout:1500}):setTimeout(Q,50)})}:{},onAnalytics:(v,M)=>n.emit3dAnalytics(v,M)});n.view3dHandle=E,n.view3dSeatViewChrome=Wd(i,{handle:()=>n.view3dHandle}),requestAnimationFrame(()=>a.remove()),n.pushAvailabilityTo3d(),n.syncSelectionTo3d(),n.view3dNav=Hd(n.regions["bottom-left"]??i,E),e&&E.flyToSeat(e)}catch(c){if(l!==n.view3dGen||n.buyerView!=="venue3d"||n.view3dEl!==i)return;n.opts.onError?.(c),n.toast(n.tf("picker.unavailable3d","3D could not start. The seat map is still available."),"warning"),n.exit3d()}}function up(n){let e=n.regions["top-left"];if(!n.root||!e)return;let t=()=>{!n.root||n.root.dataset.view3d!=="on"||n.root.style.setProperty("--sl-3d-top-inset",`${Math.max(44,Math.ceil(e.offsetHeight))}px`)};t(),typeof requestAnimationFrame=="function"&&requestAnimationFrame(t)}function mp(n){if(n.buyerView!=="venue3d"&&!n.view3dEl)return;n.view3dGen++,n.buyerView="map",n.view3dTargetSeatId=null,n.opts.onBuyerViewChange?.({view:"map"}),n.root?.removeAttribute("data-view3d"),n.closeSeatConfidencePassport(!1),n.closeView3dComparison(!1),n.view3dCompareChip.remove(),n.view3dSeatViewChrome?.dispose(),n.view3dSeatViewChrome=null,n.view3dBack?.remove(),n.view3dBack=null,n.view3dNav?.remove(),n.view3dNav=null,n.root?.removeAttribute("data-view3d-seat"),n.root?.style.removeProperty("--sl-3d-top-inset");try{n.view3dHandle?.dispose()}catch{}n.view3dHandle=null;let e=n.view3dEl;n.view3dEl=null,e&&(e.style.opacity="0",setTimeout(()=>e.remove(),320)),n.syncProjection(),n.syncTray();let t=n.view3dReturnSeat;n.view3dReturnSeat=null,t&&n.committedSelection().some(i=>i.id===t.id)&&n.opts.confirmSelection!==!1&&n.showConfirm(t)}var Rs=require("@seatlayer/core");var fp=Symbol("seatlayer.performance-group-picker");function fr(n,e){return Object.defineProperty(n,fp,{configurable:!1,enumerable:!1,value:Object.freeze({...e})}),n}function gr(n){return!n||n.surface==="season"}function un(n){return n?.surface==="season"}function gp(n){return n[fp]??null}var Fi=require("@seatlayer/core");function bp(n){return Array.isArray(n)?n.reduce((e,t)=>t.type==="minimumSelectedPlaces"?Math.max(e,t.minimum):e,0):0}function br(n,e,t=!1){let i=n.violations[0];return i==="numberOfPlacesToSelect"?n.remaining>0?(0,Fi.t)("picker.selectExactMore",{count:n.remaining}):(0,Fi.t)("picker.selectExactCount",{count:n.required}):i==="minimumSelectedPlaces"?(0,Fi.t)("picker.selectMinimumMore",{count:n.remaining}):t?e("picker.adjustSeatSelection","Adjust seat selection"):i==="consecutiveSeats"?e("picker.selectSeatsTogether","Choose seats together in the same row and ticket category."):(0,Fi.t)("picker.orphanHint")}var Is=6e4,yp=5*6e4,Pg=String(Math.round(yp/6e4));function vp(n){let e=document.createElement("div");e.className="sl-extend",e.dataset.dock="map",e.setAttribute("role","status"),e.innerHTML='<button type="button" class="sl-extend-btn" data-ref="extendBtn"></button><button type="button" class="sl-extend-x" data-ref="extendDismiss" aria-label=""><svg viewBox="0 0 16 16" width="12" height="12" aria-hidden="true" focusable="false"><path d="M3.5 3.5 12.5 12.5M12.5 3.5 3.5 12.5" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg></button>',(n.regions["bottom-center"]??n.els.map).appendChild(e),n.extendEl=e,n.els.extendBtn=e.querySelector('[data-ref="extendBtn"]'),n.els.extendDismiss=e.querySelector('[data-ref="extendDismiss"]'),n.els.extendBtn.textContent=wp(n),n.els.extendDismiss.setAttribute("aria-label",n.tf("picker.close","Close")),n.els.extendBtn.addEventListener("click",()=>{n.handleExtend()}),n.els.extendDismiss.addEventListener("click",()=>{n.extendDismissed=!0,n.setExtendPrompt(!1,0)})}function wp(n){return n.tf("picker.addMinutes","+{count} min").replace("{count}",Pg)}function xp(n){let e=n.hold?.items??[],t=new Set(e.map(o=>o.label));return n.committedSelection().filter(o=>!t.has(o.label)).reduce((o,r)=>o+(r.quantity??1),0)+It(n.gaQty,n.hold?.items??[])}function kp(n){return(n.hold?.items??[]).reduce((e,t)=>e+(t.quantity??1),0)}function Sp(n){let e=new Set((n.hold?.items??[]).map(i=>i.label)),t=n.committedSelection().filter(i=>!e.has(i.label)).reduce((i,o)=>i+(o.quantity??1),0);return n.heldTicketCount()+t+It(n.gaQty,n.hold?.items??[])}function Tp(n){let e=new Set((n.hold?.items??[]).map(o=>o.label)),t=n.committedSelection().filter(o=>e.has(o.label)).reduce((o,r)=>o+(r.quantity??1),0),i=Math.max(0,n.maxTickets-n.heldTicketCount()-It(n.gaQty,n.hold?.items??[]));n.controller.setMaxSelection(t+i)}function Ep(n,e=n.lastTrayCount,t=n.pendingSelectionCount()){let i=n.els.cta;if(!i)return;if(delete i.dataset.act,n.salesClosed&&!n.finishingHold?.()){i.disabled=!0,i.textContent=n.closedWords?.().cta??n.tf("picker.salesClosedCta","Sales closed");return}if(n.ctaPhase==="holding"){i.disabled=!0,i.innerHTML=`<span class="sl-cta-spin" aria-hidden="true"></span>${n.tf("picker.securingSeats","Securing your seats\u2026")}`;return}if(n.ctaPhase==="checkout"){i.disabled=!0,i.innerHTML=`<span class="sl-cta-spin" aria-hidden="true"></span>${n.tf("picker.openingCheckout","Opening secure checkout\u2026")}`;return}let o=!n.hold&&n.performanceGroup?.selectionMode==="per_performance"?n.performanceGroup.submissionState?.():null;if(o&&!o.ready){i.disabled=!0,i.textContent=n.tf("picker.completeAllPerformances","Complete all performances ({complete}/{total})").replace("{complete}",String(o.complete)).replace("{total}",String(o.total));return}let r=n.controller.getSelectionValidity(e);if(r&&!r.isValid){i.disabled=!0,i.textContent=br(r,(s,a)=>n.tf(s,a),!0);return}if(!e&&n.root?.dataset.layout==="narrow"&&gr(n.performanceGroup)&&!n.hold&&!n.bestAvailableSoldOut){i.disabled=!1,i.dataset.act="find",i.textContent=n.tf("picker.findBestSeats","Find best seats");return}i.disabled=e===0,i.textContent=n.hold?t?(0,Rs.t)("picker.secureMoreAndCheckout",{count:t}):n.tf("picker.continueToCheckout","Continue to checkout"):e?n.performanceGroup?(un(n.performanceGroup)?(0,Rs.t)("picker.season.holdSeatsForAllDates"):n.tf("picker.holdSeatsForAllPerformances","Hold seats for all {count} performances")).replace("{count}",String(n.performanceGroup.performanceCount)):n.tf("picker.holdSeatsAndCheckout","Hold seats & checkout"):n.tf("picker.selectSeats","Select seats")}function Cp(n,e){n.ctaPhase=e,n.syncCta()}async function Ap(n,e,t){n.setCtaPhase("checkout");try{await n.checkoutHandoff(e,t)}finally{n.ctaPhase==="checkout"&&!n.bookedShown&&n.setCtaPhase("idle")}}function Pp(n){return`@seatlayer/hold/v1/${encodeURIComponent(n.apiBase)}/${encodeURIComponent(n.opts.event)}`}function Mp(n){if(n.opts.initialHoldId)return n.opts.initialHoldId;if(n.opts.restoreHold===!1||typeof window>"u")return null;try{return window.sessionStorage.getItem(n.holdStorageKey())}catch{return null}}function Lp(n,e){if(!(n.opts.restoreHold===!1||typeof window>"u"))try{window.sessionStorage.setItem(n.holdStorageKey(),e.holdId)}catch{}}function Hp(n){if(!(typeof window>"u"))try{window.sessionStorage.removeItem(n.holdStorageKey())}catch{}}async function Rp(n,e,t=!1){try{let i=await n.controller.resumeHold(e);if(!i||n.destroyed)return null;let o={holdId:i.holdId,expiresAt:i.expiresAt,seats:i.seats,items:i.items};return n.hold=o,n.handedOff=!0,n.bookedShown=!1,n.ctaPhase="idle",n.startHoldTimer(o.expiresAt),n.rememberHold(o),n.syncTray(),n.emitHoldChange(),n.opts.onHoldRestored?.(o,o.seats??[],n.buildHandoff(o)),o}catch(i){let o=i?.status;if(o===404||o===409)n.forgetHold();else if(o===401&&i?.code==="buyer_access_invalid")n.forgetHold(),n.toast(n.tf("picker.savedSeatsNotRestored","Your earlier seats could not be restored. Please choose again."),"warning");else if(n.opts.onError?.(i),t)throw i;return null}}async function Ip(n){let e=n.rememberedHoldId();e&&await n.resumeHoldFromServer(e,!0)}function Op(n,e){n.stopHoldTimer(),n.holdExpiresAt=e,n.extendDismissed=!1,n.extendUsed=!1,n.hold&&n.rememberHold(n.hold);let t=n.els.hold;t.innerHTML=`<span class="sl-hold-dot" aria-hidden="true"></span><span>${n.tf("picker.held","Held")}</span><span class="sl-hold-time" data-ref="holdTime"></span>`;let i=t.querySelector('[data-ref="holdTime"]'),o=()=>{let r=Math.max(0,n.holdExpiresAt-Date.now());i&&(i.textContent=wl(r)),t.classList.add("on"),t.classList.toggle("is-expiring",r>0&&r<=Is),n.setExtendPrompt(r>0&&r<=Is,r),(r<=0||!n.controller.currentHold())&&n.stopHoldTimer()};n.holdTimer=setInterval(o,500),o()}function _p(n){n.holdTimer&&clearInterval(n.holdTimer),n.holdTimer=null,n.els.hold?.classList.remove("on","is-expiring"),n.setExtendPrompt(!1,0)}function Np(n,e,t){if(!n.extendEl)return;let i=e&&t>0&&n.root?.dataset.layout!=="narrow"&&!!n.api.extend&&!n.extendDismissed&&!n.extendUsed&&!!n.controller.currentHold()&&!n.bookedShown;n.extendEl.classList.toggle("on",i)}function Dp(n){if(!n.holdTimer)return;let e=Math.max(0,n.holdExpiresAt-Date.now());n.setExtendPrompt(e>0&&e<=Is,e)}async function Bp(n){let e=n.els.extendBtn,t=n.controller.currentHold();if(!(!t||!n.api.extend||n.extendUsed)){e.disabled=!0,e.textContent=n.tf("picker.addingEllipsis","Adding\u2026");try{let i=await n.api.extend(n.controller.key,t.holdId,yp);if(n.controller.currentHold()?.holdId!==t.holdId)return;n.controller.setHold({holdId:t.holdId,labels:t.labels,expiresAt:i.expiresAt,items:t.items});let o=n.controller.currentHold();if(!o)return;n.hold={holdId:o.holdId,expiresAt:o.expiresAt,seats:o.seats,items:o.items},n.holdExpiresAt=o.expiresAt,n.extendUsed=!0,n.extendEl?.classList.remove("on"),n.rememberHold(n.hold),n.emitHoldChange(),n.toast(n.tf("picker.moreTimeAdded","More time added. Your seats are still held."),"success")}catch(i){if(i?.reason==="extend_limit"){n.extendUsed=!0,n.setExtendPrompt(!1,0);return}n.opts.onError?.(i),n.toast(n.tf("picker.couldNotAddMoreTime","Couldn't add more time. Please head to checkout now."),"warning")}finally{e.disabled=!1,e.textContent=wp(n)}}}function Lg(n){let e=n;return e?.status===404?"ended":e?.status!==409||e.code!=="hold_not_active"?"unknown":e.reason==="booked"?"booked":"ended"}async function Fp(n,e){try{return await n(e),!1}catch(t){return Lg(t)==="booked"}}var ti=require("@seatlayer/core");function Vp(n){return n?.previousPrice!=null&&n.previousPrice>n.price?n.previousPrice:null}function $p(n){return Hg(n)+(n.moreLabel?`<button type="button" class="sl-price-more" aria-expanded="${!n.collapsed}">${n.esc(n.moreLabel)}</button>`:"")+Rg(n.status)}function Hg(n){let{esc:e,money:t}=n;return n.categories.map(i=>{let o=n.priceOf(i),r=n.rangeOf(i),s=n.offerOf(i.key),a=Vp(s),l=n.activeKey===i.key;return`<div class="sl-price-row${n.bandKeys!=null&&!n.bandKeys.has(i.key)?" sl-dim":""}${l?" sl-active":""}" data-cat="${e(i.key)}" role="button" tabindex="0" aria-pressed="${l}" title="${e(n.titleFor(i,l))}"><span class="sl-dot" style="--sl-cat-dot:${e(n.colorOf(i))}"></span><span class="sl-price-label"><span class="sl-price-name">${e(i.label)}</span>`+(s?.offerName?fo(s.offerName,e):"")+"</span>"+(a!=null?`<span class="sl-price-was">${e(t(a))}</span>`:"")+(r!=null?`<span class="sl-price-amt">${r.min===r.max?e(t(r.min)):`${e(t(r.min))}\u2013${e(t(r.max))}`}</span>`:o!=null?`<span class="sl-price-amt">${e(t(o))}</span>`:"")+"</div>"}).join("")}function Rg(n){let e=t=>t.replace(/[&<>"']/g,i=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[i]);return`<div class="sl-status-key" aria-label="${e(n.legend)}"><span class="sl-status-item"><i class="sl-status-icon unavailable" aria-hidden="true"></i>${e(n.unavailable)}</span>`+(n.partial?`<span class="sl-status-item"><i class="sl-status-icon partial" aria-hidden="true"></i>${e(n.partial)}</span>`:"")+"</div>"}function Os(n){let e=Math.abs(n.scrollLeft),t=e>2,i=e+n.clientWidth<n.scrollWidth-2;return n.dataset.fadeStart=String(t),n.dataset.fadeEnd=String(i),{start:t,end:i}}function zp(n){let{esc:e,money:t}=n;return`<button type="button" class="sl-rc sl-rc-all" data-rail-all aria-pressed="${n.allActive}" title="${e(n.allWord)}"><span class="sl-rc-t">${e(n.allWord)}</span></button>`+n.categories.map(o=>{let r=n.rangeOf(o),s=n.priceOf(o),a=r?r.min===r.max?t(r.min):`${t(r.min)}+`:s!=null?t(s):null,l=Object.prototype.hasOwnProperty.call(n.left,o.key)&&n.left[o.key]<=0,c=Vp(n.offerOf(o.key)),d=a?`${o.label}: ${a}${l?` (${n.soldOutWord})`:""}`:o.label;return`<button type="button" class="sl-rc" data-cat="${e(o.key)}" aria-pressed="${n.activeKey===o.key}" aria-label="${e(d)}" title="${e(d)}"${l?" disabled":""}><i class="sl-rc-dot" style="--sl-cat-dot:${e(n.colorOf(o))}"></i>`+(c!=null?`<span class="sl-rc-was">${e(t(c))}</span>`:"")+`<span class="sl-rc-t">${e(a??o.label)}</span></button>`}).join("")}function jp(n,e){let t=n.map(a=>({key:a.key,range:e.rangeOf(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?e.money(a.min):`${e.money(a.min)}\u2013${e.money(a.max)}`,keys:t.filter(l=>l.range.min===a.min&&l.range.max===a.max).map(l=>l.key),min:a.min,max:a.max}));let o=[...t].sort((a,l)=>a.range.min-l.range.min||a.range.max-l.range.max),r=Math.ceil(o.length/4),s=[];for(let a=0;a<o.length;a+=r){let l=o.slice(a,a+r),c=Math.min(...l.map(p=>p.range.min)),d=Math.max(...l.map(p=>p.range.max));s.push({id:`b${a}`,label:c===d?e.money(c):`${e.money(c)}\u2013${e.money(d)}`,keys:l.map(p=>p.key),min:c,max:d})}return s}function Kp(n){if(n.els.pricesSec?.querySelectorAll(".sl-price-select").forEach(o=>o.remove()),n.priceSelect=null,n.suppressPricing||!n.els.prices||!n.els.pricesSec)return;let e=jp((n.controller.doc?.categories??[]).filter(o=>!o.notForSale),n.legendDeps());if(e.length<2)return;let t=document.createElement("select");t.className="sl-price-select",t.setAttribute("aria-label",n.tf("picker.filterAndFocusByPrice","Filter and focus seats by price"));let i=document.createElement("option");i.value="all",i.textContent=n.tf("picker.allPrices","All prices"),t.appendChild(i);for(let o of e){let r=document.createElement("option");r.value=o.id,r.textContent=o.label,t.appendChild(r)}n.els.pricesSec.appendChild(t),n.priceSelect=t,t.addEventListener("change",()=>{n.applyPriceBand(e.find(o=>o.id===t.value)?.keys??null)})}function Gp(n,e){if(n.focusedCatKey=null,n.priceBandKeys=e?new Set(e):null,n.priceSelect){let t=e?n.priceSelect.value:"all";n.priceSelect.value!==t&&(n.priceSelect.value=t)}n.controller.setCategoryFilter(e),n.controller.focusCategoryFilter(e),n.pushAvailabilityTo3d(),n.syncFloors(),n.syncRung(),n.minimap?.refreshMinimap(),n.syncPrices(),n.lastSection&&n.showSectionCard(n.lastSection)}function Up(n){return{colorOf:e=>n.controller.getRenderer()?.categoryDisplayColor?.(e.key)??e.color,rangeOf:e=>n.catPriceRange(e),priceOf:e=>n.catPrice(e),offerOf:e=>n.offerPrice(e),money:e=>e?n.money(e):n.tf("checkout.free","Free"),esc:Y}}function qp(n,e,t,i=n.legendDeps()){let o=n.els.railScroll,r=e.length>1;if(n.els.rail?.classList.toggle("has",r),!o)return;o.innerHTML=r?zp({...i,categories:e,left:t,activeKey:n.focusedCatKey,soldOutWord:(0,ti.t)("picker.soldOut"),allWord:n.tf("picker.allPrices","All prices"),allActive:!n.focusedCatKey&&!n.priceBandKeys}):"";let s=e.map(a=>a.key).join("|");n.lastRailSignature!==s&&(n.lastRailSignature=s,o.scrollLeft=0),o.querySelectorAll(".sl-rc").forEach(a=>{a.addEventListener("click",()=>{if(a.hasAttribute("data-rail-all")){n.applyPriceBand(null);return}n.focusCategory(a.dataset.cat??"")})}),n.railEdgesBound||(n.railEdgesBound=!0,o.addEventListener("scroll",()=>Os(o),{passive:!0})),requestAnimationFrame(()=>Os(o))}function Wp(n){let e=n.controller.doc;if(!e||!n.els.prices)return;let t=n.controller.categoryAvailability(),i=e.categories.filter(p=>!p.notForSale);n.syncSoldout(i,t);let o=n.legendDeps(),r=n.suppressPricing,s=r?{...o,priceOf:()=>{},rangeOf:()=>{},offerOf:()=>null}:o;r&&(n.els.pricesSec?.querySelector("span")?.replaceChildren((0,ti.t)("picker.seatCategories")),n.els.pricesInfo?.remove()),n.syncPriceRail(i,t,s);let a=5,l=i.length-a,c=l>1&&!n.pricesExpanded,d=c?i.slice(0,a):i;n.els.prices.classList.toggle("sl-expanded",l>1&&n.pricesExpanded),n.els.prices.innerHTML=$p({...s,categories:d,left:t,collapsed:c,activeKey:n.focusedCatKey,bandKeys:n.priceBandKeys,titleFor:(p,m)=>m?n.tf("picker.showAllSeats","Show all seats"):(0,ti.t)("picker.showLabelSeatsOnMap",{label:p.label}),moreLabel:l>1?c?r?(0,ti.t)("picker.showAllCategories"):(0,ti.t)("picker.showAllTicketTypes",{count:i.length}):n.tf("picker.showFewer","Show fewer"):null,status:{legend:n.tf("picker.seatStatusLegend","Seat status legend"),unavailable:n.tf("picker.group.legendUnavailable","Unavailable"),partial:n.partialLegend()}}),n.els.prices.querySelectorAll(".sl-price-row").forEach(p=>{p.addEventListener("mouseenter",()=>n.controller.getRenderer()?.setCategoryHighlight?.(p.dataset.cat??null)),p.addEventListener("mouseleave",()=>n.controller.getRenderer()?.setCategoryHighlight?.(null));let m=()=>n.focusCategory(p.dataset.cat??"");p.addEventListener("click",m),p.addEventListener("keydown",u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),m())})}),n.els.prices.querySelector(".sl-price-more")?.addEventListener("click",()=>{n.pricesExpanded=!n.pricesExpanded,n.syncPrices()})}function Yp(n,e){if(!e)return;let t=n.focusedCatKey===e?null:e;n.focusedCatKey=t,n.priceBandKeys=t?new Set([t]):null;let i=n.els.pricesSec?.querySelector(".sl-price-select");i&&(i.value="all"),n.controller.setCategoryFilter(t?[t]:null),n.controller.focusCategoryFilter(t?[t]:null),n.pushAvailabilityTo3d(),n.syncFloors(),n.syncRung(),n.minimap?.refreshMinimap(),n.syncPrices(),n.lastSection&&n.showSectionCard(n.lastSection)}var ni=require("@seatlayer/core");function Xe(n,e,t){let i=(0,ni.t)(n,t);return i&&i!==n?i:t?e.replace(/\{(\w+)\}/g,(o,r)=>r in t?String(t[r]):o):e}function Og(n){let e=(0,ni.tCount)("picker.seatCount",n);return e.includes("picker.seatCount")?`${n} ${n===1?"seat":"seats"}`:e}function _g(n){try{let e=Intl.ListFormat;if(e)return new e(void 0,{style:"long",type:"conjunction"}).format(n)}catch{}return n.join(", ")}function Ng(n){if(n.length<2)return!1;let e=[...n].sort((t,i)=>t-i);return new Set(e).size!==e.length?!1:e[e.length-1]-e[0]===e.length-1}function Dg(n){let e=n.filter(o=>o.objectType==="ga"),t=n.filter(o=>o.objectType!=="ga"),i=[];if(t.length){let o=Og(t.length),r=[...new Set(t.map(l=>l.sectionLabel).filter(Boolean))],s=[...new Set(t.map(l=>l.rowLabel).filter(Boolean))],a=t.map(l=>Number(l.seatNumber)).filter(l=>Number.isFinite(l));if(r.length===1&&s.length===1&&a.length===t.length){let l=t.length===1?Xe("picker.releasedSeatPlace","Section {section}, Row {row}, Seat {seat}",{section:r[0],row:s[0],seat:String(t[0].seatNumber??"")}):Ng(a)?Xe("picker.releasedSeatRange","Section {section}, Row {row}, Seats {from}\u2013{to}",{section:r[0],row:s[0],from:Math.min(...a),to:Math.max(...a)}):"";i.push(l?Xe("picker.releasedPair","{first} \xB7 {second}",{first:o,second:l}):Xe("picker.releasedInSection","{seats} in Section {section}",{seats:o,section:r[0]}))}else r.length===1?i.push(Xe("picker.releasedInSection","{seats} in Section {section}",{seats:o,section:r[0]})):r.length>1?i.push(Xe("picker.releasedInSections","{seats} in Sections {sections}",{seats:o,sections:_g(r)})):i.push(o)}for(let o of e)i.push(Xe("picker.releasedGa","{quantity} \xD7 {area}",{quantity:o.quantity??1,area:o.label}));return i.length?i.reduce((o,r)=>Xe("picker.releasedPair","{first} \xB7 {second}",{first:o,second:r})):""}function Xp(n){if(!n)return[];let e=new Map((n.seats??[]).map(o=>[o.label,o])),t=n.items??[];return(t.length?t.map(o=>({label:o.label,objectType:o.objectType,quantity:o.quantity})):[...e.keys()].map(o=>({label:o}))).map(o=>{let r=e.get(o.label);return{label:o.label,...o.objectType?{objectType:o.objectType}:{},...o.quantity==null?{}:{quantity:o.quantity},...r?.sectionLabel?{sectionLabel:r.sectionLabel}:{},...r?.rowLabel?{rowLabel:ve(r)??r.rowLabel}:{},...r?.seatNumber?{seatNumber:r.seatNumber}:{}}})}function Zp(n,e){if(!n.reducedMotion)for(let t of e.slice(0,10)){if(t.objectType==="ga")continue;let i=n.seatByLabel(t.label);!i||n.statusOf(i.id)!=="free"||n.flash(i.id,n.accent)}}function Qp(n,e){if(!e.recoverable.length||!n.isConnected)return;let t=n.querySelector(".sl-hold-expired-next");t&&(e.taken.length?t.textContent=e.taken.slice(0,3).map(s=>(0,ni.t)("picker.seatJustTakenByAnother",{label:s})).join(" "):t.remove());let i=n.querySelector(".sl-interrupt-actions"),o=i?.querySelector(".sl-interrupt-act");if(!i||!o)return;o.classList.add("sl-interrupt-act-secondary");let r=document.createElement("button");r.type="button",r.className="sl-interrupt-act sl-hold-expired-recover",r.textContent=(0,ni.tCount)("picker.holdLapsedSelectAgain",e.recoverable.length),r.addEventListener("click",()=>e.onRecover([...e.recoverable])),i.insertBefore(r,o),n.classList.add("has-recovery"),r.focus()}function Jp(n,e=[]){let t=document.createElement("div");t.className="sl-interrupt sl-hold-expired sl-mo-scrim",t.setAttribute("role","alertdialog"),t.setAttribute("aria-modal","true");let i=document.createElement("div");i.className="sl-interrupt-card sl-mo-in";let o=document.createElement("div");o.className="sl-interrupt-title",o.id="sl-hold-expired-title";let r=document.createElement("span");r.className="sl-interrupt-glyph",r.setAttribute("aria-hidden","true"),r.textContent="\u23F1";let s=document.createElement("span");s.textContent=Xe("picker.holdExpiredTitle","Your seats were released"),o.append(r,s);let a=document.createElement("div");a.className="sl-interrupt-body",a.id="sl-hold-expired-body",a.textContent=Xe("picker.holdExpiredBody","Your hold time ran out and the seats went back on sale."),i.append(o,a);let l=Dg(e);if(l){let m=document.createElement("div");m.className="sl-interrupt-body sl-interrupt-fact sl-hold-expired-seats",m.textContent=l,i.appendChild(m)}let c=document.createElement("div");c.className="sl-interrupt-body sl-hold-expired-next",c.textContent=Xe("picker.holdExpiredPickAgain","Pick your seats again to continue. They may already be taken."),i.appendChild(c),t.setAttribute("aria-labelledby",o.id),t.setAttribute("aria-describedby",a.id);let d=document.createElement("div");d.className="sl-interrupt-actions";let p=document.createElement("button");return p.type="button",p.className="sl-interrupt-act sl-hold-expired-restart",p.textContent=Xe("picker.holdExpiredRestart","Choose seats again"),p.addEventListener("click",()=>n.restart()),d.appendChild(p),i.appendChild(d),t.appendChild(i),t.addEventListener("pointerdown",m=>{m.target===t&&n.restart()}),t}var xt=require("@seatlayer/core");var eh={wheelchair:"Wheelchair space",companion:"Companion seat","semi-ambulatory":"Limited mobility","designated-aisle":"Aisle / transfer","step-free":"Step-free",hearing:"Assistive listening",cart:"Live captions","sign-language":"Sign language","low-vision":"Low vision","sensory-friendly":"Sensory-friendly","plus-size":"Plus-size","lift-armrest":"Lift-up armrest"},Bg='<svg viewBox="0 0 20 20" width="17" height="17" fill="none" stroke="currentColor" stroke-width="1.45" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><circle cx="10" cy="10" r="7.5" /><path d="M10 2.5a7.5 7.5 0 0 1 0 15Z" fill="currentColor" stroke="none" /></svg>',Fg='<svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="13" cy="4.4" r="1.9"/><path d="M11 8.2v5.1h5.1"/><path d="M16.6 13.3l1.9 6.3"/><path d="M15.4 14.9a5.6 5.6 0 1 1-5.9-3.4"/></svg>',Vg=8,$g=8,zg=88;function jg(n){let e=n.gap??Vg,t=n.margin??$g,i=n.min??zg,o=Math.max(n.boundsTop,0);return Math.max(Math.round(n.buttonTop-o-e-t),i)}var yr=class{constructor(e,t){this.active=new Set;this.deps=t,this.root=document.createElement("div"),this.root.className="sl-a11y",this.button=document.createElement("button"),this.button.type="button",this.button.className="sl-a11ybtn",this.button.setAttribute("aria-haspopup","true"),this.button.setAttribute("aria-expanded","false");let o=this.offered().length>0?t.tf("picker.accessibilityOptions","Accessibility and colour options"):t.tf("picker.displayOptions","Display options");this.button.setAttribute("aria-label",o),this.button.innerHTML=Fg,this.menu=document.createElement("div"),this.menu.className="sl-a11ymenu",this.menu.hidden=!0;for(let r of this.stored())this.offeredFree().has(r)&&this.active.add(r);if(this.menu.innerHTML=yl(o,t.tf("picker.close","Close"))+vl(this.rows()),this.root.append(this.menu,this.button),e.prepend(this.root),this.button.addEventListener("pointerdown",r=>r.stopPropagation()),this.button.addEventListener("click",r=>{r.stopPropagation(),this.open(this.menu.hidden)}),this.menu.querySelector("[data-a11y-close]")?.addEventListener("click",r=>{r.stopPropagation(),this.open(!1),this.button.focus({preventScroll:!0})}),this.menu.addEventListener("pointerdown",r=>r.stopPropagation()),this.menu.addEventListener("click",r=>r.stopPropagation()),this.menu.addEventListener("focusin",r=>{let s=r.target;s&&typeof s.scrollIntoView=="function"&&s.scrollIntoView({block:"nearest"})}),this.dismiss=()=>this.open(!1),this.escape=r=>{r.key==="Escape"&&this.open(!1)},this.reflow=()=>{this.menu.hidden||this.fit()},document.addEventListener("pointerdown",this.dismiss),document.addEventListener("keydown",this.escape),window.addEventListener("resize",this.reflow),this.promoteCounts(),this.wire(),this.active.size){this.applyFilter({focus:!1});let r=()=>this.deps.focusSeatsForFilter();typeof requestAnimationFrame=="function"?requestAnimationFrame(r):r()}}colorblindRow(){return this.menu.querySelector(".sl-cbbtn")}syncCounts(){let e=new Map(this.offered().map(({key:i,count:o})=>[i,o])),t=!1;for(let i of this.menu.querySelectorAll("[data-a11y-row]")){let o=i.dataset.a11yRow??"";if(!o.startsWith("a11y:"))continue;let r=o.slice(5),s=e.get(r);if(s===void 0)continue;let a=this.countNode(i),l=s==null?"":this.countText(s);a&&(a.textContent=l);let c=s===0;a instanceof HTMLButtonElement&&(a.disabled=c,a.setAttribute("aria-label",this.jumpLabel(r,l))),i.disabled=c,c?i.setAttribute("aria-disabled","true"):i.removeAttribute("aria-disabled"),c&&this.active.delete(r)&&(this.paint(i,!1),t=!0)}t&&this.applyFilter()}syncAccessibilityFilter(e){this.active.clear();for(let t of e??[])this.active.add(t);this.remember(e&&e.length?e:null);for(let t of this.menu.querySelectorAll("[data-a11y-row]")){let i=t.dataset.a11yRow??"";i.startsWith("a11y:")&&this.paint(t,this.active.has(i.slice(5)))}}refit(){this.menu.hidden||this.fit()}destroy(){document.removeEventListener("pointerdown",this.dismiss),document.removeEventListener("keydown",this.escape),window.removeEventListener("resize",this.reflow),this.root.remove()}fit(){this.menu.style.setProperty("--sl-a11ymenu-max",`${jg({boundsTop:this.boundsTop(),buttonTop:this.button.getBoundingClientRect().top})}px`)}boundsTop(){let e=this.root.closest(".sl-map")??this.root.closest(".sl-picker");return e instanceof HTMLElement?e.getBoundingClientRect().top:0}open(e){if(e===!this.menu.hidden)return;if(this.button.setAttribute("aria-expanded",String(e)),!e){this.menu.hidden=!0,this.menu.classList.remove("sl-mo-in","sl-mo-stagger");return}this.menu.hidden=!1,this.fit(),this.menu.scrollTop=0;let t=this.button.getBoundingClientRect();es(this.menu,{x:t.left+t.width/2,y:t.top}),Kl(this.menu),jl(this.menu)}rows(){return[...this.filterRows(),...this.deps.hasLimitedView?[{key:"limited",iconHtml:(0,xt.seatTypeIconSvg)("restrictedView",{size:17}),label:this.deps.tf("picker.hideLimitedView","Hide limited-view seats"),on:this.deps.isLimitedViewHidden()}]:[],{key:"colorblind",iconHtml:Bg,className:"sl-cbbtn",label:this.deps.tf("picker.colorblindColors","Colourblind-friendly colours"),on:this.deps.isColorblindSafe()}]}offered(){let e=this.deps.needs?.();if(e)return e.map(({key:i,count:o})=>({key:i,count:o}));let t=this.deps.present;return t?xt.ACCESSIBILITY_TYPES.filter(({key:i})=>t.has(i)).map(({key:i})=>({key:i,count:null})):[]}offeredKeys(){return new Set(this.offered().map(({key:e})=>e))}offeredFree(){return new Set(this.offered().filter(({count:e})=>e!==0).map(({key:e})=>e))}filterRows(){let e=this.offeredKeys(),t=new Map(xt.ACCESSIBILITY_TYPES.map(i=>[i.key,i]));return this.offered().flatMap(({key:i,count:o})=>{let r=t.get(i);return r?[{key:`a11y:${i}`,iconHtml:(0,xt.seatTypeIconSvg)(i,{size:17}),label:this.deps.tf(`picker.accessShort.${i}`,eh[i]??r.label),...i==="wheelchair"&&e.has("companion")?{note:this.deps.tf("picker.companionSeatsNote","Companion places beside them stay selectable")}:{},...o==null?{}:{count:this.countText(o),disabled:o===0},on:this.active.has(i)}]:[]})}wire(){for(let e of this.menu.querySelectorAll("[data-sl-info]"))e.addEventListener("click",()=>{let t=e.closest(".sl-info"),i=!t?.classList.contains("open");for(let o of this.menu.querySelectorAll(".sl-info.open"))o.classList.remove("open"),o.querySelector("[data-sl-info]")?.setAttribute("aria-expanded","false");t?.classList.toggle("open",i),e.setAttribute("aria-expanded",String(i))});for(let e of this.menu.querySelectorAll("[data-a11y-row]"))e.addEventListener("click",()=>{let t=e.dataset.a11yRow??"";if(t==="colorblind"){let r=!this.deps.isColorblindSafe();this.deps.setColorblindSafe(r),this.paint(e,r);return}if(t==="limited"){let r=!this.deps.isLimitedViewHidden();this.deps.setLimitedViewHidden(r),r&&this.deps.focusSeatsForFilter(),this.paint(e,r);return}let i=t.slice(5),o=!this.active.has(i);o?this.active.add(i):this.active.delete(i),this.paint(e,o),this.applyFilter()})}promoteCounts(){if(this.deps.stepToAccessibleSection)for(let e of this.menu.querySelectorAll('[data-a11y-row^="a11y:"]')){let t=e.querySelector(".sl-a11yrow-c");if(!t)continue;let i=(e.dataset.a11yRow??"").slice(5),o=e.parentElement;o?.classList.contains("sl-a11yrow-w")||(o=document.createElement("div"),o.className="sl-a11yrow-w",e.replaceWith(o),o.appendChild(e));let r=document.createElement("button");r.type="button",r.className="sl-a11yrow-c sl-a11yjump",r.dataset.a11yJump=i,r.textContent=t.textContent,r.disabled=e.disabled,r.setAttribute("aria-label",this.jumpLabel(i,t.textContent??"")),t.remove(),e.setAttribute("aria-label",this.rowLabel(i,r.textContent??""));let s=o.querySelector(".sl-info");s?s.after(r):e.after(r),o.dataset.a11yTapThrough||(o.dataset.a11yTapThrough="true",o.addEventListener("click",a=>{a.target===o&&!e.disabled&&e.click()})),r.addEventListener("click",a=>{a.stopPropagation(),this.active.has(i)||(this.active.add(i),this.paint(e,!0),this.applyFilter({focus:!1}));let l=this.deps.stepToAccessibleSection?.(i);l&&r.setAttribute("aria-label",this.jumpLabel(i,r.textContent??"",l.label))})}}countText(e){return e>0?(0,xt.t)("picker.accessFreeCount",{count:e}):"0"}countNode(e){return e.querySelector(".sl-a11yrow-c")??e.parentElement?.querySelector(".sl-a11yrow-c")??null}typeLabel(e){let t=eh[e]??xt.ACCESSIBILITY_TYPES.find(i=>i.key===e)?.label??e;return this.deps.tf(`picker.accessShort.${e}`,t)}jumpLabel(e,t,i){return[this.deps.tf("picker.jumpToSection","Jump to section"),this.typeLabel(e),t,...i?[`${this.deps.tf("picker.section","Section")} ${i}`]:[]].filter(Boolean).join(" \xB7 ")}rowLabel(e,t){return[this.typeLabel(e),t].filter(Boolean).join(" \xB7 ")}paint(e,t){e.classList.toggle("on",t),e.setAttribute("aria-checked",String(t)),e.setAttribute("aria-pressed",String(t))}applyFilter(e={}){let t=this.active.size?[...this.active]:null;this.deps.applyAccessibilityFilter(t),this.remember(t),t&&e.focus!==!1&&this.deps.focusSeatsForFilter()}key(){let e=this.deps.chart?.();return`seatmap.a11y.filter.${this.deps.event}${e?`.${e}`:""}`}stored(){try{let e=window.sessionStorage.getItem(this.key()),t=e?JSON.parse(e):null;return Array.isArray(t)?t:[]}catch{return[]}}remember(e){try{e&&e.length?window.sessionStorage.setItem(this.key(),JSON.stringify(e)):window.sessionStorage.removeItem(this.key())}catch{}}};var th=require("@seatlayer/core"),Kg=250;function nh(n,e=Kg){let t=null,i=()=>{t===null&&(t=setTimeout(()=>{t=null,n()},e))},o=(0,th.attachVisibilityCatchUp)(i),r=typeof window<"u"&&typeof window.addEventListener=="function";return r&&window.addEventListener("focus",i),()=>{t!==null&&(clearTimeout(t),t=null),o(),r&&window.removeEventListener("focus",i)}}var mn=require("@seatlayer/core");var vr=class{constructor(e){this.note=null;this.told=!1;this.deps=e}deferExpiryToast(e){this.told=!1,queueMicrotask(()=>{this.told||e()})}handle(e){if(!e.holdLapsed)return;this.told=!0;let t=(0,mn.holdRecoveryShape)(e),i=e.lapsedLabels.length,o=i-e.recoverable.length,r=t==="all"?(0,mn.tCount)("picker.holdLapsedStillFree",i):t==="partial"?(0,mn.tCount)("picker.holdLapsedSomeTaken",o):(0,mn.tCount)("picker.holdLapsedAllTaken",i);this.note={message:r,recoverable:t==="none"?[]:[...e.recoverable]},this.deps.toast(r,t==="none"?"error":"warning",t==="none"?void 0:{label:this.actionLabel(),onClick:()=>this.recover()}),this.deps.syncTray()}noteHtml(){if(!this.note)return"";let e=this.note.recoverable.length?`<button type="button" data-lapse-again>${Y(this.actionLabel())}</button>`:"";return`<div class="sl-lapse-note" role="status"><span>${Y(this.note.message)}</span>${e}</div>`}wire(e){e?.querySelector("[data-lapse-again]")?.addEventListener("click",()=>this.recover())}clear(){this.note&&(this.note=null,this.deps.syncTray())}actionLabel(){return(0,mn.tCount)("picker.holdLapsedSelectAgain",this.note?.recoverable.length??0)}recover(){let e=this.note?.recoverable??[];this.note=null,this.deps.syncTray(),e.length&&this.deps.reselect(e)}};var ih="@seatlayer/pending-checkout/v1";function Gg(n){return typeof n=="string"&&n.length<=160&&/^ord_[A-Za-z0-9_-]+$/.test(n)}function ii(n){if(typeof location>"u")return null;let e=new URLSearchParams(location.search),t=e.get("seatlayer_checkout");if(t!=="success"&&t!=="cancelled")return null;let i=null;try{let o=window.sessionStorage.getItem(ih);if(o){let r=null;try{r=JSON.parse(o)}catch{}if(r&&Gg(r.orderId)){let s=Date.now()-Number(r.storedAt);if(s>=0&&s<=144e5){if(r.eventKey&&r.eventKey!==n)return null;i=r.orderId}}}window.sessionStorage.removeItem(ih)}catch{}e.delete("seatlayer_checkout");try{let o=e.toString();history.replaceState(history.state,"",`${location.pathname}${o?`?${o}`:""}${location.hash}`)}catch{}return{outcome:t,orderId:i}}function oh(n){if(!n.framed)return null;let e=n.ancestorOrigins?.length?n.ancestorOrigins[0]:null;for(let t of[e,n.referrer])if(t)try{return new URL(t).origin}catch{}return null}var rh="https://api.seatlayer.io",Ug=10,qg=250,sh=6e4,ah=4,Wg=10,Yg=40,Xg=220,_s=["mini","peek","open"],lh="seatmap.a11y.cb";function Nt(n,e,t){return t?{ok:!1,reason:n,message:e,labels:t}:{ok:!1,reason:n,message:e}}function Zg(){try{if(typeof window>"u")return null;let n=window.localStorage.getItem(lh);return n==null?null:n==="1"}catch{return null}}function Qg(n){try{window.localStorage.setItem(lh,n?"1":"0")}catch{}}var kt=class n{constructor(e){this.renderErrorEmitted=!1;this.realtime=null;this.accessEl=null;this.idleClock=null;this.lastSelectionValidity=null;this.root=null;this.mapHost=null;this.rendered=!1;this.destroyed=!1;this.renderInfo=null;this.webMcp=null;this.localeGeneration=0;this.paintedLocale=null;this.els={};this.regions={};this.ro=null;this.viewportResizeHandler=null;this.holdTimer=null;this.loadAbort=null;this.transportAbort=new AbortController;this.toastTimer=null;this.offerReadInFlight=null;this.offerReadSettledAt=0;this.offerRefreshTimer=null;this.offerBoundaryTimer=null;this.offerCountdownTimer=null;this.offerVisibilityHandler=null;this.motionTimers=new Set;this.currency="USD";this.currencyResolved=!1;this.eventTimezone=null;this.eventWhenText=null;this.offerAvailability=null;this.channelByObject=new Map;this.pricesByChannel=new Map;this.hold=null;this.holdExpiresAt=0;this.handedOff=!1;this.bookedShown=!1;this.holdConflicted=!1;this.paymentOptions=null;this.checkoutPanel=null;this.extendEl=null;this.extendDismissed=!1;this.extendUsed=!1;this.bookedEl=null;this.holdExpiredEl=null;this.holdExpiredFresh=!1;this.holdExpiredUnits=[];this.gaQty=new Map;this.gaPromptEl=null;this.gaPromptReturnFocus=null;this.gaAreasExpanded=!1;this.lastMapPoint=null;this.tipEl=null;this.tipPos={x:0,y:0};this.tipPinned=!1;this.tipMarkedHoverLabel=null;this.lastPointerType="mouse";this.themeMode=null;this.colorSchemeStop=null;this.seatsRevealed=!1;this.seatsRevealedWaiters=[];this.seatsRevealedReport=null;this.renderResolvedAt=null;this.revealWaitMs=null;this.handoverMs=null;this.confirmCardCache=null;this.suppressConfirmationSeatId=null;this.tableDialogEl=null;this.tableDialog=null;this.tableDialogHeld=!1;this.tableDialogReturnFocus=null;this.srEl=null;this.baQty=2;this.baCat="";this.baZone="";this.baPremium=!1;this.bestAvailableConfirm=!1;this.baSoldOutSig="";this.bestAvailableSoldOut=!1;this.salesClosed=!1;this.salesState=null;this.salesInfo=null;this.salesUi=null;this.salesUiLoad=null;this.soldOut=!1;this.soldoutEl=null;this.cbSafe=!1;this.rungsEl=null;this.testBadgeEl=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 cr({overlay:()=>this.view3dEl,savedSeatIds:()=>this.view3dCompareSeatIds,openComparison:()=>this.openView3dComparison(),clearComparison:()=>this.clearView3dComparison(),toast:(e,t)=>this.toast(e,t)});this.view3dCompareEl=null;this.view3dCompareCleanup=null;this.view3dSeatViewChrome=null;this.view3dPassportEl=null;this.view3dPassportCleanup=null;this.floorsEl=null;this.arenaViewportInsets={top:0,right:0,bottom:0,left:0};this.viewEl=null;this.viewCleanup=null;this.seatViewGen=0;this.allSeatsCache=null;this.view3dBack=null;this.view3dNav=null;this.lastRailSignature="";this.priceSelect=null;this.minimap=null;this.pickerLayoutSize={width:0,height:0};this.fullscreenAffordanceSize={rootWidth:-1,rootHeight:-1,viewportWidth:-1,viewportHeight:-1};this.priceBandKeys=null;this.focusedCatKey=null;this.limitedViewFilter=!1;this.pricesExpanded=!1;this.sectionCardCache=null;this.lastTrayCount=0;this.langSel=null;this.lastTrayTotal=0;this.lastTrayKeys=new Set;this.bestAvailableBusy=!1;this.releasingLabels=new Set;this.holdingLabels=new Set;this.ctaPhase="idle";this.a11yMenu=null;this.detachAttention=null;this.lapse=new vr({toast:(e,t,i)=>this.toast(e,t,i),reselect:e=>{this.controller.select(e),this.handleCta()},syncTray:()=>this.syncTray()});this.railEdgesBound=!1;this.fsFallback=!1;this.fsChangeHandler=null;this.fsEscHandler=null;this.eventDetailsHidden=!1;this.sideCollapsed=!1;this.sideToggleEl=null;this.framedFs=!1;this.lastPostedHeight=0;this.cbEl=null;this.modalCleanup=null;this.escHandler=null;this.closeModal=null;this.markedSeatIds=new Set;this.fitScheduled=!1;this.perspectiveWarned=!1;if(!e||typeof e!="object")throw new Error("seatmap: options object is required");if(!e.event||typeof e.event!="string")throw new Error("seatmap: `event` key is required");if(!e.container)throw new Error("seatmap: `container` is required (or use SeatPicker.open())");this.performanceGroup=gp(e),this.suppressPricing=!!this.performanceGroup?.suppressPricing,this.opts={...e,confirmSelection:e.confirmSelection??!0},this.eventDetailsHidden=!!e.hideEventDetails,this.hostPricing=e.pricing,this.apiBase=(e.apiBase??rh).replace(/\/+$/,"");let t={onExpired:a=>{this.opts.onAccessExpired?.(a),a.refreshed||this.showAccessPanel({reason:"no_token",retryable:!1})},onUnavailable:a=>{this.opts.onAccessUnavailable?.(a),this.showAccessPanel(a)}},i=!e.transport&&e.publicKey&&!e.buyerAccessTokenProvider&&!e.buyerAccessToken?_o({base:this.apiBase,event:e.event,publicKey:e.publicKey,accessHooks:t,apiOptions:{referral:e.referral,onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)}}):null;this.access=e.transport?null:i?.access??zn(e,t),this.pubApi=e.transport?null:i?.api??new Pt(this.apiBase,{access:this.access??void 0,referral:e.referral,onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)}),this.api=Mc(e.transport??this.pubApi,this.transportAbort.signal),this.chartFetch=Ho(this.api),this.buyerAssetUrls=new Wn(e.event,this.api.asset?(a,l)=>this.api.asset(a,l):void 0),e.checkout==="hosted"&&!this.pubApi&&console.warn('seatlayer: checkout: "hosted" needs the widget\'s own transport \u2014 a custom `transport` owns its backend, so the picker is staying on onCheckout for this mount.'),this.checkoutMode=e.checkout==="hosted"&&this.pubApi?"hosted":"handoff";let o=e.numberOfPlacesToSelect;if(o!=null&&(!Number.isInteger(o)||o<1))throw new Error("seatmap: `numberOfPlacesToSelect` must be a positive integer");this.exactTickets=o??null;let r=bp(e.selectionValidators);if(this.exactTickets!=null&&r>this.exactTickets)throw new Error("seatmap: `minimumSelectedPlaces.minimum` cannot exceed `numberOfPlacesToSelect`");let s=Math.max(1,Math.floor(e.maxSelection??this.exactTickets??Math.max(Ug,r)));if(this.exactTickets!=null&&s<this.exactTickets)throw new Error("seatmap: `maxSelection` cannot be lower than `numberOfPlacesToSelect`");if(e.maxSelection!=null&&s<r)throw new Error("seatmap: `maxSelection` cannot be lower than `minimumSelectedPlaces.minimum`");this.maxTickets=this.exactTickets??s,this.cbSafe=Zg()??!!e.colorblindSafe,this.controller=this.wireController(e)}get confirmEl(){return this.confirmCard.element}set confirmEl(e){this.confirmCard.element=e}get confirmSeat(){return this.confirmCard.candidate}set confirmSeat(e){this.confirmCard.candidate=e}get lastSection(){return this.sectionCard.summary}set lastSection(e){this.sectionCard.adopt(e)}deliverableViewReference(e){return Yn(e)}isFramed(){return typeof window<"u"&&window.parent!==window}postToHost(e){if(!this.isFramed())return;let t=oh({framed:!0,ancestorOrigins:window.location.ancestorOrigins,referrer:document.referrer});if(t)try{window.parent.postMessage(e,t)}catch{}}measureFramedHeight(){let e=this.root;if(!e)return 0;let t=e.clientWidth||(typeof window<"u"?window.innerWidth:0)||0;if(t<=0)return 0;let 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()}fillsViewport(){let e=this.root;if(!e||typeof window>"u")return!1;let t=e.getBoundingClientRect();return t.height>=window.innerHeight-ah&&t.width>=window.innerWidth-ah}syncFullscreenAffordance(){let e=this.els.zfs;if(!e)return;let i=!(!!document.fullscreenElement||this.fsFallback||this.framedFs)&&this.root?.dataset.layout==="narrow"&&this.fillsViewport();e.hidden=i,e.tabIndex=i?-1:0,e.setAttribute("aria-hidden",String(i))}fullscreenMeasurementChanged(e,t){let i=typeof window>"u"?0:window.innerWidth,o=typeof window>"u"?0:window.innerHeight,r=e!==this.fullscreenAffordanceSize.rootWidth||t!==this.fullscreenAffordanceSize.rootHeight||i!==this.fullscreenAffordanceSize.viewportWidth||o!==this.fullscreenAffordanceSize.viewportHeight;return this.fullscreenAffordanceSize={rootWidth:e,rootHeight:t,viewportWidth:i,viewportHeight:o},r}syncFullscreenButtons(){let e=!!document.fullscreenElement||this.fsFallback||this.framedFs,t=this.eventDetailsHidden&&!e;this.root?.setAttribute("data-event-details-hidden",String(t)),this.root?.setAttribute("data-fs",String(e)),this.els.zfs?.setAttribute("aria-pressed",String(e)),this.els.zfs?.setAttribute("title",e?this.tf("picker.exitFullScreen","Exit full screen"):this.tf("picker.fullScreen","Full screen"));let 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)),this.syncFullscreenAffordance()}enterFsFallback(){this.isFramed()?this.setFramedFs(!0):this.setFsFallback(!0)}setFramedFs(e){this.framedFs!==e&&(this.framedFs=e,this.syncFullscreenButtons(),this.postToHost({type:"seatlayer:fullscreen",on:e,background:this.cssVar("--sl-bg")||void 0}),e&&!this.fsEscHandler?(this.fsEscHandler=t=>{t.key==="Escape"&&!document.fullscreenElement&&this.setFramedFs(!1)},window.addEventListener("keydown",this.fsEscHandler)):!e&&this.fsEscHandler&&(window.removeEventListener("keydown",this.fsEscHandler),this.fsEscHandler=null),requestAnimationFrame(()=>this.controller.refitCurrentView()))}setFsFallback(e){this.fsFallback!==e&&(this.fsFallback=e,this.root?.classList.toggle("sl-fs",e),this.syncFullscreenButtons(),e&&!this.fsEscHandler?(this.fsEscHandler=t=>{t.key==="Escape"&&!document.fullscreenElement&&this.setFsFallback(!1)},window.addEventListener("keydown",this.fsEscHandler)):!e&&this.fsEscHandler&&(window.removeEventListener("keydown",this.fsEscHandler),this.fsEscHandler=null),requestAnimationFrame(()=>this.controller.refitCurrentView()))}close(){this.closeModal?this.closeModal():this.destroy()}static async open(e){yt();let t=Jo(x("picker.seatSelection","Seat selection"),gt(void 0,e.theme)["--sl-bg"]),i;try{i=new n({...e,container:t.frame})}catch(s){throw t.teardown(!1),s}i.modalCleanup=()=>{i.modalCleanup=null,t.teardown()};let o=!1,r=()=>{if(o)return;o=!0,i.modalCleanup?.();let s=()=>{i.destroy(),e.onClose?.()};i.hold&&!i.handedOff&&e.holdOnClose!=="keep"?i.release().finally(s):s()};i.closeModal=r,t.onScrimPress(r),i.escHandler=t.trapKeys(s=>{i.tableDialog?(s.preventDefault(),i.cancelTableDialog()):i.confirmSeat?(s.preventDefault(),i.cancelConfirm()):i.bestAvailableConfirm?(s.preventDefault(),i.bestAvailableConfirm=!1,i.syncTray()):(s.preventDefault(),r())});try{let s=i.render();i.els.close?.classList.add("on"),i.els.close?.addEventListener("click",r),await s}catch(s){throw i.destroy(),s}return i.destroyed||t.focusFirst(),i}static prewarm(e){try{if(!e||typeof e!="object"||typeof e.event!="string"||!e.event||typeof e.publicKey!="string"||!e.publicKey)return;Vl({base:(e.apiBase??rh).replace(/\/+$/,""),event:e.event,publicKey:e.publicKey})}catch{}}wireController(e){return new H.PickerController({sectionPreview:!0,transport:this.chartFetch.transport,eventKey:e.event,maxSelection:this.maxTickets,selectedObjects:e.selectedObjects,selectableObjects:e.selectableObjects,unselectableAsUnavailable:e.unselectableAsUnavailable,numberOfPlacesToSelect:e.numberOfPlacesToSelect,selectionValidators:e.selectionValidators,currency:e.currency,categoryPriceRanges:()=>this.mapPriceRanges(),seatPriceLabel:t=>{let i=this.seatPriceRangeOf(t.label,t.categoryKey);return i?this.moneyRange(i):void 0},flashOnLiveChange:!0,colorblindSafe:this.cbSafe,...e.loadingReveal?{loadingReveal:e.loadingReveal}:{},mapTheme:Dn(e.theme),onSeatsRevealed:()=>{this.seatsRevealed=!0,this.drainSeatsRevealedWaiters(),this.revealWaitMs===null&&this.renderResolvedAt!==null&&(this.revealWaitMs=performance.now()-this.renderResolvedAt),e.onSeatsRevealed?.(),this.seatsRevealedReport?.()},onGAClick:t=>{let i=this.controller.getGAAreas().find(o=>o.id===t);i&&(this.collapseSheet(),ss(this,i,this.lastMapPoint))},onSelectionChange:()=>{this.syncTray(),this.minimap?.refreshMinimap(),this.committedSelection().length&&this.collapseSectionCard(),this.syncSelectionTo3d()},onStatusChange:(t=>{this.syncSeatMarks(),this.syncPrices(),this.a11yMenu?.syncCounts(),Dc(t)&&this.scheduleOfferRefresh(!0),this.evictTakenSelections(),this.detectBooked(),this.minimap?.refreshMinimap(),this.pushAvailabilityTo3d()}),onHoldExpired:()=>{let t=this.handedOff,i=this.holdConflicted;this.holdExpiredUnits=Xp(this.hold);let o=this.hold;this.hold=null,this.forgetHold(),this.handedOff=!1,this.bookedShown=!1,this.holdConflicted=!1,this.ctaPhase="idle",this.stopHoldTimer(),this.gaQty.clear();let r=this.api.resume,s=t&&!i&&o&&r?Fp(a=>r.call(this.api,this.opts.event,a),o.holdId):null;this.lapse.deferExpiryToast(()=>{if(t||i){let a=()=>this.toast((0,H.t)("picker.holdExpired",void 0)||"Your hold expired. Seats released. Pick again.","warning");if(!s){a();return}s.then(l=>{if(!(this.destroyed||this.hold)){if(!l){a();return}this.hold=o,this.showBooked()}});return}this.showHoldExpired()}),this.syncTray(),this.emitHoldChange(),s?s.then(a=>{a||this.opts.onHoldExpired?.()}):this.opts.onHoldExpired?.()},onAvailabilityRefresh:t=>this.lapse.handle(t),confirmSelection:this.opts.confirmSelection,onSelect:t=>{if(this.salesClosed){this.controller.deselect([t.id]),this.toast(this.closedWords().toast,"warning");return}this.controller.tableSelection(t.id)||(this.collapseSheet(),this.flashPickedSeat(t.id),this.opts.confirmSelection&&this.suppressConfirmationSeatId!==t.id&&this.showConfirm(t))},onTableSelectionRequest:t=>{if(this.salesClosed){this.controller.deselect(t.physicalSeatIds),this.toast(this.closedWords().toast,"warning");return}this.showTableDialog(t,!1)},onDeselect:t=>{if(this.controller.currentHold()?.labels.includes(t.label)){if(this.opts.confirmSelection===!1||this.salesClosed){this.removeHeldLabels([t.label]);return}if(this.confirmSeat?.id===t.id){this.dismissConfirm();return}this.showConfirm(t,"remove");return}if(this.confirmSeat?.id===t.id){this.dismissConfirm();return}if(this.tableDialog?.physicalSeatIds.includes(t.id)){this.dismissTableDialog();return}this.opts.confirmSelection===!1||this.salesClosed||this.controller.tableSelection(t.id)||(this.controller.select([t.id]),this.showConfirm(t,"remove"))},onSelectionLimit:()=>{this.toast((0,H.t)("picker.maxTicketsForOrder",{count:this.maxTickets}),"warning"),this.opts.onSelectionLimit?.(this.maxTickets)},onViewChange:()=>{this.reanchorConfirm(),this.syncRung(),this.syncProjection(),this.minimap?.drawMinimapRect(),this.sectionCardOnView()},onSectionFocus:t=>this.showSectionCard(t),onDeckTap:()=>{this.showSectionCard(null),this.syncFloors(),this.syncRung(),this.minimap?.refreshMinimap()},onFocusSeat:t=>this.announceSeat(t),onSeatHover:t=>this.updateTooltip(t),hostCardOpen:()=>this.tipPinned||!!this.confirmSeat,onHint:t=>{t&&this.toast(t)},onSalesClosed:()=>this.setSalesClosed(!0),onSalesNotice:t=>this.salesNotice(t),onError:t=>{this.renderErrorEmitted=!0,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,yt();let o=performance.now(),r=Ao(this.opts.locale,this.opts.messages),s=this.localeGeneration+=1;this.checkoutMode==="hosted"&&(this.paymentOptions=this.pubApi.paymentOptions(this.opts.event));let a=performance.now(),l=Za(this.opts.container),{root:c,els:d,mapHost:p}=Ol(l,(b,T)=>this.tf(b,T),this.opts.theme);this.root=c,this.els=d,this.mapHost=p,this.paintedLocale=(0,H.getLocale)(),this.opts.checkoutBar===!1&&(c.dataset.checkoutBar="off"),Po(c,r,b=>{t.loadLocale=i(o),this.destroyed||this.applyActiveLocale(b,s)}),_d(c,()=>[{open:()=>!!this.holdExpiredEl,close:()=>this.restartAfterHoldExpiry()},{open:()=>this.tipPinned,close:()=>this.unpinTooltip()},{open:()=>!!this.tableDialog,close:()=>this.cancelTableDialog()},{open:()=>!!this.confirmSeat,close:()=>this.cancelConfirm()},{open:()=>this.bestAvailableConfirm,close:()=>{this.bestAvailableConfirm=!1,this.syncTray()}}]);let m=this.performanceGroup?.modalClose;m&&(this.els.close?.classList.add("on"),this.els.close?.addEventListener("click",()=>m()));let u=this.performanceGroup?.subheader;u&&c.querySelector(".sl-head")?.after(u),this.syncFullscreenButtons(),this.wireBuyerShell(c);let f=document.createElement("div");return f.style.cssText="position:absolute;inset:0",this.mapHost.appendChild(f),t.mountBuyerShell=i(a),t.skeletonPaint=i(e),this.loadAndFinishChart(f,t,i,e,c)}async loadAndFinishChart(e,t,i,o,r){this.startRealtime(),this.startIdleClock(r);let s=await this.loadChart(e,t,i);if(!s)return this.realtime?.stop(),this.realtime=null,this;t.shellsPaint=i(o);let a=performance.now();if(this.salesClosed=!!s.salesClosed||!!this.opts.readOnly,this.salesState=s.salesState??null,this.salesInfo=s,r.dataset.eventMode=s.mode==="test"?"test":"live",!this.opts.locale&&s.locale&&this.setLocale(s.locale),this.controller.setViewMode(this.normalizeInitialView(this.opts.initialView)),this.buildRegions(),this.regions["bottom-right"].appendChild(this.els.zoom),this.regions["bottom-center"].appendChild(this.els.toast),s.mode==="test"){let v=document.createElement("div");v.className="sl-testbadge",this.testBadgeEl=v,this.syncTestBadge(),this.regions["top-left"].appendChild(v)}let l=this.controller.doc?.theme;this.themeMode=this.opts.theme?.mode??null,this.applyThemeTokens(r),this.watchThemeMode(),this.currency=s.currency??this.opts.currency??"USD",this.currencyResolved=!0,this.eventTimezone=s.timezone??null,co(this.els.logo,[this.opts.theme?.logoUrl,l?.logoUrl,this.performanceGroup?.brandLogoUrl,s.posterUrl],this.opts.theme?.brandName??l?.brandName??s.eventName??"?"),this.els.name.textContent=s.eventName??"";let c=s.startsAt?mo(s.startsAt,s.timezone??null,this.opts.locale):"";this.eventWhenText=c||null,this.els.meta.textContent=[s.venue,c].filter(Boolean).join(" \xB7 "),this.syncProjection();let d=!!this.controller.doc&&this.controller.getExpandedSeats().some(v=>v.commercial?.restrictedView||v.commercial?.obstructedView);this.buildAccessibilityMenu(d),this.buildLanguageSwitcher(this.els.zoom??this.regions["bottom-right"]),this.srEl=document.createElement("div"),this.srEl.className="sl-sr",this.srEl.setAttribute("aria-live","polite"),r.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(a);let p=performance.now();if(!await this.restoreHoldForFirstPaint(t))return this;if(t.restoreHold=i(p),this.destroyed)return this;this.dismissSkeleton(),this.salesClosed&&this.applySalesClosed(),this.syncOffer(),this.syncPrices(),this.syncTray(),this.resumeHostedOrder();let m=this.controller.doc,u=ro(this.opts.event),f=this.performanceGroup?.surface??(this.performanceGroup?"performance_group":null),b=f??"event",T={apiBase:this.apiBase,eventKey:this.opts.event,metricScope:b,surface:f==="season"?"season_picker":f==="performance_group"?"performance_group_picker":"seat_picker",ms:i(o),performanceProfile:t,seatCount:this.allSeats().length,objectCount:m?.objects.length??0,sectionCount:m?.objects.filter(v=>v.type==="section").length??0,floorCount:this.controller.getFloors().length,chartName:m?.name,view:this.buyerView,load:u,transport:this.opts.transport?"custom":"pubapi",revealWaitMs:this.revealWaitMs??this.sinceRenderResolved(),handoverMs:this.handoverMs??void 0};jd(T,(v,M)=>this.emitAnalytics(v,M));let E=s.performanceProfile;return this.seatsRevealedReport=()=>this.emitAnalytics("chart_seats_revealed",Ms({...T,performanceProfile:{...T.performanceProfile,...E}})),this.seatsRevealed&&this.seatsRevealedReport(),this.renderInfo=s,await this.registerAgentTools(),this}registerAgentTools(){return Vd(this)}webMcpHost(e){return Ps(this,e)}wireBuyerShell(e){this.refreshOfferAvailability(!1),this.api.availability&&(this.offerVisibilityHandler=()=>{!document.hidden&&!this.destroyed&&this.refreshOfferAvailability(!1)},document.addEventListener("visibilitychange",this.offerVisibilityHandler)),this.detachAttention=nh(()=>{this.destroyed||this.controller.refreshAvailability()}),this.observeLayout(e),this.els.zin.addEventListener("click",()=>this.controller.zoomIn()),this.els.zout.addEventListener("click",()=>this.controller.zoomOut()),this.els.zfit?.addEventListener("click",()=>this.controller.overview()),this.els.zfs.addEventListener("click",()=>this.toggleFullscreen()),this.fsChangeHandler=()=>{document.fullscreenElement||this.setFsFallback(!1),this.syncFullscreenButtons(),requestAnimationFrame(()=>this.controller.refitCurrentView())},document.addEventListener("fullscreenchange",this.fsChangeHandler);let t=this.els.sheetHead;if(t){let o=this.els.sheetToggle;this.syncSheetAffordance();let r=0,s=!1,a=!1,l=!1;o?.addEventListener("click",c=>{c.stopPropagation(),!s&&this.cycleSheet()}),t.addEventListener("pointerdown",c=>{if(c.target.closest?.(".sl-seccard")){a=!1;return}l=!!c.target.closest?.(".sl-sheet-toggle"),a=!0,s=!1,r=c.clientY,(l&&o?o:t).setPointerCapture?.(c.pointerId)}),t.addEventListener("pointermove",c=>{if(!a||s)return;let d=c.clientY-r;d<-18?(this.stepSheet(1),s=!0):d>18&&(this.stepSheet(-1),s=!0)}),t.addEventListener("pointerup",c=>{a&&!s&&!l&&Math.abs(c.clientY-r)<6&&this.cycleSheet(),a=!1,(l&&o?o:t).releasePointerCapture?.(c.pointerId),l=!1})}this.els.foot?.addEventListener("click",o=>{this.root?.dataset.layout==="narrow"&&(o.target.closest?.('.sl-chip,button,a,input,select,label,[role="button"]')||this.cycleSheet())});let i=()=>{if(this.root?.dataset.layout!=="narrow")return;let o=this.root.getAttribute("data-prices-open")==="true";this.root.setAttribute("data-prices-open",String(!o)),this.els.pricesSec?.setAttribute("aria-expanded",String(!o)),!o&&this.root.dataset.sheet!=="open"&&this.setSheetOpen(!0)};this.els.pricesSec?.addEventListener("click",o=>{o.target.closest("select,button")||i()}),this.els.pricesSec?.addEventListener("keydown",o=>{o.key!=="Enter"&&o.key!==" "||o.target.closest("select,button")||(o.preventDefault(),i())}),e.addEventListener("click",o=>{let r=o.target.closest("[data-sl-info]");if(!r||!e.contains(r))return;o.stopPropagation();let s=r.closest(".sl-info"),a=!s?.classList.contains("open");this.closeInfoPops(s),s?.classList.toggle("open",a),r.setAttribute("aria-expanded",String(a))}),e.addEventListener("pointerdown",o=>{o.target.closest(".sl-info")||this.closeInfoPops()}),this.tipEl=document.createElement("div"),this.tipEl.setAttribute("role","tooltip"),this.tipEl.className="sl-tip",this.els.map.appendChild(this.tipEl),this.els.map.addEventListener("pointerdown",o=>{this.handleMapPointerDown(o)},!0),this.els.map.addEventListener("mousemove",o=>{if(this.tipPinned)return;let r=this.els.map.getBoundingClientRect();this.tipPos={x:o.clientX-r.left,y:o.clientY-r.top},this.tipEl&&this.tipEl.style.display!=="none"&&this.placeTooltip()}),this.els.cta.addEventListener("click",()=>{this.els.cta.dataset.act==="find"?this.openBestSeatsForm():this.handleCta()})}sheetState(){let e=this.root?.dataset.sheet;return e==="mini"||e==="open"?e:"peek"}sheetHasCards(){return this.root?.getAttribute("data-has-selection")==="true"}setSheetState(e){let t=this.root;if(!t)return;let i=t.dataset.sheet;t.dataset.sheet=e==="mini"&&!this.sheetHasCards()?"peek":e,this.syncSheetAffordance(),i==="mini"&&t.dataset.sheet!=="mini"&&this.scheduleFit()}syncSheetAffordance(){let e=this.sheetState(),t=e==="open"||e==="peek"&&this.sheetHasCards(),i=this.els.sheetToggle;i?.setAttribute("aria-expanded",String(e==="open")),i?.setAttribute("aria-label",t?this.tf("picker.collapseTicketPanel","Collapse ticket panel"):this.tf("picker.openTicketPanel","Open ticket panel"))}cycleSheet(){let e=this.sheetState();e==="open"||e==="mini"?this.setSheetState("peek"):this.setSheetState(this.sheetHasCards()?"mini":"open")}stepSheet(e){let t=_s.indexOf(this.sheetState()),i=Math.min(_s.length-1,Math.max(0,t+e));this.setSheetState(_s[i])}setSheetOpen(e){this.setSheetState(e?"open":"peek")}openBestSeatsForm(){this.setSheetOpen(!0),this.els.tray?.querySelector(".sl-ba")?.scrollIntoView({block:"nearest",behavior:this.reducedMotion()?"auto":"smooth"}),this.els.tray?.querySelector(".sl-ba-go")?.focus()}collapseSheet(){let e=this.root;!e||e.dataset.layout!=="narrow"||e.dataset.sheet!=="open"||this.setSheetState("peek")}observeLayout(e){let t=()=>{let i=e.clientWidth;if(i<=0)return;let o=e.clientHeight,r=i!==this.pickerLayoutSize.width||o!==this.pickerLayoutSize.height;this.pickerLayoutSize={width:i,height:o};let s=this.fullscreenMeasurementChanged(i,o);this.reportFramedHeight();let a=i<640?"narrow":"wide",l=o<560?"compact":"comfortable",c=e.dataset.layout!==a||e.dataset.density!==l;c&&(e.dataset.layout=a,e.dataset.density=l,this.controller.setNarrowLayout?.(a==="narrow"),queueMicrotask(()=>this.syncFitClearance()),this.controller.getRenderer()?.setSectionFocusDim?.(a!=="narrow"),a==="narrow"&&!e.dataset.sheet&&(e.dataset.sheet="peek"),this.dockLayoutChrome(),this.syncMinimapForLayout(),this.lastTrayKeys.size&&this.syncTray(),this.syncMapStepBack(),this.refreshExtendPrompt()),(s||c)&&this.syncFullscreenAffordance(),this.syncArenaViewportInsets(),r&&(this.minimap?.refreshMinimap(),this.scheduleFit())};this.ro=new ResizeObserver(t),this.ro.observe(e),this.els.map&&this.ro.observe(this.els.map),this.viewportResizeHandler=()=>{this.fullscreenMeasurementChanged(e.clientWidth,e.clientHeight)&&this.syncFullscreenAffordance()},window.addEventListener("resize",this.viewportResizeHandler),t(),requestAnimationFrame(t)}async loadChart(e,t,i){let o=performance.now();this.seatsRevealed=!1,this.seatsRevealedWaiters=[],this.seatsRevealedReport=null,this.renderResolvedAt=null,this.revealWaitMs=null,this.handoverMs=null,this.loadAbort=new AbortController;let r=await Fn(async()=>{this.renderErrorEmitted=!1;let l=await this.controller.render(e);return this.renderResolvedAt=performance.now(),this.seatsRevealed&&(this.revealWaitMs=0),this.viewportLoading()&&this.drainSeatsRevealedWaiters(),l},this.loadAbort.signal,()=>{let l=this.els.boot.querySelector(".sl-boot-say");l&&(l.classList.add("is-visible"),l.textContent=(0,H.t)("picker.loadingTakingLonger"))});if(this.loadAbort=null,r.outcome==="cancelled"||this.destroyed)return null;let s=r.outcome==="loaded"?r.value:null,a=r.outcome==="loaded"&&!s&&!this.opts.transport?Ro(this.chartFetch?.outcome(),this.renderErrorEmitted):null;if(s||this.controller.destroy(),t.loadChartAndStatuses=i(o),this.destroyed)return null;if(!s){a&&Io({apiBase:this.apiBase,eventKey:this.opts.event,reason:a}),rt({apiBase:this.apiBase,event:this.opts.event,scope:this.performanceGroup?.surface??(this.performanceGroup?"performance_group":"event"),surface:this.performanceGroup?.surface==="season"?"season_picker":this.performanceGroup?"performance_group_picker":"seat_picker",outcome:"failure",stage:r.outcome==="timeout"?"load_timeout":r.outcome==="error"?"render_error":"load_chart",ms:t.loadChartAndStatuses,performanceProfile:t,view:"map",load:ht(this.opts.event),transport:this.opts.transport?"custom":"pubapi"});let l=this.opts.transport?void 0:this.chartFetch?.outcome();if(l?.state==="rejected"&&l.error?.status===404){let c=l.error;c.serverMessage&&console.warn(`[SeatLayer] ${c.serverMessage}`),this.opts.onError?.(c),Xn(this.els.boot,{title:["picker.eventUnavailableTitle","This event isn\u2019t available"],description:["picker.eventUnavailable","Tickets can\u2019t be booked here right now."]});for(let d of[this.els.side,this.els.rail])d&&(d.setAttribute("inert",""),d.style.display="none");return null}return Xn(this.els.boot,{title:["picker.mapDidNotLoad","The seat map didn\u2019t load"],description:["picker.checkConnection","Check your connection and try again."],action:["picker.accessRetry","Try again"]}),this.els.boot.querySelector("button").addEventListener("click",()=>{if(this.destroyed||!this.root)return;this.controller=this.wireController(this.opts),Xn(this.els.boot,{title:["picker.loadingSeatMap","Loading seat map\u2026"],busy:!0});let c=performance.now();this.loadAndFinishChart(e,{},i,c,this.root)},{once:!0}),null}return Object.assign(t,s.performanceProfile),s}sinceRenderResolved(){return this.renderResolvedAt===null?void 0:performance.now()-this.renderResolvedAt}whenSeatsRevealed(e){if(!this.destroyed){if(this.seatsRevealed||this.viewportLoading()&&this.renderResolvedAt!==null){e();return}this.seatsRevealedWaiters.push(()=>{this.destroyed||e()})}}viewportLoading(){return this.opts.loadingReveal==="viewport"}drainSeatsRevealedWaiters(){let e=this.seatsRevealedWaiters;this.seatsRevealedWaiters=[];for(let t of e)try{t()}catch{}}async restoreHoldForFirstPaint(e){let t=[this.els.side,this.els.rail].filter(Boolean),i=t.map(o=>o.hasAttribute("inert"));t.forEach(o=>o.setAttribute("inert",""));try{for(;!this.destroyed;){let o=performance.now();try{return await this.restoreRememberedHold(),!this.destroyed}catch{if(this.destroyed)return!1;rt({apiBase:this.apiBase,event:this.opts.event,reconnects:this.realtime?.reconnects??0,scope:this.performanceGroup?.surface??(this.performanceGroup?"performance_group":"event"),surface:this.performanceGroup?.surface==="season"?"season_picker":this.performanceGroup?"performance_group_picker":"seat_picker",outcome:"failure",stage:"restore_hold",ms:performance.now()-o,performanceProfile:e,view:"map",load:ht(this.opts.event),transport:this.opts.transport?"custom":"pubapi"});let s=Xn(this.els.boot,{title:["picker.restoreUnavailableTitle"],description:["picker.restoreUnavailable"],action:["picker.accessRetry","Try again"]}),a=this.transportAbort.signal;if(await new Promise(l=>{let c=()=>{s.removeEventListener("click",c),a.removeEventListener("abort",c),l()};s.addEventListener("click",c,{once:!0}),a.addEventListener("abort",c,{once:!0}),a.aborted&&c()}),this.destroyed||a.aborted)return!1;Xn(this.els.boot,{title:["picker.restoringSeats"],busy:!0})}}return!1}finally{t.forEach((o,r)=>{i[r]||o.removeAttribute("inert")})}}resumeHostedOrder(){if(this.checkoutMode!=="hosted")return;let e=ii(this.opts.event);e?.outcome!=="success"||!e.orderId||this.openCheckoutPanel({kind:"resume",orderId:e.orderId})}buildPanelToggle(){if(!this.regions["top-right"])return;let e=document.createElement("button");e.type="button",e.className="sl-side-toggle",e.addEventListener("click",()=>this.setPanelCollapsed(!this.sideCollapsed)),this.sideToggleEl=e,this.regions["top-right"].appendChild(e),this.syncPanelToggle()}syncPanelToggle(){let e=this.sideToggleEl;if(!e)return;let t=this.sideCollapsed;e.setAttribute("aria-expanded",String(!t)),e.setAttribute("aria-label",t?this.tf("picker.showTicketPanel","Show the ticket panel"):this.tf("picker.hideTicketPanel","Hide the ticket panel")),e.title=t?this.tf("picker.showTicketPanel","Show the ticket panel"):this.tf("picker.hideTicketPanel","Hide the ticket panel"),e.innerHTML=t?`<svg viewBox="0 0 24 24"><path d="M15 6l-6 6 6 6"/></svg><span>${this.tf("picker.tickets","Tickets")}</span>`:'<svg viewBox="0 0 24 24"><path d="M9 6l6 6-6 6"/></svg>'}setPanelCollapsed(e){this.destroyed||(this.sideCollapsed=e,this.applyPanelCollapsed(),this.scheduleMotion(()=>this.controller.refitCurrentView(),340))}applyPanelCollapsed(){let e=this.root?.dataset.layout!=="narrow";this.root?.setAttribute("data-side-collapsed",String(this.sideCollapsed)),this.els.side?.toggleAttribute("inert",this.sideCollapsed&&e),this.syncPanelToggle()}buildAccessibilityMenu(e){let t=this.els.zoom??this.regions["bottom-right"]??this.els.map;t&&(this.a11yMenu=new yr(t,{event:String(this.opts.event),chart:()=>this.controller.doc?.name??null,needs:()=>this.controller.getAccessNeeds(),hasLimitedView:e,tf:(i,o)=>this.tf(i,o),isColorblindSafe:()=>this.cbSafe,setColorblindSafe:i=>this.setColorblindSafe(i),isLimitedViewHidden:()=>this.limitedViewFilter,setLimitedViewHidden:i=>{this.limitedViewFilter=i,this.controller.setCommercialLimitedFilter(i),this.pushAvailabilityTo3d()},applyAccessibilityFilter:i=>this.applyAccessibilityFilter(i),focusSeatsForFilter:()=>this.whenSeatsRevealed(()=>this.focusSeatsForFilter()),stepToAccessibleSection:i=>this.controller.focusNextAccessibleSection?.([i])??null}),this.cbEl=this.a11yMenu.colorblindRow())}focusSeatsForFilter(){if(this.controller.focusAccessibilityFilter?.()){this.explainAccessibilitySpread();return}this.rungsEl&&this.controller.getRung()!=="seats"&&(this.controller.setRung("seats"),this.collapseSectionCard(),this.syncRung())}explainAccessibilitySpread(){let e=this.controller.accessibilitySpread?.();!e?.wholeVenue||e.sections.length<2||this.toast((0,H.t)("picker.accessSpreadHint",{count:e.spaces,sections:e.sections.length}),"neutral")}applyAccessibilityFilter(e){this.controller.setAccessibilityFilter(e),this.syncPrices(),this.minimap?.refreshMinimap(),this.pushAvailabilityTo3d()}setAccessibilityFilter(e){this.applyAccessibilityFilter(e),this.a11yMenu?.syncAccessibilityFilter(e),e?.length&&this.focusSeatsForFilter()}focusAccessibilityFilter(){this.focusSeatsForFilter()}dockLayoutChrome(){let e=this.root?.dataset.layout==="narrow";this.applyPanelCollapsed();let t=this.els.zfs,i=this.els.headInfo?.parentElement;t&&i&&t.parentElement!==i&&(t.classList.add("sl-fs-pill"),i.insertBefore(t,this.els.hold??null));let o=this.extendEl;if(o){let s=e?this.regions["bottom-center"]??this.els.map:i;s&&o.parentElement!==s&&(o.dataset.dock=e?"map":"head",s===i?s.insertBefore(o,this.els.close??null):s.appendChild(o))}let r=this.els.pricesSec;r&&(e?(r.setAttribute("role","button"),r.tabIndex=0,r.setAttribute("aria-expanded",String(this.root?.getAttribute("data-prices-open")==="true"))):(r.removeAttribute("role"),r.removeAttribute("aria-expanded"),r.tabIndex=-1)),this.lastSection&&this.renderSectionCard(this.lastSection)}buildExtendPrompt(){vp(this)}buildBookedOverlay(){let e=document.createElement("div");e.className="sl-booked",e.setAttribute("role","status"),e.setAttribute("aria-live","polite"),e.innerHTML=`<div class="sl-booked-badge"><svg viewBox="0 0 24 24"><path d="M20 6L9 17l-5-5"/></svg></div><div class="sl-booked-title">${this.tf("picker.allSetTitle","You're all set")}</div><div class="sl-booked-sub" data-ref="bookedSub"></div><ul class="sl-booked-list" data-ref="bookedList"></ul><button type="button" class="sl-booked-back" data-ref="bookedBack"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M15 18l-6-6 6-6"/></svg><span>${Y(this.tf("picker.backToMap","Back to map"))}</span></button>`,this.root.appendChild(e),this.bookedEl=e,this.els.bookedSub=e.querySelector('[data-ref="bookedSub"]'),this.els.bookedList=e.querySelector('[data-ref="bookedList"]'),e.querySelector('[data-ref="bookedBack"]')?.addEventListener("click",()=>this.dismissBooked())}get onGAPromptHook(){return this.opts.onGAPrompt}closedWords(){return this.salesUi?.words(this)??El(this.salesState,!!this.opts.readOnly)}finishingHold(){return!!this.salesUi?.finishing(this)}withSalesUi(){return this.salesUiLoad??=Qa().then(e=>(e.translate(H.t,H.tCount),this.salesUi=e,this.destroyed||this.applySalesClosed(),e),()=>null)}salesNotice(e){(this.salesUi||e.state!=="live")&&this.withSalesUi().then(t=>t?.applyNotice(this,e))}tf(e,t){return x(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(),i=document.createElement("div");i.className="sl-soldout-eyebrow",i.textContent=t;let o=document.createElement("div");o.className="sl-soldout-title",o.textContent=this.tf("picker.soldOutTitle","Sold out");let r=document.createElement("p");r.className="sl-soldout-copy",r.textContent=this.tf("picker.soldOutCopy","No reserved seats are currently available for this event."),e.append(i,o,r),this.els.map.appendChild(e),this.soldoutEl=e}syncSoldout(e,t){let i=this.controller.getGAAreas().length>0,o=this.isSoldOut(e,t,i),r=[...wo(e,t)].join("|");r!==this.baSoldOutSig&&(this.baSoldOutSig=r,this.syncTray()),o!==this.soldOut&&(this.soldOut=o,this.soldoutEl?.classList.toggle("on",o))}isSoldOut(e,t,i){return!i&&e.length>0&&e.every(o=>(t[o.key]??0)===0)}setSalesClosed(e){let t=e||!!this.opts.readOnly;this.salesClosed!==t&&(this.salesClosed=t,this.applySalesClosed())}applySalesClosed(){this.salesClosed&&this.tableDialog&&!this.tableDialogHeld&&this.cancelTableDialog(),this.salesClosed&&!this.salesUi&&this.withSalesUi();let e=this.els.closedPill;if(e){e.classList.toggle("on",this.salesClosed&&!this.salesUi?.view(this));let t=this.els.closedPillText??e;t.textContent=this.closedWords().pill}this.root?.setAttribute("data-sales-closed",String(this.salesClosed)),this.salesClosed&&this.srEl&&(this.srEl.textContent=this.closedWords().toast),this.syncCta(),this.syncTray()}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){let t=this.reducedMotion(),i=(e.items??[]).filter(o=>o.objectType!=="ga").slice(0,10).map(o=>this.controller.seatByLabel(o.label)).filter(o=>!!o);if(this.buyerView==="venue3d"&&this.view3dHandle){rp(this,i);return}yc({regions:this.els,categories:this.controller.doc?.categories,pop:o=>this.controller.flashSeat(o,this.cssVar("--sl-accent")||"#f4b740"),focus:(o,r)=>this.controller.focusSection(o,r),focusSeats:o=>this.controller.focusSeats?.(o,{animate:!t})===!0,reducedMotion:t,screenPoint:o=>this.controller.worldToScreen(o),schedule:(o,r)=>this.scheduleMotion(o,r)},i)}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(){return xp(this)}heldTicketCount(){return kp(this)}totalTicketCount(){return Sp(this)}updateSelectionCapacity(){Tp(this)}syncCta(e=this.lastTrayCount,t=this.pendingSelectionCount()){Ep(this,e,t)}setCtaPhase(e){Cp(this,e)}runCheckoutHandoff(e,t){return Ap(this,e,t)}holdStorageKey(){return Pp(this)}rememberedHoldId(){return Mp(this)}rememberHold(e){Lp(this,e)}forgetHold(){Hp(this)}resumeHoldFromServer(e,t=!1){return Rp(this,e,t)}restoreRememberedHold(){return Ip(this)}activeFloorObjects(){let e=this.controller.doc;if(!e)return[];let t=e.floors;if(t?.length){let i=this.controller.getActiveFloorId();return(t.find(o=>o.id===i)??t[0]).objects??[]}return e.objects??[]}buildMinimap(){!this.els.map||this.root?.dataset.layout==="narrow"||(this.minimap=Ld({controller:this.controller,root:()=>this.root,cssVar:e=>this.cssVar(e),focusedSectionLabel:()=>this.lastSection?.label,tint:e=>this.controller.getRenderer?.()?.categoryDisplayColor?.(e)||void 0},this.regions["bottom-left"]??this.els.map))}syncMinimapForLayout(){let e=this.root?.dataset.layout==="narrow";if(e&&this.minimap){this.minimap.dispose(),this.minimap=null;return}!e&&!this.minimap&&this.buildMinimap()}catPrice(e){return hr(this,e)}catPriceRange(e){return ur(this,e)}buildPriceFilter(){Kp(this)}applyPriceBand(e){Gp(this,e)}buildArenaChrome(){let e=this.controller.doc;if(this.rungsEl=null,this.projectionEl=null,this.floorsEl=null,!e||!this.els.map){this.syncArenaViewportInsets();return}let t=e.objects.some(i=>i.type==="section")||(e.floors??[]).some(i=>i.objects.some(o=>o.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.dataset.slA="picker.venueView",i.innerHTML=`<button type="button" data-view="map" aria-pressed="true" data-sl-t="picker.map" data-sl-ti="picker.flat2dMap" title="${this.tf("picker.flat2dMap","Flat 2D map")}">${this.tf("picker.map","Map")}</button><button type="button" data-view="venue3d" aria-pressed="false" data-sl-ti="picker.interactive3dVenueView" title="${this.tf("picker.interactive3dVenueView","Interactive 3D venue view")}">3D</button>`,i.querySelectorAll("button").forEach(o=>{if(o.dataset.view==="venue3d")for(let r of["pointerenter","focus","pointerdown"])o.addEventListener(r,ho,{once:!0});o.addEventListener("click",()=>{this.setBuyerView(o.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)],o=new Set((e.zones??[]).map(p=>p.id)),a=(0,H.effectiveFloorOverview)(e)==="combined"&&(e.floors?.length??0)>1&&o.size===0||i.some(p=>p.type==="section"&&typeof p.zone=="string"&&o.has(p.zone))?["zones","sections","seats"]:["sections","seats"],l=document.createElement("div");l.className="sl-rungs on sl-mo-indicator",l.setAttribute("role","group"),l.setAttribute("aria-label",(0,H.t)("picker.zoomLevel")),l.dataset.slA="picker.zoomLevel";let c={zones:(0,H.t)("picker.rungLabel.zones"),sections:(0,H.t)("picker.rungLabel.sections"),seats:(0,H.t)("picker.rungLabel.seats")},d={zones:(0,H.t)("picker.rungTip.zones"),sections:(0,H.t)("picker.rungTip.sections"),seats:(0,H.t)("picker.rungTip.seats")};l.innerHTML=a.map(p=>`<button type="button" data-rung="${p}" data-sl-t="picker.rungLabel.${p}" data-sl-ti="picker.rungTip.${p}" title="${d[p]}" aria-pressed="false">${c[p]}</button>`).join(""),l.querySelectorAll("button").forEach(p=>{p.addEventListener("click",()=>{let m=p.dataset.rung;this.controller.setRung(m),m==="seats"&&this.collapseSectionCard()})}),this.regions["top-center"].appendChild(l),this.rungsEl=l,this.syncRung()}if(this.controller.isMultiFloor()){let i=ed({floors:this.controller.getFloors(),tf:(o,r)=>this.tf(o,r),onChoose:o=>{o===""?this.controller.setFloorOverview(!0):this.controller.setFloor(o),this.showSectionCard(null),this.syncFloors(),this.syncRung(),this.minimap?.refreshMinimap()}});(this.regions["bottom-right"]??this.regions["top-left"]).prepend(i),this.floorsEl=i,this.syncFloors()}this.syncArenaViewportInsets()}syncArenaViewportInsets(){let e=this.els.map;e&&hc(this.root,e,this.regions);let t=e?Jc(e.getBoundingClientRect(),[this.rungsEl,this.projectionEl].map(i=>i?.isConnected?i.getBoundingClientRect():null),[],8,this.floorsEl?.isConnected?[this.floorsEl.getBoundingClientRect()]:[]):{top:0,right:0,bottom:0,left:0};Object.keys(t).every(i=>t[i]===this.arenaViewportInsets[i])||(this.arenaViewportInsets=t,this.controller.setViewportInsets(t),this.syncFitClearance())}syncFitClearance(){let e=this.els.map,t=this.els.zoom,i=this.root?.dataset.layout==="narrow",o=0;if(i&&e&&t?.isConnected){let r=e.getBoundingClientRect(),s=t.getBoundingClientRect();s.height>0&&(o=Math.max(0,r.bottom-s.top+8))}this.controller.setFitClearance?.(o)}syncTestBadge(){let e=this.testBadgeEl;e&&(e.textContent=Xa((0,H.t)("picker.testMode"),(0,H.getLocale)()),e.setAttribute("aria-label",(0,H.t)("picker.testMode")),e.title=this.tf("picker.testModeExplained","Bookings here are not real and no card is charged"))}syncRung(){let e=this.controller.getRung(),t=this.controller.seatsRevealed?.()??(e==="seats"||!!this.controller.getFocusedSection?.());this.root&&(this.root.dataset.zoomed=String(t)),this.syncMapStepBack(),this.minimap?.setAutoOpen(!1),this.rungsEl&&this.rungsEl.querySelectorAll("button").forEach(i=>{let o=i.dataset.rung===e;i.classList.toggle("on",o),i.setAttribute("aria-pressed",String(o))})}syncMapStepBack(){let e=this.els?.zout,t=this.els?.zfit,i=this.els?.zin;if(!e||!this.root)return;let o=this.controller.getRenderer?.(),r=this.controller.canZoomIn?.()===!1||o?.seatsPickable?.()===!0,s=qc({focusedSection:this.controller.getFocusedSection?.()??null,seatsRevealed:this.controller.seatsRevealed?.()??!0,atVenueFit:this.controller.atVenueFit?.()})==="none",a=e.disabled!==s||!!t&&t.disabled!==s||!!i&&i.disabled!==r||e.hidden||!!i?.hidden||!!t?.hidden;e.disabled=s,e.hidden=!1,i&&(i.disabled=r,i.hidden=!1),t&&(t.disabled=s,t.hidden=!1),a&&this.a11yMenu?.refit()}syncProjection(){this.els.pricesHint&&(this.els.pricesHint.textContent=this.buyerView==="venue3d"?(0,H.t)("picker.priceHint3d"):this.tf("picker.priceHint","Colours on the map are ticket types. Tap one below to show just those seats.")),this.projectionEl&&this.projectionEl.querySelectorAll("button").forEach(e=>{let t=e.dataset.view===this.buyerView;e.classList.toggle("on",t),e.setAttribute("aria-pressed",String(t))})}canOffer3d(){return this.opts.enable3D===!1||!this.controller.doc||!po()?!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)?sh/2:sh}syncFloors(){td(this.floorsEl,this.controller.getActiveFloorId(),this.controller.isFloorOverview())}get sectionCard(){return this.sectionCardCache||(this.sectionCardCache=new or({controller:this.controller,map:()=>this.els.map,root:()=>this.root,collapseSheet:()=>this.collapseSheet(),region:e=>this.regions[e],refreshMinimap:()=>this.minimap?.refreshMinimap(),activeFloorObjects:()=>this.activeFloorObjects(),sectionNeighbours:e=>this.sectionNeighbours(e),catPriceRange:e=>this.catPriceRange(e),money:e=>this.money(e),suppressPricing:()=>this.suppressPricing,priceBandKeys:()=>this.priceBandKeys})),this.sectionCardCache}showSectionCard(e){this.sectionCard.show(e)}renderSectionCard(e){this.sectionCard.render(e)}collapseSectionCard(){this.sectionCard.collapse()}sectionCardOnView(){this.sectionCard.onView()}sectionNeighbours(e){let t=this.activeFloorObjects().filter(o=>o.type==="section"&&!this.controller.isSectionClosed(o.id)&&this.controller.getSectionSeatCount(o.id)>0);if(t.length<2)return null;let i=t.findIndex(o=>o.id===e);return i<0?null:{previous:t[(i-1+t.length)%t.length],next:t[(i+1)%t.length]}}markedSeatAnnouncement(e){let t=ks(this.controller.getRenderer()?.getSeatMark?.(e.id),this.performanceGroup?.nights?.());return pd(t,e.displayLabel??e.label,this.opts.locale,un(this.performanceGroup))}seatPriceRangeOf(e,t){let i=this.controller.doc?.categories.find(r=>r.key===t),o=i?i.tiers?.length?i.tiers.map(r=>this.paidPrice(i.key,r.id??null,r.price,e)):i.price==null?[]:[this.paidPrice(i.key,null,i.price,e)]:[];return o.length?{min:Math.min(...o),max:Math.max(...o)}:void 0}moneyRange(e){return e.max>e.min?`${this.money(e.min)}\u2013${this.money(e.max)}`:this.money(e.min)}announceSeat(e){if(!this.srEl)return;if(!e){this.srEl.textContent="";return}let t=this.markedSeatAnnouncement(e);if(t){this.srEl.textContent=t;return}let i=this.controller.doc?.categories.find(u=>u.key===e.categoryKey),r=(this.controller.getStatus(e.id)??"free")==="free"?this.tf("picker.statusAvailable","available"):this.controller.currentHold()?.labels.includes(e.label)?this.tf("picker.heldForYou","Held for you").toLocaleLowerCase((0,H.getLocale)()):this.tf("picker.group.legendUnavailable","Unavailable").toLocaleLowerCase((0,H.getLocale)()),s=this.seatPriceRangeOf(e.label,e.categoryKey),a=!this.suppressPricing&&s?this.moneyRange(s):void 0,l=this.controller.tableSelection(e.id),c=l??this.controller.seatDetails(e.id),d=pn(c),p=c?.rowLabel??c?.displayLabel??e.displayLabel??e.label,m=l?`${d} ${p}, ${l.bookingMode==="variable"?(0,H.t)("picker.minToMaxGuests",{min:l.minOccupancy,max:l.maxOccupancy}):(0,H.t)("picker.capacityGuests",{count:l.capacity})}`:c?.objectType==="booth"?`${d} ${p}`:c?.objectType==="table"?`${d} ${p}, ${(0,H.t)("picker.seatNumberLower",{label:c.seatNumber??e.label})}`:(0,H.t)("picker.seatLabel",{label:c?.displayLabel??e.displayLabel??e.label});this.srEl.textContent=`${m}, ${i?.label??e.categoryKey}${a?`, ${a}`:""}, ${r}`}showTableDialog(e,t,i){this.dismissTableDialog(!1),this.tableDialog={...e},this.tableDialogHeld=t,this.tableDialogReturnFocus=i??document.activeElement;let o=this.controller.doc?.categories.find(a=>a.key===e.categoryKey),r=e.bookingMode==="variable",s=document.createElement("div");s.className="sl-table-scrim",s.innerHTML=gl(e,{variable:r,held:t,typeWord:pn(e),categoryLabel:o?.label??e.categoryKey,suppressPricing:this.suppressPricing,unitPrice:this.money(this.paidPrice(e.categoryKey,e.tierId??null,e.price,e.label))}),this.root.appendChild(s),this.tableDialogEl=s,this.renderTableDialogState(),s.querySelectorAll("[data-table-step]").forEach(a=>{a.addEventListener("click",()=>{if(!this.tableDialog)return;let l=Math.max(this.tableDialog.minOccupancy,Math.min(this.tableDialog.maxOccupancy,this.tableDialog.quantity+Number(a.dataset.tableStep)));this.tableDialog={...this.tableDialog,quantity:l},this.renderTableDialogState()})}),s.querySelector(".sl-table-cancel").addEventListener("click",()=>this.cancelTableDialog()),s.querySelector(".sl-table-confirm").addEventListener("click",()=>{this.confirmTableDialog()}),s.addEventListener("mousedown",a=>{a.target===s&&this.cancelTableDialog()}),s.addEventListener("keydown",a=>{if(a.key!=="Tab")return;let l=[...s.querySelectorAll('button:not(:disabled),[tabindex]:not([tabindex="-1"])')];if(!l.length)return;let c=l[0],d=l[l.length-1];a.shiftKey&&document.activeElement===c?(a.preventDefault(),d.focus()):!a.shiftKey&&document.activeElement===d&&(a.preventDefault(),c.focus())}),requestAnimationFrame(()=>s.querySelector(r?'[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 o=t.querySelector("input[data-table-qty]");o&&(o.value=String(e.quantity)),t.querySelectorAll("[data-table-step]").forEach(a=>{let l=Number(a.dataset.tableStep);a.disabled=l<0?e.quantity<=e.minOccupancy:e.quantity>=e.maxOccupancy});let r=this.paidPrice(e.categoryKey,e.tierId??null,e.price,e.label),s=t.querySelector("[data-table-total]");s&&(s.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 o=await this.controller.replaceTableQuantity(e.label,e.quantity,this.opts.holdTtlMs);if(!o){this.toast(this.tf("picker.guestCountCouldNotBeSecured","That guest count could not be secured. Your current table hold is unchanged."),"warning"),this.renderTableDialogState(),i&&(i.disabled=!1,i.textContent=this.tf("picker.updateTable","Update table"));return}this.hold={holdId:o.holdId,expiresAt:o.expiresAt,seats:o.seats,items:o.items},this.startHoldTimer(o.expiresAt),this.dismissTableDialog(),this.syncTray(),this.emitHoldChange(),this.toast((0,H.t)("picker.tableUpdatedForGuests",{label:e.label,count:e.quantity}),"success")}catch(o){this.opts.onError?.(o),this.toast(this.tf("picker.guestCountNoLongerAvailable","That guest count is no longer available. Your current hold is unchanged."),"error"),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())}get confirmCard(){return this.confirmCardCache||(this.confirmCardCache=new ar({controller:this.controller,root:()=>this.root,els:()=>this.els,regions:()=>this.regions,hideTooltip:()=>{this.tipEl&&(this.tipEl.style.display="none")},tf:(e,t)=>this.tf(e,t),money:e=>this.money(e),feeNote:e=>this.feeWords().seat(e),paidPrice:(e,t,i,o)=>this.paidPrice(e,t,i,o),offerName:(e,t)=>this.offerPrice(e,t)?.offerName,suppressPricing:()=>this.suppressPricing,packagePrice:e=>this.performanceGroup?.packagePricing?.seatCardPrice(e)??null,reducedMotion:()=>this.reducedMotion(),scheduleMotion:(e,t)=>this.scheduleMotion(e,t),canOffer3d:()=>this.canOffer3d(),buyerView:()=>this.buyerView,view3dHandle:()=>this.view3dHandle,view3dCompareSeatIds:()=>this.view3dCompareSeatIds,rememberView3dReturnSeat:e=>{this.view3dReturnSeat=e},enter3d:e=>{this.enter3d(e)},performanceGroup:()=>this.performanceGroup,seatViewEnabled:()=>this.seatViewEnabled(),openSeatView:e=>{this.openSeatView(e)},openSeatConfidencePassport:(e,t)=>this.openSeatConfidencePassport(e,t),saveView3dComparisonSeat:e=>this.saveView3dComparisonSeat(e),resolveAssetUrl:e=>this.buyerAssetUrls.resolve(e),onError:e=>this.opts.onError?.(e),liftToastOverConfirm:()=>this.liftToastOverConfirm(),fitTranslatedRows:()=>this.fitTranslatedRows(),syncTray:()=>this.syncTray(),syncSelectionTo3d:()=>this.syncSelectionTo3d(),collapseSectionCard:()=>this.collapseSectionCard(),applyPanelCollapsed:()=>this.applyPanelCollapsed(),dismiss:()=>this.dismissConfirm(),releaseHeldSeat:e=>this.controller.currentHold()?.labels.includes(e.label)?this.removeHeldLabels([e.label]):null,reanchor:()=>this.reanchorConfirm(),inviteCommit:(e,t)=>this.inviteCommit(e,t),addSeatLabel:e=>this.addSeatLabel(e),cartLanded:()=>this.cartLanded()})),this.confirmCardCache}showConfirm(e,t="add"){this.confirmCard.show(e,t)}reanchorConfirm(){this.confirmCard.reanchor()}dismissConfirm(){this.confirmCard.dismiss()}cartLanded(){this.animateOnce(this.els.count,"sl-value-pop",380),this.animateOnce(this.els.total,"sl-value-pop",380)}async commitConfirm(){await this.confirmCard.commit()}cancelConfirm(){this.confirmCard.cancel()}closeConfirm(){this.dismissConfirm()}inviteCommit(e,t){Pd(e,t,this.reducedMotion())}addSeatLabel(e){return Md(e,(t,i)=>this.tf(t,i))}seatViewEnabled(){return this.opts.seatView!==!1}allSeats(){return this.allSeatsCache||(this.allSeatsCache=[...this.controller.getExpandedSeats()]),this.allSeatsCache}async openSeatView(e){if(!this.root||!this.seatViewEnabled())return;let t=++this.seatViewGen,i=this.controller.doc,o=this.controller.getActiveFloorId(),r=e.focalPoint??i?.floors?.find(p=>p.id===o)?.focalPoint??i?.focalPoint??{x:0,y:0},s,a,l=!1;if(e.viewUrl){let p,m=null;try{let f=e.viewMeta?.previewUrl;f&&f!==e.viewUrl?(m=await this.buyerAssetUrls.resolve(f),p=e.viewUrl):p=await this.buyerAssetUrls.resolve(e.viewUrl)}catch(f){t===this.seatViewGen&&this.opts.onError?.(f);return}if(t!==this.seatViewGen||!p||e.viewMeta?.previewUrl&&e.viewMeta.previewUrl!==e.viewUrl&&!m||!this.root||!this.seatViewEnabled())return;let u={url:p,...m?{previewUrl:m}:{},...e.viewMeta?.sourceWidth!==void 0?{sourceWidth:e.viewMeta.sourceWidth}:{},...e.viewMeta?.sourceHeight!==void 0?{sourceHeight:e.viewMeta.sourceHeight}:{},...e.viewMeta?.previewWidth!==void 0?{previewWidth:e.viewMeta.previewWidth}:{},...e.viewMeta?.previewHeight!==void 0?{previewHeight:e.viewMeta.previewHeight}:{},...e.viewMeta?.variants?.length?{variants:e.viewMeta.variants}:{},...e.viewMeta?.coverage?{coverage:e.viewMeta.coverage}:{},...e.viewMeta?.capturedAt?{capturedAt:e.viewMeta.capturedAt}:{},...e.viewMeta?.sourceLabel?{sourceLabel:e.viewMeta.sourceLabel}:{}};s=u,a=(0,wr.seatViewDisclosure)(u),l=(0,wr.isAuthoredSeatView)(u)}else{let p;try{let{generateSeatPanorama:m}=await uo();p=m(e,r,this.allSeats())}catch(m){t===this.seatViewGen&&this.opts.onError?.(m);return}if(t!==this.seatViewGen||!this.root||!this.seatViewEnabled())return;s={url:p.url,generated:!0},a=(0,H.t)("picker.illustrationCaption",{m:p.distanceM})}this.closeSeatView(!1);let c=(0,H.t)("picker.viewFromSeat",{label:e.label}),d=zo({root:this.root,source:s,caption:a,real:l,closeLabel:this.tf("picker.close","Close"),dragHint:rn(),viewFromSeatLabel:c,real360Label:(0,H.t)("picker.real360"),previewLabel:(0,H.t)("picker.preview"),resolveAsset:p=>this.buyerAssetUrls.resolve(p),onClose:()=>this.closeSeatView()});this.viewEl=d.element,this.viewCleanup=()=>d.dispose()}closeSeatView(e=!0){e&&(this.seatViewGen+=1),this.viewCleanup?.(),this.viewCleanup=null,this.viewEl?.remove(),this.viewEl=null}feeWords(){return jc(Vc(this.offerAvailability,this.currency,this.hostPricing),this.currency,e=>this.money(e))}money(e){let t=this.opts.pricing?.formatter;if(t)return t(e,this.currency);let i=Number.isInteger(e);return(0,H.formatMoney)(e,this.currency,{locale:this.opts.locale,fallback:(o,r)=>`${o} ${r}`,...i?{minimumFractionDigits:0,maximumFractionDigits:0}:{}})}scheduleOfferBoundary(e){if(this.offerBoundaryTimer&&clearTimeout(this.offerBoundaryTimer),this.offerBoundaryTimer=null,!this.api.availability||this.destroyed)return;let t=Date.now(),i=Bc(e,t);if(i==null)return;let o=6*36e5,r=Math.min(Math.max(i-t+1e3,1e3),o);this.offerBoundaryTimer=setTimeout(()=>{this.offerBoundaryTimer=null,!document.hidden&&this.refreshOfferAvailability(!1)},r)}offerReadIsCurrent(){return!!this.offerReadInFlight||Date.now()-this.offerReadSettledAt<qg}scheduleOfferRefresh(e){!this.api.availability||this.destroyed||this.offerReadIsCurrent()||(this.offerRefreshTimer&&clearTimeout(this.offerRefreshTimer),this.offerRefreshTimer=setTimeout(()=>{this.offerRefreshTimer=null,this.refreshOfferAvailability(e)},e?180:0))}refreshOfferAvailability(e){if(!this.api.availability||this.destroyed)return Promise.resolve();if(this.offerReadInFlight)return this.offerReadInFlight;if(this.offerReadIsCurrent())return Promise.resolve();let t=this.readOfferAvailability(e).finally(()=>{this.offerReadInFlight===t&&(this.offerReadInFlight=null)});return this.offerReadInFlight=t,t}async readOfferAvailability(e){if(!(!this.api.availability||this.destroyed))try{let t=await this.api.availability(this.opts.event,e);if(this.destroyed)return;this.offerReadSettledAt=Date.now();let i=tr(t);if(!i)return;let o=this.offerAvailability?.bookingFee?.amountMinor;this.offerAvailability=i,this.applyChannelPricing(i.channelPricing),this.scheduleOfferBoundary(i),this.setPricing(this.hostPricing),i.bookingFee?.amountMinor!==o&&this.syncTray(),this.syncMapPriceRanges(),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,t){if(!e)return null;let i=this.offerAvailability?.prices.filter(o=>o.categoryKey===e)??[];return t!==void 0?i.find(o=>(o.tierId??null)===t)??i.find(o=>o.tierId==null)??null:i[0]??null}mapPriceRanges(){if(this.api.availability&&!this.offerAvailability)return null;let e=this.offerAvailability?.prices.some(i=>i.tierId!==void 0)??!1,t=Object.keys(this.opts.pricing?.prices??{}).length>0||Object.keys(this.opts.pricing?.objects??{}).length>0||Object.keys(this.controller.doc?.seatPrices??{}).length>0;if(!(!e&&!t))return Object.fromEntries((this.controller.doc?.categories??[]).flatMap(i=>{let o=this.catPriceRange(i);return o?[[i.key,o]]:[]}))}syncMapPriceRanges(){this.controller.getRenderer()?.setCategoryPriceRanges?.(this.mapPriceRanges())}applyChannelPricing(e){this.channelByObject.clear(),this.pricesByChannel.clear();for(let t of e?.channels??[])this.pricesByChannel.set(t.channelId,t.priceOverrides);for(let t of e?.objects??[])this.pricesByChannel.has(t.channelId)&&this.channelByObject.set(t.label,t.channelId)}syncOffer(){let e=this.els.offer;if(!e)return;if(this.offerCountdownTimer&&clearTimeout(this.offerCountdownTimer),this.offerCountdownTimer=null,e.classList.remove("sl-offer-compact","sl-offer-early-bird"),!this.currencyResolved){e.classList.remove("has"),e.replaceChildren();return}if(this.suppressPricing){e.classList.remove("has"),e.replaceChildren();return}let t=this.offerAvailability,i=t?.release??null,o=!i&&t?.upcoming?.pricingMode!=="matrix"?t?.upcoming??null:null;if(!t||t.state==="closed"||t.state==="sold-out"||!i&&!o){e.classList.remove("has"),e.replaceChildren();return}let r=i??o,s=r.pricingMode==="matrix",a=document.createElement("div");a.className="sl-offer-main";let l=document.createElement("div");l.className="sl-offer-copy";let c=document.createElement("span");c.className="sl-offer-kicker",c.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";let p=r.name||(i?this.tf("picker.currentOffer","Current offer"):this.tf("picker.scheduledOffer","Scheduled offer"));Kr(p)&&e.classList.add("sl-offer-early-bird"),d.innerHTML=go(p,Y);let m=document.createElement("span");m.className="sl-offer-line";let u=[];if(!s&&i&&t.fromPrice!=null&&u.push(this.money(t.fromPrice/100)),!s&&i&&r.remaining!=null&&u.push((0,H.t)("picker.offerRemainingAvailable",{count:r.remaining})),i&&r.endsAt!=null){let v=!this.opts.locale||/^en(?:-|$)/i.test(this.opts.locale)?ol(r.endsAt):null;if(u.push(v??(0,H.t)("picker.offerUntil",{time:mo(r.endsAt,this.eventTimezone,this.opts.locale)})),v){let M=Math.max(1e3,r.endsAt-Date.now()),F=M%6e4||6e4;this.offerCountdownTimer=setTimeout(()=>{this.offerCountdownTimer=null,Date.now()>=r.endsAt?this.refreshOfferAvailability(!1):this.syncOffer()},Math.min(F+25,M+25))}}if(o?.startsAt!=null&&u.push((0,H.t)("picker.offerStarts",{time:mo(o.startsAt,this.eventTimezone,this.opts.locale)})),m.textContent=u.join(" \xB7 "),s||l.append(c),l.append(d,m),s){e.classList.add("sl-offer-compact"),a.append(l),e.replaceChildren(a),e.classList.add("has");return}let f=document.createElement("details");f.className="sl-offer-info";let b=document.createElement("summary");b.setAttribute("aria-label",(0,H.t)("picker.howOfferWorks",{name:d.textContent??""})),b.textContent="i";let T=document.createElement("div");T.className="sl-offer-detail",T.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."),f.append(b,T),a.append(l,f),e.replaceChildren(a),e.classList.add("has")}paidPrice(e,t,i,o){if(o){let s=(0,H.seatPriceFor)(this.opts.pricing?.objects,o,t)??(0,H.seatPriceFor)(this.controller.doc?.seatPrices,o,t);if(s!==void 0)return s}let r=o?this.channelByObject.get(o):void 0;if(r&&e){let s=this.pricesByChannel.get(r)?.find(a=>a.categoryKey===e&&a.tierId===(t??null));if(s)return s.price}return vt(this.opts.pricing?.prices,e,t,i)}heldPrice(e){return this.checkoutMode==="hosted"?e.unitPrice:Go({...this.hostPricing,seatPrices:this.controller.doc?.seatPrices},e.label,e.categoryKey,e.tierId,e.unitPrice)}hostObjectPrices(){return this.opts.pricing?.objects}legendDeps(){return Up(this)}seatCategory(e){return this.controller.seatByLabel(e)?.categoryKey||null}seatPlaces(e){return e.map(t=>{let i=this.controller.seatByLabel(t),o=i?this.controller.seatDetails(i.id):null,r=o?ve(o)||o.rowLabel:null;return{label:t,...o?.sectionLabel?{section:o.sectionLabel}:{},...r?{row:String(r)}:{},...o?.seatNumber!=null?{seat:String(o.seatNumber)}:{}}})}partialLegend(){return this.markedSeatIds.size?this.performanceGroup?.partialWords?.legend??null:null}syncPriceRail(e,t,i=this.legendDeps()){qp(this,e,t,i)}syncPrices(){this.currencyResolved&&Wp(this)}focusCategory(e){Yp(this,e)}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,H.t)("picker.seatJustTakenByAnother",{label:t[0].label}),"error"))}syncTray(){if(!this.els.tray)return;this.updateSelectionCapacity();let{seats:e,gaAreas:t,heldItems:i,heldLabels:o,total:r,count:s}=pr(this),a=[],l=new Set;if(!this.salesClosed){let g=this.performanceGroup?.nightSummary?.()??[];g.length&&a.push(rd(g,{title:this.tf("picker.group.yourSeatsByNight","Your seats by night"),empty:this.tf("picker.group.noSeatsChosenYet","No seats yet")}));let O=this.performanceGroup?.selectionModeSwitch;O&&a.push(`<button type="button" class="sl-pg-switch" data-pg-switch-mode>${Y(O.label)}</button>`)}let c={salesClosed:this.salesClosed,salesState:this.salesState,note:this.salesUi?.note(this),hasPicks:e.length>0||i.length>0,hasGaAreas:t.length>0,groupMode:this.performanceGroup?this.performanceGroup.selectionMode??"same_seat":null,season:un(this.performanceGroup),seated:!!this.controller.doc?.objects?.some(g=>g.type!=="gaArea"),venue3d:this.buyerView==="venue3d",whenText:this.eventWhenText?String(this.eventWhenText):void 0};a.push(Cl(c)),this.els.trayHint&&(this.els.trayHint.textContent=Al(c)),this.els.seatsInfo&&(this.els.seatsInfo.hidden=this.salesClosed),this.salesUi?.sync(this);let d=!e.length&&!i.length&&!It(this.gaQty,this.hold?.items??[]);if(gr(this.performanceGroup)&&!this.salesClosed&&!this.hold&&(d||this.bestAvailableBusy||this.bestAvailableConfirm)){let g=(this.controller.doc?.categories??[]).filter(V=>!V.notForSale),O=this.controller.getBestAvailableZones();this.baZone&&!O.some(V=>V.id===this.baZone)&&(this.baZone="");let R=wo(g,this.controller.categoryAvailability());this.baSoldOutSig=[...R].join("|"),this.bestAvailableSoldOut=g.length>0&&R.size===g.length,R.has(this.baCat)&&(this.baCat=""),(!this.bestAvailableSoldOut||this.bestAvailableBusy||this.bestAvailableConfirm)&&a.push(Sl({confirming:this.bestAvailableConfirm,busy:this.bestAvailableBusy,reopened:!1,quantity:this.baQty,premium:this.baPremium,offerPremium:this.controller.hasPremiumSeats(),categories:g.map(V=>R.has(V.key)?{...V,soldOut:!0}:V),zones:O,selectedCategory:this.baCat,selectedZone:this.baZone}))}let p=(g,O,R,V=1,z,D,ne,J)=>xl({categoryLabel:ne,offerName:J,d:g?this.controller.seatDetails(g):null,area:R==="ga"?t.find(X=>X.id===z):void 0,label:O,objectType:R,quantity:V,identity:D,performanceLabel:this.performanceGroup?.activePerformanceLabel?.(),performanceDates:this.performanceGroup?.selectedPerformanceDates?.()}),m=Y,u=[];for(let g of Xl(i)){let O=g.objectType==="ga"?`held:ga:${g.objectId}:${g.tierId??""}`:`held:${g.label}`;l.add(O);let R=g.objectType!=="ga"?this.controller.seatByLabel(g.label):null,V=this.performanceGroup?.packagePricing?g.categoryKey||R?.categoryKey||"":g.categoryKey,z=this.controller.doc?.categories.find(B=>B.key===V),D=this.performanceGroup||this.suppressPricing?null:$d(this.controller,g),ne=this.performanceGroup?.packagePricing?.seat(g.label,V),J=(g.tierId&&!D?z?.tiers?.find(B=>B.id===g.tierId)?.name:void 0)??ne?.types?.options.find(B=>B.id===ne.types?.selected)?.name,X=this.offerPrice(g.categoryKey,g.tierId??null)?.offerName,xe=g.objectType==="table"?this.controller.tableSelection(g.label):null,ge=R?this.controller.seatDetails(R.id):null,Ee=this.seatViewEnabled()&&!!R&&g.objectType!=="table"&&!!this.deliverableViewReference(R),Ke=m(this.tf("picker.heldForYou","Held for you")),S=(xe?.bookingMode==="variable"?`<button type="button" class="sl-table-edit" data-table-edit="${m(encodeURIComponent(g.label))}">${m((0,H.t)("picker.guestsCountEdit",{count:g.quantity??1}))}</button>`:"")+(D?`<select class="tier" data-held-tier="${m(g.label)}" aria-label="${m((0,H.t)("picker.ticketTierFor",{label:g.label}))}">${vo(D,g.tierId??void 0,m)}</select>`:""),A=this.heldPrice(g)*(g.quantity??1);u.push({key:O,fresh:!this.lastTrayKeys.has(O),held:!0,seatIds:[],heldLabels:g.labels,removeAria:(0,H.t)("picker.removeHeldTicketLabel",{label:is(g,t)}),locateId:R?.id??null,section:ge?.sectionLabel??"",rowLabel:ge&&ve(ge)||"",seatLabel:ge?.seatNumber??g.label,categoryLabel:`${z?.label??V}${J?` \xB7 ${J}`:""}`,categoryColor:this.controller.getRenderer?.()?.categoryDisplayColor?.(V)??z?.color??"",identityHtml:p(R?.id??null,g.label,g.objectType,g.quantity??1,g.objectId,xe??void 0,`${z?.label??V}${J?` \xB7 ${J}`:""}`,X),stateHtml:`<span class="sl-ticket-state held" aria-label="${Ke}" title="${Ke}"><svg viewBox="0 0 24 24"><rect x="5" y="10" width="14" height="10" rx="2"/><path d="M8 10V7a4 4 0 0 1 8 0v3"/></svg></span>`,extrasHtml:S,amount:A,amountText:ne?ne.amountText:this.suppressPricing?"":this.money(A),noteHtml:sn(R??void 0),railHtml:this.performanceGroup?"":Yr((0,H.t)("picker.removeHeldTicketLabel",{label:is(g,t)}),Ee?g.label:null)})}let f=this.seatViewEnabled();for(let g of e.filter(O=>!o.has(O.label))){let O=`seat:${g.id}`;l.add(O);let R=this.controller.doc?.categories.find(S=>S.key===g.categoryKey),V=this.performanceGroup?.packagePricing?.seat(g.label,g.categoryKey),z=V?.types?`<select class="tier" data-season-type="${m(g.label)}" aria-label="${m((0,H.t)("picker.ticketTierFor",{label:g.label}))}">`+vo(V.types.options,V.types.selected,m)+"</select>":g.tiers&&g.tiers.length&&!this.suppressPricing?`<select class="tier" data-tier="${m(g.id)}" aria-label="${m((0,H.t)("picker.ticketTierFor",{label:g.label}))}">`+vo(g.tiers,g.tierId,m)+"</select>":"",D=g.tiers?.find(S=>S.id===g.tierId)??g.tiers?.[0],ne=this.offerPrice(g.categoryKey,D?.id??null)?.offerName,J=D?.buyerMessage?.trim()||(D?.restriction==="companion"?this.tf("picker.companionRequiresWheelchair","Requires the adjacent wheelchair place"):""),X=this.controller.seatDetails(g.id),xe=m(this.tf("picker.selected","Selected")),ge=(0,H.t)("picker.removeSeatLabel",{label:g.label}),Ee=(g.objectType==="table"&&g.bookingMode==="variable"?`<button type="button" class="sl-table-edit" data-table-edit="${m(encodeURIComponent(g.label))}">${m((0,H.t)("picker.guestsCountEdit",{count:g.quantity??1}))}</button>`:"")+z,Ke=this.paidPrice(g.categoryKey,g.tierId??null,g.price,g.label)*(g.quantity??1);u.push({key:O,fresh:!this.lastTrayKeys.has(O),held:!1,seatIds:[g.id],heldLabels:[],locateId:g.id,section:X?.sectionLabel??"",rowLabel:X&&ve(X)||"",seatLabel:X?.seatNumber??g.label,categoryLabel:R?.label??g.categoryKey,identityHtml:p(g.id,g.label,g.objectType,g.quantity??1,g.objectId,g,R?.label??g.categoryKey,ne),categoryColor:this.controller.getRenderer?.()?.categoryDisplayColor?.(g.categoryKey)??R?.color??"",stateHtml:`<span class="sl-ticket-state" aria-label="${xe}" title="${xe}"><svg viewBox="0 0 24 24"><path d="M5 12l4 4L19 6"/></svg></span>`,extrasHtml:Ee,amount:Ke,amountText:V?V.amountText:this.suppressPricing?"":this.money(Ke),removeAria:ge,noteHtml:sn(g)+(J?`<small class="sl-tier-note">${m(J)}</small>`:""),railHtml:Yr(ge,f&&g.objectType!=="table"&&this.deliverableViewReference(this.controller.seatByLabel(g.label)??{})?g.label:null)})}u.length&&a.push(u.map(kl).join("")),t.length&&a.push(nc(this,t,i)),this.els.tray.innerHTML=a.join("")+(this.salesClosed?"":this.lapse.noteHtml()),this.lastTrayKeys=l,this.lapse.wire(this.els.tray),this.els.tray.querySelector("[data-pg-switch-mode]")?.addEventListener("click",()=>this.performanceGroup?.selectionModeSwitch?.activate());let b=this.performanceGroup?.selectNight;b&&gd(this.els.tray,g=>b(g)),this.els.tray.querySelectorAll("[data-ba]").forEach(g=>{g.addEventListener("click",()=>{this.baQty=Math.max(1,Math.min(this.maxTickets,this.baQty+Number(g.dataset.ba))),this.syncTray()})}),this.els.tray.querySelector("[data-ba-cat]")?.addEventListener("change",g=>{this.baCat=g.target.value,this.scheduleFit()}),this.els.tray.querySelector("[data-ba-zone]")?.addEventListener("change",g=>{this.baZone=g.target.value}),this.els.tray.querySelector("[data-ba-premium]")?.addEventListener("click",()=>{this.baPremium=!this.baPremium,this.syncTray()}),this.els.tray.querySelector(".sl-ba-go")?.addEventListener("click",()=>{if(this.pendingSelectionCount()>0){this.bestAvailableConfirm=!0,this.syncTray(),this.els.tray.querySelector("[data-ba-replace]")?.focus();return}this.bestAvailable(this.baQty,this.baCat||void 0,{preferPremium:this.baPremium,zoneId:this.baZone||void 0})}),this.els.tray.querySelector("[data-ba-cancel]")?.addEventListener("click",()=>{this.bestAvailableConfirm=!1,this.syncTray(),this.els.tray.querySelector(".sl-ba-go")?.focus()}),this.els.tray.querySelector("[data-ba-replace]")?.addEventListener("click",()=>{this.bestAvailableConfirm=!1,this.bestAvailable(this.baQty,this.baCat||void 0,{preferPremium:this.baPremium,zoneId:this.baZone||void 0})}),this.els.tray.querySelectorAll(".sl-chip .rm").forEach(g=>{g.addEventListener("click",()=>{let O=g.closest(".sl-chip");if(O.dataset.held){this.removeHeldLabels(decodeURIComponent(O.dataset.held).split(`
3540
+ `),O);return}let R=O.dataset.seat.split(" "),V=()=>{this.controller.deselect(R)};if(this.reducedMotion()){V();return}O.classList.remove("sl-enter"),O.classList.add("sl-leave","sl-mo-collapse"),this.scheduleMotion(V,Pe.collapse)})}),this.els.tray.querySelectorAll("[data-table-edit]").forEach(g=>{g.addEventListener("click",O=>{O.stopPropagation();let R=decodeURIComponent(g.dataset.tableEdit??""),V=this.controller.tableSelection(R);if(!V)return;let z=i.find(D=>D.label===R&&D.objectType==="table");this.showTableDialog({...V,quantity:z?.quantity??V.quantity},!!z,g)})}),this.els.tray.querySelectorAll(".sl-chip .tier").forEach(g=>{g.addEventListener("change",()=>{let O=g.dataset.seasonType,R=this.performanceGroup?.packagePricing;O&&R?(R.setType(O,g.value),this.syncTray()):g.dataset.heldTier?this.changeHeldTier(g,g.dataset.heldTier):this.controller.setSeatTier(g.dataset.tier,g.value||null)})}),this.els.tray.querySelectorAll(".sl-chip .view[data-view-label]").forEach(g=>{g.addEventListener("click",()=>{let O=this.controller.seatByLabel(g.dataset.viewLabel);O&&this.openSeatView(O)})}),this.els.tray.querySelectorAll(".sl-chip[data-locate]").forEach(g=>{let O=()=>this.controller.flashSeat(g.dataset.locate,this.cssVar("--sl-accent")||"#f4b740");g.addEventListener("mouseenter",O),g.addEventListener("focusin",O),g.addEventListener("click",R=>{R.target.closest?.('button,a,select,[role="button"],input')||!this.controller.focusSeats?.([g.dataset.locate],{animate:!this.reducedMotion()})||O()})}),ic(this,this.els.tray,t),this.controller.setGASelection(ql(this.gaQty)),this.salesClosed&&this.els.tray.querySelectorAll(".sl-ba-go,[data-ba],[data-ba-cat],[data-ba-zone],[data-ba-replace],.sl-ga button").forEach(g=>{g.disabled=!0});let T=this.pendingSelectionCount(),E=this.lastTrayCount,v=this.lastTrayTotal,M=fd(this.performanceGroup?.groupSelectionSummary?.(),this.performanceGroup?.selectionMode??"same_seat",un(this.performanceGroup)),F=s?this.performanceGroup?.packagePricing?.total([...i.filter(g=>g.objectType!=="ga"),...e.filter(g=>!o.has(g.label))].map(g=>({label:g.label,categoryKey:g.categoryKey||this.controller.seatByLabel(g.label)?.categoryKey||""}))):null;this.els.count.textContent=F?.countText||M||(s?(0,H.tCount)("picker.ticketsCount",s)+(this.suppressPricing?"":this.feeWords().tray(i,s,r)):this.salesUi?.view(this)?this.closedWords().pill:this.tf("picker.noSeatsSelected","No seats selected")),this.els.total.textContent=F?F.amountText:s&&!this.suppressPricing?this.money(r):"",this.root?.setAttribute("data-has-selection",String(s>0)),this.sheetState()==="mini"&&s===0?this.setSheetState("mini"):s>E&&this.root?.dataset.layout==="narrow"?this.setSheetState("mini"):this.syncSheetAffordance(),this.root?.setAttribute("data-ba-active",String(this.bestAvailableConfirm||this.bestAvailableBusy)),this.els.seatSummary&&(this.els.seatSummary.textContent=M||(s?(0,H.tCount)("picker.seatsSelectedCount",s):"")),this.syncCta(s,T);let N=this.root?.dataset.layout==="narrow"&&this.root?.dataset.confirming==="true";s!==E&&!N&&this.animateOnce(this.els.count,"sl-value-pop",380),r!==v&&!N&&this.animateOnce(this.els.total,"sl-value-pop",380),E===0&&s>0&&(this.animateOnce(this.els.cta,"sl-ready",520),this.sideCollapsed&&this.root?.dataset.layout!=="narrow"&&this.setPanelCollapsed(!1)),this.lastTrayCount=s,this.lastTrayTotal=r,this.opts.onSelectionChange?.(e),this.emitSelectionValidity(s,e),this.scheduleFit()}scheduleFit(){if(this.fitScheduled||this.destroyed)return;this.fitScheduled=!0;let e=()=>{this.fitScheduled=!1,this.destroyed||this.fitTranslatedRows()};typeof requestAnimationFrame=="function"?requestAnimationFrame(e):e()}fitTranslatedRows(){Rc(this.confirmEl?.querySelector(".sl-confirm-row")),this.els.tray?.querySelectorAll(".sl-chip-pos").forEach(Ic),this.els.tray?.querySelectorAll(".sl-ba-go").forEach(Oc),_c(this.els.tray?.querySelector("select.sl-ba-cat"))}emitSelectionValidity(e,t){let i=this.controller.getSelectionValidity(e);i&&(i.seats=t,this.opts.onSelectionValidityChange?.(i),i.isValid?this.lastSelectionValidity!==!0&&this.opts.onSelectionValid?.(t):this.lastSelectionValidity!==!1&&this.opts.onSelectionInvalid?.(i),this.lastSelectionValidity=i.isValid)}async removeHeldLabels(e,t){let i=e.filter(s=>s&&!this.releasingLabels.has(s));if(!i.length)return!1;let o=i[0];i.forEach(s=>this.releasingLabels.add(s)),t?.setAttribute("aria-busy","true");let r=t?.querySelector(".rm");r&&(r.disabled=!0);try{let s=this.handedOff;if(!await this.controller.releaseLabels(i))return this.toast((0,H.t)("picker.couldNotRemoveLabel",{label:o}),"error"),!1;Zl(this.gaQty,this.hold?.items??[],i);let l=this.controller.currentHold();return this.hold=l?{holdId:l.holdId,expiresAt:l.expiresAt,seats:l.seats,items:l.items}:null,this.handedOff=!!this.hold&&s,this.bookedShown=!1,this.ctaPhase="idle",this.hold?this.startHoldTimer(this.hold.expiresAt):(this.stopHoldTimer(),this.forgetHold()),this.syncTray(),this.emitHoldChange(),!0}finally{i.forEach(s=>this.releasingLabels.delete(s)),t?.removeAttribute("aria-busy"),r?.isConnected&&(r.disabled=!1)}}async holdSelection(){return this.ctaPhase!=="idle"?Nt("busy",this.tf("picker.securingSeats","Securing your seats\u2026")):!this.hold&&this.totalTicketCount()===0?Nt("nothing_selected",this.tf("picker.selectSeats","Select seats")):this.handleCta(!1)}async handleCta(e=!0){if(this.salesClosed&&!this.finishingHold())return Nt("sales_closed",this.tf("picker.seatSalesClosedForEvent","Seat sales have closed for this event."));let t=this.controller.getSelectionValidity(this.totalTicketCount());if(t&&!t.isValid){let o=br(t,(r,s)=>this.tf(r,s));return this.toast(o,"warning"),Nt("selection_invalid",o)}if(this.totalTicketCount()>this.maxTickets){let o=(0,H.t)("picker.removeTicketsUntilOrFewer",{count:this.maxTickets});return this.toast(o,"warning"),Nt("too_many_tickets",o)}let i=this.committedSelection();if(this.hold&&(this.salesClosed||!i.some(o=>!(this.hold.items??[]).some(r=>r.label===o.label)))){let o=this.hold.seats??i;return this.handedOff=!0,this.holdConflicted=!1,e&&await this.runCheckoutHandoff(this.hold,o),{ok:!0,hold:this.hold,seats:o}}this.holdingLabels=new Set(i.map(o=>o.label)),this.setCtaPhase("holding");try{let o=null,r=Ul(this.gaQty),s=this.committedSelection();if(s.length){let a=await this.controller.hold(void 0,this.opts.holdTtlMs);o=a?{holdId:a.holdId,expiresAt:a.expiresAt,seats:a.seats,items:a.items}:null}for(let{areaId:a,tierId:l,qty:c}of r){let d=await this.controller.holdGA(a,c,{tierId:l,ttlMs:this.opts.holdTtlMs});o=d?{holdId:d.holdId,expiresAt:d.expiresAt,seats:d.seats,items:d.items}:o}if(!o){let a=this.tf("picker.seatsJustTaken","One or more seats were just taken. Please pick again.");return this.raiseHoldConflict(a),this.setCtaPhase("idle"),this.syncTray(),Nt("seats_taken",a)}return this.hold=o,this.holdConflicted=!1,this.handedOff=!this.performanceGroup,this.startHoldTimer(o.expiresAt),this.flashHeldSeats(o),this.emitHoldChange(),this.performanceGroup||!e?this.setCtaPhase("idle"):await this.runCheckoutHandoff(o,o.seats??s),{ok:!0,hold:o,seats:o.seats??s}}catch(o){this.opts.onError?.(o);let r=ws(o);if(r)return this.toast(r,"warning"),this.setCtaPhase("idle"),Nt("paused",r);let s=o,a=(s.conflicts??[]).map(d=>d.label).filter(Boolean).slice(0,3);s.reason==="event_closed"&&this.setSalesClosed(!0);let l=s.buyerMessage?s.buyerMessage:s.reason==="event_closed"?this.tf("picker.seatSalesClosedForEvent","Seat sales have closed for this event."):s.reason==="companion_pair_required"?this.tf("picker.companionPairRequired","Select the adjacent wheelchair place with each companion ticket."):s.reason==="ticket_option_not_applicable"?(0,H.t)("picker.ticketOptionNotApplicable"):a.length?a.length===1?(0,H.t)("picker.labelsNoLongerAvailable.one",{labels:a.join(", ")}):(0,H.t)("picker.labelsNoLongerAvailable.other",{labels:a.join(", ")}):this.tf("picker.seatsJustTaken","One or more seats were just taken. Please pick again.");this.raiseHoldConflict(l),this.setCtaPhase("idle");let c=s.reason==="event_closed"?"sales_closed":s.reason==="companion_pair_required"||s.reason==="ticket_option_not_applicable"?s.reason:"seats_taken";return Nt(c,l,a.length?a:void 0)}finally{this.holdingLabels.clear(),this.ctaPhase==="holding"&&(this.ctaPhase="idle"),this.syncTray()}}startHoldTimer(e){Op(this,e)}stopHoldTimer(){_p(this)}setExtendPrompt(e,t){Np(this,e,t)}refreshExtendPrompt(){Dp(this)}handleExtend(){return Bp(this)}detectBooked(){this.bookedShown||!this.handedOff||!this.hold||this.holdConflicted||this.controller.currentHold()===null&&this.showBooked()}settleBookedHold(e){this.hold?.holdId!==e||this.bookedShown||this.holdConflicted||(this.controller.clearHold(),this.showBooked())}raiseHoldConflict(e){this.holdConflicted=!0,this.bookedShown&&(this.bookedShown=!1,this.bookedEl?.classList.remove("on")),this.toast(e,"error")}bookedLine(){return this.checkoutMode==="hosted"?this.tf("picker.confirmedAndOnWay","confirmed. A confirmation is on its way."):this.tf("picker.confirmedOnly","confirmed.")}showBooked(){if(this.bookedShown||!this.hold||this.holdConflicted)return;this.bookedShown=!0;let e=this.buildHandoff(this.hold);this.stopHoldTimer(),this.forgetHold();let t=e.lineItems.reduce((o,r)=>o+r.quantity,0),i=this.performanceGroup?.groupSelectionSummary?.();this.els.bookedSub&&(this.els.bookedSub.innerHTML=i?.seats?`<span class="sl-booked-seats">${un(this.performanceGroup)?(0,H.tCount)("picker.season.ticketsConfirmedAcross",i.seats,{performances:i.performances}):(0,H.tCount)("picker.group.ticketsConfirmedAcross",i.seats,{performances:i.performances})}</span>`:`<span class="sl-booked-seats">${(0,H.tCount)("picker.ticketsCount",t)}</span> ${this.bookedLine()}`),this.els.bookedList&&(this.els.bookedList.innerHTML=e.lineItems.map(o=>{let s=[o.sectionLabel,o.rowLabel&&`${this.tf("picker.row","Row")} ${o.rowLabel}`,o.seatNumber&&`${this.tf("picker.seat","Seat")} ${o.seatNumber}`].filter(Boolean).join(" \xB7 ")||o.displayLabel||o.label,a=o.quantity>1?` <span class="sl-booked-qty">\xD7${o.quantity}</span>`:"";return`<li>${Y(s)}${a}</li>`}).join(""),this.els.bookedList.hidden=e.lineItems.length===0),this.bookedEl?.classList.add("on"),requestAnimationFrame(()=>this.bookedEl?.querySelector(".sl-booked-back")?.focus()),this.opts.onBooked?.(e)}dismissBooked(){this.bookedEl?.classList.remove("on"),this.resetAfterBooking(),this.root?.focus({preventScroll:!0})}resetAfterBooking(){this.bookedShown=!1,this.hold=null,this.handedOff=!1,this.holdConflicted=!1,this.holdingLabels.clear(),this.gaQty.clear(),this.stopHoldTimer(),this.forgetHold(),this.clearSelection(),this.setCtaPhase("idle"),this.setSheetOpen(!1),this.syncTray(),this.syncCta(),this.emitHoldChange()}notifyGroupSettled(e){e==="booked"?this.showBooked():this.dismissConfirm(),this.hold=null,this.handedOff=!1,this.ctaPhase="idle",this.stopHoldTimer(),this.forgetHold(),this.syncTray(),this.syncCta()}async checkoutHandoff(e,t){if(this.checkoutMode==="hosted"){await this.startHostedCheckout(e,t);return}await this.opts.onCheckout?.(e,t,this.buildHandoff(e))}async startHostedCheckout(e,t){let i=this.buildHandoff(e),o=null;try{o=await(this.paymentOptions??=this.pubApi.paymentOptions(this.opts.event))}catch(a){this.opts.onError?.(a)}if(this.destroyed)return;let r=o?.bookingMode==="free",s=o?.providers?.[0]??null;if(!s&&!r){let a=Ja(o?.reason),l=!!this.opts.onCheckoutUnavailable||!!this.opts.onCheckout;this.opts.onCheckoutUnavailable?.({reason:a,handoff:i}),this.opts.onCheckout?.(e,t,i),l||this.openCheckoutPanel({kind:"unavailable",reason:a,seatCount:el(i)});return}await this.openCheckoutPanel(tl(i,s,o,this.pubApi.ticketKeysFor(e.holdId),this.controller.getGAAreas()))}async openCheckoutPanel(e){let t;try{({mountCheckout:t}=await _n())}catch(i){this.opts.onError?.(i),this.toast(this.tf("picker.checkoutCouldNotBeOpened","Checkout could not be opened. Your seats are still held. Please try again."),"error"),this.setCtaPhase("idle");return}this.destroyed||!this.root||(this.closeCheckoutPanel(),this.checkoutPanel=t({root:this.root,state:e,eventKey:this.opts.event,event:{name:this.els.name?.textContent||null,detail:this.els.meta?.textContent||null},formatMoney:i=>this.money(i),t:H.t,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=>{nl(i)&&(this.paymentOptions=null),i?.code==="seats_unavailable"&&this.controller.refresh(),this.opts.onError?.(i)}}))}closeCheckoutPanel(){this.checkoutPanel?.destroy(),this.checkoutPanel=null}buildHandoff(e){let i=(e.items??[]).map(s=>{let a=this.controller.lineItemDisplay(s),l=s.objectType==="seat"||s.objectType==="booth"?this.controller.seatByLabel(s.label):null,c=l?this.controller.seatDetails(l.id):null,d=c?ve(c):void 0,p=this.controller.doc?.categories.find(f=>f.key===s.categoryKey),m=s.tierId?p?.tiers?.find(f=>f.id===s.tierId)?.name:void 0,u=this.heldPrice(s);return{label:s.label,...a.displayLabel?{displayLabel:a.displayLabel}:{},...a.displayType?{displayType:a.displayType}:{},...c?.sectionLabel?{sectionLabel:c.sectionLabel}:{},...d?{rowLabel:d}:{},...c?.seatNumber?{seatNumber:c.seatNumber}:{},...p?.label?{categoryLabel:p.label}:{},...m?{tierLabel:m}:{},objectId:s.objectId,objectType:s.objectType,categoryKey:s.categoryKey,tierId:s.tierId,unitPrice:u,...Kc(s,u),currency:s.currency??this.currency,quantity:s.quantity??1}}),o=i[0]?.currency??this.currency,r=i.reduce((s,a)=>s+a.unitPrice*a.quantity,0);return{holdId:e.holdId,expiresAt:e.expiresAt,currency:o,lineItems:i,total:r}}emitHoldChange(){let e=this.hold;this.realtime?.watchHold(e?.holdId??null),this.syncSelectionTo3d(),this.scheduleOfferRefresh(!0),this.opts.onHoldChange?.(e,e?.seats??[],e?this.buildHandoff(e):null)}toast(e,t="neutral",i){let o=this.els.toast;if(!o)return;o.replaceChildren();let r=document.createElement("span");if(r.textContent=e,o.appendChild(r),o.classList.toggle("has-action",!!i),i){let s=document.createElement("button");s.type="button",s.className="sl-toast-action",s.textContent=i.label,s.addEventListener("click",i.onClick,{once:!0}),o.appendChild(s)}o.dataset.tone=t,o.classList.add("on","sl-mo-rise"),this.liftToastOverConfirmSoon(),this.toastTimer&&clearTimeout(this.toastTimer),this.toastTimer=setTimeout(()=>{o.classList.remove("on","sl-mo-rise"),o.classList.remove("has-action"),o.dataset.tone="neutral",this.liftToastOverConfirm()},4200)}liftToastOverConfirm(){let e=this.regions["bottom-center"];if(!e)return;let t=this.els.toast?.classList.contains("on")||this.extendEl?.classList.contains("on"),i=this.confirmEl;if(!t||!i?.isConnected){e.style.removeProperty("bottom");return}let o=this.els.map.clientHeight;if(o<=0)return;let r=i.getBoundingClientRect(),s=r.height||i.offsetHeight||Xg,a=r.height?r.top-this.els.map.getBoundingClientRect().top:o-Ts-s,l=Math.round(o-a+Wg);if(l+Yg>o){e.style.removeProperty("bottom");return}e.style.bottom=`${l}px`}liftToastOverConfirmSoon(){this.liftToastOverConfirm(),typeof requestAnimationFrame=="function"&&requestAnimationFrame(()=>{this.destroyed||this.liftToastOverConfirm()})}dismissSkeleton(){this.handoverMs===null&&this.renderResolvedAt!==null&&(this.handoverMs=performance.now()-this.renderResolvedAt),Od({boot:this.els.boot,map:this.els.map,rail:this.els.rail,root:this.root,reducedMotion:this.reducedMotion()})}placeTooltip(){if(!this.tipEl)return;let e={width:this.els.map.clientWidth,height:this.els.map.clientHeight},t={width:this.tipEl.offsetWidth,height:this.tipEl.offsetHeight},i=this.tipPinned?vd(this.tipPos,e,t):null,o=i??yd(this.tipPos,e.width,e.height,t);this.tipEl.style.left=`${o.left}px`,this.tipEl.style.top=`${o.top}px`,i?this.tipEl.dataset.placement=i.placement:delete this.tipEl.dataset.placement}nightStripFor(e,t){let i=this.performanceGroup,o=ks(e.mark,i?.nights?.()),r=o?.states.filter(s=>s.free).length??0;return sd(o,{locale:this.opts.locale,switchLabel:i?.selectionModeSwitch?.label??null,selectPartialLabel:i?.partialSeatSelection?.label(r)??null,pinned:t,words:i?.partialWords})}unpinTooltip(){this.tipPinned&&(this.tipPinned=!1,this.tipEl?.classList.remove("sl-tip-pinned"),this.tipEl&&(this.tipEl.style.display="none"))}handleMapPointerDown(e){if(this.tipEl?.contains(e.target))return;this.lastMapPoint={x:e.clientX,y:e.clientY},this.lastPointerType=e.pointerType||"mouse";let t=this.els.map.getBoundingClientRect();this.tipPos={x:e.clientX-t.left,y:e.clientY-t.top},this.unpinTooltip()}closeInfoPops(e){this.root?.querySelectorAll(".sl-info.open").forEach(t=>{t!==e&&(t.classList.remove("open"),t.querySelector("[data-sl-info]")?.setAttribute("aria-expanded","false"))})}updateTooltip(e){if(!this.tipEl)return;if(this.confirmSeat){this.tipEl.style.display="none";return}if(this.tipPinned&&e?.interaction!=="press")return;if(!e){this.tipPinned||(this.tipEl.style.display="none",this.tipMarkedHoverLabel=null);return}let t=e.mark?.kind==="partial"&&this.tipMarkedHoverLabel===e.label;if(e.interaction!=="press"&&this.lastPointerType==="mouse"&&!e.mark&&!this.tipPinned){this.tipEl.style.display="none",this.tipMarkedHoverLabel=null;return}if(e.unavailable&&e.status==="free"&&e.interaction==="press"){this.toast(this.tf("picker.turnOffAccessibilityFilter","Turn off the wheelchair filter to pick this seat"),"neutral"),this.tipEl.style.display="none";return}if(e.unavailable&&!e.mark){this.tipEl.style.display="none",this.tipMarkedHoverLabel=null;return}let i=e.mark?.kind==="partial"&&(e.interaction==="press"||this.lastPointerType!=="mouse"||t);this.tipMarkedHoverLabel=e.mark?.kind==="partial"?e.label:null;let o=this.nightStripFor(e,i);this.tipEl.style.setProperty("--sl-cat",e.categoryColor);let r=this.paidPrice(e.categoryKey,e.tierId??null,e.price,e.label),s=this.performanceGroup?.packagePricing?.seatCardPrice(e.categoryKey)??null;this.tipEl.innerHTML=bd(e,{price:s?s.price:this.suppressPricing?"":this.money(r),feeNote:s?s.note:this.suppressPricing?"":this.feeWords().seat(r),priceNote:s||!this.suppressPricing?"":this.performanceGroup?.surface==="season"?(0,H.t)("picker.season.includedInPackage"):this.tf("picker.group.pricesPerPerformance","Prices shown per performance"),rowTypeWord:pn(e),ownHold:this.controller.currentHold()?.labels.includes(e.label)===!0,extra:o+(i?`<button type="button" class="sl-tip-close" data-pg-tip-close aria-label="${Y(this.tf("picker.group.closeSeatDetails","Close seat details"))}">\xD7</button>`:"")}),this.tipPinned=i,this.tipEl.classList.toggle("sl-tip-pinned",i),this.tipEl.querySelector("[data-pg-tip-close]")?.addEventListener("click",()=>this.unpinTooltip()),this.tipEl.querySelector("[data-pg-switch-mode]")?.addEventListener("click",()=>{this.unpinTooltip(),this.performanceGroup?.selectionModeSwitch?.activate()}),kd(this.tipEl,this.performanceGroup?.partialSeatSelection?.label,a=>{this.unpinTooltip(),this.performanceGroup?.partialSeatSelection?.activate(e.id,a)}),this.tipEl.style.display="block",this.placeTooltip()}syncSeatMarks(){let e=this.performanceGroup?.seatMarks,t=this.controller.getRenderer();if(!e||!t?.setSeatMarks)return;let i={};for(let[o,r]of Object.entries(e())){let s=this.controller.idForLabel(o);s&&(i[s]=r,r?this.markedSeatIds.add(s):this.markedSeatIds.delete(s))}Object.keys(i).length&&t.setSeatMarks(i)}getSelection(){return this.committedSelection()}selectObjects(e){return this.controller.select(e)}selectObjectsWithoutConfirmation(e){let t=new Set(e),i=this.controller.getSelection().filter(o=>t.has(o.id)||t.has(o.label));if(i.length===t.size)return i;this.suppressConfirmationSeatId=e[0]??null;try{return this.controller.select(e)}finally{this.suppressConfirmationSeatId=null}}deselectObjects(e){this.controller.deselect(e)}clearSelection(){this.dismissConfirm(),this.dismissTableDialog(),this.controller.clearSelection()}categoryLegendColor(){let e=(this.controller.doc?.categories??[]).find(t=>!t.notForSale);return(e?this.controller.getRenderer()?.categoryDisplayColor?.(e.key):null)||e?.color||"#2563eb"}async refreshAvailability(){await this.controller.refresh(),this.syncSeatMarks(),this.syncTray()}refreshPerformanceGroupComposition(){this.syncTray()}async adoptRestoredHold(e){!e||this.hold||await this.resumeHoldFromServer(e)}selectCategories(e){return this.controller.selectCategories(e)}deselectCategories(e){this.controller.deselectCategories(e)}setSelectableObjects(e){this.controller.setSelectableObjects(e)}setMaxSelection(e){this.maxTickets=Math.max(this.exactTickets??1,Math.floor(e)),this.controller.setMaxSelection(this.maxTickets),this.updateSelectionCapacity(),this.syncTray()}getSelectionValidity(){let e=this.controller.getSelectionValidity(this.totalTicketCount());return e&&(e.seats=this.committedSelection()),e}setMapTheme(e){this.destroyed||(this.opts.theme={...this.opts.theme??{},map:e??void 0},this.controller.setMapTheme(e),this.applyMapChromeTokens(),this.minimap?.refreshMinimap())}applyThemeTokens(e){let t=Pi(this.themeMode),i=gt(this.controller.doc?.theme,this.opts.theme,t,this.performanceGroup?.brandAccent);for(let[o,r]of Object.entries(i))e.style.setProperty(o,r);t?e.dataset.theme=t:delete e.dataset.theme,this.applyMapChromeTokens()}watchThemeMode(){this.colorSchemeStop?.(),this.colorSchemeStop=null,this.themeMode==="auto"&&(this.colorSchemeStop=Eo(()=>{this.destroyed||this.repaintForThemeMode()}))}repaintForThemeMode(){this.root&&(this.applyThemeTokens(this.root),this.controller.setMapTheme(Dn(this.opts.theme,this.themeMode)),this.applyMapChromeTokens(),this.minimap?.refreshMinimap(),this.syncPrices())}setThemeMode(e){this.destroyed||e===this.themeMode||(this.themeMode=e,this.opts.theme={...this.opts.theme??{},...e?{mode:e}:{mode:void 0}},this.watchThemeMode(),this.repaintForThemeMode(),this.emitAnalytics("theme_mode_changed",{mode:e,resolved:Pi(e)??null}))}getThemeMode(){return this.themeMode}applyMapChromeTokens(){let e=this.els.map?.parentElement;if(!e||!this.root)return;let t=Pi(this.themeMode),i=gt(this.controller.doc?.theme,this.opts.theme,t,this.performanceGroup?.brandAccent),o=Dn(this.opts.theme,this.themeMode)?.background??this.controller.doc?.theme?.background??void 0,r=Rl(i,o);for(let s of Hl)r?e.style.setProperty(s,r[s]):e.style.removeProperty(s)}setEventDetailsHidden(e){this.eventDetailsHidden=e,this.syncFullscreenButtons()}setPricing(e){this.hostPricing=e;let t=Fc(e?.prices,this.offerAvailability),i=Object.keys(t).length>0||e?.formatter||e?.objects?{prices:t,...e?.objects?{objects:e.objects}:{},...e?.formatter?{formatter:e.formatter}:{}}:void 0;JSON.stringify(this.opts.pricing??null)!==JSON.stringify(i??null)&&(this.opts.pricing=i,!(this.destroyed||!this.els.prices||!this.currencyResolved)&&(this.syncMapPriceRanges(),this.els.pricesSec?.querySelector(".sl-price-select")?.remove(),this.buildPriceFilter(),this.syncPrices(),this.syncTray(),this.lastSection&&this.showSectionCard(this.lastSection)))}buildLanguageSwitcher(e){this.langSel=_l(e,{languages:this.opts.languages,label:this.tf("picker.preferredTicketType","Language"),onChange:t=>{this.setLocale(t)}})}async setLocale(e){let t=this.localeGeneration+=1,i=await(0,H.loadLocale)(e);return this.opts.messages&&(0,H.setStringOverrides)(this.opts.messages),i===this.paintedLocale||this.applyActiveLocale(i,t),i}applyActiveLocale(e,t){t===this.localeGeneration&&this.root&&(this.paintedLocale=e,Nl(e,{root:this.root,painters:[()=>this.syncTray(),()=>this.syncPrices(),()=>this.syncOffer(),()=>this.syncRung(),()=>this.syncFloors(),()=>this.syncPanelToggle(),()=>this.syncFullscreenButtons(),()=>this.syncTestBadge()],refreshMapCopy:()=>this.controller.refreshMapCopy(),languageSelect:this.langSel}),this.scheduleFit())}isColorblindSafe(){return this.cbSafe}setColorblindSafe(e){e!==this.cbSafe&&(this.cbSafe=e,this.cbEl?.setAttribute("aria-pressed",String(e)),this.controller.setColorblindSafe(e),this.syncPrices(),this.minimap?.refreshMinimap(),Qg(e))}setViewMode(e){this.controller.setViewMode(this.normalizeInitialView(e)),this.syncProjection(),this.dismissConfirm()}getViewMode(){return this.controller.getViewMode()}normalizeInitialView(e){return e==="perspective"?(this.perspectiveWarned||(this.perspectiveWarned=!0,console.warn("[seatlayer] initialView:'perspective' (2.5D) is deprecated for the buyer picker and was coerced to 'flat'. Use the Map | 3D control for the immersive view.")),"flat"):e??"flat"}emitAnalytics(e,t){try{this.opts.onAnalytics?.(e,t??{})}catch{}}emit3dAnalytics(e,t){this.emitAnalytics(e,t)}getBuyerView(){return Jd(this)}setBuyerView(e,t){ep(this,e,t)}seatState3dFor(e){return tp(this,e)}pushAvailabilityTo3d(){np(this)}syncSelectionTo3d(){op(this)}seatViewFor3d(e){return sp(this,e)}onView3dSeatPick(e){ap(this,e)}seatViewCaption(e){return lp(this,e)}saveView3dComparisonSeat(e){cp(this,e)}clearView3dComparison(){dp(this)}view3dComparisonSnapshot(e){return pp(this,e)}enter3d(e){return hp(this,e)}publish3dTopInset(){up(this)}exit3d(){mp(this)}openSeatConfidencePassport(e,t=null){Ls(this,e,t)}closeSeatConfidencePassport(e=!0){Bi(this,e)}openView3dComparison(){qd(this)}closeView3dComparison(e=!0){hn(this,e)}getCurrentHold(){return this.hold}async resumeHold(e){return this.resumeHoldFromServer(e)}async changeHeldTier(e,t){e.disabled=!0;try{let i=await zd(this.controller,t,e.value,this.opts.holdTtlMs);i&&(this.hold={holdId:i.holdId,expiresAt:i.expiresAt,seats:i.seats,items:i.items},this.startHoldTimer(i.expiresAt),this.emitHoldChange())}catch(i){this.opts.onError?.(i),this.toast(this.tf("picker.ticketTypeNotChanged","That ticket type is not available for this seat. Your hold is unchanged."),"error")}finally{this.syncTray()}}async removeHeldTicket(e){return this.removeHeldLabels([e])}async bestAvailable(e,t,i={}){if(this.salesClosed||this.bestAvailableBusy)return null;e=Math.max(1,Math.min(this.maxTickets,Math.floor(e)));try{return await this.bestAvailableOrThrow(e,t,i)}catch(o){this.opts.onError?.(o);let r=ws(o);if(r)return this.toast(r,"warning"),null;let s=o?.reason,a=o?.buyerMessage,l=a||(s==="not_enough_together"?(0,H.t)("picker.couldNotFindSeatsTogether",{count:e}):s==="companion_pair_required"?this.tf("picker.companionPairRequired","Select the adjacent wheelchair place with each companion ticket."):s==="ticket_option_not_applicable"?(0,H.t)("picker.ticketOptionNotApplicable"):s==="sold_out"?this.tf("picker.ticketTypeSoldOut","That ticket type is sold out. Try another ticket type."):s==="event_closed"?this.tf("picker.seatSalesClosedForEvent","Seat sales have closed for this event."):this.tf("picker.seatsNoLongerAvailableTryAnother","Those seats are no longer available. Try another quantity or ticket type."));return this.toast(l,"error"),null}}async bestAvailableOrThrow(e,t,i={}){if(this.salesClosed)throw new Error("seatlayer: seat sales are closed");if(this.bestAvailableBusy)throw new Error("seatlayer: Best Available is already in progress");if(!Number.isInteger(e)||e<1)throw new Error("seatlayer: Best Available quantity must be a positive integer");let o=xo(this.controller,t);if(o)throw o;this.confirmSeat&&this.cancelConfirm(),this.bestAvailableConfirm=!1,this.bestAvailableBusy=!0;let r=this.els.tray?.querySelector(".sl-ba-go");r&&(r.disabled=!0,r.classList.add("sl-busy"),r.innerHTML=`<span class="sl-ba-spin" aria-hidden="true"></span>${this.tf("picker.findingEllipsis","Finding\u2026")}`);try{let s=await this.controller.bestAvailable(e,t,{...i,ttlMs:this.opts.holdTtlMs});return s?(this.hold={holdId:s.holdId,expiresAt:s.expiresAt,seats:s.seats,items:s.items},this.handedOff=!1,this.bookedShown=!1,this.gaQty.clear(),this.startHoldTimer(s.expiresAt),this.flashHeldSeats(this.hold),this.syncTray(),this.emitHoldChange(),i.preferPremium&&s.seats.length&&!s.seats.every(a=>a.commercial?.premium)&&this.toast((0,H.t)("picker.premiumFallbackNote",{count:e}),"neutral"),this.hold):null}finally{this.bestAvailableBusy=!1,this.syncTray()}}async release(){let e=this.hold,t=this.controller.currentHold(),i=!0;if(t)i=await this.controller.release();else if(e){let o=[...new Set([...(e.items??[]).map(r=>r.label),...(e.seats??[]).map(r=>r.label)])];if(o.length)try{await this.api.release(this.opts.event,o,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 st({url:()=>this.pubApi.subscribeUrl(e),mintTicket:()=>this.pubApi.subscribeTicket(e),onAccessUnavailable:t=>{this.opts.onAccessUnavailable?.(t),this.showAccessPanel(t)},onIdleExpired:()=>Qc(this.idlePauseHost),heldHoldId:()=>this.hold?.holdId??null,onHoldState:(t,i)=>{i==="booked"&&this.settleBookedHold(t)},sink:{...Hn(this.controller,{flashOnLiveChange:!0,ownLabels:()=>this.holdingLabels,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")}}),onSales:t=>this.salesNotice(t)}}),this.realtime.start()}async refreshAccess(){return!this.access?.configured||!await this.access.refresh("manual")?!1:(this.dismissAccessPanel(),await this.controller.refresh(),this.realtime?this.realtime.restart():this.startRealtime(),!0)}clearDecisionSurfaces(){this.dismissConfirm(),this.dismissTableDialog(!1),at(this,!1)}showAccessPanel(e){if(this.loadAbort&&e.reason==="provider_failed"||this.destroyed||!this.root)return;this.dismissAccessPanel(),this.clearDecisionSurfaces();let t=bl(e.reason,e.reason==="idle"?()=>this.resumeFromIdle():()=>this.recoverAccess());(this.root.querySelector(".sl-body")??this.root).appendChild(t),this.accessEl=t}async recoverAccess(){return await this.refreshAccess()?!0:(this.opts.onAccessUnavailable||typeof window>"u"||window.location.reload(),!1)}dismissAccessPanel(){this.accessEl?.remove(),this.accessEl=null}get idlePauseHost(){return this}startIdleClock(e){return Yc(this.idlePauseHost,e)}resumeFromIdle(){return Zc(this.idlePauseHost)}showHoldExpired(){if(this.destroyed||!this.root||this.holdExpiredEl)return;this.clearDecisionSurfaces();let e=Jp({restart:()=>this.restartAfterHoldExpiry()},this.holdExpiredUnits);this.root.appendChild(e),this.holdExpiredEl=e,requestAnimationFrame(()=>e.querySelector(".sl-interrupt-act")?.focus());let t=this.holdExpiredUnits;this.holdExpiredFresh=!1,this.refreshAvailability().then(()=>{if(this.destroyed||this.holdExpiredEl!==e)return;this.holdExpiredFresh=!0;let i=t.filter(s=>s.objectType!=="ga"),o=[],r=[];for(let s of i){let a=this.controller.seatByLabel(s.label);(a&&this.controller.getStatus(a.id)==="free"?o:r).push(s.label)}Qp(e,{recoverable:o,taken:r,onRecover:s=>this.recoverAfterHoldExpiry(s)})}).catch(()=>{})}recoverAfterHoldExpiry(e){this.holdExpiredUnits=[],this.dismissHoldExpired(),this.lapse.clear(),this.clearSelection(),this.controller.select(e),this.syncTray(),this.handleCta()}dismissHoldExpired(){this.holdExpiredEl?.remove(),this.holdExpiredEl=null}restartAfterHoldExpiry(){let e=this.holdExpiredUnits;this.holdExpiredUnits=[],this.dismissHoldExpired(),this.lapse.clear(),this.clearSelection(),this.controller.overview(),this.syncTray(),this.syncCta(),this.root?.focus({preventScroll:!0});let t=this.holdExpiredFresh;this.holdExpiredFresh=!1,(t?Promise.resolve():this.refreshAvailability()).then(()=>{this.destroyed||Zp({reducedMotion:this.reducedMotion(),accent:this.cssVar("--sl-accent")||"#f4b740",seatByLabel:i=>this.controller.seatByLabel(i),statusOf:i=>this.controller.getStatus(i),flash:(i,o)=>this.controller.flashSeat(i,o)},e)}).catch(()=>{})}destroy(){this.transportAbort.abort(),this.loadAbort?.abort(),this.loadAbort=null,this.destroyed=!0,As(this),this.colorSchemeStop?.(),this.colorSchemeStop=null,this.realtime?.stop(),this.realtime=null,this.idleClock?.dispose(),this.idleClock=null,this.dismissAccessPanel(),this.dismissHoldExpired(),this.access?.clear(),this.hold&&!this.handedOff&&this.opts.holdOnClose!=="keep"&&this.controller.release(),this.closeConfirm(),this.dismissTableDialog(!1),at(this,!1),this.closeSeatView(),this.closeCheckoutPanel(),this.exit3d(),this.buyerAssetUrls.dispose(),this.stopHoldTimer(),this.detachAttention?.(),this.toastTimer&&clearTimeout(this.toastTimer),this.offerRefreshTimer&&clearTimeout(this.offerRefreshTimer),this.offerBoundaryTimer&&clearTimeout(this.offerBoundaryTimer),this.offerCountdownTimer&&clearTimeout(this.offerCountdownTimer),this.offerRefreshTimer=null,this.offerBoundaryTimer=null,this.offerCountdownTimer=null,this.offerVisibilityHandler&&(document.removeEventListener("visibilitychange",this.offerVisibilityHandler),this.offerVisibilityHandler=null);for(let e of this.motionTimers)clearTimeout(e);this.motionTimers.clear(),this.ro?.disconnect(),this.ro=null,this.viewportResizeHandler&&window.removeEventListener("resize",this.viewportResizeHandler),this.viewportResizeHandler=null,this.framedFs&&this.setFramedFs(!1),this.escHandler&&document.removeEventListener("keydown",this.escHandler),this.fsChangeHandler&&document.removeEventListener("fullscreenchange",this.fsChangeHandler),this.fsEscHandler&&window.removeEventListener("keydown",this.fsEscHandler),this.controller.destroy(),this.projectionEl=null,this.root?.remove(),this.root=null,this.modalCleanup?.(),this.closeModal=null}};function ch(n){kt.prewarm(n)}var Vt=require("@seatlayer/core");var dh="seatlayer-performance-group-picker-style";function ph(){if(document.getElementById(dh))return;let n=document.createElement("style");n.id=dh,n.textContent=`
3546
3541
  .sl-pg-root{display:grid;grid-template-columns:minmax(0,1fr);gap:12px;min-width:0;max-width:100%;color:var(--sl-text,#18202b);font-family:var(--sl-font,Inter,system-ui,sans-serif)}
3547
3542
  .sl-pg-head{display:grid;gap:8px;padding:16px 18px;border:1px solid var(--sl-line,#dde3ea);border-radius:14px;background:var(--sl-surface,#fff)}
3548
3543
  .sl-pg-head h2{font:700 20px/1.25 inherit;margin:0}.sl-pg-summary{margin:0;color:var(--sl-muted,#627081);font-size:14px}
@@ -3602,20 +3597,100 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default;text-decoration-color:t
3602
3597
  @media(min-width:900px){.sl-pg-legend-list{justify-content:flex-start}}
3603
3598
  .sl-pg-live{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
3604
3599
  @media(max-width:640px){.sl-pg-head{padding:13px 14px}.sl-pg-head h2{font-size:18px}.sl-pg-inner{min-height:590px}}
3605
- `,document.head.appendChild(n)}var Vf="https://api.seatlayer.io",$f=6e4,zf=2e3,jf=1e3,Kf=36e5,Gf=5e3,Uf=5e3,qf=15e3,Wf=12e4,Yf=new Set(["preparing","commit_pending","abort_pending","expire_pending"]),ye=class extends Error{constructor(){super("performance_group_destroyed"),this.name="PerformanceGroupDestroyedError"}};function Xf(n){return new Promise(e=>setTimeout(e,n))}function Xr(n){let e=Number(n.headers.get("Retry-After")??"1");return Number.isFinite(e)?Math.max(50,Math.min(Gf,e*1e3)):1e3}function Dn(n,e){return`/pub/performance-groups/${encodeURIComponent(n)}/operations/${encodeURIComponent(e)}`}function Bn(n){return n.replace(/^pghop_/,"").replace(/-/g,"").slice(-8).toUpperCase()}var Qr=class{constructor(e,t,i){this.api=e;this.sink=t;this.intervalMs=i;this.stopped=!0;this.timer=null;this.prior=new Map}start(){this.stopped&&(this.stopped=!1,this.tick())}stop(){this.stopped=!0,this.timer&&clearTimeout(this.timer),this.timer=null}async tick(){try{let e=await this.api.objects(this.api.groupKey);if(this.stopped)return;let t=new Map(Object.entries(e.seats)),o=[...new Set([...this.prior.keys(),...t.keys()])].filter(r=>this.prior.get(r)!==t.get(r)).map(r=>({label:r,status:t.get(r)??"blocked"}));this.prior=t,o.length&&this.sink.applyStatuses(o),this.sink.onSections?.(e.hidden??[],e.closed??[])}catch(e){if(e instanceof ye){this.stop();return}if(Zi(e)){this.stop(),this.api.sessionEnded(e);return}this.stopped||await this.sink.resync()}finally{this.stopped||(this.timer=setTimeout(()=>{this.tick()},this.intervalMs))}}},zo=class{constructor(e,t){this.descriptorCache=null;this.chartRequest=null;this.objectsCache=null;this.objectsEtag=null;this.activePerformanceKey=null;this.includedEventKeys=new Set;this.reuseObjectsCacheOnce=!1;this.selectionsByEvent=new Map;this.allocationsByHold=new Map;this.pendingOperationId=null;this.operationByHold=new Map;this.knownRevision=null;this.destroyed=!1;this.aborter=new AbortController;this.adoptFailure=null;this.settleTimer=null;this.settleOperationId=null;this.settleStartedAt=0;this.settleState=null;this.settleVisibility=null;this.lastRecovery={kind:"idle"};this.seededDescriptor=null;if(!e)throw new Error("seatlayer: `performanceGroup` key is required");this.groupKey=e,this.base=(t.apiBase??Vf).replace(/\/+$/,""),this.access=t.access,this.fetcher=t.fetch??globalThis.fetch.bind(globalThis),this.recoveryTimeoutMs=t.recoveryTimeoutMs??$f,this.realtimePollMs=Math.max(500,t.realtimePollMs??zf),this.selectionMode=t.selectionMode??"same_seat",this.partySize=t.partySize??null,this.onOperationState=t.onOperationState,this.onRecoveryState=t.onRecoveryState,this.onAvailability=t.onAvailability,this.onSessionEnded=t.onSessionEnded,this.access.onRenewed(o=>this.adoptSession(o));let i=this.readOperationRecord();i&&this.storedIsUndecided(i)&&(this.pendingOperationId=i.operationId)}get pendingOperation(){return this.pendingOperationId}get holdBlocked(){return!!this.adoptFailure||!!this.pendingOperationId&&this.lastRecovery.kind!=="idle"}seedDescriptor(e){e.key===this.groupKey&&Array.isArray(e.performances)&&(this.seededDescriptor=e)}async descriptor(){let e=this.seededDescriptor;this.seededDescriptor=null;let t=e?{performanceGroup:e}:await this.json(`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/descriptor`);return this.descriptorCache=t.performanceGroup,this.includedEventKeys.size||(this.includedEventKeys=new Set(t.performanceGroup.performances.map(i=>i.eventKey))),t.performanceGroup.revision&&(this.knownRevision=t.performanceGroup.revision),this.activePerformanceKey??=t.performanceGroup.performances[0]?.eventKey??null,t.performanceGroup}async chart(e){this.chartRequest??=this.json(`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/chart`).catch(o=>{throw this.chartRequest=null,o});let[t,i]=await Promise.all([this.descriptorCache?Promise.resolve(this.descriptorCache):this.descriptor(),this.chartRequest]);return{doc:i,event:{key:t.key,name:t.name,salesClosed:t.state!=="active",venue:t.venue,startsAt:t.performances[0]?.startsAt??null,timezone:t.timezone,currency:t.currency,mode:t.mode,inventoryModelVersion:2}}}asset(e,t){return/^[a-zA-Z0-9._-]+$/.test(t)?this.blob(`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/assets/${encodeURIComponent(t)}`):Promise.reject(new ie(404,"not_found","not_found"))}async objects(e){let t=this.descriptorCache?.inclusionMode==="flexible_dates",i=`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/objects`+(this.selectionMode==="per_performance"||t?"?view=per-performance":"");if(this.reuseObjectsCacheOnce&&this.objectsCache)this.reuseObjectsCacheOnce=!1;else{let s=await this.authorized(i,this.objectsCache&&this.objectsEtag?{headers:{"If-None-Match":this.objectsEtag}}:{});if(s.status===304)this.objectsCache||(this.objectsEtag=null);else{if(!s.ok)return this.throwResponse(s);this.objectsCache=await this.responseJson(s),this.objectsEtag=s.headers.get("ETag")}}if(!this.objectsCache)throw new ie(502,"group_projection_unavailable","group_projection_unavailable");if(this.selectionMode==="same_seat"&&!t){let s=this.objectsCache;return this.noteAvailability(s,s.salesClosed,s),s}let o=this.objectsCache;if(this.selectionMode==="same_seat"){let s=o.performances.filter(p=>this.includedEventKeys.has(p.eventKey));if(!s.length)throw new ie(409,"group_selection_incomplete","group_selection_incomplete");let a=Object.keys(s[0]?.seats??{}),l=Object.fromEntries(a.map(p=>[p,s.every(u=>u.seats[p]==="free")?"free":"blocked"])),c=Object.fromEntries(a.flatMap(p=>{let u=s.filter(h=>h.seats[p]!=="free").map(h=>h.eventKey);return u.length>0&&u.length<s.length?[[p,u]]:[]})),d={seats:l,partial:c,hidden:[...new Set(s.flatMap(p=>p.hidden??[]))],closed:[...new Set(s.flatMap(p=>p.closed??[]))],revision:o.revision,state:o.state,salesClosed:s.some(p=>p.salesClosed)};return this.noteAvailability(o,d.salesClosed,d),d}let r=o.performances.find(s=>s.eventKey===this.activePerformanceKey);if(!r)throw new ie(409,"group_performance_unavailable","group_performance_unavailable");return this.noteAvailability(o,o.salesClosed||o.performances.some(s=>s.salesClosed),r),r}setSelectionMode(e,t){if(this.pendingOperationId||this.holdBlocked)throw new ie(409,"group_operation_pending","group_operation_pending");e!==this.selectionMode&&(this.selectionMode=e,t!=null&&(this.partySize=t),this.objectsCache=null,this.objectsEtag=null,this.selectionsByEvent.clear(),this.activePerformanceKey=this.descriptorCache?.performances[0]?.eventKey??this.activePerformanceKey)}setActivePerformance(e){if(this.descriptorCache&&!this.descriptorCache.performances.some(t=>t.eventKey===e))throw new ie(404,"group_performance_not_found","group_performance_not_found");this.activePerformanceKey=e}setIncludedEventKeys(e){let t=new Set(this.descriptorCache?.performances.map(i=>i.eventKey)??[]);if(!e.length||new Set(e).size!==e.length||e.some(i=>!t.has(i)))throw new ie(422,"invalid_event_keys","invalid_event_keys");this.includedEventKeys=new Set(e),this.reuseObjectsCacheOnce=!!this.objectsCache}includedPerformanceKeys(){return(this.descriptorCache?.performances??[]).map(e=>e.eventKey).filter(e=>this.includedEventKeys.has(e))}setPerformanceSelections(e,t){this.selectionsByEvent.set(e,t.map(i=>({...i})))}allocationsForHold(e){return(this.allocationsByHold.get(e)??[]).map(t=>({eventKey:t.eventKey,items:t.items.map(i=>({...i}))}))}async hold(e,t,i,o){if(this.assertUsable(),o)throw new ie(409,"group_hold_replace_unsupported","group_hold_replace_unsupported");let r=t.map(c=>c.label),s={labels:r};if(this.descriptorCache?.inclusionMode==="flexible_dates"&&(s.eventKeys=this.includedPerformanceKeys()),this.selectionMode==="per_performance"){if(!this.activePerformanceKey||!this.descriptorCache||!this.partySize)throw new ie(409,"group_selection_incomplete","group_selection_incomplete");this.setPerformanceSelections(this.activePerformanceKey,t);let c=this.descriptorCache.performances.filter(d=>this.includedEventKeys.has(d.eventKey)).map(d=>({eventKey:d.eventKey,selections:this.selectionsByEvent.get(d.eventKey)??[]}));if(c.some(d=>d.selections.length!==this.partySize))throw new ie(409,"group_selection_incomplete","group_selection_incomplete");s={selectionMode:"per_performance",allocations:c,...this.descriptorCache.inclusionMode==="flexible_dates"?{eventKeys:this.includedPerformanceKeys()}:{}}}let a=this.pendingOperationId??`pghop_${crypto.randomUUID()}`;this.beginOperation(a),this.onOperationState?.({operationId:a,state:"preparing",decision:null});let l;try{l=await this.authorized(`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/hold`,{method:"POST",body:JSON.stringify({operationId:a,...s,...i?{ttlMs:i}:{}})})}catch(c){if(c instanceof ye)throw c;if(c instanceof he)throw this.failOperation(a),c;return this.recover(a,r,Date.now()+this.recoveryTimeoutMs)}if(l.status===201||l.status===202||l.status===504){let c=await this.responseJson(l);return this.emit(c.operation),l.status===201?this.complete(c.operation):this.recover(a,r,Date.now()+this.recoveryTimeoutMs,Xr(l))}if(l.status===503){let c=await l.clone().json().catch(()=>null);if((c?.code??c?.error)==="performance_group_abort_pending"){let d=c?.operation?.operationId??a;return this.beginOperation(d),c?.operation&&this.emit(c.operation),this.recover(d,r,Date.now()+this.recoveryTimeoutMs,Xr(l))}}try{return await this.throwResponse(l,r)}catch(c){throw this.failOperation(a),c}}async release(e,t,i){this.assertUsable();let o=this.operationForHold(i),r=await this.json(`${Dn(this.groupKey,o)}/release`,{method:"POST",body:"{}"});return this.operationByHold.delete(i),this.allocationsByHold.delete(i),this.clearOperationRecord(),r}async resume(e,t){this.assertUsable();let i=this.operationForHold(t),o=await this.json(Dn(this.groupKey,i));return this.complete(o.operation)}async extend(e,t,i=12e4){this.assertUsable();let o=this.operationForHold(t),r=Math.max(jf,Math.min(Kf,Math.round(i))),s=await this.json(`${Dn(this.groupKey,o)}/extend`,{method:"POST",body:JSON.stringify({ttlMs:r})}),a=this.complete(s.operation);return{holdId:a.holdId,expiresAt:a.expiresAt}}async paymentOptions(){let e=await this.authorized(`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/payment-options`);return e.status===409?null:e.ok?this.responseJson(e):this.throwResponse(e)}async checkout(e){return this.json(`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/checkout`,{method:"POST",body:JSON.stringify(e)})}async orderStatus(e){let t=await this.fetcher(`${this.base}/pub/orders/${encodeURIComponent(e)}/status`,{method:"GET",credentials:"omit",signal:this.aborter.signal});return t.ok?t.json():this.throwResponse(t)}bestAvailable(){return Promise.reject(new ie(400,"group_best_available_unsupported","group_best_available_unsupported"))}socketUrl(){return""}createRealtime(e,t){return new Qr(this,t,this.realtimePollMs)}sessionEnded(e){this.destroyed||this.onSessionEnded?.(e)}operationIdForHold(e){return this.operationByHold.get(e)??this.readMapping(e)}rememberOperation(e,t){!e||!t||(this.operationByHold.set(e,t),this.writeMapping(e,t))}async restoreOperation(){let e=this.readOperationRecord();if(!e)return null;if(!this.storedIsUndecided(e)&&e.state!=="committed"&&e.state!=="booked")return this.clearOperationRecord(),null;this.pendingOperationId=e.operationId,this.emitRecovery({kind:"pending",operationId:e.operationId,phase:e.state==="undecided"?"unknown":e.state,longRunning:!1,reference:Bn(e.operationId)});let t;try{t=await this.authorized(Dn(this.groupKey,e.operationId))}catch(r){return r instanceof ye||this.recoveryFailed(e.operationId,"request_failed"),null}if(t.status===404)return this.failOperation(e.operationId),null;if(!t.ok)return this.recoveryFailed(e.operationId,"request_failed"),null;let i=await this.responseJson(t);this.emit(i.operation);let o=i.operation.state;return o==="committed"||o==="booked"?(this.emitRecovery({kind:"idle"}),this.complete(i.operation)):o==="aborted"||o==="expired"?(this.failOperation(e.operationId),null):this.recover(e.operationId,[],Date.now()+this.recoveryTimeoutMs)}async retryRecovery(){this.assertUsable();let e=this.pendingOperationId??this.readOperationRecord()?.operationId??null;return e?(this.pendingOperationId=e,this.recover(e,[],Date.now()+this.recoveryTimeoutMs)):null}watchSettlement(e){if(this.destroyed)return;let t=this.operationIdForHold(e);!t||t===this.settleOperationId||(this.stopSettlementWatch(),this.settleOperationId=t,this.settleStartedAt=Date.now(),this.settleState="committed",typeof document<"u"&&(this.settleVisibility=()=>{document.hidden||!this.settleOperationId||this.pollSettlement()},document.addEventListener("visibilitychange",this.settleVisibility)),this.scheduleSettlementPoll())}stopSettlementWatch(){this.settleTimer&&clearTimeout(this.settleTimer),this.settleTimer=null,this.settleOperationId=null,this.settleState=null,this.settleVisibility&&typeof document<"u"&&document.removeEventListener("visibilitychange",this.settleVisibility),this.settleVisibility=null}scheduleSettlementPoll(){if(this.destroyed||!this.settleOperationId)return;if(this.settleTimer&&clearTimeout(this.settleTimer),typeof document<"u"&&document.hidden){this.settleTimer=null;return}let t=Date.now()-this.settleStartedAt>=Wf?qf:Uf;this.settleTimer=setTimeout(()=>{this.pollSettlement()},t)}settled(e){return e==="booked"||e==="expired"||e==="aborted"}async pollSettlement(){let e=this.settleOperationId;if(this.destroyed||!e)return;if(typeof document<"u"&&document.hidden){this.settleTimer&&clearTimeout(this.settleTimer),this.settleTimer=null;return}let t;try{let o=await this.authorized(Dn(this.groupKey,e));if(!o.ok)return this.scheduleSettlementPoll();t=(await this.responseJson(o)).operation}catch(o){return o instanceof ye?this.stopSettlementWatch():this.scheduleSettlementPoll()}if(this.destroyed||this.settleOperationId!==e)return;let i=t.state!==this.settleState;if(this.settleState=t.state,i&&this.noteOperationState(e,t.state),this.settled(t.state)){this.stopSettlementWatch(),t.state!=="booked"&&this.clearOperationRecord(),this.emit(t);return}i&&this.emit(t),this.scheduleSettlementPoll()}destroy(){if(!this.destroyed){this.destroyed=!0,this.stopSettlementWatch(),this.access.onRenewed(void 0);try{this.aborter.abort()}catch{}}}operationRecordKey(){return`@seatlayer/performance-group-operation/v1/${encodeURIComponent(this.base)}/${encodeURIComponent(this.groupKey)}`}readOperationRecord(){try{let e=window.sessionStorage.getItem(this.operationRecordKey());if(!e)return null;let t=JSON.parse(e);return!t?.operationId||t.groupKey!==this.groupKey?null:t}catch{return null}}storedIsUndecided(e){return e.state==="undecided"||Yf.has(e.state)}writeOperationRecord(e){try{window.sessionStorage.setItem(this.operationRecordKey(),JSON.stringify(e))}catch{}}clearOperationRecord(){try{window.sessionStorage.removeItem(this.operationRecordKey())}catch{}}beginOperation(e){this.pendingOperationId=e;let t=this.readOperationRecord();this.writeOperationRecord({operationId:e,groupKey:this.groupKey,state:"undecided",createdAt:t?.operationId===e?t.createdAt:Date.now()})}noteOperationState(e,t){let i=this.readOperationRecord();!i||i.operationId!==e||this.writeOperationRecord({...i,state:t})}failOperation(e){this.pendingOperationId=null,this.clearOperationRecord(),this.emitRecovery({kind:"idle"}),this.onOperationState?.({operationId:e,state:"aborted",decision:"abort"})}async adoptSession(e){if(this.destroyed)return;let t=`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/session/adopt`;for(let o=0;o<2;o++){if(this.destroyed)return;try{if((await this.fetcher(`${this.base}${t}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e.token}`},body:JSON.stringify({previousToken:e.previousToken}),credentials:"omit",signal:this.aborter.signal})).ok){this.adoptFailure=null;return}}catch{}}if(this.destroyed)return;this.adoptFailure=new ie(409,"performance_group_session_adopt_failed","performance_group_session_adopt_failed");let i=this.pendingOperationId??"";throw this.emitRecovery({kind:"failed",operationId:i,reference:i?Bn(i):"",reason:"session_adopt_failed",retryable:!1}),this.adoptFailure}async recover(e,t,i,o=100){let r=o,s=Date.now()+Math.min(8e3,Math.max(500,this.recoveryTimeoutMs/2)),a="unknown";for(;Date.now()<=i;){if(this.destroyed)throw new ye;if(this.emitRecovery({kind:"pending",operationId:e,phase:a,longRunning:Date.now()>=s,reference:Bn(e)}),await Xf(r),this.destroyed)throw new ye;let l;try{l=await this.authorized(Dn(this.groupKey,e))}catch(p){if(p instanceof ye)throw p;if(p instanceof he)throw this.recoveryFailed(e,"request_failed"),p;r=Math.min(2e3,Math.max(100,r*2));continue}if(l.status===404){r=Math.min(1e3,Math.max(100,r*2));continue}if(!l.ok){this.recoveryFailed(e,"request_failed");try{return await this.throwResponse(l,t)}finally{this.pendingOperationId=null,this.clearOperationRecord()}}let d=(await this.responseJson(l)).operation;if(a=d.state,this.noteOperationState(e,d.state),this.emit(d),d.state==="committed"||d.state==="booked")return this.emitRecovery({kind:"idle"}),this.complete(d);if(d.state==="aborted"||d.state==="expired")throw this.failOperation(e),new ie(409,"conflict","conflict",t.map(p=>({label:p,status:"held"})));r=Xr(l)}throw this.recoveryFailed(e,"deadline"),new ie(504,"performance_group_outcome_unknown","performance_group_outcome_unknown")}recoveryFailed(e,t){this.emitRecovery({kind:"failed",operationId:e,reference:Bn(e),reason:t,retryable:!0})}emitRecovery(e){if(this.destroyed)return;let t=this.lastRecovery.kind===e.kind&&JSON.stringify(this.lastRecovery)===JSON.stringify(e);this.lastRecovery=e,t||this.onRecoveryState?.(e)}noteAvailability(e,t,i){if(this.destroyed||!this.onAvailability)return;let o=e.state??this.descriptorCache?.state??"active",r=e.revision??null,s=!!r&&!!this.knownRevision&&r!==this.knownRevision;r&&!this.knownRevision&&(this.knownRevision=r);let a=i?.partial??{},l=Object.values(i?.seats??{});this.onAvailability({partial:a,freeCount:l.filter(c=>c==="free").length,blockedCount:Object.keys(i?.seats??{}).filter(c=>i.seats[c]!=="free"&&!(c in a)).length,state:o,salesClosed:!!t||o!=="active",revision:r,revisionChanged:s})}acceptRevision(e){this.knownRevision=e}complete(e){if(!e.hold||e.hold.expiresAt==null)throw new ie(409,"group_hold_not_active","group_hold_not_active");this.pendingOperationId=null,this.noteOperationState(e.operationId,e.state),this.operationByHold.set(e.hold.id,e.operationId),this.writeMapping(e.hold.id,e.operationId);let t=e.hold.allocations??[];this.allocationsByHold.set(e.hold.id,t);let i=t.find(o=>o.eventKey===this.activePerformanceKey)?.items;return{holdId:e.hold.id,expiresAt:e.hold.expiresAt,items:i??e.hold.items??[]}}emit(e){this.destroyed||this.onOperationState?.({operationId:e.operationId,state:e.state,decision:e.decision})}operationForHold(e){let t=this.operationIdForHold(e);if(!t)throw new ie(404,"group_hold_not_found","group_hold_not_found");return t}mappingKey(e){return`@seatlayer/performance-group-hold/v1/${encodeURIComponent(this.base)}/${encodeURIComponent(this.groupKey)}/${encodeURIComponent(e)}`}readMapping(e){try{return window.sessionStorage.getItem(this.mappingKey(e))}catch{return null}}writeMapping(e,t){try{window.sessionStorage.setItem(this.mappingKey(e),t)}catch{}}assertUsable(){if(this.destroyed)throw new ye;if(this.adoptFailure)throw this.adoptFailure}async authorized(e,t={},i=!1){if(this.destroyed)throw new ye;if(this.adoptFailure)throw this.adoptFailure;let o={...t.headers};t.body!==void 0&&(o["Content-Type"]="application/json");let r=await this.access.authorization(i?"unauthorized":"initial");if(this.destroyed)throw new ye;if(this.adoptFailure)throw this.adoptFailure;if(!r)throw new Error("performance_group_buyer_access_required");o.Authorization=r;let s=await this.fetcher(`${this.base}${e}`,{method:t.method??"GET",headers:o,body:t.body,credentials:"omit",signal:this.aborter.signal});if(!i&&(s.status===401||s.status===403||s.status===422)){let a=await s.clone().json().catch(()=>null);if(await this.access.handleFailure(s.status,a?.code??a?.error,r))return this.authorized(e,t,!0)}return s}async json(e,t={}){let i=await this.authorized(e,t);return i.ok?this.responseJson(i):this.throwResponse(i)}async blob(e){let t=await this.authorized(e);return t.ok?t.blob():this.throwResponse(t)}async responseJson(e){return e.json()}async throwResponse(e,t=[]){let o=await e.json().catch(()=>null)??{},r=o.code??o.error??`request_failed_${e.status}`;throw e.status===409&&!o.conflicts?.length&&t.length&&(o.conflicts=t.map(s=>({label:s,status:"held"}))),new ie(e.status,o.error??r,r,o.conflicts)}};var wp=require("@seatlayer/core");var Fn,Xt,Ct,Vn,fi,At,xp,jo,Ko=class{constructor(e){this.options=e;R(this,At);R(this,Fn,null);R(this,Xt,!1);R(this,Ct,null);R(this,Vn,!1);R(this,fi,!1)}get mode(){return m(this,Xt)?"hosted":"handoff"}async prepare(){try{S(this,Fn,await this.options.api.paymentOptions()),S(this,Xt,!!m(this,Fn))}catch(e){S(this,Xt,!1),this.options.onError?.(e)}}async open(e,t){if(!m(this,Xt)||m(this,Vn))return;if(t.selectionMode!=="same_seat"){this.options.announce(y("picker.group.hostedPerPerformance","Seats chosen night by night can\u2019t be paid for on this page yet. Choose one seat for every date instead."));return}let i=m(this,Fn),o=t.seatLabels.length;if(i.bookingMode==="paid"&&!i.providers.length){await x(this,At,jo).call(this,e,t.descriptor,{kind:"unavailable",reason:i.reason==="unavailable_for_run"?"unavailable_for_event":"not_configured",seatCount:o});return}S(this,Vn,!0);try{let{total:r,currency:s,lines:a}=x(this,At,xp).call(this,t.holdId,t.descriptor);await x(this,At,jo).call(this,e,t.descriptor,{kind:"pay",provider:null,free:i.bookingMode==="free",order:{holdId:t.operationId,expiresAt:t.expiresAt,currency:s,total:r,labels:[...t.seatLabels],lines:a}})}finally{S(this,Vn,!1)}}resume(e,t,i){let o=Nn(t);o?.outcome!=="success"||!o.orderId||x(this,At,jo).call(this,e,i,{kind:"resume",orderId:o.orderId})}destroy(){S(this,fi,!0),m(this,Ct)?.destroy(),S(this,Ct,null)}};Fn=new WeakMap,Xt=new WeakMap,Ct=new WeakMap,Vn=new WeakMap,fi=new WeakMap,At=new WeakSet,xp=function(e,t){let i=this.options.api.allocationsForHold(e),o=i.flatMap(a=>a.items)[0]?.currency??t.currency,r=0,s=i.map(a=>{let l=a.items.reduce((d,p)=>d+Math.round(p.unitPrice*100)*(p.quantity??1),0);r+=l;let c=t.performances.find(d=>d.eventKey===a.eventKey);return{label:a.items.map(d=>d.label).join(", "),detail:c?Rn(c,this.options.locale):null,amount:l/100}});return{total:r/100,currency:o,lines:s}},jo=async function(e,t,i){let o;try{({mountCheckout:o}=await un())}catch(s){this.options.onError?.(s),this.options.announce(y("picker.group.checkoutCouldNotOpen","Checkout could not be opened. Your seats are still held. Please try again."));return}if(m(this,fi)||!e)return;m(this,Ct)?.destroy();let r=this.options.api;S(this,Ct,o({root:e,state:i,eventKey:r.groupKey,event:{name:t.name,detail:y("picker.group.checkoutDates","{count} dates, one seat each").replace("{count}",String(t.performanceCount))},formatMoney:(s,a)=>(0,wp.formatMoney)(s,a,{locale:this.options.locale,fallback:(l,c)=>`${l} ${c}`,...Number.isInteger(s)?{minimumFractionDigits:0,maximumFractionDigits:0}:{}}),startSession:async s=>{let a=await r.checkout({operationId:s.holdId,buyerEmail:s.buyerEmail,...s.buyerName?{buyerName:s.buyerName}:{},...this.options.returnUrl?{returnUrl:this.options.returnUrl}:{}});return{orderId:a.orderId,totalMinor:a.totalMinor??0,currency:a.currency??t.currency,expiresAt:a.expiresAt??0,...a.redirectUrl?{redirectUrl:a.redirectUrl}:{},...a.status==="confirmed"?{status:"confirmed"}:{}}},orderStatus:s=>r.orderStatus(s),onCancel:()=>{S(this,Ct,null)},onConfirmed:s=>this.options.onConfirmed?.(s),onError:s=>this.options.onError?.(s)}))};var Qf={audience_not_public:"audience_not_public",sales_not_open:"sales_not_open",invalid_origin:"origin_not_allowed"},Zf=3e4;function Jf(n,e){if(!n||typeof n!="object"||Array.isArray(n))return!1;let t=n;return typeof t.token=="string"&&t.token.length>0&&typeof t.expiresAt=="number"&&Number.isFinite(t.expiresAt)&&t.expiresAt>Date.now()&&t.performanceGroupKey===e}var Zr=class extends Error{constructor(t,i){super(`performance_group_public_session_refused:${t}`);this.reason=t;this.status=i;this.name="PerformanceGroupPublicSessionRefused"}},pt,Pt,gi,$n,Jr=class{constructor(e){this.options=e;R(this,pt,null);R(this,Pt,null);R(this,gi);R(this,$n);S(this,gi,e.fetch??globalThis.fetch.bind(globalThis)),S(this,$n,e.origin??(typeof location>"u"?void 0:location.origin))}get session(){return m(this,pt)}async mint(e=!1){if(e&&S(this,pt,null),m(this,pt)&&m(this,pt).expiresAt-Zf>Date.now())return m(this,pt);if(m(this,Pt))return m(this,Pt);let t=(async()=>{let i=await m(this,gi).call(this,`${this.options.base}/pub/performance-groups/${encodeURIComponent(this.options.performanceGroup)}/sessions`,{method:"POST",body:JSON.stringify(m(this,$n)?{origin:m(this,$n)}:{}),credentials:"omit"}),o=await i.json().catch(()=>null);if(!i.ok){let r=o?.code??o?.error,s=i.status===403&&r?Qf[r]:void 0;throw s?(this.options.onRefused?.({reason:s,code:r,status:i.status,retryable:s==="sales_not_open"}),new Zr(s,i.status)):new Error(`performance_group_public_session_failed_${i.status}`)}if(!Jf(o,this.options.performanceGroup))throw new Error("performance_group_public_session_invalid");return S(this,pt,o),o})();S(this,Pt,t);try{return await t}finally{m(this,Pt)===t&&S(this,Pt,null)}}async token(e){let t=e==="expiring"||e==="expired"||e==="unauthorized"||e==="manual",i=await this.mint(t);return{token:i.token,expiresAt:i.expiresAt}}};pt=new WeakMap,Pt=new WeakMap,gi=new WeakMap,$n=new WeakMap;function kp(n){let e=new Jr(n);return{access:new De({provider:({reason:i})=>e.token(i),...n.accessHooks}),loader:e}}var Sp="https://api.seatlayer.io";function Tp(n){let e=typeof n=="string"?document.querySelector(n):n;if(!e)throw new Error("seatlayer: Performance Group picker container was not found");return e}var Go=class{constructor(e){this.descriptorValue=null;this.picker=null;this.root=null;this.innerHost=null;this.tabsHost=null;this.prevButton=null;this.nextButton=null;this.heldSummary=null;this.live=null;this.statusHost=null;this.statusCopy=null;this.statusAction=null;this.rendered=!1;this.destroyed=!1;this.continued=!1;this.switchingPerformance=!1;this.operationPending=!1;this.recovery={kind:"idle"};this.availability=null;this.activePerformanceKey=null;this.selectionsByEvent=new Map;this.validByEvent=new Map;this.refreshingComposition=!1;this.activeHandoff=null;this.selectionModeValue="same_seat";this.progressHost=null;this.legendHost=null;this.paneHost=null;this.datesSummaryHost=null;this.datesCardsHost=null;this.resettingFlexibleSelection=!1;this.selectingPartialSeat=!1;this.partialSeatDates=new Map;this.markedLabels=new Set;this.holdTicker=null;this.switchingMode=!1;this.booked=!1;this.refusal=null;if(!e||typeof e!="object")throw new Error("seatlayer: options object is required");if(!e.performanceGroup)throw new Error("seatlayer: `performanceGroup` key is required");if(!e.container)throw new Error("seatlayer: `container` is required");if(!!e.initialHoldId!=!!e.initialOperationId)throw new Error("seatlayer: `initialHoldId` and `initialOperationId` must be supplied together");if((e.selectionMode==="per_performance"||e.allowSelectionModeSwitch)&&(!Number.isSafeInteger(e.numberOfPlacesToSelect)||(e.numberOfPlacesToSelect??0)<1))throw new Error("seatlayer: `numberOfPlacesToSelect` is required for per-performance selection");this.selectionModeValue=e.selectionMode??"same_seat",this.options=e,this.panelId=`sl-pg-panel-${e.performanceGroup}`;let t=i=>{this.refusal=this.refusal&&i.reason==="provider_failed"?this.refusal:i,e.onAccessUnavailable?.(this.refusal)};this.access=e.buyerAccessToken||e.buyerAccessTokenProvider?new De({provider:e.buyerAccessTokenProvider,token:e.buyerAccessToken,onExpired:e.onAccessExpired,onUnavailable:t}):kp({base:(e.apiBase??Sp).replace(/\/$/,""),performanceGroup:e.performanceGroup,onRefused:i=>{this.refusal=i},accessHooks:{onExpired:e.onAccessExpired,onUnavailable:t}}).access,this.api=new zo(e.performanceGroup,{apiBase:e.apiBase,access:this.access,selectionMode:e.selectionMode,partySize:e.selectionMode==="per_performance"?e.numberOfPlacesToSelect:void 0,onOperationState:i=>this.operationChanged(i),onRecoveryState:i=>this.recoveryChanged(i),onAvailability:i=>this.availabilityChanged(i),onSessionEnded:i=>this.sessionEnded(i)}),e.initialHoldId&&e.initialOperationId&&this.api.rememberOperation(e.initialHoldId,e.initialOperationId),e.initialDescriptor&&this.api.seedDescriptor(e.initialDescriptor),this.hosted=e.checkout==="hosted"?new Ko({api:this.api,locale:e.locale,returnUrl:e.returnUrl,announce:i=>this.showStatus("checkout",i),onConfirmed:i=>e.onOrderConfirmed?.(i),onError:e.onError}):null}get checkoutMode(){return this.hosted?.mode??"handoff"}get mode(){return this.selectionModeValue}get selectionMode(){return this.selectionModeValue}get descriptor(){return this.descriptorValue}get currentHold(){return this.activeHandoff}async render(){if(this.rendered)return this;let e=performance.now();if(this.rendered=!0,vp(),await(0,Mt.loadLocale)(this.options.locale),this.options.messages&&(0,Mt.setStringOverrides)(this.options.messages),this.destroyed)return this;let t;try{t=await this.api.descriptor()}catch(i){throw Qe({apiBase:this.options.apiBase??Sp,event:this.options.performanceGroup,scope:"performance_group",surface:"performance_group_picker",outcome:"failure",stage:"group_descriptor",ms:performance.now()-e,load:ot(this.options.performanceGroup),transport:"pubapi"}),i instanceof he&&this.refusal?new he(this.refusal):i}return await this.hosted?.prepare(),this.destroyed?this:(this.descriptorValue=t,this.activePerformanceKey=t.performances[0]?.eventKey??null,this.buildChrome(Tp(this.options.container),t),this.announce(this.copy("picker.group.checkingAvailability")),await this.mountPicker(t),this.destroyed?this:(await this.restoreOperation(),this.destroyed||this.hosted?.resume(this.picker?.root??null,t.key,t),this))}buildChrome(e,t){e.replaceChildren();let i=document.createElement("div");i.className="sl-pg-root",i.dataset.performanceGroup=t.key,i.dataset.selectionMode=this.mode;let o=document.createElement("div");o.className="sl-pg-progress";let r=document.createElement("section");r.className="sl-pg-head",r.setAttribute("aria-labelledby",`sl-pg-title-${t.key}`);let s=document.createElement("h2");s.id=`sl-pg-title-${t.key}`,s.textContent=t.name;let a=document.createElement("p");a.className="sl-pg-summary",a.textContent=this.copy(this.mode==="per_performance"?"picker.group.perPerformanceSummary":"picker.group.sameSeatSummary",{count:t.performanceCount});let l=document.createElement("p");l.className="sl-pg-help",l.textContent=this.copy(this.mode==="per_performance"?"picker.group.perPerformanceMapHelp":"picker.group.sameSeatMapHelp");let c=document.createElement("details");c.className="sl-pg-dates",c.open=t.performanceCount<=3;let d=document.createElement("summary");d.textContent=this.copy(t.inclusionMode==="flexible_dates"?"picker.group.flexibleDatesInView":"picker.group.allDates",{count:t.performanceCount});let p=document.createElement("div");p.innerHTML=Dr(this.performanceCards(t),this.copy(t.inclusionMode==="flexible_dates"?"picker.group.flexibleDatesNote":"picker.group.includedNote",{count:t.performanceCount})),c.append(d,p);let u=document.createElement("div");u.className="sl-pg-held-summary",u.hidden=!0,s.hidden=a.hidden=c.hidden=this.options.header===!1,r.append(s,a,l,c,u);let h=document.createElement("div");h.className="sl-pg-legend";let b=document.createElement("div");b.className="sl-pg-pane",b.setAttribute("role","group"),b.setAttribute("aria-label",this.copy("picker.group.yourSelection")),b.hidden=!0;let f=this.mode==="per_performance"?this.performanceTabs(t):null,T=document.createElement("div");T.className="sl-pg-inner",T.id=this.panelId,T.setAttribute("aria-busy","false"),T.dataset.locked="false",this.mode==="per_performance"&&(T.setAttribute("role","tabpanel"),T.tabIndex=-1);let w=document.createElement("div");w.className="sl-pg-status",w.setAttribute("role","status"),w.setAttribute("aria-live","polite"),w.hidden=!0;let v=document.createElement("p"),M=document.createElement("button");M.type="button",M.hidden=!0,M.textContent=this.copy("picker.group.retry"),M.addEventListener("click",()=>{this.retryRecovery()}),w.append(v,M),T.appendChild(w);let F=document.createElement("div");F.className="sl-pg-live",F.setAttribute("role","status"),F.setAttribute("aria-live","polite"),i.append(o,r),f&&i.append(f),i.append(h,T,b,F),e.appendChild(i),this.root=i,this.progressHost=o,this.legendHost=h,this.paneHost=b,this.datesSummaryHost=d,this.datesCardsHost=p,this.innerHost=T,this.heldSummary=u,this.live=F,this.statusHost=w,this.statusCopy=v,this.statusAction=M,this.syncProgress(),this.syncLegend(),this.syncPane()}async mountPicker(e){let t=new dt(Vo({container:this.innerHost,event:e.key,apiBase:this.options.apiBase,transport:this.api,hideEventDetails:!0,maxSelection:this.options.maxSelection,selectedObjects:this.options.selectedObjects,selectableObjects:this.options.selectableObjects,numberOfPlacesToSelect:this.options.numberOfPlacesToSelect,selectionValidators:this.options.selectionValidators,locale:this.options.locale,messages:this.options.messages,languages:this.options.languages,colorblindSafe:this.options.colorblindSafe,initialView:this.options.initialView,enable3D:this.options.enable3D,max3DSeats:this.options.max3DSeats,onBuyerViewChange:this.options.onBuyerViewChange,onAnalytics:(i,o)=>{try{this.options.onAnalytics?.(i,{...o,metricScope:"performance_group",performanceGroupKey:e.key,performanceCount:e.performanceCount,selectionMode:this.mode})}catch{}},hideBadge:this.options.hideBadge,theme:this.options.theme,holdTtlMs:this.options.holdTtlMs,initialHoldId:this.options.initialHoldId,restoreHold:this.options.restoreHold,confirmSelection:this.options.confirmSelection,seatView:this.options.seatView,onSelectionChange:i=>this.selectionChanged(i),onSelectionValidityChange:i=>this.selectionValidityChanged(i),onSelectionValid:this.options.onSelectionValid,onSelectionInvalid:this.options.onSelectionInvalid,onSelectionLimit:this.options.onSelectionLimit,onHoldChange:(i,o)=>this.holdChanged(i,o),onCheckout:(i,o)=>this.checkout(i,o),onHoldExpired:()=>{this.activeHandoff=null,this.api.stopSettlementWatch(),this.resetPerPerformanceSelection(),this.syncProgress(),this.syncPane(),this.syncHoldTicker(),this.options.onHoldChange?.(null),this.options.onHoldExpired?.()},onError:this.options.onError},{performanceCount:e.performanceCount,selectionMode:this.mode,submissionState:()=>this.submissionState(),suppressPricing:!0,nights:()=>this.nights(),seatMarks:()=>this.seatMarks(),nightSummary:()=>this.nightSummary(),groupSelectionSummary:()=>this.groupSelectionSummary(),activePerformanceLabel:()=>this.activePerformanceLabel(),selectedPerformanceDates:()=>this.mode==="same_seat"&&e.inclusionMode==="flexible_dates"?cc(this.includedPerformances(),e.performanceCount,this.options.locale,this.copy("picker.group.flexibleSelectedNote",{count:this.includedPerformances().length})):null,selectNight:i=>{this.switchPerformance(i)},selectionModeSwitch:this.options.allowSelectionModeSwitch&&this.mode==="same_seat"?{label:this.copy("picker.group.chooseNightByNight"),activate:()=>{this.switchSelectionMode("per_performance")}}:null,partialSeatSelection:e.inclusionMode==="flexible_dates"&&this.mode==="same_seat"?{label:i=>this.copy("picker.group.selectAvailableDates",{count:i}),activate:(i,o)=>{this.selectPartialSeat(i,o)}}:null,confirmDateSelection:e.inclusionMode==="flexible_dates"&&this.mode==="same_seat"?{includedEventKeys:()=>this.api.includedPerformanceKeys(),availableEventKeys:i=>this.partialSeatDates.get(i)??this.nights().map(o=>o.eventKey),label:i=>this.copy("picker.group.selectAvailableDates",{count:i}),apply:(i,o)=>this.applySeatDates(i,o,!0)}:null}));this.picker=t,await t.render(),!this.destroyed&&this.updateTabs()}performanceCards(e){return e.performances.map(t=>({eventKey:t.eventKey,name:t.name,iso:new Date(t.startsAt).toISOString(),date:Ao(t,this.options.locale),time:Po(t,this.options.locale)}))}nights(){return(this.descriptorValue?.performances??[]).map(e=>({eventKey:e.eventKey,name:e.name,shortDate:Rn(e,this.options.locale)}))}seatMarks(){let e=this.descriptorValue?.performanceCount??0,t=this.availability,i=!!t?.salesClosed||!!t&&t.state!=="active",o=this.mode==="same_seat"&&!i?t?.partial??{}:{},r={};for(let s of this.markedLabels)r[s]=null;if(this.markedLabels.clear(),e>0)for(let[s,a]of Object.entries(o))!a.length||a.length>=e||(r[s]={kind:"partial",fraction:(e-a.length)/e,data:{blockedEventKeys:[...a]}},this.markedLabels.add(s));return r}activePerformanceLabel(){if(this.mode!=="per_performance")return null;let e=this.descriptorValue?.performances.find(o=>o.eventKey===this.activePerformanceKey);if(!e)return null;let t=Rn(e,this.options.locale),i=e.name?.trim();return i&&i!==t?`${i} \xB7 ${t}`:t}nightSummary(){return this.mode!=="per_performance"?[]:(this.descriptorValue?.performances??[]).map(e=>({eventKey:e.eventKey,name:Rn(e,this.options.locale),labels:(this.selectionsByEvent.get(e.eventKey)??[]).map(t=>t.label),active:e.eventKey===this.activePerformanceKey}))}groupSelectionSummary(){let e=this.includedPerformances();if(!e.length)return null;if(this.mode==="same_seat"){let r=this.activeHandoff?.seatLabels.length??this.picker?.getSelection().length??0;return{seats:r*e.length,performances:e.length,totalPerformances:this.descriptorValue?.performanceCount??e.length,performancesChosen:r?e.length:0,perPerformance:r}}let t=e.map(r=>this.selectionsByEvent.get(r.eventKey)?.length??0),i=t.filter(r=>r>0),o=i.length===t.length&&i.every(r=>r===i[0]);return{seats:t.reduce((r,s)=>r+s,0),performances:e.length,totalPerformances:this.descriptorValue?.performanceCount??e.length,performancesChosen:i.length,perPerformance:o&&i.length?i[0]:null}}syncProgress(){if(!this.progressHost)return;let e=!!this.activeHandoff,t=[{id:"performances",label:this.copy("picker.group.stepPerformances"),state:"done"},{id:"seats",label:this.copy("picker.group.stepSeats"),state:e?"done":"current"},{id:"review",label:this.copy("picker.group.stepReview"),state:this.booked?"done":e?"current":"upcoming"}];this.progressHost.innerHTML=vc(t,{label:this.copy("picker.group.progressLabel"),done:this.copy("picker.group.stepDone"),current:this.copy("picker.group.stepCurrent"),upcoming:this.copy("picker.group.notStarted")})}syncLegend(){if(!this.legendHost)return;let e=this.availability,t=!!e?.salesClosed||e&&e.state!=="active";if(!e||t){this.legendHost.replaceChildren();return}this.legendHost.innerHTML=pc({available:e.freeCount>0,selected:(this.picker?.getSelection().length??0)>0,partial:Object.keys(e.partial).length>0,unavailable:e.blockedCount>0},{title:this.copy("picker.group.legendTitle"),available:this.copy("picker.group.legendAvailable"),selected:this.copy("picker.group.legendSelected"),partial:this.copy("picker.group.legendNotEveryDate"),unavailable:this.copy("picker.group.legendUnavailable")},this.categoryColor())}categoryColor(){return this.picker?.categoryLegendColor()??"#2563eb"}syncPane(){let e=this.paneHost;if(!e)return;let t=this.includedPerformances();if(this.mode!=="same_seat"||!t.length){e.hidden=!0,e.replaceChildren();return}let i=this.activeHandoff?.seatLabels??this.picker?.getSelection().map(r=>r.label)??[],o=this.heldTotal();e.hidden=!1,e.innerHTML=wc({title:this.copy("picker.group.yourSelection"),rows:t.map(r=>({eventKey:r.eventKey,name:`${Ao(r,this.options.locale)} ${Po(r,this.options.locale)}`,labels:i})),empty:this.copy("picker.group.noSeatsChosenYet"),note:o?null:this.copy("picker.group.pricesPerPerformance"),total:o?{label:this.copy("picker.group.total"),amount:o}:null,holdStatus:this.booked?this.copy("picker.group.bookedAll",{count:t.length}):this.activeHandoff?this.copy("picker.group.heldTogether",{count:t.length,time:xc(this.activeHandoff.expiresAt-Date.now())}):null})}heldTotal(){let e=this.activeHandoff,t=this.descriptorValue;if(!e||!t)return null;let o=this.api.allocationsForHold(e.holdId).flatMap(a=>a.items);if(!o.length)return null;let r=o.reduce((a,l)=>a+l.unitPrice*(l.quantity??1),0),s=o[0]?.currency??t.currency;try{return(0,Mt.formatMoney)(r,s,void 0,this.options.locale)}catch{return`${s} ${r.toFixed(2)}`}}includedPerformances(){let e=this.descriptorValue?.performances??[];if(this.descriptorValue?.inclusionMode!=="flexible_dates")return e;let t=new Set(this.api.includedPerformanceKeys());return e.filter(i=>t.has(i.eventKey))}syncIncludedDates(){let e=this.descriptorValue;if(!e||!this.datesSummaryHost||!this.datesCardsHost)return;let t=this.includedPerformances(),i=e.inclusionMode==="flexible_dates";this.datesSummaryHost.textContent=i&&t.length<e.performanceCount?this.copy("picker.group.flexibleDatesSelected",{selected:t.length,total:e.performanceCount}):this.copy(i?"picker.group.flexibleDatesInView":"picker.group.allDates",{count:e.performanceCount}),this.datesCardsHost.innerHTML=Dr(this.performanceCards({...e,performances:t}),this.copy(i&&t.length<e.performanceCount?"picker.group.flexibleSelectedNote":i?"picker.group.flexibleDatesNote":"picker.group.includedNote",{count:t.length}))}async selectPartialSeat(e,t){if(!(this.destroyed||this.holdBlocked()||this.activeHandoff||!t.length)){if((this.picker?.getSelection().length??0)>0){this.announce(this.copy("picker.group.clearBeforePartial"));return}this.partialSeatDates.set(e,[...t]),await this.applySeatDates(e,t,!1)}}async applySeatDates(e,t,i){if(this.destroyed||this.holdBlocked()||this.activeHandoff||!t.length)return!1;let o=this.api.includedPerformanceKeys();if(o.length===t.length&&o.every(r=>t.includes(r)))return!0;this.selectingPartialSeat=!0;try{if(this.api.setIncludedEventKeys(t),this.syncIncludedDates(),await this.picker?.refreshAvailability(),!(i?this.picker?.selectObjectsWithoutConfirmation([e])??[]:this.picker?.selectObjects([e])??[]).length)throw new Error("performance_group_partial_seat_unavailable");return this.announce(this.copy("picker.group.selectedAvailableDates",{count:t.length})),this.syncPane(),this.syncLegend(),!0}catch(r){return o.length&&(this.api.setIncludedEventKeys(o),this.syncIncludedDates(),await this.picker?.refreshAvailability().catch(()=>{})),this.options.onError?.(r),!1}finally{this.selectingPartialSeat=!1}}syncHoldTicker(){this.booked||(this.activeHandoff&&!this.holdTicker?this.holdTicker=setInterval(()=>this.syncPane(),1e3):!this.activeHandoff&&this.holdTicker&&(clearInterval(this.holdTicker),this.holdTicker=null))}async switchSelectionMode(e){if(!(this.destroyed||this.switchingMode||e===this.mode)&&!(this.activeHandoff||this.holdBlocked())){this.switchingMode=!0;try{this.api.setSelectionMode(e,this.options.numberOfPlacesToSelect),this.selectionModeValue=e,this.picker?.destroy(),this.picker=null,this.selectionsByEvent.clear(),this.validByEvent.clear(),this.markedLabels.clear(),this.availability=null;let t=this.descriptorValue;if(this.activePerformanceKey=t.performances[0]?.eventKey??null,this.buildChrome(Tp(this.options.container),t),await this.mountPicker(t),this.destroyed)return;this.announce(this.copy("picker.group.nightByNightStarted")),this.options.onSelectionModeChange?.(e)}catch(t){if(t instanceof ye)return;this.options.onError?.(t)}finally{this.switchingMode=!1}}}async release(){await this.picker?.release()}close(){this.destroy()}destroy(){if(this.destroyed)return;this.destroyed=!0,this.api.destroy(),this.hosted?.destroy(),this.holdTicker&&clearInterval(this.holdTicker),this.holdTicker=null;let e=this.picker;this.root?.setAttribute("hidden","");let t=()=>{e?.destroy(),this.access.clear(),this.root?.remove(),this.root=null,this.picker=null,this.innerHost=null,this.tabsHost=null,this.statusHost=null,this.statusCopy=null,this.statusAction=null,this.live=null};e?.getCurrentHold()&&!this.continued?e.release().catch(()=>{}).finally(t):t()}copy(e,t){let i=this.options.messages?.[e];return i!==void 0?t?i.replace(/\{(\w+)\}/g,(o,r)=>String(t[r]??`{${r}}`)):i:(0,Mt.t)(e,t)}performanceTabs(e){let t=document.createElement("div");t.className="sl-pg-tabsbar";let i=document.createElement("button");i.type="button",i.className="sl-pg-step",i.dataset.step="previous",i.setAttribute("aria-label",this.copy("picker.group.previousPerformance")),i.textContent="\u2039",i.addEventListener("click",()=>{this.stepPerformance(-1)});let o=document.createElement("button");o.type="button",o.className="sl-pg-step",o.dataset.step="next",o.setAttribute("aria-label",this.copy("picker.group.nextPerformance")),o.textContent="\u203A",o.addEventListener("click",()=>{this.stepPerformance(1)});let r=document.createElement("div");return r.className="sl-pg-tabs",r.setAttribute("role","tablist"),r.setAttribute("aria-label",this.copy("picker.group.performances")),e.performances.forEach((s,a)=>{let l=document.createElement("button");l.type="button",l.className="sl-pg-tab",l.id=`sl-pg-tab-${e.key}-${s.eventKey}`,l.dataset.eventKey=s.eventKey,l.dataset.state="not-started",l.setAttribute("role","tab"),l.setAttribute("aria-selected",String(a===0)),l.setAttribute("aria-controls",this.panelId),l.tabIndex=a===0?0:-1;let c=document.createElement("span");c.className="sl-pg-tab-name",c.textContent=s.name;let d=document.createElement("span");d.className="sl-pg-tab-state",d.textContent=this.copy("picker.group.stillNeedsSeat");let p=document.createElement("span");p.className="sl-pg-tab-badge",p.textContent=this.copy("picker.group.chosenOfTotal",{chosen:0,total:this.options.numberOfPlacesToSelect??1}),l.append(c,p,d),l.addEventListener("click",()=>{this.switchPerformance(s.eventKey)}),l.addEventListener("keydown",u=>this.tabKeydown(u)),r.appendChild(l)}),t.append(i,r,o),this.tabsHost=r,this.prevButton=i,this.nextButton=o,t}tabButtons(){return[...this.tabsHost?.querySelectorAll(".sl-pg-tab")??[]]}tabKeydown(e){let t=this.tabButtons(),i=t.findIndex(a=>a===e.target);if(i<0)return;let o=getComputedStyle(this.tabsHost??document.body).direction==="rtl",r=-1;switch(e.key){case"ArrowRight":r=i+(o?-1:1);break;case"ArrowLeft":r=i+(o?1:-1);break;case"ArrowDown":r=i+1;break;case"ArrowUp":r=i-1;break;case"Home":r=0;break;case"End":r=t.length-1;break;default:return}if(r<0||r>=t.length)return;e.preventDefault();let s=t[r];s.focus({preventScroll:!0}),s.disabled||this.switchPerformance(s.dataset.eventKey)}stepPerformance(e){let t=this.tabButtons(),i=t.findIndex(r=>r.dataset.eventKey===this.activePerformanceKey),o=t[i+e];!o||o.disabled||(o.focus({preventScroll:!0}),this.switchPerformance(o.dataset.eventKey))}submissionState(){let e=this.descriptorValue?.performances??[];if(this.mode!=="per_performance"){let o=!this.holdBlocked();return{complete:e.length,total:e.length,ready:o}}let t=this.options.numberOfPlacesToSelect,i=e.filter(o=>this.selectionsByEvent.get(o.eventKey)?.length===t&&this.validByEvent.get(o.eventKey)!==!1).length;return{complete:i,total:e.length,ready:i===e.length&&!this.holdBlocked()}}holdBlocked(){return this.operationPending||this.recovery.kind!=="idle"||!!this.availability?.salesClosed}selectionChanged(e){if(this.mode!=="per_performance"){this.options.onSelectionChange?.(e),this.syncPane(),this.syncLegend(),!e.length&&!this.activeHandoff&&!this.resettingFlexibleSelection&&!this.selectingPartialSeat&&this.descriptorValue?.inclusionMode==="flexible_dates"&&this.api.includedPerformanceKeys().length<this.descriptorValue.performanceCount&&(this.resettingFlexibleSelection=!0,this.api.setIncludedEventKeys(this.descriptorValue.performances.map(i=>i.eventKey)),this.syncIncludedDates(),this.picker?.refreshAvailability().catch(i=>this.options.onError?.(i)).finally(()=>{this.resettingFlexibleSelection=!1}));return}if(this.refreshingComposition||this.switchingPerformance||!this.activePerformanceKey)return;let t=e.map(i=>({...i}));this.selectionsByEvent.set(this.activePerformanceKey,t),this.api.setPerformanceSelections(this.activePerformanceKey,t.map(i=>({label:i.label}))),t.length!==this.options.numberOfPlacesToSelect?this.validByEvent.set(this.activePerformanceKey,!1):this.validByEvent.has(this.activePerformanceKey)||this.validByEvent.set(this.activePerformanceKey,!0),this.updateTabs(),this.options.onSelectionChange?.(e),this.refreshComposition(),this.syncLegend()}selectionValidityChanged(e){if(this.mode==="per_performance"&&!this.switchingPerformance&&this.activePerformanceKey){let t=this.validByEvent.get(this.activePerformanceKey);this.validByEvent.set(this.activePerformanceKey,e.isValid),this.updateTabs(),!this.refreshingComposition&&t!==e.isValid&&this.refreshComposition()}this.options.onSelectionValidityChange?.(e)}refreshComposition(){if(this.refreshingComposition||!this.picker)return;let e=this.submissionState();this.refreshingComposition=!0;try{this.picker.refreshPerformanceGroupComposition();let t=this.submissionState();(e.complete!==t.complete||e.ready!==t.ready)&&this.picker.refreshPerformanceGroupComposition()}finally{this.refreshingComposition=!1}}tabState(e){let t=this.options.numberOfPlacesToSelect??1,i=(this.selectionsByEvent.get(e)??[]).map(r=>r.label),o=this.copy("picker.group.chosenOfTotal",{chosen:i.length,total:t});return i.length===0?{key:"not-started",label:this.copy("picker.group.stillNeedsSeat"),badge:o}:i.length===t&&this.validByEvent.get(e)!==!1?{key:"complete",label:this.copy("picker.group.completeWithSeats",{seats:i.join(", ")}),badge:o}:i.length===t?{key:"needs-attention",label:this.copy("picker.group.needsAttention"),badge:o}:{key:"in-progress",label:this.copy("picker.group.needsMoreSeats",{count:t-i.length}),badge:o}}updateTabs(){let e=this.tabButtons(),t=this.switchingPerformance||this.operationPending||this.recovery.kind!=="idle"||!!this.activeHandoff;e.forEach(o=>{let r=o.dataset.eventKey,s=this.tabState(r),a=r===this.activePerformanceKey;o.dataset.state=s.key,o.disabled=t,o.setAttribute("aria-selected",String(a)),o.tabIndex=a?0:-1;let l=o.querySelector(".sl-pg-tab-state");l&&(l.textContent=s.label);let c=o.querySelector(".sl-pg-tab-badge");c&&(c.textContent=s.badge);let d=o.querySelector(".sl-pg-tab-name")?.textContent??r;o.setAttribute("aria-label",`${d}: ${s.badge} \xB7 ${s.label}`),a&&this.innerHost?.setAttribute("aria-labelledby",o.id)});let i=e.findIndex(o=>o.dataset.eventKey===this.activePerformanceKey);this.prevButton&&(this.prevButton.disabled=t||i<=0),this.nextButton&&(this.nextButton.disabled=t||i<0||i>=e.length-1)}async switchPerformance(e){if(this.mode!=="per_performance"||this.switchingPerformance||this.holdBlocked()||this.activeHandoff||e===this.activePerformanceKey||!this.picker)return;this.activePerformanceKey&&this.selectionChanged(this.picker.getSelection());let t=this.selectionsByEvent.get(e)?.map(i=>i.label)??[];this.switchingPerformance=!0,this.activePerformanceKey=e,this.updateTabs(),this.setInteractionLocked(!0);try{this.picker.clearSelection(),this.api.setActivePerformance(e),await this.picker.refreshAvailability();let i=this.picker.selectObjects(t);this.switchingPerformance=!1,this.selectionChanged(i),i.length!==t.length&&this.validByEvent.set(e,!1),this.options.onSelectionChange?.(i);let o=this.descriptorValue?.performances.find(r=>r.eventKey===e);o&&this.announce(this.copy("picker.group.performanceOpened",{performance:o.name}))}catch(i){this.options.onError?.(i)}finally{this.switchingPerformance=!1,!this.operationPending&&this.recovery.kind==="idle"&&this.setInteractionLocked(!1),this.updateTabs(),this.picker.refreshPerformanceGroupComposition()}}setInteractionLocked(e){let t=this.innerHost;t&&(t.dataset.locked=String(e),t.setAttribute("aria-busy",String(e)),t.setAttribute("aria-disabled",String(e)))}announce(e){this.live&&(this.live.textContent=e)}showStatus(e,t,i={}){this.statusHost&&this.statusCopy&&this.statusAction&&(this.statusCopy.textContent=t,this.statusHost.hidden=!t,this.statusAction.hidden=!i.retry),this.announce(t),this.options.onStatusChange?.({kind:e,message:t,...i.reference?{reference:i.reference}:{}})}sessionEnded(e){this.destroyed||(this.showStatus("session_ended",this.copy("picker.accessExpiredTitle")),this.options.onError?.(e))}clearStatus(){this.statusHost&&(this.statusHost.hidden=!0),this.statusAction&&(this.statusAction.hidden=!0),this.options.onStatusChange?.({kind:"idle",message:""})}operationChanged(e){if(this.destroyed)return;let t=e.state==="preparing"||e.state==="commit_pending"||e.state==="abort_pending"||e.state==="expire_pending";if(this.operationPending=t,this.setInteractionLocked(t||this.recovery.kind!=="idle"),this.updateTabs(),t){this.showStatus("pending",this.copy(e.state==="commit_pending"?"picker.group.commitPending":e.state==="abort_pending"||e.state==="expire_pending"?"picker.group.abortPending":"picker.group.securing"));return}if(e.state==="booked"){this.bookingSettled();return}if(e.state==="expired"||e.state==="aborted"){this.activeHandoff&&this.holdLost();return}if(e.state==="committed"){this.clearStatus(),this.announce(this.copy("picker.group.secured")),queueMicrotask(()=>this.innerHost?.querySelector('[data-ref="cta"]')?.focus({preventScroll:!0}));return}e.decision==="abort"&&this.recovery.kind==="idle"&&(this.clearStatus(),this.announce(this.copy("picker.group.notSecured")))}bookingSettled(){if(this.booked)return;this.booked=!0,this.root&&(this.root.dataset.booking="booked"),this.clearStatus(),this.holdTicker&&clearInterval(this.holdTicker),this.holdTicker=null;let e=this.activeHandoff?{...this.activeHandoff,bookingState:"booked"}:null;e&&(this.activeHandoff=e),this.syncProgress(),this.syncPane(),this.updateTabs(),this.picker?.notifyGroupSettled("booked"),this.announce(this.copy("picker.group.bookedAll",{count:this.descriptorValue?.performanceCount??0})),e&&this.options.onBooked?.(e)}holdLost(){this.activeHandoff=null,this.api.stopSettlementWatch(),this.resetPerPerformanceSelection(),this.syncProgress(),this.syncPane(),this.syncHoldTicker(),this.picker?.notifyGroupSettled("lost"),this.announce(this.copy("picker.group.notSecured")),this.options.onHoldChange?.(null),this.options.onHoldExpired?.()}recoveryChanged(e){if(!this.destroyed){if(this.recovery=e,this.setInteractionLocked(this.operationPending||e.kind!=="idle"),this.updateTabs(),this.refreshComposition(),e.kind==="idle"){this.operationPending||this.clearStatus();return}if(e.kind==="pending"){this.showStatus("pending",e.longRunning?this.copy("picker.group.longRunning",{reference:e.reference}):this.copy("picker.group.outcomeUnknown"),{reference:e.reference});return}this.showStatus("recovery_failed",this.copy("picker.group.longRunning",{reference:e.reference}),{retry:e.retryable,reference:e.reference}),this.setInteractionLocked(!1)}}async retryRecovery(){if(!(this.destroyed||this.recovery.kind!=="failed"||!this.recovery.retryable))try{await this.api.retryRecovery()}catch(e){if(e instanceof ye)return;this.options.onError?.(e)}}async restoreOperation(){try{let e=await this.api.restoreOperation();e&&!this.destroyed&&await this.picker?.adoptRestoredHold(e.holdId)}catch(e){if(e instanceof ye)return;this.options.onError?.(e)}}availabilityChanged(e){if(this.destroyed)return;let t=this.availability;if(this.availability=e,e.revisionChanged){this.showStatus("revision_changed",this.copy("picker.group.revisionChanged")),this.reloadDescriptor(e.revision);return}e.salesClosed?this.showStatus("sales_closed",this.copy("picker.group.salesClosed")):t?.salesClosed&&this.clearStatus(),this.updateTabs(),this.refreshComposition(),this.syncLegend()}async reloadDescriptor(e){this.api.acceptRevision(e);try{let t=await this.api.descriptor();if(this.destroyed)return;this.descriptorValue=t,await this.picker?.refreshAvailability()}catch(t){if(t instanceof ye)return;this.options.onError?.(t)}}handoff(e,t){let i=this.descriptorValue,o=this.api.operationIdForHold(e.holdId);if(!i||!o)throw new Error("seatlayer: Performance Group hold identity is unavailable");let r=this.api.allocationsForHold(e.holdId);return{operationId:o,holdId:e.holdId,expiresAt:e.expiresAt,performanceGroup:i,selectionMode:this.mode,performanceKeys:r.map(s=>s.eventKey),bookingState:this.booked?"booked":"held",seatLabels:t.map(s=>s.label),...this.mode==="per_performance"?{allocations:r.map(s=>({eventKey:s.eventKey,seatLabels:s.items.map(a=>a.label)}))}:{}}}renderHeldAllocations(e){if(!(!this.heldSummary||this.mode!=="per_performance")){this.heldSummary.replaceChildren();for(let t of e){let i=this.descriptorValue?.performances.find(s=>s.eventKey===t.eventKey),o=document.createElement("p"),r=document.createElement("strong");r.textContent=i?.name??t.eventKey,o.append(r,document.createTextNode(t.items.map(s=>s.label).join(", "))),this.heldSummary.appendChild(o)}this.heldSummary.hidden=e.length===0}}resetPerPerformanceSelection(){this.mode==="per_performance"&&(this.selectionsByEvent.clear(),this.validByEvent.clear(),this.heldSummary?.replaceChildren(),this.heldSummary&&(this.heldSummary.hidden=!0),this.updateTabs(),this.picker?.refreshPerformanceGroupComposition())}holdChanged(e,t){if(!e){this.activeHandoff=null,this.api.stopSettlementWatch(),this.resetPerPerformanceSelection(),this.syncProgress(),this.syncPane(),this.syncHoldTicker(),this.options.onHoldChange?.(null);return}let i=this.handoff(e,t),o=this.activeHandoff?.holdId!==i.holdId;this.activeHandoff=i,this.renderHeldAllocations(this.api.allocationsForHold(e.holdId)),this.updateTabs(),this.api.watchSettlement(e.holdId),this.syncProgress(),this.syncPane(),this.syncHoldTicker(),o&&this.options.onHold?.(i),this.options.onHoldChange?.(i)}checkout(e,t){let i=this.handoff(e,t);this.continued=!0,this.activeHandoff=i,this.options.onCheckout?.(i),this.hosted?.mode==="hosted"&&this.descriptorValue&&this.hosted.open(this.picker?.root??null,{...i,descriptor:this.descriptorValue})}};var Xn=require("@seatlayer/core");var Ep="seatlayer-season-picker-style";function Cp(){if(document.getElementById(Ep))return;let n=document.createElement("style");n.id=Ep,n.textContent=`
3606
- .sl-season-root{--sl-season-accent:var(--sl-accent,#7357d8);box-sizing:border-box;display:grid;gap:12px;min-width:0;max-width:100%;color:var(--sl-text,#18202b);font-family:var(--sl-font,Inter,system-ui,sans-serif)}
3607
- .sl-season-root *{box-sizing:border-box}.sl-season-root button,.sl-season-root summary{font:inherit}
3608
- .sl-season-hero{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:18px;padding:20px;border:1px solid var(--sl-line,#dde3ea);border-radius:18px;background:linear-gradient(135deg,color-mix(in srgb,var(--sl-season-accent) 10%,var(--sl-surface,#fff)),var(--sl-surface,#fff) 58%);box-shadow:0 10px 30px #18202b0a}
3609
- .sl-season-copy{display:grid;align-content:start;gap:7px;min-width:0}.sl-season-eyebrow{margin:0;color:var(--sl-season-accent);font-size:11px;font-weight:800;letter-spacing:.13em;text-transform:uppercase}.sl-season-copy h2{margin:0;font:750 clamp(22px,3vw,30px)/1.12 inherit;letter-spacing:-.025em}.sl-season-promise{max-width:62ch;margin:0;color:var(--sl-muted,#627081);font-size:14px;line-height:1.5}
3610
- .sl-season-facts{display:flex;flex-wrap:wrap;gap:7px;margin-top:4px}.sl-season-fact{padding:6px 9px;border:1px solid color-mix(in srgb,var(--sl-season-accent) 20%,var(--sl-line,#dde3ea));border-radius:999px;background:color-mix(in srgb,var(--sl-surface,#fff) 78%,transparent);font-size:12px;font-weight:700}
3611
- .sl-season-offer{display:grid;align-content:start;gap:5px;min-width:190px;padding:15px 16px;border-radius:14px;background:var(--sl-text,#18202b);color:var(--sl-surface,#fff)}.sl-season-offer-label{font-size:11px;font-weight:750;letter-spacing:.08em;text-transform:uppercase;opacity:.72}.sl-season-price{font-size:25px;font-weight:800;line-height:1.1}.sl-season-was{text-decoration:line-through;opacity:.62;font-size:12px}.sl-season-saving{color:#d8ffca;font-size:12px;font-weight:750}.sl-season-price-note{max-width:24ch;font-size:12px;line-height:1.35;opacity:.76}
3612
- .sl-season-price-lines{display:grid;gap:9px;margin:0;padding:0;list-style:none}.sl-season-price-lines li{display:grid;gap:1px}.sl-season-price-category{font-size:11.5px;font-weight:700;opacity:.78}.sl-season-price-lines .sl-season-price{font-size:22px}.sl-season-price-scope{font-size:11.5px;opacity:.72}
3613
- .sl-season-package-total{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 8px;margin:0;padding:10px 0 0;border-top:1px solid var(--sl-line,#dde3ea);font-size:12px;color:var(--sl-muted,#627081)}.sl-season-package-total strong{color:var(--sl-text,#18202b);font-size:18px}.sl-season-package-total-scope{flex-basis:100%;font-size:11.5px}
3614
- .sl-season-benefits{display:flex;flex-wrap:wrap;gap:7px;grid-column:1/-1;margin:2px 0 0;padding:0;list-style:none}.sl-season-benefits li{display:inline-flex;align-items:center;gap:6px;padding:7px 10px;border-radius:9px;background:color-mix(in srgb,var(--sl-season-accent) 9%,var(--sl-surface,#fff));font-size:12px;font-weight:650}.sl-season-benefits li:before{content:'\u2713';color:var(--sl-success,#16734b);font-weight:900}
3615
- .sl-season-dates{grid-column:1/-1;border-top:1px solid var(--sl-line,#dde3ea);padding-top:12px}.sl-season-dates summary{display:flex;align-items:center;justify-content:space-between;gap:12px;cursor:pointer;font-size:13px;font-weight:750;list-style:none}.sl-season-dates summary::-webkit-details-marker{display:none}.sl-season-dates summary:after{content:'+';font-size:18px;font-weight:500}.sl-season-dates[open] summary:after{content:'\u2212'}.sl-season-date-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:7px;margin:11px 0 0;padding:0;list-style:none}.sl-season-date{display:grid;gap:2px;padding:9px 10px;border:1px solid var(--sl-line,#dde3ea);border-radius:10px;background:var(--sl-surface,#fff)}.sl-season-date b{font-size:12.5px}.sl-season-date time{color:var(--sl-muted,#627081);font-size:11.5px}
3616
- .sl-season-progress{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));margin:0;padding:0;list-style:none;border:1px solid var(--sl-line,#dde3ea);border-radius:13px;background:var(--sl-surface,#fff);overflow:hidden}.sl-season-progress li{display:flex;align-items:center;gap:8px;min-width:0;padding:10px 12px;color:var(--sl-muted,#627081);font-size:12px;font-weight:700}.sl-season-progress li+li{border-inline-start:1px solid var(--sl-line,#dde3ea)}.sl-season-progress span{display:grid;place-items:center;flex:none;width:22px;height:22px;border-radius:50%;background:var(--sl-soft,#f4f6f8);font-size:11px}.sl-season-progress li[data-state=current]{color:var(--sl-text,#18202b)}.sl-season-progress li[data-state=current] span{background:var(--sl-season-accent);color:#fff}.sl-season-progress li[data-state=done]{color:var(--sl-success,#16734b)}
3617
- .sl-season-stage{display:grid;grid-template-columns:minmax(0,1fr) minmax(230px,290px);gap:12px;align-items:start}.sl-season-map{position:relative;min-width:0;height:640px;min-height:640px}.sl-season-summary-card{position:sticky;top:12px;display:grid;gap:10px;padding:16px;border:1px solid var(--sl-line,#dde3ea);border-radius:15px;background:var(--sl-surface,#fff)}.sl-season-summary-card h3{margin:0;font-size:15px}.sl-season-selection{margin:0;color:var(--sl-muted,#627081);font-size:13px;line-height:1.45}.sl-season-selection strong{color:var(--sl-text,#18202b)}.sl-season-rule{display:flex;gap:9px;align-items:flex-start;padding:10px;border-radius:10px;background:color-mix(in srgb,var(--sl-season-accent) 8%,var(--sl-soft,#f4f6f8));font-size:12px;line-height:1.4}.sl-season-rule i{display:grid;place-items:center;flex:none;width:20px;height:20px;border-radius:50%;background:var(--sl-season-accent);color:#fff;font-style:normal;font-size:11px;font-weight:850}.sl-season-availability{margin:0;color:var(--sl-success,#16734b);font-size:12px;font-weight:750}.sl-season-checkout-note{margin:0;padding-top:10px;border-top:1px solid var(--sl-line,#dde3ea);color:var(--sl-muted,#627081);font-size:11.5px;line-height:1.45}
3618
- .sl-season-status{min-height:20px;margin:0;padding:0 4px;color:var(--sl-muted,#627081);font-size:13px}.sl-season-status[data-kind=ready]{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.sl-season-status[data-kind=failed],.sl-season-status[data-kind=partial_terminal]{position:static;width:auto;height:auto;margin:0;padding:10px 12px;overflow:visible;clip:auto;border-radius:10px;background:#fff1f0;color:var(--sl-danger,#b42318);font-weight:700}.sl-season-root[data-busy=true] .sl-season-map{opacity:.82;pointer-events:none}
3619
- @media(max-width:820px){.sl-season-stage{grid-template-columns:1fr}.sl-season-summary-card{position:static;order:-1}.sl-season-map{height:590px;min-height:590px}}
3620
- @media(max-width:560px){.sl-season-root{gap:9px}.sl-season-hero{grid-template-columns:1fr;padding:15px;border-radius:14px}.sl-season-offer{min-width:0}.sl-season-progress{grid-template-columns:1fr}.sl-season-progress li+li{border-inline-start:0;border-top:1px solid var(--sl-line,#dde3ea)}.sl-season-progress li[data-state=upcoming]{display:none}.sl-season-date-list{grid-template-columns:1fr}.sl-season-map{height:560px;min-height:560px}.sl-season-summary-card{padding:13px}.sl-season-benefits{display:grid;grid-template-columns:1fr}}
3621
- `,document.head.appendChild(n)}var eg=new Set(["audience_not_public","sales_not_open","origin_not_allowed"]),tg=3e4;function ng(n,e){if(!n||typeof n!="object"||Array.isArray(n))return!1;let t=n;return typeof t.token=="string"&&t.token.length>0&&typeof t.expiresAt=="number"&&Number.isFinite(t.expiresAt)&&t.expiresAt>Date.now()&&t.seasonKey===e&&Array.isArray(t.planActivationIds)&&t.planActivationIds.every(i=>typeof i=="string"&&!!i)}var bi=class extends Error{constructor(t,i){super(`season_public_session_refused:${t}`);this.reason=t;this.status=i;this.name="SeasonPublicSessionRefused"}},ht,Lt,yi,zn,es=class{constructor(e){this.options=e;R(this,ht,null);R(this,Lt,null);R(this,yi);R(this,zn);S(this,yi,e.fetch??globalThis.fetch.bind(globalThis)),S(this,zn,e.origin??(typeof location>"u"?void 0:location.origin))}get session(){return m(this,ht)}async mint(e=!1){if(e&&S(this,ht,null),m(this,ht)&&m(this,ht).expiresAt-tg>Date.now())return m(this,ht);if(m(this,Lt))return m(this,Lt);let t=(async()=>{let i=await m(this,yi).call(this,`${this.options.base}/pub/seasons/${encodeURIComponent(this.options.season)}/sessions`,{method:"POST",body:JSON.stringify(m(this,zn)?{origin:m(this,zn)}:{}),credentials:"omit"}),o=await i.json().catch(()=>null);if(!i.ok){let r=o?.code??o?.error;if(i.status===403&&r&&eg.has(r)){let s=r;throw this.options.onRefused?.({reason:s,code:r,status:i.status,retryable:s==="sales_not_open"}),new bi(s,i.status)}throw new Error(`season_public_session_failed_${i.status}`)}if(!ng(o,this.options.season))throw new Error("season_public_session_invalid");return S(this,ht,o),o})();S(this,Lt,t);try{return await t}finally{m(this,Lt)===t&&S(this,Lt,null)}}async token(e){let t=e==="expiring"||e==="expired"||e==="unauthorized"||e==="manual",i=await this.mint(t);return{token:i.token,expiresAt:i.expiresAt}}};ht=new WeakMap,Lt=new WeakMap,yi=new WeakMap,zn=new WeakMap;function Ap(n){let e=new es(n);return{access:new De({provider:({reason:i})=>e.token(i),...n.accessHooks}),loader:e}}Jo();var ig="https://api.seatlayer.io",og=6e4,rg=5e3,te=class extends Error{constructor(t,i,o){super(`season_request_failed:${t}`);this.code=t;this.status=i;this.name="SeasonApiError",o?.retryAfterS!==void 0&&(this.retryAfterS=o.retryAfterS),o?.retryable!==void 0&&(this.retryable=o.retryable),o?.reason!==void 0&&(this.reason=o.reason)}},wi=class extends Error{constructor(t){super(`season_operation_timeout:${t}`);this.operationId=t;this.name="SeasonRecoveryTimeoutError"}};function sg(n,e){let t=Number(n.headers.get("Retry-After")),i=Number.isFinite(t)&&t>=0?t:e.retryAfterSeconds;return Math.max(0,Math.min(rg,i*1e3))}function ag(n,e){return e?.aborted?Promise.reject(e.reason??new DOMException("Aborted","AbortError")):new Promise((t,i)=>{let o=setTimeout(t,n);e?.addEventListener("abort",()=>{clearTimeout(o),i(e.reason??new DOMException("Aborted","AbortError"))},{once:!0})})}function Pp(n){if(!n||typeof n!="object")return"unknown";let e=n;return typeof e.code=="string"?e.code:typeof e.error=="string"?e.error:"unknown"}function lg(n,e){let t=e&&typeof e=="object"?e:{},i=(n.headers.get("Retry-After")??"").trim(),o=i?Number(i):Number.NaN;return{...Number.isFinite(o)&&o>=0?{retryAfterS:Math.ceil(o)}:{},...typeof t.retryable=="boolean"?{retryable:t.retryable}:{},...typeof t.reason=="string"?{reason:t.reason}:{}}}var cg=/^shc_[a-f0-9]{40}$/,dg=/^shh_[a-f0-9]{40}$/,pg=new Set(["preparing","commit_pending","committed","expire_pending","booking_pending","abort_pending","aborted","partial_terminal","expired","booked"]),hg=new Set(["pending","prepared","refused","applied","expired","booked","aborted"]);function ts(n){return Array.isArray(n)?n.some(ts):!n||typeof n!="object"?!1:Object.entries(n).some(([e,t])=>e==="childHoldId"||e==="child_hold_id"||e==="holdId"&&typeof t=="string"&&cg.test(t)||ts(t))}function vi(n,e,t="invalid_operation_response"){if(!n||typeof n!="object"||Array.isArray(n))throw new te(t,502);if(ts(n))throw new te("unsafe_operation_response",502);let i=n,o=i.allocations,r=new Set,s=Array.isArray(o)&&o.length>0&&o.every(p=>{if(!p||typeof p!="object")return!1;let u=p.eventId,h=p.state;return typeof u!="string"||!u||typeof h!="string"||!hg.has(h)||r.has(u)?!1:(r.add(u),!0)}),a=i.bookingRef===null||typeof i.bookingRef=="string"&&i.bookingRef.length>0,l=i.state!=="booked"||typeof i.bookingRef=="string"&&s&&o.every(p=>p.state==="booked"),c=i.state!=="booking_pending"||typeof i.bookingRef=="string"&&s&&o.some(p=>p.state!=="booked"),d=i.state!=="committed"||i.bookingRef===null;if(i.operationId!==e.operationId||i.seasonId!==e.seasonId||i.kind!=="HOLD"||typeof i.holdId!="string"||!dg.test(i.holdId)||i.policy!=="fixed_inclusion_same_seat"||typeof i.state!="string"||!pg.has(i.state)||typeof i.expiresAt!="number"||!Number.isFinite(i.expiresAt)||i.expiresAt<0||!a||typeof i.location!="string"||!i.location||typeof i.retryAfterSeconds!="number"||!Number.isFinite(i.retryAfterSeconds)||i.retryAfterSeconds<0||!s||!l||!c||!d||i.pricingAuthority!==void 0&&i.pricingAuthority!=="host"||i.authoritativeAmountIncluded!==void 0&&i.authoritativeAmountIncluded!==!1)throw new te(t,502);return{operationId:i.operationId,seasonId:i.seasonId,kind:i.kind,holdId:i.holdId,expiresAt:i.expiresAt,policy:i.policy,pricingAuthority:"host",authoritativeAmountIncluded:!1,state:i.state,bookingRef:i.bookingRef,location:i.location,retryAfterSeconds:i.retryAfterSeconds,allocations:o.map(p=>({eventId:p.eventId,state:p.state}))}}function ug(n,e,t){if(!Array.isArray(n)||n.length!==t||n.some(s=>typeof s!="string"||!s)||new Set(n).size!==n.length||!Array.isArray(e)||e.length!==n.length)throw new te("invalid_best_available_response",502);let i=n,o=new Set(i),r=new Map;for(let s of e){if(!s||typeof s!="object")throw new te("invalid_best_available_response",502);let a=s;if(typeof a.label!="string"||!o.has(a.label)||r.has(a.label)||typeof a.objectId!="string"||!a.objectId||a.objectType!=="seat"||typeof a.categoryKey!="string"||!a.categoryKey||a.tierId!==null&&(typeof a.tierId!="string"||!a.tierId)||a.quantity!==void 0&&a.quantity!==1)throw new te("invalid_best_available_response",502);r.set(a.label,{label:a.label,objectId:a.objectId,objectType:"seat",categoryKey:a.categoryKey,tierId:a.tierId,...a.quantity===void 0?{}:{quantity:a.quantity}})}return{labels:i,items:i.map(s=>r.get(s))}}function mg(n){if(!n||typeof n!="object"||Array.isArray(n))return null;let e=n;if(typeof e.currency!="string"||!e.currency||!Array.isArray(e.packages))return null;let t=[];for(let i of e.packages){if(!i||typeof i!="object")continue;let o=i;if(typeof o.planKey!="string"||!o.planKey||!Array.isArray(o.prices))continue;let r=[],s=new Set;for(let a of o.prices){if(!a||typeof a!="object")continue;let l=a;typeof l.categoryKey!="string"||!l.categoryKey||s.has(l.categoryKey)||typeof l.unitPrice!="number"||!Number.isInteger(l.unitPrice)||l.unitPrice<0||(s.add(l.categoryKey),r.push({categoryKey:l.categoryKey,unitPrice:l.unitPrice}))}r.length&&t.push({planKey:o.planKey,name:typeof o.name=="string"&&o.name?o.name:o.planKey,prices:r})}return t.length?{currency:e.currency,packages:t}:null}function fg(n){if(!n||typeof n!="object"||Array.isArray(n))throw new te("invalid_checkout_response",502);let e=n,t=typeof e.redirectUrl=="string"&&!!e.redirectUrl,i=Ri(e.redirectUrl);if(t&&!i)throw new te("gateway_unavailable",502);if(typeof e.orderId!="string"||!e.orderId||typeof e.currency!="string"||!e.currency||typeof e.totalMinor!="number"||!Number.isFinite(e.totalMinor)||typeof e.expiresAt!="number"||!Number.isFinite(e.expiresAt)||!i)throw new te("invalid_checkout_response",502);return{orderId:e.orderId,totalMinor:e.totalMinor,currency:e.currency,expiresAt:e.expiresAt,redirectUrl:i}}function Mp(n,e){return{seasonKey:n.key,planActivationId:n.planActivationId,operationId:e.operationId,holdId:e.holdId,expiresAt:e.expiresAt,policy:e.policy,pricingAuthority:"host",authoritativeAmountIncluded:!1,state:e.state,allocations:e.allocations.map(({eventId:t,state:i})=>({eventKey:t,state:i}))}}var qe,Qt,et,Zt,xi,tt,nt,Me,Ke,Lp,Uo=class{constructor(e,t){R(this,Me);R(this,qe);R(this,Qt);R(this,et);R(this,Zt);R(this,xi);R(this,tt,!1);R(this,nt,null);S(this,qe,e),S(this,Qt,(t.apiBase??ig).replace(/\/$/,"")),S(this,et,t.access),S(this,Zt,t.fetch??globalThis.fetch.bind(globalThis)),S(this,xi,t.recoveryTimeoutMs??og),m(this,et).onRenewed(i=>x(this,Me,Lp).call(this,i))}async descriptor(){let{body:e}=await x(this,Me,Ke).call(this,"GET","");return e.season}async chart(){let{body:e}=await x(this,Me,Ke).call(this,"GET","/chart");return e}async availability(){let{body:e}=await x(this,Me,Ke).call(this,"GET","/availability"),t=Object.values(e.seats??{});return{...e,freeCount:t.filter(i=>i==="free").length,blockedCount:t.filter(i=>i!=="free").length}}async hold(e,t){let{body:i,response:o}=await x(this,Me,Ke).call(this,"POST","/holds",{operationId:t,labels:[...e]});return{operation:vi(i.operation,{seasonId:m(this,qe),operationId:t}),response:o}}async bestAvailable(e){let{body:t,response:i}=await x(this,Me,Ke).call(this,"POST","/best-available",{operationId:e.operationId,qty:e.qty,...e.categoryKey?{categoryKey:e.categoryKey}:{},...e.zoneId?{zoneId:e.zoneId}:{},...e.accessibility?.length?{accessibility:[...e.accessibility]}:{},...e.requireContiguous===!0?{requireContiguous:!0}:{}}),o=vi(t.operation,{seasonId:m(this,qe),operationId:e.operationId},"invalid_best_available_response"),{labels:r,items:s}=ug(t.labels,t.items,e.qty);return{operation:o,labels:r,items:s,response:i}}async operation(e){let{body:t,response:i}=await x(this,Me,Ke).call(this,"GET",`/operations/${encodeURIComponent(e)}`);return{operation:vi(t.operation,{seasonId:m(this,qe),operationId:e}),response:i}}async release(e,t){let{body:i,response:o}=await x(this,Me,Ke).call(this,"POST",`/holds/${encodeURIComponent(e)}/release`,{releaseActionId:t});return{operation:vi(i.operation,{seasonId:m(this,qe),operationId:e}),response:o}}async prices(){let e;try{({body:e}=await x(this,Me,Ke).call(this,"GET","/prices"))}catch(t){if(t instanceof te&&t.status===404)return null;throw t}return mg(e)}async checkout(e){let{body:t}=await x(this,Me,Ke).call(this,"POST","/checkout",{operationId:e.operationId,buyerEmail:e.buyerEmail,...e.buyerName?{buyerName:e.buyerName}:{},...e.provider?{provider:e.provider}:{},...e.returnUrl?{returnUrl:e.returnUrl}:{}});return fg(t)}async orderStatus(e){let t=await m(this,Zt).call(this,`${m(this,Qt)}/pub/orders/${encodeURIComponent(e)}/status`,{method:"GET",credentials:"omit"}),i=await t.json().catch(()=>null);if(!t.ok)throw new te(Pp(i),t.status);if(i===null)throw new te("invalid_json_response",502);return i}async renewalIntent(e){let{body:t}=await x(this,Me,Ke).call(this,"POST","/renewal-intents",{offerId:e}),i=t.intent;if(!i||i.offerId!==e||i.state!=="intent_received"||!i.intentId||!Number.isFinite(i.receivedAt))throw new te("invalid_renewal_intent_response",502);return i}async waitForTerminal(e,t,i){let o=Date.now(),r=t?{operation:vi(t.operation,{seasonId:m(this,qe),operationId:e}),response:t.response}:await this.operation(e);for(;r.operation.state==="preparing"||r.operation.state==="commit_pending"||r.operation.state==="expire_pending"||r.operation.state==="booking_pending"||r.operation.state==="abort_pending";){if(Date.now()-o>=m(this,xi))throw new wi(e);await ag(sg(r.response,r.operation),i),r=await this.operation(e)}return r.operation}destroy(){m(this,tt)||(S(this,tt,!0),m(this,et).onRenewed(void 0),m(this,et).clear())}};qe=new WeakMap,Qt=new WeakMap,et=new WeakMap,Zt=new WeakMap,xi=new WeakMap,tt=new WeakMap,nt=new WeakMap,Me=new WeakSet,Ke=async function(e,t,i,o=!0){if(m(this,tt))throw new te("season_api_destroyed",409);if(m(this,nt))throw m(this,nt);let r=await m(this,et).authorization();if(m(this,tt))throw new te("season_api_destroyed",409);if(m(this,nt))throw m(this,nt);if(!r)throw new he({reason:"no_token",retryable:!1});let s=await m(this,Zt).call(this,`${m(this,Qt)}/pub/seasons/${encodeURIComponent(m(this,qe))}${t}`,{method:e,headers:{Authorization:r,...i===void 0?{}:{"Content-Type":"application/json"}},body:i===void 0?void 0:JSON.stringify(i)}),a=await s.json().catch(()=>null);if(!s.ok){let l=Pp(a);if(o&&await m(this,et).handleFailure(s.status,l,r))return x(this,Me,Ke).call(this,e,t,i,!1);let c=m(this,et).unavailable;throw c?new he(c):new te(l,s.status,lg(s,a))}if(a===null)throw new te("invalid_json_response",502);return{body:a,response:s}},Lp=async function(e){if(m(this,tt))return;let t=`/pub/seasons/${encodeURIComponent(m(this,qe))}/session/adopt`;for(let i=0;i<2;i++){if(m(this,tt))return;try{if((await m(this,Zt).call(this,`${m(this,Qt)}${t}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e.token}`},body:JSON.stringify({previousToken:e.previousToken}),credentials:"omit"})).ok){S(this,nt,null);return}}catch{}}if(!m(this,tt))throw S(this,nt,new te("season_session_adopt_failed",409)),m(this,nt)};var gg=2500;function bg(n){let e=typeof n=="string"?document.querySelector(n):n;if(!e)throw new Error("seatlayer: Season picker container was not found");return e}function yg(n,e,t){if(n.startsAt==null)return{date:"Date to be announced",time:null};try{let i=new Date(n.startsAt),o=e?{timeZone:e}:{};return{date:new Intl.DateTimeFormat(t,{dateStyle:"medium",...o}).format(i),time:new Intl.DateTimeFormat(t,{timeStyle:"short",...o}).format(i)}}catch{return{date:"Date to be announced",time:null}}}function Hp(n){return n.state==="committed"||n.state==="booked"}var ns=class{constructor(e,t,i,o){this.transport=e;this.sink=t;this.intervalMs=i;this.onSessionEnded=o;this.timer=null;this.stopped=!0;this.prior={}}start(){this.stopped&&(this.stopped=!1,this.timer=setTimeout(()=>{this.tick()},this.intervalMs))}stop(){this.stopped=!0,this.timer&&clearTimeout(this.timer),this.timer=null}async tick(){if(!this.stopped)try{let e=await this.transport.objects(""),t=Object.entries(e.seats).filter(([i,o])=>this.prior[i]!==o).map(([i,o])=>({label:i,status:o}));this.prior={...e.seats},t.length&&this.sink.applyStatuses(t)}catch(e){if(Zi(e)){this.stop(),this.onSessionEnded?.(e);return}this.stopped||await this.sink.resync()}finally{this.stopped||(this.timer=setTimeout(()=>{this.tick()},this.intervalMs))}}},is=class{constructor(e,t,i){this.api=e;this.realtimePollMs=t;this.onSessionEnded=i;this.descriptorValue=null;this.availabilityValue=null;this.categoryLabels=new Map;this.reuseAvailabilityOnce=!1;this.nextOperationId=null;this.nextBestAvailable=null;this.nextReleaseActionId=null;this.operationByHold=new Map;this.chartPrefetch=null}prime(e,t){this.descriptorValue=e,this.availabilityValue=t,this.reuseAvailabilityOnce=!0}takeChartPrefetch(){let e=this.chartPrefetch;return this.chartPrefetch=null,e}primeChart(e){e.catch(()=>{}),this.chartPrefetch=e}queueOperation(e){this.nextOperationId=e}queueBestAvailable(e,t){if(this.nextBestAvailable)throw new te("season_best_available_in_progress",409);let i={operationId:e,...t.accessibility?.length?{accessibility:[...t.accessibility]}:{},...t.requireContiguous===!0?{requireContiguous:!0}:{}};return this.nextBestAvailable=i,i}clearBestAvailable(e){this.nextBestAvailable===e&&(this.nextBestAvailable=null)}queueRelease(e){this.nextReleaseActionId=e}operationForHold(e){return this.operationByHold.get(e)??null}remember(e){this.operationByHold.set(e.holdId,e)}forget(e){this.operationByHold.delete(e)}async chart(e){let[t,i]=await Promise.all([this.descriptorValue?Promise.resolve(this.descriptorValue):this.api.descriptor(),this.takeChartPrefetch()??this.api.chart()]);this.descriptorValue=t;for(let o of i.categories??[])typeof o?.key=="string"&&typeof o.label=="string"&&this.categoryLabels.set(o.key,o.label);return{doc:i,event:{key:t.key,name:t.name,venue:t.venue,startsAt:t.occurrences[0]?.startsAt??null,timezone:t.timezone,currency:t.currency,mode:t.mode,inventoryModelVersion:2}}}async objects(e){let t;return this.reuseAvailabilityOnce&&this.availabilityValue?(this.reuseAvailabilityOnce=!1,t=this.availabilityValue):(t=await this.api.availability(),this.availabilityValue=t),{seats:{...t.seats}}}async hold(e,t,i,o){if(o)throw new te("season_hold_replace_unsupported",409);let r=this.nextOperationId??`sop_${crypto.randomUUID()}`;this.nextOperationId=null;let s=await this.api.hold(t.map(l=>l.label),r),a=await this.api.waitForTerminal(r,s);if(!Hp(a))throw new te(`season_operation_${a.state}`,409);return this.remember(a),{holdId:a.holdId,expiresAt:a.expiresAt,items:t.map(l=>({label:l.label,objectId:l.label,objectType:"seat",categoryKey:"",tierId:l.tierId??null,unitPrice:0,currency:this.descriptorValue?.currency??"USD",...l.quantity==null?{}:{quantity:l.quantity}}))}}async release(e,t,i){let o=this.operationForHold(i);if(!o)throw new te("season_hold_not_found",404);let r=this.nextReleaseActionId??`sra_${crypto.randomUUID()}`;this.nextReleaseActionId=null;let s=await this.api.release(o.operationId,r),a=await this.api.waitForTerminal(o.operationId,s);if(a.state==="partial_terminal")throw this.remember(a),new te("season_operation_partial_terminal",409);this.forget(i)}async bestAvailable(e,t,i,o){let r=this.nextBestAvailable;this.nextBestAvailable=null;let s=r?.operationId??`sop_${crypto.randomUUID()}`,a=await this.api.bestAvailable({operationId:s,qty:t,...i?{categoryKey:i}:{},...o?{zoneId:o}:{},...r?.accessibility?.length?{accessibility:r.accessibility}:{},...r?.requireContiguous===!0?{requireContiguous:!0}:{}}),l=await this.api.waitForTerminal(s,a);if(!Hp(l))throw new te(`season_operation_${l.state}`,409);this.remember(l);let c=new Map(a.items.map(d=>[d.label,d]));return{holdId:l.holdId,expiresAt:l.expiresAt,labels:[...a.labels],items:a.labels.map(d=>{let p=c.get(d);return{label:d,objectId:p?.objectId??d,objectType:"seat",categoryKey:p?.categoryKey??i??"",tierId:p?.tierId??null,unitPrice:0,currency:this.descriptorValue?.currency??"USD",...p?.quantity==null?{}:{quantity:p.quantity}}})}}categoryLabel(e){return this.categoryLabels.get(e)??e}socketUrl(){return""}createRealtime(e,t){return new ns(this,t,this.realtimePollMs,this.onSessionEnded)}},V,tn,Kn,Fe,xe,Si,Te,mt,ue,Le,We,Gn,Ht,ft,nn,Ge,Ti,Ye,Un,qn,on,Wn,Rt,rn,sn,Yn,E,Rp,Ip,os,rs,ss,as,qo,Jt,Op,_p,ut,ki,Np,Dp,ls,cs,Bp,Fp,Vp,ds,ps,de,en,$p,hs,jn,Wo=class{constructor(e){R(this,E);R(this,V);R(this,tn);R(this,Kn);R(this,Fe);R(this,xe);R(this,Si,new AbortController);R(this,Te,null);R(this,mt,null);R(this,ue,null);R(this,Le,null);R(this,We,null);R(this,Gn,null);R(this,Ht,null);R(this,ft,null);R(this,nn,null);R(this,Ge,[]);R(this,Ti,new Map);R(this,Ye,!1);R(this,Un,!1);R(this,qn);R(this,on,null);R(this,Wn,null);R(this,Rt,null);R(this,rn,"handoff");R(this,sn,null);R(this,Yn,!1);if(!e?.season)throw new Error("seatlayer: `season` key is required");if(!e.container)throw new Error("seatlayer: `container` is required");if("event"in e||"performanceGroup"in e)throw new Error("seatlayer: SeasonPicker is not SeatPicker or PerformanceGroupPicker");S(this,V,e),S(this,tn,bg(e.container));let t={onExpired:o=>e.onAccessExpired?.(o),onUnavailable:o=>{let r=m(this,on)&&o.reason==="provider_failed"?m(this,on):o;S(this,on,null),S(this,Wn,r.reason==="provider_failed"?null:r),e.onAccessUnavailable?.(r),x(this,E,Bp).call(this,r)}};if(!e.buyerAccessToken&&!e.buyerAccessTokenProvider){let{access:o,loader:r}=Ap({base:(e.apiBase??"https://api.seatlayer.io").replace(/\/$/,""),season:e.season,fetch:e.fetch,onRefused:s=>{S(this,on,s)},accessHooks:t});S(this,Kn,o),S(this,qn,r)}else S(this,qn,null),S(this,Kn,new De({token:e.buyerAccessToken,provider:e.buyerAccessTokenProvider,...t}));S(this,Fe,new Uo(e.season,{apiBase:e.apiBase,access:m(this,Kn),fetch:e.fetch,recoveryTimeoutMs:e.recoveryTimeoutMs})),S(this,xe,new is(m(this,Fe),Math.max(750,e.realtimePollMs??gg),o=>x(this,E,$p).call(this,o)))}async render(){x(this,E,hs).call(this),Cp(),x(this,E,Ip).call(this),x(this,E,de).call(this,{kind:"loading",message:"Loading Season seats available for every performance."},!0);try{m(this,xe).primeChart(m(this,Fe).chart());let[e,t,i]=await Promise.all([m(this,Fe).descriptor(),m(this,Fe).availability(),m(this,Fe).prices().catch(()=>null)]);return m(this,Ye)?this:(S(this,Te,e),S(this,mt,t),S(this,Rt,i),S(this,rn,m(this,V).checkout==="hosted"&&e.checkoutMode!=="server"&&i?"hosted":"handoff"),m(this,xe).prime(e,t),x(this,E,os).call(this),await x(this,E,Rp).call(this,e),m(this,Ye)?this:(i&&x(this,E,os).call(this),x(this,E,Vp).call(this),x(this,E,de).call(this,{kind:"ready",message:`${t.freeCount} seat${t.freeCount===1?"":"s"} available for every included performance.`}),m(this,V).initialOperationId&&await this.restoreOperation(m(this,V).initialOperationId),this))}catch(e){if(m(this,Ye))return this;throw x(this,E,en).call(this,e)}}async holdSameSeat(e,t){if(x(this,E,jn).call(this),!t.startsWith("sop_"))throw new Error("seatlayer: caller-stable Season operation id is required");if(!e.length)throw new Error("seatlayer: select at least one seat");if(m(this,xe).queueOperation(t),m(this,Le).selectObjectsWithoutConfirmation([...e]),x(this,E,de).call(this,{kind:"pending",message:"Holding the same seats for every performance.",operationId:t},!0),await m(this,Le).handleCta(),!m(this,ue))throw new te("season_hold_not_created",409);return m(this,ue)}async holdBestAvailable(e,t,i={}){if(x(this,E,jn).call(this),!t.startsWith("sop_"))throw new Error("seatlayer: caller-stable Season operation id is required");if(!Number.isInteger(e)||e<1)throw new Error("seatlayer: positive Best Available quantity is required");let o=m(this,Le).maxTickets;if(e>o)throw new Error(`seatlayer: Best Available quantity cannot exceed the configured maximum (${o})`);if(m(this,Un))throw new te("season_best_available_in_progress",409);S(this,Un,!0);let r=null;try{if(r=m(this,xe).queueBestAvailable(t,i),x(this,E,de).call(this,{kind:"pending",message:`Finding ${e} Season seat${e===1?"":"s"} available for every performance.`,operationId:t},!0),!await m(this,Le).bestAvailableOrThrow(e,i.categoryKey,{zoneId:i.zoneId})||!m(this,ue))throw new te("season_hold_not_created",409);return m(this,ue)}catch(s){throw x(this,E,en).call(this,s,t)}finally{r&&m(this,xe).clearBestAvailable(r),S(this,Un,!1)}}async restoreOperation(e){x(this,E,jn).call(this),x(this,E,de).call(this,{kind:"pending",message:"Restoring your Season selection.",operationId:e},!0);try{let t=await m(this,Fe).waitForTerminal(e,void 0,m(this,Si).signal);return t.state==="aborted"||t.state==="expired"?(S(this,ue,null),m(this,V).onHoldChange?.(null),x(this,E,de).call(this,{kind:"released",message:"The previous Season selection is no longer held.",operationId:e}),null):(m(this,xe).remember(t),x(this,E,as).call(this,t,!1))}catch(t){throw x(this,E,en).call(this,t,e)}}async release(e){x(this,E,jn).call(this);let t=m(this,ue);if(t){if(!e)throw new Error("seatlayer: caller-stable release action id is required");m(this,xe).queueRelease(e),x(this,E,de).call(this,{kind:"pending",message:"Releasing the Season seats.",operationId:t.operationId},!0);try{m(this,Le)?.getCurrentHold()?.holdId===t.holdId?await m(this,Le).release():(await m(this,xe).release("",[],t.holdId),x(this,E,qo).call(this)),x(this,E,de).call(this,{kind:"released",message:"The Season seats were released.",operationId:t.operationId})}catch(i){throw x(this,E,en).call(this,i,t.operationId)}}}async createRenewalIntent(e){if(x(this,E,jn).call(this),!e.startsWith("sro_"))throw new Error("seatlayer: Season renewal offer id is required");x(this,E,de).call(this,{kind:"pending",message:"Recording renewal intent. No purchase is made in the browser."},!0);try{let t=await m(this,Fe).renewalIntent(e);return x(this,E,de).call(this,{kind:"renewal_intent",message:"Renewal intent recorded. Your ticketing platform will confirm price, payment, and renewal."}),m(this,V).onRenewalIntent?.(t),t}catch(t){throw x(this,E,en).call(this,t)}}getDescriptor(){return m(this,Te)}getAvailability(){return m(this,mt)}getHandoff(){return m(this,ue)}destroy(){m(this,Ye)||(S(this,Ye,!0),m(this,Si).abort(),x(this,E,ps).call(this),m(this,Le)?.destroy(),m(this,Fe).destroy(),m(this,tn).replaceChildren(),S(this,We,null),S(this,Gn,null),S(this,Ht,null),S(this,ft,null),S(this,nn,null),S(this,Te,null),S(this,mt,null),S(this,ue,null))}};V=new WeakMap,tn=new WeakMap,Kn=new WeakMap,Fe=new WeakMap,xe=new WeakMap,Si=new WeakMap,Te=new WeakMap,mt=new WeakMap,ue=new WeakMap,Le=new WeakMap,We=new WeakMap,Gn=new WeakMap,Ht=new WeakMap,ft=new WeakMap,nn=new WeakMap,Ge=new WeakMap,Ti=new WeakMap,Ye=new WeakMap,Un=new WeakMap,qn=new WeakMap,on=new WeakMap,Wn=new WeakMap,Rt=new WeakMap,rn=new WeakMap,sn=new WeakMap,Yn=new WeakMap,E=new WeakSet,Rp=async function(e){let t=new dt(Vo({container:m(this,Gn),event:e.key,apiBase:m(this,V).apiBase,transport:m(this,xe),hideEventDetails:!0,maxSelection:m(this,V).maxSelection,selectedObjects:m(this,V).selectedObjects,selectableObjects:m(this,V).selectableObjects,numberOfPlacesToSelect:m(this,V).numberOfPlacesToSelect,selectionValidators:m(this,V).selectionValidators,locale:m(this,V).locale,messages:m(this,V).messages,languages:m(this,V).languages,colorblindSafe:m(this,V).colorblindSafe,initialView:m(this,V).initialView,enable3D:m(this,V).enable3D,max3DSeats:m(this,V).max3DSeats,hideBadge:m(this,V).hideBadge,theme:m(this,V).theme,confirmSelection:m(this,V).confirmSelection,seatView:m(this,V).seatView,onBuyerViewChange:m(this,V).onBuyerViewChange,onAnalytics:(i,o)=>{try{m(this,V).onAnalytics?.(i,{...o,metricScope:"season",seasonKey:e.key,planActivationId:e.planActivationId,performanceCount:e.occurrenceCount})}catch{}},onSelectionChange:i=>{S(this,Ge,i.map(o=>o.label)),S(this,Ti,new Map(i.filter(o=>!!o.categoryKey).map(o=>[o.label,o.categoryKey]))),x(this,E,Jt).call(this),m(this,V).onSelectionChange?.(i)},onSelectionValidityChange:m(this,V).onSelectionValidityChange,onHoldChange:i=>{if(!i){x(this,E,qo).call(this);return}let o=m(this,xe).operationForHold(i.holdId);o&&x(this,E,as).call(this,o,!0)},onCheckout:()=>{m(this,ue)&&(x(this,E,ut).call(this,"checkout"),m(this,V).onContinue?.(m(this,ue)),m(this,rn)==="hosted"&&x(this,E,Fp).call(this,m(this,ue)))},onHoldExpired:()=>{x(this,E,qo).call(this),x(this,E,de).call(this,{kind:"released",message:"The Season hold expired. Choose seats again."}),m(this,V).onHoldExpired?.()},onError:i=>x(this,E,en).call(this,i)},{surface:"season",performanceCount:e.occurrenceCount,selectionMode:"same_seat",suppressPricing:!0,groupSelectionSummary:()=>{let i=m(this,Ge).length;return i?{seats:i,performances:e.occurrenceCount,performancesChosen:e.occurrenceCount,perPerformance:i}:null}}));S(this,Le,t),await t.render()},Ip=function(){m(this,tn).replaceChildren();let e=document.createElement("section");e.className="sl-season-root",e.setAttribute("aria-label","Season ticket selection");let t=document.createElement("header");t.className="sl-season-hero",m(this,V).header===!1&&(t.style.display="none");let i=document.createElement("ol");i.className="sl-season-progress",i.setAttribute("aria-label","Season checkout progress");for(let[f,T]of["Choose seats","Review package","Checkout"].entries()){let w=document.createElement("li");w.dataset.state=f===0?"current":"upcoming";let v=document.createElement("span");v.textContent=String(f+1),w.append(v,T),i.append(w)}let o=document.createElement("div");o.className="sl-season-stage";let r=document.createElement("div");r.className="sl-season-map";let s=document.createElement("aside");s.className="sl-season-summary-card",s.setAttribute("aria-label","Your Season selection");let a=document.createElement("h3");a.textContent="Your Season seats";let l=document.createElement("p");l.className="sl-season-selection",l.textContent="Choose a seat on the map.";let c=document.createElement("p");c.className="sl-season-rule";let d=document.createElement("i");d.textContent="1\xD7";let p=document.createElement("span");p.textContent="Each seat you choose is reserved for every included performance.",c.append(d,p);let u=document.createElement("p");u.className="sl-season-availability";let h=document.createElement("p");h.className="sl-season-checkout-note",h.textContent="Your ticketing platform confirms package price, payment, admission passes, and member benefits.",s.append(a,l,c,u,h),o.append(r,s);let b=document.createElement("p");b.className="sl-season-status",b.setAttribute("role","status"),b.setAttribute("aria-live","polite"),e.append(t,i,o,b),m(this,tn).append(e),S(this,We,e),S(this,Gn,r),S(this,Ht,b),S(this,ft,l),S(this,nn,u)},os=function(){let e=m(this,Te),t=m(this,V).offer,i=m(this,We).querySelector(".sl-season-hero");i.replaceChildren();let o=document.createElement("div");o.className="sl-season-copy";let r=document.createElement("p");r.className="sl-season-eyebrow",r.textContent=t?.eyebrow??"Season ticket";let s=document.createElement("h2");s.textContent=e.edition?`${e.name} \xB7 ${e.edition}`:e.name;let a=document.createElement("p");a.className="sl-season-promise",a.textContent=`Choose once and keep the same seat for all ${e.occurrenceCount} included performances.`;let l=document.createElement("div");l.className="sl-season-facts";for(let h of[`${e.occurrenceCount} performances`,e.venue,t?.renewalLabel??"Same-seat package"].filter(Boolean)){let b=document.createElement("span");b.className="sl-season-fact",b.textContent=h,l.append(b)}o.append(r,s,a,l),i.append(o);let c=document.createElement("div");c.className="sl-season-offer";let d=document.createElement("span");d.className="sl-season-offer-label";let p=x(this,E,ki).call(this);if(p){d.textContent=y("season.packagePriceLabel","Package price"),c.append(d,x(this,E,Dp).call(this,p,e.occurrenceCount));let h=document.createElement("span");h.className="sl-season-price-note",h.textContent=y("season.packagePricePerSeat","Per seat, for the whole package."),c.append(h),i.append(c),x(this,E,rs).call(this,i,t),x(this,E,ss).call(this,i,e),x(this,E,Jt).call(this);return}d.textContent=t?.priceLabel?"Season package":"Package price";let u=document.createElement(t?.priceLabel?"strong":"span");if(u.className=t?.priceLabel?"sl-season-price":"sl-season-price-note",u.textContent=t?.priceLabel??"Confirmed by your ticketing platform at checkout",c.append(d,u),t?.compareAtPriceLabel){let h=document.createElement("span");h.className="sl-season-was",h.textContent=t.compareAtPriceLabel,c.append(h)}if(t?.savingsLabel){let h=document.createElement("span");h.className="sl-season-saving",h.textContent=t.savingsLabel,c.append(h)}if(t?.priceNote){let h=document.createElement("span");h.className="sl-season-price-note",h.textContent=t.priceNote,c.append(h)}i.append(c),x(this,E,rs).call(this,i,t),x(this,E,ss).call(this,i,e),x(this,E,Jt).call(this)},rs=function(e,t){if(!t?.benefits?.length)return;let i=document.createElement("ul");i.className="sl-season-benefits";for(let o of t.benefits.slice(0,6)){let r=document.createElement("li");r.textContent=o,i.append(r)}e.append(i)},ss=function(e,t){let i=document.createElement("details");i.className="sl-season-dates";let o=document.createElement("summary");o.textContent=`All ${t.occurrenceCount} performances included`;let r=document.createElement("ol");r.className="sl-season-date-list";for(let s of t.occurrences){let a=document.createElement("li");a.className="sl-season-date";let l=document.createElement("b");l.textContent=s.name;let c=yg(s,t.timezone,m(this,V).locale),d=document.createElement("time");s.startsAt!=null&&(d.dateTime=new Date(s.startsAt).toISOString()),d.textContent=c.time?`${c.date} \xB7 ${c.time}`:c.date,a.append(l,d),r.append(a)}i.append(o,r),e.append(i)},as=function(e,t){if(e.state==="booked")return S(this,ue,null),m(this,xe).forget(e.holdId),m(this,Le)?.notifyGroupSettled("booked"),x(this,E,ut).call(this,"complete"),x(this,E,de).call(this,{kind:"booked",message:`Your Season booking is complete for all ${m(this,Te).occurrenceCount} performances. No further checkout action is needed.`,operationId:e.operationId}),m(this,V).onHoldChange?.(null),null;if(e.state==="partial_terminal")return S(this,ue,null),S(this,Ge,[]),m(this,xe).forget(e.holdId),m(this,Le)?.notifyGroupSettled("lost"),x(this,E,Jt).call(this),x(this,E,ut).call(this,"review"),x(this,E,de).call(this,{kind:"partial_terminal",message:"This Season selection needs organizer review. Do not try another selection.",operationId:e.operationId}),m(this,V).onHoldChange?.(null),null;if(e.state!=="committed")return S(this,ue,null),m(this,xe).forget(e.holdId),m(this,Le)?.notifyGroupSettled("lost"),x(this,E,de).call(this,{kind:"failed",message:"The Season selection could not be completed.",operationId:e.operationId}),m(this,V).onHoldChange?.(null),null;let i=Mp(m(this,Te),e),o=m(this,ue)?.holdId!==i.holdId;return S(this,ue,i),x(this,E,Jt).call(this),x(this,E,ut).call(this,"review"),m(this,V).onHoldChange?.(i),x(this,E,de).call(this,{kind:"held",message:`Your seats are held for all ${m(this,Te).occurrenceCount} performances. Review and continue to checkout.`,operationId:e.operationId}),o&&t&&m(this,V).onHold?.(i),i},qo=function(){S(this,ue,null),S(this,Ge,[]),x(this,E,Jt).call(this),x(this,E,ut).call(this,"choose"),m(this,V).onHoldChange?.(null)},Jt=function(){if(!m(this,ft))return;let e=m(this,Ge).length;if(!e)m(this,ft).textContent="Choose a seat on the map. Unavailable seats are already booked on at least one included performance.";else{m(this,ft).replaceChildren();let t=document.createElement("strong");t.textContent=m(this,Ge).join(", "),m(this,ft).append(t,` \xB7 ${e} Season seat${e===1?"":"s"} across all ${m(this,Te)?.occurrenceCount??0} performances`)}m(this,nn)&&m(this,mt)&&(m(this,nn).textContent=`${m(this,mt).freeCount} seat${m(this,mt).freeCount===1?"":"s"} currently available for the complete Season`),x(this,E,Op).call(this),x(this,E,_p).call(this)},Op=function(){let e=m(this,We)?.querySelector(".sl-season-summary-card");if(!e)return;e.querySelector(".sl-season-package-total")?.remove();let t=x(this,E,ls).call(this);if(t==null)return;let i=m(this,Rt)?.currency??m(this,Te)?.currency??"USD",o=m(this,Te)?.occurrenceCount??0,r=document.createElement("p");r.className="sl-season-package-total";let s=document.createElement("span");s.textContent=y("season.packageTotal","Package total");let a=document.createElement("strong");a.textContent=x(this,E,cs).call(this,t,i);let l=document.createElement("span");l.className="sl-season-package-total-scope",l.textContent=y("season.priceForAllDates","for all {count} dates").replace("{count}",String(o)),r.append(s,a,l);let c=e.querySelector(".sl-season-checkout-note");c?e.insertBefore(r,c):e.append(r)},_p=function(){let e=m(this,We)?.querySelector(".sl-season-checkout-note");if(e){if(m(this,rn)==="hosted"){e.textContent=y("season.hostedCheckoutNote","You pay for the whole package here. Your tickets for every performance arrive by email.");return}if(x(this,E,ki).call(this)){e.textContent=y("season.serverCheckoutPricedNote","Payment and admission passes are completed in the checkout on this page.");return}e.textContent="Your ticketing platform confirms package price, payment, admission passes, and member benefits."}},ut=function(e){let t=e==="choose"?0:e==="review"?1:e==="checkout"?2:3;m(this,We)?.querySelectorAll(".sl-season-progress li").forEach((i,o)=>{i.dataset.state=o<t?"done":o===t?"current":"upcoming";let r=i.querySelector("span");r&&(r.textContent=o<t?"\u2713":String(o+1))})},ki=function(){let e=m(this,Rt)?.packages;if(!e?.length)return null;let t=m(this,Te)?.planActivationId,i=e.find(s=>s.planKey===t);if(i)return i;let o=m(this,qn)?.session?.planActivationIds;return(o?.length?e.filter(s=>o.includes(s.planKey)):[])[0]??e[0]},Np=function(e){let t=x(this,E,ki).call(this)?.prices.find(i=>i.categoryKey===e);return t?t.unitPrice:null},Dp=function(e,t){let i=document.createElement("ul");i.className="sl-season-price-lines";let o=m(this,Rt)?.currency??m(this,Te)?.currency??"USD";for(let r of e.prices){let s=document.createElement("li"),a=document.createElement("span");a.className="sl-season-price-category",a.textContent=m(this,xe).categoryLabel(r.categoryKey);let l=document.createElement("strong");l.className="sl-season-price",l.textContent=x(this,E,cs).call(this,r.unitPrice,o);let c=document.createElement("span");c.className="sl-season-price-scope",c.textContent=y("season.priceForAllDates","for all {count} dates").replace("{count}",String(t)),s.append(a,l,c),i.append(s)}return i},ls=function(){if(!m(this,Ge).length||!x(this,E,ki).call(this))return null;let e=0;for(let t of m(this,Ge)){let i=m(this,Ti).get(t),o=i?x(this,E,Np).call(this,i):null;if(o==null)return null;e+=o}return e},cs=function(e,t){let i=(0,Xn.fromMinorUnits)(e,t),o=Number.isInteger(i);return(0,Xn.formatMoney)(i,t,{locale:m(this,V).locale,fallback:(r,s)=>`${r} ${s}`,...o?{minimumFractionDigits:0,maximumFractionDigits:0}:{}})},Bp=function(e){let t=e.reason==="audience_not_public"?y("season.accessNotPublic","This season isn't open for online booking yet."):e.reason==="sales_not_open"?y("season.accessSalesNotOpen","Season tickets aren't on sale right now. Check back when sales open."):e.reason==="origin_not_allowed"?y("season.accessOriginNotAllowed","This season can't be booked from this page."):y("season.accessUnavailable","Season tickets can't be loaded right now. Please try again later.");x(this,E,de).call(this,{kind:"failed",message:t})},Fp=async function(e){if(!m(this,Yn)){S(this,Yn,!0);try{let t=m(this,Rt)?.currency??m(this,Te)?.currency??"USD",i=x(this,E,ls).call(this);if(i==null){x(this,E,de).call(this,{kind:"failed",message:y("season.checkoutNotPriced","We can\u2019t price this package here. Your seats are still held \u2014 please continue in the checkout on this page."),operationId:e.operationId});return}await x(this,E,ds).call(this,{kind:"pay",provider:null,order:{holdId:e.operationId,expiresAt:e.expiresAt,currency:t,total:(0,Xn.fromMinorUnits)(i,t),labels:[...m(this,Ge)]}})}finally{S(this,Yn,!1)}}},Vp=function(){if(m(this,rn)!=="hosted")return;let e=Nn(m(this,V).season);e?.outcome!=="success"||!e.orderId||(x(this,E,ut).call(this,"checkout"),x(this,E,ds).call(this,{kind:"resume",orderId:e.orderId}))},ds=async function(e){let t;try{({mountCheckout:t}=await un())}catch(o){m(this,V).onError?.(o),x(this,E,de).call(this,{kind:"failed",message:y("season.checkoutCouldNotBeOpened","Checkout could not be opened. Your seats are still held. Please try again.")});return}let i=m(this,Le)?.root;m(this,Ye)||!i||(x(this,E,ps).call(this),S(this,sn,t({root:i,state:e,eventKey:m(this,V).season,formatMoney:(o,r)=>(0,Xn.formatMoney)(o,r,{locale:m(this,V).locale,fallback:(s,a)=>`${s} ${a}`,...Number.isInteger(o)?{minimumFractionDigits:0,maximumFractionDigits:0}:{}}),startSession:o=>m(this,Fe).checkout({operationId:o.holdId,buyerEmail:o.buyerEmail,...o.buyerName?{buyerName:o.buyerName}:{},...m(this,V).returnUrl?{returnUrl:m(this,V).returnUrl}:{}}),orderStatus:o=>m(this,Fe).orderStatus(o),onCancel:()=>{S(this,sn,null),m(this,ue)&&x(this,E,ut).call(this,"review")},onConfirmed:o=>{m(this,V).onOrderConfirmed?.(o),x(this,E,ut).call(this,"complete"),x(this,E,de).call(this,{kind:"booked",message:y("season.orderConfirmed","Your season tickets are confirmed for every included performance.")})},onError:o=>m(this,V).onError?.(o)})))},ps=function(){m(this,sn)?.destroy(),S(this,sn,null)},de=function(e,t=!1){m(this,Ht)&&(m(this,Ht).textContent=e.message,m(this,Ht).dataset.kind=e.kind),m(this,We)&&(m(this,We).dataset.busy=String(t)),m(this,V).onStatusChange?.(e)},en=function(e,t){let i=e instanceof he&&e.reason==="provider_failed"&&m(this,Wn)?new he(m(this,Wn)):e;if(i instanceof he)return m(this,V).onError?.(i),i;let o=i instanceof te?`Season selection unavailable (${i.code}).`:"Season selection could not be completed.";return x(this,E,de).call(this,{kind:"failed",message:o,operationId:t}),m(this,V).onError?.(i),i},$p=function(e){m(this,Ye)||(e instanceof he||x(this,E,de).call(this,{kind:"failed",message:y("season.sessionEnded","The seat map stopped updating. Reload the page to see which seats are free now.")}),m(this,V).onError?.(e))},hs=function(){if(m(this,Ye))throw new Error("seatlayer: SeasonPicker was destroyed")},jn=function(){if(x(this,E,hs).call(this),!m(this,Te)||!m(this,Le))throw new Error("seatlayer: render SeasonPicker before using it")};function zp(n,e={}){let t=e.origin??"";if(!t)try{t=new URL(n.src,window.location.href).origin}catch{t=""}let i=!1,o=null,r=null,s=null,a="",l=null,c="",d=()=>{if(i)return;i=!0,o=n.getAttribute("style"),Object.assign(n.style,{position:"fixed",inset:"0",margin:"0",border:"0",zIndex:"2147483000",background:c||"transparent"}),n.style.width="100vw",n.style.height="100vh",n.style.width="100dvw",n.style.height="100dvh";let h=document.documentElement;r=h.style.overflow,h.style.overflow="hidden",document.body&&(s=document.body.style.overflow,document.body.style.overflow="hidden"),l=b=>{b.key==="Escape"&&p()},window.addEventListener("keydown",l)},p=()=>{i&&(i=!1,o===null?n.removeAttribute("style"):n.setAttribute("style",o),o=null,a&&(n.style.height=a),r!==null&&(document.documentElement.style.overflow=r,r=null),s!==null&&document.body&&(document.body.style.overflow=s,s=null),l&&(window.removeEventListener("keydown",l),l=null))},u=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"&&(typeof b.background=="string"&&/^[#a-zA-Z0-9(),.%\s-]{1,64}$/.test(b.background)&&(c=b.background,i&&(n.style.background=c)),b.on===!0?d():b.on===!1&&p())};return window.addEventListener("message",u),()=>{window.removeEventListener("message",u),p()}}0&&(module.exports={ApiError,BuyerAccessContext,BuyerAccessUnavailableError,BuyerRealtimeClient,EmbeddedDesigner,PerformanceGroupDestroyedError,PerformanceGroupPicker,SEATING_CHART_CALLBACK_PROPS,SEATING_CHART_HANDLE_METHODS,SEATING_CHART_IDENTITY_PROPS,SEATING_CHART_VALUE_PROPS,SeasonApiError,SeasonPicker,SeasonPublicSessionRefused,SeasonRecoveryTimeoutError,SeatPicker,SeatingChart,attachPickerFrame,bindSeatingChartHandle,buildSeatingChartOptions,createBuyerAccessContext,createControllerSink,parseTicketOfferAvailability,prewarmSeatPicker,shortOperationReference,ticketOfferPrices});
3600
+ `,document.head.appendChild(n)}var Jg="https://api.seatlayer.io",eb=6e4,tb=2e3,nb=1e3,ib=36e5,ob=5e3,rb=5e3,sb=15e3,ab=12e4,lb=new Set(["preparing","commit_pending","abort_pending","expire_pending"]),Te=class extends Error{constructor(){super("performance_group_destroyed"),this.name="PerformanceGroupDestroyedError"}};function cb(n){return new Promise(e=>setTimeout(e,n))}function Ns(n){let e=Number(n.headers.get("Retry-After")??"1");return Number.isFinite(e)?Math.max(50,Math.min(ob,e*1e3)):1e3}function oi(n,e){return`/pub/performance-groups/${encodeURIComponent(n)}/operations/${encodeURIComponent(e)}`}function ri(n){return n.replace(/^pghop_/,"").replace(/-/g,"").slice(-8).toUpperCase()}var Ds=class{constructor(e,t,i){this.api=e;this.sink=t;this.intervalMs=i;this.stopped=!0;this.timer=null;this.prior=new Map}start(){this.stopped&&(this.stopped=!1,this.tick())}stop(){this.stopped=!0,this.timer&&clearTimeout(this.timer),this.timer=null}async tick(){try{let e=await this.api.objects(this.api.groupKey);if(this.stopped)return;let t=new Map(Object.entries(e.seats)),o=[...new Set([...this.prior.keys(),...t.keys()])].filter(r=>this.prior.get(r)!==t.get(r)).map(r=>({label:r,status:t.get(r)??"blocked"}));this.prior=t,o.length&&this.sink.applyStatuses(o),this.sink.onSections?.(e.hidden??[],e.closed??[])}catch(e){if(e instanceof Te){this.stop();return}if(Lo(e)){this.stop(),this.api.sessionEnded(e);return}this.stopped||await this.sink.resync()}finally{this.stopped||(this.timer=setTimeout(()=>{this.tick()},this.intervalMs))}}},xr=class{constructor(e,t){this.descriptorCache=null;this.chartRequest=null;this.objectsCache=null;this.objectsEtag=null;this.activePerformanceKey=null;this.includedEventKeys=new Set;this.reuseObjectsCacheOnce=!1;this.selectionsByEvent=new Map;this.allocationsByHold=new Map;this.pendingOperationId=null;this.operationByHold=new Map;this.knownRevision=null;this.destroyed=!1;this.aborter=new AbortController;this.adoptFailure=null;this.settleTimer=null;this.settleOperationId=null;this.settleStartedAt=0;this.settleState=null;this.settleVisibility=null;this.lastRecovery={kind:"idle"};this.seededDescriptor=null;if(!e)throw new Error("seatlayer: `performanceGroup` key is required");this.groupKey=e,this.base=(t.apiBase??Jg).replace(/\/+$/,""),this.access=t.access,this.fetcher=t.fetch??globalThis.fetch.bind(globalThis),this.recoveryTimeoutMs=t.recoveryTimeoutMs??eb,this.realtimePollMs=Math.max(500,t.realtimePollMs??tb),this.selectionMode=t.selectionMode??"same_seat",this.partySize=t.partySize??null,this.onOperationState=t.onOperationState,this.onRecoveryState=t.onRecoveryState,this.onAvailability=t.onAvailability,this.onSessionEnded=t.onSessionEnded,this.access.onRenewed(o=>this.adoptSession(o));let i=this.readOperationRecord();i&&this.storedIsUndecided(i)&&(this.pendingOperationId=i.operationId)}get pendingOperation(){return this.pendingOperationId}get holdBlocked(){return!!this.adoptFailure||!!this.pendingOperationId&&this.lastRecovery.kind!=="idle"}seedDescriptor(e){e.key===this.groupKey&&Array.isArray(e.performances)&&(this.seededDescriptor=e)}async descriptor(){let e=this.seededDescriptor;this.seededDescriptor=null;let t=e?{performanceGroup:e}:await this.json(`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/descriptor`);return this.descriptorCache=t.performanceGroup,this.includedEventKeys.size||(this.includedEventKeys=new Set(t.performanceGroup.performances.map(i=>i.eventKey))),t.performanceGroup.revision&&(this.knownRevision=t.performanceGroup.revision),this.activePerformanceKey??=t.performanceGroup.performances[0]?.eventKey??null,t.performanceGroup}async chart(e){this.chartRequest??=this.json(`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/chart`).catch(o=>{throw this.chartRequest=null,o});let[t,i]=await Promise.all([this.descriptorCache?Promise.resolve(this.descriptorCache):this.descriptor(),this.chartRequest]);return{doc:i,event:{key:t.key,name:t.name,salesClosed:t.state!=="active",venue:t.venue,startsAt:t.performances[0]?.startsAt??null,timezone:t.timezone,currency:t.currency,mode:t.mode,inventoryModelVersion:2}}}asset(e,t){return/^[a-zA-Z0-9._-]+$/.test(t)?this.blob(`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/assets/${encodeURIComponent(t)}`):Promise.reject(new re(404,"not_found","not_found"))}async objects(e){let t=this.descriptorCache?.inclusionMode==="flexible_dates",i=`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/objects`+(this.selectionMode==="per_performance"||t?"?view=per-performance":"");if(this.reuseObjectsCacheOnce&&this.objectsCache)this.reuseObjectsCacheOnce=!1;else{let s=await this.authorized(i,this.objectsCache&&this.objectsEtag?{headers:{"If-None-Match":this.objectsEtag}}:{});if(s.status===304)this.objectsCache||(this.objectsEtag=null);else{if(!s.ok)return this.throwResponse(s);this.objectsCache=await this.responseJson(s),this.objectsEtag=s.headers.get("ETag")}}if(!this.objectsCache)throw new re(502,"group_projection_unavailable","group_projection_unavailable");if(this.selectionMode==="same_seat"&&!t){let s=this.objectsCache;return this.noteAvailability(s,s.salesClosed,s),s}let o=this.objectsCache;if(this.selectionMode==="same_seat"){let s=o.performances.filter(p=>this.includedEventKeys.has(p.eventKey));if(!s.length)throw new re(409,"group_selection_incomplete","group_selection_incomplete");let a=Object.keys(s[0]?.seats??{}),l=Object.fromEntries(a.map(p=>[p,s.every(m=>m.seats[p]==="free")?"free":"blocked"])),c=Object.fromEntries(a.flatMap(p=>{let m=s.filter(u=>u.seats[p]!=="free").map(u=>u.eventKey);return m.length>0&&m.length<s.length?[[p,m]]:[]})),d={seats:l,partial:c,hidden:[...new Set(s.flatMap(p=>p.hidden??[]))],closed:[...new Set(s.flatMap(p=>p.closed??[]))],revision:o.revision,state:o.state,salesClosed:s.some(p=>p.salesClosed)};return this.noteAvailability(o,d.salesClosed,d),d}let r=o.performances.find(s=>s.eventKey===this.activePerformanceKey);if(!r)throw new re(409,"group_performance_unavailable","group_performance_unavailable");return this.noteAvailability(o,o.salesClosed||o.performances.some(s=>s.salesClosed),r),r}setSelectionMode(e,t){if(this.pendingOperationId||this.holdBlocked)throw new re(409,"group_operation_pending","group_operation_pending");e!==this.selectionMode&&(this.selectionMode=e,t!=null&&(this.partySize=t),this.objectsCache=null,this.objectsEtag=null,this.selectionsByEvent.clear(),this.activePerformanceKey=this.descriptorCache?.performances[0]?.eventKey??this.activePerformanceKey)}setActivePerformance(e){if(this.descriptorCache&&!this.descriptorCache.performances.some(t=>t.eventKey===e))throw new re(404,"group_performance_not_found","group_performance_not_found");this.activePerformanceKey=e}setIncludedEventKeys(e){let t=new Set(this.descriptorCache?.performances.map(i=>i.eventKey)??[]);if(!e.length||new Set(e).size!==e.length||e.some(i=>!t.has(i)))throw new re(422,"invalid_event_keys","invalid_event_keys");this.includedEventKeys=new Set(e),this.reuseObjectsCacheOnce=!!this.objectsCache}includedPerformanceKeys(){return(this.descriptorCache?.performances??[]).map(e=>e.eventKey).filter(e=>this.includedEventKeys.has(e))}setPerformanceSelections(e,t){this.selectionsByEvent.set(e,t.map(i=>({...i})))}allocationsForHold(e){return(this.allocationsByHold.get(e)??[]).map(t=>({eventKey:t.eventKey,items:t.items.map(i=>({...i}))}))}async hold(e,t,i,o){if(this.assertUsable(),o)throw new re(409,"group_hold_replace_unsupported","group_hold_replace_unsupported");let r=t.map(c=>c.label),s={labels:r};if(this.descriptorCache?.inclusionMode==="flexible_dates"&&(s.eventKeys=this.includedPerformanceKeys()),this.selectionMode==="per_performance"){if(!this.activePerformanceKey||!this.descriptorCache||!this.partySize)throw new re(409,"group_selection_incomplete","group_selection_incomplete");this.setPerformanceSelections(this.activePerformanceKey,t);let c=this.descriptorCache.performances.filter(d=>this.includedEventKeys.has(d.eventKey)).map(d=>({eventKey:d.eventKey,selections:this.selectionsByEvent.get(d.eventKey)??[]}));if(c.some(d=>d.selections.length!==this.partySize))throw new re(409,"group_selection_incomplete","group_selection_incomplete");s={selectionMode:"per_performance",allocations:c,...this.descriptorCache.inclusionMode==="flexible_dates"?{eventKeys:this.includedPerformanceKeys()}:{}}}let a=this.pendingOperationId??`pghop_${crypto.randomUUID()}`;this.beginOperation(a),this.onOperationState?.({operationId:a,state:"preparing",decision:null});let l;try{l=await this.authorized(`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/hold`,{method:"POST",body:JSON.stringify({operationId:a,...s,...i?{ttlMs:i}:{}})})}catch(c){if(c instanceof Te)throw c;if(c instanceof we)throw this.failOperation(a),c;return this.recover(a,r,Date.now()+this.recoveryTimeoutMs)}if(l.status===201||l.status===202||l.status===504){let c=await this.responseJson(l);return this.emit(c.operation),l.status===201?this.complete(c.operation):this.recover(a,r,Date.now()+this.recoveryTimeoutMs,Ns(l))}if(l.status===503){let c=await l.clone().json().catch(()=>null);if((c?.code??c?.error)==="performance_group_abort_pending"){let d=c?.operation?.operationId??a;return this.beginOperation(d),c?.operation&&this.emit(c.operation),this.recover(d,r,Date.now()+this.recoveryTimeoutMs,Ns(l))}}try{return await this.throwResponse(l,r)}catch(c){throw this.failOperation(a),c}}async release(e,t,i){this.assertUsable();let o=this.operationForHold(i),r=await this.json(`${oi(this.groupKey,o)}/release`,{method:"POST",body:"{}"});return this.operationByHold.delete(i),this.allocationsByHold.delete(i),this.clearOperationRecord(),r}async resume(e,t){this.assertUsable();let i=this.operationForHold(t),o=await this.json(oi(this.groupKey,i));return this.complete(o.operation)}async extend(e,t,i=12e4){this.assertUsable();let o=this.operationForHold(t),r=Math.max(nb,Math.min(ib,Math.round(i))),s=await this.json(`${oi(this.groupKey,o)}/extend`,{method:"POST",body:JSON.stringify({ttlMs:r})}),a=this.complete(s.operation);return{holdId:a.holdId,expiresAt:a.expiresAt}}async paymentOptions(){let e=await this.authorized(`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/payment-options`);return e.status===409?null:e.ok?this.responseJson(e):this.throwResponse(e)}async checkout(e){return this.json(`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/checkout`,{method:"POST",body:JSON.stringify(e)})}async orderStatus(e){let t=await this.fetcher(`${this.base}/pub/orders/${encodeURIComponent(e)}/status`,{method:"GET",credentials:"omit",signal:this.aborter.signal});return t.ok?t.json():this.throwResponse(t)}bestAvailable(){return Promise.reject(new re(400,"group_best_available_unsupported","group_best_available_unsupported"))}socketUrl(){return""}createRealtime(e,t){return new Ds(this,t,this.realtimePollMs)}sessionEnded(e){this.destroyed||this.onSessionEnded?.(e)}operationIdForHold(e){return this.operationByHold.get(e)??this.readMapping(e)}rememberOperation(e,t){!e||!t||(this.operationByHold.set(e,t),this.writeMapping(e,t))}async restoreOperation(){let e=this.readOperationRecord();if(!e)return null;if(!this.storedIsUndecided(e)&&e.state!=="committed"&&e.state!=="booked")return this.clearOperationRecord(),null;this.pendingOperationId=e.operationId,this.emitRecovery({kind:"pending",operationId:e.operationId,phase:e.state==="undecided"?"unknown":e.state,longRunning:!1,reference:ri(e.operationId)});let t;try{t=await this.authorized(oi(this.groupKey,e.operationId))}catch(r){return r instanceof Te||this.recoveryFailed(e.operationId,"request_failed"),null}if(t.status===404)return this.failOperation(e.operationId),null;if(!t.ok)return this.recoveryFailed(e.operationId,"request_failed"),null;let i=await this.responseJson(t);this.emit(i.operation);let o=i.operation.state;return o==="committed"||o==="booked"?(this.emitRecovery({kind:"idle"}),this.complete(i.operation)):o==="aborted"||o==="expired"?(this.failOperation(e.operationId),null):this.recover(e.operationId,[],Date.now()+this.recoveryTimeoutMs)}async retryRecovery(){this.assertUsable();let e=this.pendingOperationId??this.readOperationRecord()?.operationId??null;return e?(this.pendingOperationId=e,this.recover(e,[],Date.now()+this.recoveryTimeoutMs)):null}watchSettlement(e){if(this.destroyed)return;let t=this.operationIdForHold(e);!t||t===this.settleOperationId||(this.stopSettlementWatch(),this.settleOperationId=t,this.settleStartedAt=Date.now(),this.settleState="committed",typeof document<"u"&&(this.settleVisibility=()=>{document.hidden||!this.settleOperationId||this.pollSettlement()},document.addEventListener("visibilitychange",this.settleVisibility)),this.scheduleSettlementPoll())}stopSettlementWatch(){this.settleTimer&&clearTimeout(this.settleTimer),this.settleTimer=null,this.settleOperationId=null,this.settleState=null,this.settleVisibility&&typeof document<"u"&&document.removeEventListener("visibilitychange",this.settleVisibility),this.settleVisibility=null}scheduleSettlementPoll(){if(this.destroyed||!this.settleOperationId)return;if(this.settleTimer&&clearTimeout(this.settleTimer),typeof document<"u"&&document.hidden){this.settleTimer=null;return}let t=Date.now()-this.settleStartedAt>=ab?sb:rb;this.settleTimer=setTimeout(()=>{this.pollSettlement()},t)}settled(e){return e==="booked"||e==="expired"||e==="aborted"}async pollSettlement(){let e=this.settleOperationId;if(this.destroyed||!e)return;if(typeof document<"u"&&document.hidden){this.settleTimer&&clearTimeout(this.settleTimer),this.settleTimer=null;return}let t;try{let o=await this.authorized(oi(this.groupKey,e));if(!o.ok)return this.scheduleSettlementPoll();t=(await this.responseJson(o)).operation}catch(o){return o instanceof Te?this.stopSettlementWatch():this.scheduleSettlementPoll()}if(this.destroyed||this.settleOperationId!==e)return;let i=t.state!==this.settleState;if(this.settleState=t.state,i&&this.noteOperationState(e,t.state),this.settled(t.state)){this.stopSettlementWatch(),t.state!=="booked"&&this.clearOperationRecord(),this.emit(t);return}i&&this.emit(t),this.scheduleSettlementPoll()}destroy(){if(!this.destroyed){this.destroyed=!0,this.stopSettlementWatch(),this.access.onRenewed(void 0);try{this.aborter.abort()}catch{}}}operationRecordKey(){return`@seatlayer/performance-group-operation/v1/${encodeURIComponent(this.base)}/${encodeURIComponent(this.groupKey)}`}readOperationRecord(){try{let e=window.sessionStorage.getItem(this.operationRecordKey());if(!e)return null;let t=JSON.parse(e);return!t?.operationId||t.groupKey!==this.groupKey?null:t}catch{return null}}storedIsUndecided(e){return e.state==="undecided"||lb.has(e.state)}writeOperationRecord(e){try{window.sessionStorage.setItem(this.operationRecordKey(),JSON.stringify(e))}catch{}}clearOperationRecord(){try{window.sessionStorage.removeItem(this.operationRecordKey())}catch{}}beginOperation(e){this.pendingOperationId=e;let t=this.readOperationRecord();this.writeOperationRecord({operationId:e,groupKey:this.groupKey,state:"undecided",createdAt:t?.operationId===e?t.createdAt:Date.now()})}noteOperationState(e,t){let i=this.readOperationRecord();!i||i.operationId!==e||this.writeOperationRecord({...i,state:t})}failOperation(e){this.pendingOperationId=null,this.clearOperationRecord(),this.emitRecovery({kind:"idle"}),this.onOperationState?.({operationId:e,state:"aborted",decision:"abort"})}async adoptSession(e){if(this.destroyed)return;let t=`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/session/adopt`;for(let o=0;o<2;o++){if(this.destroyed)return;try{if((await this.fetcher(`${this.base}${t}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e.token}`},body:JSON.stringify({previousToken:e.previousToken}),credentials:"omit",signal:this.aborter.signal})).ok){this.adoptFailure=null;return}}catch{}}if(this.destroyed)return;this.adoptFailure=new re(409,"performance_group_session_adopt_failed","performance_group_session_adopt_failed");let i=this.pendingOperationId??"";throw this.emitRecovery({kind:"failed",operationId:i,reference:i?ri(i):"",reason:"session_adopt_failed",retryable:!1}),this.adoptFailure}async recover(e,t,i,o=100){let r=o,s=Date.now()+Math.min(8e3,Math.max(500,this.recoveryTimeoutMs/2)),a="unknown";for(;Date.now()<=i;){if(this.destroyed)throw new Te;if(this.emitRecovery({kind:"pending",operationId:e,phase:a,longRunning:Date.now()>=s,reference:ri(e)}),await cb(r),this.destroyed)throw new Te;let l;try{l=await this.authorized(oi(this.groupKey,e))}catch(p){if(p instanceof Te)throw p;if(p instanceof we)throw this.recoveryFailed(e,"request_failed"),p;r=Math.min(2e3,Math.max(100,r*2));continue}if(l.status===404){r=Math.min(1e3,Math.max(100,r*2));continue}if(!l.ok){this.recoveryFailed(e,"request_failed");try{return await this.throwResponse(l,t)}finally{this.pendingOperationId=null,this.clearOperationRecord()}}let d=(await this.responseJson(l)).operation;if(a=d.state,this.noteOperationState(e,d.state),this.emit(d),d.state==="committed"||d.state==="booked")return this.emitRecovery({kind:"idle"}),this.complete(d);if(d.state==="aborted"||d.state==="expired")throw this.failOperation(e),new re(409,"conflict","conflict",t.map(p=>({label:p,status:"held"})));r=Ns(l)}throw this.recoveryFailed(e,"deadline"),new re(504,"performance_group_outcome_unknown","performance_group_outcome_unknown")}recoveryFailed(e,t){this.emitRecovery({kind:"failed",operationId:e,reference:ri(e),reason:t,retryable:!0})}emitRecovery(e){if(this.destroyed)return;let t=this.lastRecovery.kind===e.kind&&JSON.stringify(this.lastRecovery)===JSON.stringify(e);this.lastRecovery=e,t||this.onRecoveryState?.(e)}noteAvailability(e,t,i){if(this.destroyed||!this.onAvailability)return;let o=e.state??this.descriptorCache?.state??"active",r=e.revision??null,s=!!r&&!!this.knownRevision&&r!==this.knownRevision;r&&!this.knownRevision&&(this.knownRevision=r);let a=i?.partial??{},l=Object.values(i?.seats??{});this.onAvailability({partial:a,freeCount:l.filter(c=>c==="free").length,blockedCount:Object.keys(i?.seats??{}).filter(c=>i.seats[c]!=="free"&&!(c in a)).length,state:o,salesClosed:!!t||o!=="active",revision:r,revisionChanged:s})}acceptRevision(e){this.knownRevision=e}complete(e){if(!e.hold||e.hold.expiresAt==null)throw new re(409,"group_hold_not_active","group_hold_not_active");this.pendingOperationId=null,this.noteOperationState(e.operationId,e.state),this.operationByHold.set(e.hold.id,e.operationId),this.writeMapping(e.hold.id,e.operationId);let t=e.hold.allocations??[];this.allocationsByHold.set(e.hold.id,t);let i=t.find(o=>o.eventKey===this.activePerformanceKey)?.items;return{holdId:e.hold.id,expiresAt:e.hold.expiresAt,items:i??e.hold.items??[]}}emit(e){this.destroyed||this.onOperationState?.({operationId:e.operationId,state:e.state,decision:e.decision})}operationForHold(e){let t=this.operationIdForHold(e);if(!t)throw new re(404,"group_hold_not_found","group_hold_not_found");return t}mappingKey(e){return`@seatlayer/performance-group-hold/v1/${encodeURIComponent(this.base)}/${encodeURIComponent(this.groupKey)}/${encodeURIComponent(e)}`}readMapping(e){try{return window.sessionStorage.getItem(this.mappingKey(e))}catch{return null}}writeMapping(e,t){try{window.sessionStorage.setItem(this.mappingKey(e),t)}catch{}}assertUsable(){if(this.destroyed)throw new Te;if(this.adoptFailure)throw this.adoptFailure}async authorized(e,t={},i=!1){if(this.destroyed)throw new Te;if(this.adoptFailure)throw this.adoptFailure;let o={...t.headers};t.body!==void 0&&(o["Content-Type"]="application/json");let r=await this.access.authorization(i?"unauthorized":"initial");if(this.destroyed)throw new Te;if(this.adoptFailure)throw this.adoptFailure;if(!r)throw new Error("performance_group_buyer_access_required");o.Authorization=r;let s=await this.fetcher(`${this.base}${e}`,{method:t.method??"GET",headers:o,body:t.body,credentials:"omit",signal:this.aborter.signal});if(!i&&(s.status===401||s.status===403||s.status===422)){let a=await s.clone().json().catch(()=>null);if(await this.access.handleFailure(s.status,a?.code??a?.error,r))return this.authorized(e,t,!0)}return s}async json(e,t={}){let i=await this.authorized(e,t);return i.ok?this.responseJson(i):this.throwResponse(i)}async blob(e){let t=await this.authorized(e);return t.ok?t.blob():this.throwResponse(t)}async responseJson(e){return e.json()}async throwResponse(e,t=[]){let o=await e.json().catch(()=>null)??{},r=o.code??o.error??`request_failed_${e.status}`;throw e.status===409&&!o.conflicts?.length&&t.length&&(o.conflicts=t.map(s=>({label:s,status:"held"}))),new re(e.status,o.error??r,r,o.conflicts)}};var si=require("@seatlayer/core");var ai,fn,Dt,li,Vi,Bt,hh,kr,Sr=class{constructor(e){this.options=e;P(this,Bt);P(this,ai,null);P(this,fn,!1);P(this,Dt,null);P(this,li,!1);P(this,Vi,!1)}get mode(){return h(this,fn)?"hosted":"handoff"}async prepare(){try{k(this,ai,await this.options.api.paymentOptions()),k(this,fn,!!h(this,ai))}catch(e){k(this,fn,!1),this.options.onError?.(e)}}async open(e,t){if(!h(this,fn)||h(this,li))return;if(t.selectionMode!=="same_seat"){this.options.announce((0,si.t)("picker.group.hostedPerPerformance"));return}let i=h(this,ai),o=t.seatLabels.length;if(i.bookingMode==="paid"&&!i.providers.length){await w(this,Bt,kr).call(this,e,t.descriptor,{kind:"unavailable",reason:i.reason==="unavailable_for_run"?"unavailable_for_event":"not_configured",seatCount:o});return}k(this,li,!0);try{let{total:r,currency:s,lines:a}=w(this,Bt,hh).call(this,t.holdId,t.descriptor);await w(this,Bt,kr).call(this,e,t.descriptor,{kind:"pay",provider:null,free:i.bookingMode==="free",order:{holdId:t.operationId,expiresAt:t.expiresAt,currency:s,total:r,labels:[...t.seatLabels],lines:a}})}finally{k(this,li,!1)}}resume(e,t,i){let o=ii(t);o?.outcome!=="success"||!o.orderId||w(this,Bt,kr).call(this,e,i,{kind:"resume",orderId:o.orderId})}destroy(){k(this,Vi,!0),h(this,Dt)?.destroy(),k(this,Dt,null)}};ai=new WeakMap,fn=new WeakMap,Dt=new WeakMap,li=new WeakMap,Vi=new WeakMap,Bt=new WeakSet,hh=function(e,t){let i=this.options.api.allocationsForHold(e),o=i.flatMap(a=>a.items)[0]?.currency??t.currency,r=0,s=i.map(a=>{let l=a.items.reduce((d,p)=>d+Math.round(p.unitPrice*100)*(p.quantity??1),0);r+=l;let c=t.performances.find(d=>d.eventKey===a.eventKey);return{label:a.items.map(d=>d.label).join(", "),detail:c?Qn(c,this.options.locale):null,amount:l/100}});return{total:r/100,currency:o,lines:s}},kr=async function(e,t,i){let o;try{({mountCheckout:o}=await _n())}catch(s){this.options.onError?.(s),this.options.announce((0,si.t)("picker.group.checkoutCouldNotOpen"));return}if(h(this,Vi)||!e)return;h(this,Dt)?.destroy();let r=this.options.api;k(this,Dt,o({root:e,state:i,eventKey:r.groupKey,event:{name:t.name,detail:(0,si.t)("picker.group.checkoutDates").replace("{count}",String(t.performanceCount))},formatMoney:(s,a)=>(0,si.formatMoney)(s,a,{locale:this.options.locale,fallback:(l,c)=>`${l} ${c}`,...Number.isInteger(s)?{minimumFractionDigits:0,maximumFractionDigits:0}:{}}),startSession:async s=>{let a=await r.checkout({operationId:s.holdId,buyerEmail:s.buyerEmail,...s.buyerName?{buyerName:s.buyerName}:{},...this.options.returnUrl?{returnUrl:this.options.returnUrl}:{}});return{orderId:a.orderId,totalMinor:a.totalMinor??0,currency:a.currency??t.currency,expiresAt:a.expiresAt??0,...a.redirectUrl?{redirectUrl:a.redirectUrl}:{},...a.status==="confirmed"?{status:"confirmed"}:{}}},orderStatus:s=>r.orderStatus(s),onCancel:()=>{k(this,Dt,null)},onConfirmed:s=>this.options.onConfirmed?.(s),onError:s=>this.options.onError?.(s)}))};var db={audience_not_public:"audience_not_public",sales_not_open:"sales_not_open",invalid_origin:"origin_not_allowed"},pb=3e4;function hb(n,e){if(!n||typeof n!="object"||Array.isArray(n))return!1;let t=n;return typeof t.token=="string"&&t.token.length>0&&typeof t.expiresAt=="number"&&Number.isFinite(t.expiresAt)&&t.expiresAt>Date.now()&&t.performanceGroupKey===e}var Bs=class extends Error{constructor(t,i){super(`performance_group_public_session_refused:${t}`);this.reason=t;this.status=i;this.name="PerformanceGroupPublicSessionRefused"}},St,Ft,$i,ci,Fs=class{constructor(e){this.options=e;P(this,St,null);P(this,Ft,null);P(this,$i);P(this,ci);k(this,$i,e.fetch??globalThis.fetch.bind(globalThis)),k(this,ci,e.origin??(typeof location>"u"?void 0:location.origin))}get session(){return h(this,St)}async mint(e=!1){if(e&&k(this,St,null),h(this,St)&&h(this,St).expiresAt-pb>Date.now())return h(this,St);if(h(this,Ft))return h(this,Ft);let t=(async()=>{let i=await h(this,$i).call(this,`${this.options.base}/pub/performance-groups/${encodeURIComponent(this.options.performanceGroup)}/sessions`,{method:"POST",body:JSON.stringify(h(this,ci)?{origin:h(this,ci)}:{}),credentials:"omit"}),o=await i.json().catch(()=>null);if(!i.ok){let r=o?.code??o?.error,s=i.status===403&&r?db[r]:void 0;throw s?(this.options.onRefused?.({reason:s,code:r,status:i.status,retryable:s==="sales_not_open"}),new Bs(s,i.status)):new Error(`performance_group_public_session_failed_${i.status}`)}if(!hb(o,this.options.performanceGroup))throw new Error("performance_group_public_session_invalid");return k(this,St,o),o})();k(this,Ft,t);try{return await t}finally{h(this,Ft)===t&&k(this,Ft,null)}}async token(e){let t=e==="expiring"||e==="expired"||e==="unauthorized"||e==="manual",i=await this.mint(t);return{token:i.token,expiresAt:i.expiresAt}}};St=new WeakMap,Ft=new WeakMap,$i=new WeakMap,ci=new WeakMap;function uh(n){let e=new Fs(n);return{access:new De({provider:({reason:i})=>e.token(i),...n.accessHooks}),loader:e}}var mh="https://api.seatlayer.io";function fh(n){let e=typeof n=="string"?document.querySelector(n):n;if(!e)throw new Error("seatlayer: Performance Group picker container was not found");return e}var Tr=class{constructor(e){this.descriptorValue=null;this.picker=null;this.root=null;this.innerHost=null;this.tabsHost=null;this.prevButton=null;this.nextButton=null;this.heldSummary=null;this.live=null;this.statusHost=null;this.statusCopy=null;this.statusAction=null;this.rendered=!1;this.destroyed=!1;this.continued=!1;this.switchingPerformance=!1;this.operationPending=!1;this.recovery={kind:"idle"};this.availability=null;this.activePerformanceKey=null;this.selectionsByEvent=new Map;this.validByEvent=new Map;this.refreshingComposition=!1;this.activeHandoff=null;this.selectionModeValue="same_seat";this.progressHost=null;this.legendHost=null;this.paneHost=null;this.datesSummaryHost=null;this.datesCardsHost=null;this.resettingFlexibleSelection=!1;this.selectingPartialSeat=!1;this.partialSeatDates=new Map;this.markedLabels=new Set;this.holdTicker=null;this.switchingMode=!1;this.booked=!1;this.refusal=null;if(!e||typeof e!="object")throw new Error("seatlayer: options object is required");if(!e.performanceGroup)throw new Error("seatlayer: `performanceGroup` key is required");if(!e.container)throw new Error("seatlayer: `container` is required");if(!!e.initialHoldId!=!!e.initialOperationId)throw new Error("seatlayer: `initialHoldId` and `initialOperationId` must be supplied together");if((e.selectionMode==="per_performance"||e.allowSelectionModeSwitch)&&(!Number.isSafeInteger(e.numberOfPlacesToSelect)||(e.numberOfPlacesToSelect??0)<1))throw new Error("seatlayer: `numberOfPlacesToSelect` is required for per-performance selection");this.selectionModeValue=e.selectionMode??"same_seat",this.options=e,this.panelId=`sl-pg-panel-${e.performanceGroup}`;let t=i=>{this.refusal=this.refusal&&i.reason==="provider_failed"?this.refusal:i,e.onAccessUnavailable?.(this.refusal)};this.access=e.buyerAccessToken||e.buyerAccessTokenProvider?new De({provider:e.buyerAccessTokenProvider,token:e.buyerAccessToken,onExpired:e.onAccessExpired,onUnavailable:t}):uh({base:(e.apiBase??mh).replace(/\/$/,""),performanceGroup:e.performanceGroup,onRefused:i=>{this.refusal=i},accessHooks:{onExpired:e.onAccessExpired,onUnavailable:t}}).access,this.api=new xr(e.performanceGroup,{apiBase:e.apiBase,access:this.access,selectionMode:e.selectionMode,partySize:e.selectionMode==="per_performance"?e.numberOfPlacesToSelect:void 0,onOperationState:i=>this.operationChanged(i),onRecoveryState:i=>this.recoveryChanged(i),onAvailability:i=>this.availabilityChanged(i),onSessionEnded:i=>this.sessionEnded(i)}),e.initialHoldId&&e.initialOperationId&&this.api.rememberOperation(e.initialHoldId,e.initialOperationId),e.initialDescriptor&&this.api.seedDescriptor(e.initialDescriptor),this.hosted=e.checkout==="hosted"?new Sr({api:this.api,locale:e.locale,returnUrl:e.returnUrl,announce:i=>this.showStatus("checkout",i),onConfirmed:i=>e.onOrderConfirmed?.(i),onError:e.onError}):null}get checkoutMode(){return this.hosted?.mode??"handoff"}get mode(){return this.selectionModeValue}get selectionMode(){return this.selectionModeValue}get descriptor(){return this.descriptorValue}get currentHold(){return this.activeHandoff}async render(){if(this.rendered)return this;let e=performance.now();if(this.rendered=!0,ph(),await(0,Vt.loadLocale)(this.options.locale),this.options.messages&&(0,Vt.setStringOverrides)(this.options.messages),this.destroyed)return this;let t;try{t=await this.api.descriptor()}catch(i){throw rt({apiBase:this.options.apiBase??mh,event:this.options.performanceGroup,scope:"performance_group",surface:"performance_group_picker",outcome:"failure",stage:"group_descriptor",ms:performance.now()-e,load:ht(this.options.performanceGroup),transport:"pubapi"}),i instanceof we&&this.refusal?new we(this.refusal):i}return await this.hosted?.prepare(),this.destroyed?this:(this.descriptorValue=t,this.activePerformanceKey=t.performances[0]?.eventKey??null,this.buildChrome(fh(this.options.container),t),this.announce(this.copy("picker.group.checkingAvailability")),await this.mountPicker(t),this.destroyed?this:(await this.restoreOperation(),this.destroyed||this.hosted?.resume(this.picker?.root??null,t.key,t),this))}buildChrome(e,t){e.replaceChildren();let i=document.createElement("div");i.className="sl-pg-root",i.dataset.performanceGroup=t.key,i.dataset.selectionMode=this.mode;let o=document.createElement("div");o.className="sl-pg-progress";let r=document.createElement("section");r.className="sl-pg-head",r.setAttribute("aria-labelledby",`sl-pg-title-${t.key}`);let s=document.createElement("h2");s.id=`sl-pg-title-${t.key}`,s.textContent=t.name;let a=document.createElement("p");a.className="sl-pg-summary",a.textContent=this.copy(this.mode==="per_performance"?"picker.group.perPerformanceSummary":"picker.group.sameSeatSummary",{count:t.performanceCount});let l=document.createElement("p");l.className="sl-pg-help",l.textContent=this.copy(this.mode==="per_performance"?"picker.group.perPerformanceMapHelp":"picker.group.sameSeatMapHelp");let c=document.createElement("details");c.className="sl-pg-dates",c.open=t.performanceCount<=3;let d=document.createElement("summary");d.textContent=this.copy(t.inclusionMode==="flexible_dates"?"picker.group.flexibleDatesInView":"picker.group.allDates",{count:t.performanceCount});let p=document.createElement("div");p.innerHTML=Ss(this.performanceCards(t),this.copy(t.inclusionMode==="flexible_dates"?"picker.group.flexibleDatesNote":"picker.group.includedNote",{count:t.performanceCount})),c.append(d,p);let m=document.createElement("div");m.className="sl-pg-held-summary",m.hidden=!0,s.hidden=a.hidden=c.hidden=this.options.header===!1,r.append(s,a,l,c,m);let u=document.createElement("div");u.className="sl-pg-legend";let f=document.createElement("div");f.className="sl-pg-pane",f.setAttribute("role","group"),f.setAttribute("aria-label",this.copy("picker.group.yourSelection")),f.hidden=!0;let b=this.mode==="per_performance"?this.performanceTabs(t):null,T=document.createElement("div");T.className="sl-pg-inner",T.id=this.panelId,T.setAttribute("aria-busy","false"),T.dataset.locked="false",this.mode==="per_performance"&&(T.setAttribute("role","tabpanel"),T.tabIndex=-1);let E=document.createElement("div");E.className="sl-pg-status",E.setAttribute("role","status"),E.setAttribute("aria-live","polite"),E.hidden=!0;let v=document.createElement("p"),M=document.createElement("button");M.type="button",M.hidden=!0,M.textContent=this.copy("picker.group.retry"),M.addEventListener("click",()=>{this.retryRecovery()}),E.append(v,M),T.appendChild(E);let F=document.createElement("div");F.className="sl-pg-live",F.setAttribute("role","status"),F.setAttribute("aria-live","polite"),i.append(o,r),b&&i.append(b),i.append(u,T,f,F),e.appendChild(i),this.root=i,this.progressHost=o,this.legendHost=u,this.paneHost=f,this.datesSummaryHost=d,this.datesCardsHost=p,this.innerHost=T,this.heldSummary=m,this.live=F,this.statusHost=E,this.statusCopy=v,this.statusAction=M,this.syncProgress(),this.syncLegend(),this.syncPane()}async mountPicker(e){let t=new kt(fr({container:this.innerHost,event:e.key,apiBase:this.options.apiBase,transport:this.api,hideEventDetails:!0,maxSelection:this.options.maxSelection,selectedObjects:this.options.selectedObjects,selectableObjects:this.options.selectableObjects,numberOfPlacesToSelect:this.options.numberOfPlacesToSelect,selectionValidators:this.options.selectionValidators,locale:this.options.locale,messages:this.options.messages,languages:this.options.languages,colorblindSafe:this.options.colorblindSafe,initialView:this.options.initialView,enable3D:this.options.enable3D,max3DSeats:this.options.max3DSeats,onBuyerViewChange:this.options.onBuyerViewChange,onAnalytics:(i,o)=>{try{this.options.onAnalytics?.(i,{...o,metricScope:"performance_group",performanceGroupKey:e.key,performanceCount:e.performanceCount,selectionMode:this.mode})}catch{}},hideBadge:this.options.hideBadge,theme:this.options.theme,holdTtlMs:this.options.holdTtlMs,initialHoldId:this.options.initialHoldId,restoreHold:this.options.restoreHold,confirmSelection:this.options.confirmSelection,seatView:this.options.seatView,onSelectionChange:i=>this.selectionChanged(i),onSelectionValidityChange:i=>this.selectionValidityChanged(i),onSelectionValid:this.options.onSelectionValid,onSelectionInvalid:this.options.onSelectionInvalid,onSelectionLimit:this.options.onSelectionLimit,onHoldChange:(i,o)=>this.holdChanged(i,o),onCheckout:(i,o)=>this.checkout(i,o),onHoldExpired:()=>{this.activeHandoff=null,this.api.stopSettlementWatch(),this.resetPerPerformanceSelection(),this.syncProgress(),this.syncPane(),this.syncHoldTicker(),this.options.onHoldChange?.(null),this.options.onHoldExpired?.()},onError:this.options.onError},{performanceCount:e.performanceCount,selectionMode:this.mode,submissionState:()=>this.submissionState(),suppressPricing:!0,nights:()=>this.nights(),seatMarks:()=>this.seatMarks(),nightSummary:()=>this.nightSummary(),groupSelectionSummary:()=>this.groupSelectionSummary(),activePerformanceLabel:()=>this.activePerformanceLabel(),selectedPerformanceDates:()=>this.mode==="same_seat"&&e.inclusionMode==="flexible_dates"?nd(this.includedPerformances(),e.performanceCount,this.options.locale,this.copy("picker.group.flexibleSelectedNote",{count:this.includedPerformances().length})):null,selectNight:i=>{this.switchPerformance(i)},selectionModeSwitch:this.options.allowSelectionModeSwitch&&this.mode==="same_seat"?{label:this.copy("picker.group.chooseNightByNight"),activate:()=>{this.switchSelectionMode("per_performance")}}:null,partialSeatSelection:e.inclusionMode==="flexible_dates"&&this.mode==="same_seat"?{label:i=>this.copy("picker.group.selectAvailableDates",{count:i}),activate:(i,o)=>{this.selectPartialSeat(i,o)}}:null,confirmDateSelection:e.inclusionMode==="flexible_dates"&&this.mode==="same_seat"?{includedEventKeys:()=>this.api.includedPerformanceKeys(),availableEventKeys:i=>this.partialSeatDates.get(i)??this.nights().map(o=>o.eventKey),label:i=>this.copy("picker.group.selectAvailableDates",{count:i}),apply:(i,o)=>this.applySeatDates(i,o,!0)}:null}));this.picker=t,await t.render(),!this.destroyed&&this.updateTabs()}performanceCards(e){return e.performances.map(t=>({eventKey:t.eventKey,name:t.name,iso:new Date(t.startsAt).toISOString(),date:rr(t,this.options.locale),time:sr(t,this.options.locale)}))}nights(){return(this.descriptorValue?.performances??[]).map(e=>({eventKey:e.eventKey,name:e.name,shortDate:Qn(e,this.options.locale)}))}seatMarks(){let e=this.descriptorValue?.performanceCount??0,t=this.availability,i=!!t?.salesClosed||!!t&&t.state!=="active",o=this.mode==="same_seat"&&!i?t?.partial??{}:{},r={};for(let s of this.markedLabels)r[s]=null;if(this.markedLabels.clear(),e>0)for(let[s,a]of Object.entries(o))!a.length||a.length>=e||(r[s]={kind:"partial",fraction:(e-a.length)/e,data:{blockedEventKeys:[...a]}},this.markedLabels.add(s));return r}activePerformanceLabel(){if(this.mode!=="per_performance")return null;let e=this.descriptorValue?.performances.find(o=>o.eventKey===this.activePerformanceKey);if(!e)return null;let t=Qn(e,this.options.locale),i=e.name?.trim();return i&&i!==t?`${i} \xB7 ${t}`:t}nightSummary(){return this.mode!=="per_performance"?[]:(this.descriptorValue?.performances??[]).map(e=>({eventKey:e.eventKey,name:Qn(e,this.options.locale),labels:(this.selectionsByEvent.get(e.eventKey)??[]).map(t=>t.label),active:e.eventKey===this.activePerformanceKey}))}groupSelectionSummary(){let e=this.includedPerformances();if(!e.length)return null;if(this.mode==="same_seat"){let r=this.activeHandoff?.seatLabels.length??this.picker?.getSelection().length??0;return{seats:r*e.length,performances:e.length,totalPerformances:this.descriptorValue?.performanceCount??e.length,performancesChosen:r?e.length:0,perPerformance:r}}let t=e.map(r=>this.selectionsByEvent.get(r.eventKey)?.length??0),i=t.filter(r=>r>0),o=i.length===t.length&&i.every(r=>r===i[0]);return{seats:t.reduce((r,s)=>r+s,0),performances:e.length,totalPerformances:this.descriptorValue?.performanceCount??e.length,performancesChosen:i.length,perPerformance:o&&i.length?i[0]:null}}syncProgress(){if(!this.progressHost)return;let e=!!this.activeHandoff,t=[{id:"performances",label:this.copy("picker.group.stepPerformances"),state:"done"},{id:"seats",label:this.copy("picker.group.stepSeats"),state:e?"done":"current"},{id:"review",label:this.copy("picker.group.stepReview"),state:this.booked?"done":e?"current":"upcoming"}];this.progressHost.innerHTML=hd(t,{label:this.copy("picker.group.progressLabel"),done:this.copy("picker.group.stepDone"),current:this.copy("picker.group.stepCurrent"),upcoming:this.copy("picker.group.notStarted")})}syncLegend(){if(!this.legendHost)return;let e=this.availability,t=!!e?.salesClosed||e&&e.state!=="active";if(!e||t){this.legendHost.replaceChildren();return}this.legendHost.innerHTML=od({available:e.freeCount>0,selected:(this.picker?.getSelection().length??0)>0,partial:Object.keys(e.partial).length>0,unavailable:e.blockedCount>0},{title:this.copy("picker.group.legendTitle"),available:this.copy("picker.group.legendAvailable"),selected:this.copy("picker.group.legendSelected"),partial:this.copy("picker.group.legendNotEveryDate"),unavailable:this.copy("picker.group.legendUnavailable")},this.categoryColor())}categoryColor(){return this.picker?.categoryLegendColor()??"#2563eb"}syncPane(){let e=this.paneHost;if(!e)return;let t=this.includedPerformances();if(this.mode!=="same_seat"||!t.length){e.hidden=!0,e.replaceChildren();return}let i=this.activeHandoff?.seatLabels??this.picker?.getSelection().map(r=>r.label)??[],o=this.heldTotal();e.hidden=!1,e.innerHTML=ud({title:this.copy("picker.group.yourSelection"),rows:t.map(r=>({eventKey:r.eventKey,name:`${rr(r,this.options.locale)} ${sr(r,this.options.locale)}`,labels:i})),empty:this.copy("picker.group.noSeatsChosenYet"),note:o?null:this.copy("picker.group.pricesPerPerformance"),total:o?{label:this.copy("picker.group.total"),amount:o}:null,holdStatus:this.booked?this.copy("picker.group.bookedAll",{count:t.length}):this.activeHandoff?this.copy("picker.group.heldTogether",{count:t.length,time:md(this.activeHandoff.expiresAt-Date.now())}):null})}heldTotal(){let e=this.activeHandoff,t=this.descriptorValue;if(!e||!t)return null;let o=this.api.allocationsForHold(e.holdId).flatMap(a=>a.items);if(!o.length)return null;let r=o.reduce((a,l)=>a+l.unitPrice*(l.quantity??1),0),s=o[0]?.currency??t.currency;try{return(0,Vt.formatMoney)(r,s,void 0,this.options.locale)}catch{return`${s} ${r.toFixed(2)}`}}includedPerformances(){let e=this.descriptorValue?.performances??[];if(this.descriptorValue?.inclusionMode!=="flexible_dates")return e;let t=new Set(this.api.includedPerformanceKeys());return e.filter(i=>t.has(i.eventKey))}syncIncludedDates(){let e=this.descriptorValue;if(!e||!this.datesSummaryHost||!this.datesCardsHost)return;let t=this.includedPerformances(),i=e.inclusionMode==="flexible_dates";this.datesSummaryHost.textContent=i&&t.length<e.performanceCount?this.copy("picker.group.flexibleDatesSelected",{selected:t.length,total:e.performanceCount}):this.copy(i?"picker.group.flexibleDatesInView":"picker.group.allDates",{count:e.performanceCount}),this.datesCardsHost.innerHTML=Ss(this.performanceCards({...e,performances:t}),this.copy(i&&t.length<e.performanceCount?"picker.group.flexibleSelectedNote":i?"picker.group.flexibleDatesNote":"picker.group.includedNote",{count:t.length}))}async selectPartialSeat(e,t){if(!(this.destroyed||this.holdBlocked()||this.activeHandoff||!t.length)){if((this.picker?.getSelection().length??0)>0){this.announce(this.copy("picker.group.clearBeforePartial"));return}this.partialSeatDates.set(e,[...t]),await this.applySeatDates(e,t,!1)}}async applySeatDates(e,t,i){if(this.destroyed||this.holdBlocked()||this.activeHandoff||!t.length)return!1;let o=this.api.includedPerformanceKeys();if(o.length===t.length&&o.every(r=>t.includes(r)))return!0;this.selectingPartialSeat=!0;try{if(this.api.setIncludedEventKeys(t),this.syncIncludedDates(),await this.picker?.refreshAvailability(),!(i?this.picker?.selectObjectsWithoutConfirmation([e])??[]:this.picker?.selectObjects([e])??[]).length)throw new Error("performance_group_partial_seat_unavailable");return this.announce(this.copy("picker.group.selectedAvailableDates",{count:t.length})),this.syncPane(),this.syncLegend(),!0}catch(r){return o.length&&(this.api.setIncludedEventKeys(o),this.syncIncludedDates(),await this.picker?.refreshAvailability().catch(()=>{})),this.options.onError?.(r),!1}finally{this.selectingPartialSeat=!1}}syncHoldTicker(){this.booked||(this.activeHandoff&&!this.holdTicker?this.holdTicker=setInterval(()=>this.syncPane(),1e3):!this.activeHandoff&&this.holdTicker&&(clearInterval(this.holdTicker),this.holdTicker=null))}async switchSelectionMode(e){if(!(this.destroyed||this.switchingMode||e===this.mode)&&!(this.activeHandoff||this.holdBlocked())){this.switchingMode=!0;try{this.api.setSelectionMode(e,this.options.numberOfPlacesToSelect),this.selectionModeValue=e,this.picker?.destroy(),this.picker=null,this.selectionsByEvent.clear(),this.validByEvent.clear(),this.markedLabels.clear(),this.availability=null;let t=this.descriptorValue;if(this.activePerformanceKey=t.performances[0]?.eventKey??null,this.buildChrome(fh(this.options.container),t),await this.mountPicker(t),this.destroyed)return;this.announce(this.copy("picker.group.nightByNightStarted")),this.options.onSelectionModeChange?.(e)}catch(t){if(t instanceof Te)return;this.options.onError?.(t)}finally{this.switchingMode=!1}}}async release(){await this.picker?.release()}close(){this.destroy()}destroy(){if(this.destroyed)return;this.destroyed=!0,this.api.destroy(),this.hosted?.destroy(),this.holdTicker&&clearInterval(this.holdTicker),this.holdTicker=null;let e=this.picker;this.root?.setAttribute("hidden","");let t=()=>{e?.destroy(),this.access.clear(),this.root?.remove(),this.root=null,this.picker=null,this.innerHost=null,this.tabsHost=null,this.statusHost=null,this.statusCopy=null,this.statusAction=null,this.live=null};e?.getCurrentHold()&&!this.continued?e.release().catch(()=>{}).finally(t):t()}copy(e,t){let i=this.options.messages?.[e];return i!==void 0?t?i.replace(/\{(\w+)\}/g,(o,r)=>String(t[r]??`{${r}}`)):i:(0,Vt.t)(e,t)}performanceTabs(e){let t=document.createElement("div");t.className="sl-pg-tabsbar";let i=document.createElement("button");i.type="button",i.className="sl-pg-step",i.dataset.step="previous",i.setAttribute("aria-label",this.copy("picker.group.previousPerformance")),i.textContent="\u2039",i.addEventListener("click",()=>{this.stepPerformance(-1)});let o=document.createElement("button");o.type="button",o.className="sl-pg-step",o.dataset.step="next",o.setAttribute("aria-label",this.copy("picker.group.nextPerformance")),o.textContent="\u203A",o.addEventListener("click",()=>{this.stepPerformance(1)});let r=document.createElement("div");return r.className="sl-pg-tabs",r.setAttribute("role","tablist"),r.setAttribute("aria-label",this.copy("picker.group.performances")),e.performances.forEach((s,a)=>{let l=document.createElement("button");l.type="button",l.className="sl-pg-tab",l.id=`sl-pg-tab-${e.key}-${s.eventKey}`,l.dataset.eventKey=s.eventKey,l.dataset.state="not-started",l.setAttribute("role","tab"),l.setAttribute("aria-selected",String(a===0)),l.setAttribute("aria-controls",this.panelId),l.tabIndex=a===0?0:-1;let c=document.createElement("span");c.className="sl-pg-tab-name",c.textContent=s.name;let d=document.createElement("span");d.className="sl-pg-tab-state",d.textContent=this.copy("picker.group.stillNeedsSeat");let p=document.createElement("span");p.className="sl-pg-tab-badge",p.textContent=this.copy("picker.group.chosenOfTotal",{chosen:0,total:this.options.numberOfPlacesToSelect??1}),l.append(c,p,d),l.addEventListener("click",()=>{this.switchPerformance(s.eventKey)}),l.addEventListener("keydown",m=>this.tabKeydown(m)),r.appendChild(l)}),t.append(i,r,o),this.tabsHost=r,this.prevButton=i,this.nextButton=o,t}tabButtons(){return[...this.tabsHost?.querySelectorAll(".sl-pg-tab")??[]]}tabKeydown(e){let t=this.tabButtons(),i=t.findIndex(a=>a===e.target);if(i<0)return;let o=getComputedStyle(this.tabsHost??document.body).direction==="rtl",r=-1;switch(e.key){case"ArrowRight":r=i+(o?-1:1);break;case"ArrowLeft":r=i+(o?1:-1);break;case"ArrowDown":r=i+1;break;case"ArrowUp":r=i-1;break;case"Home":r=0;break;case"End":r=t.length-1;break;default:return}if(r<0||r>=t.length)return;e.preventDefault();let s=t[r];s.focus({preventScroll:!0}),s.disabled||this.switchPerformance(s.dataset.eventKey)}stepPerformance(e){let t=this.tabButtons(),i=t.findIndex(r=>r.dataset.eventKey===this.activePerformanceKey),o=t[i+e];!o||o.disabled||(o.focus({preventScroll:!0}),this.switchPerformance(o.dataset.eventKey))}submissionState(){let e=this.descriptorValue?.performances??[];if(this.mode!=="per_performance"){let o=!this.holdBlocked();return{complete:e.length,total:e.length,ready:o}}let t=this.options.numberOfPlacesToSelect,i=e.filter(o=>this.selectionsByEvent.get(o.eventKey)?.length===t&&this.validByEvent.get(o.eventKey)!==!1).length;return{complete:i,total:e.length,ready:i===e.length&&!this.holdBlocked()}}holdBlocked(){return this.operationPending||this.recovery.kind!=="idle"||!!this.availability?.salesClosed}selectionChanged(e){if(this.mode!=="per_performance"){this.options.onSelectionChange?.(e),this.syncPane(),this.syncLegend(),!e.length&&!this.activeHandoff&&!this.resettingFlexibleSelection&&!this.selectingPartialSeat&&this.descriptorValue?.inclusionMode==="flexible_dates"&&this.api.includedPerformanceKeys().length<this.descriptorValue.performanceCount&&(this.resettingFlexibleSelection=!0,this.api.setIncludedEventKeys(this.descriptorValue.performances.map(i=>i.eventKey)),this.syncIncludedDates(),this.picker?.refreshAvailability().catch(i=>this.options.onError?.(i)).finally(()=>{this.resettingFlexibleSelection=!1}));return}if(this.refreshingComposition||this.switchingPerformance||!this.activePerformanceKey)return;let t=e.map(i=>({...i}));this.selectionsByEvent.set(this.activePerformanceKey,t),this.api.setPerformanceSelections(this.activePerformanceKey,t.map(i=>({label:i.label}))),t.length!==this.options.numberOfPlacesToSelect?this.validByEvent.set(this.activePerformanceKey,!1):this.validByEvent.has(this.activePerformanceKey)||this.validByEvent.set(this.activePerformanceKey,!0),this.updateTabs(),this.options.onSelectionChange?.(e),this.refreshComposition(),this.syncLegend()}selectionValidityChanged(e){if(this.mode==="per_performance"&&!this.switchingPerformance&&this.activePerformanceKey){let t=this.validByEvent.get(this.activePerformanceKey);this.validByEvent.set(this.activePerformanceKey,e.isValid),this.updateTabs(),!this.refreshingComposition&&t!==e.isValid&&this.refreshComposition()}this.options.onSelectionValidityChange?.(e)}refreshComposition(){if(this.refreshingComposition||!this.picker)return;let e=this.submissionState();this.refreshingComposition=!0;try{this.picker.refreshPerformanceGroupComposition();let t=this.submissionState();(e.complete!==t.complete||e.ready!==t.ready)&&this.picker.refreshPerformanceGroupComposition()}finally{this.refreshingComposition=!1}}tabState(e){let t=this.options.numberOfPlacesToSelect??1,i=(this.selectionsByEvent.get(e)??[]).map(r=>r.label),o=this.copy("picker.group.chosenOfTotal",{chosen:i.length,total:t});return i.length===0?{key:"not-started",label:this.copy("picker.group.stillNeedsSeat"),badge:o}:i.length===t&&this.validByEvent.get(e)!==!1?{key:"complete",label:this.copy("picker.group.completeWithSeats",{seats:i.join(", ")}),badge:o}:i.length===t?{key:"needs-attention",label:this.copy("picker.group.needsAttention"),badge:o}:{key:"in-progress",label:this.copy("picker.group.needsMoreSeats",{count:t-i.length}),badge:o}}updateTabs(){let e=this.tabButtons(),t=this.switchingPerformance||this.operationPending||this.recovery.kind!=="idle"||!!this.activeHandoff;e.forEach(o=>{let r=o.dataset.eventKey,s=this.tabState(r),a=r===this.activePerformanceKey;o.dataset.state=s.key,o.disabled=t,o.setAttribute("aria-selected",String(a)),o.tabIndex=a?0:-1;let l=o.querySelector(".sl-pg-tab-state");l&&(l.textContent=s.label);let c=o.querySelector(".sl-pg-tab-badge");c&&(c.textContent=s.badge);let d=o.querySelector(".sl-pg-tab-name")?.textContent??r;o.setAttribute("aria-label",`${d}: ${s.badge} \xB7 ${s.label}`),a&&this.innerHost?.setAttribute("aria-labelledby",o.id)});let i=e.findIndex(o=>o.dataset.eventKey===this.activePerformanceKey);this.prevButton&&(this.prevButton.disabled=t||i<=0),this.nextButton&&(this.nextButton.disabled=t||i<0||i>=e.length-1)}async switchPerformance(e){if(this.mode!=="per_performance"||this.switchingPerformance||this.holdBlocked()||this.activeHandoff||e===this.activePerformanceKey||!this.picker)return;this.activePerformanceKey&&this.selectionChanged(this.picker.getSelection());let t=this.selectionsByEvent.get(e)?.map(i=>i.label)??[];this.switchingPerformance=!0,this.activePerformanceKey=e,this.updateTabs(),this.setInteractionLocked(!0);try{this.picker.clearSelection(),this.api.setActivePerformance(e),await this.picker.refreshAvailability();let i=this.picker.selectObjects(t);this.switchingPerformance=!1,this.selectionChanged(i),i.length!==t.length&&this.validByEvent.set(e,!1),this.options.onSelectionChange?.(i);let o=this.descriptorValue?.performances.find(r=>r.eventKey===e);o&&this.announce(this.copy("picker.group.performanceOpened",{performance:o.name}))}catch(i){this.options.onError?.(i)}finally{this.switchingPerformance=!1,!this.operationPending&&this.recovery.kind==="idle"&&this.setInteractionLocked(!1),this.updateTabs(),this.picker.refreshPerformanceGroupComposition()}}setInteractionLocked(e){let t=this.innerHost;t&&(t.dataset.locked=String(e),t.setAttribute("aria-busy",String(e)),t.setAttribute("aria-disabled",String(e)))}announce(e){this.live&&(this.live.textContent=e)}showStatus(e,t,i={}){this.statusHost&&this.statusCopy&&this.statusAction&&(this.statusCopy.textContent=t,this.statusHost.hidden=!t,this.statusAction.hidden=!i.retry),this.announce(t),this.options.onStatusChange?.({kind:e,message:t,...i.reference?{reference:i.reference}:{}})}sessionEnded(e){this.destroyed||(this.showStatus("session_ended",this.copy("picker.accessExpiredTitle")),this.options.onError?.(e))}clearStatus(){this.statusHost&&(this.statusHost.hidden=!0),this.statusAction&&(this.statusAction.hidden=!0),this.options.onStatusChange?.({kind:"idle",message:""})}operationChanged(e){if(this.destroyed)return;let t=e.state==="preparing"||e.state==="commit_pending"||e.state==="abort_pending"||e.state==="expire_pending";if(this.operationPending=t,this.setInteractionLocked(t||this.recovery.kind!=="idle"),this.updateTabs(),t){this.showStatus("pending",this.copy(e.state==="commit_pending"?"picker.group.commitPending":e.state==="abort_pending"||e.state==="expire_pending"?"picker.group.abortPending":"picker.group.securing"));return}if(e.state==="booked"){this.bookingSettled();return}if(e.state==="expired"||e.state==="aborted"){this.activeHandoff&&this.holdLost();return}if(e.state==="committed"){this.clearStatus(),this.announce(this.copy("picker.group.secured")),queueMicrotask(()=>this.innerHost?.querySelector('[data-ref="cta"]')?.focus({preventScroll:!0}));return}e.decision==="abort"&&this.recovery.kind==="idle"&&(this.clearStatus(),this.announce(this.copy("picker.group.notSecured")))}bookingSettled(){if(this.booked)return;this.booked=!0,this.root&&(this.root.dataset.booking="booked"),this.clearStatus(),this.holdTicker&&clearInterval(this.holdTicker),this.holdTicker=null;let e=this.activeHandoff?{...this.activeHandoff,bookingState:"booked"}:null;e&&(this.activeHandoff=e),this.syncProgress(),this.syncPane(),this.updateTabs(),this.picker?.notifyGroupSettled("booked"),this.announce(this.copy("picker.group.bookedAll",{count:this.descriptorValue?.performanceCount??0})),e&&this.options.onBooked?.(e)}holdLost(){this.activeHandoff=null,this.api.stopSettlementWatch(),this.resetPerPerformanceSelection(),this.syncProgress(),this.syncPane(),this.syncHoldTicker(),this.picker?.notifyGroupSettled("lost"),this.announce(this.copy("picker.group.notSecured")),this.options.onHoldChange?.(null),this.options.onHoldExpired?.()}recoveryChanged(e){if(!this.destroyed){if(this.recovery=e,this.setInteractionLocked(this.operationPending||e.kind!=="idle"),this.updateTabs(),this.refreshComposition(),e.kind==="idle"){this.operationPending||this.clearStatus();return}if(e.kind==="pending"){this.showStatus("pending",e.longRunning?this.copy("picker.group.longRunning",{reference:e.reference}):this.copy("picker.group.outcomeUnknown"),{reference:e.reference});return}this.showStatus("recovery_failed",this.copy("picker.group.longRunning",{reference:e.reference}),{retry:e.retryable,reference:e.reference}),this.setInteractionLocked(!1)}}async retryRecovery(){if(!(this.destroyed||this.recovery.kind!=="failed"||!this.recovery.retryable))try{await this.api.retryRecovery()}catch(e){if(e instanceof Te)return;this.options.onError?.(e)}}async restoreOperation(){try{let e=await this.api.restoreOperation();e&&!this.destroyed&&await this.picker?.adoptRestoredHold(e.holdId)}catch(e){if(e instanceof Te)return;this.options.onError?.(e)}}availabilityChanged(e){if(this.destroyed)return;let t=this.availability;if(this.availability=e,e.revisionChanged){this.showStatus("revision_changed",this.copy("picker.group.revisionChanged")),this.reloadDescriptor(e.revision);return}e.salesClosed?this.showStatus("sales_closed",this.copy("picker.group.salesClosed")):t?.salesClosed&&this.clearStatus(),this.updateTabs(),this.refreshComposition(),this.syncLegend()}async reloadDescriptor(e){this.api.acceptRevision(e);try{let t=await this.api.descriptor();if(this.destroyed)return;this.descriptorValue=t,await this.picker?.refreshAvailability()}catch(t){if(t instanceof Te)return;this.options.onError?.(t)}}handoff(e,t){let i=this.descriptorValue,o=this.api.operationIdForHold(e.holdId);if(!i||!o)throw new Error("seatlayer: Performance Group hold identity is unavailable");let r=this.api.allocationsForHold(e.holdId);return{operationId:o,holdId:e.holdId,expiresAt:e.expiresAt,performanceGroup:i,selectionMode:this.mode,performanceKeys:r.map(s=>s.eventKey),bookingState:this.booked?"booked":"held",seatLabels:t.map(s=>s.label),...this.mode==="per_performance"?{allocations:r.map(s=>({eventKey:s.eventKey,seatLabels:s.items.map(a=>a.label)}))}:{}}}renderHeldAllocations(e){if(!(!this.heldSummary||this.mode!=="per_performance")){this.heldSummary.replaceChildren();for(let t of e){let i=this.descriptorValue?.performances.find(s=>s.eventKey===t.eventKey),o=document.createElement("p"),r=document.createElement("strong");r.textContent=i?.name??t.eventKey,o.append(r,document.createTextNode(t.items.map(s=>s.label).join(", "))),this.heldSummary.appendChild(o)}this.heldSummary.hidden=e.length===0}}resetPerPerformanceSelection(){this.mode==="per_performance"&&(this.selectionsByEvent.clear(),this.validByEvent.clear(),this.heldSummary?.replaceChildren(),this.heldSummary&&(this.heldSummary.hidden=!0),this.updateTabs(),this.picker?.refreshPerformanceGroupComposition())}holdChanged(e,t){if(!e){this.activeHandoff=null,this.api.stopSettlementWatch(),this.resetPerPerformanceSelection(),this.syncProgress(),this.syncPane(),this.syncHoldTicker(),this.options.onHoldChange?.(null);return}let i=this.handoff(e,t),o=this.activeHandoff?.holdId!==i.holdId;this.activeHandoff=i,this.renderHeldAllocations(this.api.allocationsForHold(e.holdId)),this.updateTabs(),this.api.watchSettlement(e.holdId),this.syncProgress(),this.syncPane(),this.syncHoldTicker(),o&&this.options.onHold?.(i),this.options.onHoldChange?.(i)}checkout(e,t){let i=this.handoff(e,t);this.continued=!0,this.activeHandoff=i,this.options.onCheckout?.(i),this.hosted?.mode==="hosted"&&this.descriptorValue&&this.hosted.open(this.picker?.root??null,{...i,descriptor:this.descriptorValue})}};var fe=require("@seatlayer/core");var gh="seatlayer-season-picker-style";function bh(){if(document.getElementById(gh))return;let n=document.createElement("style");n.id=gh,n.textContent=`
3601
+ .sl-season-root{box-sizing:border-box;margin:0;display:flex;flex-direction:column;height:100%;min-width:0;min-height:0;max-width:100%;color:var(--sl-text,#18202b);font-family:var(--sl-font,Inter,system-ui,sans-serif)}
3602
+ .sl-season-root *{box-sizing:border-box}
3603
+ .sl-season-map{position:relative;flex:1 1 auto;min-width:0;min-height:0}
3604
+ .sl-season-status{margin:0;padding:12px 16px;color:var(--sl-muted,#627081);font-size:13px}
3605
+ .sl-season-status[data-kind=failed],.sl-season-status[data-kind=partial_terminal]{color:var(--sl-danger,#b42318);font-weight:650}
3606
+ .sl-season-status:not([data-kind=loading]):not([data-kind=failed]):not([data-kind=partial_terminal]){position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
3607
+ .sl-season-root .sl-picker .sl-logo:not(:has(img)){display:none}
3608
+ .sl-season-root[data-placement=popup] .sl-picker{border-radius:0;min-height:0}
3609
+ .sl-season-root[data-placement=popup] .sl-picker .sl-head{min-height:52px;padding:0 16px;gap:12px;border-bottom-color:transparent;background:var(--sl-accent);color:var(--sl-accent-ink)}
3610
+ .sl-season-root[data-placement=popup] .sl-picker .sl-logo{width:30px;height:30px;border-radius:8px}
3611
+ .sl-season-root[data-placement=popup] .sl-picker .sl-head-name{font-size:15px;font-weight:700}
3612
+ .sl-season-root[data-placement=popup] .sl-picker .sl-head-meta{display:none}
3613
+ .sl-season-root[data-placement=popup] .sl-picker .sl-close{border-color:transparent;color:inherit}
3614
+ .sl-season-root[data-placement=popup] .sl-picker .sl-head .sl-hold-pill{background:var(--sl-accent-ink);color:var(--sl-accent)}
3615
+ .sl-season-root[data-placement=popup] .sl-picker[data-layout=narrow] .sl-head{min-height:48px;padding:0 14px;gap:10px}
3616
+ .sl-season-root[data-placement=popup] .sl-picker[data-layout=narrow] .sl-logo{width:28px;height:28px}
3617
+ .sl-season-root[data-placement=popup] .sl-picker[data-layout=narrow] .sl-head-name{font-size:14px}
3618
+ .sl-season-root .sl-step-frame{min-height:0}
3619
+ .sl-season-root .sl-season-step{flex:1 1 auto;min-height:0;display:flex;flex-direction:column;container-type:inline-size}
3620
+ .sl-season-root .sl-step-body{flex:1 1 auto;min-height:0;overflow:auto;padding:20px 24px 8px;display:flex;flex-direction:column;gap:18px}
3621
+ .sl-season-root .sl-step-body>*{flex:none}
3622
+ .sl-season-root .sl-step-cols{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(0,1fr);gap:22px;align-items:start}
3623
+ .sl-season-root .sl-step-col{display:flex;flex-direction:column;gap:18px;min-width:0}
3624
+ .sl-season-root .sl-step-title{margin:0;font-size:22px;font-weight:750;line-height:1.2}
3625
+ .sl-season-root .sl-step-facts{margin:4px 0 0;display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;color:var(--sl-muted);font-size:14px}
3626
+ .sl-season-root .sl-step-onsale{padding:2px 8px;border-radius:999px;background:color-mix(in srgb,var(--sl-accent) 16%,transparent);color:var(--sl-accent-text,var(--sl-text));font-size:12px;font-weight:650}
3627
+ .sl-season-root .sl-step-promise b,.sl-season-root .sl-step-packages>b{display:block;margin-bottom:8px;font-size:15px;font-weight:700}
3628
+ .sl-season-root .sl-step-promise ul{margin:0;padding-left:18px;display:grid;gap:4px;font-size:14px}
3629
+ .sl-season-root .sl-step-cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:10px}
3630
+ .sl-season-root .sl-step-card{display:flex;flex-direction:column;gap:4px;padding:14px;border:1px solid var(--sl-line);border-radius:12px;background:var(--sl-surface)}
3631
+ .sl-season-root .sl-step-card[data-chosen]{border-color:var(--sl-accent);box-shadow:0 0 0 1px var(--sl-accent)}
3632
+ .sl-season-root .sl-step-card-name{font-size:15px}
3633
+ .sl-season-root .sl-step-card-dates,.sl-season-root .sl-step-card-price span,.sl-season-root .sl-step-prices-head span{color:var(--sl-muted);font-size:13px}
3634
+ .sl-season-root .sl-step-card-price{display:flex;align-items:baseline;gap:6px;margin-top:4px}
3635
+ .sl-season-root .sl-step-card-choose,.sl-season-root .sl-step-seats,.sl-season-root .sl-step-all{min-height:40px;padding:0 16px;border:1px solid var(--sl-line);border-radius:10px;background:var(--sl-surface);color:var(--sl-text);font:inherit;font-size:14px;font-weight:650;white-space:nowrap;cursor:pointer}
3636
+ .sl-season-root .sl-step-card-choose{margin-top:8px;align-self:flex-start}
3637
+ .sl-season-root .sl-step-card-choose[aria-pressed=true]{border-color:transparent;background:transparent;color:var(--sl-accent-text,var(--sl-text));cursor:default}
3638
+ .sl-season-root .sl-step-seats{border-color:var(--sl-accent);background:var(--sl-accent);color:var(--sl-accent-ink)}
3639
+ .sl-season-root .sl-season-step button:disabled:not([aria-pressed=true]){opacity:.6;cursor:wait}
3640
+ .sl-season-root .sl-season-step button:focus-visible{outline:2px solid var(--sl-accent);outline-offset:2px}
3641
+ .sl-season-root .sl-step-prices{border:1px solid var(--sl-line);border-radius:12px;overflow:hidden}
3642
+ .sl-season-root .sl-step-prices-head{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 10px;padding:12px 14px;border-bottom:1px solid var(--sl-line)}
3643
+ .sl-season-root .sl-step-prices table{width:100%;border-collapse:collapse;font-size:14px}
3644
+ .sl-season-root .sl-step-prices th,.sl-season-root .sl-step-prices td{padding:9px 14px;text-align:left;border-top:1px solid var(--sl-line)}
3645
+ .sl-season-root .sl-step-prices tr:first-child th{border-top:0;color:var(--sl-muted);font-size:12px;font-weight:650}
3646
+ .sl-season-root .sl-step-prices td{font-variant-numeric:tabular-nums}
3647
+ .sl-season-root .sl-step-dates{margin:0;padding:0;list-style:none;display:grid;gap:8px}
3648
+ .sl-season-root .sl-step-date{display:flex;align-items:center;gap:12px;padding:10px 12px;border:1px solid var(--sl-line);border-radius:12px}
3649
+ .sl-season-root .sl-step-day{display:flex;flex-direction:column;align-items:center;min-width:40px;line-height:1.1}
3650
+ .sl-season-root .sl-step-day small{color:var(--sl-muted);font-size:11px;font-weight:700}
3651
+ .sl-season-root .sl-step-day b{font-size:18px}
3652
+ .sl-season-root .sl-step-date-text{display:flex;flex-direction:column;min-width:0;flex:1;font-size:14px}
3653
+ .sl-season-root .sl-step-date-text span{color:var(--sl-muted);font-size:13px}
3654
+ .sl-season-root .sl-step-date[data-state]{opacity:.6}
3655
+ .sl-season-root .sl-step-date[data-state=cancelled] .sl-step-date-text b{text-decoration:line-through}
3656
+ .sl-season-root .sl-step-date-tag{font-size:12px;font-weight:650;color:var(--sl-muted)}
3657
+ .sl-season-root .sl-step-all{align-self:flex-start}
3658
+ .sl-season-root .sl-step-narrow{display:none}
3659
+ .sl-season-root .sl-step-go{flex:none;display:flex;align-items:center;justify-content:flex-end;gap:12px;padding:12px 24px 16px}
3660
+ .sl-season-root .sl-step-go-price{display:none}
3661
+ .sl-season-root .sl-season-strip{flex:none;display:flex;flex-wrap:wrap;align-items:center;gap:6px 16px;padding:8px 16px;border-bottom:1px solid var(--sl-line);background:var(--sl-surface);font-size:13px;container-type:inline-size}
3662
+ .sl-season-root .sl-strip-steps{display:flex;flex-wrap:wrap;gap:6px 14px;margin:0;padding:0;list-style:none;font-size:13px}
3663
+ .sl-season-root .sl-strip-steps li{display:flex;align-items:center;gap:6px;color:var(--sl-muted)}
3664
+ .sl-season-root .sl-strip-steps li[data-state=current]{color:var(--sl-text);font-weight:650}
3665
+ .sl-season-root .sl-strip-n{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;border:1px solid var(--sl-line);border-radius:999px;font-size:11px;font-weight:700}
3666
+ .sl-season-root .sl-strip-steps li:not([data-state=next]) .sl-strip-n{border-color:var(--sl-accent);background:var(--sl-accent);color:var(--sl-accent-ink)}
3667
+ .sl-season-root .sl-strip-pkg{color:var(--sl-muted)}
3668
+ .sl-season-root .sl-strip-pkg b{color:var(--sl-text)}
3669
+ .sl-season-root .sl-strip-change{margin-left:auto;padding:4px 2px;border:0;background:none;color:var(--sl-accent-text,var(--sl-text));font:inherit;font-weight:650;text-decoration:underline;cursor:pointer;white-space:nowrap}
3670
+ .sl-season-root .sl-step-intro .sl-strip-steps{margin-bottom:12px}
3671
+ @container (max-width:720px){
3672
+ .sl-season-root .sl-step-cols{grid-template-columns:minmax(0,1fr)}
3673
+ }
3674
+ @container (max-width:640px){
3675
+ .sl-season-root .sl-strip-steps li:not([data-state=current]){display:none}
3676
+ .sl-season-root .sl-strip-price{display:none}
3677
+ .sl-season-root .sl-step-body{padding:16px 16px 8px}
3678
+ .sl-season-root .sl-step-title{font-size:19px}
3679
+ .sl-season-root .sl-step-cards{grid-template-columns:1fr}
3680
+ .sl-season-root .sl-step-card{flex-direction:row;flex-wrap:wrap;align-items:center;column-gap:8px}
3681
+ .sl-season-root .sl-step-card-choose{margin:0 0 0 auto}
3682
+ .sl-season-root .sl-season-step [data-more]{display:none}
3683
+ .sl-season-root .sl-step-wide{display:none}
3684
+ .sl-season-root .sl-step-narrow{display:inline}
3685
+ .sl-season-root .sl-step-go{justify-content:space-between;padding:12px 16px;border-top:1px solid var(--sl-line);background:var(--sl-surface)}
3686
+ .sl-season-root .sl-step-go-price{display:block;font-size:13px;font-weight:650}
3687
+ }
3688
+ .sl-season-leave{position:fixed;inset:0;z-index:2147483001;display:flex;align-items:center;justify-content:center;padding:16px;background:rgba(5,7,12,.45);font-family:var(--sl-font,Inter,system-ui,sans-serif)}
3689
+ .sl-season-leave-card{box-sizing:border-box;width:min(380px,100%);padding:22px;border-radius:16px;background:var(--sl-surface,#fff);color:var(--sl-text,#18202b);box-shadow:0 18px 48px rgba(5,7,12,.28)}
3690
+ .sl-season-leave h2{margin:0 0 6px;font-size:18px;font-weight:750;line-height:1.25}
3691
+ .sl-season-leave p{margin:0 0 18px;color:var(--sl-muted,#627081);font-size:14px;line-height:1.45}
3692
+ .sl-season-leave-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:10px}
3693
+ .sl-season-leave button{min-height:40px;padding:0 16px;border:1px solid var(--sl-line,#dde3ea);border-radius:10px;background:var(--sl-surface,#fff);color:var(--sl-text,#18202b);font:inherit;font-size:14px;font-weight:650;cursor:pointer}
3694
+ .sl-season-leave button[data-leave=keep]{border-color:var(--sl-accent,#7357d8);background:var(--sl-accent,#7357d8);color:var(--sl-accent-ink,#fff)}
3695
+ .sl-season-leave button:focus-visible{outline:2px solid var(--sl-accent,#7357d8);outline-offset:2px}
3696
+ `,document.head.appendChild(n)}var hi=require("@seatlayer/core");var q=class extends Error{constructor(t,i,o){super(`season_request_failed:${t}`);this.code=t;this.status=i;this.name="SeasonApiError",o?.retryAfterS!==void 0&&(this.retryAfterS=o.retryAfterS),o?.retryable!==void 0&&(this.retryable=o.retryable),o?.reason!==void 0&&(this.reason=o.reason),o?.refusals?.length&&(this.refusals=o.refusals),o?.buyerMessage&&(this.buyerMessage=o.buyerMessage)}},di=class extends Error{constructor(t){super(`season_operation_timeout:${t}`);this.operationId=t;this.name="SeasonRecoveryTimeoutError"}},pi=class extends Error{constructor(t,i){super(`season_public_session_refused:${t}`);this.reason=t;this.status=i;this.name="SeasonPublicSessionRefused"}};Vr();var ub="https://api.seatlayer.io",mb=6e4,fb=5e3,gb=new Set(["seat_unavailable","seat_held_for_renewal"]);function wh(n){return typeof n=="string"&&gb.has(n)?n:void 0}function $s(n){return Array.isArray(n)?n.flatMap(e=>{let t=e??{},i=typeof t.eventKey=="string"?t.eventKey:t.eventId,o=wh(t.code);return typeof i=="string"&&o?[{eventKey:i,code:o}]:[]}):[]}function bb(n,e){let t=Number(n.headers.get("Retry-After")),i=Number.isFinite(t)&&t>=0?t:e.retryAfterSeconds;return Math.max(0,Math.min(fb,i*1e3))}function yb(n,e){return e?.aborted?Promise.reject(e.reason??new DOMException("Aborted","AbortError")):new Promise((t,i)=>{let o=setTimeout(t,n);e?.addEventListener("abort",()=>{clearTimeout(o),i(e.reason??new DOMException("Aborted","AbortError"))},{once:!0})})}function yh(n){if(!n||typeof n!="object")return"unknown";let e=n;return typeof e.code=="string"?e.code:typeof e.error=="string"?e.error:"unknown"}function vb(n,e){let t=e&&typeof e=="object"?e:{},i=$s(t.handoff?.allocations??t.operation?.allocations),o=(n.headers.get("Retry-After")??"").trim(),r=o?Number(o):Number.NaN;return{...Number.isFinite(r)&&r>=0?{retryAfterS:Math.ceil(r)}:{},...typeof t.retryable=="boolean"?{retryable:t.retryable}:{},...typeof t.reason=="string"?{reason:t.reason}:{},...i.length?{refusals:i}:{}}}var wb=/^shc_[a-f0-9]{40}$/,xb=/^shh_[a-f0-9]{40}$/,kb=new Set(["preparing","commit_pending","committed","expire_pending","booking_pending","abort_pending","aborted","partial_terminal","expired","booked"]),Sb=new Set(["pending","prepared","refused","applied","expired","booked","aborted"]);function Vs(n){return Array.isArray(n)?n.some(Vs):!n||typeof n!="object"?!1:Object.entries(n).some(([e,t])=>e==="childHoldId"||e==="child_hold_id"||e==="holdId"&&typeof t=="string"&&wb.test(t)||Vs(t))}function zi(n,e,t="invalid_operation_response"){if(!n||typeof n!="object"||Array.isArray(n))throw new q(t,502);if(Vs(n))throw new q("unsafe_operation_response",502);let i=n,o=i.allocations,r=new Set,s=Array.isArray(o)&&o.length>0&&o.every(p=>{if(!p||typeof p!="object")return!1;let m=p.eventId,u=p.state;return typeof m!="string"||!m||typeof u!="string"||!Sb.has(u)||r.has(m)?!1:(r.add(m),!0)}),a=i.bookingRef===null||typeof i.bookingRef=="string"&&i.bookingRef.length>0,l=i.state!=="booked"||typeof i.bookingRef=="string"&&s&&o.every(p=>p.state==="booked"),c=i.state!=="booking_pending"||typeof i.bookingRef=="string"&&s&&o.some(p=>p.state!=="booked"),d=i.state!=="committed"||i.bookingRef===null;if(i.operationId!==e.operationId||i.seasonId!==e.seasonId||i.kind!=="HOLD"||typeof i.holdId!="string"||!xb.test(i.holdId)||i.policy!=="fixed_inclusion_same_seat"||typeof i.state!="string"||!kb.has(i.state)||typeof i.expiresAt!="number"||!Number.isFinite(i.expiresAt)||i.expiresAt<0||!a||typeof i.location!="string"||!i.location||typeof i.retryAfterSeconds!="number"||!Number.isFinite(i.retryAfterSeconds)||i.retryAfterSeconds<0||!s||!l||!c||!d||i.pricingAuthority!==void 0&&i.pricingAuthority!=="host"||i.authoritativeAmountIncluded!==void 0&&i.authoritativeAmountIncluded!==!1)throw new q(t,502);return{operationId:i.operationId,seasonId:i.seasonId,kind:i.kind,holdId:i.holdId,expiresAt:i.expiresAt,policy:i.policy,pricingAuthority:"host",authoritativeAmountIncluded:!1,state:i.state,bookingRef:i.bookingRef,location:i.location,retryAfterSeconds:i.retryAfterSeconds,allocations:o.map(p=>{let m=wh(p.code);return{eventId:p.eventId,state:p.state,...m?{code:m}:{}}})}}function Tb(n,e,t){if(!Array.isArray(n)||n.length!==t||n.some(s=>typeof s!="string"||!s)||new Set(n).size!==n.length||!Array.isArray(e)||e.length!==n.length)throw new q("invalid_best_available_response",502);let i=n,o=new Set(i),r=new Map;for(let s of e){if(!s||typeof s!="object")throw new q("invalid_best_available_response",502);let a=s;if(typeof a.label!="string"||!o.has(a.label)||r.has(a.label)||typeof a.objectId!="string"||!a.objectId||a.objectType!=="seat"||typeof a.categoryKey!="string"||!a.categoryKey||a.tierId!==null&&(typeof a.tierId!="string"||!a.tierId)||a.quantity!==void 0&&a.quantity!==1)throw new q("invalid_best_available_response",502);r.set(a.label,{label:a.label,objectId:a.objectId,objectType:"seat",categoryKey:a.categoryKey,tierId:a.tierId,...a.quantity===void 0?{}:{quantity:a.quantity}})}return{labels:i,items:i.map(s=>r.get(s))}}function vh(n){return typeof n=="number"&&Number.isFinite(n)?n:null}async function xh(n,e,t=globalThis.fetch.bind(globalThis)){try{let i=await t(`${n.replace(/\/$/,"")}/pub/seasons/${encodeURIComponent(e)}/prices`,{method:"GET",credentials:"omit"});return i.ok?kh(await i.json()):null}catch{return null}}function kh(n){if(!n||typeof n!="object"||Array.isArray(n))return null;let e=n;if(typeof e.currency!="string"||!e.currency||!Array.isArray(e.packages))return null;let t=[];for(let i of e.packages){if(!i||typeof i!="object")continue;let o=i;if(typeof o.planKey!="string"||!o.planKey||typeof o.planActivationId!="string"||!o.planActivationId||!Array.isArray(o.prices))continue;let r=[],s=new Set;for(let a of o.prices){if(!a||typeof a!="object")continue;let l=a;if(typeof l.categoryKey!="string"||!l.categoryKey)continue;let c=typeof l.priceTypeKey=="string"?l.priceTypeKey:"",d=`${l.categoryKey}\0${c||"adult"}`;s.has(d)||typeof l.unitPrice!="number"||!Number.isInteger(l.unitPrice)||l.unitPrice<0||(s.add(d),r.push({categoryKey:l.categoryKey,...c?{priceTypeKey:c,priceTypeLabel:typeof l.priceTypeLabel=="string"?l.priceTypeLabel:c}:{},unitPrice:l.unitPrice}))}r.length&&t.push({planKey:o.planKey,planActivationId:o.planActivationId,name:typeof o.name=="string"&&o.name?o.name:o.planKey,prices:r,...Number.isInteger(o.datesToCome)&&o.datesToCome>=0?{datesToCome:o.datesToCome,firstDateAt:vh(o.firstDateAt),lastDateAt:vh(o.lastDateAt)}:{}})}return t.length?{currency:e.currency,packages:t}:null}function Eb(n){if(!n||typeof n!="object"||Array.isArray(n))throw new q("invalid_checkout_response",502);let e=n,t=typeof e.redirectUrl=="string"&&!!e.redirectUrl,i=so(e.redirectUrl);if(t&&!i)throw new q("gateway_unavailable",502);if(typeof e.orderId!="string"||!e.orderId||typeof e.currency!="string"||!e.currency||typeof e.totalMinor!="number"||!Number.isFinite(e.totalMinor)||typeof e.expiresAt!="number"||!Number.isFinite(e.expiresAt)||!i)throw new q("invalid_checkout_response",502);return{orderId:e.orderId,totalMinor:e.totalMinor,currency:e.currency,expiresAt:e.expiresAt,redirectUrl:i}}function Sh(n,e,t){return{seasonKey:n.key,planActivationId:n.planActivationId,operationId:e.operationId,holdId:e.holdId,expiresAt:e.expiresAt,policy:e.policy,pricingAuthority:"host",authoritativeAmountIncluded:!1,state:e.state,allocations:e.allocations.map(({eventId:i,state:o,code:r})=>({eventKey:i,state:o,...r?{code:r}:{}})),...t?{seats:t}:{}}}var tt,gn,lt,bn,ji,ct,dt,Fe,Ze,Th,Er=class{constructor(e,t){P(this,Fe);P(this,tt);P(this,gn);P(this,lt);P(this,bn);P(this,ji);P(this,ct,!1);P(this,dt,null);k(this,tt,e),k(this,gn,(t.apiBase??ub).replace(/\/$/,"")),k(this,lt,t.access),k(this,bn,t.fetch??globalThis.fetch.bind(globalThis)),k(this,ji,t.recoveryTimeoutMs??mb),h(this,lt).onRenewed(i=>w(this,Fe,Th).call(this,i))}async descriptor(){let{body:e}=await w(this,Fe,Ze).call(this,"GET","");return e.season}async chart(){let{body:e}=await w(this,Fe,Ze).call(this,"GET","/chart");return e}async availability(){let{body:e}=await w(this,Fe,Ze).call(this,"GET","/availability"),t=Object.values(e.seats??{});return{...e,freeCount:t.filter(i=>i==="free").length,blockedCount:t.filter(i=>i!=="free").length}}async hold(e,t,i){let o=e.map(a=>{let l=i?.get(a);return l&&l!=="adult"?{label:a,priceTypeKey:l}:{label:a}}),{body:r,response:s}=await w(this,Fe,Ze).call(this,"POST","/holds",{operationId:t,labels:[...e],...o.some(a=>"priceTypeKey"in a)?{selections:o}:{}});return{operation:zi(r.operation,{seasonId:h(this,tt),operationId:t}),response:s}}async bestAvailable(e){let{body:t,response:i}=await w(this,Fe,Ze).call(this,"POST","/best-available",{operationId:e.operationId,qty:e.qty,...e.categoryKey?{categoryKey:e.categoryKey}:{},...e.zoneId?{zoneId:e.zoneId}:{},...e.accessibility?.length?{accessibility:[...e.accessibility]}:{},...e.requireContiguous===!0?{requireContiguous:!0}:{}}),o=zi(t.operation,{seasonId:h(this,tt),operationId:e.operationId},"invalid_best_available_response"),{labels:r,items:s}=Tb(t.labels,t.items,e.qty);return{operation:o,labels:r,items:s,response:i}}async operation(e){let{body:t,response:i}=await w(this,Fe,Ze).call(this,"GET",`/operations/${encodeURIComponent(e)}`);return{operation:zi(t.operation,{seasonId:h(this,tt),operationId:e}),response:i}}async release(e,t){let{body:i,response:o}=await w(this,Fe,Ze).call(this,"POST",`/holds/${encodeURIComponent(e)}/release`,{releaseActionId:t});return{operation:zi(i.operation,{seasonId:h(this,tt),operationId:e}),response:o}}async prices(){let e;try{({body:e}=await w(this,Fe,Ze).call(this,"GET","/prices"))}catch(t){if(t instanceof q&&t.status===404)return null;throw t}return kh(e)}async checkout(e){let{body:t}=await w(this,Fe,Ze).call(this,"POST","/checkout",{operationId:e.operationId,buyerEmail:e.buyerEmail,...e.buyerName?{buyerName:e.buyerName}:{},...e.provider?{provider:e.provider}:{},...e.returnUrl?{returnUrl:e.returnUrl}:{}});return Eb(t)}async orderStatus(e){let t=await h(this,bn).call(this,`${h(this,gn)}/pub/orders/${encodeURIComponent(e)}/status`,{method:"GET",credentials:"omit"}),i=await t.json().catch(()=>null);if(!t.ok)throw new q(yh(i),t.status);if(i===null)throw new q("invalid_json_response",502);return i}async renewalIntent(e){let{body:t}=await w(this,Fe,Ze).call(this,"POST","/renewal-intents",{offerId:e}),i=t.intent;if(!i||i.offerId!==e||i.state!=="intent_received"||!i.intentId||!Number.isFinite(i.receivedAt))throw new q("invalid_renewal_intent_response",502);return i}async waitForTerminal(e,t,i){let o=Date.now(),r=t?{operation:zi(t.operation,{seasonId:h(this,tt),operationId:e}),response:t.response}:await this.operation(e);for(;r.operation.state==="preparing"||r.operation.state==="commit_pending"||r.operation.state==="expire_pending"||r.operation.state==="booking_pending"||r.operation.state==="abort_pending";){if(Date.now()-o>=h(this,ji))throw new di(e);await yb(bb(r.response,r.operation),i),r=await this.operation(e)}return r.operation}destroy(){h(this,ct)||(k(this,ct,!0),h(this,lt).onRenewed(void 0),h(this,lt).clear())}};tt=new WeakMap,gn=new WeakMap,lt=new WeakMap,bn=new WeakMap,ji=new WeakMap,ct=new WeakMap,dt=new WeakMap,Fe=new WeakSet,Ze=async function(e,t,i,o=!0){if(h(this,ct))throw new q("season_api_destroyed",409);if(h(this,dt))throw h(this,dt);let r=await h(this,lt).authorization();if(h(this,ct))throw new q("season_api_destroyed",409);if(h(this,dt))throw h(this,dt);if(!r)throw new we({reason:"no_token",retryable:!1});let s=await h(this,bn).call(this,`${h(this,gn)}/pub/seasons/${encodeURIComponent(h(this,tt))}${t}`,{method:e,headers:{Authorization:r,...i===void 0?{}:{"Content-Type":"application/json"}},body:i===void 0?void 0:JSON.stringify(i)}),a=await s.json().catch(()=>null);if(!s.ok){let l=yh(a);if(o&&await h(this,lt).handleFailure(s.status,l,r))return w(this,Fe,Ze).call(this,e,t,i,!1);let c=h(this,lt).unavailable;throw c?new we(c):new q(l,s.status,vb(s,a))}if(a===null)throw new q("invalid_json_response",502);return{body:a,response:s}},Th=async function(e){if(h(this,ct))return;let t=`/pub/seasons/${encodeURIComponent(h(this,tt))}/session/adopt`;for(let i=0;i<2;i++){if(h(this,ct))return;try{if((await h(this,bn).call(this,`${h(this,gn)}${t}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e.token}`},body:JSON.stringify({previousToken:e.previousToken}),credentials:"omit"})).ok){k(this,dt,null);return}}catch{}}if(!h(this,ct))throw k(this,dt,new q("season_session_adopt_failed",409)),h(this,dt)};function Cr(n){if(!(n instanceof q))return(0,hi.t)("season.selectionFailed");let e=new Set((n.refusals??[]).map(t=>t.code));return n.code==="season_sales_not_open"?(0,hi.t)("season.accessSalesNotOpen"):e.has("seat_held_for_renewal")?(0,hi.t)("season.seatHeldForRenewal"):e.has("seat_unavailable")||n.code==="seats_unavailable"?(0,hi.t)("season.seatUnavailable"):n.code==="unknown"?(0,hi.t)("season.selectionFailed"):`Season selection unavailable (${n.code}).`}function Pr(n){let e=n.edition?.trim();return e&&!n.name.includes(e)?`${n.name} ${e}`:n.name}function Eh(n){return n.state==="committed"||n.state==="booked"}function Ch(n){return new q(`season_operation_${n.state}`,409,{refusals:$s(n.allocations)})}var zs=class{constructor(e,t,i,o){this.transport=e;this.sink=t;this.intervalMs=i;this.onSessionEnded=o;this.timer=null;this.stopped=!0;this.prior={};this.priorPartial={}}start(){this.stopped&&(this.stopped=!1,this.timer=setTimeout(()=>{this.tick()},this.intervalMs))}stop(){this.stopped=!0,this.timer&&clearTimeout(this.timer),this.timer=null}async tick(){if(!this.stopped)try{let e=await this.transport.objects(""),t=this.transport.latestAvailability?.partial??{},i=r=>(t[r]??[]).join("|"),o=Object.entries(e.seats).filter(([r,s])=>this.prior[r]!==s||this.priorPartial[r]!==i(r)).map(([r,s])=>({label:r,status:s}));this.prior={...e.seats},this.priorPartial=Object.fromEntries(Object.keys(e.seats).map(r=>[r,i(r)])),o.length&&this.sink.applyStatuses(o)}catch(e){if(Lo(e)){this.stop(),this.onSessionEnded?.(e);return}this.stopped||await this.sink.resync()}finally{this.stopped||(this.timer=setTimeout(()=>{this.tick()},this.intervalMs))}}},Ar=class{constructor(e,t,i,o=!1){this.api=e;this.realtimePollMs=t;this.onSessionEnded=i;this.typed=o;this.descriptorValue=null;this.availabilityValue=null;this.reuseAvailabilityOnce=!1;this.nextOperationId=null;this.nextBestAvailable=null;this.nextReleaseActionId=null;this.operationByHold=new Map;this.seatsByHold=new Map;this.typeRefusal=null;this.types=new Map;this.chartPrefetch=null;this.resumable=null}get latestAvailability(){return this.availabilityValue}typesInPlay(e){return this.typed||e.some(t=>this.types.has(t))}recordSeats(e,t){this.seatsByHold.set(e,t.map(i=>({label:i,priceTypeKey:this.types.get(i)||"adult"})))}prime(e,t){this.descriptorValue=e,this.availabilityValue=t,this.reuseAvailabilityOnce=!0}takeChartPrefetch(){let e=this.chartPrefetch;return this.chartPrefetch=null,e}primeChart(e){e.catch(()=>{}),this.chartPrefetch=e}queueOperation(e){this.nextOperationId=e}queueBestAvailable(e,t){if(this.nextBestAvailable)throw new q("season_best_available_in_progress",409);let i={operationId:e,...t.accessibility?.length?{accessibility:[...t.accessibility]}:{},...t.requireContiguous===!0?{requireContiguous:!0}:{}};return this.nextBestAvailable=i,i}clearBestAvailable(e){this.nextBestAvailable===e&&(this.nextBestAvailable=null)}queueRelease(e){this.nextReleaseActionId=e}operationForHold(e){return this.operationByHold.get(e)??null}remember(e){this.operationByHold.set(e.holdId,e)}forget(e){this.operationByHold.delete(e)}prepareResume(e){this.resumable=e}async resume(e,t){let i=this.resumable;if(this.resumable=null,!i||i.holdId!==t)throw new q("season_hold_not_found",404);let o=await this.api.waitForTerminal(i.operationId);if(o.state!=="committed"||o.holdId!==t)throw new q("season_hold_not_found",404);if(i.typedSeats)for(let r of i.seats)this.types.set(r.label,r.priceTypeKey);return this.remember(o),this.recordSeats(t,i.seats.map(r=>r.label)),{holdId:t,expiresAt:o.expiresAt,items:i.seats.map(r=>({label:r.label,objectId:r.label,objectType:"seat",categoryKey:"",tierId:null,unitPrice:0,currency:this.descriptorValue?.currency??"USD"}))}}async chart(e){let[t,i]=await Promise.all([this.descriptorValue?Promise.resolve(this.descriptorValue):this.api.descriptor(),this.takeChartPrefetch()??this.api.chart()]);return this.descriptorValue=t,{doc:i,event:{key:t.key,name:Pr(t),venue:t.venue,startsAt:t.occurrences[0]?.startsAt??null,timezone:t.timezone,currency:t.currency,mode:t.mode,inventoryModelVersion:2}}}async objects(e){let t;return this.reuseAvailabilityOnce&&this.availabilityValue?(this.reuseAvailabilityOnce=!1,t=this.availabilityValue):(t=await this.api.availability(),this.availabilityValue=t),{seats:{...t.seats}}}async hold(e,t,i,o){if(o)throw new q("season_hold_replace_unsupported",409);let r=this.nextOperationId??`sop_${crypto.randomUUID()}`;this.nextOperationId=null;let s=t.map(c=>c.label),a=await this.api.hold(s,r,this.types).catch(c=>{throw c instanceof q&&c.code==="price_type_not_offered"?this.typeRefusal=new q(c.code,c.status,{reason:"ticket_option_not_applicable"}):Ah(c)}),l=await this.api.waitForTerminal(r,a);if(!Eh(l))throw Ch(l);return this.remember(l),this.recordSeats(l.holdId,s),{holdId:l.holdId,expiresAt:l.expiresAt,items:t.map(c=>({label:c.label,objectId:c.label,objectType:"seat",categoryKey:"",tierId:c.tierId??null,unitPrice:0,currency:this.descriptorValue?.currency??"USD",...c.quantity==null?{}:{quantity:c.quantity}}))}}async release(e,t,i){let o=this.operationForHold(i);if(!o)throw new q("season_hold_not_found",404);let r=this.nextReleaseActionId??`sra_${crypto.randomUUID()}`;this.nextReleaseActionId=null;let s=await this.api.release(o.operationId,r),a=await this.api.waitForTerminal(o.operationId,s);if(a.state==="partial_terminal")throw this.remember(a),new q("season_operation_partial_terminal",409);this.forget(i)}async bestAvailable(e,t,i,o){let r=this.nextBestAvailable;this.nextBestAvailable=null;let s=r?.operationId??`sop_${crypto.randomUUID()}`,a=await this.api.bestAvailable({operationId:s,qty:t,...i?{categoryKey:i}:{},...o?{zoneId:o}:{},...r?.accessibility?.length?{accessibility:r.accessibility}:{},...r?.requireContiguous===!0?{requireContiguous:!0}:{}}).catch(d=>{throw Ah(d)}),l=await this.api.waitForTerminal(s,a);if(!Eh(l))throw Ch(l);this.remember(l);for(let d of a.labels)this.types.delete(d);this.recordSeats(l.holdId,a.labels);let c=new Map(a.items.map(d=>[d.label,d]));return{holdId:l.holdId,expiresAt:l.expiresAt,labels:[...a.labels],items:a.labels.map(d=>{let p=c.get(d);return{label:d,objectId:p?.objectId??d,objectType:"seat",categoryKey:p?.categoryKey??i??"",tierId:p?.tierId??null,unitPrice:0,currency:this.descriptorValue?.currency??"USD",...p?.quantity==null?{}:{quantity:p.quantity}}})}}socketUrl(){return""}createRealtime(e,t){return new zs(this,t,this.realtimePollMs,this.onSessionEnded)}};function Ah(n){return!(n instanceof q)||n.code!=="season_sales_not_open"?n:new q(n.code,n.status,{reason:"event_closed",buyerMessage:Cr(n)})}var te=require("@seatlayer/core"),Cb=["adult","child","concession","senior","student"];function j(n,e,t){let i=document.createElement(n);return e&&(i.className=e),t!==void 0&&(i.textContent=t),i}function Ki(n){return n===1?(0,te.t)("season.oneDate"):(0,te.t)("season.dateCount").replace("{count}",String(n))}function js(n){return n===1?(0,te.t)("season.priceForOneDate"):(0,te.t)("season.priceForAllDates").replace("{count}",String(n))}function Tt(n){return n.occurrences.length?n.occurrences.filter(e=>e.past!==!0&&e.cancelled!==!0).length:n.occurrenceCount}function ui(n,e,t,i){try{return new Intl.DateTimeFormat(t,{...i,...e?{timeZone:e}:{}}).format(n)}catch{return new Intl.DateTimeFormat(t,i).format(n)}}function Ph(n,e,t,i,o){let r={day:"numeric",month:"short",...o?{year:"numeric"}:{}},s=ui(n,t,i,r),a=ui(e,t,i,r);return s===a?s:(0,te.t)("season.dateRange").replace("{from}",s).replace("{to}",a)}function Ks(n){let e=n.filter(i=>(i.priceTypeKey??"adult")==="adult"),t=e.length?e:n;return t.length?Math.min(...t.map(i=>i.unitPrice)):null}function Mh(n){return n.occurrences.filter(e=>e.past!==!0&&e.cancelled!==!0)}function Ab(n,e,t){let i=j("div","sl-step-card");t&&(i.dataset.chosen="true"),i.append(j("b","sl-step-card-name",e.name));let o=t?Mh(n.descriptor):null,r=o?o.length:e.datesToCome;if(r!==void 0){let l=o?o.find(p=>p.startsAt!=null)?.startsAt??null:e.firstDateAt??null,c=o?[...o].reverse().find(p=>p.startsAt!=null)?.startsAt??null:e.lastDateAt??null,d=l!=null&&c!=null?Ph(l,c,n.descriptor.timezone,n.locale,!1):"";i.append(j("span","sl-step-card-dates",[Ki(r),d].filter(Boolean).join(" \xB7 ")))}let s=Ks(e.prices);if(s!=null){let l=j("span","sl-step-card-price");l.append(j("b",void 0,(0,te.t)("season.fromPrice").replace("{price}",n.money(s))),j("span",void 0,(0,te.t)("season.perSeat"))),i.append(l)}let a=j("button","sl-step-card-choose",t?(0,te.t)("season.chosen"):(0,te.t)("season.choose"));return a.type="button",a.disabled=t||n.loading,a.setAttribute("aria-pressed",String(t)),t||a.addEventListener("click",()=>n.choose(e.planActivationId)),i.append(a),i}function Pb(n,e,t){let i=j("div","sl-step-prices"),o=j("div","sl-step-prices-head");o.append(j("b",void 0,(0,te.t)("season.packagePrices").replace("{name}",e.name)),j("span",void 0,`${(0,te.t)("season.perSeat")}, ${js(t)}`));let r=Cb.filter(d=>e.prices.some(p=>(p.priceTypeKey??"adult")===d)),s=d=>e.prices.find(p=>(p.priceTypeKey??"adult")===d)?.priceTypeLabel??(d==="adult"?(0,te.t)("season.adult"):d),a=[...n.areas.keys()].filter(d=>e.prices.some(p=>p.categoryKey===d));for(let d of e.prices)a.includes(d.categoryKey)||a.push(d.categoryKey);let l=j("table"),c=j("tr");c.append(j("th",void 0,(0,te.t)("season.area")),...r.map(d=>j("th",void 0,s(d)))),l.append(c);for(let d of a){let p=j("tr");p.append(j("th",void 0,n.areas.get(d)??d));for(let m of r){let u=e.prices.find(f=>f.categoryKey===d&&(f.priceTypeKey??"adult")===m);p.append(j("td",void 0,u?n.money(u.unitPrice):"\u2014"))}l.append(p)}return i.append(o,l),i}function Mb(n,e){let t=j("li","sl-step-date");e.cancelled?t.dataset.state="cancelled":e.past&&(t.dataset.state="past");let i=n.descriptor.timezone,o=j("span","sl-step-day");e.startsAt!=null&&o.append(j("small",void 0,ui(e.startsAt,i,n.locale,{month:"short"}).toUpperCase()),j("b",void 0,ui(e.startsAt,i,n.locale,{day:"numeric"})));let r=j("span","sl-step-date-text");if(r.append(j("b",void 0,e.name)),e.startsAt!=null){let s=ui(e.startsAt,i,n.locale,{weekday:"short",day:"numeric",month:"short"}),a=ui(e.startsAt,i,n.locale,{hour:"2-digit",minute:"2-digit"});r.append(j("span",void 0,`${s} \xB7 ${a}`))}return t.append(o,r),(e.cancelled||e.past)&&t.append(j("span","sl-step-date-tag",e.cancelled?(0,te.t)("season.cancelled"):(0,te.t)("season.past"))),t}function Lh(n){let{descriptor:e}=n,t=j("div","sl-season-step"),i=j("div","sl-step-body"),o=Mh(e),r=o.length,s=j("div","sl-step-intro");s.append(Hh("package")),n.titled||s.append(j("h2","sl-step-title",n.title));let a=o.find(g=>g.startsAt!=null)?.startsAt??null,l=[...o].reverse().find(g=>g.startsAt!=null)?.startsAt??null,c=[Ki(r),e.venue,a!=null&&l!=null?Ph(a,l,e.timezone,n.locale,!0):""].filter(Boolean).join(" \xB7 "),d=j("p","sl-step-facts");d.append(j("span",void 0,c)),n.onSale===!0&&d.append(j("span","sl-step-onsale",(0,te.t)("season.onSale"))),s.append(d),n.onSale===!1&&s.append(j("p","sl-step-facts sl-step-closed",(0,te.t)("season.accessSalesNotOpen")));let p=j("div","sl-step-promise");p.append(j("b",void 0,(0,te.t)("season.whatYouGet")));let m=j("ul");m.append(j("li",void 0,(0,te.t)("season.sameSeat"))),n.emailTickets&&m.append(j("li",void 0,(0,te.t)("season.emailTickets"))),m.append(j("li",void 0,(0,te.t)("season.payOnce"))),p.append(m);let u=j("div","sl-step-cols"),f=j("div","sl-step-col"),b=j("div","sl-step-col");u.append(f,b),i.append(u),f.append(s,p);let T=n.prices?.packages??[],E=T.find(g=>g.planActivationId===n.chosen)??null;if(T.length){let g=j("div","sl-step-packages");g.append(j("b",void 0,(0,te.t)("season.choosePackage")));let O=j("div","sl-step-cards");n.loading&&O.setAttribute("aria-busy","true"),O.append(...T.map(R=>Ab(n,R,R.planActivationId===n.chosen))),g.append(O),f.append(g)}if(E){let g=Pb(n,E,r);n.expanded||(g.dataset.more="true"),b.append(g)}let v=j("ul","sl-step-dates");if((n.expanded?e.occurrences:o.slice(0,3)).forEach((g,O)=>{let R=Mb(n,g);!n.expanded&&O>0&&(R.dataset.more="true"),v.append(R)}),b.append(v),!n.expanded&&e.occurrences.length>1){let g=j("button","sl-step-all");g.type="button";let O=Ki(e.occurrences.length);g.append(j("span","sl-step-wide",(0,te.t)("season.showAllDates").replace("{dates}",O)),j("span","sl-step-narrow",(0,te.t)("season.showAllDatesPrices").replace("{dates}",O))),g.addEventListener("click",()=>n.expand()),b.append(g)}let F=j("div","sl-step-go"),Q=E?Ks(E.prices):null;E&&Q!=null&&F.append(j("span","sl-step-go-price",[(0,te.t)("season.fromPrice").replace("{price}",n.money(Q)),E.name,(0,te.t)("season.perSeat")].join(" \xB7 ")));let N=j("button","sl-step-seats",(0,te.t)("season.chooseSeats"));return N.type="button",N.disabled=n.loading,N.addEventListener("click",()=>n.seats()),F.append(N),t.append(i,F),t}function Hh(n){let e=["package","seats","pay"],t={package:(0,te.t)("season.stepPackage"),seats:(0,te.t)("season.stepSeats"),pay:(0,te.t)("season.stepPay")},i=j("ol","sl-strip-steps");return e.forEach((o,r)=>{let s=r<e.indexOf(n)?"done":o===n?"current":"next",a=j("li");a.dataset.state=s,s==="current"&&a.setAttribute("aria-current","step"),a.append(j("span","sl-strip-n",s==="done"?"\u2713":String(r+1)),document.createTextNode(t[o])),i.append(a)}),i}function Rh(n){let e=j("span","sl-strip-pkg");n.pkg?e.append(j("b",void 0,n.pkg.name),document.createTextNode(` \xB7 ${Ki(n.dates)}`)):e.append(document.createTextNode(Ki(n.dates)));let t=n.pkg?Ks(n.pkg.prices):null;t!=null&&e.append(j("span","sl-strip-price",` \xB7 ${(0,te.t)("season.fromPrice").replace("{price}",n.money(t))} ${(0,te.t)("season.perSeat")}`));let i=j("button","sl-strip-change");return i.type="button",i.append(j("span","sl-step-wide",(0,te.t)("season.changePackage")),j("span","sl-step-narrow",(0,te.t)("season.change"))),i.addEventListener("click",()=>n.change()),[Hh(n.step),e,i]}var Qe=require("@seatlayer/core");function Ih(n,e){for(let[t,i]of Object.entries(e))n.style.setProperty(t,i)}function Oh(n,e,t,i={}){let o=document.createElement("div");Ih(o,i),o.className="sl-season-leave",o.setAttribute("role","dialog"),o.setAttribute("aria-modal","true");let r=document.createElement("div");r.className="sl-season-leave-card";let s=document.createElement("h2");s.id=`sl-season-leave-${Math.random().toString(36).slice(2,10)}`,s.textContent=(0,Qe.t)("season.leaveTitle"),o.setAttribute("aria-labelledby",s.id);let a=document.createElement("p"),l=document.createElement("div");l.className="sl-season-leave-actions";let c=document.createElement("button");c.type="button",c.dataset.leave="release",c.textContent=(0,Qe.t)("season.leaveRelease");let d=document.createElement("button");d.type="button",d.dataset.leave="keep",d.textContent=(0,Qe.t)("season.leaveKeep"),l.append(c,d),r.append(s,a,l),o.append(r);let p=null,m=()=>{p&&clearInterval(p),p=null,o.remove()},u=()=>{let f=Math.max(0,e-Date.now());if(f<=0){m(),t.lapsed();return}let b=Math.ceil(f/1e3),T=`${Math.floor(b/60)}:${String(b%60).padStart(2,"0")}`;a.textContent=(0,Qe.t)("season.leaveBody").replace("{time}",T)};return c.addEventListener("click",()=>{m(),t.release()}),d.addEventListener("click",()=>{m(),t.keep()}),u(),p=setInterval(u,1e3),n.append(o),d.focus({preventScroll:!0}),{remove:m}}function _h(n){let e=o=>{try{return new Intl.ListFormat(void 0,{type:"conjunction"}).format(o)}catch{return o.join(", ")}},t=[],i=new Map;for(let o of n){if(!o.row||!o.seat){t.push({head:[o.label],seats:[]});continue}let r=`${o.section??""}\0${o.row}`,s=i.get(r);s||(s={head:[o.section??"",`${(0,Qe.t)("picker.row")} ${o.row}`].filter(Boolean),seats:[]},i.set(r,s),t.push(s)),s.seats.push(o.seat)}return t.map(({head:o,seats:r})=>[...o,...r.length===1?[`${(0,Qe.t)("picker.seat")} ${r[0]}`]:[],...r.length>1?[`${(0,Qe.t)("season.seats")} ${e(r)}`]:[]].join(", ")).join("; ")}function Nh(n,e,t,i={}){let o=document.createElement("div");Ih(o,i),o.className="sl-season-leave",o.setAttribute("role","dialog"),o.setAttribute("aria-modal","true");let r=document.createElement("div");r.className="sl-season-leave-card";let s=document.createElement("h2");s.id=`sl-season-change-${Math.random().toString(36).slice(2,10)}`,s.textContent=(0,Qe.t)("season.changeTitle"),o.setAttribute("aria-labelledby",s.id);let a=document.createElement("p");a.textContent=(0,Qe.t)("season.changeBody").replace("{seats}",e);let l=document.createElement("div");l.className="sl-season-leave-actions";let c=document.createElement("button");c.type="button",c.dataset.leave="release",c.textContent=(0,Qe.t)("season.changeConfirm");let d=document.createElement("button");d.type="button",d.dataset.leave="keep",d.textContent=(0,Qe.t)("season.changeKeep"),l.append(c,d),r.append(s,a,l),o.append(r);let p=()=>{o.remove()};return c.addEventListener("click",()=>{p(),t.change()}),d.addEventListener("click",()=>{p(),t.keep()}),n.append(o),d.focus({preventScroll:!0}),{remove:p}}var Lb=new Set(["audience_not_public","sales_not_open","origin_not_allowed"]),Hb=3e4;function Rb(n,e){if(!n||typeof n!="object"||Array.isArray(n))return!1;let t=n;return typeof t.token=="string"&&t.token.length>0&&typeof t.expiresAt=="number"&&Number.isFinite(t.expiresAt)&&t.expiresAt>Date.now()&&t.seasonKey===e&&Array.isArray(t.planActivationIds)&&t.planActivationIds.every(i=>typeof i=="string"&&!!i)}var Et,$t,Gi,mi,Gs=class{constructor(e){this.options=e;P(this,Et,null);P(this,$t,null);P(this,Gi);P(this,mi);k(this,Gi,e.fetch??globalThis.fetch.bind(globalThis)),k(this,mi,e.origin??(typeof location>"u"?void 0:location.origin))}get session(){return h(this,Et)}async mint(e=!1){if(e&&k(this,Et,null),h(this,Et)&&h(this,Et).expiresAt-Hb>Date.now())return h(this,Et);if(h(this,$t))return h(this,$t);let t=(async()=>{let i=await h(this,Gi).call(this,`${this.options.base}/pub/seasons/${encodeURIComponent(this.options.season)}/sessions`,{method:"POST",body:JSON.stringify({...h(this,mi)?{origin:h(this,mi)}:{},...this.options.planActivationId?{planActivationId:this.options.planActivationId}:{}}),credentials:"omit"}),o=await i.json().catch(()=>null);if(!i.ok){let r=o?.code??o?.error;if(i.status===403&&r&&Lb.has(r)){let s=r;throw this.options.onRefused?.({reason:s,code:r,status:i.status,retryable:s==="sales_not_open"}),new pi(s,i.status)}throw new Error(`season_public_session_failed_${i.status}`)}if(!Rb(o,this.options.season))throw new Error("season_public_session_invalid");return k(this,Et,o),o})();k(this,$t,t);try{return await t}finally{h(this,$t)===t&&k(this,$t,null)}}async token(e){let t=e==="expiring"||e==="expired"||e==="unauthorized"||e==="manual",i=await this.mint(t);return{token:i.token,expiresAt:i.expiresAt}}};Et=new WeakMap,$t=new WeakMap,Gi=new WeakMap,mi=new WeakMap;function Dh(n){let e=new Gs(n);return{access:new De({provider:({reason:i})=>e.token(i),...n.accessHooks}),loader:e}}var Ib=2500,Us=new Map;function Ob(){return typeof location<"u"&&new URLSearchParams(location.search).has("seatlayer_checkout")}function _b(n,e){let t=null;try{t=new URL(n)}catch{}if(!t||!/^https?:$/.test(t.protocol))return`"${n}" is not an absolute http(s) URL, so checkout ignores it and onOrderConfirmed does not run`;let i=typeof location>"u"?t.origin:location.origin;return t.origin!==i?`is on ${t.origin}, but this tab keeps the order for ${i}: onOrderConfirmed does not run there`:e==="test"?`brings the buyer back only if ${t.origin} is saved under Embed domains; otherwise onOrderConfirmed does not run`:null}function Nb(n){let e=typeof n=="string"?document.querySelector(n):n;if(!e)throw new Error("seatlayer: Season picker container was not found");return e}var I,xn,kn,Re,ae,zt,gi,jt,Sn,Tn,En,Yi,bi,yi,Xi,me,Cn,he,ue,Ct,Kt,Gt,nt,Ut,Me,vi,qt,An,wi,Wt,Yt,Xt,xi,Zi,pt,ki,it,Qi,y,qs,Mr,Ws,yn,Ys,Xs,Bh,Fh,Zs,Si,Vh,Qs,$h,zh,Lr,jh,Hr,Ui,vn,Rr,Kh,Js,fi,Gh,Uh,qh,Wh,ea,Ir,Yh,qi,Xh,Or,ta,ye,Je,Zh,Wi,wn,na=class na{constructor(e){P(this,y);P(this,I);P(this,xn);P(this,kn);P(this,Re);P(this,ae);P(this,zt);P(this,gi,null);P(this,jt,0);P(this,Sn,null);P(this,Tn,"package");P(this,En,null);P(this,Yi,!1);P(this,bi,new Map);P(this,yi,null);P(this,Xi,new AbortController);P(this,me,null);P(this,Cn,null);P(this,he,null);P(this,ue,null);P(this,Ct,null);P(this,Kt,null);P(this,Gt,null);P(this,nt,[]);P(this,Ut,new Map);P(this,Me,!1);P(this,vi,!1);P(this,qt,null);P(this,An,null);P(this,wi,null);P(this,Wt,null);P(this,Yt,"handoff");P(this,Xt,null);P(this,xi,!1);P(this,Zi,!1);P(this,pt,null);P(this,ki,null);P(this,it,null);P(this,Qi,null);P(this,Si,new Set);if(!e?.season)throw new Error("seatlayer: `season` key is required");if(!e.container)throw new Error("seatlayer: `container` is required");if("event"in e||"performanceGroup"in e)throw new Error("seatlayer: SeasonPicker is not SeatPicker or PerformanceGroupPicker");k(this,I,e),k(this,xn,Nb(e.container)),k(this,zt,!e.buyerAccessToken&&!e.buyerAccessTokenProvider),w(this,y,Mr).call(this,null)}async render(){w(this,y,Wi).call(this),yt(),bh(),w(this,y,Fh).call(this),w(this,y,ye).call(this,{kind:"loading",message:"Loading Season seats available for every performance."},!0);try{let e;if(h(this,I).package&&w(this,y,qs).call(this)&&!h(this,it)){if(e=await xh(h(this,I).apiBase??"https://api.seatlayer.io",h(this,I).season,h(this,I).fetch),h(this,Me))return this;let t=e?.packages.find(i=>i.planKey===h(this,I).package);t&&(h(this,Re).destroy(),w(this,y,Mr).call(this,t.planActivationId))}return await w(this,y,Ws).call(this,h(this,jt),e)?(w(this,y,qh).call(this),h(this,it)||h(this,I).initialOperationId||Ob()?await this.chooseSeats():w(this,y,yn).call(this),h(this,Me)?this:(w(this,y,Wh).call(this),w(this,y,Ys).call(this),h(this,I).initialOperationId&&await this.restoreOperation(h(this,I).initialOperationId),this)):this}catch(e){if(h(this,Me))return this;throw w(this,y,Je).call(this,e)}}async choosePackage(e){if(w(this,y,Wi).call(this),(h(this,Sn)??h(this,me)?.planActivationId)===e)return;if(!w(this,y,qs).call(this))throw new q("season_package_fixed",409);if(h(this,he))throw new q("season_hold_open",409);k(this,Sn,e);let t=++pa(this,jt)._;h(this,ue)?.destroy(),k(this,ue,null),k(this,nt,[]),h(this,Ut).clear(),h(this,Re).destroy(),w(this,y,Mr).call(this,e),w(this,y,yn).call(this),w(this,y,ye).call(this,{kind:"loading",message:"Loading Season seats available for every performance."},!0);try{if(!await w(this,y,Ws).call(this,t))return;w(this,y,yn).call(this),w(this,y,Ys).call(this)}catch(i){if(h(this,Me)||t!==h(this,jt))return;throw w(this,y,Je).call(this,i)}}async chooseSeats(){if(w(this,y,Wi).call(this),!(h(this,Tn)==="seats"&&h(this,ue))){if(!h(this,me))throw new Error("seatlayer: render SeasonPicker before using it");k(this,Tn,"seats"),h(this,En)?.remove(),k(this,En,null),await w(this,y,Bh).call(this,h(this,me))}}async holdSameSeat(e,t,i){if(w(this,y,wn).call(this),!t.startsWith("sop_"))throw new Error("seatlayer: caller-stable Season operation id is required");if(!e.length)throw new Error("seatlayer: select at least one seat");if(i)for(let o of e)h(this,ae).types.set(o,i[o]||"adult");if(h(this,ae).typeRefusal=null,h(this,ae).queueOperation(t),h(this,ue).selectObjectsWithoutConfirmation([...e]),w(this,y,ye).call(this,{kind:"pending",message:"Holding the same seats for every performance.",operationId:t},!0),await h(this,ue).handleCta(),!h(this,he))throw h(this,ae).typeRefusal??new q("season_hold_not_created",409);return h(this,he)}async holdBestAvailable(e,t,i={}){if(w(this,y,wn).call(this),!t.startsWith("sop_"))throw new Error("seatlayer: caller-stable Season operation id is required");if(!Number.isInteger(e)||e<1)throw new Error("seatlayer: positive Best Available quantity is required");let o=h(this,ue).maxTickets;if(e>o)throw new Error(`seatlayer: Best Available quantity cannot exceed the configured maximum (${o})`);if(h(this,vi))throw new q("season_best_available_in_progress",409);k(this,vi,!0);let r=null;try{if(r=h(this,ae).queueBestAvailable(t,i),w(this,y,ye).call(this,{kind:"pending",message:`Finding ${e} Season seat${e===1?"":"s"} available for every performance.`,operationId:t},!0),!await h(this,ue).bestAvailableOrThrow(e,i.categoryKey,{zoneId:i.zoneId})||!h(this,he))throw new q("season_hold_not_created",409);return h(this,he)}catch(s){throw w(this,y,Je).call(this,s,t)}finally{r&&h(this,ae).clearBestAvailable(r),k(this,vi,!1)}}async restoreOperation(e){w(this,y,wn).call(this),w(this,y,ye).call(this,{kind:"pending",message:"Restoring your Season selection.",operationId:e},!0);try{let t=await h(this,Re).waitForTerminal(e,void 0,h(this,Xi).signal);return t.state==="aborted"||t.state==="expired"?(k(this,he,null),h(this,I).onHoldChange?.(null),w(this,y,ye).call(this,{kind:"released",message:"The previous Season selection is no longer held.",operationId:e}),null):(h(this,ae).remember(t),w(this,y,Lr).call(this,t,!1))}catch(t){throw w(this,y,Je).call(this,t,e)}}async markBooked(){w(this,y,wn).call(this);let e=h(this,he);if(!e)return!1;try{let{operation:t}=await h(this,Re).operation(e.operationId);return t.state!=="booked"?!1:(h(this,ae).remember(t),w(this,y,Lr).call(this,t,!1),!0)}catch(t){throw w(this,y,Je).call(this,t,e.operationId)}}async release(e){w(this,y,wn).call(this);let t=h(this,he);if(t){if(!e)throw new Error("seatlayer: caller-stable release action id is required");h(this,ae).queueRelease(e),w(this,y,ye).call(this,{kind:"pending",message:"Releasing the Season seats.",operationId:t.operationId},!0);try{h(this,ue)?.getCurrentHold()?.holdId===t.holdId?await h(this,ue).release():(await h(this,ae).release("",[],t.holdId),w(this,y,Hr).call(this)),w(this,y,ye).call(this,{kind:"released",message:"The Season seats were released.",operationId:t.operationId})}catch(i){throw w(this,y,Je).call(this,i,t.operationId)}}}async createRenewalIntent(e){if(w(this,y,wn).call(this),!e.startsWith("sro_"))throw new Error("seatlayer: Season renewal offer id is required");w(this,y,ye).call(this,{kind:"pending",message:"Recording renewal intent. No purchase is made in the browser."},!0);try{let t=await h(this,Re).renewalIntent(e);return w(this,y,ye).call(this,{kind:"renewal_intent",message:"Renewal intent recorded. Your ticketing platform will confirm price, payment, and renewal."}),h(this,I).onRenewalIntent?.(t),t}catch(t){throw w(this,y,Je).call(this,t)}}getDescriptor(){return h(this,me)}getAvailability(){return h(this,Cn)}getHandoff(){return h(this,he)}destroy(){if(h(this,Me))return;k(this,Me,!0),h(this,Xi).abort(),w(this,y,Ir).call(this),h(this,ue)?.destroy(),h(this,Re).destroy(),h(this,xn).replaceChildren(),k(this,Ct,null),k(this,Kt,null),k(this,Gt,null),k(this,me,null),k(this,Cn,null),k(this,he,null),k(this,pt,null);let e=h(this,ki);k(this,ki,null),e?.()}close(){h(this,pt)?h(this,pt).call(this):this.destroy()}static async open(e){yt();let t=Us.get(e.season)??null;Us.delete(e.season);let i=t&&t.expiresAt>Date.now()?t:null,o=!!e.buyerAccessToken||!!e.buyerAccessTokenProvider,r=Jo((0,fe.t)("season.popupLabel"),gt(void 0,e.theme)["--sl-bg"]),s;try{s=new na({...e,...i?.token&&!o?{buyerAccessToken:i.token}:{},container:r.frame})}catch(p){throw r.teardown(!1),p}k(s,it,i),k(s,zt,!o),k(s,ki,()=>r.teardown());let a=!1,l=null,c=()=>{a||(a=!0,l?.remove(),l=null,s.destroy(),e.onClose?.())},d=()=>{var m;if(a||l)return;let p=h(s,he);if(!p||p.expiresAt<=Date.now()){c();return}l=Oh(r.frame,p.expiresAt,{keep:()=>{var u;w(u=s,y,Xs).call(u,p),c()},release:()=>{s.release(`sra_${crypto.randomUUID()}`).catch(u=>e.onError?.(u)).finally(c)},lapsed:()=>{l=null,c()}},w(m=s,y,Or).call(m))};k(s,pt,d),k(s,Qi,p=>{setTimeout(()=>{var m;a||l||(w(m=s,y,Xs).call(m,p),c())},0)}),r.onScrimPress(d),r.trapKeys(p=>{p.preventDefault(),l?(l.remove(),l=null):d()});try{await s.render()}catch(p){throw a=!0,s.destroy(),p}return h(s,Me)||r.focusFirst(),s}};I=new WeakMap,xn=new WeakMap,kn=new WeakMap,Re=new WeakMap,ae=new WeakMap,zt=new WeakMap,gi=new WeakMap,jt=new WeakMap,Sn=new WeakMap,Tn=new WeakMap,En=new WeakMap,Yi=new WeakMap,bi=new WeakMap,yi=new WeakMap,Xi=new WeakMap,me=new WeakMap,Cn=new WeakMap,he=new WeakMap,ue=new WeakMap,Ct=new WeakMap,Kt=new WeakMap,Gt=new WeakMap,nt=new WeakMap,Ut=new WeakMap,Me=new WeakMap,vi=new WeakMap,qt=new WeakMap,An=new WeakMap,wi=new WeakMap,Wt=new WeakMap,Yt=new WeakMap,Xt=new WeakMap,xi=new WeakMap,Zi=new WeakMap,pt=new WeakMap,ki=new WeakMap,it=new WeakMap,Qi=new WeakMap,y=new WeakSet,qs=function(){return h(this,zt)||!!h(this,I).buyerAccessTokenProvider&&!h(this,I).buyerAccessToken},Mr=function(e){let t=h(this,I),i={onExpired:r=>t.onAccessExpired?.(r),onUnavailable:r=>{let s=h(this,An)&&r.reason==="provider_failed"?h(this,An):r;k(this,An,null),k(this,wi,s.reason==="provider_failed"?null:s),t.onAccessUnavailable?.(s),w(this,y,Gh).call(this,s)}},o=t.buyerAccessTokenProvider;if(e&&!h(this,zt)&&o)k(this,qt,null),k(this,kn,new De({provider:r=>o({...r,planActivationId:e}),...i}));else if(h(this,zt)){let{access:r,loader:s}=Dh({base:(t.apiBase??"https://api.seatlayer.io").replace(/\/$/,""),season:t.season,fetch:t.fetch,...e?{planActivationId:e}:{},onRefused:a=>{k(this,An,a)},accessHooks:i});k(this,kn,r),k(this,qt,s)}else k(this,qt,null),k(this,kn,new De({token:t.buyerAccessToken,provider:t.buyerAccessTokenProvider,...i}));k(this,Re,new Er(t.season,{apiBase:t.apiBase,access:h(this,kn),fetch:t.fetch,recoveryTimeoutMs:t.recoveryTimeoutMs})),k(this,ae,new Ar(h(this,Re),Math.max(750,t.realtimePollMs??Ib),r=>w(this,y,Zh).call(this,r),!!t.priceTypes?.some(r=>r!=="adult")))},Ws=async function(e,t){let i=h(this,Re).chart();h(this,ae).primeChart(i),i.then(a=>{h(this,Me)||e!==h(this,jt)||(k(this,bi,new Map((a.categories??[]).map(l=>[l.key,l.label||l.key]))),k(this,yi,a.theme??null),h(this,Tn)==="package"&&w(this,y,yn).call(this))},()=>{});let[o,r,s]=await Promise.all([h(this,Re).descriptor(),h(this,Re).availability(),t!==void 0?Promise.resolve(t):h(this,Re).prices().catch(()=>null)]);return h(this,Me)||e!==h(this,jt)?!1:(k(this,me,o),k(this,Sn,o.planActivationId),k(this,Cn,r),k(this,Wt,s),k(this,Yt,h(this,I).checkout==="hosted"&&o.checkoutMode!=="server"&&s?"hosted":"handoff"),h(this,ae).prime(o,r),!0)},yn=function(){let e=h(this,me);if(!h(this,Kt)||!e||h(this,Me))return;k(this,Tn,"package");let t=h(this,Sn)??e.planActivationId,i=document.createElement("div");i.className="sl-picker sl-step-frame";let o=w(this,y,Or).call(this);for(let[s,a]of Object.entries(o))i.style.setProperty(s,a);let r=h(this,pt);if(r){let s=document.createElement("div");s.className="sl-head";let a=document.createElement("div");a.className="sl-logo",co(a,[h(this,I).theme?.logoUrl,h(this,yi)?.logoUrl,e.orgLogoUrl],"");let l=document.createElement("div");l.className="sl-head-info";let c=document.createElement("div");c.className="sl-head-name",c.textContent=Pr(e),l.append(c);let d=document.createElement("button");d.type="button",d.className="sl-close on",d.setAttribute("aria-label",(0,fe.t)("picker.close")),d.innerHTML='<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>',d.addEventListener("click",()=>r()),s.append(a,l,d),i.append(s)}i.append(Lh({descriptor:e,prices:h(this,Wt),chosen:t,loading:t!==e.planActivationId,expanded:h(this,Yi),areas:h(this,bi),emailTickets:h(this,Yt)==="hosted"||h(this,I).ticketsByEmail===!0,onSale:w(this,y,jh).call(this,e),titled:!!r,title:Pr(e),locale:h(this,I).locale,money:s=>w(this,y,fi).call(this,s),choose:s=>{this.choosePackage(s).catch(a=>w(this,y,Je).call(this,a))},expand:()=>{k(this,Yi,!0),w(this,y,yn).call(this)},seats:()=>{this.chooseSeats().catch(s=>w(this,y,Je).call(this,s))}})),h(this,En)?.remove(),h(this,Kt).append(i),k(this,En,i)},Ys=function(){let e=h(this,Cn)?.freeCount??0;w(this,y,ye).call(this,{kind:"ready",message:`${e} seat${e===1?"":"s"} available for every included performance.`})},Xs=function(e){let t=h(this,qt)?.session,i=h(this,ae).seatsByHold.get(e.holdId),o=h(this,ue)?.getCurrentHold(),r=o?.holdId===e.holdId?[...new Set((o.items??[]).map(a=>a.label))]:[],s=i??r.map(a=>({label:a,priceTypeKey:"adult"}));Us.set(h(this,I).season,{operationId:e.operationId,holdId:e.holdId,expiresAt:e.expiresAt,seats:s,typedSeats:h(this,ae).typesInPlay(s.map(a=>a.label)),token:t?{token:t.token,expiresAt:t.expiresAt}:h(this,it)?.token??null})},Bh=async function(e){h(this,it)&&h(this,ae).prepareResume(h(this,it));let t=new kt(fr({container:h(this,Kt),event:e.key,apiBase:h(this,I).apiBase,transport:h(this,ae),hideEventDetails:!0,...h(this,it)?{initialHoldId:h(this,it).holdId}:{},maxSelection:h(this,I).maxSelection,selectedObjects:h(this,I).selectedObjects,selectableObjects:h(this,I).selectableObjects,numberOfPlacesToSelect:h(this,I).numberOfPlacesToSelect,selectionValidators:h(this,I).selectionValidators,locale:h(this,I).locale,messages:h(this,I).messages,languages:h(this,I).languages,colorblindSafe:h(this,I).colorblindSafe,initialView:h(this,I).initialView,enable3D:h(this,I).enable3D,max3DSeats:h(this,I).max3DSeats,hideBadge:h(this,I).hideBadge,theme:h(this,I).theme,confirmSelection:h(this,I).confirmSelection,seatView:h(this,I).seatView,onBuyerViewChange:h(this,I).onBuyerViewChange,onAnalytics:(i,o)=>{try{h(this,I).onAnalytics?.(i,{...o,metricScope:"season",seasonKey:e.key,planActivationId:e.planActivationId,performanceCount:Tt(e)})}catch{}},onSelectionChange:i=>{k(this,nt,i.map(o=>o.label)),k(this,Ut,new Map(i.filter(o=>!!o.categoryKey).map(o=>[o.label,o.categoryKey]))),h(this,I).onSelectionChange?.(i)},onSelectionValidityChange:h(this,I).onSelectionValidityChange,onHoldChange:i=>{if(!i){w(this,y,Hr).call(this);return}let o=h(this,ae).operationForHold(i.holdId);o&&w(this,y,Lr).call(this,o,!0)},onCheckout:()=>{var i;h(this,he)&&(h(this,I).onContinue?.(h(this,he)),h(this,Yt)==="hosted"?w(this,y,Uh).call(this,h(this,he)):(i=h(this,Qi))==null||i.call(this,h(this,he)))},onHoldExpired:()=>{w(this,y,Hr).call(this),w(this,y,ye).call(this,{kind:"released",message:"The Season hold expired. Choose seats again."}),h(this,I).onHoldExpired?.()},onError:i=>w(this,y,Je).call(this,i)},{surface:"season",performanceCount:Tt(e),selectionMode:"same_seat",suppressPricing:!0,packagePricing:w(this,y,Ui).call(this)?w(this,y,zh).call(this):null,modalClose:h(this,pt),subheader:w(this,y,Yh).call(this),brandLogoUrl:e.orgLogoUrl??null,brandAccent:e.orgAccent??null,nights:()=>w(this,y,Zs).call(this),seatMarks:()=>w(this,y,Vh).call(this),partialWords:{title:(0,fe.t)("season.partlyFreeTitle"),advice:(0,fe.t)("season.partlyFreeAdvice"),legend:(0,fe.t)("season.partlyFreeLegend")},groupSelectionSummary:()=>{let i=h(this,nt).length;return i?{seats:i,performances:Tt(e),performancesChosen:Tt(e),perPerformance:i}:null}}));k(this,ue,t),await t.render()},Fh=function(){h(this,xn).replaceChildren();let e=document.createElement("section");e.className="sl-season-root",e.setAttribute("aria-label","Season ticket selection"),h(this,pt)&&(e.dataset.placement="popup");let t=document.createElement("div");t.className="sl-season-map";let i=document.createElement("p");i.className="sl-season-status",i.setAttribute("role","status"),i.setAttribute("aria-live","polite"),e.append(i,t),h(this,xn).append(e),k(this,Ct,e),k(this,Kt,t),k(this,Gt,i)},Zs=function(){let e=h(this,me);if(!e)return[];let t=e.timezone?{timeZone:e.timezone}:{},i=o=>{if(o==null)return(0,fe.t)("season.dateToBeAnnounced");try{return new Intl.DateTimeFormat(h(this,I).locale,{weekday:"short",day:"numeric",month:"short",...t}).format(new Date(o))}catch{return new Date(o).toDateString()}};return e.occurrences.filter(o=>o.past!==!0&&o.cancelled!==!0).map(o=>({eventKey:o.eventKey,name:o.name,shortDate:i(o.startsAt)}))},Si=new WeakMap,Vh=function(){let e=new Set(w(this,y,Zs).call(this).map(o=>o.eventKey)),t={};for(let o of h(this,Si))t[o]=null;h(this,Si).clear();let i=h(this,ae).latestAvailability?.partial??{};if(e.size)for(let[o,r]of Object.entries(i)){let s=r.filter(a=>e.has(a));!s.length||s.length>=e.size||(t[o]={kind:"partial",fraction:(e.size-s.length)/e.size,data:{blockedEventKeys:s}},h(this,Si).add(o))}return t},Qs=function(e){let t=w(this,y,Ui).call(this)?.prices.find(i=>(i.priceTypeKey||"adult")===e);return x(`season.priceType.${e}`,t?.priceTypeLabel||e.charAt(0).toUpperCase()+e.slice(1))},$h=function(e,t){return(h(this,ue)?.seatPlaces(e)??e.map(o=>({label:o}))).map(o=>{let r=o.row&&o.seat?[o.section,`${x("picker.row","Row")} ${o.row}`,`${x("picker.seat","Seat")} ${o.seat}`].filter(Boolean).join(" \xB7 "):o.label,s=h(this,Ut).get(o.label)??h(this,ue)?.seatCategory(o.label)??null,a=h(this,ae).types.get(o.label),l=s?w(this,y,vn).call(this,s,a):null,c=h(this,ae).typed||!!a&&a!=="adult",d=[s?h(this,bi).get(s)??s:null,c?w(this,y,Qs).call(this,a||"adult"):null].filter(Boolean).join(" \xB7 ");return{label:r,...d?{detail:d}:{},amount:l==null?null:(0,fe.fromMinorUnits)(l,t)}})},zh=function(){let e=h(this,ae).types,t=[...new Set(h(this,I).priceTypes??["adult"])],i=a=>t.filter(l=>w(this,y,vn).call(this,a,l)!=null),o=a=>w(this,y,Qs).call(this,a),r=(a,l)=>{let c=e.get(a);if(c)return c;let d=i(l),p=d.includes("adult")?"adult":d[0];return p&&p!=="adult"&&e.set(a,p),p??"adult"},s=()=>js(h(this,me)?Tt(h(this,me)):0);return{seat:(a,l)=>{let c=r(a,l),d=w(this,y,vn).call(this,l,c),p=h(this,ae).typed?i(l):[];return{amountText:d==null?"":w(this,y,fi).call(this,d),types:p.length>1?{options:p.map(m=>({id:m,name:o(m)})),selected:c}:null}},total:a=>{let l=0;for(let{label:c,categoryKey:d}of a){let p=w(this,y,vn).call(this,d,r(c,d));if(p==null)return null;l+=p}return{amountText:w(this,y,fi).call(this,l),countText:`${(0,fe.tCount)("picker.seatCount",a.length)} \xB7 ${s()}`}},setType:(a,l)=>{t.includes(l)&&e.set(a,l)},seatCardPrice:a=>{let l=i(a),c=w(this,y,vn).call(this,a,l.includes("adult")?"adult":l[0]);return c==null?null:{price:w(this,y,fi).call(this,c),note:s()}}}},Lr=function(e,t){if(e.state==="booked")return k(this,he,null),h(this,ae).forget(e.holdId),h(this,ue)?.notifyGroupSettled("booked"),w(this,y,ye).call(this,{kind:"booked",message:`Your Season booking is complete for all ${Tt(h(this,me))} dates. No further checkout action is needed.`,operationId:e.operationId}),h(this,I).onHoldChange?.(null),null;if(e.state==="partial_terminal")return k(this,he,null),k(this,nt,[]),h(this,ae).forget(e.holdId),h(this,ue)?.notifyGroupSettled("lost"),w(this,y,ye).call(this,{kind:"partial_terminal",message:"This Season selection needs organizer review. Do not try another selection.",operationId:e.operationId}),h(this,I).onHoldChange?.(null),null;if(e.state!=="committed")return k(this,he,null),h(this,ae).forget(e.holdId),h(this,ue)?.notifyGroupSettled("lost"),w(this,y,ye).call(this,{kind:"failed",message:"The Season selection could not be completed.",operationId:e.operationId}),h(this,I).onHoldChange?.(null),null;let i=Sh(h(this,me),e,h(this,ae).seatsByHold.get(e.holdId)),o=h(this,he)?.holdId!==i.holdId;return k(this,he,i),h(this,I).onHoldChange?.(i),w(this,y,ye).call(this,{kind:"held",message:`Your seats are held for all ${Tt(h(this,me))} dates. Review and continue to checkout.`,operationId:e.operationId}),o&&t&&h(this,I).onHold?.(i),i},jh=function(e){return e.salesState?e.salesState==="open":h(this,qt)?.session?!0:null},Hr=function(){k(this,he,null),k(this,nt,[]),h(this,I).onHoldChange?.(null)},Ui=function(){let e=h(this,me)?.planActivationId;return h(this,Wt)?.packages.find(t=>t.planActivationId===e)??null},vn=function(e,t="adult"){let i=w(this,y,Ui).call(this)?.prices.find(o=>o.categoryKey===e&&(o.priceTypeKey||"adult")===t);return i?i.unitPrice:null},Rr=function(){return h(this,he)?.seats?.map(e=>e.label)??h(this,nt)},Kh=function(){let e=w(this,y,Rr).call(this);if(!e.length||!w(this,y,Ui).call(this))return null;let t=0;for(let i of e){let o=h(this,Ut).get(i)??h(this,ue)?.seatCategory(i),r=o?w(this,y,vn).call(this,o,h(this,ae).types.get(i)):null;if(r==null)return null;t+=r}return t},Js=function(){return h(this,Wt)?.currency??h(this,me)?.currency??"USD"},fi=function(e,t=w(this,y,Js).call(this)){let i=(0,fe.fromMinorUnits)(e,t),o=Number.isInteger(i);return(0,fe.formatMoney)(i,t,{locale:h(this,I).locale,fallback:(r,s)=>`${r} ${s}`,...o?{minimumFractionDigits:0,maximumFractionDigits:0}:{}})},Gh=function(e){let t=e.reason==="audience_not_public"?(0,fe.t)("season.accessNotPublic"):e.reason==="sales_not_open"?(0,fe.t)("season.accessSalesNotOpen"):e.reason==="origin_not_allowed"?(0,fe.t)("season.accessOriginNotAllowed"):(0,fe.t)("season.accessUnavailable");w(this,y,ye).call(this,{kind:"failed",message:t})},Uh=async function(e){if(!h(this,xi)){k(this,xi,!0);try{let t=w(this,y,Js).call(this),i=w(this,y,Kh).call(this);if(i==null){w(this,y,ye).call(this,{kind:"failed",message:(0,fe.t)("season.checkoutNotPriced"),operationId:e.operationId});return}await w(this,y,ea).call(this,{kind:"pay",provider:null,order:{holdId:e.operationId,expiresAt:e.expiresAt,currency:t,total:(0,fe.fromMinorUnits)(i,t),labels:w(this,y,Rr).call(this),lines:w(this,y,$h).call(this,w(this,y,Rr).call(this),t)}})}finally{k(this,xi,!1)}}},qh=function(){let e=h(this,I).returnUrl;if(h(this,Zi)||!e||!h(this,me))return;k(this,Zi,!0);let t=h(this,Yt)==="hosted"?_b(e,h(this,me).mode):"is not used: this picker takes no payment and hands the held seats to onContinue";t&&console.warn(`seatlayer: SeasonPicker returnUrl ${t}.`)},Wh=function(){if(h(this,Yt)!=="hosted")return;let e=ii(h(this,I).season);e?.outcome!=="success"||!e.orderId||w(this,y,ea).call(this,{kind:"resume",orderId:e.orderId})},ea=async function(e){let t;try{({mountCheckout:t}=await _n())}catch(a){h(this,I).onError?.(a),w(this,y,ye).call(this,{kind:"failed",message:(0,fe.t)("season.checkoutCouldNotBeOpened")});return}let i=h(this,ue)?.root;if(h(this,Me)||!i)return;w(this,y,Ir).call(this);let o=h(this,me)?.buyer,r=h(this,I).buyerEmail||o?.email||void 0,s=h(this,I).buyerName||o?.name||void 0;k(this,Xt,t({root:i,state:e,eventKey:h(this,I).season,formatMoney:(a,l)=>(0,fe.formatMoney)(a,l,{locale:h(this,I).locale,fallback:(c,d)=>`${c} ${d}`,...Number.isInteger(a)?{minimumFractionDigits:0,maximumFractionDigits:0}:{}}),startSession:a=>h(this,Re).checkout({operationId:a.holdId,buyerEmail:a.buyerEmail,...a.buyerName?{buyerName:a.buyerName}:{},...h(this,I).returnUrl?{returnUrl:h(this,I).returnUrl}:{}}),orderStatus:a=>h(this,Re).orderStatus(a),...r||s?{buyer:{email:r,name:s}}:{},onCancel:()=>{k(this,Xt,null),w(this,y,qi).call(this)},onConfirmed:a=>{h(this,I).onOrderConfirmed?.(a),w(this,y,ye).call(this,{kind:"booked",message:(0,fe.t)("season.orderConfirmed")})},onError:a=>h(this,I).onError?.(a)})),w(this,y,qi).call(this)},Ir=function(){h(this,Xt)?.destroy(),k(this,Xt,null),w(this,y,qi).call(this)},Yh=function(){let e=document.createElement("div");return e.className="sl-season-strip",k(this,gi,e),w(this,y,qi).call(this),e},qi=function(){let e=h(this,gi),t=h(this,me);!e||!t||e.replaceChildren(...Rh({step:h(this,Xt)?"pay":"seats",pkg:h(this,Wt)?.packages.find(i=>i.planActivationId===t.planActivationId)??null,dates:Tt(t),money:i=>w(this,y,fi).call(this,i),change:()=>w(this,y,Xh).call(this)}))},Xh=function(){let e=h(this,he);if(!e){w(this,y,ta).call(this);return}if(!h(this,Ct))return;let t=e.seats?.map(o=>o.label)??h(this,nt),i=h(this,ue)?.seatPlaces(t)??t.map(o=>({label:o}));Nh(h(this,Ct),_h(i),{keep:()=>{},change:()=>{this.release(`sra_${crypto.randomUUID()}`).then(()=>w(this,y,ta).call(this),o=>w(this,y,Je).call(this,o))}},w(this,y,Or).call(this))},Or=function(){return gt(h(this,yi)??void 0,h(this,I).theme,void 0,h(this,me)?.orgAccent)},ta=function(){h(this,Me)||(w(this,y,Ir).call(this),h(this,ue)?.destroy(),k(this,ue,null),k(this,gi,null),k(this,nt,[]),h(this,Ut).clear(),w(this,y,yn).call(this))},ye=function(e,t=!1){h(this,Gt)&&(h(this,Gt).textContent=e.message,h(this,Gt).dataset.kind=e.kind),h(this,Ct)&&(h(this,Ct).dataset.busy=String(t)),h(this,I).onStatusChange?.(e)},Je=function(e,t){if(h(this,Me)||e instanceof q&&e.code==="season_api_destroyed")return e;let i=e instanceof we&&e.reason==="provider_failed"&&h(this,wi)?new we(h(this,wi)):e;return i instanceof we?(h(this,I).onError?.(i),i):(w(this,y,ye).call(this,{kind:"failed",message:Cr(i),operationId:t}),h(this,I).onError?.(i),i)},Zh=function(e){h(this,Me)||(e instanceof we||w(this,y,ye).call(this,{kind:"failed",message:(0,fe.t)("season.sessionEnded")}),h(this,I).onError?.(e))},Wi=function(){if(h(this,Me))throw new Error("seatlayer: SeasonPicker was destroyed")},wn=function(){if(w(this,y,Wi).call(this),!h(this,me)||!h(this,ue))throw new Error("seatlayer: render SeasonPicker before using it")};var _r=na;function Qh(n,e={}){let t=e.origin??"";if(!t)try{t=new URL(n.src,window.location.href).origin}catch{t=""}let i=!1,o=null,r=null,s=null,a="",l=null,c="",d=()=>{if(i)return;i=!0,o=n.getAttribute("style"),Object.assign(n.style,{position:"fixed",inset:"0",margin:"0",border:"0",zIndex:"2147483000",background:c||"transparent"}),n.style.width="100vw",n.style.height="100vh",n.style.width="100dvw",n.style.height="100dvh";let u=document.documentElement;r=u.style.overflow,u.style.overflow="hidden",document.body&&(s=document.body.style.overflow,document.body.style.overflow="hidden"),l=f=>{f.key==="Escape"&&p()},window.addEventListener("keydown",l)},p=()=>{i&&(i=!1,o===null?n.removeAttribute("style"):n.setAttribute("style",o),o=null,a&&(n.style.height=a),r!==null&&(document.documentElement.style.overflow=r,r=null),s!==null&&document.body&&(document.body.style.overflow=s,s=null),l&&(window.removeEventListener("keydown",l),l=null))},m=u=>{if(u.source!==n.contentWindow||t&&u.origin!==t||!u.data||typeof u.data!="object")return;let f=u.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"&&(typeof f.background=="string"&&/^[#a-zA-Z0-9(),.%\s-]{1,64}$/.test(f.background)&&(c=f.background,i&&(n.style.background=c)),f.on===!0?d():f.on===!1&&p())};return window.addEventListener("message",m),()=>{window.removeEventListener("message",m),p()}}0&&(module.exports={ApiError,BuyerAccessContext,BuyerAccessUnavailableError,BuyerRealtimeClient,EmbeddedDesigner,PerformanceGroupDestroyedError,PerformanceGroupPicker,SEATING_CHART_CALLBACK_PROPS,SEATING_CHART_HANDLE_METHODS,SEATING_CHART_IDENTITY_PROPS,SEATING_CHART_VALUE_PROPS,SeasonApiError,SeasonPicker,SeasonPublicSessionRefused,SeasonRecoveryTimeoutError,SeatPicker,SeatingChart,attachPickerFrame,bindSeatingChartHandle,buildSeatingChartOptions,createBuyerAccessContext,createControllerSink,parseTicketOfferAvailability,prewarmSeatPicker,shortOperationReference,ticketOfferPrices});