@seatlayer/js 0.80.2 → 0.80.3

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.js CHANGED
@@ -1,4 +1,4 @@
1
- import{a as Fn,b as Vn,d as Bt,e as qe,f as Nt,g as Ue}from"./chunk-TNTHWQQ2.js";import{a as f,b as O,c as T,d as E}from"./chunk-OSZ7DOEH.js";import{PickerController as Ul,formatMoney as Kl,getLocale as Wi,loadLocale as Wl,localeDirection as Yl,LOCALE_NAMES as Xl,resolveLocale as Ql,setStringOverrides as Zl,t as le}from"@seatlayer/core";var Oe="seatlayer.v1";function Da(i){let e=typeof i.default=="string"?i.default:"free",t={};if(i.seats&&typeof i.seats=="object")for(let[n,r]of Object.entries(i.seats))typeof r=="string"&&r!==e&&(t[n]=r);return{default:e,exceptions:t}}function Ba(i,e){if(!i||i.default!==e.default)return null;let t=[];for(let[n,r]of Object.entries(e.exceptions))i.exceptions[n]!==r&&t.push({label:n,status:r});for(let n of Object.keys(i.exceptions))n in e.exceptions||t.push({label:n,status:e.default});return t}function Na(i,e){for(let t of e)t.status===i.default?delete i.exceptions[t.label]:i.exceptions[t.label]=t.status}function $n(i){if(/(?:^|[?&#])(?:token|access_token|bearer|authorization|ticket|tkt|bse)=/i.test(i))throw new Error("seatlayer: refusing to open a socket with a credential in the URL");if(/\bbse_[A-Za-z0-9._-]+/.test(i))throw new Error("seatlayer: refusing to open a socket with a credential in the URL")}var ve=class{constructor(e){this.ws=null;this.stopped=!0;this.attempt=0;this.reconnectTimer=null;this.pingTimer=null;this.pongTimer=null;this.resumeTimer=null;this.projection=null;this.version=null;this.v1=!1;this.useQueryMarker=!1;this.hidden=null;this.closedSections=null;this.opts=e,$n(e.url)}get protocol(){return this.ws?this.v1?"v1":"legacy":null}get snapshotVersion(){return this.version}start(){this.stopped&&(this.stopped=!1,this.connect())}stop(){this.stopped=!0,this.clearTimers();let e=this.ws;if(this.ws=null,e){e.onopen=null,e.onmessage=null,e.onclose=null,e.onerror=null;try{e.close()}catch{}}}restart(){this.stop(),this.projection=null,this.version=null,this.attempt=0,this.start()}async connect(){if(this.stopped)return;let e=[Oe];if(this.opts.mintTicket){let s;try{s=await this.opts.mintTicket()}catch(o){this.reportIfAccessError(o),this.scheduleReconnect();return}if(this.stopped)return;s?.protocols?.length?(e=[...s.protocols],e.includes(Oe)||e.unshift(Oe)):s?.ticket&&(e=[Oe,`tkt.${s.ticket}`])}let t=this.version!==null;t&&e.push(`sv.${this.version}`);let n=this.useQueryMarker?`${this.opts.url}${this.opts.url.includes("?")?"&":"?"}pv=1`:this.opts.url;$n(n);let r;try{r=(this.opts.socketFactory??((o,a)=>new WebSocket(o,a)))(n,e)}catch{this.scheduleReconnect();return}this.ws=r,r.onopen=()=>{this.ws===r&&(this.attempt=0,this.v1=r.protocol===Oe,this.v1||(this.useQueryMarker=!0),this.startKeepalive(r),t?this.resumeTimer=setTimeout(()=>{this.resumeTimer=null,this.opts.sink.resync()},5e3):this.resumeTimer=setTimeout(()=>{this.resumeTimer=null,this.opts.sink.resync({reason:"connect"})},5e3))},r.onmessage=s=>{if(this.ws!==r)return;let o;try{o=JSON.parse(typeof s.data=="string"?s.data:"")}catch{return}!o||typeof o!="object"||this.handleFrame(o)},r.onclose=s=>{if(this.ws===r){if(this.ws=null,this.clearTimers(),s?.code===4401){if(s.reason==="access_expired"){this.scheduleReconnect();return}this.stopped=!0,this.opts.onAccessUnavailable?.({reason:"revoked",code:"access_revoked",retryable:!1});return}this.scheduleReconnect()}},r.onerror=()=>{try{r.close()}catch{}}}handleFrame(e){let t=typeof e.type=="string"?e.type:"";if(e.protocol===1&&(this.v1=!0),typeof e.snapshotVersion=="number"&&(this.version=e.snapshotVersion),t==="pong"){this.clearPongTimer();return}if(Array.isArray(e.hidden)||Array.isArray(e.closed)){let n=Array.isArray(e.hidden)?e.hidden:[],r=Array.isArray(e.closed)?e.closed:[],s=n.join("\0"),o=r.join("\0");(s!==this.hidden||o!==this.closedSections)&&(this.hidden=s,this.closedSections=o,this.opts.sink.onSections?.(n,r,{withInventory:t==="snapshot"||!!e.seats}))}if(t!=="hidden"){if(t==="presence"){this.opts.sink.onPresence?.({shoppingSessions:Number(e.shoppingSessions)||0,activeHolds:Number(e.activeHolds)||0});return}if(t!=="allocation"){if(t==="snapshot"||!t&&e.seats){this.answered();let n=Da(e),r=Ba(this.projection,n);this.projection=n,r===null?this.opts.sink.applyProjection?this.opts.sink.applyProjection(n):this.opts.sink.resync():r.length&&this.opts.sink.applyStatuses(r);return}if(t==="delta"&&Array.isArray(e.changes)){this.answered();let n=e.changes.filter(r=>typeof r?.label=="string"&&typeof r?.status=="string").map(r=>({label:r.label,status:r.status}));if(!n.length)return;this.projection&&Na(this.projection,n),this.opts.sink.applyStatuses(n)}}}}answered(){this.resumeTimer&&(clearTimeout(this.resumeTimer),this.resumeTimer=null)}reportIfAccessError(e){let t=e?.reason;e?.name==="BuyerAccessUnavailableError"&&(this.stopped=!0,this.opts.onAccessUnavailable?.({reason:t??"invalid",code:e.code,status:e.status,retryable:t==="paused"}))}startKeepalive(e){this.pingTimer=setInterval(()=>{if(this.ws===e){try{e.send(JSON.stringify({type:"ping"}))}catch{return}this.clearPongTimer(),this.pongTimer=setTimeout(()=>{this.pongTimer=null;try{e.close()}catch{}},1e4)}},25e3)}scheduleReconnect(){if(this.stopped||this.reconnectTimer)return;let e=Math.min(this.attempt++,5),t=Math.min(1e3*2**e,15e3),n=Math.random()*t;this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},n)}clearPongTimer(){this.pongTimer&&(clearTimeout(this.pongTimer),this.pongTimer=null)}clearTimers(){this.pingTimer&&clearInterval(this.pingTimer),this.pingTimer=null,this.clearPongTimer(),this.reconnectTimer&&clearTimeout(this.reconnectTimer),this.reconnectTimer=null,this.resumeTimer&&clearTimeout(this.resumeTimer),this.resumeTimer=null}};function Fa(i){return i==="blocked"?"not_for_sale":i==="held"||i==="booked"||i==="free"||i==="not_for_sale"?i:"free"}function mt(i,e={}){let t=n=>{let r=i.tableSelection(n);if(r)return r.physicalSeatIds;let s=i.idForLabel(n);return s?[s]:[]};return{applyStatuses(n){let r=new Set([...i.currentHold()?.labels??[],...e.ownLabels?.()??[]]),s={free:[],held:[],booked:[],not_for_sale:[]},o=[],a=[],l=new Map(i.getSelection().map(c=>[c.label,c.id]));for(let c of n){let p=t(c.label);if(!p.length)continue;let d=Fa(c.status);if(s[d].push(...p),e.flashOnLiveChange&&d!=="free"&&!r.has(c.label)&&p.some(u=>i.getStatus(u)==="free")){let u=d==="held"?"#f4b740":"#f43f5e";for(let h of p)o.push({id:h,color:u})}d!=="free"&&!r.has(c.label)&&l.has(c.label)&&a.push(c.label)}for(let c of["free","held","booked","not_for_sale"])s[c].length&&i.setStatus(s[c],c);for(let c of o)i.flashSeat(c.id,c.color);if(a.length){let c=a.flatMap(d=>t(d));c.length&&i.deselect(c);let p=n.some(d=>d.status==="blocked"&&a.includes(d.label));e.onSelectedObjectUnavailable?.(a,p?"ineligible":"taken")}e.onStatusChange?.()},...i.applyProjection?{applyProjection:n=>{i.applyProjection(n)}}:{},async resync(n){await(i.resync?i.resync(n):i.refresh())},onSections(n,r,s){s?.withInventory||(i.resync?i.resync({reason:"frame"}):i.refresh()),e.onSections?.(n,r,s)}}}var V=class extends Error{constructor(e,t,n,r,s,o){super(t),this.name="ApiError",this.status=e,this.code=n,this.conflicts=r,this.reason=s,this.retryAfterS=o}},zn=10,jn=1;function Ft(i,e){let t=(i??"").trim();if(t){let n=Number(t);if(Number.isFinite(n)&&n>=0)return Math.ceil(n);let r=Date.parse(t);if(Number.isFinite(r))return Math.max(0,Math.ceil((r-Date.now())/1e3))}if(typeof e=="number"&&Number.isFinite(e)&&e>=0)return Math.ceil(e)}var Va={seat_conflict:"taken",conflict:"taken",channel_assignment_conflict:"ineligible",allocation_exhausted:"exhausted"},Ae=class{constructor(e,t={}){this.base=e;this.viewerId=typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`viewer_${Math.random().toString(36).slice(2)}${Date.now().toString(36)}`;this.access=t.access,this.onObjectUnavailable=t.onObjectUnavailable;let n=t.referral?.trim();this.referral=n?n.slice(0,120):void 0}get accessScoped(){return!!this.access?.configured}async request(e,t={},n={}){let r=t.method??"GET",s={},o;t.body!==void 0&&(s["Content-Type"]="application/json",o=JSON.stringify(t.body));let a=await this.access?.authorization(n.auth?"unauthorized":"initial");a&&(s.Authorization=a);let l=await fetch(`${this.base}${e}`,{method:r,headers:s,body:o,credentials:"omit"}),p=(l.headers.get("content-type")??"").includes("application/json")?await l.json().catch(()=>null):null;if(!l.ok){let d=p,u=d?.code??d?.error;if(this.access?.configured&&(l.status===401||l.status===403||l.status===422)&&await this.access.handleFailure(l.status,u)&&!n.auth)return this.request(e,t,{...n,auth:!0});if(l.status===409){let g=u?Va[u]:void 0,b=d?.conflicts?.map(w=>w.label)??t.labels??[];g&&this.onObjectUnavailable?.({labels:b,reason:g,code:u})}let h;if(l.status===429&&(h=Ft(l.headers.get("Retry-After"),d?.retryAfterSeconds)??jn,r==="GET"&&!n.rateLimit&&h<=zn))return await new Promise(g=>setTimeout(g,h*1e3)),this.request(e,t,{...n,rateLimit:!0});throw new V(l.status,d?.error??`request_failed_${l.status}`,u,d?.conflicts,d?.reason,h)}return p}async requestBlob(e,t={}){let n={},r=await this.access?.authorization(t.auth?"unauthorized":"initial");r&&(n.Authorization=r);let s=await fetch(`${this.base}${e}`,{method:"GET",headers:n,credentials:"omit"});if(s.ok)return s.blob();let a=(s.headers.get("content-type")??"").includes("application/json")?await s.json().catch(()=>null):null,l=a?.code??a?.error;if(this.access?.configured&&(s.status===401||s.status===403||s.status===422)&&await this.access.handleFailure(s.status,l)&&!t.auth)return this.requestBlob(e,{...t,auth:!0});let c;if(s.status===429&&(c=Ft(s.headers.get("Retry-After"),a?.retryAfterSeconds)??jn,!t.rateLimit&&c<=zn))return await new Promise(p=>setTimeout(p,c*1e3)),this.requestBlob(e,{...t,rateLimit:!0});throw new V(s.status,a?.error??`request_failed_${s.status}`,l,void 0,void 0,c)}chart(e){return this.request(`/pub/events/${encodeURIComponent(e)}/chart`)}eventConfiguration(e){return this.request(`/pub/events/${encodeURIComponent(e)}/event-configuration`)}reportViewEvidence(e,t){return this.request(`/pub/events/${encodeURIComponent(e)}/view-evidence-reports`,{method:"POST",body:{seatId:t.seatId,...t.evidenceId?{evidenceId:t.evidenceId}:{},...t.message?{message:t.message}:{}}})}asset(e,t){return/^[a-zA-Z0-9._-]+$/.test(t)?this.requestBlob(`/pub/events/${encodeURIComponent(e)}/assets/${encodeURIComponent(t)}`):Promise.reject(new V(404,"not_found","not_found"))}objects(e){return this.request(`/pub/events/${encodeURIComponent(e)}/objects?compact=1`)}hold(e,t,n,r){return this.request(`/pub/events/${encodeURIComponent(e)}/hold`,{method:"POST",body:{selections:t,...n?{ttlMs:n}:{},...r?{replaceHoldId:r}:{},...this.referral?{referral:this.referral}:{}},labels:t.map(s=>s.label)})}bestAvailable(e,t,n,r,s){return this.request(`/pub/events/${encodeURIComponent(e)}/best-available`,{method:"POST",body:{qty:t,...n?{categoryKey:n}:{},...r?{zoneId:r}:{},...s?{ttlMs:s}:{},...this.referral?{referral:this.referral}:{}}})}resume(e,t){return this.request(`/pub/events/${encodeURIComponent(e)}/hold/resume`,{method:"POST",body:{holdId:t}})}release(e,t,n){return this.request(`/pub/events/${encodeURIComponent(e)}/release`,{method:"POST",body:{labels:t,holdId:n}})}extend(e,t,n){return this.request(`/pub/events/${encodeURIComponent(e)}/extend`,{method:"POST",body:{holdId:t,...n?{ttlMs:n}:{}}})}paymentOptions(e){return this.request(`/pub/events/${encodeURIComponent(e)}/payment-options`)}availability(e,t=!1){return this.request(`/pub/events/${encodeURIComponent(e)}/availability${t?"?live=1":""}`)}startCheckout(e,t){return this.request(`/pub/events/${encodeURIComponent(e)}/checkout`,{method:"POST",body:t})}orderStatus(e){return this.request(`/pub/orders/${encodeURIComponent(e)}/status`)}subscribeTicket(e){return this.request(`/pub/events/${encodeURIComponent(e)}/subscribe-tickets`,{method:"POST",body:{}})}subscribeUrl(e){let t=this.base.replace(/^http/,"ws"),n=new URLSearchParams({surface:"picker",viewerId:this.viewerId});return`${t}/pub/events/${encodeURIComponent(e)}/subscribe?${n}`}socketUrl(e){return this.accessScoped?"":this.subscribeUrl(e)}socketProtocols(e){return this.accessScoped?[]:[Oe]}createRealtime(e,t){return this.accessScoped?null:new ve({url:this.subscribeUrl(e),sink:t})}};import{getLocale as qa,loadLocale as Ua,LOCALE_NAMES as Ka,localeDirection as Un,resolveLocale as Kn,setStringOverrides as Wa,TRANSLATED_LOCALES as Ya}from"@seatlayer/core";import{getLocale as $a,localeDirection as za,t as ja}from"@seatlayer/core";function Ga(){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 Gn(i,e,t){let n=document.createElement("div");n.className="sl-picker",n.tabIndex=-1,n.lang=$a(),n.dir=za(),i.appendChild(n),Object.entries(Ue(void 0,t)).forEach(([s,o])=>n.style.setProperty(s,o)),n.innerHTML=`
1
+ import{a as Fn,b as Vn,d as Bt,e as qe,f as Nt,g as Ue}from"./chunk-TNTHWQQ2.js";import{a as f,b as O,c as T,d as E}from"./chunk-OSZ7DOEH.js";import{PickerController as Yl,formatMoney as Xl,getLocale as Wi,loadLocale as Ql,localeDirection as Zl,LOCALE_NAMES as Jl,resolveLocale as ec,setStringOverrides as tc,t as le}from"@seatlayer/core";var Oe="seatlayer.v1";function Fa(i){let e=typeof i.default=="string"?i.default:"free",t={};if(i.seats&&typeof i.seats=="object")for(let[n,r]of Object.entries(i.seats))typeof r=="string"&&r!==e&&(t[n]=r);return{default:e,exceptions:t}}function Va(i,e){if(!i||i.default!==e.default)return null;let t=[];for(let[n,r]of Object.entries(e.exceptions))i.exceptions[n]!==r&&t.push({label:n,status:r});for(let n of Object.keys(i.exceptions))n in e.exceptions||t.push({label:n,status:e.default});return t}function $a(i,e){for(let t of e)t.status===i.default?delete i.exceptions[t.label]:i.exceptions[t.label]=t.status}function $n(i){if(/(?:^|[?&#])(?:token|access_token|bearer|authorization|ticket|tkt|bse)=/i.test(i))throw new Error("seatlayer: refusing to open a socket with a credential in the URL");if(/\bbse_[A-Za-z0-9._-]+/.test(i))throw new Error("seatlayer: refusing to open a socket with a credential in the URL")}var ve=class{constructor(e){this.ws=null;this.stopped=!0;this.attempt=0;this.reconnectTimer=null;this.pingTimer=null;this.pongTimer=null;this.resumeTimer=null;this.projection=null;this.version=null;this.v1=!1;this.useQueryMarker=!1;this.hidden=null;this.closedSections=null;this.opts=e,$n(e.url)}get protocol(){return this.ws?this.v1?"v1":"legacy":null}get snapshotVersion(){return this.version}start(){this.stopped&&(this.stopped=!1,this.connect())}stop(){this.stopped=!0,this.clearTimers();let e=this.ws;if(this.ws=null,e){e.onopen=null,e.onmessage=null,e.onclose=null,e.onerror=null;try{e.close()}catch{}}}restart(){this.stop(),this.projection=null,this.version=null,this.attempt=0,this.start()}async connect(){if(this.stopped)return;let e=[Oe];if(this.opts.mintTicket){let s;try{s=await this.opts.mintTicket()}catch(o){this.reportIfAccessError(o),this.scheduleReconnect();return}if(this.stopped)return;s?.protocols?.length?(e=[...s.protocols],e.includes(Oe)||e.unshift(Oe)):s?.ticket&&(e=[Oe,`tkt.${s.ticket}`])}let t=this.version!==null;t&&e.push(`sv.${this.version}`);let n=this.useQueryMarker?`${this.opts.url}${this.opts.url.includes("?")?"&":"?"}pv=1`:this.opts.url;$n(n);let r;try{r=(this.opts.socketFactory??((o,a)=>new WebSocket(o,a)))(n,e)}catch{this.scheduleReconnect();return}this.ws=r,r.onopen=()=>{this.ws===r&&(this.attempt=0,this.v1=r.protocol===Oe,this.v1||(this.useQueryMarker=!0),this.startKeepalive(r),t?this.resumeTimer=setTimeout(()=>{this.resumeTimer=null,this.opts.sink.resync()},5e3):this.resumeTimer=setTimeout(()=>{this.resumeTimer=null,this.opts.sink.resync({reason:"connect"})},5e3))},r.onmessage=s=>{if(this.ws!==r)return;let o;try{o=JSON.parse(typeof s.data=="string"?s.data:"")}catch{return}!o||typeof o!="object"||this.handleFrame(o)},r.onclose=s=>{if(this.ws===r){if(this.ws=null,this.clearTimers(),s?.code===4401){if(s.reason==="access_expired"){this.scheduleReconnect();return}this.stopped=!0,this.opts.onAccessUnavailable?.({reason:"revoked",code:"access_revoked",retryable:!1});return}this.scheduleReconnect()}},r.onerror=()=>{try{r.close()}catch{}}}handleFrame(e){let t=typeof e.type=="string"?e.type:"";if(e.protocol===1&&(this.v1=!0),typeof e.snapshotVersion=="number"&&(this.version=e.snapshotVersion),t==="pong"){this.clearPongTimer();return}if(Array.isArray(e.hidden)||Array.isArray(e.closed)){let n=Array.isArray(e.hidden)?e.hidden:[],r=Array.isArray(e.closed)?e.closed:[],s=n.join("\0"),o=r.join("\0");(s!==this.hidden||o!==this.closedSections)&&(this.hidden=s,this.closedSections=o,this.opts.sink.onSections?.(n,r,{withInventory:t==="snapshot"||!!e.seats}))}if(t!=="hidden"){if(t==="presence"){this.opts.sink.onPresence?.({shoppingSessions:Number(e.shoppingSessions)||0,activeHolds:Number(e.activeHolds)||0});return}if(t!=="allocation"){if(t==="snapshot"||!t&&e.seats){this.answered();let n=Fa(e),r=Va(this.projection,n);this.projection=n,r===null?this.opts.sink.applyProjection?this.opts.sink.applyProjection(n):this.opts.sink.resync():r.length&&this.opts.sink.applyStatuses(r);return}if(t==="delta"&&Array.isArray(e.changes)){this.answered();let n=e.changes.filter(r=>typeof r?.label=="string"&&typeof r?.status=="string").map(r=>({label:r.label,status:r.status}));if(!n.length)return;this.projection&&$a(this.projection,n),this.opts.sink.applyStatuses(n)}}}}answered(){this.resumeTimer&&(clearTimeout(this.resumeTimer),this.resumeTimer=null)}reportIfAccessError(e){let t=e?.reason;e?.name==="BuyerAccessUnavailableError"&&(this.stopped=!0,this.opts.onAccessUnavailable?.({reason:t??"invalid",code:e.code,status:e.status,retryable:t==="paused"}))}startKeepalive(e){this.pingTimer=setInterval(()=>{if(this.ws===e){try{e.send(JSON.stringify({type:"ping"}))}catch{return}this.clearPongTimer(),this.pongTimer=setTimeout(()=>{this.pongTimer=null;try{e.close()}catch{}},1e4)}},25e3)}scheduleReconnect(){if(this.stopped||this.reconnectTimer)return;let e=Math.min(this.attempt++,5),t=Math.min(1e3*2**e,15e3),n=Math.random()*t;this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},n)}clearPongTimer(){this.pongTimer&&(clearTimeout(this.pongTimer),this.pongTimer=null)}clearTimers(){this.pingTimer&&clearInterval(this.pingTimer),this.pingTimer=null,this.clearPongTimer(),this.reconnectTimer&&clearTimeout(this.reconnectTimer),this.reconnectTimer=null,this.resumeTimer&&clearTimeout(this.resumeTimer),this.resumeTimer=null}};function za(i){return i==="blocked"?"not_for_sale":i==="held"||i==="booked"||i==="free"||i==="not_for_sale"?i:"free"}function mt(i,e={}){let t=n=>{let r=i.tableSelection(n);if(r)return r.physicalSeatIds;let s=i.idForLabel(n);return s?[s]:[]};return{applyStatuses(n){let r=new Set([...i.currentHold()?.labels??[],...e.ownLabels?.()??[]]),s={free:[],held:[],booked:[],not_for_sale:[]},o=[],a=[],l=new Map(i.getSelection().map(c=>[c.label,c.id]));for(let c of n){let p=t(c.label);if(!p.length)continue;let d=za(c.status);if(s[d].push(...p),e.flashOnLiveChange&&d!=="free"&&!r.has(c.label)&&p.some(u=>i.getStatus(u)==="free")){let u=d==="held"?"#f4b740":"#f43f5e";for(let h of p)o.push({id:h,color:u})}d!=="free"&&!r.has(c.label)&&l.has(c.label)&&a.push(c.label)}for(let c of["free","held","booked","not_for_sale"])s[c].length&&i.setStatus(s[c],c);for(let c of o)i.flashSeat(c.id,c.color);if(a.length){let c=a.flatMap(d=>t(d));c.length&&i.deselect(c);let p=n.some(d=>d.status==="blocked"&&a.includes(d.label));e.onSelectedObjectUnavailable?.(a,p?"ineligible":"taken")}e.onStatusChange?.()},...i.applyProjection?{applyProjection:n=>{i.applyProjection(n)}}:{},async resync(n){await(i.resync?i.resync(n):i.refresh())},onSections(n,r,s){s?.withInventory||(i.resync?i.resync({reason:"frame"}):i.refresh()),e.onSections?.(n,r,s)}}}var V=class extends Error{constructor(e,t,n,r,s,o){super(t),this.name="ApiError",this.status=e,this.code=n,this.conflicts=r,this.reason=s,this.retryAfterS=o}},zn=10,jn=1;function Ft(i,e){let t=(i??"").trim();if(t){let n=Number(t);if(Number.isFinite(n)&&n>=0)return Math.ceil(n);let r=Date.parse(t);if(Number.isFinite(r))return Math.max(0,Math.ceil((r-Date.now())/1e3))}if(typeof e=="number"&&Number.isFinite(e)&&e>=0)return Math.ceil(e)}var ja={seat_conflict:"taken",conflict:"taken",channel_assignment_conflict:"ineligible",allocation_exhausted:"exhausted"},Ae=class{constructor(e,t={}){this.base=e;this.viewerId=typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`viewer_${Math.random().toString(36).slice(2)}${Date.now().toString(36)}`;this.access=t.access,this.onObjectUnavailable=t.onObjectUnavailable;let n=t.referral?.trim();this.referral=n?n.slice(0,120):void 0}get accessScoped(){return!!this.access?.configured}async request(e,t={},n={}){let r=t.method??"GET",s={},o;t.body!==void 0&&(s["Content-Type"]="application/json",o=JSON.stringify(t.body));let a=await this.access?.authorization(n.auth?"unauthorized":"initial");a&&(s.Authorization=a);let l=await fetch(`${this.base}${e}`,{method:r,headers:s,body:o,credentials:"omit"}),p=(l.headers.get("content-type")??"").includes("application/json")?await l.json().catch(()=>null):null;if(!l.ok){let d=p,u=d?.code??d?.error;if(this.access?.configured&&(l.status===401||l.status===403||l.status===422)&&await this.access.handleFailure(l.status,u)&&!n.auth)return this.request(e,t,{...n,auth:!0});if(l.status===409){let g=u?ja[u]:void 0,b=d?.conflicts?.map(w=>w.label)??t.labels??[];g&&this.onObjectUnavailable?.({labels:b,reason:g,code:u})}let h;if(l.status===429&&(h=Ft(l.headers.get("Retry-After"),d?.retryAfterSeconds)??jn,r==="GET"&&!n.rateLimit&&h<=zn))return await new Promise(g=>setTimeout(g,h*1e3)),this.request(e,t,{...n,rateLimit:!0});throw new V(l.status,d?.error??`request_failed_${l.status}`,u,d?.conflicts,d?.reason,h)}return p}async requestBlob(e,t={}){let n={},r=await this.access?.authorization(t.auth?"unauthorized":"initial");r&&(n.Authorization=r);let s=await fetch(`${this.base}${e}`,{method:"GET",headers:n,credentials:"omit"});if(s.ok)return s.blob();let a=(s.headers.get("content-type")??"").includes("application/json")?await s.json().catch(()=>null):null,l=a?.code??a?.error;if(this.access?.configured&&(s.status===401||s.status===403||s.status===422)&&await this.access.handleFailure(s.status,l)&&!t.auth)return this.requestBlob(e,{...t,auth:!0});let c;if(s.status===429&&(c=Ft(s.headers.get("Retry-After"),a?.retryAfterSeconds)??jn,!t.rateLimit&&c<=zn))return await new Promise(p=>setTimeout(p,c*1e3)),this.requestBlob(e,{...t,rateLimit:!0});throw new V(s.status,a?.error??`request_failed_${s.status}`,l,void 0,void 0,c)}chart(e){return this.request(`/pub/events/${encodeURIComponent(e)}/chart`)}eventConfiguration(e){return this.request(`/pub/events/${encodeURIComponent(e)}/event-configuration`)}reportViewEvidence(e,t){return this.request(`/pub/events/${encodeURIComponent(e)}/view-evidence-reports`,{method:"POST",body:{seatId:t.seatId,...t.evidenceId?{evidenceId:t.evidenceId}:{},...t.message?{message:t.message}:{}}})}asset(e,t){return/^[a-zA-Z0-9._-]+$/.test(t)?this.requestBlob(`/pub/events/${encodeURIComponent(e)}/assets/${encodeURIComponent(t)}`):Promise.reject(new V(404,"not_found","not_found"))}objects(e){return this.request(`/pub/events/${encodeURIComponent(e)}/objects?compact=1`)}hold(e,t,n,r){return this.request(`/pub/events/${encodeURIComponent(e)}/hold`,{method:"POST",body:{selections:t,...n?{ttlMs:n}:{},...r?{replaceHoldId:r}:{},...this.referral?{referral:this.referral}:{}},labels:t.map(s=>s.label)})}bestAvailable(e,t,n,r,s){return this.request(`/pub/events/${encodeURIComponent(e)}/best-available`,{method:"POST",body:{qty:t,...n?{categoryKey:n}:{},...r?{zoneId:r}:{},...s?{ttlMs:s}:{},...this.referral?{referral:this.referral}:{}}})}resume(e,t){return this.request(`/pub/events/${encodeURIComponent(e)}/hold/resume`,{method:"POST",body:{holdId:t}})}release(e,t,n){return this.request(`/pub/events/${encodeURIComponent(e)}/release`,{method:"POST",body:{labels:t,holdId:n}})}extend(e,t,n){return this.request(`/pub/events/${encodeURIComponent(e)}/extend`,{method:"POST",body:{holdId:t,...n?{ttlMs:n}:{}}})}paymentOptions(e){return this.request(`/pub/events/${encodeURIComponent(e)}/payment-options`)}availability(e,t=!1){return this.request(`/pub/events/${encodeURIComponent(e)}/availability${t?"?live=1":""}`)}startCheckout(e,t){return this.request(`/pub/events/${encodeURIComponent(e)}/checkout`,{method:"POST",body:t})}orderStatus(e){return this.request(`/pub/orders/${encodeURIComponent(e)}/status`)}subscribeTicket(e){return this.request(`/pub/events/${encodeURIComponent(e)}/subscribe-tickets`,{method:"POST",body:{}})}subscribeUrl(e){let t=this.base.replace(/^http/,"ws"),n=new URLSearchParams({surface:"picker",viewerId:this.viewerId});return`${t}/pub/events/${encodeURIComponent(e)}/subscribe?${n}`}socketUrl(e){return this.accessScoped?"":this.subscribeUrl(e)}socketProtocols(e){return this.accessScoped?[]:[Oe]}createRealtime(e,t){return this.accessScoped?null:new ve({url:this.subscribeUrl(e),sink:t})}};import{getLocale as Wa,loadLocale as Ya,LOCALE_NAMES as Xa,localeDirection as Un,resolveLocale as Kn,setStringOverrides as Qa,TRANSLATED_LOCALES as Za}from"@seatlayer/core";import{getLocale as Ga,localeDirection as qa,t as Ua}from"@seatlayer/core";function Ka(){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 Gn(i,e,t){let n=document.createElement("div");n.className="sl-picker",n.tabIndex=-1,n.lang=Ga(),n.dir=qa(),i.appendChild(n),Object.entries(Ue(void 0,t)).forEach(([s,o])=>n.style.setProperty(s,o)),n.innerHTML=`
2
2
  <div class="sl-head">
3
3
  <div class="sl-logo" data-ref="logo"></div>
4
4
  <div class="sl-head-info" data-ref="headInfo">
@@ -30,7 +30,7 @@ import{a as Fn,b as Vn,d as Bt,e as qe,f as Nt,g as Ue}from"./chunk-TNTHWQQ2.js"
30
30
  </div>
31
31
  <div class="sl-boot" data-ref="boot">
32
32
  <div class="sl-boot-bar" aria-hidden="true"></div>
33
- ${Ga()}
33
+ ${Ka()}
34
34
  <span class="sl-boot-say" role="status" aria-live="polite" data-sl-t="picker.loadingSeatMap">${e("picker.loadingSeatMap","Loading seat map\u2026")}</span>
35
35
  </div>
36
36
  <div class="sl-toast" data-ref="toast" role="status" aria-live="polite"></div>
@@ -61,7 +61,7 @@ import{a as Fn,b as Vn,d as Bt,e as qe,f as Nt,g as Ue}from"./chunk-TNTHWQQ2.js"
61
61
  <button type="button" class="sl-cta" data-ref="cta" disabled></button>
62
62
  </div>
63
63
  </div>
64
- </div>`;let r={};return n.querySelectorAll("[data-ref]").forEach(s=>{r[s.dataset.ref]=s}),{root:n,mapHost:r.map,els:r}}function qn(i){let e=(t,n)=>{for(let r of i.querySelectorAll(`[${t}]`)){let s=r.getAttribute(t);if(!s)continue;let o=ja(s);o!==s&&n(r,o)}};e("data-sl-t",(t,n)=>{t.textContent=n}),e("data-sl-a",(t,n)=>{t.setAttribute("aria-label",n)}),e("data-sl-ti",(t,n)=>{t.setAttribute("title",n)})}function Vt(i,e){let t=Kn(i),n=Ya.includes(t)?t:"en";return e&&Wa(e),{locale:n,direction:Un(n),ready:Ua(i)}}function $t(i,e,t){i.lang=e.locale,i.dir=e.direction,e.ready.then(t)}function Wn(i,e){if(!i)return null;let t=(e.languages??[]).map(r=>Kn(r)).filter((r,s,o)=>o.indexOf(r)===s);if(t.length<2)return null;let n=document.createElement("select");n.className="sl-langsel",n.setAttribute("aria-label",e.label);for(let r of t){let s=document.createElement("option");s.value=r,s.textContent=Ka[r]??r,s.selected=r===qa(),n.appendChild(s)}return n.addEventListener("change",()=>e.onChange(n.value)),i.appendChild(n),n}function Yn(i,e){e.root.lang=i,e.root.dir=Un(i),qn(e.root);for(let n of e.painters)try{n()}catch{}e.refreshMapCopy();let t=e.languageSelect;t&&t.value!==i&&(t.value=i)}var ae=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}},Xa=new Set(["buyer_access_expired"]),Qa=new Set(["paused","provider_failed","channel_denied"]);function Za(i,e){switch(e){case"buyer_access_invalid":return"invalid";case"buyer_access_revoked":return"revoked";case"buyer_access_origin_mismatch":return"origin_mismatch";case"buyer_access_event_mismatch":return"event_mismatch";case"buyer_access_group_mismatch":return"group_mismatch";case"buyer_access_mode_mismatch":return"mode_mismatch";case"buyer_access_environment_mismatch":return"environment_mismatch";case"channel_access_denied":return"channel_denied";case"channel_paused":return"paused";case"invalid_channel_scope":return"invalid_scope";default:break}return i===401?"invalid":null}function Ja(i,e){return i===401&&!!e&&Xa.has(e)}var el=3e4,Q,Z,We,Ye,ft,Pe,ye,Xe,gt,bt,vt,Ie,J,Di,zt,Ke,de=class{constructor(e){O(this,J);O(this,Q,null);O(this,Z,0);O(this,We,null);O(this,Ye);O(this,ft);O(this,Pe,null);O(this,ye,null);O(this,Xe,null);O(this,gt);O(this,bt);O(this,vt,!1);O(this,Ie);if(T(this,Ye,e.provider),T(this,ft,e.skewMs??el),T(this,gt,e.onExpired),T(this,bt,e.onUnavailable),e.token){let t=typeof e.token=="string"?{token:e.token}:e.token;E(this,J,Di).call(this,t)}T(this,vt,!!f(this,Ye)||!!f(this,Q))}get configured(){return f(this,vt)}onRenewed(e){T(this,Ie,e)}get unavailable(){return f(this,ye)}get hasToken(){return!!f(this,Q)&&(f(this,Z)===0||f(this,Z)>Date.now())}get expiresAt(){return f(this,Z)}async authorization(e="initial"){if(!this.configured)return null;if(f(this,ye))throw new ae(f(this,ye));let t=Date.now();if(!f(this,Q)||f(this,Z)>0&&f(this,Z)-f(this,ft)<=t){let r=!!f(this,Q)&&f(this,Z)>0&&f(this,Z)<=t,s=f(this,Q)?r?"expired":"expiring":e,o=await E(this,J,zt).call(this,s);if(!o)throw new ae(f(this,ye)??f(this,Xe)??E(this,J,Ke).call(this,"provider_failed"));return`Bearer ${o}`}return`Bearer ${f(this,Q)}`}async handleFailure(e,t){var r;if(!this.configured)return!1;if(Ja(e,t)){T(this,Q,null),T(this,Z,0);let s=await E(this,J,zt).call(this,"unauthorized",t);return(r=f(this,gt))==null||r.call(this,{reason:"unauthorized",code:t,refreshed:!!s}),!!s}let n=Za(e,t);return n&&E(this,J,Ke).call(this,n,t,e),!1}async refresh(e="manual"){return T(this,ye,null),T(this,Xe,null),T(this,Q,null),T(this,Z,0),!!await E(this,J,zt).call(this,e)}clear(){T(this,Q,null),T(this,We,null),T(this,Z,0),T(this,Pe,null),T(this,Ie,void 0)}toJSON(){return{configured:this.configured,hasToken:this.hasToken}}toString(){return"[BuyerAccessContext redacted]"}};Q=new WeakMap,Z=new WeakMap,We=new WeakMap,Ye=new WeakMap,ft=new WeakMap,Pe=new WeakMap,ye=new WeakMap,Xe=new WeakMap,gt=new WeakMap,bt=new WeakMap,vt=new WeakMap,Ie=new WeakMap,J=new WeakSet,Di=function(e){return!e||typeof e.token!="string"||!e.token?null:(T(this,We,e.token),T(this,Q,e.token),T(this,Z,typeof e.expiresAt=="number"?e.expiresAt:0),f(this,Q))},zt=function(e,t){if(f(this,Pe))return f(this,Pe);let n=f(this,Ye);if(!n)return E(this,J,Ke).call(this,"no_token",t),Promise.resolve(null);let r=f(this,We),s=(async()=>{try{let o=await n({reason:e}),a=E(this,J,Di).call(this,o);if(!a)return E(this,J,Ke).call(this,"provider_failed",t),null;if(r&&r!==a&&f(this,Ie))try{await f(this,Ie).call(this,{previousToken:r,token:a,reason:e})}catch{}return a}catch{return E(this,J,Ke).call(this,"provider_failed",t),null}finally{T(this,Pe,null)}})();return T(this,Pe,s),s},Ke=function(e,t,n){var s;let r={reason:e,code:t,status:n,retryable:e==="paused"||e==="channel_denied"};return T(this,Xe,r),Qa.has(e)||(T(this,ye,r),T(this,Q,null),T(this,Z,0)),(s=f(this,bt))==null||s.call(this,r),r};function yt(i,e={}){return!i.buyerAccessTokenProvider&&!i.buyerAccessToken?null:new de({provider:i.buyerAccessTokenProvider,token:i.buyerAccessToken,...e})}var tl=3e4;function il(i){if(!i||typeof i!="object"||Array.isArray(i))return!1;let e=i;return typeof e.token=="string"&&e.token.startsWith("bse_")&&typeof e.expiresAt=="number"&&Number.isFinite(e.expiresAt)&&e.expiresAt>Date.now()&&!!e.event&&typeof e.event=="object"&&!!e.doc&&typeof e.doc=="object"&&!!e.objects&&typeof e.objects=="object"&&!Array.isArray(e.objects)&&!!e.objects.seats&&typeof e.objects.seats=="object"}var Bi=class{constructor(e,t,n){this.base=e;this.event=t;this.publicKey=n;this.value=null;this.inflight=null}async load(e=!1){if(e&&(this.value=null),this.value&&this.value.expiresAt-tl>Date.now())return this.value;if(this.inflight)return this.inflight;let t=(async()=>{let n=await fetch(`${this.base}/pub/events/${encodeURIComponent(this.event)}/bootstrap`,{method:"POST",body:JSON.stringify({publicKey:this.publicKey}),credentials:"omit"}),r=await n.json().catch(()=>null);if(!n.ok){let s=n.status===429?Ft(n.headers.get("Retry-After"),r?.retryAfterSeconds):void 0;throw new V(n.status,r?.error??`request_failed_${n.status}`,r?.code??r?.error,void 0,void 0,s)}if(!il(r))throw new V(502,"invalid_bootstrap_response","invalid_bootstrap_response");return this.value=r,r})();this.inflight=t;try{return await t}finally{this.inflight===t&&(this.inflight=null)}}async token(e){let t=e==="expiring"||e==="expired"||e==="unauthorized"||e==="manual",n=await this.load(t);return{token:n.token,expiresAt:n.expiresAt}}},Ni=class extends Ae{constructor(t,n,r,s,o){super(t,{...o,access:s});this.event=n;this.loader=r;this.bootstrapAccess=s;this.initialChartDelivered=!1;this.initialObjectsDelivered=!1}assertEvent(t){if(t!==this.event)throw new V(404,"not_found","not_found")}async bundle(t){return this.assertEvent(t),await this.bootstrapAccess.authorization("initial"),this.loader.load()}async chart(t){if(this.assertEvent(t),this.initialChartDelivered)return super.chart(t);let n=await this.bundle(t);return this.initialChartDelivered=!0,{event:n.event,doc:n.doc,chartDelivery:n.chartDelivery}}async objects(t){if(this.assertEvent(t),this.initialObjectsDelivered)return super.objects(t);let n=await this.bundle(t);return this.initialObjectsDelivered=!0,n.objects}};function jt(i){let e=new Bi(i.base,i.event,i.publicKey),t=new de({provider:({reason:n})=>e.token(n),...i.accessHooks});return{access:t,api:new Ni(i.base,i.event,e,t,i.apiOptions??{})}}import{t as we,tCount as _e}from"@seatlayer/core";var q={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 nl=`.sl-picker,.sl-modal-scrim,.sl-mo-host{--sl-dur-enter:${q.enter}ms;--sl-dur-exit:${q.exit}ms;--sl-dur-spring:${q.spring}ms;--sl-dur-flight:${q.flight}ms;--sl-dur-stagger:${q.stagger}ms;--sl-dur-xfade:${q.crossfade}ms;--sl-dur-collapse:${q.collapse}ms;--sl-dur-rung:${q.rung}ms;--sl-ease-enter:${q.easeEnter};--sl-ease-exit:${q.easeExit};--sl-ease-spring:${q.easeSpring};--sl-mo-ox:50%;--sl-mo-oy:50%}`,rl=`@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:${q.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:${q.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}}`,Xn=nl+`
64
+ </div>`;let r={};return n.querySelectorAll("[data-ref]").forEach(s=>{r[s.dataset.ref]=s}),{root:n,mapHost:r.map,els:r}}function qn(i){let e=(t,n)=>{for(let r of i.querySelectorAll(`[${t}]`)){let s=r.getAttribute(t);if(!s)continue;let o=Ua(s);o!==s&&n(r,o)}};e("data-sl-t",(t,n)=>{t.textContent=n}),e("data-sl-a",(t,n)=>{t.setAttribute("aria-label",n)}),e("data-sl-ti",(t,n)=>{t.setAttribute("title",n)})}function Vt(i,e){let t=Kn(i),n=Za.includes(t)?t:"en";return e&&Qa(e),{locale:n,direction:Un(n),ready:Ya(i)}}function $t(i,e,t){i.lang=e.locale,i.dir=e.direction,e.ready.then(t)}function Wn(i,e){if(!i)return null;let t=(e.languages??[]).map(r=>Kn(r)).filter((r,s,o)=>o.indexOf(r)===s);if(t.length<2)return null;let n=document.createElement("select");n.className="sl-langsel",n.setAttribute("aria-label",e.label);for(let r of t){let s=document.createElement("option");s.value=r,s.textContent=Xa[r]??r,s.selected=r===Wa(),n.appendChild(s)}return n.addEventListener("change",()=>e.onChange(n.value)),i.appendChild(n),n}function Yn(i,e){e.root.lang=i,e.root.dir=Un(i),qn(e.root);for(let n of e.painters)try{n()}catch{}e.refreshMapCopy();let t=e.languageSelect;t&&t.value!==i&&(t.value=i)}var ae=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}},Ja=new Set(["buyer_access_expired"]),el=new Set(["paused","provider_failed","channel_denied"]);function tl(i,e){switch(e){case"buyer_access_invalid":return"invalid";case"buyer_access_revoked":return"revoked";case"buyer_access_origin_mismatch":return"origin_mismatch";case"buyer_access_event_mismatch":return"event_mismatch";case"buyer_access_group_mismatch":return"group_mismatch";case"buyer_access_mode_mismatch":return"mode_mismatch";case"buyer_access_environment_mismatch":return"environment_mismatch";case"channel_access_denied":return"channel_denied";case"channel_paused":return"paused";case"invalid_channel_scope":return"invalid_scope";default:break}return i===401?"invalid":null}function il(i,e){return i===401&&!!e&&Ja.has(e)}var nl=3e4,Q,Z,We,Ye,ft,Pe,ye,Xe,gt,bt,vt,Ie,J,Di,zt,Ke,de=class{constructor(e){O(this,J);O(this,Q,null);O(this,Z,0);O(this,We,null);O(this,Ye);O(this,ft);O(this,Pe,null);O(this,ye,null);O(this,Xe,null);O(this,gt);O(this,bt);O(this,vt,!1);O(this,Ie);if(T(this,Ye,e.provider),T(this,ft,e.skewMs??nl),T(this,gt,e.onExpired),T(this,bt,e.onUnavailable),e.token){let t=typeof e.token=="string"?{token:e.token}:e.token;E(this,J,Di).call(this,t)}T(this,vt,!!f(this,Ye)||!!f(this,Q))}get configured(){return f(this,vt)}onRenewed(e){T(this,Ie,e)}get unavailable(){return f(this,ye)}get hasToken(){return!!f(this,Q)&&(f(this,Z)===0||f(this,Z)>Date.now())}get expiresAt(){return f(this,Z)}async authorization(e="initial"){if(!this.configured)return null;if(f(this,ye))throw new ae(f(this,ye));let t=Date.now();if(!f(this,Q)||f(this,Z)>0&&f(this,Z)-f(this,ft)<=t){let r=!!f(this,Q)&&f(this,Z)>0&&f(this,Z)<=t,s=f(this,Q)?r?"expired":"expiring":e,o=await E(this,J,zt).call(this,s);if(!o)throw new ae(f(this,ye)??f(this,Xe)??E(this,J,Ke).call(this,"provider_failed"));return`Bearer ${o}`}return`Bearer ${f(this,Q)}`}async handleFailure(e,t){var r;if(!this.configured)return!1;if(il(e,t)){T(this,Q,null),T(this,Z,0);let s=await E(this,J,zt).call(this,"unauthorized",t);return(r=f(this,gt))==null||r.call(this,{reason:"unauthorized",code:t,refreshed:!!s}),!!s}let n=tl(e,t);return n&&E(this,J,Ke).call(this,n,t,e),!1}async refresh(e="manual"){return T(this,ye,null),T(this,Xe,null),T(this,Q,null),T(this,Z,0),!!await E(this,J,zt).call(this,e)}clear(){T(this,Q,null),T(this,We,null),T(this,Z,0),T(this,Pe,null),T(this,Ie,void 0)}toJSON(){return{configured:this.configured,hasToken:this.hasToken}}toString(){return"[BuyerAccessContext redacted]"}};Q=new WeakMap,Z=new WeakMap,We=new WeakMap,Ye=new WeakMap,ft=new WeakMap,Pe=new WeakMap,ye=new WeakMap,Xe=new WeakMap,gt=new WeakMap,bt=new WeakMap,vt=new WeakMap,Ie=new WeakMap,J=new WeakSet,Di=function(e){return!e||typeof e.token!="string"||!e.token?null:(T(this,We,e.token),T(this,Q,e.token),T(this,Z,typeof e.expiresAt=="number"?e.expiresAt:0),f(this,Q))},zt=function(e,t){if(f(this,Pe))return f(this,Pe);let n=f(this,Ye);if(!n)return E(this,J,Ke).call(this,"no_token",t),Promise.resolve(null);let r=f(this,We),s=(async()=>{try{let o=await n({reason:e}),a=E(this,J,Di).call(this,o);if(!a)return E(this,J,Ke).call(this,"provider_failed",t),null;if(r&&r!==a&&f(this,Ie))try{await f(this,Ie).call(this,{previousToken:r,token:a,reason:e})}catch{}return a}catch{return E(this,J,Ke).call(this,"provider_failed",t),null}finally{T(this,Pe,null)}})();return T(this,Pe,s),s},Ke=function(e,t,n){var s;let r={reason:e,code:t,status:n,retryable:e==="paused"||e==="channel_denied"};return T(this,Xe,r),el.has(e)||(T(this,ye,r),T(this,Q,null),T(this,Z,0)),(s=f(this,bt))==null||s.call(this,r),r};function yt(i,e={}){return!i.buyerAccessTokenProvider&&!i.buyerAccessToken?null:new de({provider:i.buyerAccessTokenProvider,token:i.buyerAccessToken,...e})}var rl=3e4;function sl(i){if(!i||typeof i!="object"||Array.isArray(i))return!1;let e=i;return typeof e.token=="string"&&e.token.startsWith("bse_")&&typeof e.expiresAt=="number"&&Number.isFinite(e.expiresAt)&&e.expiresAt>Date.now()&&!!e.event&&typeof e.event=="object"&&!!e.doc&&typeof e.doc=="object"&&!!e.objects&&typeof e.objects=="object"&&!Array.isArray(e.objects)&&!!e.objects.seats&&typeof e.objects.seats=="object"}var Bi=class{constructor(e,t,n){this.base=e;this.event=t;this.publicKey=n;this.value=null;this.inflight=null}async load(e=!1){if(e&&(this.value=null),this.value&&this.value.expiresAt-rl>Date.now())return this.value;if(this.inflight)return this.inflight;let t=(async()=>{let n=await fetch(`${this.base}/pub/events/${encodeURIComponent(this.event)}/bootstrap`,{method:"POST",body:JSON.stringify({publicKey:this.publicKey}),credentials:"omit"}),r=await n.json().catch(()=>null);if(!n.ok){let s=n.status===429?Ft(n.headers.get("Retry-After"),r?.retryAfterSeconds):void 0;throw new V(n.status,r?.error??`request_failed_${n.status}`,r?.code??r?.error,void 0,void 0,s)}if(!sl(r))throw new V(502,"invalid_bootstrap_response","invalid_bootstrap_response");return this.value=r,r})();this.inflight=t;try{return await t}finally{this.inflight===t&&(this.inflight=null)}}async token(e){let t=e==="expiring"||e==="expired"||e==="unauthorized"||e==="manual",n=await this.load(t);return{token:n.token,expiresAt:n.expiresAt}}},Ni=class extends Ae{constructor(t,n,r,s,o){super(t,{...o,access:s});this.event=n;this.loader=r;this.bootstrapAccess=s;this.initialChartDelivered=!1;this.initialObjectsDelivered=!1}assertEvent(t){if(t!==this.event)throw new V(404,"not_found","not_found")}async bundle(t){return this.assertEvent(t),await this.bootstrapAccess.authorization("initial"),this.loader.load()}async chart(t){if(this.assertEvent(t),this.initialChartDelivered)return super.chart(t);let n=await this.bundle(t);return this.initialChartDelivered=!0,{event:n.event,doc:n.doc,chartDelivery:n.chartDelivery}}async objects(t){if(this.assertEvent(t),this.initialObjectsDelivered)return super.objects(t);let n=await this.bundle(t);return this.initialObjectsDelivered=!0,n.objects}};function jt(i){let e=new Bi(i.base,i.event,i.publicKey),t=new de({provider:({reason:n})=>e.token(n),...i.accessHooks});return{access:t,api:new Ni(i.base,i.event,e,t,i.apiOptions??{})}}import{t as we,tCount as _e}from"@seatlayer/core";var U={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 ol=`.sl-picker,.sl-modal-scrim,.sl-mo-host{--sl-dur-enter:${U.enter}ms;--sl-dur-exit:${U.exit}ms;--sl-dur-spring:${U.spring}ms;--sl-dur-flight:${U.flight}ms;--sl-dur-stagger:${U.stagger}ms;--sl-dur-xfade:${U.crossfade}ms;--sl-dur-collapse:${U.collapse}ms;--sl-dur-rung:${U.rung}ms;--sl-ease-enter:${U.easeEnter};--sl-ease-exit:${U.easeExit};--sl-ease-spring:${U.easeSpring};--sl-mo-ox:50%;--sl-mo-oy:50%}`,al=`@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:${U.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:${U.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}}`,Xn=ol+`
65
65
  /* Anchored open/close. The translate is 8px TOWARD the anchor, which is what
66
66
  makes the card look attached to the seat rather than dropped on the map. */
67
67
  .sl-mo-in{transform-origin:var(--sl-mo-ox) var(--sl-mo-oy);
@@ -128,7 +128,7 @@ import{a as Fn,b as Vn,d as Bt,e as qe,f as Nt,g as Ue}from"./chunk-TNTHWQQ2.js"
128
128
  @keyframes slMoZoom{from{opacity:0;transform:scale(1.02)}to{opacity:1;transform:none}}
129
129
  .sl-mo-rotate-in{animation:slMoSpin var(--sl-dur-spring) var(--sl-ease-spring) 1 both}
130
130
  @keyframes slMoSpin{from{opacity:0;transform:rotate(-140deg) scale(.8)}to{opacity:1;transform:none}}
131
- `+rl;function Gt(){try{return window.matchMedia?.("(prefers-reduced-motion: reduce)").matches===!0}catch{return!1}}function Fi(i,e){if(!e){i.style.removeProperty("--sl-mo-ox"),i.style.removeProperty("--sl-mo-oy");return}qt(i,e,i.getBoundingClientRect())}function qt(i,e,t){let n=t.width||1,r=t.height||1,s=o=>Math.max(0,Math.min(100,o));i.style.setProperty("--sl-mo-ox",`${s((e.x-t.left)/n*100).toFixed(1)}%`),i.style.setProperty("--sl-mo-oy",`${s((e.y-t.top)/r*100).toFixed(1)}%`)}function Qn(i,e,t){let n=i.getBoundingClientRect(),r=t.getBoundingClientRect();qt(i,e,{left:n.left-r.left,top:n.top-r.top,width:n.width,height:n.height})}function Ut(i,e){i.classList.remove("sl-mo-out"),e!==void 0&&Fi(i,e),i.classList.remove("sl-mo-in"),i.offsetWidth,i.classList.add("sl-mo-in")}function Zn(i){i.classList.add("sl-mo-stagger");let e=0;for(let t of Array.from(i.children))t.style.setProperty("--sl-mo-i",String(e)),e+=1}function Qe(i,e,t={className:"sl-mo-out",duration:q.exit}){let n=()=>{r||(r=!0,!(typeof window>"u")&&(clearTimeout(s),i.removeEventListener("animationend",n),e?e():i.remove()))},r=!1;i.classList.remove("sl-mo-in","sl-mo-slide-up","sl-mo-spring","sl-mo-zoom","sl-mo-rise"),i.classList.add(t.className),i.addEventListener("animationend",n);let s=setTimeout(n,Gt()?0:t.duration+60)}var Zp={className:"sl-mo-slide-down",duration:q.exit};function Jn(i){if(Gt())return i.onArrive?.(),null;let e=document.createElement("div");e.className="sl-mo-fly sl-mo-host",e.setAttribute("aria-hidden","true"),e.textContent=i.label??"",e.style.left=`${i.from.x}px`,e.style.top=`${i.from.y}px`,e.style.background=i.color??"var(--sl-accent,#6e7bff)",e.style.color=i.ink??"#fff",e.style.setProperty("--sl-fly-dx",`${Math.round(i.to.x-i.from.x)}px`),e.style.setProperty("--sl-fly-dy",`${Math.round(i.to.y-i.from.y)}px`),document.body.appendChild(e);let t=!1,n=()=>{t||(t=!0,window.clearTimeout(r),e.remove(),i.onArrive?.())};e.addEventListener("animationend",n);let r=window.setTimeout(n,q.flight+80);return e}var $=i=>String(i??"").replace(/[&<>"']/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[e]);function Ze(i,e){let t=0;for(let n of i.get(e)?.values()??[])t+=n;return t}function er(i){let e=[];for(let[t,n]of i)for(let[r,s]of n)s>0&&e.push({areaId:t,tierId:r,qty:s});return e}function tr(i){let e=new Map;for(let t of i.keys())e.set(t,Ze(i,t));return e}function wt(i,e,t,n){let r=i.get(e)??new Map;n>0?r.set(t,n):r.delete(t),r.size?i.set(e,r):i.delete(e)}function ir(i){let e=new Map;for(let t of i)t.objectType!=="ga"||!t.objectId||e.set(t.objectId,(e.get(t.objectId)??0)+(t.quantity??1));return e}function Le(i,e){let t=ir(e),n=0;for(let r of i.keys())n+=Math.max(0,Ze(i,r)-(t.get(r)??0));return n}function nr(i,e,t){let n=ir(t),r=0;for(let s of e){let o=i.gaQty.get(s.id);if(!o)continue;let a=n.get(s.id)??0;for(let[l,c]of o){let p=Math.max(0,c-a);a=Math.max(0,a-c),r+=p*i.paidPrice(s.categoryKey,l,sl(s,l),s.id)}}return r}function sl(i,e){return e?i.tiers?.find(t=>t.id===e)?.price??i.price:i.price}function rr(i){let e=[],t=new Map;for(let n of i){if(n.objectType!=="ga"||!n.objectId){e.push({...n,labels:[n.label]});continue}let r=`${n.objectId}\0${n.tierId??""}`,s=t.get(r);if(s){s.quantity=(s.quantity??0)+(n.quantity??1),s.labels.push(n.label);continue}let o={...n,quantity:n.quantity??1,labels:[n.label]};t.set(r,o),e.push(o)}return e}function sr(i,e,t){let n=new Set(t);for(let r of e)r.objectType==="ga"&&r.objectId&&n.has(r.label)&&wt(i,r.objectId,r.tierId??null,0)}function $i(i,e){if(i.objectType!=="ga")return i.label;let t=e.find(n=>n.id===i.objectId);return t?.displayLabel??t?.label??i.label}function ol(i){let e=new Map;for(let t of i){if(t.objectType!=="ga"||!t.objectId)continue;let n=`${t.objectId}\0${t.tierId??""}`;e.set(n,(e.get(n)??0)+(t.quantity??1))}return e}function Kt(i){let e=i.tiers??[];return e.length>1?e.map(t=>({id:t.id,label:t.name||t.id,price:t.price})):[{id:null,label:i.displayType??we("picker.generalAdmission"),price:i.price}]}function or(i,e){let t=i.totalTicketCount()-Ze(i.gaQty,e.id);return Math.max(0,Math.min(e.available,i.maxTickets-t))}function zi(i,e,t,n){if(pe(i,!1),i.salesClosed){i.toast(i.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}let r=Kt(e),s=i.gaQty.get(e.id),o=Ze(i.gaQty,e.id)>0,a=or(i,e);if(a<=0&&!o){i.toast(e.available>0?we("picker.maxTicketsForOrder",{count:i.maxTickets}):i.tf("picker.soldOutTitle","Sold out"),"warning");return}if(i.onGAPromptHook){let u={};for(let[g,b]of s??[])u[g??""]=b;if(i.onGAPromptHook({area:e,selected:u,min:0,max:a,tiers:r,confirm:g=>{dl(i,e,r,g,a)},cancel:()=>pe(i)})===!0)return}let l=new Map;for(let u of r)l.set(u.id,s?.get(u.id)??0);!o&&a>0&&l.set(r[0].id,1);let c={area:e,tiers:r,draft:l,max:a,reopened:o},p=i.root?.dataset.layout==="narrow",d=document.createElement("div");d.className=p?"sl-ga-scrim sl-mo-scrim":"sl-ga-pop-layer",d.innerHTML=al(i,c,p),i.root?.appendChild(d),i.gaPromptEl=d,i.gaPromptReturnFocus=n??document.activeElement,p||pl(i,d,t),i.reducedMotion()&&(d.dataset.motion="reduced"),lr(i,c),ll(i,d,c),requestAnimationFrame(()=>d.querySelector('[data-ga-step="1"]')?.focus())}function al(i,e,t){let{area:n,tiers:r}=e,s=r.length>1,o=n.displayLabel??n.label,a=r.map(l=>`<div class="sl-ga-prompt-row" data-ga-tier="${$(l.id??"")}"><div class="sl-ga-prompt-label"><span>${$(s?l.label:i.tf("picker.gaChooseTickets","How many tickets?"))}</span>`+(s?`<small>${$(i.money(i.paidPrice(n.categoryKey,l.id,l.price,n.id)))}</small>`:"")+`</div><div class="sl-ga-stepper" role="group" aria-label="${$(s?l.label:o)}"><button type="button" data-ga-step="-1" aria-label="${$(i.tf("picker.fewer","Fewer"))}">\u2212</button><output data-ga-qty aria-live="polite">0</output><button type="button" data-ga-step="1" aria-label="${$(i.tf("picker.more","More"))}">+</button></div></div>`).join("");return`<section class="${t?"sl-ga-sheet":"sl-ga-pop"}" role="dialog" aria-modal="true" aria-label="${$(we("picker.gaChooseForArea",{area:o}))}"><div class="sl-ga-prompt-head"><div class="sl-ga-prompt-eyebrow">${$(n.displayType??i.tf("picker.generalAdmission","General admission"))}</div><h2 class="sl-ga-prompt-title">${$(o)}</h2><p class="sl-ga-prompt-sub" data-ga-sub></p><button type="button" class="sl-ga-prompt-close" data-ga-cancel aria-label="${$(we("common.close"))}">\xD7</button></div><div class="sl-ga-prompt-body">${a}`+(r.length>1?`<div class="sl-ga-prompt-total"><span>${$(i.tf("picker.total","Total"))}</span><b data-ga-total></b></div>`:"")+'<p class="sl-ga-prompt-hint" data-ga-hint></p></div><div class="sl-ga-prompt-actions">'+(e.reopened?`<button type="button" class="sl-ga-prompt-remove" data-ga-remove>${$(i.tf("picker.gaRemove","Remove"))}</button>`:`<button type="button" class="sl-ga-prompt-remove" data-ga-cancel>${$(we("common.cancel"))}</button>`)+'<button type="button" class="sl-ga-prompt-confirm" data-ga-confirm></button></div></section>'}function ji(i){let e=0;for(let t of i.draft.values())e+=t;return e}function ar(i,e){let t=0;for(let n of e.tiers)t+=(e.draft.get(n.id)??0)*i.paidPrice(e.area.categoryKey,n.id,n.price,e.area.id);return t}function lr(i,e){let t=i.gaPromptEl;if(!t)return;let n=ji(e),r=ar(i,e);t.querySelectorAll("[data-ga-tier]").forEach(c=>{let p=c.dataset.gaTier?c.dataset.gaTier:null,d=e.draft.get(p)??0,u=c.querySelector("[data-ga-qty]");u&&(u.value=String(d)),c.querySelectorAll("[data-ga-step]").forEach(h=>{h.disabled=Number(h.dataset.gaStep)<0?d<=0:n>=e.max})});let s=t.querySelector("[data-ga-sub]");s&&(s.textContent=`${i.money(i.paidPrice(e.area.categoryKey,e.tiers[0].id,e.tiers[0].price,e.area.id))} \xB7 ${_e("picker.leftCount",e.area.available)}`);let o=t.querySelector("[data-ga-total]");o&&(o.textContent=i.money(r));let a=t.querySelector("[data-ga-hint]");a&&(a.textContent=n>=e.max&&e.max>0?e.area.available<=e.max?_e("picker.leftCount",e.area.available):we("picker.maxTicketsForOrder",{count:i.maxTickets}):"");let l=t.querySelector("[data-ga-confirm]");l&&(l.textContent=e.reopened?_e("picker.gaUpdate",n,{count:n}):_e("picker.gaAdd",n,{count:n,price:i.money(r)}),l.disabled=n<=0&&!e.reopened)}function ll(i,e,t){e.querySelectorAll("[data-ga-step]").forEach(n=>{n.addEventListener("click",()=>{let r=n.closest("[data-ga-tier]");if(!r)return;let s=r.dataset.gaTier?r.dataset.gaTier:null,o=Number(n.dataset.gaStep),a=t.draft.get(s)??0,l=t.max-ji(t);t.draft.set(s,Math.max(0,a+(o>0?Math.min(1,l):-1))),lr(i,t)})}),e.querySelectorAll("[data-ga-cancel]").forEach(n=>n.addEventListener("click",()=>pe(i))),e.querySelector("[data-ga-remove]")?.addEventListener("click",()=>{i.gaQty.delete(t.area.id),pe(i),i.syncTray(),Vi(i,we("picker.gaRemoved",{area:t.area.displayLabel??t.area.label}))}),e.querySelector("[data-ga-confirm]")?.addEventListener("click",()=>{cl(i,t)}),e.addEventListener("mousedown",n=>{n.target===e&&pe(i)}),e.addEventListener("keydown",n=>{if(n.key==="Escape"){n.stopPropagation(),pe(i);return}if(n.key!=="Tab")return;let r=[...e.querySelectorAll('button:not(:disabled),[tabindex]:not([tabindex="-1"])')];if(!r.length)return;let s=r[0],o=r[r.length-1];n.shiftKey&&document.activeElement===s?(n.preventDefault(),o.focus()):!n.shiftKey&&document.activeElement===o&&(n.preventDefault(),s.focus())})}function cl(i,e){let t=ji(e),n=ar(i,e);for(let s of e.tiers)wt(i.gaQty,e.area.id,s.id,e.draft.get(s.id)??0);pe(i),i.syncTray();let r=e.area.displayLabel??e.area.label;t>0?Vi(i,_e("picker.gaAdded",t,{count:t,area:r,price:i.money(n)})):Vi(i,we("picker.gaRemoved",{area:r}))}function dl(i,e,t,n,r){if(typeof n=="number")wt(i.gaQty,e.id,t[0].id,Math.max(0,Math.min(r,Math.floor(n))));else{i.gaQty.delete(e.id);let s=r;for(let o of t){let a=Math.max(0,Math.floor(n[o.id??""]??0)),l=Math.min(a,s);s-=l,wt(i.gaQty,e.id,o.id,l)}}i.syncTray()}function pe(i,e=!0){let t=i.gaPromptReturnFocus;i.gaPromptEl&&Qe(i.gaPromptEl),i.gaPromptEl=null,i.gaPromptReturnFocus=null,e&&t&&requestAnimationFrame(()=>(t.isConnected?t:i.root)?.focus())}function pl(i,e,t){let n=i.root,r=e.querySelector(".sl-ga-pop");if(!n||!r||!t)return;let s=n.getBoundingClientRect(),o=t.x-s.left,a=t.y-s.top;e.style.setProperty("--sl-ga-anchor-x",`${o}px`),e.style.setProperty("--sl-ga-anchor-y",`${a}px`),requestAnimationFrame(()=>{let l=r.offsetWidth||260,c=r.offsetHeight||220,p=Math.max(8,Math.min(s.width-l-8,o-l/2)),d=a-c-14,u=d>=8?d:Math.min(s.height-c-8,a+14);r.style.left=`${p}px`,r.style.top=`${Math.max(8,u)}px`,r.dataset.side=d>=8?"above":"below",r.style.setProperty("--sl-ga-arrow-x",`${Math.max(12,Math.min(l-12,o-p))}px`)})}function Vi(i,e){i.srEl&&(i.srEl.textContent=e)}function cr(i,e,t=[]){let n=[],r=ol(t);for(let o of e){let a=i.gaQty.get(o.id);if(!a)continue;let l=Kt(o);for(let c of l){let p=(a.get(c.id)??0)-(r.get(`${o.id}\0${c.id??""}`)??0);if(p<=0)continue;let d=i.paidPrice(o.categoryKey,c.id,c.price,o.id);n.push(`<div class="sl-ga" data-ga="${$(o.id)}" data-ga-row-tier="${$(c.id??"")}"><div class="sl-ga-info"><div class="sl-ga-name">${$(o.displayLabel??o.label)}</div><div class="sl-ga-sub">${$(l.length>1?c.label:o.displayType??i.tf("picker.generalAdmission","General admission"))} \xB7 ${$(i.money(d))} \xB7 ${$(_e("picker.leftCount",o.available))}</div></div><div class="sl-ga-qty"><button type="button" data-d="-1" aria-label="${$(i.tf("picker.fewer","Fewer"))}">\u2212</button><span>${p}</span><button type="button" data-d="1" aria-label="${$(i.tf("picker.more","More"))}">+</button></div></div>`)}}let s=e.filter(o=>Ze(i.gaQty,o.id)<=0&&!t.some(a=>a.objectId===o.id));return s.length&&n.push(`<div class="sl-ga-areas" data-ga-areas><button type="button" class="sl-ga-areas-toggle" data-ga-areas-toggle aria-expanded="${i.gaAreasExpanded}"><span>${$(i.tf("picker.gaAreasHeading","Areas"))}</span><small>${s.length}</small></button>`+(i.gaAreasExpanded?`<div class="sl-ga-areas-list">${s.map(o=>`<button type="button" class="sl-ga-area-open" data-ga-open="${$(o.id)}"${o.available<=0?" disabled":""}><span class="name">${$(o.displayLabel??o.label)}<small>${$(o.displayType??i.tf("picker.generalAdmission","General admission"))}</small></span><span class="meta">${$(i.money(i.paidPrice(o.categoryKey,null,o.price,o.id)))} \xB7 ${$(o.available>0?_e("picker.leftCount",o.available):i.tf("picker.soldOutTitle","Sold out"))}</span></button>`).join("")}</div>`:"")+"</div>"),n.join("")}function dr(i,e,t){e.querySelectorAll(".sl-ga .sl-ga-qty button").forEach(n=>{n.addEventListener("click",()=>{let r=n.closest(".sl-ga");if(!r?.dataset.ga)return;let s=t.find(c=>c.id===r.dataset.ga);if(!s)return;let o=r.dataset.gaRowTier?r.dataset.gaRowTier:null,a=Number(n.dataset.d),l=i.gaQty.get(s.id)?.get(o)??0;if(a>0&&or(i,s)-Ze(i.gaQty,s.id)<=0){i.toast(we("picker.maxTicketsForOrder",{count:i.maxTickets}),"warning");return}wt(i.gaQty,s.id,o,Math.max(0,l+a)),i.syncTray()})}),e.querySelector("[data-ga-areas-toggle]")?.addEventListener("click",()=>{i.gaAreasExpanded=!i.gaAreasExpanded,i.syncTray()}),e.querySelectorAll("[data-ga-open]").forEach(n=>{n.addEventListener("click",()=>{let r=t.find(s=>s.id===n.dataset.gaOpen);r&&zi(i,r,null,n)})})}var Wt='<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 hl=/^data:image\/(?:png|jpe?g|webp|gif|avif);base64,[a-z0-9+/]+={0,2}$/i,ul=/[\s"'<>`\\]/;function ml(i){return i.startsWith("//")?!1:i.startsWith("/")||i.startsWith("./")||i.startsWith("../")}function fl(){try{let i=typeof location>"u"?"":location.origin;return i&&i!=="null"?i:null}catch{return null}}function Je(i){if(typeof i!="string"||!i||i.length>2e6||i!==i.trim())return!1;if(i.startsWith("data:"))return hl.test(i);if(ul.test(i))return!1;let e=fl();if(ml(i)){if(!e)return!1;try{let t=new URL(i,e);return t.origin===e&&!t.username&&!t.password}catch{return!1}}try{let t=new URL(i);return t.username||t.password?!1:t.protocol==="https:"||e!=null&&t.origin===e}catch{return!1}}var gl=/^[a-zA-Z0-9._-]+$/;function Gi(i){let e;try{e=new URL(i,"https://seatlayer.invalid")}catch{return null}if(e.search||e.hash)return null;let t=/^\/pub\/events\/([^/]+)\/assets\/([^/]+)$/.exec(e.pathname);if(!t)return null;try{let n=decodeURIComponent(t[1]),r=decodeURIComponent(t[2]);return!n||!gl.test(r)?null:{eventKey:n,asset:r}}catch{return null}}function bl(i){try{return/^\/pub\/events\/[^/]+\/assets(?:\/|$)/.test(new URL(i,"https://seatlayer.invalid").pathname)}catch{return!1}}var et=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=Gi(e);if(!t)return Promise.resolve(bl(e)||!Je(e)?null:e);if(t.eventKey!==this.eventKey||!this.load||this.disposed)return Promise.resolve(null);let n=this.pending.get(e);if(n)return n;let r=this.load(this.eventKey,t.asset).then(s=>{let o=URL.createObjectURL(s);return this.disposed?(URL.revokeObjectURL(o),null):(this.created.add(o),o)}).catch(s=>{throw this.pending.delete(e),s});return this.pending.set(e,r),r}dispose(){if(!this.disposed){this.disposed=!0;for(let e of this.created)URL.revokeObjectURL(e);this.created.clear(),this.pending.clear()}}};import{t as nt}from"@seatlayer/core";import{isAuthoredSeatView as El,seatViewDisclosure as Cl}from"@seatlayer/core/view3d/crossfade/panorama";var pr=`
131
+ `+al;function Gt(){try{return window.matchMedia?.("(prefers-reduced-motion: reduce)").matches===!0}catch{return!1}}function Fi(i,e){if(!e){i.style.removeProperty("--sl-mo-ox"),i.style.removeProperty("--sl-mo-oy");return}qt(i,e,i.getBoundingClientRect())}function qt(i,e,t){let n=t.width||1,r=t.height||1,s=o=>Math.max(0,Math.min(100,o));i.style.setProperty("--sl-mo-ox",`${s((e.x-t.left)/n*100).toFixed(1)}%`),i.style.setProperty("--sl-mo-oy",`${s((e.y-t.top)/r*100).toFixed(1)}%`)}function Qn(i,e,t){let n=i.getBoundingClientRect(),r=t.getBoundingClientRect();qt(i,e,{left:n.left-r.left,top:n.top-r.top,width:n.width,height:n.height})}function Ut(i,e){i.classList.remove("sl-mo-out"),e!==void 0&&Fi(i,e),i.classList.remove("sl-mo-in"),i.offsetWidth,i.classList.add("sl-mo-in")}function Zn(i){i.classList.add("sl-mo-stagger");let e=0;for(let t of Array.from(i.children))t.style.setProperty("--sl-mo-i",String(e)),e+=1}function Qe(i,e,t={className:"sl-mo-out",duration:U.exit}){let n=()=>{r||(r=!0,!(typeof window>"u")&&(clearTimeout(s),i.removeEventListener("animationend",n),e?e():i.remove()))},r=!1;i.classList.remove("sl-mo-in","sl-mo-slide-up","sl-mo-spring","sl-mo-zoom","sl-mo-rise"),i.classList.add(t.className),i.addEventListener("animationend",n);let s=setTimeout(n,Gt()?0:t.duration+60)}var Jp={className:"sl-mo-slide-down",duration:U.exit};function Jn(i){if(Gt())return i.onArrive?.(),null;let e=document.createElement("div");e.className="sl-mo-fly sl-mo-host",e.setAttribute("aria-hidden","true"),e.textContent=i.label??"",e.style.left=`${i.from.x}px`,e.style.top=`${i.from.y}px`,e.style.background=i.color??"var(--sl-accent,#6e7bff)",e.style.color=i.ink??"#fff",e.style.setProperty("--sl-fly-dx",`${Math.round(i.to.x-i.from.x)}px`),e.style.setProperty("--sl-fly-dy",`${Math.round(i.to.y-i.from.y)}px`),document.body.appendChild(e);let t=!1,n=()=>{t||(t=!0,window.clearTimeout(r),e.remove(),i.onArrive?.())};e.addEventListener("animationend",n);let r=window.setTimeout(n,U.flight+80);return e}var $=i=>String(i??"").replace(/[&<>"']/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[e]);function Ze(i,e){let t=0;for(let n of i.get(e)?.values()??[])t+=n;return t}function er(i){let e=[];for(let[t,n]of i)for(let[r,s]of n)s>0&&e.push({areaId:t,tierId:r,qty:s});return e}function tr(i){let e=new Map;for(let t of i.keys())e.set(t,Ze(i,t));return e}function wt(i,e,t,n){let r=i.get(e)??new Map;n>0?r.set(t,n):r.delete(t),r.size?i.set(e,r):i.delete(e)}function ir(i){let e=new Map;for(let t of i)t.objectType!=="ga"||!t.objectId||e.set(t.objectId,(e.get(t.objectId)??0)+(t.quantity??1));return e}function Le(i,e){let t=ir(e),n=0;for(let r of i.keys())n+=Math.max(0,Ze(i,r)-(t.get(r)??0));return n}function nr(i,e,t){let n=ir(t),r=0;for(let s of e){let o=i.gaQty.get(s.id);if(!o)continue;let a=n.get(s.id)??0;for(let[l,c]of o){let p=Math.max(0,c-a);a=Math.max(0,a-c),r+=p*i.paidPrice(s.categoryKey,l,ll(s,l),s.id)}}return r}function ll(i,e){return e?i.tiers?.find(t=>t.id===e)?.price??i.price:i.price}function rr(i){let e=[],t=new Map;for(let n of i){if(n.objectType!=="ga"||!n.objectId){e.push({...n,labels:[n.label]});continue}let r=`${n.objectId}\0${n.tierId??""}`,s=t.get(r);if(s){s.quantity=(s.quantity??0)+(n.quantity??1),s.labels.push(n.label);continue}let o={...n,quantity:n.quantity??1,labels:[n.label]};t.set(r,o),e.push(o)}return e}function sr(i,e,t){let n=new Set(t);for(let r of e)r.objectType==="ga"&&r.objectId&&n.has(r.label)&&wt(i,r.objectId,r.tierId??null,0)}function $i(i,e){if(i.objectType!=="ga")return i.label;let t=e.find(n=>n.id===i.objectId);return t?.displayLabel??t?.label??i.label}function cl(i){let e=new Map;for(let t of i){if(t.objectType!=="ga"||!t.objectId)continue;let n=`${t.objectId}\0${t.tierId??""}`;e.set(n,(e.get(n)??0)+(t.quantity??1))}return e}function Kt(i){let e=i.tiers??[];return e.length>1?e.map(t=>({id:t.id,label:t.name||t.id,price:t.price})):[{id:null,label:i.displayType??we("picker.generalAdmission"),price:i.price}]}function or(i,e){let t=i.totalTicketCount()-Ze(i.gaQty,e.id);return Math.max(0,Math.min(e.available,i.maxTickets-t))}function zi(i,e,t,n){if(pe(i,!1),i.salesClosed){i.toast(i.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}let r=Kt(e),s=i.gaQty.get(e.id),o=Ze(i.gaQty,e.id)>0,a=or(i,e);if(a<=0&&!o){i.toast(e.available>0?we("picker.maxTicketsForOrder",{count:i.maxTickets}):i.tf("picker.soldOutTitle","Sold out"),"warning");return}if(i.onGAPromptHook){let u={};for(let[g,b]of s??[])u[g??""]=b;if(i.onGAPromptHook({area:e,selected:u,min:0,max:a,tiers:r,confirm:g=>{ul(i,e,r,g,a)},cancel:()=>pe(i)})===!0)return}let l=new Map;for(let u of r)l.set(u.id,s?.get(u.id)??0);!o&&a>0&&l.set(r[0].id,1);let c={area:e,tiers:r,draft:l,max:a,reopened:o},p=i.root?.dataset.layout==="narrow",d=document.createElement("div");d.className=p?"sl-ga-scrim sl-mo-scrim":"sl-ga-pop-layer",d.innerHTML=dl(i,c,p),i.root?.appendChild(d),i.gaPromptEl=d,i.gaPromptReturnFocus=n??document.activeElement,p||ml(i,d,t),i.reducedMotion()&&(d.dataset.motion="reduced"),lr(i,c),pl(i,d,c),requestAnimationFrame(()=>d.querySelector('[data-ga-step="1"]')?.focus())}function dl(i,e,t){let{area:n,tiers:r}=e,s=r.length>1,o=n.displayLabel??n.label,a=r.map(l=>`<div class="sl-ga-prompt-row" data-ga-tier="${$(l.id??"")}"><div class="sl-ga-prompt-label"><span>${$(s?l.label:i.tf("picker.gaChooseTickets","How many tickets?"))}</span>`+(s?`<small>${$(i.money(i.paidPrice(n.categoryKey,l.id,l.price,n.id)))}</small>`:"")+`</div><div class="sl-ga-stepper" role="group" aria-label="${$(s?l.label:o)}"><button type="button" data-ga-step="-1" aria-label="${$(i.tf("picker.fewer","Fewer"))}">\u2212</button><output data-ga-qty aria-live="polite">0</output><button type="button" data-ga-step="1" aria-label="${$(i.tf("picker.more","More"))}">+</button></div></div>`).join("");return`<section class="${t?"sl-ga-sheet":"sl-ga-pop"}" role="dialog" aria-modal="true" aria-label="${$(we("picker.gaChooseForArea",{area:o}))}"><div class="sl-ga-prompt-head"><div class="sl-ga-prompt-eyebrow">${$(n.displayType??i.tf("picker.generalAdmission","General admission"))}</div><h2 class="sl-ga-prompt-title">${$(o)}</h2><p class="sl-ga-prompt-sub" data-ga-sub></p><button type="button" class="sl-ga-prompt-close" data-ga-cancel aria-label="${$(we("common.close"))}">\xD7</button></div><div class="sl-ga-prompt-body">${a}`+(r.length>1?`<div class="sl-ga-prompt-total"><span>${$(i.tf("picker.total","Total"))}</span><b data-ga-total></b></div>`:"")+'<p class="sl-ga-prompt-hint" data-ga-hint></p></div><div class="sl-ga-prompt-actions">'+(e.reopened?`<button type="button" class="sl-ga-prompt-remove" data-ga-remove>${$(i.tf("picker.gaRemove","Remove"))}</button>`:`<button type="button" class="sl-ga-prompt-remove" data-ga-cancel>${$(we("common.cancel"))}</button>`)+'<button type="button" class="sl-ga-prompt-confirm" data-ga-confirm></button></div></section>'}function ji(i){let e=0;for(let t of i.draft.values())e+=t;return e}function ar(i,e){let t=0;for(let n of e.tiers)t+=(e.draft.get(n.id)??0)*i.paidPrice(e.area.categoryKey,n.id,n.price,e.area.id);return t}function lr(i,e){let t=i.gaPromptEl;if(!t)return;let n=ji(e),r=ar(i,e);t.querySelectorAll("[data-ga-tier]").forEach(c=>{let p=c.dataset.gaTier?c.dataset.gaTier:null,d=e.draft.get(p)??0,u=c.querySelector("[data-ga-qty]");u&&(u.value=String(d)),c.querySelectorAll("[data-ga-step]").forEach(h=>{h.disabled=Number(h.dataset.gaStep)<0?d<=0:n>=e.max})});let s=t.querySelector("[data-ga-sub]");s&&(s.textContent=`${i.money(i.paidPrice(e.area.categoryKey,e.tiers[0].id,e.tiers[0].price,e.area.id))} \xB7 ${_e("picker.leftCount",e.area.available)}`);let o=t.querySelector("[data-ga-total]");o&&(o.textContent=i.money(r));let a=t.querySelector("[data-ga-hint]");a&&(a.textContent=n>=e.max&&e.max>0?e.area.available<=e.max?_e("picker.leftCount",e.area.available):we("picker.maxTicketsForOrder",{count:i.maxTickets}):"");let l=t.querySelector("[data-ga-confirm]");l&&(l.textContent=e.reopened?_e("picker.gaUpdate",n,{count:n}):_e("picker.gaAdd",n,{count:n,price:i.money(r)}),l.disabled=n<=0&&!e.reopened)}function pl(i,e,t){e.querySelectorAll("[data-ga-step]").forEach(n=>{n.addEventListener("click",()=>{let r=n.closest("[data-ga-tier]");if(!r)return;let s=r.dataset.gaTier?r.dataset.gaTier:null,o=Number(n.dataset.gaStep),a=t.draft.get(s)??0,l=t.max-ji(t);t.draft.set(s,Math.max(0,a+(o>0?Math.min(1,l):-1))),lr(i,t)})}),e.querySelectorAll("[data-ga-cancel]").forEach(n=>n.addEventListener("click",()=>pe(i))),e.querySelector("[data-ga-remove]")?.addEventListener("click",()=>{i.gaQty.delete(t.area.id),pe(i),i.syncTray(),Vi(i,we("picker.gaRemoved",{area:t.area.displayLabel??t.area.label}))}),e.querySelector("[data-ga-confirm]")?.addEventListener("click",()=>{hl(i,t)}),e.addEventListener("mousedown",n=>{n.target===e&&pe(i)}),e.addEventListener("keydown",n=>{if(n.key==="Escape"){n.stopPropagation(),pe(i);return}if(n.key!=="Tab")return;let r=[...e.querySelectorAll('button:not(:disabled),[tabindex]:not([tabindex="-1"])')];if(!r.length)return;let s=r[0],o=r[r.length-1];n.shiftKey&&document.activeElement===s?(n.preventDefault(),o.focus()):!n.shiftKey&&document.activeElement===o&&(n.preventDefault(),s.focus())})}function hl(i,e){let t=ji(e),n=ar(i,e);for(let s of e.tiers)wt(i.gaQty,e.area.id,s.id,e.draft.get(s.id)??0);pe(i),i.syncTray();let r=e.area.displayLabel??e.area.label;t>0?Vi(i,_e("picker.gaAdded",t,{count:t,area:r,price:i.money(n)})):Vi(i,we("picker.gaRemoved",{area:r}))}function ul(i,e,t,n,r){if(typeof n=="number")wt(i.gaQty,e.id,t[0].id,Math.max(0,Math.min(r,Math.floor(n))));else{i.gaQty.delete(e.id);let s=r;for(let o of t){let a=Math.max(0,Math.floor(n[o.id??""]??0)),l=Math.min(a,s);s-=l,wt(i.gaQty,e.id,o.id,l)}}i.syncTray()}function pe(i,e=!0){let t=i.gaPromptReturnFocus;i.gaPromptEl&&Qe(i.gaPromptEl),i.gaPromptEl=null,i.gaPromptReturnFocus=null,e&&t&&requestAnimationFrame(()=>(t.isConnected?t:i.root)?.focus())}function ml(i,e,t){let n=i.root,r=e.querySelector(".sl-ga-pop");if(!n||!r||!t)return;let s=n.getBoundingClientRect(),o=t.x-s.left,a=t.y-s.top;e.style.setProperty("--sl-ga-anchor-x",`${o}px`),e.style.setProperty("--sl-ga-anchor-y",`${a}px`),requestAnimationFrame(()=>{let l=r.offsetWidth||260,c=r.offsetHeight||220,p=Math.max(8,Math.min(s.width-l-8,o-l/2)),d=a-c-14,u=d>=8?d:Math.min(s.height-c-8,a+14);r.style.left=`${p}px`,r.style.top=`${Math.max(8,u)}px`,r.dataset.side=d>=8?"above":"below",r.style.setProperty("--sl-ga-arrow-x",`${Math.max(12,Math.min(l-12,o-p))}px`)})}function Vi(i,e){i.srEl&&(i.srEl.textContent=e)}function cr(i,e,t=[]){let n=[],r=cl(t);for(let o of e){let a=i.gaQty.get(o.id);if(!a)continue;let l=Kt(o);for(let c of l){let p=(a.get(c.id)??0)-(r.get(`${o.id}\0${c.id??""}`)??0);if(p<=0)continue;let d=i.paidPrice(o.categoryKey,c.id,c.price,o.id);n.push(`<div class="sl-ga" data-ga="${$(o.id)}" data-ga-row-tier="${$(c.id??"")}"><div class="sl-ga-info"><div class="sl-ga-name">${$(o.displayLabel??o.label)}</div><div class="sl-ga-sub">${$(l.length>1?c.label:o.displayType??i.tf("picker.generalAdmission","General admission"))} \xB7 ${$(i.money(d))} \xB7 ${$(_e("picker.leftCount",o.available))}</div></div><div class="sl-ga-qty"><button type="button" data-d="-1" aria-label="${$(i.tf("picker.fewer","Fewer"))}">\u2212</button><span>${p}</span><button type="button" data-d="1" aria-label="${$(i.tf("picker.more","More"))}">+</button></div></div>`)}}let s=e.filter(o=>Ze(i.gaQty,o.id)<=0&&!t.some(a=>a.objectId===o.id));return s.length&&n.push(`<div class="sl-ga-areas" data-ga-areas><button type="button" class="sl-ga-areas-toggle" data-ga-areas-toggle aria-expanded="${i.gaAreasExpanded}"><span>${$(i.tf("picker.gaAreasHeading","Areas"))}</span><small>${s.length}</small></button>`+(i.gaAreasExpanded?`<div class="sl-ga-areas-list">${s.map(o=>`<button type="button" class="sl-ga-area-open" data-ga-open="${$(o.id)}"${o.available<=0?" disabled":""}><span class="name">${$(o.displayLabel??o.label)}<small>${$(o.displayType??i.tf("picker.generalAdmission","General admission"))}</small></span><span class="meta">${$(i.money(i.paidPrice(o.categoryKey,null,o.price,o.id)))} \xB7 ${$(o.available>0?_e("picker.leftCount",o.available):i.tf("picker.soldOutTitle","Sold out"))}</span></button>`).join("")}</div>`:"")+"</div>"),n.join("")}function dr(i,e,t){e.querySelectorAll(".sl-ga .sl-ga-qty button").forEach(n=>{n.addEventListener("click",()=>{let r=n.closest(".sl-ga");if(!r?.dataset.ga)return;let s=t.find(c=>c.id===r.dataset.ga);if(!s)return;let o=r.dataset.gaRowTier?r.dataset.gaRowTier:null,a=Number(n.dataset.d),l=i.gaQty.get(s.id)?.get(o)??0;if(a>0&&or(i,s)-Ze(i.gaQty,s.id)<=0){i.toast(we("picker.maxTicketsForOrder",{count:i.maxTickets}),"warning");return}wt(i.gaQty,s.id,o,Math.max(0,l+a)),i.syncTray()})}),e.querySelector("[data-ga-areas-toggle]")?.addEventListener("click",()=>{i.gaAreasExpanded=!i.gaAreasExpanded,i.syncTray()}),e.querySelectorAll("[data-ga-open]").forEach(n=>{n.addEventListener("click",()=>{let r=t.find(s=>s.id===n.dataset.gaOpen);r&&zi(i,r,null,n)})})}var Wt='<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 fl=/^data:image\/(?:png|jpe?g|webp|gif|avif);base64,[a-z0-9+/]+={0,2}$/i,gl=/[\s"'<>`\\]/;function bl(i){return i.startsWith("//")?!1:i.startsWith("/")||i.startsWith("./")||i.startsWith("../")}function vl(){try{let i=typeof location>"u"?"":location.origin;return i&&i!=="null"?i:null}catch{return null}}function Je(i){if(typeof i!="string"||!i||i.length>2e6||i!==i.trim())return!1;if(i.startsWith("data:"))return fl.test(i);if(gl.test(i))return!1;let e=vl();if(bl(i)){if(!e)return!1;try{let t=new URL(i,e);return t.origin===e&&!t.username&&!t.password}catch{return!1}}try{let t=new URL(i);return t.username||t.password?!1:t.protocol==="https:"||e!=null&&t.origin===e}catch{return!1}}var yl=/^[a-zA-Z0-9._-]+$/;function Gi(i){let e;try{e=new URL(i,"https://seatlayer.invalid")}catch{return null}if(e.search||e.hash)return null;let t=/^\/pub\/events\/([^/]+)\/assets\/([^/]+)$/.exec(e.pathname);if(!t)return null;try{let n=decodeURIComponent(t[1]),r=decodeURIComponent(t[2]);return!n||!yl.test(r)?null:{eventKey:n,asset:r}}catch{return null}}function wl(i){try{return/^\/pub\/events\/[^/]+\/assets(?:\/|$)/.test(new URL(i,"https://seatlayer.invalid").pathname)}catch{return!1}}var et=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=Gi(e);if(!t)return Promise.resolve(wl(e)||!Je(e)?null:e);if(t.eventKey!==this.eventKey||!this.load||this.disposed)return Promise.resolve(null);let n=this.pending.get(e);if(n)return n;let r=this.load(this.eventKey,t.asset).then(s=>{let o=URL.createObjectURL(s);return this.disposed?(URL.revokeObjectURL(o),null):(this.created.add(o),o)}).catch(s=>{throw this.pending.delete(e),s});return this.pending.set(e,r),r}dispose(){if(!this.disposed){this.disposed=!0;for(let e of this.created)URL.revokeObjectURL(e);this.created.clear(),this.pending.clear()}}};import{t as nt}from"@seatlayer/core";import{isAuthoredSeatView as Pl,seatViewDisclosure as Ll}from"@seatlayer/core/view3d/crossfade/panorama";var pr=`
132
132
  /* confirm card: a candidate is not in the tray until Select. Map gestures and
133
133
  floating chrome pause while the card owns focus, keeping the camera stable. */
134
134
  .sl-picker[data-confirming="true"] .sl-map-host>:not(.sl-confirm){pointer-events:none}
@@ -1357,7 +1357,7 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default}
1357
1357
  .sl-picker .sl-fitpill.sl-fit-p2,.sl-picker .sl-fitpill.sl-fit-p3{font-size:11.5px}
1358
1358
  .sl-picker .sl-fitpill.sl-fit-p3{white-space:normal;text-align:center;
1359
1359
  padding-top:6px;padding-bottom:6px;line-height:1.2}
1360
- `;var fr="seatlayer-picker-style",vl=`
1360
+ `;var fr="seatlayer-picker-style",xl=`
1361
1361
  .sl-picker{position:relative;display:flex;flex-direction:column;width:100%;height:100%;min-height:420px;overflow:hidden;
1362
1362
  background:var(--sl-bg);color:var(--sl-text);font-family:var(--sl-font);border-radius:var(--sl-radius);
1363
1363
  /* iOS INFLATES FIXED-PX TYPE IN A HOST LAYOUT IT DECIDES IS TOO NARROW, and
@@ -2723,6 +2723,21 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default}
2723
2723
  /* The hold dialog sits above the access one: a hold can lapse while the access
2724
2724
  screen is up, and the hold is the more specific thing to say. */
2725
2725
  .sl-hold-expired{z-index:21}
2726
+ /* The hold card is a pause, not a fault: an accent rule on top and the title in
2727
+ the accent keep it from reading as an error slab on a dark map (owner review
2728
+ 2026-09-05). The released seats sit in a quiet chip rather than a bold line. */
2729
+ .sl-hold-expired .sl-interrupt-card{border-top:3px solid var(--sl-accent)}
2730
+ .sl-hold-expired .sl-interrupt-title{color:var(--sl-accent-text)}
2731
+ .sl-hold-expired .sl-hold-expired-seats{display:inline-block;margin-top:12px;padding:6px 10px;border-radius:8px;
2732
+ font-size:13px;background:color-mix(in srgb,var(--sl-accent) 10%,var(--sl-surface));
2733
+ border:1px solid color-mix(in srgb,var(--sl-accent) 30%,var(--sl-line))}
2734
+ /* Once a refresh has offered the seats back there are two buttons: the offer
2735
+ is the pill, and Start again steps back to a quiet outline beside it. */
2736
+ .sl-hold-expired .sl-interrupt-actions{gap:10px;flex-wrap:wrap}
2737
+ .sl-picker .sl-hold-expired .sl-interrupt-act-secondary{background:transparent;color:var(--sl-text);
2738
+ border:1px solid var(--sl-line);box-shadow:none}
2739
+ .sl-picker .sl-hold-expired .sl-interrupt-act-secondary:hover{filter:none;border-color:var(--sl-text);box-shadow:none}
2740
+ .sl-picker[data-layout="narrow"] .sl-hold-expired .sl-interrupt-act + .sl-interrupt-act{margin-top:10px}
2726
2741
  @keyframes slAccessVeilIn{from{opacity:0}to{opacity:1}}
2727
2742
  @keyframes slAccessCardIn{from{opacity:0;transform:translateY(14px) scale(.96)}to{opacity:1;transform:none}}
2728
2743
  @keyframes slAccessSpin{to{transform:rotate(360deg)}}
@@ -2779,7 +2794,7 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default}
2779
2794
  corners, and it is the frame. */
2780
2795
  .sl-modal-frame > .sl-picker{border-radius:0}
2781
2796
  @media(max-width:640px){.sl-modal-scrim{padding:0}.sl-modal-frame{width:100%;height:100%;border-radius:0}}
2782
- `;function tt(){if(document.getElementById(fr))return;let i=document.createElement("style");i.id=fr,i.textContent=vl+pr+mr+ur+hr+Xn,document.head.appendChild(i)}import{t as yl}from"@seatlayer/core";import{cdnAssetUrl as wl}from"@seatlayer/core/core/cdnAsset";import{SEATLAYER_MODULE_URL as Sh}from"@seatlayer/core/core/cdnAsset";function v(i,e){let t=yl(i);return t===i?e:t}function De(){return globalThis.matchMedia?.("(pointer: coarse)").matches??!1?v("picker.dragToLookTouch","Drag to look \xB7 pinch to zoom \xB7 tap \u2715 to close"):v("picker.dragToLookMouse","Drag to look \xB7 pinch or scroll to zoom \xB7 Esc to close")}function gr(i,e){let t=e?i.toLocaleUpperCase(e):i.toLocaleUpperCase(),n=e?i.toLocaleLowerCase(e):i.toLocaleLowerCase();if(i!==t||t===n)return i;let r=[...n][0]??"";return(e?r.toLocaleUpperCase(e):r.toLocaleUpperCase())+n.slice(r.length)}function br(i){if(typeof i=="string"){let e=document.querySelector(i);if(!e)throw new Error(`seatmap: container "${i}" not found`);return e}if(!(i instanceof HTMLElement))throw new Error("seatmap: container must be a CSS selector or an HTMLElement");return i}function H(i){return String(i??"").replace(/[&<>"']/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[e])}function vr(i,e,t){let n=e.find(s=>Je(s))??null;if(i.replaceChildren(),!n)return i.textContent=t.slice(0,1).toUpperCase(),null;let r=document.createElement("img");return r.alt="",r.referrerPolicy="no-referrer",r.src=n,i.appendChild(r),n}var it=null;function Yt(){if(it!==null)return it;try{if(typeof document>"u")return it=!1;it=!!document.createElement("canvas").getContext("webgl2")}catch{it=!1}return it}function qi(i){return wl(i)}var xt=null;function St(){return xt||(xt=(typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?import(qi("seatlayer-view3d.mjs")):import("@seatlayer/core/view3d")).catch(e=>{throw xt=null,e}),xt)}function Xt(){(typeof navigator>"u"?void 0:navigator.connection)?.saveData||St().catch(()=>{})}async function Qt(){return typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?import(qi("seatlayer-panorama.mjs")):import("@seatlayer/core")}async function yr(){return typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?import(qi("seatlayer-checkout.mjs")):import("./hostedCheckout-W7QZWSOQ.js")}function wr(i){return i==="unavailable_for_event"||i==="payments_off_for_event"?i:"not_configured"}function Zt(i,e,t){let n={month:"short",day:"numeric",hour:"numeric",minute:"2-digit"},r=new Date(i);if(e)try{return r.toLocaleString(t,{...n,timeZone:e})}catch{}return r.toLocaleString(t,n)}async function Jt(i,e){let t=i.overlay.productionElements;if(!t?.some(r=>r.contentImageUrl))return i;let n=await Promise.all(t.map(async r=>{if(!r.contentImageUrl)return r;try{let s=await e(r.contentImageUrl);if(!s){let{contentImageUrl:o,...a}=r;return a}return{...r,runtimeContentImageUrl:s}}catch{let{contentImageUrl:s,...o}=r;return o}}));return{...i,overlay:{...i.overlay,productionElements:n}}}async function ei(i,e){if(i)try{let t=await e(i);return t?await(await fetch(t)).arrayBuffer():void 0}catch{return}}import{browserPanoramaConstraints as xl,loadPanoramaImage as Sl,planPanoramaDelivery as kl,schedulePanoramaUpgrade as Tl}from"@seatlayer/core/view/panoramaDelivery";function ti(i){let{root:e,source:t,caption:n,real:r,closeLabel:s,dragHint:o,viewFromSeatLabel:a,real360Label:l,previewLabel:c,resolveAsset:p,onClose:d}=i,u=i.chrome??{},h=document.createElement("div");h.className="sl-view sl-mo-zoom",h.setAttribute("role","dialog"),h.setAttribute("aria-label",a),h.innerHTML='<div class="sl-view-head"><span class="sl-view-title"></span><span class="sl-view-cap"></span><button type="button" class="sl-view-x"><svg viewBox="0 0 24 24"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg></button></div><div class="sl-view-pano"><span class="sl-view-badge"></span><span class="sl-view-hint"></span></div>';let g=F=>h.querySelector(F)?.remove();u.title===!1?g(".sl-view-title"):h.querySelector(".sl-view-title").textContent=a,u.caption===!1?g(".sl-view-cap"):h.querySelector(".sl-view-cap").textContent=n,h.querySelector(".sl-view-x").setAttribute("aria-label",s),u.badge===!1?g(".sl-view-badge"):h.querySelector(".sl-view-badge").textContent=r?l:c,h.querySelector(".sl-view-hint").textContent=o,e.appendChild(h);let b=h.querySelector(".sl-view-pano"),w=kl(t,xl()),x=new AbortController;b.style.backgroundImage=`url(${JSON.stringify(w.initialUrl)})`;let y=()=>{};w.upgradeUrl&&(y=Tl(()=>{p(w.upgradeUrl).then(F=>!F||x.signal.aborted?null:Sl(F,x.signal).then(()=>F)).then(F=>{!F||!h.isConnected||x.signal.aborted||(b.style.backgroundImage=`url(${JSON.stringify(F)})`)}).catch(()=>{})}));let m=70,A=35,_=1,k=b.clientHeight||1,M=b.clientWidth||1,L=-(k*(180/m)*2/2-M/2),C=0,D=()=>{let F=b.clientHeight||1,_i=F*(180/m)*_,Bn=Math.max(0,_i-F),Nn=Math.min(Bn/2,A/180*_i);C=Math.min(Nn,Math.max(-Nn,C)),b.style.backgroundSize=`auto ${_i}px`,b.style.backgroundPosition=`${L}px ${C-Bn/2}px`};D();let R=!1,N=0,te=0,j=F=>{R=!0,N=F.clientX,te=F.clientY,b.classList.add("drag"),b.setPointerCapture?.(F.pointerId)},In=F=>{R&&(L+=F.clientX-N,C+=F.clientY-te,N=F.clientX,te=F.clientY,D())},Dt=F=>{R=!1,b.classList.remove("drag"),b.releasePointerCapture?.(F.pointerId)},_n=F=>{F.preventDefault(),_=Math.min(2.4,Math.max(1,_+(F.deltaY<0?.12:-.12))),D()};b.addEventListener("pointerdown",j),b.addEventListener("pointermove",In),b.addEventListener("pointerup",Dt),b.addEventListener("pointercancel",Dt),b.addEventListener("wheel",_n,{passive:!1});let Ii=h.querySelector(".sl-view-x");Ii.addEventListener("click",d);let Dn=F=>{F.key==="Escape"&&(F.stopPropagation(),d())};return h.addEventListener("keydown",Dn),Ii.focus(),{element:h,dispose(){y(),x.abort(),b.removeEventListener("pointerdown",j),b.removeEventListener("pointermove",In),b.removeEventListener("pointerup",Dt),b.removeEventListener("pointercancel",Dt),b.removeEventListener("wheel",_n),h.removeEventListener("keydown",Dn),Ii.removeEventListener("click",d)}}}function Al(i,e){if(!e)return{targetSeatId:null,previousSeatId:null,nextSeatId:null};let t=i.find(s=>s.id===e);if(!t?.rowId)return{targetSeatId:e,previousSeatId:null,nextSeatId:null};let n=i.filter(s=>s.rowId===t.rowId),r=n.findIndex(s=>s.id===e);return{targetSeatId:e,previousSeatId:r>0?n[r-1].id:null,nextSeatId:r>=0&&r+1<n.length?n[r+1].id:null}}var xr=6e4,ii=class{constructor(e){this.buyerView_="map";this.targetSeatId_=null;this.focusedSectionId_=null;this.navigationMode_="orbit";this.overlay=null;this.handle=null;this.generation=0;this.seatViewGeneration=0;this.seatViewElement=null;this.seatViewDispose=null;this.options=e}get buyerView(){return this.buyerView_}get targetSeatId(){return this.targetSeatId_}get focusedSectionId(){return this.focusedSectionId_}get seatPosition(){return Al(this.options.seats(),this.targetSeatId_)}get navigationMode(){return this.navigationMode_}canOffer3D(){return this.options.enable3D?this.handle&&this.overlay?!0:!this.options.doc()||!Yt()?!1:this.options.seats().length<=this.max3DSeats():!1}canOfferSeatView(){return this.options.enableSeatView?this.options.seats().some(e=>!!e.viewUrl)?!0:this.hasStage():!1}async setBuyerView(e,t={}){if(e==="map"){this.exit3D();return}if(!this.canOffer3D())throw new Error("venue_3d_unavailable");if(this.buyerView_==="venue3d"&&this.handle){t.flyToSeatId?(this.targetSeatId_=t.flyToSeatId,this.focusedSectionId_=this.findSeat(t.flyToSeatId)?.sectionId??null,this.options.onViewChange(this.buyerView_,this.targetSeatId_),await this.handle.flyToSeat(t.flyToSeatId)):t.resetView&&this.handle.focusOverview();return}if(this.handle&&this.overlay){await this.restore3D(t);return}await this.enter3D(t.flyToSeatId)}async openSeatView(e){if(!this.canOfferSeatView())throw new Error("seat_view_unavailable");let t=this.findSeat(e),n=this.options.host(),r=this.options.doc();if(!t||!n||!r)throw new Error("seat_view_unavailable");let s=++this.seatViewGeneration,o,a,l=!1;if(t.viewUrl){let g=t.viewMeta?.previewUrl,b=!!g&&g!==t.viewUrl,w=b?await this.options.resolveAsset(g):null,x=b?t.viewUrl:await this.options.resolveAsset(t.viewUrl);if(s!==this.seatViewGeneration||!x||b&&!w)return;o={url:x,...w?{previewUrl:w}:{},...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=Cl(o),l=El(o)}else{if(!this.hasStage())throw new Error("seat_view_unavailable");let{generateSeatPanorama:g}=await Qt();if(s!==this.seatViewGeneration)return;let b=r.floors?.find(y=>y.objects.some(m=>m.type==="row"&&m.id===t.rowId)),w=t.focalPoint??b?.focalPoint??r.focalPoint,x=g(t,w,[...this.options.seats()]);o={url:x.url,generated:!0},a=nt("picker.illustrationCaption",{m:x.distanceM})}if(s!==this.seatViewGeneration)return;this.closeSeatView(!1),this.prepareHostTheme(n,r),tt();let c=this.options.chrome??{},p=De(),d=nt("picker.viewFromSeat",{label:t.displayLabel||t.label}),u=l?nt("picker.real360"):nt("picker.preview"),h=ti({root:n,source:o,caption:a,real:l,closeLabel:v("picker.close","Close"),dragHint:p,viewFromSeatLabel:d,real360Label:nt("picker.real360"),previewLabel:nt("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:d,caption:a,badge:u,real:l,generated:!!o.generated,dragHint:p})}pushLiveState(){this.handle&&(this.handle.setAvailability(this.options.seats().map(e=>({seatId:e.id,state:this.seatState(e)}))),this.handle.setSelection(this.options.selection().map(e=>e.id)))}focusOverview(){return this.buyerView_!=="venue3d"||!this.handle?!1:(this.handle.focusOverview(),!0)}focusSection(e){return this.buyerView_==="venue3d"?this.handle?.focusSection(e)??!1:!1}focusFloor(e){let t=this.options.doc();if(this.buyerView_!=="venue3d"||!this.handle||!t?.floors?.length)return!1;let n=t.floors.findIndex(r=>r.id===e);return n>=0&&this.handle.focusFloor(n)}zoomIn(){return this.buyerView_!=="venue3d"||!this.handle?!1:(this.handle.zoomIn(),!0)}zoomOut(){return this.buyerView_!=="venue3d"||!this.handle?!1:(this.handle.zoomOut(),!0)}setNavigationMode(e){return this.navigationMode_=e,this.buyerView_!=="venue3d"||!this.handle?!1:(this.handle.setNavigationMode(e),this.options.onViewChange(this.buyerView_,this.targetSeatId_),!0)}destroy(){this.generation+=1,this.closeSeatView(!0,!1);try{this.handle?.dispose()}catch{}this.handle=null,this.overlay?.remove(),this.overlay=null,this.buyerView_="map",this.targetSeatId_=null,this.focusedSectionId_=null}max3DSeats(){let e=this.options.max3DSeats;if(typeof e=="number"&&e>0)return e;let t=globalThis.navigator;return(t?.hardwareConcurrency??8)<=4||(t?.deviceMemory??8)<=4||(globalThis.matchMedia?.("(pointer: coarse)").matches??!1)?xr/2:xr}async enter3D(e){let t=this.options.host(),n=this.options.doc();if(!t||!n||this.overlay)throw new Error("venue_3d_unavailable");tt(),this.prepareHostTheme(t,n);let r=document.createElement("div");r.className="sl-view3d",r.setAttribute("role","group"),r.setAttribute("aria-label",v("picker.interactive3dVenueView","Interactive 3D venue view")),Object.assign(r.style,{position:"absolute",inset:"0",zIndex:"4",opacity:"0",touchAction:"none",transition:this.reducedMotion()?"none":"opacity 260ms cubic-bezier(.2,.8,.2,1)",background:"radial-gradient(120% 120% at 50% 0%,#191f28 0%,#0d1014 70%)"});let s=document.createElement("div");s.className="sl-view3d-loading",s.setAttribute("role","status"),s.setAttribute("aria-live","polite"),s.textContent=v("picker.loading3d","Building the 3D venue\u2026"),r.appendChild(s),t.appendChild(r),this.overlay=r;let o=++this.generation;if(this.reducedMotion()?r.style.opacity="1":requestAnimationFrame(()=>{r.style.opacity="1"}),await this.nextPaint(),!(o!==this.generation||this.overlay!==r))try{let[a,l]=await Promise.all([St(),this.options.loadEventConfiguration()]),c=l?await Jt(l,this.options.resolveAsset):null,p=await ei(n.theme?.venue3d?.shellAssetUrl,this.options.resolveAsset);if(o!==this.generation||this.overlay!==r)return;let d={doc:n,seats:[...this.options.seats()],...c?{eventConfigurationId:c.id,eventConfiguration:c}:{},...p?{registeredShellGlb:p}:{}};s.textContent=v("picker.building3d","Building venue geometry\u2026");let u=await a.prepareVenue3D(d);if(o!==this.generation||this.overlay!==r)return;let h=this.options.chrome??{},g=a.mountVenue3D(r,{...d,prepared:u},{portraitOverviewCrop:!0,arriveAtSeatEye:!0,lookAroundHint:De(),...h.view3dCaption===!1||h.view3dSeatStepper===!1||h.view3dControlDock===!1?{chrome:{caption:h.view3dCaption!==!1,seatStepper:h.view3dSeatStepper!==!1,controlDock:h.view3dControlDock!==!1}}:{},seatViewActionLabel:b=>this.findSeat(b)?.viewUrl?v("picker.openAuthored360","Open venue 360\xB0"):v("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(o!==this.generation||this.overlay!==r){g.dispose();return}this.handle=g,this.buyerView_="venue3d",this.targetSeatId_=e??null,this.focusedSectionId_=e?this.findSeat(e)?.sectionId??null:null,g.setNavigationMode(this.navigationMode_),requestAnimationFrame(()=>s.remove()),this.pushLiveState(),this.options.onViewChange("venue3d",this.targetSeatId_),e&&await g.flyToSeat(e)}catch(a){if(o!==this.generation)return;throw this.options.onError?.(a),this.remove3DOverlay(!1),a}}exit3D(){this.buyerView_==="map"&&!this.overlay||(this.generation+=1,this.buyerView_="map",this.targetSeatId_=null,this.focusedSectionId_=null,this.remove3DOverlay(!0,!!this.handle),this.options.onViewChange("map",null))}remove3DOverlay(e,t=!1){let n=this.handle,r=this.overlay;if(this.options.restoreMap(),t&&n&&r){r.style.pointerEvents="none";let s=()=>{this.buyerView_!=="map"||this.overlay!==r||(r.style.visibility="hidden",this.options.restoreMap())};!e||this.reducedMotion()?(r.style.opacity="0",s()):(requestAnimationFrame(()=>{r.style.opacity="0"}),setTimeout(s,280));return}if(this.handle=null,this.overlay=null,!r){try{n?.dispose()}catch{}this.options.restoreMap();return}if(!e||this.reducedMotion()){try{n?.dispose()}catch{}r.remove(),this.options.restoreMap();return}r.style.pointerEvents="none",requestAnimationFrame(()=>{r.style.opacity="0"}),setTimeout(()=>{try{n?.dispose()}catch{}r.remove(),this.options.restoreMap()},280)}async restore3D(e){let t=this.overlay,n=this.handle;if(!t||!n)throw new Error("venue_3d_unavailable");this.buyerView_="venue3d",this.targetSeatId_=e.flyToSeatId??null,this.focusedSectionId_=e.flyToSeatId?this.findSeat(e.flyToSeatId)?.sectionId??null:null,t.style.visibility="visible",t.style.pointerEvents="auto",this.reducedMotion()?t.style.opacity="1":requestAnimationFrame(()=>{t.style.opacity="1"}),n.resize(),n.setNavigationMode(this.navigationMode_),this.pushLiveState(),this.options.onViewChange("venue3d",this.targetSeatId_),e.flyToSeatId?await n.flyToSeat(e.flyToSeatId):e.resetView&&n.focusOverview()}nextPaint(){return this.reducedMotion()||typeof requestAnimationFrame!="function"?Promise.resolve():new Promise(e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))})}toggleSeat(e){if(!this.findSeat(e))return;this.options.selection().some(r=>r.id===e)?this.options.deselect(e):this.options.status(e)==="free"&&this.options.select(e),this.pushLiveState()}seatState(e){switch(this.options.status(e.id)){case"held":return"held";case"booked":return"sold";case"not_for_sale":return"dimmed";default:return"available"}}async seatViewFor3D(e){let t=this.findSeat(e);if(!t)throw new Error("seat_view_unavailable");if(t.viewUrl){let n=t.viewMeta?.previewUrl,r=!!n&&n!==t.viewUrl,s=r?await this.options.resolveAsset(n):null,o=r?t.viewUrl:await this.options.resolveAsset(t.viewUrl);if(!o||r&&!s)throw new Error("seat_view_unavailable");return{url:o,...s?{previewUrl:s}:{},...r?{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:v("picker.chartDerivedModel","Chart-derived model")}}closeSeatView(e=!0,t=!1){e&&(this.seatViewGeneration+=1);let n=this.seatViewElement;if(this.seatViewDispose?.(),this.seatViewDispose=null,this.seatViewElement=null,!!n){if(this.options.onSeatViewChange?.(null),!t||this.reducedMotion()){n.remove();return}n.classList.add("is-leaving"),setTimeout(()=>n.remove(),190)}}findSeat(e){return this.options.seats().find(t=>t.id===e||t.label===e)}hasStage(){let e=this.options.doc();return e?(e.floors?.flatMap(n=>n.objects)??e.objects).some(n=>n.type==="shape"&&(n.role==="stage"||!!n.stageKind)):!1}prepareHostTheme(e,t){getComputedStyle(e).position==="static"&&(e.style.position="relative");let n=t.theme;e.style.setProperty("--sl-bg",n?.background??"#f6f7fb"),e.style.setProperty("--sl-surface","#ffffff"),e.style.setProperty("--sl-text",n?.textColor??"#10162a"),e.style.setProperty("--sl-muted","#697386"),e.style.setProperty("--sl-line","#d9deea"),e.style.setProperty("--sl-accent",n?.accent??"#ef4056"),e.style.setProperty("--sl-accent-ink",n?.accentInk??"#ffffff")}reducedMotion(){return globalThis.matchMedia?.("(prefers-reduced-motion: reduce)").matches??!1}};var Pl={host:"web",platform:"web",bundle:"",protocol:0,chromeOwner:"web"},Ll={...Pl},ni=null,Sr=null;function Ml(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():0}function Hl(){let i=e=>Math.max(0,Math.round(e*100)/100);return{bootMs:i(Ml()),documentMs:ni==null?0:i(ni),handshakeMs:ni==null||Sr==null?0:i(Sr-ni)}}function kr(){let{host:i,platform:e,bundle:t,protocol:n,chromeOwner:r}=Ll,s=Hl();return{host:i,platform:e,...t?{bundle:t}:{},...n?{protocol:n}:{},chromeOwner:r,bootMs:s.bootMs,documentMs:s.documentMs,handshakeMs:s.handshakeMs}}var Tr=new Set;function Me(i){return Tr.has(i)?"repeat":"cold"}function ri(i){let e=Me(i);return Tr.add(i),e}function ne(i){return typeof i=="number"&&Number.isFinite(i)&&i>=0?Math.round(i):0}function Rl(){return typeof location>"u"?!1:/^(localhost|127\.0\.0\.1|\[::1\])$/i.test(location.hostname)}function Ol(i){if(!/^[A-Za-z0-9_-]{1,80}$/.test(i.event))return null;let e=i.performanceProfile??{};return{event:i.event,scope:i.scope,surface:i.surface,outcome:i.outcome,stage:i.stage?.slice(0,32)??"",ms:ne(i.ms),api:ne(e.loadChartAndStatuses)||ne(e.loadChart),scene:ne(e.buildScene),panel:ne(e.buildBuyerControls),paint:ne(e.firstPaint),normalize:ne(e.normalizeBuyerModel),renderer:ne(e.createRenderer),seats:ne(i.seats),floors:ne(i.floors),view:i.view??"map",load:i.load??Me(i.event),transport:i.transport??"pubapi",chartBytes:ne(i.chartDelivery?.bytes),chartCache:i.chartDelivery?.cache??"",...kr(),availabilityMs:ne(e.loadStatuses)}}var Il=new Set;function xe(i){let e=Ol(i);if(e){for(let t of Il)try{t(e)}catch{}typeof fetch>"u"||Rl()||fetch(`${i.apiBase.replace(/\/+$/,"")}/pub/telemetry/chart-load`,{method:"POST",headers:{"Content-Type":"application/json","X-SeatLayer-Client":"1"},body:JSON.stringify(e),credentials:"omit",keepalive:!0}).catch(()=>{})}}function kt(i){if(!i)return null;let e=i.getBoundingClientRect();return e.width>0&&e.height>0?e:null}function _l(i){return kt(i.peek?.querySelector(".sl-peek-sum"))??kt(i.foot?.querySelector(".sl-total"))??kt(i.tray)??kt(i.sheetHead)}function Ki(i,e,t,n){let r=i,s=r.map;if(!s||!e)return;let o=s.getBoundingClientRect(),a={x:o.left+e.x,y:o.top+e.y},l=t.displayLabel??t.label,c=n?.find(d=>d.key===t.categoryKey)?.color,p=()=>{let d=_l(r);d&&Jn({from:a,to:{x:d.left+d.width/2,y:d.top+d.height/2},label:l,color:c})};kt(r.peek)?requestAnimationFrame(p):p()}var Ui=60,Dl=650;function Er(i,e){if(!e.length||i.focusSeats?.(e.map(r=>r.id)))return;let t=e.find(r=>r.sectionId)?.sectionId;if(!t)return;let n=e.filter(r=>r.sectionId===t);i.focus(t,{x:n.reduce((r,s)=>r+s.x,0)/n.length,y:n.reduce((r,s)=>r+s.y,0)/n.length})}function Cr(i,e){let t=!Gt();Er({focusSeats:n=>i.focusSeats?.(n,{animate:t})===!0,focus:(n,r)=>i.focusSection(n,r)},(e?.items??[]).filter(n=>n.objectType!=="ga").slice(0,10).map(n=>i.seatByLabel(n.label)).filter(n=>!!n))}function Ar(i,e){if(!e.length)return;let t=i.reducedMotion===!0;t||e.forEach((o,a)=>{i.schedule(()=>i.pop(o.id),a*Ui)});let n=t?0:e.length*Ui,r=e.find(o=>o.sectionId)?.sectionId;if(i.schedule(()=>Er(i,e),n),t)return;let s=n+(i.focusSeats||r?Dl:0);e.forEach((o,a)=>{i.schedule(()=>Ki(i.regions,i.screenPoint(o),o,i.categories),s+a*Ui)})}function Bl(i,e,t){for(let n of i)if(e>=n.x&&t>=n.y&&e<=n.x+n.w&&t<=n.y+n.h)return!0;return!1}var si=class{constructor(){this.rects=[];this.host=null;this.pointers=new Set;this.touches=new Set;this.mouseDown=!1;this.onPointerDown=e=>{this.inside(e.clientX,e.clientY)&&(this.pointers.add(e.pointerId),this.swallow(e))};this.onPointerFollow=e=>{this.pointers.has(e.pointerId)&&this.swallow(e)};this.onPointerEnd=e=>{this.pointers.delete(e.pointerId)&&this.swallow(e)};this.onTouchStart=e=>{let t=this.changed(e);if(!t.length)return;let n=!0;for(let r of t)this.inside(r.clientX,r.clientY)?this.touches.add(r.identifier):n=!1;n&&this.swallow(e)};this.onTouchFollow=e=>{let t=this.changed(e);t.length&&t.every(n=>this.touches.has(n.identifier))&&this.swallow(e)};this.onTouchEnd=e=>{let t=this.changed(e);if(!t.length)return;let n=t.every(r=>this.touches.has(r.identifier));for(let r of t)this.touches.delete(r.identifier);n&&this.swallow(e)};this.onMouseDown=e=>{this.inside(e.clientX,e.clientY)&&(this.mouseDown=!0,this.swallow(e))};this.onMouseFollow=e=>{this.mouseDown&&this.swallow(e)};this.onMouseUp=e=>{this.mouseDown&&(this.mouseDown=!1,this.swallow(e))};this.onClick=e=>{this.inside(e.clientX,e.clientY)&&this.swallow(e)}}set(e){this.rects=e.map(t=>({x:t.x,y:t.y,w:t.w,h:t.h})),this.rects.length||(this.pointers.clear(),this.touches.clear(),this.mouseDown=!1)}get(){return this.rects}attach(e){if(this.host===e)return;this.detach(),this.host=e;let t={capture:!0,passive:!1};e.addEventListener("pointerdown",this.onPointerDown,t),e.addEventListener("pointermove",this.onPointerFollow,t),e.addEventListener("pointerup",this.onPointerEnd,t),e.addEventListener("pointercancel",this.onPointerEnd,t),e.addEventListener("touchstart",this.onTouchStart,t),e.addEventListener("touchmove",this.onTouchFollow,t),e.addEventListener("touchend",this.onTouchEnd,t),e.addEventListener("touchcancel",this.onTouchEnd,t),e.addEventListener("mousedown",this.onMouseDown,t),e.addEventListener("mousemove",this.onMouseFollow,t),e.addEventListener("mouseup",this.onMouseUp,t),e.addEventListener("click",this.onClick,t),e.addEventListener("dblclick",this.onClick,t)}detach(){let e=this.host;if(!e)return;let t={capture:!0};e.removeEventListener("pointerdown",this.onPointerDown,t),e.removeEventListener("pointermove",this.onPointerFollow,t),e.removeEventListener("pointerup",this.onPointerEnd,t),e.removeEventListener("pointercancel",this.onPointerEnd,t),e.removeEventListener("touchstart",this.onTouchStart,t),e.removeEventListener("touchmove",this.onTouchFollow,t),e.removeEventListener("touchend",this.onTouchEnd,t),e.removeEventListener("touchcancel",this.onTouchEnd,t),e.removeEventListener("mousedown",this.onMouseDown,t),e.removeEventListener("mousemove",this.onMouseFollow,t),e.removeEventListener("mouseup",this.onMouseUp,t),e.removeEventListener("click",this.onClick,t),e.removeEventListener("dblclick",this.onClick,t),this.host=null,this.pointers.clear(),this.touches.clear(),this.mouseDown=!1}inside(e,t){if(!this.rects.length||!this.host)return!1;let n=this.host.getBoundingClientRect();return Bl(this.rects,e-n.left,t-n.top)}swallow(e){e.stopImmediatePropagation(),e.stopPropagation(),e.cancelable&&e.preventDefault()}changed(e){let t=e.changedTouches;return t?Array.from(t):[]}},Pr=.48,Nl=8;function Fl(i,e,t,n=Pr){let r=Math.max(0,t.top),s=e.height-Math.max(0,t.bottom);if(!(s>r))return 0;let o=Number.isFinite(n)?Math.min(1,Math.max(0,n)):Pr,a=r+(s-r)*o-i;return Math.abs(a)<=Nl?0:Math.round(a)}function Lr(i,e,t={}){let n=i.gestureCount();if(t.gestures!==void 0&&t.gestures!==n)return{dy:0,gestures:n};let r=i.seatPoint(e);if(!r)return{dy:0,gestures:n};let s=Fl(r.y,{height:i.mapHeight()},i.insets(),t.fraction);return s?{dy:i.panScreenBy({x:0,y:s},t.animate!==!1)?s:0,gestures:n}:{dy:0,gestures:n}}var Tt=class i{constructor(e,t=null){this.seams=e;this.watch=null;this.mode=t,this.watchMode()}themeMode(){return this.mode}setThemeMode(e,t){let n=t!==void 0&&"mapTheme"in t;e===this.mode&&!n||(n&&this.seams.setHostMapTheme(t.mapTheme??void 0),this.mode=e,this.watchMode(),this.applyThemeMode())}static groundFor(e){return qe(null,e)}applyThemeMode(){let e=this.seams.mapTheme()??i.groundFor(this.mode);this.seams.applyMapTheme(e??null)&&this.seams.changed()}watchMode(){this.watch?.(),this.watch=null,this.mode==="auto"&&(this.watch=Nt(()=>this.applyThemeMode()))}setViewportInsets(e){this.seams.applyViewportInsets(e),this.seams.changed()}viewportInsets(){return this.seams.readViewportInsets()}dispose(){this.watch?.(),this.watch=null}};import{getLocale as zl}from"@seatlayer/core";import{seatConfidenceDisclosure as jl}from"@seatlayer/core/core/seatConfidence";import{generateSeatThumb as Vl}from"@seatlayer/core";function rt(i){let e=i.viewMeta?.previewUrl??i.viewUrl;return e&&(Gi(e)||Je(e))?e:null}function ai(i){if(!i)return!1;let e=i.floors?.length?i.floors.map(t=>t.objects??[]):[i.objects??[]];for(let t of e)for(let n of t)if(n.type==="shape"&&(n.role==="stage"||n.stageKind))return!0;return!1}var $l=512,oi=new Map;function li(i,e){if(!e)return null;let t=`${i.id}|${Math.round(e.x)},${Math.round(e.y)}`,n=oi.get(t);if(n!==void 0)return n;let r=null;try{r=Vl(i,e).distanceM??null}catch{r=null}return oi.size>=$l&&oi.clear(),oi.set(t,r),r}function Et(i){return i.getFocusedSection()!==null||i.seatsRevealed()}function Gl(i,e){return{accessibilityFilter:i.length>0,limitedViewFilter:e.some(t=>t.commercial?.restrictedView||t.commercial?.obstructedView)}}function ql(i,e,t,n){for(let r of e){if(r.count<=0)continue;let s=i.accessibilitySpread?.([r.key]);for(let o of s?.sections??[]){let a=t.get(o.id)??n.get(o.id);if(!a||o.free<=0)continue;let l=a.accessibleFree??(a.accessibleFree={});l[r.key]=o.free}}}function Mr(i,e,t){let n=i.doc,r=n?.theme??{},s=i.categoryAvailability(),o=i.getGAAreas(),a=i.getFloors(),l=i.getExpandedSeats(),c=i.getAccessNeeds(),p=Gl(c,l),d=e.seatPosition,u=d.targetSeatId?i.seatDetails(d.targetSeatId):null,h=new Map(l.map(y=>[y.id,y])),g=ai(n),b=n?.floors?.flatMap(y=>y.objects)??n?.objects??[],w=new Map,x=new Map;for(let y of b){if(y.type!=="section")continue;let m={id:y.id,label:y.label,...y.displayLabel?{displayLabel:y.displayLabel}:{},...y.zone?{zoneId:y.zone}:{}};w.set(y.id,m);let A=y.logicalSectionId??y.id;x.has(A)||x.set(A,m)}return ql(i,c,w,x),{event:{key:t.event,name:t.eventInfo?.name??n?.name??t.event,venue:t.eventInfo?.venue??null,startsAt:t.eventInfo?.startsAt??null,timezone:t.eventInfo?.timezone??null,currency:t.eventInfo?.currency??t.currency??"USD",locale:zl()||t.eventLocale,posterUrl:t.eventInfo?.posterUrl??null,mode:t.mode_??"live",salesClosed:t.eventInfo?.salesClosed??!1},branding:{...r.accent?{accent:r.accent}:{},...r.accentInk?{accentInk:r.accentInk}:{},...r.background?{background:r.background}:{},...r.textColor?{textColor:r.textColor}:{},...r.brandName?{brandName:r.brandName}:{},...r.logoUrl?{logoUrl:r.logoUrl}:{},attributionRequired:!r.hideBadge},features:{ga:o.length>0,tiers:!!n?.categories.some(y=>y.tiers?.length),floors:a.length>1,zones:!!n?.zones?.length,sections:w.size>0,bestAvailable:!0,...p,venue3d:e.canOffer3D(),seatView:e.canOfferSeatView()},catalog:{categories:(n?.categories??[]).filter(y=>!y.notForSale).map(y=>({key:y.key,label:y.label,color:y.color,price:y.price??y.tiers?.[0]?.price??0,available:s[y.key]??0,...Object.prototype.hasOwnProperty.call(s,y.key)?{free:s[y.key]}:{},tiers:(y.tiers??[]).map(m=>({id:m.id,name:m.name,price:m.price,...m.currency?{currency:m.currency}:{}}))})),zones:(n?.zones??[]).map(y=>({id:y.id,label:y.label,...y.color?{color:y.color}:{}})),sections:[...w.values()],gaAreas:o,bestAvailableZones:i.getBestAvailableZones()},map:{floors:a,activeFloorId:i.getActiveFloorId()||a[0]?.id||null,floorMode:i.isFloorOverview()?"all":"single",floorLabelStyle:i.getRenderer()?.getFloorLabelStyle?.()??"number",rung:i.getRung(),canZoomOut:Et(i)||t.focusedSection_!==null,focusedSectionId:i.getFocusedSection(),focusedSection:t.focusedSection_,viewMode:i.getViewMode(),buyerView:e.buyerView,view3dTargetSeatId:d.targetSeatId,view3dTargetSeat:u,view3dPreviousSeatId:d.previousSeatId,view3dNextSeatId:d.nextSeatId,view3dFocusedSectionId:e.focusedSectionId,view3dNavigationMode:e.navigationMode,colorblindSafe:t.colorblindSafe_,viewportInsets:i.getViewportInsets(),categoryFilter:t.categoryFilter_?[...t.categoryFilter_]:null,accessibilityFilter:t.accessibilityFilter_?[...t.accessibilityFilter_]:null,hideLimitedView:t.hideLimitedView_,accessNeeds:c},selection:{seats:i.getSelection().map(y=>{let m=h.get(y.id);if(!m)return y;let A=i.worldToScreen({x:m.x,y:m.y}),_=rt(m),k=g?li(m,m.focalPoint??n?.focalPoint):null;return{...y,screenPoint:{x:A.x,y:A.y},..._?{seatViewThumb:{reference:_,kind:"real"}}:{},...k!=null?{sightlineMetres:k}:{},...m.confidenceEvidence?{seatViewConfidence:jl(m.confidenceEvidence)}:{}}}),validity:i.getSelectionValidity(),maxSelection:t.maxSelection_},access:{...t.accessState_}}}var Jl="https://api.seatlayer.io",Hr=10;function ec(i){if(typeof i=="string"){let e=document.querySelector(i);if(!e)throw new Error(`seatmap: container "${i}" not found`);return e}if(!(i instanceof HTMLElement))throw new Error("seatmap: container must be a CSS selector or an HTMLElement");return i}var Yi=class{constructor(e){this.mount=null;this.hostEl=null;this.interactionEnabled_=!0;this.eventLocale=null;this.localeGeneration=0;this.languageSelect=null;this.rendered=!1;this.mode_=null;this.eventInfo=null;this.categoryFilter_=null;this.accessibilityFilter_=null;this.hideLimitedView_=!1;this.focusedSection_=null;this.lastReportedViewRung_=null;this.lastReportedCanZoomOut_=!1;this.tipEl=null;this.tipPos={x:0,y:0};this.onTipMove=null;this.blockedRegions=null;this.realtime=null;this.holdingLabels=new Set;if(!e||typeof e!="object")throw new Error("seatmap: options object is required");if(!e.container)throw new Error("seatmap: `container` is required");if(!e.event||typeof e.event!="string")throw new Error("seatmap: `event` key is required");this.opts=e,this.maxSelection_=e.maxSelection??Hr,this.colorblindSafe_=e.colorblindSafe??!1;let t=!!(e.buyerAccessTokenProvider||e.buyerAccessToken||e.publicKey);this.accessState_={configured:t,status:t?"ready":"public"},this.publicKey=e.publicKey;let n={onExpired:a=>{this.accessState_={configured:!0,status:a.refreshed?"ready":"expired"},this.opts.onAccessExpired?.(a),this.notifyMapStateChange()},onUnavailable:a=>{this.accessState_={configured:!0,status:"unavailable",reason:a.reason},this.opts.onAccessUnavailable?.(a),this.notifyMapStateChange()}},r=(e.apiBase??Jl).replace(/\/+$/,"");this.apiBase=r;let s=e.publicKey&&!e.buyerAccessTokenProvider&&!e.buyerAccessToken?jt({base:r,event:e.event,publicKey:e.publicKey,accessHooks:n,apiOptions:{onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)}}):null;this.access=s?.access??yt(e,n);let o=s?.api??new Ae(r,{access:this.access??void 0,onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)});this.api=o,this.controller=new Ul({transport:o,eventKey:e.event,maxSelection:this.maxSelection_,selectedObjects:e.selectedObjects,selectableObjects:e.selectableObjects,numberOfPlacesToSelect:e.numberOfPlacesToSelect,selectionValidators:e.selectionValidators,currency:e.currency,onSelectionChange:a=>{this.immersive?.pushLiveState(),this.opts.onSelectionChange?.(a)},onSelectionValidityChange:a=>this.opts.onSelectionValidityChange?.(a),onSelectionValid:a=>this.opts.onSelectionValid?.(a),onSelectionInvalid:a=>this.opts.onSelectionInvalid?.(a),onDeselect:a=>{this.controller.currentHold()?.labels.includes(a.label)&&this.controller.releaseLabels([a.label])},retapKeepsSelection:!0,onSeatRetap:a=>this.opts.onSeatRetap?.(a),onSelectionLimit:a=>this.opts.onSelectionLimit?.(a),onHold:a=>this.opts.onHold?.({holdId:a.holdId,expiresAt:a.expiresAt,seats:a.seats,items:a.items}),onHoldRestored:a=>this.opts.onHoldRestored?.({holdId:a.holdId,expiresAt:a.expiresAt,seats:a.seats,items:a.items}),onHoldExpired:()=>this.opts.onHoldExpired?.(),onGAClick:a=>{let l=this.controller.getGAAreas().find(c=>c.id===a);l&&(this.opts.onGAClick?.(l),this.opts.onGAPrompt?.({area:l,selected:{},min:0,max:Math.max(0,Math.min(l.available,(this.opts.maxSelection??Hr)-this.controller.getSelection().length)),tiers:Kt(l),confirm:c=>{let p=typeof c=="number"?c:Object.values(c).reduce((d,u)=>d+u,0);this.holdGA(l.id,p)},cancel:()=>{}}))},onError:a=>this.opts.onError?.(a),onDeckTap:a=>{this.opts.onDeckTap?.(a),this.notifyMapStateChange()},onHint:a=>this.opts.onHint?.(a),onSectionFocus:a=>{this.focusedSection_=a,this.opts.onSectionFocus?.(a),this.notifyMapStateChange()},onViewChange:()=>this.handleViewChange(),onStatusChange:()=>{this.immersive?.pushLiveState(),this.opts.onStatusChange?.()},onSalesClosed:()=>{this.eventInfo&&(this.eventInfo.salesClosed=!0),this.opts.onSalesClosed?.()},flashOnLiveChange:!0,onSeatHover:a=>{this.opts.onSeatHover?.(a),this.opts.seatTooltip!==!1&&this.updateTooltip(a)},colorblindSafe:e.colorblindSafe,mapTheme:e.mapTheme??Tt.groundFor(e.theme?.mode)??null}),this.hostSurface=new Tt({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 et(e.event,(a,l)=>o.asset(a,l)),this.immersive=new ii({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_=Et(this.controller)}handleViewChange(){this.opts.onViewChange?.();let e=this.controller.getRung(),t=Et(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_=Et(this.controller),this.opts.onMapStateChange?.()}async render(){if(this.rendered)return this;let e=performance.now();this.rendered=!0;let t=Vt(this.opts.locale,this.opts.messages),n=this.localeGeneration+=1,r=Wi();this.mount=ec(this.opts.container);let s=document.createElement("div");s.style.width="100%",s.style.height="100%",s.style.position="relative",this.mount.appendChild(s),this.hostEl=s,this.blockedRegions?.attach(s),$t(s,t,a=>{a!==r&&this.applyActiveLocale(a,n)}),this.applyInteractionState();let o=await this.controller.render(s);if(!o)return xe({apiBase:this.apiBase,event:this.opts.event,scope:"event",surface:"seating_chart",outcome:"failure",stage:"load_chart",ms:performance.now()-e,load:Me(this.opts.event),transport:"pubapi"}),this.rendered=!1,this.opts.errorDisplay!=="none"&&this.showLoadFailure(s),this;if(this.eventLocale=o.locale??null,!this.opts.locale&&this.eventLocale&&this.setLocale(this.eventLocale),this.buildLanguageSwitcher(s),this.controller.setViewMode(this.opts.initialView??"flat"),this.opts.floorLabelStyle&&this.setFloorLabelStyle(this.opts.floorLabelStyle),this.startRealtime(),this.mode_=o.mode==="test"?"test":"live",this.eventInfo={name:o.eventName,venue:o.venue??null,startsAt:o.startsAt??null,timezone:o.timezone??null,currency:o.currency??this.opts.currency??"USD",posterUrl:o.posterUrl??null,salesClosed:o.salesClosed},this.opts.seatTooltip!==!1){let a=document.createElement("div");a.setAttribute("role","tooltip"),a.style.cssText='position:absolute;z-index:7;pointer-events:none;display:none;max-width:240px;background:#10162a;color:#fff;border-radius:10px;padding:9px 12px;font:500 12px/1.45 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;box-shadow:0 10px 30px -10px rgba(0,0,0,.5);',s.appendChild(a),this.tipEl=a,this.onTipMove=l=>{let c=s.getBoundingClientRect();this.tipPos={x:l.clientX-c.left,y:l.clientY-c.top},this.tipEl&&this.tipEl.style.display!=="none"&&this.placeTooltip()},s.addEventListener("mousemove",this.onTipMove)}if(o.mode==="test"&&this.opts.showTestModeIndicator!==!1){s.style.overflow="hidden";let a=document.createElement("div");a.dataset.slI18n="testMode",a.textContent=le("picker.testMode"),a.setAttribute("aria-label",le("picker.testMode")),a.style.cssText="position:absolute;top:18px;right:-34px;z-index:6;transform:rotate(45deg);width:140px;text-align:center;padding:4px 0;background:#f4b740;color:#1a1200;font:800 10.5px/1.4 -apple-system,BlinkMacSystemFont,sans-serif;letter-spacing:.12em;box-shadow:0 2px 8px rgba(0,0,0,.25);pointer-events:none;",s.appendChild(a)}return this.opts.showAttribution!==!1&&this.buildBadge(s),xe({apiBase:this.apiBase,event:this.opts.event,scope:"event",surface:"seating_chart",outcome:"success",ms:performance.now()-e,performanceProfile:o.performanceProfile,chartDelivery:o.chartDelivery,seats:this.controller.getExpandedSeats().length,floors:this.controller.getFloors().length,view:"map",load:ri(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",le("picker.poweredBy")),t.style.cssText='position:absolute;bottom:10px;right:12px;z-index:5;display:inline-flex;align-items:center;gap:6px;padding:5px 9px;border-radius:999px;background:rgba(255,255,255,.92);color:#4a5163;text-decoration:none;font:600 11px/1 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;letter-spacing:.02em;box-shadow:0 2px 8px rgba(0,0,0,.12);';let n=document.createElement("span");n.setAttribute("aria-hidden","true"),n.style.cssText="width:16px;height:16px;border-radius:4px;flex:none;display:flex;align-items:center;justify-content:center;background:#0c1220;color:#fcf7ee",n.innerHTML=Wt;let r=document.createElement("span");r.textContent=le("picker.poweredBy"),t.append(n,r),e.appendChild(t)}placeTooltip(){if(!this.tipEl||!this.hostEl)return;let e=this.hostEl.clientWidth,t=this.tipEl.offsetWidth,n=this.tipEl.offsetHeight,r=this.tipPos.x+14,s=this.tipPos.y-n-12;r+t>e-8&&(r=this.tipPos.x-t-14),s<8&&(s=this.tipPos.y+18),this.tipEl.style.left=`${Math.max(8,r)}px`,this.tipEl.style.top=`${Math.max(8,s)}px`}updateTooltip(e){if(!this.tipEl)return;if(!e){this.tipEl.style.display="none";return}let t=Kl(e.price,e.currency,{...Number.isInteger(e.price)?{minimumFractionDigits:0,maximumFractionDigits:0}:{},locale:this.opts.locale,fallback:(l,c)=>`${l} ${c}`}),n=document.createElement("div");n.style.cssText="font-weight:700;font-size:13px",n.textContent=e.label;let r=document.createElement("div");r.style.cssText="display:flex;align-items:center;gap:6px;margin-top:4px;color:#c7cddc";let s=document.createElement("span");s.style.cssText="width:9px;height:9px;border-radius:50%;flex:none",s.style.background=e.categoryColor;let o=document.createElement("span");o.textContent=e.categoryLabel;let a=document.createElement("span");if(a.style.cssText="margin-left:auto;font-weight:700;color:#fff",a.textContent=t,r.append(s,o,a),this.tipEl.replaceChildren(n,r),e.status!=="free"){let l=document.createElement("div");l.style.cssText="margin-top:5px;font-size:10.5px;letter-spacing:.08em;text-transform:uppercase;color:#fca5a5;font-weight:700",l.textContent=e.status==="held"?le("map.statusHeld"):le("map.statusTaken"),this.tipEl.appendChild(l)}this.tipEl.style.display="block",this.placeTooltip()}buildLanguageSwitcher(e){let t=(this.opts.languages??[]).map(r=>Ql(r)).filter((r,s,o)=>o.indexOf(r)===s);if(t.length<2)return;let n=document.createElement("select");n.setAttribute("aria-label",le("picker.preferredTicketType")),n.style.cssText='position:absolute;bottom:10px;left:12px;z-index:5;appearance:none;padding:5px 9px;border-radius:999px;border:0;cursor:pointer;background:rgba(255,255,255,.92);color:#4a5163;font:600 11px/1 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;box-shadow:0 2px 8px rgba(0,0,0,.12);';for(let r of t){let s=document.createElement("option");s.value=r,s.textContent=Xl[r]??r,s.selected=r===Wi(),n.appendChild(s)}n.addEventListener("change",()=>{this.setLocale(n.value)}),e.appendChild(n),this.languageSelect=n}async setLocale(e){let t=Wi(),n=this.localeGeneration+=1,r=await Wl(e);return this.opts.messages&&Zl(this.opts.messages),r===t||this.applyActiveLocale(r,n),r}applyActiveLocale(e,t){if(t!==this.localeGeneration)return;let n=this.hostEl;if(n){n.lang=e,n.dir=Yl(e);for(let r of n.querySelectorAll("[data-sl-i18n]"))if(r.dataset.slI18n==="testMode")r.textContent=le("picker.testMode"),r.setAttribute("aria-label",le("picker.testMode"));else if(r.dataset.slI18n==="badge"){r.setAttribute("aria-label",le("picker.poweredBy"));let s=r.querySelector("span:last-child");s&&(s.textContent=le("picker.poweredBy"))}this.languageSelect&&this.languageSelect.value!==e&&(this.languageSelect.value=e),this.controller.refreshMapCopy()}}getMode(){return this.mode_}getPickerState(){return Mr(this.controller,this.immersive,{event:this.opts.event,currency:this.opts.currency,mode_:this.mode_,eventInfo:this.eventInfo,eventLocale:this.eventLocale,focusedSection_:this.focusedSection_,colorblindSafe_:this.colorblindSafe_,categoryFilter_:this.categoryFilter_,accessibilityFilter_:this.accessibilityFilter_,hideLimitedView_:this.hideLimitedView_,maxSelection_:this.maxSelection_,accessState_:this.accessState_})}getCategoryAvailability(){return this.controller.categoryAvailability()}getBestAvailableZones(){return this.controller.getBestAvailableZones()}getActiveFloorId(){return this.controller.getActiveFloorId()||null}getRung(){return this.controller.getRung()}getFocusedSection(){return this.controller.getFocusedSection()}focusSection(e){if(this.immersive.buyerView==="venue3d"&&this.immersive.focusSection(e)){this.notifyMapStateChange();return}this.controller.focusSection(e),this.notifyMapStateChange()}overview(){if(this.immersive.focusOverview()){this.notifyMapStateChange();return}this.controller.overview(),this.notifyMapStateChange()}setRung(e){this.controller.setRung(e),this.notifyMapStateChange()}setCategoryFilter(e,t=!1){this.categoryFilter_=e?[...e]:null,this.controller.setCategoryFilter(e),t&&this.controller.focusCategoryFilter(e),this.notifyMapStateChange()}setAccessibilityFilter(e){this.accessibilityFilter_=e?[...e]:null,this.controller.setAccessibilityFilter(e),this.notifyMapStateChange(),e?.length&&this.focusAccessibilityFilter()}focusAccessibilityFilter(){this.controller.focusAccessibilityFilter?.(),this.notifyMapStateChange()}focusNextAccessibleSection(e){let t=this.controller.focusNextAccessibleSection?.(e)??null;return t&&this.notifyMapStateChange(),t}setCommercialLimitedFilter(e){this.hideLimitedView_=e,this.controller.setCommercialLimitedFilter(e),this.notifyMapStateChange()}getSelection(){return this.controller.getSelection()}selectObjects(e){let t=this.controller.select(e);return this.immersive.pushLiveState(),t}deselectObjects(e){this.controller.deselect(e),this.immersive.pushLiveState()}clearSelection(){this.controller.clearSelection(),this.immersive.pushLiveState()}selectCategories(e){return this.controller.selectCategories(e)}deselectCategories(e){this.controller.deselectCategories(e)}setSelectableObjects(e){this.controller.setSelectableObjects(e)}setMaxSelection(e){this.maxSelection_=e,this.controller.setMaxSelection(e),this.notifyMapStateChange()}getSelectionValidity(){return this.controller.getSelectionValidity()}async hold(e={}){try{return await this.holdOrThrow(e)}catch(t){return this.opts.onError?.(t),null}}async holdOrThrow(e={}){let t=this.controller.getSelectionValidity();if(t&&!t.isValid){let n=t.violations.includes("numberOfPlacesToSelect");throw Object.assign(new Error(n?`seatmap: select exactly ${t.required} places before holding`:"seatmap: adjust the ticket selection before holding"),{code:n?"selection_count_mismatch":"selection_invalid",selection:t})}this.holdingLabels=new Set(this.controller.getSelection().map(n=>n.label));try{let n=await this.controller.hold(void 0,e.ttlMs);return n?{holdId:n.holdId,expiresAt:n.expiresAt,seats:n.seats,items:n.items}:null}finally{this.holdingLabels.clear()}}async resumeHold(e){try{return await this.resumeHoldOrThrow(e)}catch(t){return this.opts.onError?.(t),null}}async resumeHoldOrThrow(e){let t=await this.controller.resumeHold(e);return t?{holdId:t.holdId,expiresAt:t.expiresAt,seats:t.seats,items:t.items}:null}async extendHold(e){try{let t=await this.controller.extendHold(e);return t?{holdId:t.holdId,expiresAt:t.expiresAt,seats:t.seats,items:t.items}:null}catch(t){return this.opts.onError?.(t),null}}getCurrentHold(){let e=this.controller.currentHold();return e?{holdId:e.holdId,expiresAt:e.expiresAt,seats:e.seats,items:e.items}:null}getGAAreas(){return this.controller.getGAAreas()}async holdGA(e,t,n={}){try{return await this.holdGAOrThrow(e,t,n)}catch(r){return this.opts.onError?.(r),null}}async holdGAOrThrow(e,t,n={}){let r=await this.controller.holdGA(e,t,n);return r?{holdId:r.holdId,expiresAt:r.expiresAt,seats:r.seats,items:r.items}:null}async bestAvailable(e,t,n={}){try{return await this.bestAvailableOrThrow(e,t,n)}catch(r){return this.opts.onError?.(r),null}}async bestAvailableOrThrow(e,t,n={}){let r=await this.controller.bestAvailable(e,t,n);return Cr(this.controller,r),r?{holdId:r.holdId,expiresAt:r.expiresAt,labels:r.labels,seats:r.seats,items:r.items,...n.zoneId?{zoneId:n.zoneId}:{}}:null}setSeatTier(e,t){this.controller.setSeatTier(e,t)}setTableQuantity(e,t){return this.controller.setTableQuantity(e,t)}async replaceTableQuantity(e,t,n){try{return await this.replaceTableQuantityOrThrow(e,t,n)}catch(r){return this.opts.onError?.(r),null}}async replaceTableQuantityOrThrow(e,t,n){let r=await this.controller.replaceTableQuantity(e,t,n);return r?{holdId:r.holdId,expiresAt:r.expiresAt,seats:r.seats,items:r.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 si,this.hostEl&&this.blockedRegions.attach(this.hostEl)}this.blockedRegions.set(e)}getBlockedRegions(){return this.blockedRegions?.get()??[]}frameSeat(e,t={}){let n=this.controller.getRenderer();return Lr({seatPoint:r=>{let s=this.controller.getExpandedSeats().find(o=>o.id===r);return s?this.controller.worldToScreen({x:s.x,y:s.y}):null},mapHeight:()=>this.hostEl?.clientHeight??0,insets:()=>this.controller.getViewportInsets(),gestureCount:()=>n?.getCameraGestureCount?.()??0,panScreenBy:(r,s)=>n?.panScreenBy?(n.panScreenBy(r,{animate:s}),!0):!1},e,t)}setColorblindSafe(e){this.colorblindSafe_=e,this.controller.setColorblindSafe(e),this.notifyMapStateChange()}setViewMode(e){this.controller.setViewMode(e),this.notifyMapStateChange()}getViewMode(){return this.controller.getViewMode()}zoomIn(){this.immersive.zoomIn()||(this.controller.zoomIn(),this.notifyMapStateChange())}zoomOut(){this.immersive.zoomOut()||(this.controller.zoomOut(),this.notifyMapStateChange())}zoomToFit(){this.immersive.focusOverview()||(this.controller.zoomToFit(),this.notifyMapStateChange())}setThemeMode(e,t){this.hostSurface.setThemeMode(e,t)}getThemeMode(){return this.hostSurface.themeMode()}setViewportInsets(e){this.hostSurface.setViewportInsets(e)}getViewportInsets(){return this.hostSurface.viewportInsets()}setBuyerView(e,t){return this.immersive.setBuyerView(e,t)}getBuyerView(){return this.immersive.buyerView}openSeatView(e){return this.immersive.openSeatView(e)}setVenue3DNavigationMode(e){if(!this.immersive.setNavigationMode(e))throw new Error("venue_3d_not_active")}setInteractionEnabled(e){this.interactionEnabled_=e,this.applyInteractionState()}applyInteractionState(){let e=this.hostEl;e&&(e.style.pointerEvents=this.interactionEnabled_?"":"none",e.toggleAttribute("inert",!this.interactionEnabled_),this.interactionEnabled_?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden","true"))}async release(){await this.controller.release()}async releaseLabels(e){return this.controller.releaseLabels(e)}startRealtime(){!this.access?.configured||this.realtime||(this.realtime=new ve({url:this.api.subscribeUrl(this.opts.event),mintTicket:()=>this.api.subscribeTicket(this.opts.event),onAccessUnavailable:e=>this.opts.onAccessUnavailable?.(e),sink:mt(this.controller,{flashOnLiveChange:!0,ownLabels:()=>this.holdingLabels,onStatusChange:()=>{this.immersive.pushLiveState(),this.opts.onStatusChange?.()},onSelectedObjectUnavailable:(e,t)=>this.opts.onSelectedObjectUnavailable?.({labels:e,reason:t})})}),this.realtime.start())}async refreshAvailability(){let e=await this.controller.refreshAvailability();return this.immersive.pushLiveState(),this.opts.onStatusChange?.(),e.lost.length&&this.opts.onSelectedObjectUnavailable?.({labels:e.lost,reason:"taken"}),this.notifyMapStateChange(),e}async refreshAccess(){if(!this.access?.configured)return!1;let e=await this.access.refresh("manual");return e&&(this.accessState_={configured:!0,status:"ready"},await this.controller.refresh(),this.realtime?.restart(),this.realtime||this.startRealtime()),this.notifyMapStateChange(),e}showLoadFailure(e){let t=document.createElement("div");t.setAttribute("role","status"),t.style.cssText='display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;width:100%;height:100%;min-height:180px;box-sizing:border-box;padding:24px;text-align:center;font:500 14px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#3b4256;';let n=document.createElement("div");n.textContent="The seat map didn\u2019t load.",t.appendChild(n);let r=document.createElement("button");r.type="button",r.textContent="Try again",r.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;",r.addEventListener("click",()=>{this.destroy(),this.render().catch(s=>this.opts.onError?.(s))}),t.appendChild(r),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 Rr=["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"],tc={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 ic(i){let e={};for(let t of Rr)e[t]=(...n)=>{let r=i();return r?r[t](...n):tc[t]()};return e}var Or=["event","apiBase","maxSelection","numberOfPlacesToSelect","selectionValidators","publicKey","locale","currency","colorblindSafe","initialView","errorDisplay"],Ir=[...Or,"selectedObjects","selectableObjects","messages","seatTooltip","buyerAccessTokenProvider","buyerAccessToken"],_r=["onSelectionChange","onSelectionValidityChange","onSelectionValid","onSelectionInvalid","onSelectionLimit","onHold","onHoldRestored","onHoldExpired","onGAClick","onGAPrompt","onError","onDeckTap","onHint","onSeatHover","onAccessExpired","onAccessUnavailable","onSelectedObjectUnavailable"];function nc(i,e,t){let n={container:i};for(let r of Ir)n[r]=e[r];for(let r of _r)n[r]=t[r];return n}var rc=new Set(["seatlayer.designer.ready","seatlayer.designer.saved","seatlayer.designer.published","seatlayer.designer.close","seatlayer.designer.error"]),sc=2e4,oc=480,ac=180*1e3,lc=900*1e3,cc=.8,dc=30*1e3,pc=1e5,hc=4,uc=50;function Xi(i){if(typeof i!="string")return i;let e=document.querySelector(i);if(!e)throw new Error(`EmbeddedDesigner container not found: ${i}`);return e}function mc(i){let e=(i??"").toLowerCase();return e.includes("expire")||e.includes("revoke")||e==="401"?"expired":e.includes("mismatch")?"mismatch":e.includes("timeout")?"timeout":"load"}var fc={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."}},Qi=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"||!rc.has(t.type))return;let n={type:t.type,chartId:typeof t.chartId=="string"?t.chartId:void 0,workspaceId:typeof t.workspaceId=="string"?t.workspaceId:void 0,expiresAt:typeof t.expiresAt=="number"?t.expiresAt:void 0,code:typeof t.code=="string"?t.code:void 0,message:typeof t.message=="string"?t.message:void 0,meta:t.meta,fatal:typeof t.fatal=="boolean"?t.fatal:void 0,action:typeof t.action=="string"?t.action:void 0},r=this.identityEstablished||n.type==="seatlayer.designer.ready"||n.type==="seatlayer.designer.saved"||n.type==="seatlayer.designer.published"||n.type==="seatlayer.designer.close",s=this.options.expectedChartId!==void 0&&n.chartId!==this.options.expectedChartId&&(r||n.chartId!==void 0),o=this.options.expectedWorkspaceId!==void 0&&n.workspaceId!==this.options.expectedWorkspaceId&&(r||n.workspaceId!==void 0);if(s||o){this.showError("mismatch");return}switch(n.type){case"seatlayer.designer.ready":this.identityEstablished=!0,this.sessionExpiresAt=n.expiresAt,this.phase="ready",this.clearTimeoutTimer(),this.removeOverlay(),this.autoRecoverUsed=!1,this.scheduleRenewal(n.expiresAt),this.options.onReady?.(n);break;case"seatlayer.designer.saved":this.options.onSaved?.(n);break;case"seatlayer.designer.published":this.options.onPublished?.(n);break;case"seatlayer.designer.close":this.options.onClose?.(n);break;case"seatlayer.designer.error":{let a=mc(n.code);if(a==="expired"&&this.autoRenewEnabled()&&!this.autoRecoverUsed){this.autoRecoverUsed=!0,this.clearRenewTimer(),this.options.onRequestRelaunch();return}(typeof n.fatal=="boolean"?n.fatal:a!=="load"||this.phase!=="ready")&&this.showError(a),this.options.onError?.(n);break}}};this.options=e}mount(){this.destroy();let e=new URL(this.options.designerUrl,window.location.href);if(e.protocol!=="https:"&&e.hostname!=="localhost"&&e.hostname!=="127.0.0.1")throw new Error("EmbeddedDesigner requires an HTTPS designerUrl outside local development.");this.designerOrigin=e.origin;let t=document.createElement("iframe");t.title=this.options.title??"Venue chart Designer",t.allow=this.options.allow??"fullscreen; clipboard-write",t.referrerPolicy=this.options.referrerPolicy??"origin",t.src=e.toString(),t.style.setProperty("width","100%","important"),t.style.setProperty("height",typeof this.options.height=="number"?`${this.options.height}px`:"100%","important"),t.style.border="0",Object.assign(t.style,this.options.style),this.options.className&&(t.className=this.options.className);let n=Xi(this.options.container);if(this.containerEl=n,window.addEventListener("message",this.handleMessage),n.append(t),this.frame=t,this.fillEnabled()&&this.startFill(),this.phase="loading",this.loadingStateEnabled()){this.ensureContainerPositioned(n),this.renderOverlay(n,"loading");let r=this.options.loadingTimeoutMs??sc;r>0&&Number.isFinite(r)&&(this.timeoutTimer=setTimeout(()=>{this.phase==="loading"&&this.showError("timeout")},r))}return t}setDesignerUrl(e){return this.options={...this.options,designerUrl:e},this.mount()}getIframe(){return this.frame}setSizing(e,t){this.options={...this.options,height:e,minHeight:t},this.frame&&(this.stopFill(),this.lastAutoHeight="",this.fillEnabled()?(this.pinned||this.setFrameHeight("100%"),this.startFill()):this.pinned||this.setFrameHeight(`${e}px`))}setRelaunchPolicy(e,t){this.options={...this.options,onRequestRelaunch:e,autoRenewSession:t},this.clearRenewTimer(),this.phase==="ready"&&this.scheduleRenewal(this.sessionExpiresAt)}destroy(){window.removeEventListener("message",this.handleMessage),this.stopFill(),this.unpinFullscreen(),this.clearTimeoutTimer(),this.clearRenewTimer(),this.removeOverlay(),this.restoreContainerStyle(),this.frame?.remove(),this.frame=null,this.containerEl=null,this.fillMode=null,this.designerOrigin="",this.phase="loading",this.identityEstablished=!1,this.sessionExpiresAt=void 0,this.lastAutoHeight=""}loadingStateEnabled(){return this.options.showLoadingState!==!1}autoResizeEnabled(){return this.options.autoResize!==!1}fillEnabled(){return typeof this.options.height!="number"}setFrameHeight(e){this.frame?.style.setProperty("height",e,"important")}detectFillMode(){let e=this.containerEl,t=this.frame;if(this.pinned||!e||!t)return this.fillMode??"viewport";let n=()=>e.getBoundingClientRect().height,r=t.style.getPropertyValue("height"),s=t.style.getPropertyPriority("height");t.style.setProperty("height","0px","important");let o=n();t.style.setProperty("height",`${pc}px`,"important");let a=n();return r?t.style.setProperty("height",r,s):t.style.removeProperty("height"),!(a-o>hc)&&o>=uc?"container":"viewport"}applyFill(){if(!this.frame||this.pinned)return;let e=this.options.minHeight??oc;if(this.fillMode==="container"&&this.containerEl){let r=Math.max(e,Math.round(this.containerEl.getBoundingClientRect().height));this.setFrameHeight(`${r}px`);return}let t=this.frame.getBoundingClientRect().top,n=Math.max(e,Math.round(window.innerHeight-t));this.setFrameHeight(`${n}px`)}syncContainerObserver(){let e=this.fillMode==="container"&&!!this.containerEl&&typeof ResizeObserver<"u";e&&!this.resizeObs?(this.resizeObs=new ResizeObserver(()=>this.scheduleFill()),this.resizeObs.observe(this.containerEl)):!e&&this.resizeObs&&(this.resizeObs.disconnect(),this.resizeObs=null)}startFill(){this.fillMode=this.detectFillMode(),this.syncContainerObserver(),this.applyFill(),!this.fillListening&&(this.fillListening=!0,window.addEventListener("resize",this.scheduleReprobe),window.addEventListener("orientationchange",this.scheduleReprobe),window.addEventListener("scroll",this.scheduleFill,{passive:!0}))}stopFill(){this.fillRaf!==null&&(cancelAnimationFrame(this.fillRaf),this.fillRaf=null),this.reprobeRaf!==null&&(cancelAnimationFrame(this.reprobeRaf),this.reprobeRaf=null),this.resizeObs&&(this.resizeObs.disconnect(),this.resizeObs=null),this.fillListening&&(this.fillListening=!1,window.removeEventListener("resize",this.scheduleReprobe),window.removeEventListener("orientationchange",this.scheduleReprobe),window.removeEventListener("scroll",this.scheduleFill))}pinFullscreen(){if(this.pinned||!this.frame)return;this.pinned=!0,this.frameStyleBeforeFs=this.frame.getAttribute("style");let e={position:"fixed",top:"0",right:"0",bottom:"0",left:"0",width:"100vw",height:"100vh",margin:"0",border:"0","z-index":"2147483000",background:"#101625"};for(let[n,r]of Object.entries(e))this.frame.style.setProperty(n,r,"important");let t=document.documentElement;this.docOverflowBeforeFs=t.style.overflow,t.style.overflow="hidden",document.body&&(this.bodyOverflowBeforeFs=document.body.style.overflow,document.body.style.overflow="hidden"),this.fsKeyHandler=n=>{n.key==="Escape"&&this.unpinFullscreen()},window.addEventListener("keydown",this.fsKeyHandler)}unpinFullscreen(){this.pinned&&(this.pinned=!1,this.frame&&(this.frameStyleBeforeFs===null?this.frame.removeAttribute("style"):this.frame.setAttribute("style",this.frameStyleBeforeFs),this.fillEnabled()?this.applyFill():this.autoResizeEnabled()&&this.lastAutoHeight?this.setFrameHeight(this.lastAutoHeight):typeof this.options.height=="number"&&this.setFrameHeight(`${this.options.height}px`)),this.frameStyleBeforeFs=null,this.docOverflowBeforeFs!==null&&(document.documentElement.style.overflow=this.docOverflowBeforeFs,this.docOverflowBeforeFs=null),this.bodyOverflowBeforeFs!==null&&document.body&&(document.body.style.overflow=this.bodyOverflowBeforeFs,this.bodyOverflowBeforeFs=null),this.fsKeyHandler&&(window.removeEventListener("keydown",this.fsKeyHandler),this.fsKeyHandler=null))}clearTimeoutTimer(){this.timeoutTimer!==null&&(clearTimeout(this.timeoutTimer),this.timeoutTimer=null)}autoRenewEnabled(){return!!this.options.onRequestRelaunch&&this.options.autoRenewSession!==!1}clearRenewTimer(){this.renewTimer!==null&&(clearTimeout(this.renewTimer),this.renewTimer=null)}scheduleRenewal(e){if(this.clearRenewTimer(),!this.autoRenewEnabled()||typeof e!="number"||!Number.isFinite(e))return;let t=e-Date.now();if(t<=0)return;let n=t<lc?t*cc:t-ac,r=Math.max(dc,n);this.renewTimer=setTimeout(()=>{this.renewTimer=null,this.autoRenewEnabled()&&this.options.onRequestRelaunch()},r)}ensureContainerPositioned(e){getComputedStyle(e).position==="static"&&(this.restoreContainerPosition=e.style.position,e.style.position="relative")}restoreContainerStyle(){if(this.restoreContainerPosition!==null){try{Xi(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=Xi(this.options.container)}catch{return}this.renderOverlay(t,"error",e)}handleTryAgain(){if(this.options.onRequestRelaunch){this.options.onRequestRelaunch();return}this.mount()}renderOverlay(e,t,n){this.removeOverlay();let r=document.createElement("div");r.setAttribute("data-seatlayer-designer-overlay",t),r.setAttribute("role",t==="error"?"alert":"status"),r.setAttribute("aria-live","polite"),Object.assign(r.style,{position:"absolute",inset:"0",display:"flex",alignItems:"center",justifyContent:"center",background:"#101625",color:"#e6ebf5",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif',zIndex:"2",overflow:"hidden"}),t==="loading"?this.buildSkeleton(r):this.buildErrorCard(r,n??"load"),e.append(r),this.overlay=r}buildSkeleton(e){let t=document.createElement("style");t.textContent=`
2797
+ `;function tt(){if(document.getElementById(fr))return;let i=document.createElement("style");i.id=fr,i.textContent=xl+pr+mr+ur+hr+Xn,document.head.appendChild(i)}import{t as Sl}from"@seatlayer/core";import{cdnAssetUrl as kl}from"@seatlayer/core/core/cdnAsset";import{SEATLAYER_MODULE_URL as kh}from"@seatlayer/core/core/cdnAsset";function v(i,e){let t=Sl(i);return t===i?e:t}function De(){return globalThis.matchMedia?.("(pointer: coarse)").matches??!1?v("picker.dragToLookTouch","Drag to look \xB7 pinch to zoom \xB7 tap \u2715 to close"):v("picker.dragToLookMouse","Drag to look \xB7 pinch or scroll to zoom \xB7 Esc to close")}function gr(i,e){let t=e?i.toLocaleUpperCase(e):i.toLocaleUpperCase(),n=e?i.toLocaleLowerCase(e):i.toLocaleLowerCase();if(i!==t||t===n)return i;let r=[...n][0]??"";return(e?r.toLocaleUpperCase(e):r.toLocaleUpperCase())+n.slice(r.length)}function br(i){if(typeof i=="string"){let e=document.querySelector(i);if(!e)throw new Error(`seatmap: container "${i}" not found`);return e}if(!(i instanceof HTMLElement))throw new Error("seatmap: container must be a CSS selector or an HTMLElement");return i}function H(i){return String(i??"").replace(/[&<>"']/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[e])}function vr(i,e,t){let n=e.find(s=>Je(s))??null;if(i.replaceChildren(),!n)return i.textContent=t.slice(0,1).toUpperCase(),null;let r=document.createElement("img");return r.alt="",r.referrerPolicy="no-referrer",r.src=n,i.appendChild(r),n}var it=null;function Yt(){if(it!==null)return it;try{if(typeof document>"u")return it=!1;it=!!document.createElement("canvas").getContext("webgl2")}catch{it=!1}return it}function qi(i){return kl(i)}var xt=null;function St(){return xt||(xt=(typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?import(qi("seatlayer-view3d.mjs")):import("@seatlayer/core/view3d")).catch(e=>{throw xt=null,e}),xt)}function Xt(){(typeof navigator>"u"?void 0:navigator.connection)?.saveData||St().catch(()=>{})}async function Qt(){return typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?import(qi("seatlayer-panorama.mjs")):import("@seatlayer/core")}async function yr(){return typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?import(qi("seatlayer-checkout.mjs")):import("./hostedCheckout-W7QZWSOQ.js")}function wr(i){return i==="unavailable_for_event"||i==="payments_off_for_event"?i:"not_configured"}function Zt(i,e,t){let n={month:"short",day:"numeric",hour:"numeric",minute:"2-digit"},r=new Date(i);if(e)try{return r.toLocaleString(t,{...n,timeZone:e})}catch{}return r.toLocaleString(t,n)}async function Jt(i,e){let t=i.overlay.productionElements;if(!t?.some(r=>r.contentImageUrl))return i;let n=await Promise.all(t.map(async r=>{if(!r.contentImageUrl)return r;try{let s=await e(r.contentImageUrl);if(!s){let{contentImageUrl:o,...a}=r;return a}return{...r,runtimeContentImageUrl:s}}catch{let{contentImageUrl:s,...o}=r;return o}}));return{...i,overlay:{...i.overlay,productionElements:n}}}async function ei(i,e){if(i)try{let t=await e(i);return t?await(await fetch(t)).arrayBuffer():void 0}catch{return}}import{browserPanoramaConstraints as Tl,loadPanoramaImage as El,planPanoramaDelivery as Cl,schedulePanoramaUpgrade as Al}from"@seatlayer/core/view/panoramaDelivery";function ti(i){let{root:e,source:t,caption:n,real:r,closeLabel:s,dragHint:o,viewFromSeatLabel:a,real360Label:l,previewLabel:c,resolveAsset:p,onClose:d}=i,u=i.chrome??{},h=document.createElement("div");h.className="sl-view sl-mo-zoom",h.setAttribute("role","dialog"),h.setAttribute("aria-label",a),h.innerHTML='<div class="sl-view-head"><span class="sl-view-title"></span><span class="sl-view-cap"></span><button type="button" class="sl-view-x"><svg viewBox="0 0 24 24"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg></button></div><div class="sl-view-pano"><span class="sl-view-badge"></span><span class="sl-view-hint"></span></div>';let g=F=>h.querySelector(F)?.remove();u.title===!1?g(".sl-view-title"):h.querySelector(".sl-view-title").textContent=a,u.caption===!1?g(".sl-view-cap"):h.querySelector(".sl-view-cap").textContent=n,h.querySelector(".sl-view-x").setAttribute("aria-label",s),u.badge===!1?g(".sl-view-badge"):h.querySelector(".sl-view-badge").textContent=r?l:c,h.querySelector(".sl-view-hint").textContent=o,e.appendChild(h);let b=h.querySelector(".sl-view-pano"),w=Cl(t,Tl()),x=new AbortController;b.style.backgroundImage=`url(${JSON.stringify(w.initialUrl)})`;let y=()=>{};w.upgradeUrl&&(y=Al(()=>{p(w.upgradeUrl).then(F=>!F||x.signal.aborted?null:El(F,x.signal).then(()=>F)).then(F=>{!F||!h.isConnected||x.signal.aborted||(b.style.backgroundImage=`url(${JSON.stringify(F)})`)}).catch(()=>{})}));let m=70,A=35,_=1,k=b.clientHeight||1,M=b.clientWidth||1,L=-(k*(180/m)*2/2-M/2),C=0,D=()=>{let F=b.clientHeight||1,_i=F*(180/m)*_,Bn=Math.max(0,_i-F),Nn=Math.min(Bn/2,A/180*_i);C=Math.min(Nn,Math.max(-Nn,C)),b.style.backgroundSize=`auto ${_i}px`,b.style.backgroundPosition=`${L}px ${C-Bn/2}px`};D();let R=!1,N=0,te=0,j=F=>{R=!0,N=F.clientX,te=F.clientY,b.classList.add("drag"),b.setPointerCapture?.(F.pointerId)},In=F=>{R&&(L+=F.clientX-N,C+=F.clientY-te,N=F.clientX,te=F.clientY,D())},Dt=F=>{R=!1,b.classList.remove("drag"),b.releasePointerCapture?.(F.pointerId)},_n=F=>{F.preventDefault(),_=Math.min(2.4,Math.max(1,_+(F.deltaY<0?.12:-.12))),D()};b.addEventListener("pointerdown",j),b.addEventListener("pointermove",In),b.addEventListener("pointerup",Dt),b.addEventListener("pointercancel",Dt),b.addEventListener("wheel",_n,{passive:!1});let Ii=h.querySelector(".sl-view-x");Ii.addEventListener("click",d);let Dn=F=>{F.key==="Escape"&&(F.stopPropagation(),d())};return h.addEventListener("keydown",Dn),Ii.focus(),{element:h,dispose(){y(),x.abort(),b.removeEventListener("pointerdown",j),b.removeEventListener("pointermove",In),b.removeEventListener("pointerup",Dt),b.removeEventListener("pointercancel",Dt),b.removeEventListener("wheel",_n),h.removeEventListener("keydown",Dn),Ii.removeEventListener("click",d)}}}function Ml(i,e){if(!e)return{targetSeatId:null,previousSeatId:null,nextSeatId:null};let t=i.find(s=>s.id===e);if(!t?.rowId)return{targetSeatId:e,previousSeatId:null,nextSeatId:null};let n=i.filter(s=>s.rowId===t.rowId),r=n.findIndex(s=>s.id===e);return{targetSeatId:e,previousSeatId:r>0?n[r-1].id:null,nextSeatId:r>=0&&r+1<n.length?n[r+1].id:null}}var xr=6e4,ii=class{constructor(e){this.buyerView_="map";this.targetSeatId_=null;this.focusedSectionId_=null;this.navigationMode_="orbit";this.overlay=null;this.handle=null;this.generation=0;this.seatViewGeneration=0;this.seatViewElement=null;this.seatViewDispose=null;this.options=e}get buyerView(){return this.buyerView_}get targetSeatId(){return this.targetSeatId_}get focusedSectionId(){return this.focusedSectionId_}get seatPosition(){return Ml(this.options.seats(),this.targetSeatId_)}get navigationMode(){return this.navigationMode_}canOffer3D(){return this.options.enable3D?this.handle&&this.overlay?!0:!this.options.doc()||!Yt()?!1:this.options.seats().length<=this.max3DSeats():!1}canOfferSeatView(){return this.options.enableSeatView?this.options.seats().some(e=>!!e.viewUrl)?!0:this.hasStage():!1}async setBuyerView(e,t={}){if(e==="map"){this.exit3D();return}if(!this.canOffer3D())throw new Error("venue_3d_unavailable");if(this.buyerView_==="venue3d"&&this.handle){t.flyToSeatId?(this.targetSeatId_=t.flyToSeatId,this.focusedSectionId_=this.findSeat(t.flyToSeatId)?.sectionId??null,this.options.onViewChange(this.buyerView_,this.targetSeatId_),await this.handle.flyToSeat(t.flyToSeatId)):t.resetView&&this.handle.focusOverview();return}if(this.handle&&this.overlay){await this.restore3D(t);return}await this.enter3D(t.flyToSeatId)}async openSeatView(e){if(!this.canOfferSeatView())throw new Error("seat_view_unavailable");let t=this.findSeat(e),n=this.options.host(),r=this.options.doc();if(!t||!n||!r)throw new Error("seat_view_unavailable");let s=++this.seatViewGeneration,o,a,l=!1;if(t.viewUrl){let g=t.viewMeta?.previewUrl,b=!!g&&g!==t.viewUrl,w=b?await this.options.resolveAsset(g):null,x=b?t.viewUrl:await this.options.resolveAsset(t.viewUrl);if(s!==this.seatViewGeneration||!x||b&&!w)return;o={url:x,...w?{previewUrl:w}:{},...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=Ll(o),l=Pl(o)}else{if(!this.hasStage())throw new Error("seat_view_unavailable");let{generateSeatPanorama:g}=await Qt();if(s!==this.seatViewGeneration)return;let b=r.floors?.find(y=>y.objects.some(m=>m.type==="row"&&m.id===t.rowId)),w=t.focalPoint??b?.focalPoint??r.focalPoint,x=g(t,w,[...this.options.seats()]);o={url:x.url,generated:!0},a=nt("picker.illustrationCaption",{m:x.distanceM})}if(s!==this.seatViewGeneration)return;this.closeSeatView(!1),this.prepareHostTheme(n,r),tt();let c=this.options.chrome??{},p=De(),d=nt("picker.viewFromSeat",{label:t.displayLabel||t.label}),u=l?nt("picker.real360"):nt("picker.preview"),h=ti({root:n,source:o,caption:a,real:l,closeLabel:v("picker.close","Close"),dragHint:p,viewFromSeatLabel:d,real360Label:nt("picker.real360"),previewLabel:nt("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:d,caption:a,badge:u,real:l,generated:!!o.generated,dragHint:p})}pushLiveState(){this.handle&&(this.handle.setAvailability(this.options.seats().map(e=>({seatId:e.id,state:this.seatState(e)}))),this.handle.setSelection(this.options.selection().map(e=>e.id)))}focusOverview(){return this.buyerView_!=="venue3d"||!this.handle?!1:(this.handle.focusOverview(),!0)}focusSection(e){return this.buyerView_==="venue3d"?this.handle?.focusSection(e)??!1:!1}focusFloor(e){let t=this.options.doc();if(this.buyerView_!=="venue3d"||!this.handle||!t?.floors?.length)return!1;let n=t.floors.findIndex(r=>r.id===e);return n>=0&&this.handle.focusFloor(n)}zoomIn(){return this.buyerView_!=="venue3d"||!this.handle?!1:(this.handle.zoomIn(),!0)}zoomOut(){return this.buyerView_!=="venue3d"||!this.handle?!1:(this.handle.zoomOut(),!0)}setNavigationMode(e){return this.navigationMode_=e,this.buyerView_!=="venue3d"||!this.handle?!1:(this.handle.setNavigationMode(e),this.options.onViewChange(this.buyerView_,this.targetSeatId_),!0)}destroy(){this.generation+=1,this.closeSeatView(!0,!1);try{this.handle?.dispose()}catch{}this.handle=null,this.overlay?.remove(),this.overlay=null,this.buyerView_="map",this.targetSeatId_=null,this.focusedSectionId_=null}max3DSeats(){let e=this.options.max3DSeats;if(typeof e=="number"&&e>0)return e;let t=globalThis.navigator;return(t?.hardwareConcurrency??8)<=4||(t?.deviceMemory??8)<=4||(globalThis.matchMedia?.("(pointer: coarse)").matches??!1)?xr/2:xr}async enter3D(e){let t=this.options.host(),n=this.options.doc();if(!t||!n||this.overlay)throw new Error("venue_3d_unavailable");tt(),this.prepareHostTheme(t,n);let r=document.createElement("div");r.className="sl-view3d",r.setAttribute("role","group"),r.setAttribute("aria-label",v("picker.interactive3dVenueView","Interactive 3D venue view")),Object.assign(r.style,{position:"absolute",inset:"0",zIndex:"4",opacity:"0",touchAction:"none",transition:this.reducedMotion()?"none":"opacity 260ms cubic-bezier(.2,.8,.2,1)",background:"radial-gradient(120% 120% at 50% 0%,#191f28 0%,#0d1014 70%)"});let s=document.createElement("div");s.className="sl-view3d-loading",s.setAttribute("role","status"),s.setAttribute("aria-live","polite"),s.textContent=v("picker.loading3d","Building the 3D venue\u2026"),r.appendChild(s),t.appendChild(r),this.overlay=r;let o=++this.generation;if(this.reducedMotion()?r.style.opacity="1":requestAnimationFrame(()=>{r.style.opacity="1"}),await this.nextPaint(),!(o!==this.generation||this.overlay!==r))try{let[a,l]=await Promise.all([St(),this.options.loadEventConfiguration()]),c=l?await Jt(l,this.options.resolveAsset):null,p=await ei(n.theme?.venue3d?.shellAssetUrl,this.options.resolveAsset);if(o!==this.generation||this.overlay!==r)return;let d={doc:n,seats:[...this.options.seats()],...c?{eventConfigurationId:c.id,eventConfiguration:c}:{},...p?{registeredShellGlb:p}:{}};s.textContent=v("picker.building3d","Building venue geometry\u2026");let u=await a.prepareVenue3D(d);if(o!==this.generation||this.overlay!==r)return;let h=this.options.chrome??{},g=a.mountVenue3D(r,{...d,prepared:u},{portraitOverviewCrop:!0,arriveAtSeatEye:!0,lookAroundHint:De(),...h.view3dCaption===!1||h.view3dSeatStepper===!1||h.view3dControlDock===!1?{chrome:{caption:h.view3dCaption!==!1,seatStepper:h.view3dSeatStepper!==!1,controlDock:h.view3dControlDock!==!1}}:{},seatViewActionLabel:b=>this.findSeat(b)?.viewUrl?v("picker.openAuthored360","Open venue 360\xB0"):v("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(o!==this.generation||this.overlay!==r){g.dispose();return}this.handle=g,this.buyerView_="venue3d",this.targetSeatId_=e??null,this.focusedSectionId_=e?this.findSeat(e)?.sectionId??null:null,g.setNavigationMode(this.navigationMode_),requestAnimationFrame(()=>s.remove()),this.pushLiveState(),this.options.onViewChange("venue3d",this.targetSeatId_),e&&await g.flyToSeat(e)}catch(a){if(o!==this.generation)return;throw this.options.onError?.(a),this.remove3DOverlay(!1),a}}exit3D(){this.buyerView_==="map"&&!this.overlay||(this.generation+=1,this.buyerView_="map",this.targetSeatId_=null,this.focusedSectionId_=null,this.remove3DOverlay(!0,!!this.handle),this.options.onViewChange("map",null))}remove3DOverlay(e,t=!1){let n=this.handle,r=this.overlay;if(this.options.restoreMap(),t&&n&&r){r.style.pointerEvents="none";let s=()=>{this.buyerView_!=="map"||this.overlay!==r||(r.style.visibility="hidden",this.options.restoreMap())};!e||this.reducedMotion()?(r.style.opacity="0",s()):(requestAnimationFrame(()=>{r.style.opacity="0"}),setTimeout(s,280));return}if(this.handle=null,this.overlay=null,!r){try{n?.dispose()}catch{}this.options.restoreMap();return}if(!e||this.reducedMotion()){try{n?.dispose()}catch{}r.remove(),this.options.restoreMap();return}r.style.pointerEvents="none",requestAnimationFrame(()=>{r.style.opacity="0"}),setTimeout(()=>{try{n?.dispose()}catch{}r.remove(),this.options.restoreMap()},280)}async restore3D(e){let t=this.overlay,n=this.handle;if(!t||!n)throw new Error("venue_3d_unavailable");this.buyerView_="venue3d",this.targetSeatId_=e.flyToSeatId??null,this.focusedSectionId_=e.flyToSeatId?this.findSeat(e.flyToSeatId)?.sectionId??null:null,t.style.visibility="visible",t.style.pointerEvents="auto",this.reducedMotion()?t.style.opacity="1":requestAnimationFrame(()=>{t.style.opacity="1"}),n.resize(),n.setNavigationMode(this.navigationMode_),this.pushLiveState(),this.options.onViewChange("venue3d",this.targetSeatId_),e.flyToSeatId?await n.flyToSeat(e.flyToSeatId):e.resetView&&n.focusOverview()}nextPaint(){return this.reducedMotion()||typeof requestAnimationFrame!="function"?Promise.resolve():new Promise(e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))})}toggleSeat(e){if(!this.findSeat(e))return;this.options.selection().some(r=>r.id===e)?this.options.deselect(e):this.options.status(e)==="free"&&this.options.select(e),this.pushLiveState()}seatState(e){switch(this.options.status(e.id)){case"held":return"held";case"booked":return"sold";case"not_for_sale":return"dimmed";default:return"available"}}async seatViewFor3D(e){let t=this.findSeat(e);if(!t)throw new Error("seat_view_unavailable");if(t.viewUrl){let n=t.viewMeta?.previewUrl,r=!!n&&n!==t.viewUrl,s=r?await this.options.resolveAsset(n):null,o=r?t.viewUrl:await this.options.resolveAsset(t.viewUrl);if(!o||r&&!s)throw new Error("seat_view_unavailable");return{url:o,...s?{previewUrl:s}:{},...r?{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:v("picker.chartDerivedModel","Chart-derived model")}}closeSeatView(e=!0,t=!1){e&&(this.seatViewGeneration+=1);let n=this.seatViewElement;if(this.seatViewDispose?.(),this.seatViewDispose=null,this.seatViewElement=null,!!n){if(this.options.onSeatViewChange?.(null),!t||this.reducedMotion()){n.remove();return}n.classList.add("is-leaving"),setTimeout(()=>n.remove(),190)}}findSeat(e){return this.options.seats().find(t=>t.id===e||t.label===e)}hasStage(){let e=this.options.doc();return e?(e.floors?.flatMap(n=>n.objects)??e.objects).some(n=>n.type==="shape"&&(n.role==="stage"||!!n.stageKind)):!1}prepareHostTheme(e,t){getComputedStyle(e).position==="static"&&(e.style.position="relative");let n=t.theme;e.style.setProperty("--sl-bg",n?.background??"#f6f7fb"),e.style.setProperty("--sl-surface","#ffffff"),e.style.setProperty("--sl-text",n?.textColor??"#10162a"),e.style.setProperty("--sl-muted","#697386"),e.style.setProperty("--sl-line","#d9deea"),e.style.setProperty("--sl-accent",n?.accent??"#ef4056"),e.style.setProperty("--sl-accent-ink",n?.accentInk??"#ffffff")}reducedMotion(){return globalThis.matchMedia?.("(prefers-reduced-motion: reduce)").matches??!1}};var Hl={host:"web",platform:"web",bundle:"",protocol:0,chromeOwner:"web"},Rl={...Hl},ni=null,Sr=null;function Ol(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():0}function Il(){let i=e=>Math.max(0,Math.round(e*100)/100);return{bootMs:i(Ol()),documentMs:ni==null?0:i(ni),handshakeMs:ni==null||Sr==null?0:i(Sr-ni)}}function kr(){let{host:i,platform:e,bundle:t,protocol:n,chromeOwner:r}=Rl,s=Il();return{host:i,platform:e,...t?{bundle:t}:{},...n?{protocol:n}:{},chromeOwner:r,bootMs:s.bootMs,documentMs:s.documentMs,handshakeMs:s.handshakeMs}}var Tr=new Set;function Me(i){return Tr.has(i)?"repeat":"cold"}function ri(i){let e=Me(i);return Tr.add(i),e}function ne(i){return typeof i=="number"&&Number.isFinite(i)&&i>=0?Math.round(i):0}function _l(){return typeof location>"u"?!1:/^(localhost|127\.0\.0\.1|\[::1\])$/i.test(location.hostname)}function Dl(i){if(!/^[A-Za-z0-9_-]{1,80}$/.test(i.event))return null;let e=i.performanceProfile??{};return{event:i.event,scope:i.scope,surface:i.surface,outcome:i.outcome,stage:i.stage?.slice(0,32)??"",ms:ne(i.ms),api:ne(e.loadChartAndStatuses)||ne(e.loadChart),scene:ne(e.buildScene),panel:ne(e.buildBuyerControls),paint:ne(e.firstPaint),normalize:ne(e.normalizeBuyerModel),renderer:ne(e.createRenderer),seats:ne(i.seats),floors:ne(i.floors),view:i.view??"map",load:i.load??Me(i.event),transport:i.transport??"pubapi",chartBytes:ne(i.chartDelivery?.bytes),chartCache:i.chartDelivery?.cache??"",...kr(),availabilityMs:ne(e.loadStatuses)}}var Bl=new Set;function xe(i){let e=Dl(i);if(e){for(let t of Bl)try{t(e)}catch{}typeof fetch>"u"||_l()||fetch(`${i.apiBase.replace(/\/+$/,"")}/pub/telemetry/chart-load`,{method:"POST",headers:{"Content-Type":"application/json","X-SeatLayer-Client":"1"},body:JSON.stringify(e),credentials:"omit",keepalive:!0}).catch(()=>{})}}function kt(i){if(!i)return null;let e=i.getBoundingClientRect();return e.width>0&&e.height>0?e:null}function Nl(i){return kt(i.peek?.querySelector(".sl-peek-sum"))??kt(i.foot?.querySelector(".sl-total"))??kt(i.tray)??kt(i.sheetHead)}function Ki(i,e,t,n){let r=i,s=r.map;if(!s||!e)return;let o=s.getBoundingClientRect(),a={x:o.left+e.x,y:o.top+e.y},l=t.displayLabel??t.label,c=n?.find(d=>d.key===t.categoryKey)?.color,p=()=>{let d=Nl(r);d&&Jn({from:a,to:{x:d.left+d.width/2,y:d.top+d.height/2},label:l,color:c})};kt(r.peek)?requestAnimationFrame(p):p()}var Ui=60,Fl=650;function Er(i,e){if(!e.length||i.focusSeats?.(e.map(r=>r.id)))return;let t=e.find(r=>r.sectionId)?.sectionId;if(!t)return;let n=e.filter(r=>r.sectionId===t);i.focus(t,{x:n.reduce((r,s)=>r+s.x,0)/n.length,y:n.reduce((r,s)=>r+s.y,0)/n.length})}function Cr(i,e){let t=!Gt();Er({focusSeats:n=>i.focusSeats?.(n,{animate:t})===!0,focus:(n,r)=>i.focusSection(n,r)},(e?.items??[]).filter(n=>n.objectType!=="ga").slice(0,10).map(n=>i.seatByLabel(n.label)).filter(n=>!!n))}function Ar(i,e){if(!e.length)return;let t=i.reducedMotion===!0;t||e.forEach((o,a)=>{i.schedule(()=>i.pop(o.id),a*Ui)});let n=t?0:e.length*Ui,r=e.find(o=>o.sectionId)?.sectionId;if(i.schedule(()=>Er(i,e),n),t)return;let s=n+(i.focusSeats||r?Fl:0);e.forEach((o,a)=>{i.schedule(()=>Ki(i.regions,i.screenPoint(o),o,i.categories),s+a*Ui)})}function Vl(i,e,t){for(let n of i)if(e>=n.x&&t>=n.y&&e<=n.x+n.w&&t<=n.y+n.h)return!0;return!1}var si=class{constructor(){this.rects=[];this.host=null;this.pointers=new Set;this.touches=new Set;this.mouseDown=!1;this.onPointerDown=e=>{this.inside(e.clientX,e.clientY)&&(this.pointers.add(e.pointerId),this.swallow(e))};this.onPointerFollow=e=>{this.pointers.has(e.pointerId)&&this.swallow(e)};this.onPointerEnd=e=>{this.pointers.delete(e.pointerId)&&this.swallow(e)};this.onTouchStart=e=>{let t=this.changed(e);if(!t.length)return;let n=!0;for(let r of t)this.inside(r.clientX,r.clientY)?this.touches.add(r.identifier):n=!1;n&&this.swallow(e)};this.onTouchFollow=e=>{let t=this.changed(e);t.length&&t.every(n=>this.touches.has(n.identifier))&&this.swallow(e)};this.onTouchEnd=e=>{let t=this.changed(e);if(!t.length)return;let n=t.every(r=>this.touches.has(r.identifier));for(let r of t)this.touches.delete(r.identifier);n&&this.swallow(e)};this.onMouseDown=e=>{this.inside(e.clientX,e.clientY)&&(this.mouseDown=!0,this.swallow(e))};this.onMouseFollow=e=>{this.mouseDown&&this.swallow(e)};this.onMouseUp=e=>{this.mouseDown&&(this.mouseDown=!1,this.swallow(e))};this.onClick=e=>{this.inside(e.clientX,e.clientY)&&this.swallow(e)}}set(e){this.rects=e.map(t=>({x:t.x,y:t.y,w:t.w,h:t.h})),this.rects.length||(this.pointers.clear(),this.touches.clear(),this.mouseDown=!1)}get(){return this.rects}attach(e){if(this.host===e)return;this.detach(),this.host=e;let t={capture:!0,passive:!1};e.addEventListener("pointerdown",this.onPointerDown,t),e.addEventListener("pointermove",this.onPointerFollow,t),e.addEventListener("pointerup",this.onPointerEnd,t),e.addEventListener("pointercancel",this.onPointerEnd,t),e.addEventListener("touchstart",this.onTouchStart,t),e.addEventListener("touchmove",this.onTouchFollow,t),e.addEventListener("touchend",this.onTouchEnd,t),e.addEventListener("touchcancel",this.onTouchEnd,t),e.addEventListener("mousedown",this.onMouseDown,t),e.addEventListener("mousemove",this.onMouseFollow,t),e.addEventListener("mouseup",this.onMouseUp,t),e.addEventListener("click",this.onClick,t),e.addEventListener("dblclick",this.onClick,t)}detach(){let e=this.host;if(!e)return;let t={capture:!0};e.removeEventListener("pointerdown",this.onPointerDown,t),e.removeEventListener("pointermove",this.onPointerFollow,t),e.removeEventListener("pointerup",this.onPointerEnd,t),e.removeEventListener("pointercancel",this.onPointerEnd,t),e.removeEventListener("touchstart",this.onTouchStart,t),e.removeEventListener("touchmove",this.onTouchFollow,t),e.removeEventListener("touchend",this.onTouchEnd,t),e.removeEventListener("touchcancel",this.onTouchEnd,t),e.removeEventListener("mousedown",this.onMouseDown,t),e.removeEventListener("mousemove",this.onMouseFollow,t),e.removeEventListener("mouseup",this.onMouseUp,t),e.removeEventListener("click",this.onClick,t),e.removeEventListener("dblclick",this.onClick,t),this.host=null,this.pointers.clear(),this.touches.clear(),this.mouseDown=!1}inside(e,t){if(!this.rects.length||!this.host)return!1;let n=this.host.getBoundingClientRect();return Vl(this.rects,e-n.left,t-n.top)}swallow(e){e.stopImmediatePropagation(),e.stopPropagation(),e.cancelable&&e.preventDefault()}changed(e){let t=e.changedTouches;return t?Array.from(t):[]}},Pr=.48,$l=8;function zl(i,e,t,n=Pr){let r=Math.max(0,t.top),s=e.height-Math.max(0,t.bottom);if(!(s>r))return 0;let o=Number.isFinite(n)?Math.min(1,Math.max(0,n)):Pr,a=r+(s-r)*o-i;return Math.abs(a)<=$l?0:Math.round(a)}function Lr(i,e,t={}){let n=i.gestureCount();if(t.gestures!==void 0&&t.gestures!==n)return{dy:0,gestures:n};let r=i.seatPoint(e);if(!r)return{dy:0,gestures:n};let s=zl(r.y,{height:i.mapHeight()},i.insets(),t.fraction);return s?{dy:i.panScreenBy({x:0,y:s},t.animate!==!1)?s:0,gestures:n}:{dy:0,gestures:n}}var Tt=class i{constructor(e,t=null){this.seams=e;this.watch=null;this.mode=t,this.watchMode()}themeMode(){return this.mode}setThemeMode(e,t){let n=t!==void 0&&"mapTheme"in t;e===this.mode&&!n||(n&&this.seams.setHostMapTheme(t.mapTheme??void 0),this.mode=e,this.watchMode(),this.applyThemeMode())}static groundFor(e){return qe(null,e)}applyThemeMode(){let e=this.seams.mapTheme()??i.groundFor(this.mode);this.seams.applyMapTheme(e??null)&&this.seams.changed()}watchMode(){this.watch?.(),this.watch=null,this.mode==="auto"&&(this.watch=Nt(()=>this.applyThemeMode()))}setViewportInsets(e){this.seams.applyViewportInsets(e),this.seams.changed()}viewportInsets(){return this.seams.readViewportInsets()}dispose(){this.watch?.(),this.watch=null}};import{getLocale as ql}from"@seatlayer/core";import{seatConfidenceDisclosure as Ul}from"@seatlayer/core/core/seatConfidence";import{generateSeatThumb as jl}from"@seatlayer/core";function rt(i){let e=i.viewMeta?.previewUrl??i.viewUrl;return e&&(Gi(e)||Je(e))?e:null}function ai(i){if(!i)return!1;let e=i.floors?.length?i.floors.map(t=>t.objects??[]):[i.objects??[]];for(let t of e)for(let n of t)if(n.type==="shape"&&(n.role==="stage"||n.stageKind))return!0;return!1}var Gl=512,oi=new Map;function li(i,e){if(!e)return null;let t=`${i.id}|${Math.round(e.x)},${Math.round(e.y)}`,n=oi.get(t);if(n!==void 0)return n;let r=null;try{r=jl(i,e).distanceM??null}catch{r=null}return oi.size>=Gl&&oi.clear(),oi.set(t,r),r}function Et(i){return i.getFocusedSection()!==null||i.seatsRevealed()}function Kl(i,e){return{accessibilityFilter:i.length>0,limitedViewFilter:e.some(t=>t.commercial?.restrictedView||t.commercial?.obstructedView)}}function Wl(i,e,t,n){for(let r of e){if(r.count<=0)continue;let s=i.accessibilitySpread?.([r.key]);for(let o of s?.sections??[]){let a=t.get(o.id)??n.get(o.id);if(!a||o.free<=0)continue;let l=a.accessibleFree??(a.accessibleFree={});l[r.key]=o.free}}}function Mr(i,e,t){let n=i.doc,r=n?.theme??{},s=i.categoryAvailability(),o=i.getGAAreas(),a=i.getFloors(),l=i.getExpandedSeats(),c=i.getAccessNeeds(),p=Kl(c,l),d=e.seatPosition,u=d.targetSeatId?i.seatDetails(d.targetSeatId):null,h=new Map(l.map(y=>[y.id,y])),g=ai(n),b=n?.floors?.flatMap(y=>y.objects)??n?.objects??[],w=new Map,x=new Map;for(let y of b){if(y.type!=="section")continue;let m={id:y.id,label:y.label,...y.displayLabel?{displayLabel:y.displayLabel}:{},...y.zone?{zoneId:y.zone}:{}};w.set(y.id,m);let A=y.logicalSectionId??y.id;x.has(A)||x.set(A,m)}return Wl(i,c,w,x),{event:{key:t.event,name:t.eventInfo?.name??n?.name??t.event,venue:t.eventInfo?.venue??null,startsAt:t.eventInfo?.startsAt??null,timezone:t.eventInfo?.timezone??null,currency:t.eventInfo?.currency??t.currency??"USD",locale:ql()||t.eventLocale,posterUrl:t.eventInfo?.posterUrl??null,mode:t.mode_??"live",salesClosed:t.eventInfo?.salesClosed??!1},branding:{...r.accent?{accent:r.accent}:{},...r.accentInk?{accentInk:r.accentInk}:{},...r.background?{background:r.background}:{},...r.textColor?{textColor:r.textColor}:{},...r.brandName?{brandName:r.brandName}:{},...r.logoUrl?{logoUrl:r.logoUrl}:{},attributionRequired:!r.hideBadge},features:{ga:o.length>0,tiers:!!n?.categories.some(y=>y.tiers?.length),floors:a.length>1,zones:!!n?.zones?.length,sections:w.size>0,bestAvailable:!0,...p,venue3d:e.canOffer3D(),seatView:e.canOfferSeatView()},catalog:{categories:(n?.categories??[]).filter(y=>!y.notForSale).map(y=>({key:y.key,label:y.label,color:y.color,price:y.price??y.tiers?.[0]?.price??0,available:s[y.key]??0,...Object.prototype.hasOwnProperty.call(s,y.key)?{free:s[y.key]}:{},tiers:(y.tiers??[]).map(m=>({id:m.id,name:m.name,price:m.price,...m.currency?{currency:m.currency}:{}}))})),zones:(n?.zones??[]).map(y=>({id:y.id,label:y.label,...y.color?{color:y.color}:{}})),sections:[...w.values()],gaAreas:o,bestAvailableZones:i.getBestAvailableZones()},map:{floors:a,activeFloorId:i.getActiveFloorId()||a[0]?.id||null,floorMode:i.isFloorOverview()?"all":"single",floorLabelStyle:i.getRenderer()?.getFloorLabelStyle?.()??"number",rung:i.getRung(),canZoomOut:Et(i)||t.focusedSection_!==null,focusedSectionId:i.getFocusedSection(),focusedSection:t.focusedSection_,viewMode:i.getViewMode(),buyerView:e.buyerView,view3dTargetSeatId:d.targetSeatId,view3dTargetSeat:u,view3dPreviousSeatId:d.previousSeatId,view3dNextSeatId:d.nextSeatId,view3dFocusedSectionId:e.focusedSectionId,view3dNavigationMode:e.navigationMode,colorblindSafe:t.colorblindSafe_,viewportInsets:i.getViewportInsets(),categoryFilter:t.categoryFilter_?[...t.categoryFilter_]:null,accessibilityFilter:t.accessibilityFilter_?[...t.accessibilityFilter_]:null,hideLimitedView:t.hideLimitedView_,accessNeeds:c},selection:{seats:i.getSelection().map(y=>{let m=h.get(y.id);if(!m)return y;let A=i.worldToScreen({x:m.x,y:m.y}),_=rt(m),k=g?li(m,m.focalPoint??n?.focalPoint):null;return{...y,screenPoint:{x:A.x,y:A.y},..._?{seatViewThumb:{reference:_,kind:"real"}}:{},...k!=null?{sightlineMetres:k}:{},...m.confidenceEvidence?{seatViewConfidence:Ul(m.confidenceEvidence)}:{}}}),validity:i.getSelectionValidity(),maxSelection:t.maxSelection_},access:{...t.accessState_}}}var ic="https://api.seatlayer.io",Hr=10;function nc(i){if(typeof i=="string"){let e=document.querySelector(i);if(!e)throw new Error(`seatmap: container "${i}" not found`);return e}if(!(i instanceof HTMLElement))throw new Error("seatmap: container must be a CSS selector or an HTMLElement");return i}var Yi=class{constructor(e){this.mount=null;this.hostEl=null;this.interactionEnabled_=!0;this.eventLocale=null;this.localeGeneration=0;this.languageSelect=null;this.rendered=!1;this.mode_=null;this.eventInfo=null;this.categoryFilter_=null;this.accessibilityFilter_=null;this.hideLimitedView_=!1;this.focusedSection_=null;this.lastReportedViewRung_=null;this.lastReportedCanZoomOut_=!1;this.tipEl=null;this.tipPos={x:0,y:0};this.onTipMove=null;this.blockedRegions=null;this.realtime=null;this.holdingLabels=new Set;if(!e||typeof e!="object")throw new Error("seatmap: options object is required");if(!e.container)throw new Error("seatmap: `container` is required");if(!e.event||typeof e.event!="string")throw new Error("seatmap: `event` key is required");this.opts=e,this.maxSelection_=e.maxSelection??Hr,this.colorblindSafe_=e.colorblindSafe??!1;let t=!!(e.buyerAccessTokenProvider||e.buyerAccessToken||e.publicKey);this.accessState_={configured:t,status:t?"ready":"public"},this.publicKey=e.publicKey;let n={onExpired:a=>{this.accessState_={configured:!0,status:a.refreshed?"ready":"expired"},this.opts.onAccessExpired?.(a),this.notifyMapStateChange()},onUnavailable:a=>{this.accessState_={configured:!0,status:"unavailable",reason:a.reason},this.opts.onAccessUnavailable?.(a),this.notifyMapStateChange()}},r=(e.apiBase??ic).replace(/\/+$/,"");this.apiBase=r;let s=e.publicKey&&!e.buyerAccessTokenProvider&&!e.buyerAccessToken?jt({base:r,event:e.event,publicKey:e.publicKey,accessHooks:n,apiOptions:{onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)}}):null;this.access=s?.access??yt(e,n);let o=s?.api??new Ae(r,{access:this.access??void 0,onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)});this.api=o,this.controller=new Yl({transport:o,eventKey:e.event,maxSelection:this.maxSelection_,selectedObjects:e.selectedObjects,selectableObjects:e.selectableObjects,numberOfPlacesToSelect:e.numberOfPlacesToSelect,selectionValidators:e.selectionValidators,currency:e.currency,onSelectionChange:a=>{this.immersive?.pushLiveState(),this.opts.onSelectionChange?.(a)},onSelectionValidityChange:a=>this.opts.onSelectionValidityChange?.(a),onSelectionValid:a=>this.opts.onSelectionValid?.(a),onSelectionInvalid:a=>this.opts.onSelectionInvalid?.(a),onDeselect:a=>{this.controller.currentHold()?.labels.includes(a.label)&&this.controller.releaseLabels([a.label])},retapKeepsSelection:!0,onSeatRetap:a=>this.opts.onSeatRetap?.(a),onSelectionLimit:a=>this.opts.onSelectionLimit?.(a),onHold:a=>this.opts.onHold?.({holdId:a.holdId,expiresAt:a.expiresAt,seats:a.seats,items:a.items}),onHoldRestored:a=>this.opts.onHoldRestored?.({holdId:a.holdId,expiresAt:a.expiresAt,seats:a.seats,items:a.items}),onHoldExpired:()=>this.opts.onHoldExpired?.(),onGAClick:a=>{let l=this.controller.getGAAreas().find(c=>c.id===a);l&&(this.opts.onGAClick?.(l),this.opts.onGAPrompt?.({area:l,selected:{},min:0,max:Math.max(0,Math.min(l.available,(this.opts.maxSelection??Hr)-this.controller.getSelection().length)),tiers:Kt(l),confirm:c=>{let p=typeof c=="number"?c:Object.values(c).reduce((d,u)=>d+u,0);this.holdGA(l.id,p)},cancel:()=>{}}))},onError:a=>this.opts.onError?.(a),onDeckTap:a=>{this.opts.onDeckTap?.(a),this.notifyMapStateChange()},onHint:a=>this.opts.onHint?.(a),onSectionFocus:a=>{this.focusedSection_=a,this.opts.onSectionFocus?.(a),this.notifyMapStateChange()},onViewChange:()=>this.handleViewChange(),onStatusChange:()=>{this.immersive?.pushLiveState(),this.opts.onStatusChange?.()},onSalesClosed:()=>{this.eventInfo&&(this.eventInfo.salesClosed=!0),this.opts.onSalesClosed?.()},flashOnLiveChange:!0,onSeatHover:a=>{this.opts.onSeatHover?.(a),this.opts.seatTooltip!==!1&&this.updateTooltip(a)},colorblindSafe:e.colorblindSafe,mapTheme:e.mapTheme??Tt.groundFor(e.theme?.mode)??null}),this.hostSurface=new Tt({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 et(e.event,(a,l)=>o.asset(a,l)),this.immersive=new ii({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_=Et(this.controller)}handleViewChange(){this.opts.onViewChange?.();let e=this.controller.getRung(),t=Et(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_=Et(this.controller),this.opts.onMapStateChange?.()}async render(){if(this.rendered)return this;let e=performance.now();this.rendered=!0;let t=Vt(this.opts.locale,this.opts.messages),n=this.localeGeneration+=1,r=Wi();this.mount=nc(this.opts.container);let s=document.createElement("div");s.style.width="100%",s.style.height="100%",s.style.position="relative",this.mount.appendChild(s),this.hostEl=s,this.blockedRegions?.attach(s),$t(s,t,a=>{a!==r&&this.applyActiveLocale(a,n)}),this.applyInteractionState();let o=await this.controller.render(s);if(!o)return xe({apiBase:this.apiBase,event:this.opts.event,scope:"event",surface:"seating_chart",outcome:"failure",stage:"load_chart",ms:performance.now()-e,load:Me(this.opts.event),transport:"pubapi"}),this.rendered=!1,this.opts.errorDisplay!=="none"&&this.showLoadFailure(s),this;if(this.eventLocale=o.locale??null,!this.opts.locale&&this.eventLocale&&this.setLocale(this.eventLocale),this.buildLanguageSwitcher(s),this.controller.setViewMode(this.opts.initialView??"flat"),this.opts.floorLabelStyle&&this.setFloorLabelStyle(this.opts.floorLabelStyle),this.startRealtime(),this.mode_=o.mode==="test"?"test":"live",this.eventInfo={name:o.eventName,venue:o.venue??null,startsAt:o.startsAt??null,timezone:o.timezone??null,currency:o.currency??this.opts.currency??"USD",posterUrl:o.posterUrl??null,salesClosed:o.salesClosed},this.opts.seatTooltip!==!1){let a=document.createElement("div");a.setAttribute("role","tooltip"),a.style.cssText='position:absolute;z-index:7;pointer-events:none;display:none;max-width:240px;background:#10162a;color:#fff;border-radius:10px;padding:9px 12px;font:500 12px/1.45 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;box-shadow:0 10px 30px -10px rgba(0,0,0,.5);',s.appendChild(a),this.tipEl=a,this.onTipMove=l=>{let c=s.getBoundingClientRect();this.tipPos={x:l.clientX-c.left,y:l.clientY-c.top},this.tipEl&&this.tipEl.style.display!=="none"&&this.placeTooltip()},s.addEventListener("mousemove",this.onTipMove)}if(o.mode==="test"&&this.opts.showTestModeIndicator!==!1){s.style.overflow="hidden";let a=document.createElement("div");a.dataset.slI18n="testMode",a.textContent=le("picker.testMode"),a.setAttribute("aria-label",le("picker.testMode")),a.style.cssText="position:absolute;top:18px;right:-34px;z-index:6;transform:rotate(45deg);width:140px;text-align:center;padding:4px 0;background:#f4b740;color:#1a1200;font:800 10.5px/1.4 -apple-system,BlinkMacSystemFont,sans-serif;letter-spacing:.12em;box-shadow:0 2px 8px rgba(0,0,0,.25);pointer-events:none;",s.appendChild(a)}return this.opts.showAttribution!==!1&&this.buildBadge(s),xe({apiBase:this.apiBase,event:this.opts.event,scope:"event",surface:"seating_chart",outcome:"success",ms:performance.now()-e,performanceProfile:o.performanceProfile,chartDelivery:o.chartDelivery,seats:this.controller.getExpandedSeats().length,floors:this.controller.getFloors().length,view:"map",load:ri(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",le("picker.poweredBy")),t.style.cssText='position:absolute;bottom:10px;right:12px;z-index:5;display:inline-flex;align-items:center;gap:6px;padding:5px 9px;border-radius:999px;background:rgba(255,255,255,.92);color:#4a5163;text-decoration:none;font:600 11px/1 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;letter-spacing:.02em;box-shadow:0 2px 8px rgba(0,0,0,.12);';let n=document.createElement("span");n.setAttribute("aria-hidden","true"),n.style.cssText="width:16px;height:16px;border-radius:4px;flex:none;display:flex;align-items:center;justify-content:center;background:#0c1220;color:#fcf7ee",n.innerHTML=Wt;let r=document.createElement("span");r.textContent=le("picker.poweredBy"),t.append(n,r),e.appendChild(t)}placeTooltip(){if(!this.tipEl||!this.hostEl)return;let e=this.hostEl.clientWidth,t=this.tipEl.offsetWidth,n=this.tipEl.offsetHeight,r=this.tipPos.x+14,s=this.tipPos.y-n-12;r+t>e-8&&(r=this.tipPos.x-t-14),s<8&&(s=this.tipPos.y+18),this.tipEl.style.left=`${Math.max(8,r)}px`,this.tipEl.style.top=`${Math.max(8,s)}px`}updateTooltip(e){if(!this.tipEl)return;if(!e){this.tipEl.style.display="none";return}let t=Xl(e.price,e.currency,{...Number.isInteger(e.price)?{minimumFractionDigits:0,maximumFractionDigits:0}:{},locale:this.opts.locale,fallback:(l,c)=>`${l} ${c}`}),n=document.createElement("div");n.style.cssText="font-weight:700;font-size:13px",n.textContent=e.label;let r=document.createElement("div");r.style.cssText="display:flex;align-items:center;gap:6px;margin-top:4px;color:#c7cddc";let s=document.createElement("span");s.style.cssText="width:9px;height:9px;border-radius:50%;flex:none",s.style.background=e.categoryColor;let o=document.createElement("span");o.textContent=e.categoryLabel;let a=document.createElement("span");if(a.style.cssText="margin-left:auto;font-weight:700;color:#fff",a.textContent=t,r.append(s,o,a),this.tipEl.replaceChildren(n,r),e.status!=="free"){let l=document.createElement("div");l.style.cssText="margin-top:5px;font-size:10.5px;letter-spacing:.08em;text-transform:uppercase;color:#fca5a5;font-weight:700",l.textContent=e.status==="held"?le("map.statusHeld"):le("map.statusTaken"),this.tipEl.appendChild(l)}this.tipEl.style.display="block",this.placeTooltip()}buildLanguageSwitcher(e){let t=(this.opts.languages??[]).map(r=>ec(r)).filter((r,s,o)=>o.indexOf(r)===s);if(t.length<2)return;let n=document.createElement("select");n.setAttribute("aria-label",le("picker.preferredTicketType")),n.style.cssText='position:absolute;bottom:10px;left:12px;z-index:5;appearance:none;padding:5px 9px;border-radius:999px;border:0;cursor:pointer;background:rgba(255,255,255,.92);color:#4a5163;font:600 11px/1 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;box-shadow:0 2px 8px rgba(0,0,0,.12);';for(let r of t){let s=document.createElement("option");s.value=r,s.textContent=Jl[r]??r,s.selected=r===Wi(),n.appendChild(s)}n.addEventListener("change",()=>{this.setLocale(n.value)}),e.appendChild(n),this.languageSelect=n}async setLocale(e){let t=Wi(),n=this.localeGeneration+=1,r=await Ql(e);return this.opts.messages&&tc(this.opts.messages),r===t||this.applyActiveLocale(r,n),r}applyActiveLocale(e,t){if(t!==this.localeGeneration)return;let n=this.hostEl;if(n){n.lang=e,n.dir=Zl(e);for(let r of n.querySelectorAll("[data-sl-i18n]"))if(r.dataset.slI18n==="testMode")r.textContent=le("picker.testMode"),r.setAttribute("aria-label",le("picker.testMode"));else if(r.dataset.slI18n==="badge"){r.setAttribute("aria-label",le("picker.poweredBy"));let s=r.querySelector("span:last-child");s&&(s.textContent=le("picker.poweredBy"))}this.languageSelect&&this.languageSelect.value!==e&&(this.languageSelect.value=e),this.controller.refreshMapCopy()}}getMode(){return this.mode_}getPickerState(){return Mr(this.controller,this.immersive,{event:this.opts.event,currency:this.opts.currency,mode_:this.mode_,eventInfo:this.eventInfo,eventLocale:this.eventLocale,focusedSection_:this.focusedSection_,colorblindSafe_:this.colorblindSafe_,categoryFilter_:this.categoryFilter_,accessibilityFilter_:this.accessibilityFilter_,hideLimitedView_:this.hideLimitedView_,maxSelection_:this.maxSelection_,accessState_:this.accessState_})}getCategoryAvailability(){return this.controller.categoryAvailability()}getBestAvailableZones(){return this.controller.getBestAvailableZones()}getActiveFloorId(){return this.controller.getActiveFloorId()||null}getRung(){return this.controller.getRung()}getFocusedSection(){return this.controller.getFocusedSection()}focusSection(e){if(this.immersive.buyerView==="venue3d"&&this.immersive.focusSection(e)){this.notifyMapStateChange();return}this.controller.focusSection(e),this.notifyMapStateChange()}overview(){if(this.immersive.focusOverview()){this.notifyMapStateChange();return}this.controller.overview(),this.notifyMapStateChange()}setRung(e){this.controller.setRung(e),this.notifyMapStateChange()}setCategoryFilter(e,t=!1){this.categoryFilter_=e?[...e]:null,this.controller.setCategoryFilter(e),t&&this.controller.focusCategoryFilter(e),this.notifyMapStateChange()}setAccessibilityFilter(e){this.accessibilityFilter_=e?[...e]:null,this.controller.setAccessibilityFilter(e),this.notifyMapStateChange(),e?.length&&this.focusAccessibilityFilter()}focusAccessibilityFilter(){this.controller.focusAccessibilityFilter?.(),this.notifyMapStateChange()}focusNextAccessibleSection(e){let t=this.controller.focusNextAccessibleSection?.(e)??null;return t&&this.notifyMapStateChange(),t}setCommercialLimitedFilter(e){this.hideLimitedView_=e,this.controller.setCommercialLimitedFilter(e),this.notifyMapStateChange()}getSelection(){return this.controller.getSelection()}selectObjects(e){let t=this.controller.select(e);return this.immersive.pushLiveState(),t}deselectObjects(e){this.controller.deselect(e),this.immersive.pushLiveState()}clearSelection(){this.controller.clearSelection(),this.immersive.pushLiveState()}selectCategories(e){return this.controller.selectCategories(e)}deselectCategories(e){this.controller.deselectCategories(e)}setSelectableObjects(e){this.controller.setSelectableObjects(e)}setMaxSelection(e){this.maxSelection_=e,this.controller.setMaxSelection(e),this.notifyMapStateChange()}getSelectionValidity(){return this.controller.getSelectionValidity()}async hold(e={}){try{return await this.holdOrThrow(e)}catch(t){return this.opts.onError?.(t),null}}async holdOrThrow(e={}){let t=this.controller.getSelectionValidity();if(t&&!t.isValid){let n=t.violations.includes("numberOfPlacesToSelect");throw Object.assign(new Error(n?`seatmap: select exactly ${t.required} places before holding`:"seatmap: adjust the ticket selection before holding"),{code:n?"selection_count_mismatch":"selection_invalid",selection:t})}this.holdingLabels=new Set(this.controller.getSelection().map(n=>n.label));try{let n=await this.controller.hold(void 0,e.ttlMs);return n?{holdId:n.holdId,expiresAt:n.expiresAt,seats:n.seats,items:n.items}:null}finally{this.holdingLabels.clear()}}async resumeHold(e){try{return await this.resumeHoldOrThrow(e)}catch(t){return this.opts.onError?.(t),null}}async resumeHoldOrThrow(e){let t=await this.controller.resumeHold(e);return t?{holdId:t.holdId,expiresAt:t.expiresAt,seats:t.seats,items:t.items}:null}async extendHold(e){try{let t=await this.controller.extendHold(e);return t?{holdId:t.holdId,expiresAt:t.expiresAt,seats:t.seats,items:t.items}:null}catch(t){return this.opts.onError?.(t),null}}getCurrentHold(){let e=this.controller.currentHold();return e?{holdId:e.holdId,expiresAt:e.expiresAt,seats:e.seats,items:e.items}:null}getGAAreas(){return this.controller.getGAAreas()}async holdGA(e,t,n={}){try{return await this.holdGAOrThrow(e,t,n)}catch(r){return this.opts.onError?.(r),null}}async holdGAOrThrow(e,t,n={}){let r=await this.controller.holdGA(e,t,n);return r?{holdId:r.holdId,expiresAt:r.expiresAt,seats:r.seats,items:r.items}:null}async bestAvailable(e,t,n={}){try{return await this.bestAvailableOrThrow(e,t,n)}catch(r){return this.opts.onError?.(r),null}}async bestAvailableOrThrow(e,t,n={}){let r=await this.controller.bestAvailable(e,t,n);return Cr(this.controller,r),r?{holdId:r.holdId,expiresAt:r.expiresAt,labels:r.labels,seats:r.seats,items:r.items,...n.zoneId?{zoneId:n.zoneId}:{}}:null}setSeatTier(e,t){this.controller.setSeatTier(e,t)}setTableQuantity(e,t){return this.controller.setTableQuantity(e,t)}async replaceTableQuantity(e,t,n){try{return await this.replaceTableQuantityOrThrow(e,t,n)}catch(r){return this.opts.onError?.(r),null}}async replaceTableQuantityOrThrow(e,t,n){let r=await this.controller.replaceTableQuantity(e,t,n);return r?{holdId:r.holdId,expiresAt:r.expiresAt,seats:r.seats,items:r.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 si,this.hostEl&&this.blockedRegions.attach(this.hostEl)}this.blockedRegions.set(e)}getBlockedRegions(){return this.blockedRegions?.get()??[]}frameSeat(e,t={}){let n=this.controller.getRenderer();return Lr({seatPoint:r=>{let s=this.controller.getExpandedSeats().find(o=>o.id===r);return s?this.controller.worldToScreen({x:s.x,y:s.y}):null},mapHeight:()=>this.hostEl?.clientHeight??0,insets:()=>this.controller.getViewportInsets(),gestureCount:()=>n?.getCameraGestureCount?.()??0,panScreenBy:(r,s)=>n?.panScreenBy?(n.panScreenBy(r,{animate:s}),!0):!1},e,t)}setColorblindSafe(e){this.colorblindSafe_=e,this.controller.setColorblindSafe(e),this.notifyMapStateChange()}setViewMode(e){this.controller.setViewMode(e),this.notifyMapStateChange()}getViewMode(){return this.controller.getViewMode()}zoomIn(){this.immersive.zoomIn()||(this.controller.zoomIn(),this.notifyMapStateChange())}zoomOut(){this.immersive.zoomOut()||(this.controller.zoomOut(),this.notifyMapStateChange())}zoomToFit(){this.immersive.focusOverview()||(this.controller.zoomToFit(),this.notifyMapStateChange())}setThemeMode(e,t){this.hostSurface.setThemeMode(e,t)}getThemeMode(){return this.hostSurface.themeMode()}setViewportInsets(e){this.hostSurface.setViewportInsets(e)}getViewportInsets(){return this.hostSurface.viewportInsets()}setBuyerView(e,t){return this.immersive.setBuyerView(e,t)}getBuyerView(){return this.immersive.buyerView}openSeatView(e){return this.immersive.openSeatView(e)}setVenue3DNavigationMode(e){if(!this.immersive.setNavigationMode(e))throw new Error("venue_3d_not_active")}setInteractionEnabled(e){this.interactionEnabled_=e,this.applyInteractionState()}applyInteractionState(){let e=this.hostEl;e&&(e.style.pointerEvents=this.interactionEnabled_?"":"none",e.toggleAttribute("inert",!this.interactionEnabled_),this.interactionEnabled_?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden","true"))}async release(){await this.controller.release()}async releaseLabels(e){return this.controller.releaseLabels(e)}startRealtime(){!this.access?.configured||this.realtime||(this.realtime=new ve({url:this.api.subscribeUrl(this.opts.event),mintTicket:()=>this.api.subscribeTicket(this.opts.event),onAccessUnavailable:e=>this.opts.onAccessUnavailable?.(e),sink:mt(this.controller,{flashOnLiveChange:!0,ownLabels:()=>this.holdingLabels,onStatusChange:()=>{this.immersive.pushLiveState(),this.opts.onStatusChange?.()},onSelectedObjectUnavailable:(e,t)=>this.opts.onSelectedObjectUnavailable?.({labels:e,reason:t})})}),this.realtime.start())}async refreshAvailability(){let e=await this.controller.refreshAvailability();return this.immersive.pushLiveState(),this.opts.onStatusChange?.(),e.lost.length&&this.opts.onSelectedObjectUnavailable?.({labels:e.lost,reason:"taken"}),this.notifyMapStateChange(),e}async refreshAccess(){if(!this.access?.configured)return!1;let e=await this.access.refresh("manual");return e&&(this.accessState_={configured:!0,status:"ready"},await this.controller.refresh(),this.realtime?.restart(),this.realtime||this.startRealtime()),this.notifyMapStateChange(),e}showLoadFailure(e){let t=document.createElement("div");t.setAttribute("role","status"),t.style.cssText='display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;width:100%;height:100%;min-height:180px;box-sizing:border-box;padding:24px;text-align:center;font:500 14px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#3b4256;';let n=document.createElement("div");n.textContent="The seat map didn\u2019t load.",t.appendChild(n);let r=document.createElement("button");r.type="button",r.textContent="Try again",r.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;",r.addEventListener("click",()=>{this.destroy(),this.render().catch(s=>this.opts.onError?.(s))}),t.appendChild(r),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 Rr=["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"],rc={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 sc(i){let e={};for(let t of Rr)e[t]=(...n)=>{let r=i();return r?r[t](...n):rc[t]()};return e}var Or=["event","apiBase","maxSelection","numberOfPlacesToSelect","selectionValidators","publicKey","locale","currency","colorblindSafe","initialView","errorDisplay"],Ir=[...Or,"selectedObjects","selectableObjects","messages","seatTooltip","buyerAccessTokenProvider","buyerAccessToken"],_r=["onSelectionChange","onSelectionValidityChange","onSelectionValid","onSelectionInvalid","onSelectionLimit","onHold","onHoldRestored","onHoldExpired","onGAClick","onGAPrompt","onError","onDeckTap","onHint","onSeatHover","onAccessExpired","onAccessUnavailable","onSelectedObjectUnavailable"];function oc(i,e,t){let n={container:i};for(let r of Ir)n[r]=e[r];for(let r of _r)n[r]=t[r];return n}var ac=new Set(["seatlayer.designer.ready","seatlayer.designer.saved","seatlayer.designer.published","seatlayer.designer.close","seatlayer.designer.error"]),lc=2e4,cc=480,dc=180*1e3,pc=900*1e3,hc=.8,uc=30*1e3,mc=1e5,fc=4,gc=50;function Xi(i){if(typeof i!="string")return i;let e=document.querySelector(i);if(!e)throw new Error(`EmbeddedDesigner container not found: ${i}`);return e}function bc(i){let e=(i??"").toLowerCase();return e.includes("expire")||e.includes("revoke")||e==="401"?"expired":e.includes("mismatch")?"mismatch":e.includes("timeout")?"timeout":"load"}var vc={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."}},Qi=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"||!ac.has(t.type))return;let n={type:t.type,chartId:typeof t.chartId=="string"?t.chartId:void 0,workspaceId:typeof t.workspaceId=="string"?t.workspaceId:void 0,expiresAt:typeof t.expiresAt=="number"?t.expiresAt:void 0,code:typeof t.code=="string"?t.code:void 0,message:typeof t.message=="string"?t.message:void 0,meta:t.meta,fatal:typeof t.fatal=="boolean"?t.fatal:void 0,action:typeof t.action=="string"?t.action:void 0},r=this.identityEstablished||n.type==="seatlayer.designer.ready"||n.type==="seatlayer.designer.saved"||n.type==="seatlayer.designer.published"||n.type==="seatlayer.designer.close",s=this.options.expectedChartId!==void 0&&n.chartId!==this.options.expectedChartId&&(r||n.chartId!==void 0),o=this.options.expectedWorkspaceId!==void 0&&n.workspaceId!==this.options.expectedWorkspaceId&&(r||n.workspaceId!==void 0);if(s||o){this.showError("mismatch");return}switch(n.type){case"seatlayer.designer.ready":this.identityEstablished=!0,this.sessionExpiresAt=n.expiresAt,this.phase="ready",this.clearTimeoutTimer(),this.removeOverlay(),this.autoRecoverUsed=!1,this.scheduleRenewal(n.expiresAt),this.options.onReady?.(n);break;case"seatlayer.designer.saved":this.options.onSaved?.(n);break;case"seatlayer.designer.published":this.options.onPublished?.(n);break;case"seatlayer.designer.close":this.options.onClose?.(n);break;case"seatlayer.designer.error":{let a=bc(n.code);if(a==="expired"&&this.autoRenewEnabled()&&!this.autoRecoverUsed){this.autoRecoverUsed=!0,this.clearRenewTimer(),this.options.onRequestRelaunch();return}(typeof n.fatal=="boolean"?n.fatal:a!=="load"||this.phase!=="ready")&&this.showError(a),this.options.onError?.(n);break}}};this.options=e}mount(){this.destroy();let e=new URL(this.options.designerUrl,window.location.href);if(e.protocol!=="https:"&&e.hostname!=="localhost"&&e.hostname!=="127.0.0.1")throw new Error("EmbeddedDesigner requires an HTTPS designerUrl outside local development.");this.designerOrigin=e.origin;let t=document.createElement("iframe");t.title=this.options.title??"Venue chart Designer",t.allow=this.options.allow??"fullscreen; clipboard-write",t.referrerPolicy=this.options.referrerPolicy??"origin",t.src=e.toString(),t.style.setProperty("width","100%","important"),t.style.setProperty("height",typeof this.options.height=="number"?`${this.options.height}px`:"100%","important"),t.style.border="0",Object.assign(t.style,this.options.style),this.options.className&&(t.className=this.options.className);let n=Xi(this.options.container);if(this.containerEl=n,window.addEventListener("message",this.handleMessage),n.append(t),this.frame=t,this.fillEnabled()&&this.startFill(),this.phase="loading",this.loadingStateEnabled()){this.ensureContainerPositioned(n),this.renderOverlay(n,"loading");let r=this.options.loadingTimeoutMs??lc;r>0&&Number.isFinite(r)&&(this.timeoutTimer=setTimeout(()=>{this.phase==="loading"&&this.showError("timeout")},r))}return t}setDesignerUrl(e){return this.options={...this.options,designerUrl:e},this.mount()}getIframe(){return this.frame}setSizing(e,t){this.options={...this.options,height:e,minHeight:t},this.frame&&(this.stopFill(),this.lastAutoHeight="",this.fillEnabled()?(this.pinned||this.setFrameHeight("100%"),this.startFill()):this.pinned||this.setFrameHeight(`${e}px`))}setRelaunchPolicy(e,t){this.options={...this.options,onRequestRelaunch:e,autoRenewSession:t},this.clearRenewTimer(),this.phase==="ready"&&this.scheduleRenewal(this.sessionExpiresAt)}destroy(){window.removeEventListener("message",this.handleMessage),this.stopFill(),this.unpinFullscreen(),this.clearTimeoutTimer(),this.clearRenewTimer(),this.removeOverlay(),this.restoreContainerStyle(),this.frame?.remove(),this.frame=null,this.containerEl=null,this.fillMode=null,this.designerOrigin="",this.phase="loading",this.identityEstablished=!1,this.sessionExpiresAt=void 0,this.lastAutoHeight=""}loadingStateEnabled(){return this.options.showLoadingState!==!1}autoResizeEnabled(){return this.options.autoResize!==!1}fillEnabled(){return typeof this.options.height!="number"}setFrameHeight(e){this.frame?.style.setProperty("height",e,"important")}detectFillMode(){let e=this.containerEl,t=this.frame;if(this.pinned||!e||!t)return this.fillMode??"viewport";let n=()=>e.getBoundingClientRect().height,r=t.style.getPropertyValue("height"),s=t.style.getPropertyPriority("height");t.style.setProperty("height","0px","important");let o=n();t.style.setProperty("height",`${mc}px`,"important");let a=n();return r?t.style.setProperty("height",r,s):t.style.removeProperty("height"),!(a-o>fc)&&o>=gc?"container":"viewport"}applyFill(){if(!this.frame||this.pinned)return;let e=this.options.minHeight??cc;if(this.fillMode==="container"&&this.containerEl){let r=Math.max(e,Math.round(this.containerEl.getBoundingClientRect().height));this.setFrameHeight(`${r}px`);return}let t=this.frame.getBoundingClientRect().top,n=Math.max(e,Math.round(window.innerHeight-t));this.setFrameHeight(`${n}px`)}syncContainerObserver(){let e=this.fillMode==="container"&&!!this.containerEl&&typeof ResizeObserver<"u";e&&!this.resizeObs?(this.resizeObs=new ResizeObserver(()=>this.scheduleFill()),this.resizeObs.observe(this.containerEl)):!e&&this.resizeObs&&(this.resizeObs.disconnect(),this.resizeObs=null)}startFill(){this.fillMode=this.detectFillMode(),this.syncContainerObserver(),this.applyFill(),!this.fillListening&&(this.fillListening=!0,window.addEventListener("resize",this.scheduleReprobe),window.addEventListener("orientationchange",this.scheduleReprobe),window.addEventListener("scroll",this.scheduleFill,{passive:!0}))}stopFill(){this.fillRaf!==null&&(cancelAnimationFrame(this.fillRaf),this.fillRaf=null),this.reprobeRaf!==null&&(cancelAnimationFrame(this.reprobeRaf),this.reprobeRaf=null),this.resizeObs&&(this.resizeObs.disconnect(),this.resizeObs=null),this.fillListening&&(this.fillListening=!1,window.removeEventListener("resize",this.scheduleReprobe),window.removeEventListener("orientationchange",this.scheduleReprobe),window.removeEventListener("scroll",this.scheduleFill))}pinFullscreen(){if(this.pinned||!this.frame)return;this.pinned=!0,this.frameStyleBeforeFs=this.frame.getAttribute("style");let e={position:"fixed",top:"0",right:"0",bottom:"0",left:"0",width:"100vw",height:"100vh",margin:"0",border:"0","z-index":"2147483000",background:"#101625"};for(let[n,r]of Object.entries(e))this.frame.style.setProperty(n,r,"important");let t=document.documentElement;this.docOverflowBeforeFs=t.style.overflow,t.style.overflow="hidden",document.body&&(this.bodyOverflowBeforeFs=document.body.style.overflow,document.body.style.overflow="hidden"),this.fsKeyHandler=n=>{n.key==="Escape"&&this.unpinFullscreen()},window.addEventListener("keydown",this.fsKeyHandler)}unpinFullscreen(){this.pinned&&(this.pinned=!1,this.frame&&(this.frameStyleBeforeFs===null?this.frame.removeAttribute("style"):this.frame.setAttribute("style",this.frameStyleBeforeFs),this.fillEnabled()?this.applyFill():this.autoResizeEnabled()&&this.lastAutoHeight?this.setFrameHeight(this.lastAutoHeight):typeof this.options.height=="number"&&this.setFrameHeight(`${this.options.height}px`)),this.frameStyleBeforeFs=null,this.docOverflowBeforeFs!==null&&(document.documentElement.style.overflow=this.docOverflowBeforeFs,this.docOverflowBeforeFs=null),this.bodyOverflowBeforeFs!==null&&document.body&&(document.body.style.overflow=this.bodyOverflowBeforeFs,this.bodyOverflowBeforeFs=null),this.fsKeyHandler&&(window.removeEventListener("keydown",this.fsKeyHandler),this.fsKeyHandler=null))}clearTimeoutTimer(){this.timeoutTimer!==null&&(clearTimeout(this.timeoutTimer),this.timeoutTimer=null)}autoRenewEnabled(){return!!this.options.onRequestRelaunch&&this.options.autoRenewSession!==!1}clearRenewTimer(){this.renewTimer!==null&&(clearTimeout(this.renewTimer),this.renewTimer=null)}scheduleRenewal(e){if(this.clearRenewTimer(),!this.autoRenewEnabled()||typeof e!="number"||!Number.isFinite(e))return;let t=e-Date.now();if(t<=0)return;let n=t<pc?t*hc:t-dc,r=Math.max(uc,n);this.renewTimer=setTimeout(()=>{this.renewTimer=null,this.autoRenewEnabled()&&this.options.onRequestRelaunch()},r)}ensureContainerPositioned(e){getComputedStyle(e).position==="static"&&(this.restoreContainerPosition=e.style.position,e.style.position="relative")}restoreContainerStyle(){if(this.restoreContainerPosition!==null){try{Xi(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=Xi(this.options.container)}catch{return}this.renderOverlay(t,"error",e)}handleTryAgain(){if(this.options.onRequestRelaunch){this.options.onRequestRelaunch();return}this.mount()}renderOverlay(e,t,n){this.removeOverlay();let r=document.createElement("div");r.setAttribute("data-seatlayer-designer-overlay",t),r.setAttribute("role",t==="error"?"alert":"status"),r.setAttribute("aria-live","polite"),Object.assign(r.style,{position:"absolute",inset:"0",display:"flex",alignItems:"center",justifyContent:"center",background:"#101625",color:"#e6ebf5",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif',zIndex:"2",overflow:"hidden"}),t==="loading"?this.buildSkeleton(r):this.buildErrorCard(r,n??"load"),e.append(r),this.overlay=r}buildSkeleton(e){let t=document.createElement("style");t.textContent=`
2783
2798
  @media (prefers-reduced-motion: no-preference) {
2784
2799
  @keyframes seatlayer-designer-shimmer {
2785
2800
  0% { background-position: -320px 0; }
@@ -2789,9 +2804,9 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default}
2789
2804
  animation: seatlayer-designer-shimmer 1.25s ease-in-out infinite;
2790
2805
  background-size: 640px 100%;
2791
2806
  }
2792
- }`,e.append(t);let n="linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.10) 37%, rgba(255,255,255,0.04) 63%)",r=document.createElement("div");Object.assign(r.style,{position:"absolute",inset:"0",display:"flex",flexDirection:"column",padding:"16px",gap:"14px",opacity:"0.9"});let s=c=>{let p=document.createElement("div");return p.className="sl-shimmer",Object.assign(p.style,{background:n,borderRadius:"8px"}),Object.assign(p.style,c),p};r.append(s({height:"40px",width:"100%",flex:"0 0 auto"}));let o=document.createElement("div");Object.assign(o.style,{display:"flex",gap:"14px",flex:"1 1 auto",minHeight:"0"}),o.append(s({width:"220px",height:"100%",flex:"0 0 auto"})),o.append(s({flex:"1 1 auto",height:"100%"})),r.append(o),e.append(r);let a=document.createElement("div");Object.assign(a.style,{position:"relative",zIndex:"1",display:"flex",alignItems:"center",gap:"10px",padding:"10px 16px",borderRadius:"999px",background:"rgba(16, 22, 37, 0.72)",fontSize:"13px",fontWeight:"500",letterSpacing:"0.01em"});let l=document.createElement("span");l.className="sl-shimmer",Object.assign(l.style,{width:"9px",height:"9px",borderRadius:"50%",background:n,flex:"0 0 auto"}),a.append(l),a.append(document.createTextNode("Loading designer\u2026")),e.append(a)}buildErrorCard(e,t){let n=fc[t],r=document.createElement("div");Object.assign(r.style,{maxWidth:"420px",margin:"0 24px",padding:"28px",textAlign:"center",background:"rgba(255, 255, 255, 0.03)",border:"1px solid rgba(255, 255, 255, 0.08)",borderRadius:"16px",boxShadow:"0 12px 40px rgba(0, 0, 0, 0.35)"});let s=document.createElement("h2");s.textContent=n.title,Object.assign(s.style,{margin:"0 0 8px",fontSize:"17px",fontWeight:"600",color:"#f4f7ff"});let o=document.createElement("p");o.textContent=n.body,Object.assign(o.style,{margin:"0 0 20px",fontSize:"13.5px",lineHeight:"1.5",color:"#aab4c8"});let a=document.createElement("button");a.type="button",a.textContent="Try again",Object.assign(a.style,{appearance:"none",cursor:"pointer",border:"0",borderRadius:"10px",padding:"10px 22px",fontSize:"14px",fontWeight:"600",color:"#101625",background:"#7aa2ff"}),a.addEventListener("click",()=>this.handleTryAgain()),r.append(s,o,a),e.append(r)}};import{PickerController as Kd,formatMoney as Wd,getLocale as xa,loadLocale as Yd,setStringOverrides as Xd,t as B,tCount as Li}from"@seatlayer/core";import{isAuthoredSeatView as Qd,seatViewDisclosure as Zd}from"@seatlayer/core/view3d/crossfade/panorama";function Dr(i){return!!i&&i.clientWidth>0&&i.scrollWidth>i.clientWidth+1}function gc(i){return i.some(e=>Dr(e))}var ci="data-fit-gone",bc=12;function Zi(i,e,t=Dr){if(!i)return 0;for(let n of e)i.classList.remove(n.cls);if(i.querySelectorAll(`[${ci}]`).forEach(n=>{n.removeAttribute(ci),n.hidden=!1}),i.dataset.fit="0",i.clientWidth<=0||!t(i))return 0;for(let n=0;n<e.length;n+=1){let r=e[n];n>0&&i.classList.remove(e[n-1].cls),i.classList.add(r.cls),i.dataset.fit=String(n+1);let s=r.give?r.give(i):!0;if(!t(i))return n+1;if(r.repeat&&r.give){for(let o=1;s&&o<bc;o+=1)if(s=r.give(i),!t(i))return n+1}}return e.length}function vc(i,e="[data-fit-seg]"){let t=[...i.querySelectorAll(e)].filter(n=>!n.hidden);return t.length<2?!1:Br(t[t.length-1])}function yc(i,e){let t=i.querySelector(e);return t&&!t.hidden?Br(t):!1}function Br(i){let e=i.previousElementSibling;return e instanceof HTMLElement&&e.tagName==="I"&&(e.setAttribute(ci,""),e.hidden=!0),i.setAttribute(ci,""),i.hidden=!0,!0}function wc(i){if(!i)return!1;let e=(i.getAttribute("aria-label")||i.textContent||"").trim();return e?(i.setAttribute("aria-label",e),i.setAttribute("title",e),!0):!1}function Nr(i){if(!i)return 0;let e=i.querySelector(".sl-confirm-cancel"),t=i.querySelector(".sl-confirm-add-t");return Zi(i,[{cls:"sl-fit-track"},{cls:"sl-fit-type"},{cls:"sl-fit-icon",give:()=>wc(e)}],()=>gc([e,t]))}function Fr(i){return Zi(i,[{cls:"sl-fit-notype",give:e=>yc(e,"[data-fit-type]")},{cls:"sl-fit-short",give:e=>vc(e),repeat:!0}])}function Ji(i){return i?(i.classList.add("sl-fitpill"),Zi(i,[{cls:"sl-fit-p1"},{cls:"sl-fit-p2"},{cls:"sl-fit-p3"}])):0}var xc=["on-sale","low","sold-out","presale","closed"];function Ct(i){return i==null?null:typeof i=="number"&&Number.isFinite(i)&&i>=0?i:void 0}function $r(i){return i==null?null:typeof i=="number"&&Number.isFinite(i)&&i>=0?i:void 0}function Vr(i){if(i==null)return null;if(typeof i!="object"||Array.isArray(i))return;let e=i,t=e.count,n=e.index;if(typeof n!="number"||!Number.isInteger(n)||n<1||typeof t!="number"||!Number.isInteger(t)||t<n)return;let r=e.remaining;if(r!=null&&(typeof r!="number"||!Number.isInteger(r)||r<0))return;let s={index:n,count:t,remaining:r??null};if(e.id!==void 0){if(typeof e.id!="string"||!e.id.trim())return;s.id=e.id.trim()}if(e.name!==void 0){if(typeof e.name!="string"||!e.name.trim())return;s.name=e.name.trim()}if(e.categoryKey!==void 0){if(e.categoryKey!==null&&(typeof e.categoryKey!="string"||!e.categoryKey.trim()))return;s.categoryKey=e.categoryKey==null?null:e.categoryKey.trim()}for(let o of["startsAt","endsAt"]){if(e[o]===void 0)continue;let a=$r(e[o]);if(a===void 0)return;s[o]=a}return s}function Sc(i){if(i==null)return null;if(typeof i!="object"||Array.isArray(i))return;let e=i;if(!Number.isInteger(e.assignmentVersion)||e.assignmentVersion<0||!Array.isArray(e.channels)||!Array.isArray(e.objects))return;let t=[],n=new Set;for(let o of e.channels){if(!o||typeof o!="object"||Array.isArray(o))return;let a=o,l=typeof a.channelId=="string"?a.channelId.trim():"";if(!l||n.has(l)||!Number.isInteger(a.pricingVersion)||a.pricingVersion<0||!Array.isArray(a.priceOverrides))return;let c=[],p=new Set;for(let d of a.priceOverrides){if(!d||typeof d!="object"||Array.isArray(d))return;let u=d,h=typeof u.categoryKey=="string"?u.categoryKey.trim():"",g=u.tierId===null?null:typeof u.tierId=="string"&&u.tierId.trim()?u.tierId.trim():void 0,b=Ct(u.price);if(!h||g===void 0||b===void 0||b===null)return;let w=`${h}\0${g??""}`;if(p.has(w))return;p.add(w),c.push({categoryKey:h,tierId:g,price:b})}n.add(l),t.push({channelId:l,pricingVersion:a.pricingVersion,priceOverrides:c})}let r=[],s=new Set;for(let o of e.objects){if(!o||typeof o!="object"||Array.isArray(o))return;let a=o,l=typeof a.label=="string"?a.label.trim():"",c=typeof a.channelId=="string"?a.channelId.trim():"";if(!l||s.has(l)||!n.has(c))return;s.add(l),r.push({label:l,channelId:c})}return{assignmentVersion:e.assignmentVersion,channels:t,objects:r}}function en(i){if(!i||typeof i!="object"||Array.isArray(i))return null;let e=i,t=xc.find(p=>p===e.state);if(!t)return null;let n=Ct(e.fromPrice),r=Ct(e.previousPrice);if(n===void 0||r===void 0)return null;let s=e.currency==null?null:typeof e.currency=="string"&&e.currency.trim()?e.currency.trim():void 0;if(s===void 0)return null;let o=Vr(e.release);if(o===void 0)return null;let a=e.upcoming===void 0?null:Vr(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 d of e.prices){if(!d||typeof d!="object"||Array.isArray(d))return null;let u=d,h=typeof u.categoryKey=="string"?u.categoryKey.trim():"";if(!h)return null;let g=Ct(u.price),b=Ct(u.previousPrice);if(g==null||b===void 0)return null;let w={categoryKey:h,price:g,previousPrice:b};if(u.offerId!==void 0){if(typeof u.offerId!="string"||!u.offerId.trim())return null;w.offerId=u.offerId.trim()}if(u.offerName!==void 0){if(typeof u.offerName!="string"||!u.offerName.trim())return null;w.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;w.remaining=u.remaining==null?null:u.remaining}for(let x of["startsAt","endsAt"]){if(u[x]===void 0)continue;let y=$r(u[x]);if(y===void 0)return null;w[x]=y}p.push(w)}l=p}let c=Sc(e.channelPricing);return c===void 0?null:{state:t,fromPrice:n,previousPrice:r,currency:s,release:o,upcoming:a,prices:l,channelPricing:c}}function zr(i){return i?.changed!==!1}function jr(i,e){if(!i)return null;let t=null,n=r=>{r!=null&&r>e&&(t===null||r<t)&&(t=r)};for(let r of[i.release,i.upcoming])n(r?.startsAt),n(r?.endsAt);for(let r of i.prices)n(r.startsAt),n(r.endsAt);return t}function tn(i){let e={};for(let t of i?.prices??[])e[t.categoryKey]=t.price;return e}function Gr(i){return i.focusedSection!==null?i.deeperThanSectionFrame===!1?"venue":"section":i.seatsRevealed?"venue":"none"}import{compactRowLabel as kc,t as Be}from"@seatlayer/core";import{seatConfidenceDisclosure as Tc}from"@seatlayer/core/core/seatConfidence";function nn(i){return String(i??"\u2014").replace(/[&<>"]/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[e])}function S(i){return String(i??"").replace(/[&<>"]/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[e])}function Se(i){return i?.restrictedView?v("picker.restrictedView","Restricted view"):i?.obstructedView?v("picker.obstructedView","Obstructed view"):""}function Ur(i){if(!i)return"";let e=[];i.premium&&e.push(`<div class="sl-cx-premium"><span class="sl-cx-star" aria-hidden="true">\u2605</span>${v("picker.premiumSeat","Premium seat")}</div>`);let t=Se(i);return t?e.push(`<div class="sl-cx-warn"><span class="sl-cx-glyph" aria-hidden="true">\u25D0</span><span class="sl-cx-txt"><b>${t}</b>${i.note?`<span class="sl-cx-note">${S(i.note)}</span>`:""}</span></div>`):i.note&&e.push(`<div class="sl-cx-warn"><span class="sl-cx-glyph" aria-hidden="true">\u2139</span><span class="sl-cx-txt"><span class="sl-cx-note">${S(i.note)}</span></span></div>`),e.length?`<div class="sl-cx">${e.join("")}</div>`:""}function rn(i){if(!i)return"";let e=[];if(i.premium){let n=S(v("picker.premiumSeat","Premium seat"));e.push(`<span class="sl-cx-mark sl-cx-mark-premium" role="img" aria-label="${n}" title="${n}">\u2605</span>`)}let t=Se(i);if(t){let n=S(i.note?`${t}: ${i.note}`:t);e.push(`<span class="sl-cx-mark sl-cx-mark-limited" role="img" aria-label="${n}" title="${n}">\u25D0</span>`)}else if(i.note){let n=S(i.note);e.push(`<span class="sl-cx-mark sl-cx-mark-info" role="img" aria-label="${n}" title="${n}">\u2139</span>`)}return e.join("")}function sn(i){if(!i)return"";let e=[];i.premium&&e.push(`<span class="sl-chip-cx-tag premium"><span aria-hidden="true">\u2605</span>${v("picker.premiumSeat","Premium seat")}</span>`);let t=Se(i);return t&&e.push(`<span class="sl-chip-cx-tag limited"><span aria-hidden="true">\u25D0</span>${S(t)}</span>`),!e.length&&!i.note?"":'<div class="sl-chip-cx">'+(e.length?`<div class="sl-chip-cx-tags">${e.join("")}</div>`:"")+(i.note?`<div class="sl-chip-cx-note">${S(i.note)}</div>`:"")+"</div>"}function st(i){return i==="no-seat"?v("picker.emptyWheelchairSpace","Empty wheelchair space"):i==="seat-present"?v("picker.accessiblePhysicalSeat","Accessible physical seat"):""}function Kr(i){let e=st(i);return e?`<div class="sl-cx"><div class="sl-cx-warn"><span class="sl-cx-glyph" aria-hidden="true">\u267F</span><span class="sl-cx-txt"><b>${e}</b></span></div></div>`:""}function At(i){let e=st(i);return e?`<span class="sl-cx-mark" role="img" aria-label="${e}" title="${e}">\u267F</span>`:""}function on(i,e){if(!i)return"";let t=e?v("picker.viewFromThisSeat","View from this seat"):v("picker.seeItIn3d","See it in 3D"),n=e?v("picker.viewFromHere","View from here"):t;return`<button type="button" class="sl-confirm-3d" aria-label="${t}"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2l9 5v10l-9 5-9-5V7z"/><path d="M12 12l9-5M12 12v10M12 12L3 7"/></svg><span>${n}</span></button>`}function Wr(i){if(!i)return"";let e=i.previous.label||i.previous.id,t=i.next.label||i.next.id;return`<span class="sl-seccard-nav" aria-label="${v("picker.browseSections","Browse sections")}"><button type="button" data-section-nav="${H(i.previous.id)}" aria-label="${v("picker.previousSection","Previous section")}: ${H(e)}" title="${H(e)}">\u2190</button><button type="button" data-section-nav="${H(i.next.id)}" aria-label="${v("picker.nextSection","Next section")}: ${H(t)}" title="${H(t)}">\u2192</button></span>`}function Yr(i,e){if(!e)return"";let t=e,n=t.includes(i.id),r=n?t.length>1?v("picker.openComparison","Open comparison"):v("picker.savedForComparison","Saved for comparison"):t.length?v("picker.compareWithSaved","Compare with saved"):v("picker.saveToCompare","Save to compare");return`<button type="button" class="sl-confirm-compare"${n&&t.length===1?" disabled":""}><span aria-hidden="true">\u21C4</span><span>${S(r)}</span></button>`}function Xr(i,e,t){if(!t)return"";let n=Tc(i.confidenceEvidence),r=n.modeledTarget??n.reality;return`<button type="button" class="sl-confirm-confidence" aria-label="Open seat confidence passport for ${S(i.displayLabel??i.label)}"><span><em>${S(e)}</em><strong>${S(n.headline)}</strong><small>${S(r)}</small></span><b>Passport</b></button>`}function U(i){let e=i?.rowLabel,t=i?.sectionLabel;if(!e||!t)return e;for(let n of["-"," ","\xB7","/","_"]){let r=`${t}${n}`;if(e.startsWith(r)&&e.length>r.length)return e.slice(r.length)}return kc(e,t)}function Ec(i){switch(i){case"paused":return{title:v("picker.accessPausedTitle","These seats are on hold right now"),body:v("picker.accessPausedBody","The organizer has paused this selection. Try again in a few minutes."),action:v("picker.accessRetry","Try again")};case"revoked":return{title:v("picker.accessRevokedTitle","This access link is no longer active"),body:v("picker.accessRevokedBody","Ask whoever sent you here for a new link to keep booking these seats."),action:v("picker.accessRefresh","Refresh")};case"no_token":case"provider_failed":return{title:v("picker.accessExpiredTitle","The seat map timed out"),body:v("picker.accessExpiredBody","Any seats you\u2019re holding stay held. Refresh to see what\u2019s available now."),action:v("picker.accessRefresh","Refresh")};default:return{title:v("picker.accessInvalidTitle","We couldn\u2019t verify your access"),body:v("picker.accessInvalidBody","You can still book anything shown as available. Contact whoever sent you here for access to the rest."),action:v("picker.accessRefresh","Refresh")}}}var Cc=6;function Qr(i,e,t){let n=nn;return[i?.sectionLabel?`<div class="sl-confirm-field sl-confirm-sec${i.sectionLabel.length>Cc?" sl-confirm-sec-long":""}"><span class="sl-confirm-key">${v("picker.section","Section")}</span><span class="sl-confirm-value">${n(i.sectionLabel)}</span></div>`:"",i?.rowLabel||i?.objectType==="booth"?`<div class="sl-confirm-field"><span class="sl-confirm-key">${n(t)}</span><span class="sl-confirm-value">${n(U(i)??i?.displayLabel??e)}</span></div>`:"",i?.objectType!=="booth"?`<div class="sl-confirm-field"><span class="sl-confirm-key">${v("picker.seat","Seat")}</span><span class="sl-confirm-value">${n(i?.seatNumber??i?.displayLabel??e)}</span></div>`:""].filter(Boolean).join("")}function Zr(i,e,t){let n=nn,r=i?.objectType==="booth",s=i?.objectType==="table"&&!!i?.bookingMode,o=r||s||!i?.seatNumber,a=i?.sectionLabel??(o?void 0:i?.displayLabel),l=s?`${v("picker.guests","Guests")} ${i?.bookingMode==="variable"?`${i?.minOccupancy}\u2013${i?.maxOccupancy}`:i?.capacity}`:void 0,p=(o?[l,a?i?.rowLabel??i?.displayLabel:void 0]:[i?.rowLabel?`${t} ${U(i)??""}`.trim():void 0,`${v("picker.seat","Seat")} ${i?.seatNumber??e}`]).filter(Boolean).join(" \xB7 ");return(a?`<span class="sl-confirm-place">${n(a)}</span>`:"")+(p?`<span class="sl-confirm-pos">${a?" \xB7 ":""}${n(p)}</span>`:"")+(a||p?"":`<span class="sl-confirm-pos">${n(e)}</span>`)}function Jr(i,e){if(!i)return"";let t=e?v("picker.viewFromThisSeat","View from this seat"):v("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 es(i,e){if(!i||e)return"";let t=v("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 qr(i){return i.buyerMessage?.trim()||(i.restriction==="companion"?v("picker.companionRequiresWheelchair","Requires the adjacent wheelchair place"):void 0)}function ts(i,e,t){let n=nn;if(i.length>1)return`<fieldset class="sl-confirm-tiers"><legend>${v("picker.ticketType","Ticket type")}</legend>`+i.map(o=>{let a=qr(o);return`<button type="button" class="sl-confirm-tier" data-confirm-tier="${n(o.id)}" aria-pressed="${o.id===e}"><span class="sl-confirm-tier-copy"><span class="sl-confirm-tier-name">${n(o.name)}</span>`+(a?`<small class="sl-confirm-tier-note">${n(a)}</small>`:"")+`</span><span class="sl-confirm-tier-price">${n(t(o))}</span></button>`}).join("")+"</fieldset>";let r=i[0],s=r?qr(r):void 0;return s?`<p class="sl-confirm-tier-note">${n(s)}</p>`:""}function is(i){return`<span class="sl-seccard-dot" style="background:${S(i.color)}"></span><span class="sl-seccard-name">${S(i.label)}</span><span class="sl-seccard-left" data-full="${S(i.leftLabel)}" data-short="${S(i.leftShortLabel??i.leftLabel)}">${S(i.leftLabel)}</span>`+i.nav+i.close}function ns(i){return`<div class="sl-seccard-head"><span class="sl-seccard-dot" style="background:${S(i.color)}"></span><span class="sl-seccard-name">${S(i.label)}</span>`+(i.showPrice?`<span class="sl-seccard-price">${S(i.priceLabel)}</span>`:"")+i.close+`</div><div class="sl-seccard-zone">${i.zoneLabel?`${S(i.zoneLabel)} \xB7 `:""}<span class="sl-seccard-left">${S(i.leftLabel)}</span></div>`+(i.entrance?`<div class="sl-seccard-entrance">${S(i.entrance)}</div>`:"")+(i.mix?`<div class="sl-seccard-mix">${i.mix}</div>`:"")+`<div class="sl-seccard-foot"><button type="button" class="sl-seccard-overview">\u2190 ${S(i.overviewLabel)}</button>`+i.nav+`<span class="sl-seccard-hint">${S(i.hint)}</span></div>`}function rs(i){return`<span class="sl-seccard-mix-item${i.dim?" sl-dim":""}"><span class="sl-seccard-mix-dot" style="background:${S(i.color)}"></span>${S(i.label)} <span class="sl-seccard-mix-price">${S(i.rangeLabel)}</span></span>`}function ss(i){return'<div class="sl-confirm-grid">'+i.identityFields+`</div><div class="sl-confirm-cat"><span class="sl-confirm-cat-name">${S(i.categoryLabel)}</span>`+(i.priceLabel?`<span class="sl-confirm-price">${S(i.priceLabel)}</span>`:"")+'</div><div class="sl-confirm-id">'+i.marker+`<span class="sl-confirm-dot" style="background:${S(i.categoryColor)}" aria-hidden="true"></span><span class="sl-sr">${S(i.categoryLabel)}</span><span class="sl-confirm-who">`+i.identity+"</span>"+(i.priceLabel?`<span class="sl-confirm-idprice">${S(i.priceLabel)}</span>`:"")+'</div><div class="sl-confirm-body">'+i.tierChoices+i.groupDates+i.wheelchair+i.commercial+(i.thumb||i.see3dPill?`<div class="sl-confirm-strip">${i.thumb}<span class="sl-confirm-pills">${i.see3dPill}</span></div>`:"")+i.inspect+'<div class="sl-confirm-row">'+(i.see3dRow??"")+`<button type="button" class="sl-confirm-cancel">${S(i.cancelLabel)}</button><button type="button" class="sl-confirm-add"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M5 12.5l4 4L19 7"/></svg><span class="sl-confirm-add-t">${S(i.selectLabel)}</span></button></div></div>`}function os(i,e){let t=H,{variable:n}=e;return`<section class="sl-table-dialog" role="dialog" aria-modal="true" aria-labelledby="sl-table-title" aria-describedby="sl-table-copy"><div class="sl-table-head"><div class="sl-table-eyebrow">${t(n?Be("picker.flexiblePartyTypeWord",{typeWord:e.typeWord}):Be("picker.wholeTypeWord",{typeWord:e.typeWord}))}</div><h2 class="sl-table-title" id="sl-table-title">${t(i.displayLabel??i.label)}</h2><p class="sl-table-copy" id="sl-table-copy">${t(n?v("picker.chooseGuestsCopy","Choose how many guests will sit together. This table is held exclusively for your party."):Be("picker.allPlacesBookedTogether",{count:i.capacity}))}</p></div><div class="sl-table-body"><div class="sl-table-summary"><span>${t(e.categoryLabel)}</span>`+(e.suppressPricing?"":`<b data-table-unit>${t(Be("picker.perGuestPrice",{price:e.unitPrice}))}</b>`)+`<span class="muted">${t(v("picker.tableCapacity","Table capacity"))}</span><span>${t(Be("picker.guestsCount",{count:i.capacity}))}</span>`+(e.suppressPricing?"":`<span class="muted">${t(v("picker.total","Total"))}</span><b data-table-total></b>`)+"</div>"+(n?`<label class="sl-table-qtylabel" id="sl-table-qty-label">${t(v("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(v("picker.fewerGuests","Fewer guests"))}">\u2212</button><output aria-live="polite" data-table-qty>${i.quantity}</output><button type="button" data-table-step="1" aria-label="${t(v("picker.moreGuests","More guests"))}">+</button></div><div class="sl-table-range">${t(Be("picker.chooseMinMaxGuests",{min:i.minOccupancy,max:i.maxOccupancy}))}</div>`:`<input type="hidden" data-table-qty value="${i.capacity}">`)+`<div class="sl-table-actions"><button type="button" class="sl-table-cancel">${t(Be("common.cancel"))}</button><button type="button" class="sl-table-confirm">${t(e.held?v("picker.updateTable","Update table"):n?v("picker.selectTable","Select table"):v("picker.selectWholeTable","Select whole table"))}</button></div></div></section>`}function as(i,e){let t=Ec(i),n=document.createElement("div");n.className="sl-interrupt sl-access",n.setAttribute("role","status"),n.setAttribute("aria-live","polite");let r=document.createElement("div");r.className="sl-interrupt-card";let s=document.createElement("div");s.className="sl-interrupt-title",s.textContent=t.title;let o=document.createElement("div");o.className="sl-interrupt-body",o.textContent=t.body,r.append(s,o);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 p=document.createElement("span");return p.textContent=t.action,l.append(c,p),l.addEventListener("click",async()=>{n.classList.add("is-reloading"),l.disabled=!0;try{await e()}catch{}finally{n.isConnected&&(n.classList.remove("is-reloading"),l.disabled=!1)}}),a.appendChild(l),r.appendChild(a),n.appendChild(r),n}function ls(i){return i.map(e=>`<button type="button" role="switch" class="sl-a11yrow${e.className?` ${e.className}`:""}${e.on?" on":""}" data-a11y-row="${S(e.key)}" aria-checked="${e.on}" aria-pressed="${e.on}"`+(e.disabled?' disabled aria-disabled="true"':"")+`><span class="sl-a11yrow-i" aria-hidden="true">${S(e.icon)}</span><span class="sl-a11yrow-t"><span class="sl-a11yrow-l">${S(e.label)}</span>`+(e.note?`<span class="sl-a11yrow-n">${S(e.note)}</span>`:"")+"</span>"+(e.count?`<span class="sl-a11yrow-c">${S(e.count)}</span>`:"")+'<span class="sl-a11yrow-s" aria-hidden="true"></span></button>').join("")}function cs(i){let e=document.createElement("div");e.className="sl-floors on",e.setAttribute("role","group"),e.setAttribute("aria-label",i.tf("picker.chooseLevel","Choose level"));let t=[{id:"",name:i.tf("picker.allFloors","All floors")},...i.floors.map(s=>({id:s.id,name:s.name}))];for(let s of t){let o=document.createElement("button");o.type="button",o.dataset.floor=s.id,o.textContent=s.name,o.setAttribute("aria-pressed","false"),o.addEventListener("click",()=>i.onChoose(s.id)),e.appendChild(o)}let n=document.createElement("button");n.type="button",n.className="sl-floor-info",n.textContent="i";let r=i.tf("picker.floorHelp","All floors shows the complete venue. Choose one level to inspect and select its seats.");return n.setAttribute("aria-label",r),n.title=r,e.appendChild(n),e}function ds(i,e,t){if(!i)return;let n=t?"":e;i.querySelectorAll("button[data-floor]").forEach(r=>{r.setAttribute("aria-pressed",String(r.dataset.floor===n))})}import{t as Ne,tCount as Ac}from"@seatlayer/core";var di=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()}wireNavigation(e){e.querySelectorAll("[data-section-nav]").forEach(t=>{t.addEventListener("click",n=>{n.preventDefault(),n.stopPropagation();let r=t.dataset.sectionNav;r&&this.host.controller.focusSection(r)})})}render(e){let t=this.host.map();if(!t)return;if(this.host.root()?.dataset.layout==="narrow"){this.el?.remove(),this.el=null;return}let n=e.categories.length?e.categories.map(h=>{let g=this.host.controller.doc?.categories.find(b=>b.key===h.key);return g?this.host.catPriceRange(g):{min:h.priceMin,max:h.priceMax}}).filter(h=>h!=null):[{min:e.priceMin,max:e.priceMax}],r=Math.min(...n.map(h=>h.min)),s=Math.max(...n.map(h=>h.max)),o=r===s?this.host.money(r):`${this.host.money(r)}\u2013${this.host.money(s)}`,a=Ac("picker.seatsLeftInSection",e.seatsLeft),l=Ne("picker.seatsLeftShort",{count:e.seatsLeft}),c=`<button type="button" class="sl-seccard-x" aria-label="${Ne("picker.closeSectionSummary")}">\u2715</button>`,p=Wr(this.host.sectionNeighbours(e.id)),d={label:e.label,color:e.color,leftLabel:a,leftShortLabel:l,nav:p,close:c};this.el?.remove();let u=document.createElement("div");if(this.collapsed)u.className="sl-seccard mini on",u.setAttribute("role","button"),u.setAttribute("aria-label",Ne("picker.sectionSummaryAria",{label:e.label})),u.innerHTML=is(d),this.wireNavigation(u),u.addEventListener("click",h=>{h.target.closest(".sl-seccard-x")||(this.collapsed=!1,this.shownAt=Date.now(),this.render(e))}),u.querySelector(".sl-seccard-x").addEventListener("click",()=>this.host.controller.overview()),(this.host.region("top-center")??t).appendChild(u);else{u.className="sl-seccard on",u.setAttribute("role","dialog"),u.setAttribute("aria-label",Ne("picker.sectionSummaryAria",{label:e.label}));let h=this.host.priceBandKeys(),g=this.host.suppressPricing(),b=e.categories.map(w=>{let x=this.host.controller.doc?.categories.find(m=>m.key===w.key),y=x?this.host.catPriceRange(x):{min:w.priceMin,max:w.priceMax};return rs({label:w.label,color:w.color,dim:h!=null&&!h.has(w.key),rangeLabel:g?"":y&&y.min!==y.max?`${this.host.money(y.min)}\u2013${this.host.money(y.max)}`:this.host.money(y?.min??w.price)})}).join("");u.innerHTML=ns({...d,priceLabel:o,showPrice:!g&&e.categories.length>0,zoneLabel:e.zoneLabel,entrance:e.entrance?`${Ne("picker.entrance")} ${e.entrance}`:void 0,mix:b,overviewLabel:Ne("picker.overview"),hint:Ne("picker.tapSeatHint")}),this.wireNavigation(u),u.querySelector(".sl-seccard-x").addEventListener("click",()=>this.host.controller.overview()),u.querySelector(".sl-seccard-overview").addEventListener("click",()=>this.host.controller.overview()),(this.host.region("top-center")??t).appendChild(u)}this.el=u}collapse(){!this.el||this.collapsed||!this.current||(this.collapsed=!0,this.render(this.current))}onView(){if(!(!this.el||this.collapsed||!this.current)){if(this.host.controller.getRung()==="seats"){this.collapse();return}if(Date.now()-this.shownAt<1400){this.coverage()>.25&&this.collapse();return}this.collapse()}}coverage(){let e=this.el,t=this.current,n=this.host.map();if(!e||!t||!n)return 0;let r=this.host.activeFloorObjects().find(y=>y.type==="section"&&y.id===t.id)?.outline;if(!r||r.length<3)return 0;let s=r.map(y=>this.host.controller.worldToScreen(y)),o=s.map(y=>y.x),a=s.map(y=>y.y),l=Math.min(...o),c=Math.min(...a),p=Math.max(...o)-l,d=Math.max(...a)-c;if(p<=0||d<=0)return 0;let u=n.getBoundingClientRect(),h=e.getBoundingClientRect(),g=h.left-u.left,b=h.top-u.top,w=Math.max(0,Math.min(g+h.width,l+p)-Math.max(g,l)),x=Math.max(0,Math.min(b+h.height,c+d)-Math.max(b,c));return w*x/(p*d)}};import{t as fi,tCount as $c}from"@seatlayer/core";import{contrastRatio as zc}from"@seatlayer/core/core/color";import{t as ps,tCount as pi}from"@seatlayer/core";function an(i,e,t){try{return new Intl.DateTimeFormat(e,{...t,...i.timezone?{timeZone:i.timezone}:{}}).format(new Date(i.startsAt))}catch{return new Date(i.startsAt).toLocaleString(e)}}var hi=(i,e)=>an(i,e,{dateStyle:"medium"}),ui=(i,e)=>an(i,e,{timeStyle:"short"}),mi=(i,e)=>an(i,e,{weekday:"short",day:"numeric",month:"short"});function hs(i,e,t,n){return!i.length||i.length>=e?null:{summary:n,labels:i.map(r=>`${hi(r,t)} \xB7 ${ui(r,t)}`)}}function Pc(i,e){let t=new Set(e);return i.map(n=>({...n,free:!t.has(n.eventKey)}))}function us(i,e){let t=[...i];if(t.length<=1)return t[0]??"";try{return new Intl.ListFormat(e,{style:"long",type:"conjunction"}).format(t)}catch{return t.join(", ")}}function Lc(i,e,t="",n=!1){if(!i.length)return"";let r=i.map(s=>{let o=s.free?e.free:e.blocked,a=n&&s.free?`<input class="sl-night-choice" type="checkbox" data-pg-event-key="${S(s.eventKey)}" aria-label="${S(`${s.shortDate}: ${o}`)}" checked>`:"";return`<li class="sl-night${s.free?" ok":" no"}" aria-label="${S(`${s.shortDate}: ${o}`)}">`+a+`<i class="sl-night-dot" aria-hidden="true"></i><span class="d">${S(s.shortDate)}</span><span class="st">${S(o)}</span></li>`}).join("");return`<div class="sl-tip-nights"><div class="sl-tip-nights-title">${S(e.title)}</div><ul class="sl-nightstrip">${r}</ul><p class="sl-tip-nights-note">${S(e.notAvailableOn)}</p>`+t+"</div>"}function Mc(i){return i.selectPartialLabel&&i.pinned?`<button type="button" class="sl-tip-switch" data-pg-select-partial>${S(i.selectPartialLabel)}</button>`:i.switchLabel&&i.pinned?`<button type="button" class="sl-tip-switch" data-pg-switch-mode>${S(i.switchLabel)}</button>`:i.switchLabel||i.selectPartialLabel?"":`<p class="sl-tip-advice">${S(i.advice)}</p>`}function Hc(i){return Number(i.available)+Number(i.selected)+Number(i.partial)+Number(i.unavailable)}function ms(i,e,t){if(Hc(i)<2)return"";let n=(s,o,a="")=>`<li class="sl-pg-legend-item"><i class="sl-pg-sw ${s}"${a}></i>${S(o)}</li>`,r=[];return i.available&&r.push(n("sl-pg-sw-free",e.available,` style="background:${S(t)}"`)),i.selected&&r.push(n("sl-pg-sw-sel",e.selected)),i.partial&&r.push(n("sl-pg-sw-split",e.partial,` style="--sl-pg-sw-cat:${S(t)}"`)),i.unavailable&&r.push(n("sl-pg-sw-off",e.unavailable)),`<ul class="sl-pg-legend-list" aria-label="${S(e.title)}">${r.join("")}</ul>`}function fs(i,e){if(!i.length)return"";let t=i.map(n=>{let r=n.labels.length?n.labels.join(", "):e.empty;return`<li class="sl-pg-night-row${n.labels.length?"":" empty"}${n.active?" active":""}" role="button" tabindex="0"${n.active?' aria-current="true"':""} data-event-key="${S(n.eventKey)}"><span class="n">${S(n.name)}</span><span class="s">${S(r)}</span></li>`}).join("");return`<div class="sl-pg-nights" role="group" aria-label="${S(e.title)}"><div class="sl-pg-nights-title">${S(e.title)}</div><ul class="sl-pg-nights-list">${t}</ul></div>`}function ln(i,e){if(i?.kind!=="partial"||!e?.length)return null;let t=i.data?.blockedEventKeys??[],n=Pc(e,t);return{states:n,missing:n.filter(r=>!r.free).map(r=>r.shortDate)}}function gs(i,e){return i?Lc(i.states,{title:v("picker.group.partlyAvailableTitle","Free on some nights only"),free:v("picker.group.nightFree","Free"),blocked:v("picker.group.nightBlocked","Not available"),notAvailableOn:ps("picker.group.notAvailableOn",{dates:us(i.missing,e.locale)})},Mc({switchLabel:e.switchLabel??null,selectPartialLabel:e.selectPartialLabel??null,pinned:e.pinned,advice:v("picker.group.pickSeatFreeEveryNight","Pick a seat that is free every night.")}),!!e.selectPartialLabel&&!!e.pinned):""}function Rc(i,e,t,n){if(!i.length)return"";let r=new Set(e),s=new Set(t),o=i.map(a=>{let l=r.has(a.eventKey);return`<li class="sl-confirm-date${l?"":" blocked"}"><label><input type="checkbox" data-pg-confirm-event-key="${S(a.eventKey)}" aria-label="${S(`${a.shortDate}: ${l?n.available:n.unavailable}`)}"${l&&s.has(a.eventKey)?" checked":""}${l?"":" disabled"}><span class="sl-confirm-date-label">${S(a.shortDate)}</span><span class="sl-confirm-date-state">${S(l?n.available:n.unavailable)}</span></label></li>`}).join("");return`<fieldset class="sl-confirm-dates" data-pg-confirm-dates><legend>${S(n.title)}</legend><p class="sl-confirm-dates-copy">${S(n.copy)}</p><label class="sl-confirm-date-all"><input type="checkbox" data-pg-confirm-all><span>${S(n.selectAll)}</span></label><ul>${o}</ul><p class="sl-confirm-dates-summary" data-pg-confirm-summary aria-live="polite"></p></fieldset>`}function bs(i,e,t,n){let r=e.availableEventKeys(t);return Rc(i,r,e.includedEventKeys(),{title:n("picker.group.confirmDatesTitle","Choose performance dates"),copy:r.length===i.length?n("picker.group.confirmAllDatesCopy","This seat is available for all {count} dates. Keep all selected, or remove dates you do not want.").replace("{count}",String(i.length)):n("picker.group.confirmPartialDatesCopy","This seat is available for {available} of {total} dates. Choose one date or keep every available date.").replace("{available}",String(r.length)).replace("{total}",String(i.length)),selectAll:n("picker.group.confirmSelectAll","Select all available dates"),available:n("picker.group.nightFree","Available"),unavailable:n("picker.group.nightBlocked","Unavailable")})}function vs(i){return[...i.querySelectorAll("[data-pg-confirm-event-key]")].filter(e=>e.checked&&!e.disabled).map(e=>e.dataset.pgConfirmEventKey).filter(Boolean)}function ys(i,e,t,n){let r=[...i.querySelectorAll("[data-pg-confirm-event-key]")];if(!e||!r.length)return;let s=i.querySelector(".sl-confirm-add"),o=i.querySelector("[data-pg-confirm-all]"),a=()=>{let l=r.filter(d=>!d.disabled),c=vs(i).length;o&&(o.checked=c===l.length,o.indeterminate=c>0&&c<l.length);let p=i.querySelector("[data-pg-confirm-summary]");p&&(p.textContent=c===l.length?t("picker.group.confirmAllSelected","All {count} available dates are selected.").replace("{count}",String(c)):t("picker.group.confirmSelectedOfAvailable","{selected} of {available} available dates selected.").replace("{selected}",String(c)).replace("{available}",String(l.length))),s.disabled=c===0,s.textContent=c?e.label(c):t("picker.group.confirmChooseOne","Choose at least 1 date"),n()};r.forEach(l=>l.addEventListener("change",a)),o?.addEventListener("change",()=>{r.filter(l=>!l.disabled).forEach(l=>{l.checked=o.checked}),a()}),a()}async function ws(i,e,t){if(!i||!t||!i.querySelector("[data-pg-confirm-event-key]"))return!0;let n=vs(i);if(!n.length)return!1;let r=i.querySelector(".sl-confirm-add");return r?.setAttribute("aria-busy","true"),r&&(r.disabled=!0),await t.apply(e,n)?!0:(r?.removeAttribute("aria-busy"),r?.isConnected&&(r.disabled=!1),!1)}function xs(i,e,t){return i?ps("picker.group.seatPartlyAvailable",{label:e,free:i.states.length-i.missing.length,total:i.states.length,dates:us(i.missing,t)}):""}function Ss(i,e){let t=i.map((n,r)=>{let s=n.state==="done"?e.done:n.state==="current"?e.current:e.upcoming;return`<li class="sl-pg-step-item" data-step="${S(n.id)}" data-state="${S(n.state)}"${n.state==="current"?' aria-current="step"':""}><span class="i" aria-hidden="true">${n.state==="done"?"\u2713":String(r+1)}</span><span class="l">${S(n.label)}</span><span class="sl-pg-sr">${S(s)}</span></li>`}).join("");return`<ol class="sl-pg-steps" aria-label="${S(e.label)}">${t}</ol>`}function cn(i,e){return`<ul class="sl-pg-cards">${i.map(n=>`<li class="sl-pg-card" data-event-key="${S(n.eventKey)}"><span class="n">${S(n.name)}</span><time datetime="${S(n.iso)}"><span class="d">${S(n.date)}</span><span class="t">${S(n.time)}</span></time></li>`).join("")}</ul><p class="sl-pg-included">${S(e)}</p>`}function ks(i){let e=i.rows.map(t=>`<li class="sl-pg-pane-row${t.labels.length?"":" empty"}" data-event-key="${S(t.eventKey)}"><span class="n">${S(t.name)}</span><span class="s">${S(t.labels.length?t.labels.join(", "):i.empty)}</span></li>`).join("");return`<div class="sl-pg-pane-title">${S(i.title)}</div><ul class="sl-pg-pane-list">${e}</ul>`+(i.note?`<p class="sl-pg-pane-note">${S(i.note)}</p>`:"")+(i.total?`<div class="sl-pg-pane-total"><span>${S(i.total.label)}</span><b>${S(i.total.amount)}</b></div>`:"")+(i.holdStatus?`<p class="sl-pg-hold-status" role="status">${S(i.holdStatus)}</p>`:"")}function Ts(i){let e=Math.max(0,i);return`${Math.floor(e/6e4)}:${String(Math.floor(e/1e3)%60).padStart(2,"0")}`}function Es(i,e){if(!i||i.seats<=0)return"";if(e==="same_seat"){let t=i.perPerformance??i.seats;return i.totalPerformances&&i.performances<i.totalPerformances?pi("picker.group.performancesChosenOf",t,{chosen:i.performances,total:i.totalPerformances}):pi("picker.group.seatsEveryPerformance",t)}return i.perPerformance!=null&&i.performancesChosen===i.performances?pi("picker.group.seatsPerPerformance",i.seats,{per:i.perPerformance}):pi("picker.group.performancesChosenOf",i.seats,{chosen:i.performancesChosen,total:i.performances})}function Cs(i,e){i.querySelectorAll(".sl-pg-night-row[data-event-key]").forEach(t=>{let n=()=>e(t.dataset.eventKey);t.addEventListener("click",n),t.addEventListener("keydown",r=>{r.key!=="Enter"&&r.key!==" "||(r.preventDefault(),n())})})}import{t as Oc}from"@seatlayer/core";function he(i){return String(i??"\u2014").replace(/[&<>"]/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[e])}function Ic(i,e){let t=i.objectType==="table"&&!!i.bookingMode,n=i.objectType==="booth",r=t||n||!i.seatNumber,s=r?i.rowLabel??i.displayLabel??i.label:i.seatNumber,o=t?`${v("picker.guests","Guests")} ${i.bookingMode==="variable"?`${i.minOccupancy}\u2013${i.maxOccupancy}`:i.capacity}`:!n&&i.rowLabel?`${e} ${U(i)??""}`.trim():"";return`<div class="sl-tip-head"><div class="sl-tip-id"><span class="sl-tip-seat${r?" name":""}">${he(s)}</span>`+(o?`<span class="sl-tip-row">${he(o)}</span>`:"")+"</div>"+(i.sectionLabel?`<div class="sl-tip-sec"><span class="sl-tip-eyebrow">${v("picker.section","Section")}</span><span class="sl-tip-secname">${he(i.sectionLabel)}</span></div>`:"")+"</div>"}function As(i,e){let t=i.status==="not_for_sale",n=i.mark?.kind==="partial",r=i.status==="free"||n?"":`<span class="sl-tip-tag">${t?v("picker.notAvailable","Not available"):i.status==="held"?Oc("map.statusHeld"):v("picker.sold","Sold")}</span>`,s=t?"":e.price,o=s?`<span class="sl-tip-amt">${he(s)}</span>`:"",a=!s&&e.priceNote?`<div class="sl-tip-note">${he(e.priceNote)}</div>`:"",l=Se(i.commercial),c=l?`<div class="sl-tip-cx"><span class="g" aria-hidden="true">\u25D0</span>${he(l)}</div>`:"",p=st(i.wheelchairSpaceType),d=p?`<div class="sl-tip-cx"><span class="g" aria-hidden="true">\u267F</span>${he(p)}</div>`:"",u=e.reason?`<div class="sl-tip-reason">${he(e.reason)}</div>`:"";return'<i class="sl-tip-rail" aria-hidden="true"></i>'+Ic(i,e.rowTypeWord)+`<div class="sl-tip-cat"><span class="sl-tip-dot" style="background:${he(i.categoryColor)}"></span><span class="sl-tip-name">${he(i.categoryLabel)}</span>`+r+o+"</div>"+a+u+d+c+(e.extra??"")}function Ps(i,e,t,n){let r=i.x+14,s=i.y-n.height-12,o=i.y+18,a=s;r+n.width>e-8&&(r=i.x-n.width-14),s<8&&o+n.height<=t-8&&(a=o);let l=Math.max(8,t-n.height-8);return{left:Math.max(8,Math.min(r,Math.max(8,e-n.width-8))),top:Math.max(8,Math.min(a,l))}}function Ls(i,e,t,n=22){let r=Math.max(8,Math.min(i.x-t.width/2,Math.max(8,e.width-t.width-8))),s=i.y-n-t.height,o=i.y+n;return s>=8?{left:r,top:s,placement:"above"}:o+t.height<=e.height-8?{left:r,top:o,placement:"below"}:{left:r,top:Math.max(8,Math.min(s<8?o:s,Math.max(8,e.height-t.height-8))),placement:s<8?"below":"above"}}var dn=14,_c=12,Dc=12,Bc=8;function Ms(i,e,t,n=_c){let r=e.height-dn-t.height,s=Dc,o=r-n;if(o<=s)return{placement:"sheet",nudgeY:0};let a=(s+o)/2-i;return Math.abs(a)<=Bc?{placement:"sheet",nudgeY:0}:{placement:"sheet",nudgeY:Math.round(a)}}function Hs(i,e,t,n,r=0){let s=t.width/2+12,o=Math.max(s,Math.min(e.width-s,i.x)),a=i.y+r+t.height+24<=e.height,l=i.y-r<t.height+24&&a?"below":"above",c=l==="above"?i.y-r:i.y+r,p=n&&l==="above"?Math.max(t.height+24,c):c;return{left:o,top:Math.max(8,Math.min(e.height-8,p)),placement:l}}function Rs(i,e,t){let n=i.querySelector("[data-pg-select-partial]"),r=[...i.querySelectorAll("[data-pg-event-key]")],s=()=>r.filter(a=>a.checked).map(a=>a.dataset.pgEventKey).filter(Boolean),o=()=>{if(!n)return;let a=s().length;n.disabled=a===0,n.textContent=e?.(a)??n.textContent};r.forEach(a=>{a.addEventListener("change",o);let l=a.closest(".sl-night");l?.classList.add("selectable"),l?.addEventListener("click",c=>{c.target!==a&&(a.checked=!a.checked,o())})}),n?.addEventListener("click",()=>{let a=s();a.length&&t?.(a)})}function Fe(i){let e=i?.displayType?.trim()||i?.rowType?.trim();return e||(i?.objectType==="table"?v("picker.table","Table"):i?.objectType==="booth"?v("picker.booth","Booth"):v("picker.row","Row"))}var Nc="sl-confirm-scrim",Fc="--sl-scrim-mask";function Vc(i){let e=Math.round(i.x),t=Math.round(i.y);return`radial-gradient(circle at ${e}px ${t}px, transparent 0 56px, #000 88px)`}function Os(i,e,t,n){let r=i??document.createElement("div");return i||(r.className=Nc),r.style.setProperty(Fc,Vc(n)),t.parentNode===e?r.nextSibling!==t&&e.insertBefore(r,t):r.parentNode!==e&&e.appendChild(r),r}function pn(i){return i?.remove(),null}var jc=360,Gc=160,qc=700,Is=450;function _s(){try{return globalThis.matchMedia?.("(pointer: coarse)").matches??!1}catch{return!1}}function Uc(i){return zc("#ffffff",i)>=3?"#ffffff":"#0b0f19"}var gi=class{constructor(e){this.el=null;this.seat=null;this.outsideTap=null;this.scrim=null;this.shownAt=0;this.lift=null;this.framing=null;this.mode="add";this.host=e}get element(){return this.el}set element(e){this.el=e}get candidate(){return this.seat}set candidate(e){this.seat=e}thumbHtml(e){let t=this.host.controller.doc;if(!t)return"";let n=rt(e)?e.viewUrl??"":"",r=ai(t);if(!n&&!r)return"";let s=n?null:li(e,e.focalPoint??t.focalPoint);if(!n&&s==null)return"";let o=r&&s!=null?`<div class="sl-confirm-sight">${H(fi("picker.sightline",{m:s}))}</div>`:"";if(!n)return o;let a=H(fi("picker.viewFromSeat",{label:e.label})),l=H(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>`+o}show(e,t="add"){let n=this.host;this.mode=t;let r=this.seat?.id;this.el?.remove(),this.el=null,this.seat=e,n.root()?.setAttribute("data-confirming","true"),n.els().side?.toggleAttribute("inert",!0),Object.values(n.regions()).forEach(L=>L.toggleAttribute("inert",!0)),n.controller.setSelectionFocus(e.id),r&&r!==e.id&&n.controller.deselect([r]),n.hideTooltip();let s=n.controller.seatDetails(e.id),o=n.controller.doc?.categories.find(L=>L.key===e.categoryKey),a=s?.price??(o?.tiers?.length?o.tiers[0].price:o?.price),l=a!=null?n.paidPrice(e.categoryKey,s?.tierId??o?.tiers?.[0]?.id??null,a,e.label):void 0,c=Qr(s,e.displayLabel??e.label,Fe(s)),p=s?.tiers??o?.tiers??[],d=s?.tierId??p[0]?.id,u=n.suppressPricing()?"":ts(p,d,L=>n.money(n.paidPrice(e.categoryKey,L.id,L.price,e.label))),h=n.buyerView()==="venue3d",g=n.performanceGroup()?.confirmDateSelection??void 0,b=g?n.performanceGroup()?.nights?.()??[]:[],w=g?bs(b,g,e.id,(L,C)=>n.tf(L,C)):"";this.shownAt=performance.now();let x=document.createElement("div");x.className="sl-confirm sl-mo-in",t==="remove"&&x.classList.add("sl-confirm-removing"),w&&x.classList.add("sl-confirm-group-dates"),x.setAttribute("role","dialog"),x.setAttribute("aria-label",fi("picker.confirmSeatLabel",{label:e.label}));let y=o?.color??"#6e7bff";x.style.setProperty("--sl-cat",y),x.style.setProperty("--sl-cat-ink",Uc(y));let m=String(s?.categoryLabel??o?.label??e.categoryKey),A=n.controller.categoryAvailability()[e.categoryKey],_=typeof A=="number"&&A>0?$c("picker.leftCount",A):"";x.innerHTML=ss({identityFields:c,identity:Zr(s,e.displayLabel??e.label,Fe(s)),marker:At(s?.wheelchairSpaceType),see3dPill:Jr(n.canOffer3d(),h),categoryColor:o?.color??"#6e7bff",categoryLabel:m,priceLabel:!n.suppressPricing()&&l!=null?n.money(l):"",categoryLeftLabel:_,tierChoices:u,groupDates:w,wheelchair:Kr(s?.wheelchairSpaceType),commercial:Ur(e.commercial),thumb:n.seatViewEnabled()&&n.buyerView()!=="venue3d"?this.thumbHtml(e):"",inspect:h?`<div class="sl-confirm-inspect-row">${Xr(e,n.suppressPricing()?`${s?.displayLabel??e.displayLabel??e.label}`:`${s?.displayLabel??e.displayLabel??e.label} \xB7 ${l==null?n.tf("picker.priceNotSupplied","Price not supplied"):n.money(l)}`,h)}${Yr(e,h?n.view3dCompareSeatIds():null)}${on(n.canOffer3d(),h)}</div>`:on(n.canOffer3d(),h),see3dRow:es(n.canOffer3d(),h),cancelLabel:fi("common.cancel"),selectLabel:t==="remove"?n.tf("picker.removeSeat","Remove seat"):n.addSeatLabel(s?.objectType)}),t==="remove"&&x.querySelector(".sl-confirm-add svg path")?.setAttribute("d","M6 6l12 12M18 6L6 18"),n.els().map.appendChild(x),this.el=x;let k=x.querySelector(".sl-confirm-thumb"),M=k?.closest(".sl-confirm-thumbwrap")??null;if(k&&M){let L=!1,C=()=>{if(L||!M.isConnected)return;L=!0;let R=()=>{M.remove(),this.el===x&&n.reanchor()};if(n.reducedMotion()||typeof requestAnimationFrame!="function"){R();return}M.style.height=`${M.offsetHeight}px`,M.classList.add("sl-confirm-thumb-out"),requestAnimationFrame(()=>{M.style.height="0px",M.style.opacity="0"}),setTimeout(R,Gc)};k.addEventListener("error",C),k.addEventListener("load",()=>{k.naturalWidth||C()});let D=e.viewMeta?.previewUrl??e.viewUrl;D?n.resolveAssetUrl(D).then(R=>{if(!(!x.isConnected||this.el!==x)){if(!R){C();return}k.src=R}}).catch(R=>{C(),n.onError(R)}):C()}n.reanchor(),this.liftSeatClearOfSheet(e),x.querySelector(".sl-confirm-view")?.addEventListener("click",()=>{n.openSeatView(e)}),x.querySelector(".sl-confirm-confidence")?.addEventListener("click",L=>{n.openSeatConfidencePassport(e,L.currentTarget instanceof HTMLElement?L.currentTarget:null)}),x.querySelector(".sl-confirm-compare")?.addEventListener("click",()=>n.saveView3dComparisonSeat(e)),x.querySelectorAll("[data-confirm-tier]").forEach(L=>{L.addEventListener("click",()=>{let C=L.dataset.confirmTier,D=p.find(N=>N.id===C);if(!D)return;n.controller.setSeatTier(e.id,D.id),x.querySelectorAll("[data-confirm-tier]").forEach(N=>{N.setAttribute("aria-pressed",String(N===L))});let R=x.querySelector(".sl-confirm-price");R&&(R.textContent=n.money(n.paidPrice(e.categoryKey,D.id,D.price,e.label))),n.reanchor()})}),x.querySelectorAll(".sl-confirm-3d,.sl-confirm-3dpill,.sl-confirm-3drow").forEach(L=>{L.addEventListener("pointerdown",Xt,{once:!0}),L.addEventListener("click",()=>{n.buyerView()==="venue3d"?(n.dismiss(),n.view3dHandle()?.flyToSeat(e.id)):(n.rememberView3dReturnSeat(e),n.dismiss(),n.enter3d(e.id))})}),ys(x,g,(L,C)=>n.tf(L,C),()=>n.reanchor()),x.querySelector(".sl-confirm-add").addEventListener("click",()=>{if(!this.ghostActivation()){if(this.mode==="remove"){this.removeCommitted();return}this.commit()}}),x.querySelector(".sl-confirm-cancel").addEventListener("click",()=>{this.ghostActivation()||this.cancel()}),this.armOutsideTap(x),requestAnimationFrame(()=>{let L=x.querySelector(".sl-confirm-add");L?.focus(),n.liftToastOverConfirm(),n.fitTranslatedRows(),n.inviteCommit(x,L)})}liftSeatClearOfSheet(e){let t=this.host.controller.getRenderer();this.framing={gestures:t?.getCameraGestureCount?.()??0,quietUntil:0},this.frameSeatForSheet(e)}frameSeatForSheet(e){let t=this.host,n=t.root();if(!this.el||n?.dataset.layout!=="narrow"||n?.dataset.view3d==="on")return;let r=t.els().map;if(!r)return;let s=t.controller.worldToScreen({x:e.x,y:e.y}),o=t.controller.getRenderer(),a=o?.getCameraGestureCount?.()??0,{nudgeY:l}=Ms(s.y,{height:r.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 p=!t.reducedMotion();o?.panScreenBy?.({x:0,y:l},{animate:p}),this.lift={dy:c+l,gestures:a},this.framing&&(this.framing.gestures=a,this.framing.quietUntil=p?this.now()+qc:0)}reframeSeatForSheet(){let e=this.framing,t=this.seat;!e||!t||e.quietUntil&&this.now()<e.quietUntil||(this.host.controller.getRenderer()?.getCameraGestureCount?.()??e.gestures)!==e.gestures||this.frameSeatForSheet(t)}now(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}settleLift(){let e=this.lift;if(this.lift=null,this.framing=null,!e)return;let t=this.host.controller.getRenderer();(t?.getCameraGestureCount?.()??e.gestures)===e.gestures&&t?.panScreenBy?.({x:0,y:-e.dy},{animate:!this.host.reducedMotion()})}reanchor(){let e=this.host;if(!this.el||!this.seat||e.root()?.dataset.view3d==="on")return;let t=e.controller.worldToScreen({x:this.seat.x,y:this.seat.y}),n=e.els().map;if(e.root()?.dataset.layout==="narrow"){this.el.removeAttribute("data-placement"),this.el.style.removeProperty("bottom"),this.scrim=Os(this.scrim,n,this.el,t),Qn(this.el,t,n),e.liftToastOverConfirm(),this.reframeSeatForSheet();return}this.scrim=pn(this.scrim);let r=n.clientWidth,s=n.clientHeight,o=this.el.offsetWidth||276,a=this.el.offsetHeight||230,l=this.el.classList.contains("sl-confirm-group-dates"),c=e.controller.seatScreenRadius()*1.5,p=Hs(t,{width:r,height:s},{width:o,height:a},l,c);this.el.dataset.placement=p.placement,this.el.style.left=`${p.left}px`,this.el.style.top=`${p.top}px`,qt(this.el,t,{left:p.left,top:p.top,width:o,height:a})}ghostActivation(){return _s()?performance.now()-this.shownAt<Is:!1}armOutsideTap(e){this.disarmOutsideTap();let t=this.host,n=s=>{if(this.el!==e){this.disarmOutsideTap();return}let o=s.target;!o||e.contains(o)||t.els().tray?.contains(o)||this.cancel()};this.outsideTap=n;let r=t.root();setTimeout(()=>{this.outsideTap===n&&(r??document).addEventListener("pointerdown",n,!0)},_s()?Is:0)}disarmOutsideTap(){if(!this.outsideTap)return;let e=this.outsideTap;this.outsideTap=null,(this.host.root()??document).removeEventListener("pointerdown",e,!0),document.removeEventListener("pointerdown",e,!0)}dismiss(){let e=this.host;this.disarmOutsideTap(),this.scrim=pn(this.scrim),this.settleLift(),this.el&&Qe(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)}async commit(){let e=this.host,t=this.seat;if(!t)return;let r=this.el?.querySelector(".sl-confirm-add")??null;if(r?.classList.contains("is-adding")||!await ws(this.el,t.id,e.performanceGroup()?.confirmDateSelection??void 0))return;e.collapseSectionCard(),this.seat=null,e.syncTray(),e.syncSelectionTo3d();let s=()=>{e.dismiss(),Ki(e.els(),e.controller.worldToScreen(t),t,e.controller.doc?.categories)};if(!r||e.reducedMotion()){s();return}r.classList.remove("sl-confirm-add-invite"),r.classList.add("is-adding"),r.setAttribute("aria-disabled","true");let o=r.querySelector(".sl-confirm-add-t");o&&(o.textContent=e.tf("picker.added","Added")),e.scheduleMotion(s,jc)}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;t&&(e.controller.deselect([t.id]),e.dismiss(),e.syncTray(),e.syncSelectionTo3d(),e.root()?.focus({preventScroll:!0}))}};function Ds(i,e,t){if(!e||t)return;e.classList.add("sl-confirm-add-invite");let n=()=>e.classList.remove("sl-confirm-add-invite");i.addEventListener("pointerdown",n,{once:!0}),i.addEventListener("keydown",n,{once:!0}),e.addEventListener("focus",n,{once:!0})}function Bs(i,e){return i&&i!=="seat"?e("picker.select","Select"):e("picker.addSeat","Add seat")}import{pointInPolygon as Kc}from"@seatlayer/core";import{createMinimapTransform as Wc,minimapPointToWorld as Yc,minimapViewportPlan as Xc}from"@seatlayer/core/picker/minimapGeometry";function Qc(i,e){return i.x<=e.x&&i.y<=e.y&&i.x+i.width>=e.x+e.width&&i.y+i.height>=e.y+e.height}function Ns(i,e){let t=new hn(i);return t.build(e),t}var hn=class{constructor(e){this.host=e;this.miniCanvas=null;this.miniBase=null;this.miniWrap=null;this.miniToggle=null;this.miniLabel=null;this.miniTf=null;this.miniDrag=null;this.miniSuppressClick=!1;this.userClosed=!1}dispose(){this.miniToggle?.remove(),this.miniWrap?.remove(),this.miniToggle=null,this.miniWrap=null,this.miniCanvas=null,this.miniBase=null,this.miniLabel=null,this.miniTf=null,this.miniDrag=null,this.host.root()?.removeAttribute("data-minimap-open")}build(e){if(!this.host.controller.getViewport())return;let n=document.createElement("button");n.type="button",n.className="sl-minimap-toggle",n.setAttribute("aria-label",v("picker.openVenueMap","Open venue overview map")),n.setAttribute("aria-expanded","false"),n.innerHTML='<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M3 6l5-2 8 3 5-2v13l-5 2-8-3-5 2zM8 4v13M16 7v13"/></svg>',e.appendChild(n),this.miniToggle=n;let r=document.createElement("div");r.className="sl-minimap",r.setAttribute("role","group");let s=document.createElement("div");s.className="sl-minimap-bar";let o=document.createElement("span");o.className="sl-minimap-label";let a=document.createElement("span");a.className="sl-minimap-key",a.setAttribute("aria-label",v("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",v("picker.closeVenueMap","Close venue overview map")),l.textContent="\xD7",s.append(o,a,l);let c=document.createElement("canvas");c.tabIndex=0,c.setAttribute("role","application"),c.setAttribute("aria-label",v("picker.venueMapInstructions","Venue overview map. Drag the viewport, click a section, or use arrow keys to pan.")),r.append(s,c),e.appendChild(r),this.miniWrap=r,this.miniLabel=o,this.miniCanvas=c;let p=document.createElement("canvas");this.miniBase=p,n.addEventListener("click",()=>{let d=this.host.root()?.dataset.minimapOpen==="true";this.userClosed=d,this.setMinimapOpen(!d)}),l.addEventListener("click",()=>{this.userClosed=!0,this.setMinimapOpen(!1)}),c.addEventListener("click",d=>{if(this.miniSuppressClick){this.miniSuppressClick=!1;return}this.minimapJump(d)}),c.addEventListener("pointerdown",d=>this.minimapPointerDown(d)),c.addEventListener("pointermove",d=>this.minimapPointerMove(d)),c.addEventListener("pointerup",d=>this.minimapPointerUp(d)),c.addEventListener("pointercancel",d=>this.minimapPointerUp(d)),c.addEventListener("keydown",d=>this.minimapKeydown(d)),this.layoutMinimap(),this.syncMinimapLabel(),this.drawMinimapStatic(),this.drawMinimapRect()}setAutoOpen(e){if(this.miniWrap){if(!e){this.userClosed=!1,this.host.root()?.dataset.minimapOpen==="true"&&this.setMinimapOpen(!1,!1);return}this.userClosed||this.host.root()?.dataset.minimapOpen==="true"||this.setMinimapOpen(!0,!1)}}setMinimapOpen(e,t=!0){this.host.root()?.setAttribute("data-minimap-open",String(e)),this.miniToggle?.setAttribute("aria-expanded",String(e)),t&&(e?this.miniCanvas?.focus():this.miniToggle?.focus())}layoutMinimap(){let e=this.miniCanvas,t=this.miniBase,n=this.host.controller.getViewport()?.bounds;if(!e||!t||!n||!(n.width>0&&n.height>0))return;let r=196,s=146,o=6,a=n.width/Math.max(1,n.height),l=r,c=Math.round(r/a);c>s&&(c=s,l=Math.round(s*a)),l=Math.max(64,l),c=Math.max(48,c);let p=Math.min(2,window.devicePixelRatio||1);e.width=Math.round(l*p),e.height=Math.round(c*p),e.style.width=`${l}px`,e.style.height=`${c}px`,t.width=e.width,t.height=e.height,this.miniTf=Wc(n,e.width,e.height,p,o)}syncMinimapLabel(){if(!this.miniLabel||!this.miniWrap)return;let e=this.host.controller.getFloors(),t=this.host.controller.isFloorOverview()?v("picker.allFloors","All floors"):e.find(p=>p.id===this.host.controller.getActiveFloorId())?.name??v("picker.venueOverview","Venue overview"),n=this.host.controller.getMinimapSnapshot().sections,s=n.find(p=>p.active)?.label??this.host.focusedSectionLabel(),o=s?`${t} \xB7 ${s}`:t;this.miniLabel.textContent=o;let a=n.filter(p=>p.state==="selected").length,l=n.filter(p=>p.state==="available").length,c=n.filter(p=>p.state==="inactive").length;this.miniWrap.setAttribute("aria-label",n.length?`${o}. ${a} selected, ${l} available, ${c} inactive sections.`:o),this.miniCanvas?.setAttribute("aria-label",n.length?`${o}. ${a} selected, ${l} available, ${c} inactive sections. ${v("picker.venueMapInstructions","The outlined region is the visible map area. Drag it, click a section, or use arrow keys to pan.")}`:`${o}. ${v("picker.venueMapInstructions","The outlined region is the visible map area. Drag it, click elsewhere, or use arrow keys to pan.")}`)}refreshMinimap(){this.miniBase&&(this.layoutMinimap(),this.syncMinimapLabel(),this.drawMinimapStatic(),this.drawMinimapRect())}drawMinimapStatic(){let e=this.miniBase,t=this.miniTf;if(!e||!t)return;let n=e.getContext("2d");if(!n)return;n.clearRect(0,0,e.width,e.height);let r=d=>d*t.scale+t.offX,s=d=>d*t.scale+t.offY,o=this.host.cssVar("--sl-line")||"rgba(139,147,167,.5)",a=this.host.cssVar("--sl-muted")||"#8b93a7",l=this.host.cssVar("--sl-accent")||"#6e7bff",c=this.host.cssVar("--sl-success")||"#22a06b",p=this.host.controller.getMinimapSnapshot();for(let d of p.sections){if(d.outline.length<3)continue;n.beginPath(),d.outline.forEach((h,g)=>g===0?n.moveTo(r(h.x),s(h.y)):n.lineTo(r(h.x),s(h.y))),n.closePath();let u=d.paint;if(n.globalAlpha=d.state==="inactive"?.5:.92,u?n.fillStyle=u.fill:(n.globalAlpha=d.state==="inactive"?.18:d.state==="selected"?.72:.34,n.fillStyle=d.state==="inactive"?a:d.state==="selected"?l:c),n.fill(),n.globalAlpha=.82,n.lineWidth=Math.max(1,t.dpr),n.strokeStyle=u?.stroke||o,n.stroke(),d.owned){n.globalAlpha=1,n.lineWidth=Math.max(2,t.dpr*1.5),n.strokeStyle=l,n.stroke();let h=d.outline.reduce((g,b)=>({x:g.x+b.x,y:g.y+b.y}),{x:0,y:0});n.beginPath(),n.arc(r(h.x/d.outline.length),s(h.y/d.outline.length),Math.max(1.5,t.dpr*1.6),0,Math.PI*2),n.fillStyle=l,n.fill(),n.beginPath(),d.outline.forEach((g,b)=>b===0?n.moveTo(r(g.x),s(g.y)):n.lineTo(r(g.x),s(g.y))),n.closePath()}d.active&&(n.globalAlpha=1,n.lineJoin="round",n.lineWidth=Math.max(4,t.dpr*3.5),n.strokeStyle=this.host.cssVar("--sl-surface")||"#fff",n.stroke(),n.lineWidth=Math.max(2,t.dpr*1.75),n.strokeStyle=l,n.stroke())}if(n.globalAlpha=1,!p.sections.length){let d=Math.max(1,t.dpr),u=this.host.controller.getRenderer?.(),h=new Map,g=b=>{let w=h.get(b);if(w)return w;let x=u?.categoryDisplayColor?.(b)||c;return h.set(b,x),x};for(let b of p.seats)n.globalAlpha=b.state==="inactive"?.22:.78,n.fillStyle=b.state==="inactive"?a:b.state==="selected"?l:g(b.categoryKey),n.beginPath(),n.arc(r(b.x),s(b.y),d,0,Math.PI*2),n.fill();n.globalAlpha=1}}drawMinimapRect(){let e=this.miniCanvas,t=this.miniBase,n=this.miniTf;if(!e||!t||!n)return;let r=e.getContext("2d");if(!r)return;r.clearRect(0,0,e.width,e.height),r.drawImage(t,0,0);let s=this.host.controller.getViewport();if(!s||Qc(s.visible,s.bounds))return;let o=Xc(s.visible,n,e.width,e.height,Math.max(2,n.dpr*2)),a=this.host.cssVar("--sl-text")||"#12151c",l=this.host.cssVar("--sl-surface")||"#fff";r.save(),r.globalAlpha=.1,r.fillStyle=a,r.fillRect(o.raw.x,o.raw.y,o.raw.width,o.raw.height),r.globalAlpha=.9,r.lineJoin="round",r.lineWidth=Math.max(4,n.dpr*3.25),r.strokeStyle=l,r.strokeRect(o.raw.x,o.raw.y,o.raw.width,o.raw.height),r.globalAlpha=1,r.lineWidth=Math.max(2,n.dpr*1.75),r.strokeStyle=a,r.strokeRect(o.raw.x,o.raw.y,o.raw.width,o.raw.height),o.clipped&&Object.values(o.clippedEdges).some(Boolean)&&(r.setLineDash([Math.max(3,n.dpr*3),Math.max(2,n.dpr*2)]),r.strokeRect(o.clipped.x,o.clipped.y,o.clipped.width,o.clipped.height)),r.restore()}minimapWorldPoint(e){let t=this.miniCanvas,n=this.miniTf;if(!t||!n)return null;let r=t.getBoundingClientRect(),s=(e.clientX-r.left)*(t.width/Math.max(1,r.width)),o=(e.clientY-r.top)*(t.height/Math.max(1,r.height));return{...Yc({x:s,y:o},n),px:s,py:o}}minimapPointerDown(e){let t=this.minimapWorldPoint(e),n=this.host.controller.getViewport()?.visible;!t||!n||!(t.x>=n.x&&t.x<=n.x+n.width&&t.y>=n.y&&t.y<=n.y+n.height)||(this.miniDrag={pointerId:e.pointerId,offsetX:t.x-(n.x+n.width/2),offsetY:t.y-(n.y+n.height/2),startX:e.clientX,startY:e.clientY,moved:!1},this.miniCanvas?.setPointerCapture(e.pointerId),this.miniCanvas?.classList.add("sl-dragging"),e.preventDefault())}minimapPointerMove(e){let t=this.miniDrag;if(!t||t.pointerId!==e.pointerId)return;let n=this.minimapWorldPoint(e);n&&(!t.moved&&Math.hypot(e.clientX-t.startX,e.clientY-t.startY)>2&&(t.moved=!0,this.host.controller.clearSectionFocus()),this.host.controller.panToWorld({x:n.x-t.offsetX,y:n.y-t.offsetY}),e.preventDefault())}minimapPointerUp(e){let t=this.miniDrag;!t||t.pointerId!==e.pointerId||(this.miniSuppressClick=t.moved,this.miniDrag=null,this.miniCanvas?.classList.remove("sl-dragging"),this.miniCanvas?.hasPointerCapture(e.pointerId)&&this.miniCanvas.releasePointerCapture(e.pointerId))}minimapKeydown(e){let t=this.host.controller.getViewport()?.visible;if(!t)return;if(e.key==="Home"){this.host.controller.overview(),e.preventDefault();return}let n=e.key==="ArrowLeft"?-t.width*.2:e.key==="ArrowRight"?t.width*.2:0,r=e.key==="ArrowUp"?-t.height*.2:e.key==="ArrowDown"?t.height*.2:0;!n&&!r||(this.host.controller.clearSectionFocus(),this.host.controller.panToWorld({x:t.x+t.width/2+n,y:t.y+t.height/2+r}),e.preventDefault())}minimapJump(e){let t=this.minimapWorldPoint(e);if(t){for(let n of this.host.controller.getMinimapSnapshot().sections)if(!(n.state==="inactive"||n.outline.length<3)&&Kc(t,n.outline)){this.host.controller.focusSection(n.id);return}this.host.controller.clearSectionFocus(),this.host.controller.panToWorld(t)}}};import{t as un}from"@seatlayer/core";var Zc=12;function Fs(i,e){let t=e.floors(),n=new Set(t.map(k=>k.label.trim().toLocaleLowerCase())),r=e.zones().filter(k=>k.seatCount>0&&!n.has(k.label.trim().toLocaleLowerCase())),s=e.sections().filter(k=>k.seatCount>0&&!n.has(k.label.trim().toLocaleLowerCase())),o=r.length>1?[]:s,a=t.length>1,l=r.length>1,c=o.length>1;if(!a&&!l&&!c)return null;let p=document.createElement("div");p.className="sl-view3d-nav";let d=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>',g=document.createElement("span");u.innerHTML=h,u.appendChild(g);let b=()=>{for(let k of p.querySelectorAll(":scope > div")){let M=k.querySelector('[aria-pressed="true"]');!M||k.scrollWidth<=k.clientWidth||M.scrollIntoView({block:"nearest",inline:"nearest"})}},w=()=>{if(d)return d;for(let k of p.querySelectorAll(":scope > div")){let M=k.querySelector('button[aria-pressed="true"]'),L=M?.textContent?.trim();if(L&&M?.dataset.floor!=="")return L}return a&&(l||c)?v("picker.levelsAndAreas","Levels & areas"):a?v("picker.levels","Levels"):v("picker.areas","Areas")},x=k=>{p.classList.toggle("is-open",k),u.setAttribute("aria-expanded",String(k)),k&&typeof requestAnimationFrame=="function"&&requestAnimationFrame(b),g.textContent=w()};u.addEventListener("click",()=>x(!p.classList.contains("is-open"))),p.addEventListener("keydown",k=>{k.key!=="Escape"||!p.classList.contains("is-open")||(k.preventDefault(),k.stopPropagation(),x(!1),u.focus())});let y=document.createElement("button");y.type="button",y.className="sl-view3d-nav-close",y.innerHTML='<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M18 6L6 18M6 6l12 12"/></svg>';let m=v("picker.closeVenueNavigation","Close venue navigation");y.setAttribute("aria-label",m),y.title=m,y.addEventListener("click",()=>{x(!1),u.focus()}),x(!1),p.appendChild(u);let A=k=>{},_=k=>{};if(a){let k=document.createElement("div");k.setAttribute("role","group"),k.setAttribute("aria-label",v("picker.levels","Levels"));let M=[];_=D=>{M.forEach(R=>{R.setAttribute("aria-pressed",String((R.dataset.floor===""?null:Number(R.dataset.floor))===D))})};let L=D=>{e.focusFloor(D)&&(_(D),A(D))},C=(D,R)=>{let N=document.createElement("button");N.type="button",N.textContent=D,N.dataset.floor=R===null?"":String(R),N.setAttribute("aria-pressed",String(R===null)),N.addEventListener("click",()=>{L(R),x(!1)}),M.push(N),k.appendChild(N)};C(v("picker.allLevels","All levels"),null);for(let D of t)C(D.label||un("picker.levelNumber",{number:D.index+1}),D.index);p.appendChild(k)}if(l||c){let k=document.createElement("div");k.setAttribute("role","group"),k.setAttribute("aria-label",v("picker.areas","Areas"));let M=l?r.map(C=>({id:C.id,label:C.label||C.id,go:()=>{e.focusZone(C.id)}})):o.map(C=>({id:C.id,label:C.label||C.id,floorIndex:C.floorIndex,go:()=>{e.focusSection(C.id),Number.isFinite(C.floorIndex)&&_(C.floorIndex)}})),L=C=>{let D=l||C===null?M:M.filter(R=>R.floorIndex===void 0||R.floorIndex===C);if(k.replaceChildren(),!D.length){k.remove();return}if(k.isConnected||p.insertBefore(k,y.isConnected?y:null),!l&&D.length>Zc){let R=document.createElement("select");R.setAttribute("aria-label",v("picker.jumpToSection","Jump to section"));let N=document.createElement("option");N.value="",N.textContent=v("picker.jumpToSection","Jump to section"),R.appendChild(N);for(let te of D){let j=document.createElement("option");j.value=te.id,j.textContent=te.label,R.appendChild(j)}R.addEventListener("change",()=>{D.find(te=>te.id===R.value)?.go()}),k.appendChild(R);return}for(let R of D){let N=document.createElement("button");N.type="button",N.textContent=R.label,N.dataset.area=R.id,N.addEventListener("click",()=>{d=R.label,R.go(),x(!1)}),k.appendChild(N)}};A=L,L(null)}return p.appendChild(y),i.appendChild(p),p}var bi=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",v("picker.savedSeatComparison","Saved seat comparison"));let s=document.createElement("button");s.type="button",s.className="main",s.addEventListener("click",()=>{this.host.savedSeatIds().length>1?this.host.openComparison():this.host.toast(v("picker.chooseAnotherToCompare","Choose another seat to compare."),"neutral")});let o=document.createElement("button");o.type="button",o.className="clear",o.textContent="\xD7",o.setAttribute("aria-label",v("picker.clearSavedSeatComparison","Clear saved seat comparison")),o.addEventListener("click",()=>this.host.clearComparison()),t.append(s,o),e.appendChild(t),this.chip=t}let n=this.host.savedSeatIds().length,r=t.querySelector(".main");r&&(r.textContent=n>1?un("picker.compareCount",{count:n}):v("picker.oneSeatSaved","1 seat saved"),r.setAttribute("aria-label",n>1?un("picker.openComparisonOfSeats",{count:n}):v("picker.oneSeatSavedChooseAnother","One seat saved; choose another to compare")))}remove(){this.chip?.remove(),this.chip=null}mainButton(){return this.chip?.querySelector(".main")??null}};function Vs(i){return!i?.querySelector('[data-ref="zfs"]')}var $s="sl:sheet-hint";function zs(i){let e=i.boot;if(!e?.isConnected)return;if(i.reducedMotion){e.remove();return}e.classList.add("is-going"),setTimeout(()=>e.remove(),200);let t=document.createElement("div");t.className="sl-shells-in",t.setAttribute("aria-hidden","true"),i.map?.appendChild(t),setTimeout(()=>t.remove(),650),i.rail?.classList.add("is-in"),i.root?.classList.add("is-arriving"),setTimeout(()=>{i.rail?.classList.remove("is-in"),i.root?.classList.remove("is-arriving"),Jc(i.root)},900)}function Jc(i){if(!i||i.dataset.layout!=="narrow")return;try{if(window.sessionStorage.getItem($s))return;window.sessionStorage.setItem($s,"1")}catch{}let e=i.querySelector(".sl-sheet-grab");e&&(e.classList.add("sl-mo-hint"),e.addEventListener("animationend",()=>e.classList.remove("sl-mo-hint"),{once:!0}))}function js(i,e){i.addEventListener("keydown",t=>{if(t.key==="Escape"){for(let n of e())if(n.open()){t.preventDefault(),t.stopPropagation(),n.close();return}}})}function vi(i){let e=i.committedSelection(),t=i.controller.getGAAreas(),n=i.hold?.items??[],r=new Set(n.map(u=>u.label)),s=nr(i,t,n),o=Le(i.gaQty,n),a=n.reduce((u,h)=>u+i.paidPrice(h.categoryKey,h.tierId,h.unitPrice,h.label)*(h.quantity??1),0),l=n.reduce((u,h)=>u+(h.quantity??1),0),c=e.filter(u=>!r.has(u.label)),p=c.reduce((u,h)=>u+i.paidPrice(h.categoryKey,h.tierId??null,h.price,h.label)*(h.quantity??1),0)+s+a,d=c.reduce((u,h)=>u+(h.quantity??1),0)+o+l;return{seats:e,freshSeats:c,gaAreas:t,heldItems:n,heldLabels:r,heldCount:l,total:p,count:d}}function yi(i,e){let t=e.tiers?.length?e.tiers[0].price:e.price;return t===void 0||!e.key?t:i.paidPrice(e.key,e.tiers?.[0]?.id??null,t)}function wi(i,e){let t=e.tiers?.length?e.tiers.map(n=>i.paidPrice(e.key,n.id??null,n.price)):e.price==null?[]:[i.paidPrice(e.key,null,e.price)];if(e.key)for(let n of i.pricesByChannel.values())for(let r of n)r.categoryKey===e.key&&t.push(r.price);return t.length?{min:Math.min(...t),max:Math.max(...t)}:void 0}var Pt="seatlayer_";function ed(){let i=globalThis;return i.document?.modelContext??i.navigator?.modelContext??null}function re(i,e){return e?{ok:!1,reason:i,message:e}:{ok:!1,reason:i}}function td(i){return Array.isArray(i)?i.filter(e=>typeof e=="string"&&!!e):[]}function id(i,e){let t=i.event();if(!t)return re("not_loaded","The seat map has not finished loading.");let n=i.selectionLimits();return{ok:!0,event:t,selection:{max:n.max,...n.required!=null?{required:n.required}:{}},categories:i.categories(),zones:i.zones(),hasPremiumSeats:i.hasPremiumSeats(),holdsAllowed:e}}function Gs(i,e){let t=r=>!!r&&r.toLowerCase()===e.toLowerCase(),n=i.find(r=>t(r.key??r.id))??i.find(r=>t(r.label));return n?.key??n?.id??null}function qs(i,e){let t=e.map(n=>i.describeSeat(n.id));return{seatIds:e.map(n=>n.id),labels:e.map(n=>n.label),section:t[0]?.section??"",row:t[0]?.row??"",seats:e.map((n,r)=>t[r]?.seat||n.label),category:t[0]?.category??e[0].categoryKey,unitPrice:e[0].price,total:e.reduce((n,r)=>n+r.price,0)}}function nd(i,e,t){let n=new Map;for(let s of e){let o=n.get(s.rowKey);o?o.push(s):n.set(s.rowKey,[s])}let r=[];for(let s of n.values()){let o=[...s].sort((l,c)=>l.index-c.index),a=0;for(let l=1;l<=o.length;l++)if(l===o.length||o[l].index!==o[l-1].index+1||o[l].categoryKey!==o[l-1].categoryKey){for(let p=a;p+t<=l;p+=t)r.push(qs(i,o.slice(p,p+t)));a=l}}return r}function rd(i,e,t){let n=new Map;for(let s of e){let o=n.get(s.sectionKey);o?o.push(s):n.set(s.sectionKey,[s])}let r=[];for(let s of n.values()){if(s.length<t)continue;let o=[...s].sort((a,l)=>a.price!==l.price?l.price-a.price:a.rowKey.localeCompare(l.rowKey)||a.index-l.index);r.push(qs(i,o.slice(0,t)))}return r}function sd(i,e){if(!i.event())return re("not_loaded","The seat map has not finished loading.");let n=i.selectionLimits(),r=Math.floor(Number(e.count));if(!Number.isInteger(r)||r<1||r>n.max)return re("bad_count",`count must be a whole number between 1 and ${n.max}.`);let s=Number.isInteger(Number(e.limit))?Math.max(1,Math.min(20,Number(e.limit))):5,o=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,p=l?Gs(i.categories(),l):null;if(l&&!p)return re("no_match",`No ticket type called "${l}".`);let d=c?Gs(i.zones(),c):null;if(c&&!d)return re("no_match",`No zone called "${c}".`);let u=i.seats().filter(b=>b.available);if(!u.length)return re("sold_out");let h=u.filter(b=>(!p||b.categoryKey===p)&&(!d||b.zoneId===d)&&(a==null||b.price<=a));if(!h.length)return re("no_match");let g=o?nd(i,h,r):rd(i,h,r);return g.length?(g.sort((b,w)=>w.unitPrice!==b.unitPrice?w.unitPrice-b.unitPrice:b.row.localeCompare(w.row)||b.labels[0].localeCompare(w.labels[0])),{ok:!0,groups:g.slice(0,s),searched:{count:r,filters:{...a!=null?{max_price:a}:{},...p?{category:p}:{},...d?{zone:d}:{},together:o}}}):re(o?"not_enough_together":"no_match")}function Us(i){return{ok:!0,...i.selection()}}function od(i,e){let t=i.event();if(!t)return re("not_loaded","The seat map has not finished loading.");if(t.salesClosed)return re("event_closed","Sales are closed for this event.");let n=td(e.seat_ids);return n.length?(i.clearSelection(),i.selectObjects(n),Us(i)):re("nothing_requested","Pass one or more seat ids or labels in seat_ids.")}function ad(i,e){let t=async r=>{try{return await r()}catch(s){return re("error",s instanceof Error?s.message:String(s))}},n=[{name:`${Pt}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(()=>id(i,e))},{name:`${Pt}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:r=>t(()=>sd(i,r))},{name:`${Pt}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:r=>t(()=>od(i,r))},{name:`${Pt}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(()=>Us(i))}];return e&&n.push({name:`${Pt}hold_selection`,title:"Reserve the selected seats",description:"Reserve the currently selected seats for this buyer for a limited time, exactly as pressing the checkout button would. Confirm with the buyer before calling this.",inputSchema:{type:"object",properties:{},additionalProperties:!1},annotations:{readOnlyHint:!1,untrustedContentHint:!0},execute:()=>t(()=>i.hold())}),n}async function Ks(i,e={}){let t=ed();if(!t||typeof t.registerTool!="function")return null;let n=new AbortController,r=ad(i,!!e.holds),s=[],o=e.exposedTo?.length?[...new Set(e.exposedTo)]:void 0;try{for(let a of r)await t.registerTool(a,{signal:n.signal,...o?{exposedTo:o}:{}}),s.push(a.name)}catch(a){console.warn("seatmap: WebMCP tools could not be registered",a)}return s.length?{names:s,dispose:()=>{if(n.abort(),typeof t.unregisterTool=="function")for(let a of s)try{t.unregisterTool(a)}catch{}}}:null}async function Ws(i){let e=i.opts.webMcp;if(!e||i.destroyed)return;let t=typeof e=="object"&&!!e.holds,n=typeof e=="object"?e.exposedTo:void 0;try{i.webMcp=await Ks(fn(i,t),{holds:t,exposedTo:n}),i.destroyed&&mn(i)}catch(r){console.warn("seatmap: WebMCP registration failed",r)}}function mn(i){i.webMcp?.dispose(),i.webMcp=null}function fn(i,e){let t=(n,r)=>{if(Number.isInteger(n.logicalSeatIndex))return n.logicalSeatIndex;let s=n.id.lastIndexOf(":"),o=s<0?NaN:Number(n.id.slice(s+1));return Number.isFinite(o)?o:r};return{event:()=>{let n=i.renderInfo;return n?{name:n.eventName??"",venue:n.venue??null,startsAt:n.startsAt??null,timezone:n.timezone??null,currency:i.currency,salesClosed:i.salesClosed}:null},selectionLimits:()=>({max:i.maxTickets,required:i.exactTickets}),categories:()=>{let n=i.controller.categoryAvailability();return(i.controller.doc?.categories??[]).filter(r=>!r.notForSale).map(r=>{let s=wi(i,r),o=yi(i,r);return{key:r.key,label:r.label??r.key,...o===void 0?{}:{price:o},...s&&s.min!==s.max?{priceRange:s}:{},available:n[r.key]??0}})},zones:()=>i.controller.getBestAvailableZones(),hasPremiumSeats:()=>i.controller.hasPremiumSeats(),seats:()=>{let n=i.controller.getActiveFloorId(),r=[];return i.allSeats().forEach((s,o)=>{if(s.floorId&&n&&s.floorId!==n)return;let a=i.controller.getStatus(s.id)??"free",l=i.controller.doc?.categories.find(p=>p.key===s.categoryKey),c=l?.tiers?.length?l.tiers[0].price:l?.price??0;r.push({id:s.id,label:s.label,rowKey:s.logicalRowId??s.rowId,sectionKey:s.sectionId??s.rowId,index:t(s,o),categoryKey:s.categoryKey,price:i.paidPrice(s.categoryKey,l?.tiers?.[0]?.id??null,c,s.label),...s.zoneId?{zoneId:s.zoneId}:{},available:a==="free"&&!l?.notForSale})}),r},describeSeat:n=>{let r=i.controller.seatDetails(n);return r?{section:r.sectionLabel??"",row:U(r)??"",seat:r.seatNumber??r.label,category:r.categoryLabel??r.categoryKey}:null},selection:()=>{let{freshSeats:n,total:r,count:s}=vi(i);return{seats:n.map(o=>({id:o.id,label:o.label,section:o.sectionLabel??"",row:U(o)??"",seat:o.seatNumber??o.label,category:o.categoryKey,price:i.paidPrice(o.categoryKey,o.tierId??null,o.price,o.label)})),count:s,total:r,currency:i.currency,hold:i.hold?{id:i.hold.holdId,expiresAt:i.hold.expiresAt}:null,validity:i.getSelectionValidity()}},clearSelection:()=>i.clearSelection(),selectObjects:n=>{i.selectObjects(n)},hold:()=>e?ld(i):Promise.resolve({ok:!1,reason:"not_allowed"})}}async function ld(i){if(i.salesClosed)return{ok:!1,reason:"event_closed"};if(!i.totalTicketCount())return{ok:!1,reason:"nothing_selected"};let e=i.controller.getSelectionValidity(i.totalTicketCount());return e&&!e.isValid?{ok:!1,reason:"invalid_selection"}:(await i.handleCta(),i.hold?{ok:!0,hold:{id:i.hold.holdId,expiresAt:i.hold.expiresAt}}:{ok:!1,reason:"hold_failed"})}function gn(i){return{renderingTimeMillis:i.ms,performanceProfile:i.performanceProfile,seatCount:i.seatCount,objectCount:i.objectCount,sectionCount:i.sectionCount,view:i.view,eventKey:i.eventKey,chartName:i.chartName,floorCount:i.floorCount,transport:i.transport,load:i.load,metricScope:i.metricScope,operationalTelemetryReporter:"sdk"}}function Ys(i,e){xe({apiBase:i.apiBase,event:i.eventKey,scope:i.metricScope,surface:i.surface,outcome:"success",ms:i.ms,performanceProfile:i.performanceProfile,chartDelivery:i.chartDelivery,seats:i.seatCount,floors:i.floorCount,view:i.view,load:i.load,transport:i.transport}),e("chart_rendered",gn(i))}import{seatConfidenceDisclosure as cd}from"@seatlayer/core/core/seatConfidence";function Y(i){return String(i??"").replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#39;")}function Xs(i){let e=cd(i.seat.confidenceEvidence),t=i.seat.confidenceEvidence,n=e.limitations.length?`<h4>Known limits</h4><ul>${e.limitations.map(c=>`<li>${Y(c)}</li>`).join("")}</ul>`:"",r=e.modeledTarget?`<div><dt>Modeled target</dt><dd>${Y(e.modeledTarget)}</dd></div>`:"",s=t?`<div><dt>Evidence ID</dt><dd>${Y(t.evidenceId)}</dd></div><div><dt>Model version</dt><dd>${Y(t.modelVersion)}</dd></div><div><dt>Event configuration</dt><dd>${Y(t.eventConfigurationId??"Not configuration-specific")}</dd></div><div><dt>Approval</dt><dd>${Y(t.approvedByRole??"No external approval supplied")}</dd></div>`+(t.validUntil?`<div><dt>Valid until</dt><dd>${Y(t.validUntil.slice(0,10))}</dd></div>`:""):"<div><dt>Evidence ID</dt><dd>None supplied</dd></div>",o=Se(i.seat.commercial)||i.restrictionFallback,a=`<div><dt>View restriction</dt><dd>${Y(o)}</dd></div>`+(i.seat.commercial?.note?`<div><dt>Organizer note</dt><dd>${Y(i.seat.commercial.note)}</dd></div>`:""),l=i.canReport?'<button type="button" data-report>Report this view</button><p data-report-status role="status" aria-live="polite"></p>':"";return`<div class="sl-view3d-passport-scrim" aria-hidden="true"></div><section class="sl-view3d-passport" role="dialog" aria-modal="true" aria-labelledby="sl-view3d-passport-title"><header><div><span>Seat confidence passport</span><strong id="sl-view3d-passport-title">${Y(i.title)}</strong></div><button type="button" data-close aria-label="Close seat confidence passport">\xD7</button></header><div class="sl-view3d-passport-summary"><strong>${Y(e.headline)}</strong><span>${Y(e.coverage)} \xB7 ${Y(e.freshness)}</span></div><dl><div><dt>Model status</dt><dd>${Y(e.model)}</dd></div><div><dt>Reality evidence</dt><dd>${Y(e.reality)}</dd></div><div><dt>Source</dt><dd>${Y(e.provenance)}</dd></div>`+a+r+s+`</dl>${n}<p class="sl-view3d-passport-note">This passport describes supplied evidence and known limits. It does not guarantee that every temporary obstruction or real-world condition is knowable before the event build.</p>`+l+"</section>"}function Qs(i){return i?i.closest("[data-report]")?"report":i.closest("[data-close]")||i.classList.contains("sl-view3d-passport-scrim")?"close":null:null}function xi(i,e,t){let n=i?.querySelector("[data-report]"),r=i?.querySelector("[data-report-status]");n&&(n.disabled=e!=="failed",n.textContent=e==="received"?"Report received":"Report this view"),r&&(r.setAttribute("role",e==="failed"?"alert":"status"),r.textContent=e==="sending"?"Sending report\u2026":e==="received"?`Report received. Reference ${t??""}.`:"The report could not be sent. Please try again.")}function bn(i,e,t=null){let n=i.view3dEl;if(!n)return;Lt(i,!1);let r=e.confidenceEvidence,s=i.controller.seatDetails(e.id),o=document.createElement("div");o.className="sl-view3d-passport-shell",o.innerHTML=Xs({seat:e,title:s?.displayLabel??e.displayLabel??e.label,restrictionFallback:i.tf("picker.noAuthoredRestriction","No organizer-authored restriction"),canReport:typeof i.api.reportViewEvidence=="function"});let a=[...new Set([...n.children,...[...i.els.map.children].filter(u=>u!==n)])].filter(u=>u instanceof HTMLElement),l=a.map(u=>({element:u,inert:u.inert,ariaHidden:u.getAttribute("aria-hidden")}));for(let u of a)u.inert=!0,u.setAttribute("aria-hidden","true");n.appendChild(o),n.classList.add("has-passport"),i.view3dPassportEl=o;let c=o.querySelector(".sl-view3d-passport"),p=()=>[...c.querySelectorAll('button:not(:disabled),[href],[tabindex]:not([tabindex="-1"])')],d=u=>{if(u.key==="Escape"){u.preventDefault(),u.stopPropagation(),u.stopImmediatePropagation(),Lt(i);return}if(u.key!=="Tab")return;let h=p();if(!h.length)return;let g=h[0],b=h[h.length-1];u.shiftKey&&document.activeElement===g?(u.preventDefault(),b.focus()):!u.shiftKey&&document.activeElement===b&&(u.preventDefault(),g.focus())};window.addEventListener("keydown",d,!0),i.view3dPassportCleanup=()=>{window.removeEventListener("keydown",d,!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 u=t?.isConnected?t:i.confirmEl?.querySelector(".sl-confirm-confidence")??i.view3dCompareEl?.querySelector("[data-passport-seat]")??null,h=u?.closest(".sl-confirm,.sl-view3d-compare");h?.isConnected&&(h.inert=!1,h.removeAttribute("aria-hidden")),o.remove(),n.classList.remove("has-passport"),i.view3dPassportEl===o&&(i.view3dPassportEl=null);let g=u??i.view3dCompareEl?.querySelector("[data-passport-seat]")??i.confirmEl?.querySelector(".sl-confirm-confidence")??i.view3dCompareChip.mainButton();(t?.isConnected?t:g)?.focus()},o.addEventListener("click",u=>{let h=Qs(u.target instanceof HTMLElement?u.target:null);h==="close"&&Lt(i),h==="report"&&dd(i,e)}),requestAnimationFrame(()=>p()[0]?.focus()),i.emit3dAnalytics("3d_confidence_passport_opened",{seatId:e.id,evidenceId:r?.evidenceId??null,eventConfigurationId:r?.eventConfigurationId??null,modelLevel:r?.modelLevel??"unverified",realityLevel:r?.realityLevel??"none"})}async function dd(i,e){if(i.api.reportViewEvidence){xi(i.view3dPassportEl,"sending");try{let t=await i.api.reportViewEvidence(i.opts.event,{seatId:e.id,evidenceId:e.confidenceEvidence?.evidenceId});i.emit3dAnalytics("3d_confidence_view_reported",{seatId:e.id,evidenceId:e.confidenceEvidence?.evidenceId??null}),xi(i.view3dPassportEl,"received",t.report.id)}catch{xi(i.view3dPassportEl,"failed")}}}function Lt(i,e=!0){let t=i.view3dPassportCleanup;if(i.view3dPassportCleanup=null,!t){i.view3dPassportEl?.remove(),i.view3dPassportEl=null,i.view3dEl?.classList.remove("has-passport");return}e||(document.activeElement instanceof HTMLElement?document.activeElement:null)?.blur(),t(),e||i.root?.focus({preventScroll:!0})}function Zs(i){let e=i.view3dEl;if(!e||i.view3dCompareSeatIds.length<2)return;Ve(i,!1);let t=i.view3dCompareSeatIds.map(h=>i.view3dComparisonSnapshot(h)).filter(h=>!!h);if(t.length<2){i.clearView3dComparison();return}let n=h=>S(h),r=t.some(h=>!!h.price),s=document.createElement("div");s.className="sl-view3d-compare-shell";let o=t.map((h,g)=>`<article><span>Seat ${g===0?"A":"B"}</span><strong>${n(h.label)}</strong><small>Section ${n(h.section)} \xB7 Row ${n(h.row)}</small><dl>`+(r?`<div><dt>Current price</dt><dd>${n(h.price)}</dd></div>`:"")+`<div><dt>Ticket type</dt><dd>${n(h.category)}</dd></div><div><dt>Availability</dt><dd>${n(h.availability)}</dd></div><div><dt>View source</dt><dd>${n(h.viewSource)}</dd></div><div><dt>View restriction</dt><dd>${n(h.limited)}</dd></div><div><dt>Seat confidence</dt><dd>${n(h.confidence.headline)}</dd></div><div><dt>Reality check</dt><dd>${n(h.confidence.reality)}</dd></div><div><dt>Accessibility</dt><dd>${n(h.accessibility)}</dd></div></dl><div class="sl-view3d-compare-actions"><button type="button" data-passport-seat="${n(h.seat.id)}">Passport</button><button type="button" data-view-seat="${n(h.seat.id)}">View seat</button><button type="button" class="select" data-select-seat="${n(h.seat.id)}"${h.selectable?"":" disabled"}>Select seat</button></div></article>`).join("");s.innerHTML=`<div class="sl-view3d-compare-scrim" aria-hidden="true"></div><section class="sl-view3d-compare" role="dialog" aria-modal="true" aria-labelledby="sl-view3d-compare-title"><header><div><span>Seat inspection</span><strong id="sl-view3d-compare-title">Compare disclosed attributes</strong></div><button type="button" data-close aria-label="Close seat comparison">\xD7</button></header><p class="sl-view3d-compare-note">${r?"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">${o}</div></section>`;let a=document.activeElement instanceof HTMLElement?document.activeElement:null,l=[...e.children].filter(h=>h instanceof HTMLElement),c=l.map(h=>({element:h,inert:h.inert,ariaHidden:h.getAttribute("aria-hidden")}));for(let h of l)h.inert=!0,h.setAttribute("aria-hidden","true");e.appendChild(s),e.classList.add("has-comparison"),i.view3dCompareEl=s;let p=s.querySelector(".sl-view3d-compare"),d=()=>[...p.querySelectorAll('button:not(:disabled),[href],[tabindex]:not([tabindex="-1"])')],u=h=>{if(h.key==="Escape"){h.preventDefault(),Ve(i);return}if(h.key!=="Tab")return;let g=d();if(!g.length)return;let b=g[0],w=g[g.length-1];h.shiftKey&&document.activeElement===b?(h.preventDefault(),w.focus()):!h.shiftKey&&document.activeElement===w&&(h.preventDefault(),b.focus())};window.addEventListener("keydown",u),i.view3dCompareCleanup=()=>{window.removeEventListener("keydown",u);for(let h of c)h.element.inert=h.inert,h.ariaHidden===null?h.element.removeAttribute("aria-hidden"):h.element.setAttribute("aria-hidden",h.ariaHidden);s.remove(),e.classList.remove("has-comparison"),i.view3dCompareEl===s&&(i.view3dCompareEl=null),a?.isConnected?a.focus():i.view3dCompareChip.mainButton()?.focus()},s.querySelector("[data-close]")?.addEventListener("click",()=>Ve(i)),s.querySelectorAll("[data-passport-seat]").forEach(h=>h.addEventListener("click",()=>{let g=h.dataset.passportSeat,b=g?i.allSeats().find(w=>w.id===g):void 0;b&&bn(i,b,h)})),s.querySelectorAll("[data-view-seat]").forEach(h=>h.addEventListener("click",()=>{let g=h.dataset.viewSeat;Ve(i,!1),g&&i.view3dHandle?.flyToSeat(g)})),s.querySelectorAll("[data-select-seat]").forEach(h=>h.addEventListener("click",()=>{let g=h.dataset.selectSeat;g&&pd(i,g)})),requestAnimationFrame(()=>d()[0]?.focus()),i.emit3dAnalytics("3d_comparison_opened",{seatIds:i.view3dCompareSeatIds.slice()})}function Ve(i,e=!0){let t=i.view3dCompareCleanup;if(i.view3dCompareCleanup=null,!t){i.view3dCompareEl?.remove(),i.view3dCompareEl=null,i.view3dEl?.classList.remove("has-comparison");return}e||(document.activeElement instanceof HTMLElement?document.activeElement:null)?.blur(),t(),e||i.root?.focus({preventScroll:!0})}function pd(i,e){if(i.salesClosed){i.toast(i.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}let t=i.allSeats().find(r=>r.id===e);if(!t)return;if(Ve(i,!1),!i.controller.select([e]).length){i.syncSelectionTo3d(),i.toast(i.tf("picker.seatNoLongerAvailable","That seat is no longer available."),"warning");return}i.syncSelectionTo3d(),i.showConfirm(t),i.emit3dAnalytics("3d_comparison_selected",{seatId:e})}import{t as vd}from"@seatlayer/core";import{seatViewDisclosure as yd}from"@seatlayer/core/view3d/crossfade/panorama";import{t as Js}from"@seatlayer/core";var hd=900,ud=450;function md(i){switch(i){case"seat":return v("picker.stopYourSeat","Your seat");case"row":return v("picker.stopYourRow","Your row");case"section":return v("picker.stopYourSection","Your section");default:return v("picker.stopWholeVenue","Whole venue")}}function eo(i,e){let t=document.createElement("button");t.type="button",t.className="sl-view3d-recentre sl-mo-rotate-in",t.textContent="\u25CE";let n=v("picker.recentreOnStage","Recentre on the stage");t.setAttribute("aria-label",n),t.title=n,t.addEventListener("click",()=>{e.handle()?.recentreSeatView()});let r=document.createElement("div");r.className="sl-view3d-stop",r.setAttribute("role","status"),r.setAttribute("aria-live","polite"),i.append(t,r);let s=null,o=null;return{onStopChange(a){if(s&&(clearTimeout(s),s=null),o&&(clearTimeout(o),o=null),!a){r.classList.remove("is-shown"),r.textContent="",o=setTimeout(()=>{o=null,i.classList.remove("is-seat-view")},ud);return}i.classList.add("is-seat-view"),r.textContent=md(a),r.classList.add("is-shown"),s=setTimeout(()=>{s=null,r.classList.remove("is-shown")},hd)},dispose(){s&&(clearTimeout(s),s=null),o&&(clearTimeout(o),o=null),t.remove(),r.remove(),i.classList.remove("is-seat-view")}}}var fd=44,gd=92;function to(i,e,t,n={}){let r=i?.sectionLabel,s=U(i),o=bd(i,e),a=[r,s?Js("picker.rowLabel",{label:s}):null,o?Js("picker.seatLabel",{label:o}):null].filter(Boolean).join(" \xB7 "),l=n.maxChars??(n.narrow?fd:gd);for(let c of[t,n.shortTail??t,null]){let p=[a,c].filter(Boolean).join(" \xB7 ");if(p.length<=l||c==null)return p}return a}function bd(i,e){if(i?.seatNumber)return i.seatNumber;let t=i?.displayLabel??e,n=r=>{!r||!t.startsWith(r)||t.length<=r.length||(t=t.slice(r.length).replace(/^[\s·\-\/_]+/,""))};return n(i?.sectionLabel),n(U(i)),t}import{seatConfidenceDisclosure as wd}from"@seatlayer/core/core/seatConfidence";function io(i,e){i.querySelector(".sl-view3d-unavailable")?.remove();let{tf:t}=e,n=e.status==="held"?{title:t("picker.temporarilyHeld","Temporarily held"),message:t("picker.heldSeatExplanation","Another buyer is holding this seat. It may become available again.")}:e.status==="booked"?{title:t("picker.sold","Sold"),message:t("picker.soldSeatExplanation","This seat has already been booked.")}:{title:t("picker.notForSale","Not for sale"),message:t("picker.notForSaleExplanation","This seat is not included in the current sale.")},r=document.createElement("div");r.className="sl-view3d-unavailable",r.dataset.state=e.visualState,r.setAttribute("role","status"),r.setAttribute("aria-live","polite");let s=document.createElement("span");s.className="sl-view3d-unavailable-eyebrow",s.textContent=e.location;let o=document.createElement("strong");o.textContent=n.title;let a=document.createElement("div");a.className="sl-view3d-unavailable-copy",a.append(s,o);let l=document.createElement("button");l.type="button",l.setAttribute("aria-label",t("picker.closeSeatStatus","Close seat status")),l.textContent="\xD7";let c=document.createElement("p");c.textContent=n.message,r.append(a,l,c),l.addEventListener("click",()=>vn(i)),i.appendChild(r),Ut(r,e.anchor??null)}function vn(i){let e=i?.querySelector(".sl-view3d-unavailable:not([data-leaving])");e&&(e.dataset.leaving="true",Qe(e))}function no(i){return i.buyerView}function ro(i,e,t){if(e==="map"){i.exit3d();return}let n=t?.flyToSeatId;if(i.buyerView==="venue3d"){n?(i.opts.onBuyerViewChange?.({view:"venue3d",seatId:n}),i.view3dHandle?.flyToSeat(n)):t?.resetView&&i.view3dHandle?.focusOverview();return}i.enter3d(n)}function so(i,e){switch(i.controller.getStatus(e.id)){case"held":return"held";case"booked":return"sold";case"not_for_sale":return"dimmed";default:break}return i.priceBandKeys!=null&&!i.priceBandKeys.has(e.categoryKey)||i.controller.accessibilityFilterDims?.(e)||i.limitedViewFilter&&(e.commercial?.restrictedView||e.commercial?.obstructedView)?"dimmed":"available"}function oo(i){if(!i.view3dHandle)return;let e=i.allSeats().map(t=>({seatId:t.id,state:i.seatState3dFor(t)}));i.view3dHandle.setAvailability(e)}function ao(i){i.view3dHandle&&i.view3dHandle.setSelection(i.controller.getSelection().map(e=>e.id))}async function lo(i,e){let t=i.allSeats().find(n=>n.id===e);if(!t)return null;if(t.viewUrl)try{let n=t.viewMeta?.previewUrl,r=!!n&&n!==t.viewUrl,s=r?await i.buyerAssetUrls.resolve(n):null,o=r?t.viewUrl:await i.buyerAssetUrls.resolve(t.viewUrl);return!o||r&&!s?null:{url:o,...s?{previewUrl:s}:{},...r?{resolveUrl:a=>i.buyerAssetUrls.resolve(a)}:{},...t.viewMeta?.sourceWidth!==void 0?{sourceWidth:t.viewMeta.sourceWidth}:{},...t.viewMeta?.sourceHeight!==void 0?{sourceHeight:t.viewMeta.sourceHeight}:{},...t.viewMeta?.previewWidth!==void 0?{previewWidth:t.viewMeta.previewWidth}:{},...t.viewMeta?.previewHeight!==void 0?{previewHeight:t.viewMeta.previewHeight}:{},...t.viewMeta?.variants?.length?{variants:t.viewMeta.variants}:{},...t.viewMeta?.initialBearingDeg!==void 0?{initialBearingDeg:t.viewMeta.initialBearingDeg}:{},...t.viewMeta?.initialPitchDeg!==void 0?{initialPitchDeg:t.viewMeta.initialPitchDeg}:{},...t.viewMeta?.coverage?{coverage:t.viewMeta.coverage}:{},...t.viewMeta?.capturedAt?{capturedAt:t.viewMeta.capturedAt}:{},...t.viewMeta?.sourceLabel?{sourceLabel:t.viewMeta.sourceLabel}:{}}}catch(n){return i.opts.onError?.(n),null}return{url:"",generated:!0,mediaKind:"model",coverage:"exact-seat",sourceLabel:i.tf("picker.chartDerivedModel","Chart-derived model")}}function co(i,e){if(i.salesClosed){i.toast(i.tf("picker.salesClosedToast","Sales are closed for this event."),"warning"),i.syncSelectionTo3d();return}let t=i.allSeats().find(a=>a.id===e);if(!t)return;let n=i.controller.tableSelection(e);if(i.committedSelection().some(a=>n?a.label===n.label:a.id===e)){i.controller.deselect([e]),i.dismissConfirm(),i.syncSelectionTo3d();return}let s=i.controller.getStatus(t.id);if(s==="held"||s==="booked"||s==="not_for_sale"){i.showUnavailable3dSeat(t,i.seatState3dFor(t),s),i.syncSelectionTo3d();return}if(i.dismissUnavailable3dSeat(),!i.controller.select([e]).length){i.syncSelectionTo3d(),i.dismissConfirm();return}if(i.opts.onBuyerViewChange?.({view:"venue3d",seatId:e}),i.flashPickedSeat(e),n){i.showTableDialog(n,!1),i.syncSelectionTo3d();return}i.opts.confirmSelection!==!1?i.showConfirm(t):i.syncTray(),i.syncSelectionTo3d()}function po(i,e){let t=i.allSeats().find(n=>n.id===e);return to(i.controller.seatDetails(e),t?.displayLabel??t?.label??e,i.tf("picker.viewFromYourSeat","view from your seat"),{narrow:i.root?.dataset.layout==="narrow",shortTail:i.tf("picker.fromYourSeat","from your seat")})}function ho(i,e,t,n){let r=i.view3dEl;if(!r)return;let s=i.controller.seatDetails(e.id),o=s?.displayLabel??e.displayLabel??e.label,a=U(s);io(r,{status:n,visualState:t,location:[s?.sectionLabel,a?vd("picker.rowLabel",{label:a}):null,o].filter(Boolean).join(" \xB7 ")||o,tf:(l,c)=>i.tf(l,c)}),i.announceSeat(e)}function uo(i){vn(i.view3dEl)}function mo(i,e){if(i.buyerView!=="venue3d")return;let t=i.view3dCompareSeatIds;t.includes(e.id)||(i.view3dCompareSeatIds=t.length===0?[e.id]:[t[0],e.id]),i.confirmSeat?.id===e.id&&(i.controller.deselect([e.id]),i.dismissConfirm(),i.syncSelectionTo3d(),i.syncTray()),i.view3dCompareChip.sync(),i.emit3dAnalytics("3d_comparison_saved",{seatId:e.id,count:i.view3dCompareSeatIds.length}),i.view3dCompareSeatIds.length>1?i.openView3dComparison():i.toast(i.tf("picker.chooseAnotherToCompare","Seat saved. Choose another seat to compare."),"success")}function fo(i){i.closeView3dComparison(!1),i.view3dCompareSeatIds=[],i.view3dCompareChip.remove(),i.emit3dAnalytics("3d_comparison_cleared")}function go(i,e){let t=i.allSeats().find(h=>h.id===e);if(!t)return null;let n=i.controller.seatDetails(t.id),r=i.controller.doc?.categories.find(h=>h.key===t.categoryKey),s=n?.price??(r?.tiers?.length?r.tiers[0].price:r?.price),o=s!=null?i.paidPrice(t.categoryKey,n?.tierId??r?.tiers?.[0]?.id??null,s,t.label):void 0,a=i.controller.getStatus(t.id),l=a==="held"?i.tf("picker.temporarilyHeld","Temporarily held"):a==="booked"?i.tf("picker.sold","Sold"):a==="not_for_sale"?i.tf("picker.notForSale","Not for sale"):i.tf("picker.available","Available"),c=t.viewUrl?yd({url:t.viewUrl,...t.viewMeta?.coverage?{coverage:t.viewMeta.coverage}:{},...t.viewMeta?.capturedAt?{capturedAt:t.viewMeta.capturedAt}:{},...t.viewMeta?.sourceLabel?{sourceLabel:t.viewMeta.sourceLabel}:{}}):i.tf("picker.chartDerivedSeatEye","Live 3D \xB7 chart-derived seat-eye \xB7 not surveyed"),p=Se(t.commercial)||i.tf("picker.noAuthoredRestriction","No organizer-authored restriction"),d=n?.wheelchairSpaceType?`${st(n.wheelchairSpaceType)} \xB7 metadata, not access certification`:i.tf("picker.noAccessibilityMetadata","No accessibility metadata supplied"),u=wd(t.confidenceEvidence);return{seat:t,label:n?.displayLabel??t.displayLabel??t.label,section:n?.sectionLabel??t.sectionId??"\u2014",row:U(n)??n?.rowLabel??"\u2014",category:n?.categoryLabel??r?.label??t.categoryKey,price:i.suppressPricing||o==null?"":i.money(o),availability:l,selectable:a==null||a==="free",viewSource:c,limited:p,accessibility:d,confidence:u}}async function bo(i,e){if(i.view3dEl||!i.canOffer3d()||!i.els.map)return;let t=i.controller.doc;if(!t)return;i.buyerView="venue3d",i.view3dTargetSeatId=null,i.opts.onBuyerViewChange?.({view:"venue3d",...e?{seatId:e}:{}}),i.root?.setAttribute("data-view3d","on"),i.dismissConfirm(),i.syncProjection(),i.syncTray();let n=document.createElement("div");n.className="sl-view3d sl-mo-zoom",n.setAttribute("role","group"),n.setAttribute("aria-label",i.tf("picker.interactive3dVenueView","Interactive 3D venue view"));let r=document.createElement("button");r.type="button",r.className="sl-view3d-back",r.innerHTML=`<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M15 18l-6-6 6-6"/></svg><span>${i.tf("picker.backToMap","Back to map")}</span>`;let s=r.querySelector("span"),o=c=>{i.view3dTargetSeatId=c;let p=!!c;n.classList.toggle("is-seat-focused",p),i.root&&(i.root.dataset.view3dSeat=p?"on":"off");let d=p?i.tf("picker.backToVenue","Back to venue"):i.tf("picker.backToMap","Back to map");s&&(s.textContent=d),r.setAttribute("aria-label",d)};if(r.addEventListener("click",()=>{if(i.view3dTargetSeatId&&i.view3dHandle){i.view3dHandle.focusOverview();return}i.exit3d()}),i.regions["top-left"]?.prepend(r),i.view3dBack=r,i.publish3dTopInset(),Vs(i.root)){let c=document.createElement("button");c.type="button",c.className="sl-view3d-fs",c.textContent="\u26F6",c.setAttribute("aria-label",i.tf("picker.fullScreen","Full screen")),c.setAttribute("aria-pressed",String(!!document.fullscreenElement||i.fsFallback||i.framedFs)),c.addEventListener("click",()=>i.toggleFullscreen()),n.appendChild(c)}let a=document.createElement("div");a.className="sl-view3d-loading",a.setAttribute("role","status"),a.setAttribute("aria-live","polite"),a.textContent=i.tf("picker.loading3d","Building the 3D venue\u2026"),n.appendChild(a),i.els.map.appendChild(n),i.view3dEl=n,i.view3dCompareChip.sync(),requestAnimationFrame(()=>{n.style.opacity="1"});let l=++i.view3dGen;try{let c=i.allSeats(),[p,d]=await Promise.all([St(),i.controller.loadEventConfiguration()]),u=d?await Jt(d,y=>i.buyerAssetUrls.resolve(y)):null,h=t.theme?.venue3d?.shellAssetUrl,g=await ei(h,y=>i.buyerAssetUrls.resolve(y));if(l!==i.view3dGen||i.buyerView!=="venue3d"||i.view3dEl!==n)return;let b={doc:t,seats:c,...u?{eventConfigurationId:u.id,eventConfiguration:u}:{},...g?{registeredShellGlb:g}:{}};a.textContent=i.tf("picker.building3d","Building venue geometry\u2026");let w=await p.prepareVenue3D(b);if(l!==i.view3dGen||i.buyerView!=="venue3d"||i.view3dEl!==n)return;let x=p.mountVenue3D(n,{...b,prepared:w},{portraitOverviewCrop:!0,arriveAtSeatEye:!0,lookAroundHint:De(),seatViewActionLabel:y=>i.allSeats().find(m=>m.id===y)?.viewUrl?i.tf("picker.openAuthored360","Open venue 360\xB0"):i.tf("picker.lookAroundLive3d","Look around in live 3D"),seatViewCaption:y=>i.seatViewCaption(y),onSeatViewStopChange:y=>i.view3dSeatViewChrome?.onStopChange(y),onSeatPick:y=>i.onView3dSeatPick(y),onSeatInspect:y=>i.onView3dSeatPick(y),onSectionFocusChange:y=>{let m=n.querySelector('select[data-locator="section"]'),A=y??"";!m||m.value===A||(m.value=A,m.dispatchEvent(new Event("change")))},onViewTargetChange:y=>{n.querySelector(".sl-view3d-nav")?.classList.toggle("is-seat-focused",!!y),o(y),i.opts.onBuyerViewChange?.({view:"venue3d",...y?{seatId:y}:{}})},...i.seatViewEnabled()?{getSeatView:y=>new Promise((m,A)=>{let _=()=>{i.seatViewFor3d(y).then(M=>{M?m(M):A(new Error("seat_view_unavailable"))})},k=globalThis.requestIdleCallback;typeof k=="function"?k(_,{timeout:1500}):setTimeout(_,50)})}:{},onAnalytics:(y,m)=>i.emit3dAnalytics(y,m)});i.view3dHandle=x,i.view3dSeatViewChrome=eo(n,{handle:()=>i.view3dHandle}),requestAnimationFrame(()=>a.remove()),i.pushAvailabilityTo3d(),i.syncSelectionTo3d(),i.view3dNav=Fs(i.regions["bottom-left"]??n,x),e&&x.flyToSeat(e)}catch(c){if(l!==i.view3dGen||i.buyerView!=="venue3d"||i.view3dEl!==n)return;i.opts.onError?.(c),i.toast(i.tf("picker.unavailable3d","3D could not start. The seat map is still available."),"warning"),i.exit3d()}}function vo(i){let e=i.regions["top-left"];if(!i.root||!e)return;let t=()=>{!i.root||i.root.dataset.view3d!=="on"||i.root.style.setProperty("--sl-3d-top-inset",`${Math.max(44,Math.ceil(e.offsetHeight))}px`)};t(),typeof requestAnimationFrame=="function"&&requestAnimationFrame(t)}function yo(i){if(i.buyerView!=="venue3d"&&!i.view3dEl)return;i.view3dGen++,i.buyerView="map",i.view3dTargetSeatId=null,i.opts.onBuyerViewChange?.({view:"map"}),i.root?.removeAttribute("data-view3d"),i.closeSeatConfidencePassport(!1),i.closeView3dComparison(!1),i.view3dCompareChip.remove(),i.view3dSeatViewChrome?.dispose(),i.view3dSeatViewChrome=null,i.view3dBack?.remove(),i.view3dBack=null,i.view3dNav?.remove(),i.view3dNav=null,i.root?.removeAttribute("data-view3d-seat"),i.root?.style.removeProperty("--sl-3d-top-inset");try{i.view3dHandle?.dispose()}catch{}i.view3dHandle=null;let e=i.view3dEl;i.view3dEl=null,e&&(e.style.opacity="0",setTimeout(()=>e.remove(),320)),i.syncProjection(),i.syncTray();let t=i.view3dReturnSeat;i.view3dReturnSeat=null,t&&i.committedSelection().some(n=>n.id===t.id)&&i.opts.confirmSelection!==!1&&i.showConfirm(t)}import{t as kd}from"@seatlayer/core";import{t as Si}from"@seatlayer/core";function wo(i){return Array.isArray(i)?i.reduce((e,t)=>t.type==="minimumSelectedPlaces"?Math.max(e,t.minimum):e,0):0}function ki(i,e,t=!1){let n=i.violations[0];return n==="numberOfPlacesToSelect"?i.remaining>0?Si("picker.selectExactMore",{count:i.remaining}):Si("picker.selectExactCount",{count:i.required}):n==="minimumSelectedPlaces"?Si("picker.selectMinimumMore",{count:i.remaining}):t?e("picker.adjustSeatSelection","Adjust seat selection"):n==="consecutiveSeats"?e("picker.selectSeatsTogether","Choose seats together in the same row and ticket category."):Si("picker.orphanHint")}import{t as Ti,tCount as xo}from"@seatlayer/core";function Mt(i){let e=Math.max(0,i),t=Math.floor(e/6e4),n=String(Math.floor(e%6e4/1e3)).padStart(2,"0");return`${t}:${n}`}function So(i){let e=i.performanceLabel?`<div class="sl-chip-when">${H(i.performanceLabel)}</div>`:"",t=i.performanceDates?.labels.length?`<div class="sl-chip-dates"><span class="sl-chip-dates-summary">${H(i.performanceDates.summary)}</span><span class="sl-chip-date-list">${i.performanceDates.labels.map(n=>`<span class="sl-chip-date">${H(n)}</span>`).join("")}</span></div>`:"";return e+Sd(i)+t}function Sd(i){let{d:e,area:t,label:n,objectType:r,quantity:s=1,identity:o}=i,a=m=>String(m??"\u2014").replace(/[&<>"]/g,A=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[A]),l=r==="ga"?"ga":e?.objectType??r,c=o?.displayType?.trim()||e?.displayType?.trim()||t?.displayType?.trim()||(l==="table"?v("picker.table","Table"):l==="booth"?v("picker.booth","Booth"):l==="ga"?v("picker.generalAdmission","General admission"):v("picker.row","Row")),p=o?.rowLabel??o?.displayLabel??e?.rowLabel??e?.displayLabel??t?.label??n,d=i.categoryLabel?.trim()??"",u="",h=[];l==="table"&&o?.bookingMode?(u=`${c} ${p}`,h.push([v("picker.guests","Guests"),String(s)])):l==="ga"?(u=String(t?.displayLabel??p),s>1&&h.push([v("picker.tickets","Tickets"),String(s)])):l==="booth"?(u=e?.sectionLabel??`${c} ${p}`,e?.sectionLabel&&h.push([c,String(p)])):!e?.sectionLabel&&!e?.rowLabel&&!e?.seatNumber?u=String(p):(u=e.sectionLabel??"",e.rowLabel&&h.push([c,String(U(e)??e.rowLabel)]),e.seatNumber&&h.push([v("picker.seat","Seat"),String(e.seatNumber)]));let g=!u&&!!d,b=u||d||String(p),w=!!d&&!g&&d!==b,x=h.map(([m,A])=>`<span class="sl-chip-seg" data-fit-seg><span class="w">${a(m)}</span> <b>${a(A)}</b></span>`);w&&x.push(`<span class="sl-chip-seg" data-fit-seg data-fit-type><span class="w">${a(d)}</span></span>`);let y=[b,...h.map(([m,A])=>`${m} ${A}`),w?d:""].filter(Boolean).join(" \xB7 ");return`<div class="sl-chip-id"><span class="sl-sr">${a(y)}</span><span class="sl-chip-name" aria-hidden="true">${a(b)}</span>`+(x.length?`<span class="sl-chip-pos" aria-hidden="true">${x.join("<i>\xB7</i>")}</span>`:"")+"</div>"}function yn(i,e){let t=H(i),n=e?H(e):"";return'<div class="sl-chip-rail">'+(e?`<button type="button" class="view" data-view-label="${n}" aria-label="${H(Ti("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 ko(i){return i.salesClosed||i.hasHold||i.ctaPhase!=="idle"||i.formOpen||i.room<=0?null:Math.max(1,Math.min(i.wanted,i.room))}function To({count:i,total:e,pendingCount:t,ctaPhase:n,hasHold:r,salesClosed:s,suppressPricing:o=!1,fromPrice:a,addMore:l,offerFind:c=!1,holdTime:p,money:d}){if(i&&n==="holding")return`<span>${v("picker.securingSeats","Securing your seats\u2026")}</span>`;if(i&&n==="checkout")return o?`<span>${v("picker.seatsSecuredOpeningCheckout","Seats secured. Opening checkout\u2026")}</span>`:`<span>${Ti("picker.peekSecured",{count:i,total:d(e)})}</span>`;if(i)return`<span class="sl-peek-sum">${xo("picker.ticketsCount",i)}</span>`+(l&&!o?`<button type="button" class="go ghost sl-sheet-go sl-sheet-best" data-act="best" aria-label="${v("picker.findTogetherInstead","Find seats together instead")}"><span aria-hidden="true">\u2726</span>${v("picker.seatsTogether","Seats together")}</button>`:"")+`<button type="button" class="go sl-sheet-go" data-act="checkout">${r&&t?v("picker.secureMore","Secure more"):v("picker.continue","Continue")}`+(o?"":`<span class="sl-peek-total">${d(e)}</span>`)+(r&&p?`<span class="sl-peek-time" aria-hidden="true">${p}</span>`:"")+"</button>";if(s)return`<span>${v("picker.salesClosedPill","Sales are closed")}</span>`;let u=!o&&a!=null?d(a):null;return`<span class="sl-peek-sum">${u!=null?Ti("picker.peekFromPrice",{price:u}).replace(u,`<b class="sl-peek-price">${u}</b>`):v("picker.pickYourSeats","Pick your seats")}</span>`+(c?`<button type="button" class="go sl-sheet-go sl-sheet-find" data-act="find"><span class="sl-peek-spark" aria-hidden="true">\u2726</span>${v("picker.findSeats","Find seats")}</button>`:"")}function Eo(i){return i.confirming?`<div class="sl-ba" role="alert"><div class="sl-ba-title"><span class="spark" aria-hidden="true">\u2726</span>${v("picker.replaceCurrentChoices","Replace your current choices?")}</div><div class="sl-ba-replace"><b>${Ti("picker.willFindSeatsTogether",{count:i.quantity})}</b><span>${v("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>${v("picker.keepMine","Keep mine")}</button><button type="button" class="replace" data-ba-replace>${v("picker.findNewSeats","Find new seats")}</button></div></div>`:`<div class="sl-ba"><div class="sl-ba-title"><span class="spark" aria-hidden="true">\u2726</span>${v("picker.findClosestSeatsTogether","Find the closest seats together")}</div><div class="sl-ba-copy">${v("picker.closestGroupChosenInstantly","Closest available group, chosen instantly.")}</div>`+(i.offerPremium?`<button type="button" class="sl-ba-premium${i.premium?" on":""}" data-ba-premium aria-pressed="${i.premium?"true":"false"}"><span class="star" aria-hidden="true">\u2605</span>${v("picker.bestSeatsPremium","Best seats")}</button>`:"")+`<div class="sl-ba-qty"><button type="button" data-ba="-1" aria-label="${v("picker.fewerSeats","Fewer seats")}">\u2212</button><span>${i.quantity}</span><button type="button" data-ba="1" aria-label="${v("picker.moreSeats","More seats")}">+</button></div>`+(i.categories.length>1?`<select class="sl-ba-cat" aria-label="${H(v("picker.preferredTicketType","Preferred ticket type"))}" data-ba-cat><option value="">${H(v("picker.anyTicketType","Any ticket type"))}</option>`+i.categories.map(e=>`<option value="${H(e.key)}"${i.selectedCategory===e.key?" selected":""}>${H(e.label)}</option>`).join("")+"</select>":'<span class="sl-ba-cat" aria-hidden="true"></span>')+(i.zones.length?`<select class="sl-ba-zone" aria-label="${v("picker.preferredVenueZone","Preferred venue zone")}" data-ba-zone><option value="">${v("picker.anyVenueZone","Any venue zone")}</option>`+i.zones.map(e=>`<option value="${H(e.id)}"${i.selectedZone===e.id?" selected":""}>${H(e.label)}</option>`).join("")+"</select>":"")+`<button type="button" class="sl-ba-go${i.busy?" sl-busy":""}"${i.busy?" disabled":""}>`+(i.busy?`<span class="sl-ba-spin" aria-hidden="true"></span>${v("picker.findingBestSeats","Finding the best seats\u2026")}`:xo("picker.findBestSeatsCount",i.quantity))+"</button>"+(i.reopened?`<button type="button" class="sl-ba-back" data-ba-close>${v("picker.keepMyPicks","Keep my picks")}</button>`:"")+"</div>"}function Co(i){if(i.salesClosed&&!i.hasPicks){let e=i.whenText?`<span class="when">${H(i.whenText)}</span>`:"";return`<div class="sl-closed-note" role="status"><b>${v("picker.salesClosedPill","Sales are closed")}</b><span>${v("picker.salesClosedCopy","Ticket sales for this event have ended.")}${e}</span></div>`}return i.hasPicks?"":i.hasGaAreas?`<div class="sl-tray-hint">${i.seated?i.venue3d?v("picker.trayHintChoose3dOrStanding","Choose a seat in the 3D venue \u2014 or grab standing tickets below."):v("picker.trayHintTapOrStanding","Tap a seat on the map \u2014 or grab standing tickets below."):i.venue3d?v("picker.gaTrayHintChoose3dArea","Choose an area in the 3D venue to select tickets."):v("picker.gaTrayHintTapArea","Tap an area on the map to choose tickets.")}</div>`:`<div class="sl-tray-hint">${i.groupMode==="per_performance"?v("picker.groupPerPerformanceTrayHint","Choose seats for this performance, then complete every date above."):i.groupMode?v("picker.groupTrayHint","Choose seats once \u2014 the same seats will be held for every performance."):i.venue3d?v("picker.trayHintChoose3dOrBest","Choose a seat in the 3D venue, or let us pick the best available for you."):v("picker.trayHintTapOrBest","Tap a seat on the map, or let us pick the best available for you.")}</div>`}var wn=6e4,Ao=5*6e4,Td=String(Math.round(Ao/6e4));function Po(i){let e=document.createElement("div");e.className="sl-extend",e.dataset.dock="map",e.setAttribute("role","status"),e.innerHTML='<button type="button" class="sl-extend-btn" data-ref="extendBtn"></button><button type="button" class="sl-extend-x" data-ref="extendDismiss" aria-label=""><svg viewBox="0 0 16 16" width="12" height="12" aria-hidden="true" focusable="false"><path d="M3.5 3.5 12.5 12.5M12.5 3.5 3.5 12.5" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg></button>',(i.regions["bottom-center"]??i.els.map).appendChild(e),i.extendEl=e,i.els.extendBtn=e.querySelector('[data-ref="extendBtn"]'),i.els.extendDismiss=e.querySelector('[data-ref="extendDismiss"]'),i.els.extendBtn.textContent=Lo(i),i.els.extendDismiss.setAttribute("aria-label",i.tf("picker.close","Close")),i.els.extendBtn.addEventListener("click",()=>{i.handleExtend()}),i.els.extendDismiss.addEventListener("click",()=>{i.extendDismissed=!0,i.setExtendPrompt(!1,0)})}function Lo(i){return i.tf("picker.addMinutes","+{count} min").replace("{count}",Td)}function Mo(i){let e=i.hold?.items??[],t=new Set(e.map(r=>r.label));return i.committedSelection().filter(r=>!t.has(r.label)).reduce((r,s)=>r+(s.quantity??1),0)+Le(i.gaQty,i.hold?.items??[])}function Ho(i){return(i.hold?.items??[]).reduce((e,t)=>e+(t.quantity??1),0)}function Ro(i){let e=new Set((i.hold?.items??[]).map(n=>n.label)),t=i.committedSelection().filter(n=>!e.has(n.label)).reduce((n,r)=>n+(r.quantity??1),0);return i.heldTicketCount()+t+Le(i.gaQty,i.hold?.items??[])}function Oo(i){let e=new Set((i.hold?.items??[]).map(r=>r.label)),t=i.committedSelection().filter(r=>e.has(r.label)).reduce((r,s)=>r+(s.quantity??1),0),n=Math.max(0,i.maxTickets-i.heldTicketCount()-Le(i.gaQty,i.hold?.items??[]));i.controller.setMaxSelection(t+n)}function Io(i,e=i.lastTrayCount,t=i.pendingSelectionCount()){let n=i.els.cta;if(!n)return;if(i.salesClosed){n.disabled=!0,n.textContent=i.tf("picker.salesClosedCta","Sales closed");return}if(i.confirmSeat||i.tableDialog&&!i.tableDialogHeld){n.disabled=!0,n.textContent=i.tableDialog?i.tf("picker.confirmYourTable","Confirm your table"):i.tf("picker.confirmOrCancelSeat","Confirm or cancel this seat");return}if(i.ctaPhase==="holding"){n.disabled=!0,n.innerHTML=`<span class="sl-cta-spin" aria-hidden="true"></span>${i.tf("picker.securingSeats","Securing your seats\u2026")}`;return}if(i.ctaPhase==="checkout"){n.disabled=!0,n.innerHTML=`<span class="sl-cta-spin" aria-hidden="true"></span>${i.tf("picker.openingCheckout","Opening secure checkout\u2026")}`;return}let r=!i.hold&&i.performanceGroup?.selectionMode==="per_performance"?i.performanceGroup.submissionState?.():null;if(r&&!r.ready){n.disabled=!0,n.textContent=i.tf("picker.completeAllPerformances","Complete all performances ({complete}/{total})").replace("{complete}",String(r.complete)).replace("{total}",String(r.total));return}let s=i.controller.getSelectionValidity(e);if(s&&!s.isValid){n.disabled=!0,n.textContent=ki(s,(o,a)=>i.tf(o,a),!0);return}n.disabled=e===0,n.textContent=i.hold?t?kd("picker.secureMoreAndCheckout",{count:t}):i.tf("picker.continueToCheckout","Continue to checkout"):e?i.performanceGroup?i.tf("picker.holdSeatsForAllPerformances","Hold seats for all {count} performances").replace("{count}",String(i.performanceGroup.performanceCount)):i.tf("picker.holdSeatsAndCheckout","Hold seats & checkout"):i.tf("picker.selectSeats","Select seats")}function _o(i,e){i.ctaPhase=e,i.syncCta(),i.renderPeek(i.lastTrayCount,i.lastTrayTotal,i.pendingSelectionCount())}async function Do(i,e,t){i.setCtaPhase("checkout");try{await i.checkoutHandoff(e,t)}finally{i.ctaPhase==="checkout"&&!i.bookedShown&&i.setCtaPhase("idle")}}function Bo(i){return`@seatlayer/hold/v1/${encodeURIComponent(i.apiBase)}/${encodeURIComponent(i.opts.event)}`}function No(i){if(i.opts.initialHoldId)return i.opts.initialHoldId;if(i.opts.restoreHold===!1||typeof window>"u")return null;try{return window.sessionStorage.getItem(i.holdStorageKey())}catch{return null}}function Fo(i,e){if(!(i.opts.restoreHold===!1||typeof window>"u"))try{window.sessionStorage.setItem(i.holdStorageKey(),e.holdId)}catch{}}function Vo(i){if(!(typeof window>"u"))try{window.sessionStorage.removeItem(i.holdStorageKey())}catch{}}async function $o(i,e){try{let t=await i.controller.resumeHold(e);if(!t||i.destroyed)return null;let n={holdId:t.holdId,expiresAt:t.expiresAt,seats:t.seats,items:t.items};return i.hold=n,i.handedOff=!0,i.bookedShown=!1,i.ctaPhase="idle",i.startHoldTimer(n.expiresAt),i.rememberHold(n),i.syncTray(),i.emitHoldChange(),i.opts.onHoldRestored?.(n,n.seats??[],i.buildHandoff(n)),n}catch(t){let n=t?.status;return n===404||n===409?i.forgetHold():i.opts.onError?.(t),null}}async function zo(i){let e=i.rememberedHoldId();e&&await i.resumeHoldFromServer(e)}function jo(i,e){i.stopHoldTimer(),i.holdExpiresAt=e,i.extendDismissed=!1,i.extendUsed=!1,i.hold&&i.rememberHold(i.hold);let t=i.els.hold;t.innerHTML=`<span class="sl-hold-dot" aria-hidden="true"></span><span>${i.tf("picker.held","Held")}</span><span class="sl-hold-time" data-ref="holdTime"></span>`;let n=t.querySelector('[data-ref="holdTime"]'),r=()=>{let s=Math.max(0,i.holdExpiresAt-Date.now());n&&(n.textContent=Mt(s));let o=i.els.peek?.querySelector(".sl-peek-time");o&&(o.textContent=Mt(s)),t.classList.add("on"),t.classList.toggle("is-expiring",s>0&&s<=wn),i.setExtendPrompt(s>0&&s<=wn,s),(s<=0||!i.controller.currentHold())&&i.stopHoldTimer()};i.holdTimer=setInterval(r,500),r()}function Go(i){i.holdTimer&&clearInterval(i.holdTimer),i.holdTimer=null,i.els.hold?.classList.remove("on","is-expiring"),i.root&&delete i.root.dataset.peekClock,i.setExtendPrompt(!1,0)}function qo(i,e,t){if(!i.extendEl)return;let n=e&&t>0&&i.root?.dataset.layout!=="narrow"&&!i.extendDismissed&&!i.extendUsed&&!!i.controller.currentHold()&&!i.bookedShown;i.extendEl.classList.toggle("on",n)}function Uo(i){if(!i.holdTimer)return;let e=Math.max(0,i.holdExpiresAt-Date.now());i.setExtendPrompt(e>0&&e<=wn,e)}async function Ko(i){let e=i.els.extendBtn,t=i.controller.currentHold();if(!(!t||!i.api.extend||i.extendUsed)){e.disabled=!0,e.textContent=i.tf("picker.addingEllipsis","Adding\u2026");try{let n=await i.api.extend(i.controller.key,t.holdId,Ao);if(i.controller.currentHold()?.holdId!==t.holdId)return;i.controller.setHold({holdId:t.holdId,labels:t.labels,expiresAt:n.expiresAt,items:t.items});let r=i.controller.currentHold();if(!r)return;i.hold={holdId:r.holdId,expiresAt:r.expiresAt,seats:r.seats,items:r.items},i.holdExpiresAt=r.expiresAt,i.extendUsed=!0,i.extendEl?.classList.remove("on"),i.rememberHold(i.hold),i.emitHoldChange(),i.toast(i.tf("picker.moreTimeAdded","More time added \u2014 your seats are still held."),"success")}catch(n){if(n?.reason==="extend_limit"){i.extendUsed=!0,i.setExtendPrompt(!1,0);return}i.opts.onError?.(n),i.toast(i.tf("picker.couldNotAddMoreTime","Couldn't add more time \u2014 please head to checkout now."),"warning")}finally{e.disabled=!1,e.textContent=Lo(i)}}}import{t as Zo,tCount as Pd}from"@seatlayer/core";function Wo(i){return i?.previousPrice!=null&&i.previousPrice>i.price?i.previousPrice:null}function Yo(i){return Cd(i)+(i.moreLabel?`<button type="button" class="sl-price-more" aria-expanded="${!i.collapsed}">${i.esc(i.moreLabel)}</button>`:"")+Ad(i.status)}function Cd(i){let{esc:e,money:t}=i;return i.categories.map(n=>{let r=i.priceOf(n),s=i.rangeOf(n),o=i.offerOf(n.key),a=Wo(o),l=i.activeKey===n.key;return`<div class="sl-price-row${i.bandKeys!=null&&!i.bandKeys.has(n.key)?" sl-dim":""}${l?" sl-active":""}" data-cat="${e(n.key)}" role="button" tabindex="0" aria-pressed="${l}" title="${e(i.titleFor(n,l))}"><span class="sl-dot" style="--sl-cat-dot:${e(i.colorOf(n))}"></span><span class="sl-price-label">${e(n.label)}`+(o?.offerName?`<small class="sl-price-offer">${e(o.offerName)}</small>`:"")+`</span><span class="sl-price-left">${e(i.leftCount(i.left[n.key]??0))}</span>`+(a!=null?`<span class="sl-price-was">${e(t(a))}</span>`:"")+(s!=null?`<span class="sl-price-amt">${s.min===s.max?e(t(s.min)):`${e(t(s.min))}\u2013${e(t(s.max))}`}</span>`:r!=null?`<span class="sl-price-amt">${e(t(r))}</span>`:"")+"</div>"}).join("")}function Ad(i){let e=t=>t.replace(/[&<>"']/g,n=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[n]);return`<div class="sl-status-key" aria-label="${e(i.legend)}"><span class="sl-status-item"><i class="sl-status-icon held" aria-hidden="true"><svg viewBox="0 0 24 24"><rect x="5" y="10" width="14" height="10" rx="2"/><path d="M8 10V7a4 4 0 0 1 8 0v3"/></svg></i>${e(i.held)}</span><span class="sl-status-item"><i class="sl-status-icon sold" aria-hidden="true"><svg viewBox="0 0 24 24"><path d="M7 17L17 7"/></svg></i>${e(i.sold)}</span></div>`}function xn(i){let e=Math.abs(i.scrollLeft),t=e>2,n=e+i.clientWidth<i.scrollWidth-2;return i.dataset.fadeStart=String(t),i.dataset.fadeEnd=String(n),{start:t,end:n}}function Xo(i){let{esc:e,money:t}=i;return`<button type="button" class="sl-rc sl-rc-all" data-rail-all aria-pressed="${i.allActive}" title="${e(i.allWord)}"><span class="sl-rc-t">${e(i.allWord)}</span></button>`+i.categories.map(r=>{let s=i.rangeOf(r),o=i.priceOf(r),a=s?s.min===s.max?t(s.min):`${t(s.min)}+`:o!=null?t(o):null,l=Object.prototype.hasOwnProperty.call(i.left,r.key)&&i.left[r.key]<=0,c=Wo(i.offerOf(r.key)),p=a?`${r.label} \u2014 ${a}${l?` (${i.soldOutWord})`:""}`:r.label;return`<button type="button" class="sl-rc" data-cat="${e(r.key)}" aria-pressed="${i.activeKey===r.key}" aria-label="${e(p)}" title="${e(p)}"${l?" disabled":""}><i class="sl-rc-dot" style="--sl-cat-dot:${e(i.colorOf(r))}"></i>`+(c!=null?`<span class="sl-rc-was">${e(t(c))}</span>`:"")+`<span class="sl-rc-t">${e(a??r.label)}</span></button>`}).join("")}function Qo(i,e){let t=i.map(a=>({key:a.key,range:e.rangeOf(a)})).filter(a=>a.range!=null);if(!t.length)return[];let n=[...new Map(t.map(a=>[`${a.range.min}:${a.range.max}`,a.range])).values()].sort((a,l)=>a.min-l.min||a.max-l.max);if(n.length<=5)return n.map(a=>({id:`p${a.min}-${a.max}`,label:a.min===a.max?e.money(a.min):`${e.money(a.min)}\u2013${e.money(a.max)}`,keys:t.filter(l=>l.range.min===a.min&&l.range.max===a.max).map(l=>l.key),min:a.min,max:a.max}));let r=[...t].sort((a,l)=>a.range.min-l.range.min||a.range.max-l.range.max),s=Math.ceil(r.length/4),o=[];for(let a=0;a<r.length;a+=s){let l=r.slice(a,a+s),c=Math.min(...l.map(d=>d.range.min)),p=Math.max(...l.map(d=>d.range.max));o.push({id:`b${a}`,label:c===p?e.money(c):`${e.money(c)}\u2013${e.money(p)}`,keys:l.map(d=>d.key),min:c,max:p})}return o}function Jo(i){if(i.suppressPricing||!i.els.prices||!i.els.pricesSec)return;let e=Qo(i.controller.doc?.categories??[],i.legendDeps());if(e.length<2)return;let t=document.createElement("select");t.className="sl-price-select",t.setAttribute("aria-label",i.tf("picker.filterAndFocusByPrice","Filter and focus seats by price"));let n=document.createElement("option");n.value="all",n.textContent=i.tf("picker.allPrices","All prices"),t.appendChild(n);for(let r of e){let s=document.createElement("option");s.value=r.id,s.textContent=r.label,t.appendChild(s)}i.els.pricesSec.appendChild(t),i.priceSelect=t,t.addEventListener("change",()=>{i.applyPriceBand(e.find(r=>r.id===t.value)?.keys??null)})}function ea(i,e){if(i.focusedCatKey=null,i.priceBandKeys=e?new Set(e):null,i.priceSelect){let t=e?i.priceSelect.value:"all";i.priceSelect.value!==t&&(i.priceSelect.value=t)}i.controller.setCategoryFilter(e),i.controller.focusCategoryFilter(e),i.pushAvailabilityTo3d(),i.syncFloors(),i.syncRung(),i.minimap?.refreshMinimap(),i.syncPrices(),i.lastSection&&i.showSectionCard(i.lastSection)}function ta(i){return{colorOf:e=>i.controller.getRenderer()?.categoryDisplayColor?.(e.key)??e.color,rangeOf:e=>i.catPriceRange(e),priceOf:e=>i.catPrice(e),offerOf:e=>i.offerPrice(e),money:e=>i.money(e),esc:H}}function ia(i,e,t,n=i.legendDeps()){let r=i.els.railScroll,s=e.length>1;if(i.els.rail?.classList.toggle("has",s),!r)return;r.innerHTML=s?Xo({...n,categories:e,left:t,activeKey:i.focusedCatKey,soldOutWord:i.tf("picker.soldOut","Sold out"),allWord:i.tf("picker.allPrices","All prices"),allActive:!i.focusedCatKey&&!i.priceBandKeys}):"";let o=e.map(a=>a.key).join("|");i.lastRailSignature!==o&&(i.lastRailSignature=o,r.scrollLeft=0),r.querySelectorAll(".sl-rc").forEach(a=>{a.addEventListener("click",()=>{if(a.hasAttribute("data-rail-all")){i.applyPriceBand(null);return}i.focusCategory(a.dataset.cat??"")})}),i.railEdgesBound||(i.railEdgesBound=!0,r.addEventListener("scroll",()=>xn(r),{passive:!0})),requestAnimationFrame(()=>xn(r))}function na(i){let e=i.controller.doc;if(!e||!i.els.prices)return;let t=i.controller.categoryAvailability(),n=e.categories.filter(d=>!d.notForSale);i.syncSoldout(n,t);let r=i.legendDeps(),s=i.suppressPricing,o=s?{...r,priceOf:()=>{},rangeOf:()=>{},offerOf:()=>null}:r;s&&(i.els.pricesSec?.querySelector("span")?.replaceChildren(i.tf("picker.seatCategories","Seat categories")),i.els.pricesHint?.remove()),i.syncPriceRail(n,t,o);let a=5,l=n.length-a,c=l>1&&!i.pricesExpanded,p=c?n.slice(0,a):n;i.els.prices.classList.toggle("sl-expanded",l>1&&i.pricesExpanded),i.els.prices.innerHTML=Yo({...o,categories:p,left:t,collapsed:c,activeKey:i.focusedCatKey,bandKeys:i.priceBandKeys,leftCount:d=>Pd("picker.leftCount",d),titleFor:(d,u)=>u?i.tf("picker.showAllSeats","Show all seats"):Zo("picker.showLabelSeatsOnMap",{label:d.label}),moreLabel:l>1?c?s?i.tf("picker.showAllCategories","Show all categories"):Zo("picker.showAllTicketTypes",{count:n.length}):i.tf("picker.showFewer","Show fewer"):null,status:{legend:i.tf("picker.seatStatusLegend","Seat status legend"),held:i.tf("picker.temporarilyHeld","Temporarily held"),sold:i.tf("picker.sold","Sold")}}),i.els.prices.querySelectorAll(".sl-price-row").forEach(d=>{d.addEventListener("mouseenter",()=>i.controller.getRenderer()?.setCategoryHighlight?.(d.dataset.cat??null)),d.addEventListener("mouseleave",()=>i.controller.getRenderer()?.setCategoryHighlight?.(null));let u=()=>i.focusCategory(d.dataset.cat??"");d.addEventListener("click",u),d.addEventListener("keydown",h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),u())})}),i.els.prices.querySelector(".sl-price-more")?.addEventListener("click",()=>{i.pricesExpanded=!i.pricesExpanded,i.syncPrices()})}function ra(i,e){if(!e)return;let t=i.focusedCatKey===e?null:e;i.focusedCatKey=t,i.priceBandKeys=t?new Set([t]):null;let n=i.els.pricesSec?.querySelector(".sl-price-select");n&&(n.value="all"),i.controller.setCategoryFilter(t?[t]:null),i.controller.focusCategoryFilter(t?[t]:null),i.pushAvailabilityTo3d(),i.syncFloors(),i.syncRung(),i.minimap?.refreshMinimap(),i.syncPrices(),i.lastSection&&i.showSectionCard(i.lastSection)}import{t as Md,tCount as Hd}from"@seatlayer/core";function se(i,e,t){let n=Md(i,t);return n&&n!==i?n:t?e.replace(/\{(\w+)\}/g,(r,s)=>s in t?String(t[s]):r):e}function Rd(i){let e=Hd("picker.seatCount",i);return e.includes("picker.seatCount")?`${i} ${i===1?"seat":"seats"}`:e}function Od(i){try{let e=Intl.ListFormat;if(e)return new e(void 0,{style:"long",type:"conjunction"}).format(i)}catch{}return i.join(", ")}function Id(i){if(i.length<2)return!1;let e=[...i].sort((t,n)=>t-n);return new Set(e).size!==e.length?!1:e[e.length-1]-e[0]===e.length-1}function _d(i){let e=i.filter(r=>r.objectType==="ga"),t=i.filter(r=>r.objectType!=="ga"),n=[];if(t.length){let r=Rd(t.length),s=[...new Set(t.map(l=>l.sectionLabel).filter(Boolean))],o=[...new Set(t.map(l=>l.rowLabel).filter(Boolean))],a=t.map(l=>Number(l.seatNumber)).filter(l=>Number.isFinite(l));if(s.length===1&&o.length===1&&a.length===t.length){let l=t.length===1?se("picker.releasedSeatPlace","Section {section}, Row {row}, Seat {seat}",{section:s[0],row:o[0],seat:String(t[0].seatNumber??"")}):Id(a)?se("picker.releasedSeatRange","Section {section}, Row {row}, Seats {from}\u2013{to}",{section:s[0],row:o[0],from:Math.min(...a),to:Math.max(...a)}):"";n.push(l?se("picker.releasedPair","{first} \xB7 {second}",{first:r,second:l}):se("picker.releasedInSection","{seats} in Section {section}",{seats:r,section:s[0]}))}else s.length===1?n.push(se("picker.releasedInSection","{seats} in Section {section}",{seats:r,section:s[0]})):s.length>1?n.push(se("picker.releasedInSections","{seats} in Sections {sections}",{seats:r,sections:Od(s)})):n.push(r)}for(let r of e)n.push(se("picker.releasedGa","{quantity} \xD7 {area}",{quantity:r.quantity??1,area:r.label}));return n.length?n.reduce((r,s)=>se("picker.releasedPair","{first} \xB7 {second}",{first:r,second:s})):""}function sa(i){if(!i)return[];let e=new Map((i.seats??[]).map(r=>[r.label,r])),t=i.items??[];return(t.length?t.map(r=>({label:r.label,objectType:r.objectType,quantity:r.quantity})):[...e.keys()].map(r=>({label:r}))).map(r=>{let s=e.get(r.label);return{label:r.label,...r.objectType?{objectType:r.objectType}:{},...r.quantity==null?{}:{quantity:r.quantity},...s?.sectionLabel?{sectionLabel:s.sectionLabel}:{},...s?.rowLabel?{rowLabel:s.rowLabel}:{},...s?.seatNumber?{seatNumber:s.seatNumber}:{}}})}function oa(i,e){if(!i.reducedMotion)for(let t of e.slice(0,10)){if(t.objectType==="ga")continue;let n=i.seatByLabel(t.label);!n||i.statusOf(n.id)!=="free"||i.flash(n.id,i.accent)}}function aa(i,e=[]){let t=document.createElement("div");t.className="sl-interrupt sl-hold-expired sl-mo-scrim",t.setAttribute("role","alertdialog"),t.setAttribute("aria-modal","true");let n=document.createElement("div");n.className="sl-interrupt-card sl-mo-in";let r=document.createElement("div");r.className="sl-interrupt-title",r.id="sl-hold-expired-title";let s=document.createElement("span");s.className="sl-interrupt-glyph",s.setAttribute("aria-hidden","true"),s.textContent="\u23F1";let o=document.createElement("span");o.textContent=se("picker.holdExpiredTitle","Your seats were released"),r.append(s,o);let a=document.createElement("div");a.className="sl-interrupt-body",a.id="sl-hold-expired-body",a.textContent=se("picker.holdExpiredBody","Your hold time ran out and the seats went back on sale."),n.append(r,a);let l=_d(e);if(l){let u=document.createElement("div");u.className="sl-interrupt-body sl-interrupt-fact sl-hold-expired-seats",u.textContent=l,n.appendChild(u)}let c=document.createElement("div");c.className="sl-interrupt-body",c.textContent=se("picker.holdExpiredPickAgain","Pick your seats again to continue \u2014 they may already be taken."),n.appendChild(c),t.setAttribute("aria-labelledby",r.id),t.setAttribute("aria-describedby",a.id);let p=document.createElement("div");p.className="sl-interrupt-actions";let d=document.createElement("button");return d.type="button",d.className="sl-interrupt-act",d.textContent=se("picker.holdExpiredRestart","Choose seats again"),d.addEventListener("click",()=>i.restart()),p.appendChild(d),n.appendChild(p),t.appendChild(n),t.addEventListener("pointerdown",u=>{u.target===t&&i.restart()}),t}import{t as kn,tCount as Dd}from"@seatlayer/core";var Sn=4,Bd=6;function Nd(i){let e=i.trim();return/^[0-9]{1,4}$/.test(e)?Number(e):null}function la(i){return[i.held?"h":"s",i.section,i.rowLabel,i.categoryLabel,i.amountText].join(" ")}function Fd(i){if(i.length===1)return i[0];let e=i.map(Nd);if(e.every(n=>n!==null)){let n=[...e].sort((o,a)=>o-a);if(n.every((o,a)=>a===0||o===n[a-1]+1))return`${n[0]}\u2013${n[n.length-1]}`;let s=n.slice(0,3).join(", ");return n.length>3?`${s} +${n.length-3}`:s}let t=i.slice(0,3).join(", ");return i.length>3?`${t} +${i.length-3}`:t}function Vd(i){let e=[];for(let t of i){let n=e[e.length-1];!!n&&t.groupable&&n.members[0].groupable&&la(n.members[0])===la(t)?n.members.push(t):e.push({members:[t],seatsLabel:""})}for(let t of e)t.seatsLabel=Fd(t.members.map(n=>n.seatLabel));return e}function da(i,e,t,n){let r=H;return` data-key="${r(i)}"`+(t.length?` data-held="${r(encodeURIComponent(t.join(`
2793
- `)))}"`:"")+(e.length?` data-seat="${r(e.join(" "))}"`:"")+(n?` data-locate="${r(n)}"`:"")}function pa(i){let e=H;return`<div class="sl-chip${i.held?" sl-held":""}${i.fresh?" sl-enter":""}"`+da(i.key,i.seatIds,i.heldLabels,i.locateId)+">"+(i.held?i.stateHtml:`<span class="sl-chip-dot" style="background:${S(i.categoryColor)}" aria-hidden="true"></span>`)+`<div class="sl-chip-main">${i.identityHtml}`+(i.extrasHtml?`<div class="sl-chip-sub">${i.extrasHtml}</div>`:"")+`${i.noteHtml}</div>`+(i.amountText?`<span class="amt">${e(i.amountText)}</span>`:"")+i.railHtml+"</div>"}function ca(i,e,t,n,r){let s=H,o=e?.members.length??1,a=o>1,l=e?e.seatsLabel:i.seatLabel,c=e?e.members.reduce((u,h)=>u+h.amount,0):i.amount,p=e?e.members.flatMap(u=>u.seatIds):i.seatIds,d=e?e.members.flatMap(u=>u.heldLabels):i.heldLabels;return`<div class="sl-chip sl-tline${i.held?" sl-held":""}${i.fresh?" sl-enter":""}${e?"":" sl-tsub"}"${n?' data-overflow="true"':""}`+(e?` data-run="${t}"`:` data-run-of="${t}"`)+da(i.key,p,d,i.locateId)+">"+(a?`<button type="button" class="sl-trun-toggle" aria-expanded="false" aria-label="${s(Dd("picker.seatsSelectedCount",o))}"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M9 6l6 6-6 6"/></svg></button>`:i.held?i.stateHtml:`<span class="sl-tline-dot" style="background:${S(i.categoryColor)}" aria-hidden="true"></span>`)+`<span class="sl-sr">${s(i.categoryLabel)}</span><span class="sl-tline-id"><b>${s(i.section||i.seatLabel)}</b>`+(i.rowLabel?`<i>\xB7</i><span>${s(i.rowLabel)}</span>`:"")+(i.section&&l?`<i>\xB7</i><span>${s(l)}</span>`:"")+"</span>"+i.extrasHtml+(r.suppressPricing||!i.amountText?"":(a?`<span class="sl-tline-mult">${o}\xD7</span>`:"")+`<span class="amt">${s(r.money(c))}</span>`)+(i.railHtml?`<button type="button" class="rm" aria-label="${s(a?kn("picker.removeSeatLabel",{label:[i.section,i.rowLabel,l].filter(Boolean).join(" \xB7 ")}):i.removeAria)}"><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 ha(i,e){if(!i.length)return"";let t=Vd(i),n=[v("picker.section","Section"),v("picker.row","Row"),v("picker.seat","Seat")].join(" \xB7 "),r=t.length>=Bd,s=t.map((a,l)=>{let c=r&&l>=Sn;return ca(a.members[0],a,l,c,e)+(a.members.length>1?a.members.map(p=>ca(p,null,l,c,e)).join(""):"")}).join(""),o=r?`<button type="button" class="sl-tmore" data-tmore aria-expanded="false" data-more="${H(kn("picker.moreCount",{count:t.length-Sn}))}" data-less="${H(v("picker.showLess","Show less"))}"><span>${H(kn("picker.moreCount",{count:t.length-Sn}))}</span><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M6 9l6 6 6-6"/></svg></button>`:"";return`<div class="sl-tlist"${r?' data-collapsed="true"':""}><div class="sl-tlist-head sl-sr">${H(n)}</div>${s}${o}</div>`}function ua(i){i.dataset.denseWired!=="true"&&(i.dataset.denseWired="true",i.addEventListener("click",e=>{let t=e.target,n=t.closest("[data-tmore]");if(n){let l=n.closest(".sl-tlist"),c=l?.getAttribute("data-collapsed")==="true";l?.setAttribute("data-collapsed",c?"false":"true"),n.setAttribute("aria-expanded",c?"true":"false");let p=n.querySelector("span");p&&(p.textContent=(c?n.dataset.less:n.dataset.more)??p.textContent);return}let r=t.closest(".sl-trun-toggle");if(!r)return;e.stopPropagation();let s=r.closest(".sl-tline"),o=s?.dataset.run;if(!s||o===void 0)return;let a=r.getAttribute("aria-expanded")!=="true";r.setAttribute("aria-expanded",a?"true":"false"),s.setAttribute("data-open",a?"true":"false"),s.parentElement?.querySelectorAll(`.sl-tsub[data-run-of="${o}"]`).forEach(l=>l.setAttribute("data-open",a?"true":"false"))}))}import{ACCESSIBILITY_TYPES as Tn,t as ma}from"@seatlayer/core";var $d='<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>',zd='<svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="12" r="8.4"/><circle cx="8.6" cy="10.2" r="1.15"/><circle cx="12" cy="8.2" r="1.15"/><circle cx="15.4" cy="10.2" r="1.15"/><path d="M12 20.4a2.6 2.6 0 0 1 0-5.2 2.2 2.2 0 0 0 0-4.4"/></svg>',Ei=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 n=this.offered().length>0;this.button.setAttribute("aria-label",n?t.tf("picker.accessibilityOptions","Accessibility and colour options"):t.tf("picker.displayOptions","Display options")),this.button.innerHTML=n?$d:zd,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=ls(this.rows()),this.root.append(this.menu,this.button),e.appendChild(this.root),this.button.addEventListener("click",r=>{r.stopPropagation(),this.open(this.menu.hidden)}),this.menu.addEventListener("pointerdown",r=>r.stopPropagation()),this.menu.addEventListener("click",r=>r.stopPropagation()),this.dismiss=()=>this.open(!1),this.escape=r=>{r.key==="Escape"&&this.open(!1)},document.addEventListener("pointerdown",this.dismiss),document.addEventListener("keydown",this.escape),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:n,count:r})=>[n,r])),t=!1;for(let n of this.menu.querySelectorAll("[data-a11y-row]")){let r=n.dataset.a11yRow??"";if(!r.startsWith("a11y:"))continue;let s=r.slice(5),o=e.get(s);if(o===void 0)continue;let a=this.countNode(n),l=o==null?"":o>0?ma("picker.accessFreeCount",{count:o}):this.deps.tf("picker.accessNoneLeft","None left");a&&(a.textContent=l);let c=o===0;a instanceof HTMLButtonElement&&(a.disabled=c,a.setAttribute("aria-label",this.jumpLabel(s,l))),n.disabled=c,c?n.setAttribute("aria-disabled","true"):n.removeAttribute("aria-disabled"),c&&this.active.delete(s)&&(this.paint(n,!1),t=!0)}t&&this.applyFilter()}syncAccessibilityFilter(e){this.active.clear();for(let t of e??[])this.active.add(t);this.remember(e&&e.length?e:null);for(let t of this.menu.querySelectorAll("[data-a11y-row]")){let n=t.dataset.a11yRow??"";n.startsWith("a11y:")&&this.paint(t,this.active.has(n.slice(5)))}}destroy(){document.removeEventListener("pointerdown",this.dismiss),document.removeEventListener("keydown",this.escape),this.root.remove()}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;let t=this.button.getBoundingClientRect();Fi(this.menu,{x:t.left+t.width/2,y:t.top}),Zn(this.menu),Ut(this.menu)}rows(){return[...this.filterRows(),...this.deps.hasLimitedView?[{key:"limited",icon:"\u25D0",label:this.deps.tf("picker.hideLimitedView","Hide limited-view seats"),on:this.deps.isLimitedViewHidden()}]:[],{key:"colorblind",icon:"\u25D0",className:"sl-cbbtn",label:this.deps.tf("picker.colorblindColors","Colourblind-friendly colours"),on:this.deps.isColorblindSafe()}]}offered(){let e=this.deps.needs?.();if(e)return e.map(({key:n,count:r})=>({key:n,count:r}));let t=this.deps.present;return t?Tn.filter(({key:n})=>t.has(n)).map(({key:n})=>({key:n,count:null})):[]}offeredKeys(){return new Set(this.offered().map(({key:e})=>e))}offeredFree(){return new Set(this.offered().filter(({count:e})=>e!==0).map(({key:e})=>e))}filterRows(){let e=this.offeredKeys(),t=new Map(Tn.map(n=>[n.key,n]));return this.offered().flatMap(({key:n,count:r})=>{let s=t.get(n);return s?[{key:`a11y:${n}`,icon:s.icon,label:s.label,...n==="wheelchair"&&e.has("companion")?{note:this.deps.tf("picker.companionSeatsNote","Companion places beside them stay selectable")}:{},...r==null?{}:{count:r>0?ma("picker.accessFreeCount",{count:r}):this.deps.tf("picker.accessNoneLeft","None left"),disabled:r===0},on:this.active.has(n)}]:[]})}wire(){for(let e of this.menu.querySelectorAll("[data-a11y-row]"))e.addEventListener("click",()=>{let t=e.dataset.a11yRow??"";if(t==="colorblind"){let s=!this.deps.isColorblindSafe();this.deps.setColorblindSafe(s),this.paint(e,s);return}if(t==="limited"){let s=!this.deps.isLimitedViewHidden();this.deps.setLimitedViewHidden(s),s&&this.deps.focusSeatsForFilter(),this.paint(e,s);return}let n=t.slice(5),r=!this.active.has(n);r?this.active.add(n):this.active.delete(n),this.paint(e,r),this.applyFilter()})}promoteCounts(){if(this.deps.stepToAccessibleSection)for(let e of this.menu.querySelectorAll('[data-a11y-row^="a11y:"]')){let t=e.querySelector(".sl-a11yrow-c");if(!t)continue;let n=(e.dataset.a11yRow??"").slice(5),r=document.createElement("div");r.className="sl-a11yrow-w",e.replaceWith(r);let s=document.createElement("button");s.type="button",s.className="sl-a11yrow-c sl-a11yjump",s.dataset.a11yJump=n,s.textContent=t.textContent,s.disabled=e.disabled,s.setAttribute("aria-label",this.jumpLabel(n,t.textContent??"")),t.remove(),e.setAttribute("aria-label",this.rowLabel(n,s.textContent??"")),r.append(e,s),s.addEventListener("click",o=>{o.stopPropagation(),this.active.has(n)||(this.active.add(n),this.paint(e,!0),this.applyFilter({focus:!1}));let a=this.deps.stepToAccessibleSection?.(n);a&&s.setAttribute("aria-label",this.jumpLabel(n,s.textContent??"",a.label))})}}countNode(e){return e.querySelector(".sl-a11yrow-c")??e.parentElement?.querySelector(".sl-a11yrow-c")??null}typeLabel(e){return Tn.find(t=>t.key===e)?.label??e}jumpLabel(e,t,n){return[this.deps.tf("picker.jumpToSection","Jump to section"),this.typeLabel(e),t,...n?[`${this.deps.tf("picker.section","Section")} ${n}`]:[]].filter(Boolean).join(" \xB7 ")}rowLabel(e,t){return[this.typeLabel(e),t].filter(Boolean).join(" \xB7 ")}paint(e,t){e.classList.toggle("on",t),e.setAttribute("aria-checked",String(t)),e.setAttribute("aria-pressed",String(t))}applyFilter(e={}){let t=this.active.size?[...this.active]:null;this.deps.applyAccessibilityFilter(t),this.remember(t),t&&e.focus!==!1&&this.deps.focusSeatsForFilter()}key(){let e=this.deps.chart?.();return`seatmap.a11y.filter.${this.deps.event}${e?`.${e}`:""}`}stored(){try{let e=window.sessionStorage.getItem(this.key()),t=e?JSON.parse(e):null;return Array.isArray(t)?t:[]}catch{return[]}}remember(e){try{e&&e.length?window.sessionStorage.setItem(this.key(),JSON.stringify(e)):window.sessionStorage.removeItem(this.key())}catch{}}};import{attachVisibilityCatchUp as jd}from"@seatlayer/core";var Gd=250;function fa(i,e=Gd){let t=null,n=()=>{t===null&&(t=setTimeout(()=>{t=null,i()},e))},r=jd(n),s=typeof window<"u"&&typeof window.addEventListener=="function";return s&&window.addEventListener("focus",n),()=>{t!==null&&(clearTimeout(t),t=null),r(),s&&window.removeEventListener("focus",n)}}import{holdRecoveryShape as qd,tCount as Ci}from"@seatlayer/core";var Ai=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=qd(e),n=e.lapsedLabels.length,r=n-e.recoverable.length,s=t==="all"?Ci("picker.holdLapsedStillFree",n):t==="partial"?Ci("picker.holdLapsedSomeTaken",r):Ci("picker.holdLapsedAllTaken",n);this.note={message:s,recoverable:t==="none"?[]:[...e.recoverable]},this.deps.toast(s,t==="none"?"error":"warning",t==="none"?void 0:{label:this.actionLabel(),onClick:()=>this.recover()}),this.deps.syncTray()}noteHtml(){if(!this.note)return"";let e=this.note.recoverable.length?`<button type="button" data-lapse-again>${H(this.actionLabel())}</button>`:"";return`<div class="sl-lapse-note" role="status"><span>${H(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 Ci("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 ga=Symbol("seatlayer.performance-group-picker");function Pi(i,e){return Object.defineProperty(i,ga,{configurable:!1,enumerable:!1,value:Object.freeze({...e})}),i}function ba(i){return i[ga]??null}var va="@seatlayer/pending-checkout/v1";function Ud(i){return typeof i=="string"&&i.length<=160&&/^ord_[A-Za-z0-9_-]+$/.test(i)}function ya(i){if(typeof location>"u")return null;let e=new URLSearchParams(location.search),t=e.get("seatlayer_checkout");if(t!=="success"&&t!=="cancelled")return null;let n=null;try{let r=window.sessionStorage.getItem(va);if(r){let s=null;try{s=JSON.parse(r)}catch{}if(s&&Ud(s.orderId)){let o=Date.now()-Number(s.storedAt);if(o>=0&&o<=144e5){if(s.eventKey&&s.eventKey!==i)return null;n=s.orderId}}}window.sessionStorage.removeItem(va)}catch{}e.delete("seatlayer_checkout");try{let r=e.toString();history.replaceState(history.state,"",`${location.pathname}${r?`?${r}`:""}${location.hash}`)}catch{}return{outcome:t,orderId:n}}function wa(i){if(!i.framed)return null;let e=i.ancestorOrigins?.length?i.ancestorOrigins[0]:null;for(let t of[e,i.referrer])if(t)try{return new URL(t).origin}catch{}return null}var Jd="https://api.seatlayer.io",ep=10,tp=250,Sa=6e4,ka=4,ip=10,np=40,rp=220,Ta="seatmap.a11y.cb";function sp(){try{if(typeof window>"u")return null;let i=window.localStorage.getItem(Ta);return i==null?null:i==="1"}catch{return null}}function op(i){try{window.localStorage.setItem(Ta,i?"1":"0")}catch{}}var $e=class i{constructor(e){this.realtime=null;this.accessEl=null;this.lastSelectionValidity=null;this.root=null;this.mapHost=null;this.rendered=!1;this.destroyed=!1;this.renderInfo=null;this.webMcp=null;this.localeGeneration=0;this.els={};this.regions={};this.ro=null;this.holdTimer=null;this.toastTimer=null;this.offerReadInFlight=null;this.offerReadSettledAt=0;this.offerRefreshTimer=null;this.offerBoundaryTimer=null;this.offerVisibilityHandler=null;this.motionTimers=new Set;this.currency="USD";this.eventTimezone=null;this.eventWhenText=null;this.offerAvailability=null;this.channelByObject=new Map;this.pricesByChannel=new Map;this.hold=null;this.holdExpiresAt=0;this.handedOff=!1;this.bookedShown=!1;this.holdConflicted=!1;this.paymentOptions=null;this.checkoutPanel=null;this.extendEl=null;this.extendDismissed=!1;this.extendUsed=!1;this.bookedEl=null;this.holdExpiredEl=null;this.holdExpiredUnits=[];this.gaQty=new Map;this.gaPromptEl=null;this.gaPromptReturnFocus=null;this.gaAreasExpanded=!1;this.lastMapPoint=null;this.tipEl=null;this.tipPos={x:0,y:0};this.tipPinned=!1;this.tipMarkedHoverLabel=null;this.lastPointerType="mouse";this.themeMode=null;this.colorSchemeStop=null;this.seatsRevealed=!1;this.seatsRevealedReport=null;this.confirmCardCache=null;this.suppressConfirmationSeatId=null;this.tableDialogEl=null;this.tableDialog=null;this.tableDialogHeld=!1;this.tableDialogReturnFocus=null;this.srEl=null;this.baQty=2;this.baCat="";this.baZone="";this.baPremium=!1;this.baReopen=!1;this.bestAvailableConfirm=!1;this.salesClosed=!1;this.soldOut=!1;this.soldoutEl=null;this.cbSafe=!1;this.rungsEl=null;this.projectionEl=null;this.buyerView="map";this.view3dEl=null;this.view3dHandle=null;this.view3dGen=0;this.view3dReturnSeat=null;this.view3dTargetSeatId=null;this.view3dCompareSeatIds=[];this.view3dCompareChip=new bi({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.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.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 Ai({toast:(e,t,n)=>this.toast(e,t,n),reselect:e=>{this.controller.select(e),this.handleCta()},syncTray:()=>this.syncTray()});this.railEdgesBound=!1;this.fsFallback=!1;this.fsChangeHandler=null;this.fsEscHandler=null;this.eventDetailsHidden=!1;this.sideCollapsed=!1;this.sideToggleEl=null;this.framedFs=!1;this.lastPostedHeight=0;this.cbEl=null;this.modalScrim=null;this.prevFocus=null;this.escHandler=null;this.closeModal=null;this.fitScheduled=!1;this.perspectiveWarned=!1;if(!e||typeof e!="object")throw new Error("seatmap: options object is required");if(!e.event||typeof e.event!="string")throw new Error("seatmap: `event` key is required");if(!e.container)throw new Error("seatmap: `container` is required (or use SeatPicker.open())");this.performanceGroup=ba(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??Jd).replace(/\/+$/,"");let t={onExpired:a=>{this.opts.onAccessExpired?.(a),a.refreshed||this.showAccessPanel({reason:"no_token",retryable:!1})},onUnavailable:a=>{this.opts.onAccessUnavailable?.(a),this.showAccessPanel(a)}},n=!e.transport&&e.publicKey&&!e.buyerAccessTokenProvider&&!e.buyerAccessToken?jt({base:this.apiBase,event:e.event,publicKey:e.publicKey,accessHooks:t,apiOptions:{referral:e.referral,onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)}}):null;this.access=e.transport?null:n?.access??yt(e,t),this.pubApi=e.transport?null:n?.api??new Ae(this.apiBase,{access:this.access??void 0,referral:e.referral,onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)}),this.api=e.transport??this.pubApi,this.buyerAssetUrls=new et(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 r=e.numberOfPlacesToSelect;if(r!=null&&(!Number.isInteger(r)||r<1))throw new Error("seatmap: `numberOfPlacesToSelect` must be a positive integer");this.exactTickets=r??null;let s=wo(e.selectionValidators);if(this.exactTickets!=null&&s>this.exactTickets)throw new Error("seatmap: `minimumSelectedPlaces.minimum` cannot exceed `numberOfPlacesToSelect`");let o=Math.max(1,Math.floor(e.maxSelection??this.exactTickets??Math.max(ep,s)));if(this.exactTickets!=null&&o<this.exactTickets)throw new Error("seatmap: `maxSelection` cannot be lower than `numberOfPlacesToSelect`");if(e.maxSelection!=null&&o<s)throw new Error("seatmap: `maxSelection` cannot be lower than `minimumSelectedPlaces.minimum`");this.maxTickets=this.exactTickets??o,this.cbSafe=sp()??!!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 rt(e)}isFramed(){return typeof window<"u"&&window.parent!==window}postToHost(e){if(!this.isFramed())return;let t=wa({framed:!0,ancestorOrigins:window.location.ancestorOrigins,referrer:document.referrer});if(t)try{window.parent.postMessage(e,t)}catch{}}measureFramedHeight(){let e=this.root;if(!e)return 0;let t=e.clientWidth||(typeof window<"u"?window.innerWidth:0)||0;if(t<=0)return 0;let n=t<640?1.2:.62;return Math.max(420,Math.round(t*n))}reportFramedHeight(){if(!this.isFramed())return;let e=this.measureFramedHeight();e<=0||e===this.lastPostedHeight||(this.lastPostedHeight=e,this.postToHost({type:"seatlayer:height",px:e}))}toggleFullscreen(){let e=this.root;if(!e)return;!!document.fullscreenElement||this.fsFallback||this.framedFs?document.fullscreenElement?document.exitFullscreen().catch(()=>{}):this.framedFs?this.setFramedFs(!1):this.setFsFallback(!1):e.requestFullscreen?e.requestFullscreen().catch(()=>this.enterFsFallback()):this.enterFsFallback()}fillsViewport(){let e=this.root;if(!e||typeof window>"u")return!1;let t=e.getBoundingClientRect();return t.height>=window.innerHeight-ka&&t.width>=window.innerWidth-ka}syncFullscreenAffordance(){let e=this.els.zfs;if(!e)return;let n=!(!!document.fullscreenElement||this.fsFallback||this.framedFs)&&this.root?.dataset.layout==="narrow"&&this.fillsViewport();e.hidden=n,e.tabIndex=n?-1:0,e.setAttribute("aria-hidden",String(n))}syncFullscreenButtons(){let e=!!document.fullscreenElement||this.fsFallback||this.framedFs,t=this.eventDetailsHidden&&!e;this.root?.setAttribute("data-event-details-hidden",String(t)),this.root?.setAttribute("data-fs",String(e)),this.els.zfs?.setAttribute("aria-pressed",String(e)),this.els.zfs?.setAttribute("title",e?this.tf("picker.exitFullScreen","Exit full screen"):this.tf("picker.fullScreen","Full screen"));let n=this.els.zfs?.querySelector(".sl-zfs-lbl");n&&(n.textContent=e?this.tf("picker.exitFullScreen","Exit full screen"):this.tf("picker.fullScreen","Full screen")),this.view3dEl?.querySelector(".sl-view3d-fs")?.setAttribute("aria-pressed",String(e)),this.syncFullscreenAffordance()}enterFsFallback(){this.isFramed()?this.setFramedFs(!0):this.setFsFallback(!0)}setFramedFs(e){this.framedFs!==e&&(this.framedFs=e,this.syncFullscreenButtons(),this.postToHost({type:"seatlayer:fullscreen",on:e,background:this.cssVar("--sl-bg")||void 0}),e&&!this.fsEscHandler?(this.fsEscHandler=t=>{t.key==="Escape"&&!document.fullscreenElement&&this.setFramedFs(!1)},window.addEventListener("keydown",this.fsEscHandler)):!e&&this.fsEscHandler&&(window.removeEventListener("keydown",this.fsEscHandler),this.fsEscHandler=null),requestAnimationFrame(()=>this.controller.refitCurrentView()))}setFsFallback(e){this.fsFallback!==e&&(this.fsFallback=e,this.root?.classList.toggle("sl-fs",e),this.syncFullscreenButtons(),e&&!this.fsEscHandler?(this.fsEscHandler=t=>{t.key==="Escape"&&!document.fullscreenElement&&this.setFsFallback(!1)},window.addEventListener("keydown",this.fsEscHandler)):!e&&this.fsEscHandler&&(window.removeEventListener("keydown",this.fsEscHandler),this.fsEscHandler=null),requestAnimationFrame(()=>this.controller.refitCurrentView()))}close(){this.closeModal?this.closeModal():this.destroy()}static async open(e){tt();let t=document.activeElement instanceof HTMLElement?document.activeElement:null,n=document.createElement("div");n.className="sl-modal-scrim";let r=document.createElement("div");r.className="sl-modal-frame",r.style.setProperty("--sl-bg",Ue(void 0,e.theme)["--sl-bg"]),r.setAttribute("role","dialog"),r.setAttribute("aria-modal","true"),r.setAttribute("aria-label",v("picker.seatSelection","Seat selection")),r.tabIndex=-1,n.appendChild(r),document.body.appendChild(n);let s=document.body.style.overflow;document.body.style.overflow="hidden";let o=new i({...e,container:r});o.modalScrim=n,o.prevFocus=t;let a=["a[href]","area[href]","button","input","select","textarea","iframe","object","embed","summary","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"[tabindex]"].join(","),l=()=>{let g=[...r.querySelectorAll('[role="dialog"][aria-modal="true"]')].filter(b=>b.isConnected&&!b.closest('[hidden], [aria-hidden="true"], [inert]'));return g[g.length-1]??r},c=(g,b)=>{let w=g;for(;w;){let x=window.getComputedStyle(w);if(w.hidden||w.getAttribute("aria-hidden")==="true"||w.hasAttribute("inert")||x.display==="none"||x.visibility==="hidden"||x.visibility==="collapse")return!0;if(w===b)return!1;w=w.parentElement}return!0},p=g=>[...g.querySelectorAll(a)].filter(b=>b.tabIndex>=0&&!b.matches(":disabled")&&!c(b,g)),d=(g,b)=>{let w=p(g),x=b?w[w.length-1]:w[0];x?x.focus({preventScroll:!0}):(g.hasAttribute("tabindex")||(g.tabIndex=-1),g.focus({preventScroll:!0}))},u=!1,h=()=>{if(u)return;u=!0,document.body.style.overflow=s,o.escHandler&&document.removeEventListener("keydown",o.escHandler),n.remove(),o.modalScrim=null;let g=o.prevFocus;o.prevFocus=null,g?.isConnected&&g.focus({preventScroll:!0});let b=()=>{o.destroy(),e.onClose?.()};o.hold&&!o.handedOff?o.release().finally(b):b()};return o.closeModal=h,n.addEventListener("mousedown",g=>{g.target===n&&h()}),o.escHandler=g=>{if(g.key==="Tab"){if(g.defaultPrevented)return;let b=l(),w=p(b),x=w[0],y=w[w.length-1],m=document.activeElement;!x||!y?(g.preventDefault(),d(b,g.shiftKey)):m===b||!m||!b.contains(m)?(g.preventDefault(),(g.shiftKey?y:x).focus({preventScroll:!0})):g.shiftKey&&m===x?(g.preventDefault(),y.focus({preventScroll:!0})):!g.shiftKey&&m===y&&(g.preventDefault(),x.focus({preventScroll:!0}));return}g.key==="Escape"&&(o.tableDialog?(g.preventDefault(),o.cancelTableDialog()):o.confirmSeat?(g.preventDefault(),o.cancelConfirm()):o.bestAvailableConfirm?(g.preventDefault(),o.bestAvailableConfirm=!1,o.syncTray()):(g.preventDefault(),h()))},document.addEventListener("keydown",o.escHandler),await o.render(),o.els.close?.classList.add("on"),o.els.close?.addEventListener("click",h),d(l(),!1),o}wireController(e){return new Kd({transport:this.api,eventKey:e.event,maxSelection:this.maxTickets,selectedObjects:e.selectedObjects,selectableObjects:e.selectableObjects,numberOfPlacesToSelect:e.numberOfPlacesToSelect,selectionValidators:e.selectionValidators,currency:e.currency,flashOnLiveChange:!0,colorblindSafe:this.cbSafe,...e.loadingReveal?{loadingReveal:e.loadingReveal}:{},mapTheme:qe(e.theme),onSeatsRevealed:()=>{this.seatsRevealed=!0,e.onSeatsRevealed?.(),this.seatsRevealedReport?.()},onGAClick:t=>{let n=this.controller.getGAAreas().find(r=>r.id===t);n&&(this.collapseSheet(),zi(this,n,this.lastMapPoint))},onSelectionChange:()=>{this.syncTray(),this.minimap?.refreshMinimap(),this.committedSelection().length&&this.collapseSectionCard(),this.syncSelectionTo3d()},onStatusChange:(t=>{this.syncSeatMarks(),this.syncPrices(),this.a11yMenu?.syncCounts(),zr(t)&&this.scheduleOfferRefresh(!0),this.evictTakenSelections(),this.detectBooked(),this.minimap?.refreshMinimap(),this.pushAvailabilityTo3d()}),onHoldExpired:()=>{let t=this.handedOff,n=this.holdConflicted;this.holdExpiredUnits=sa(this.hold),this.hold=null,this.forgetHold(),this.handedOff=!1,this.bookedShown=!1,this.holdConflicted=!1,this.ctaPhase="idle",this.stopHoldTimer(),this.gaQty.clear(),this.lapse.deferExpiryToast(()=>{if(t||n){this.toast(B("picker.holdExpired",void 0)||"Your hold expired \u2014 seats released. Pick again.","warning");return}this.showHoldExpired()}),this.syncTray(),this.emitHoldChange(),this.opts.onHoldExpired?.()},onAvailabilityRefresh:t=>this.lapse.handle(t),confirmSelection:this.opts.confirmSelection,onSelect:t=>{if(this.salesClosed){this.controller.deselect([t.id]),this.toast(this.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}this.controller.tableSelection(t.id)||(this.collapseSheet(),this.flashPickedSeat(t.id),this.opts.confirmSelection&&this.suppressConfirmationSeatId!==t.id&&this.showConfirm(t))},onTableSelectionRequest:t=>{if(this.salesClosed){this.controller.deselect(t.physicalSeatIds),this.toast(this.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}this.showTableDialog(t,!1)},onDeselect:t=>{if(this.controller.currentHold()?.labels.includes(t.label)){this.removeHeldLabels([t.label]);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(B("picker.maxTicketsForOrder",{count:this.maxTickets}),"warning"),this.opts.onSelectionLimit?.(this.maxTickets)},onViewChange:()=>{this.reanchorConfirm(),this.syncRung(),this.syncProjection(),this.minimap?.drawMinimapRect(),this.sectionCardOnView()},onSectionFocus:t=>this.showSectionCard(t),onDeckTap:()=>{this.showSectionCard(null),this.syncFloors(),this.syncRung(),this.minimap?.refreshMinimap()},onFocusSeat:t=>this.announceSeat(t),onSeatHover:t=>this.updateTooltip(t),hostCardOpen:()=>this.tipPinned||!!this.confirmSeat,onHint:t=>{t&&this.toast(t)},onSalesClosed:()=>this.setSalesClosed(!0),onError:t=>this.opts.onError?.(t)})}async render(){if(this.rendered)return this;let e=performance.now(),t={},n=C=>Math.round((performance.now()-C)*100)/100;this.rendered=!0,tt();let r=performance.now(),s=Vt(this.opts.locale,this.opts.messages),o=this.localeGeneration+=1;this.checkoutMode==="hosted"&&(this.paymentOptions=this.pubApi.paymentOptions(this.opts.event));let a=performance.now(),l=br(this.opts.container),{root:c,els:p,mapHost:d}=Gn(l,(C,D)=>this.tf(C,D),this.opts.theme);this.root=c,this.els=p,this.mapHost=d,$t(c,s,C=>{t.loadLocale=n(r),this.destroyed||this.applyActiveLocale(C,o)}),js(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");u.style.cssText="position:absolute;inset:0",this.mapHost.appendChild(u),t.mountBuyerShell=n(a),t.skeletonPaint=n(e),this.startRealtime();let h=await this.loadChart(u,t,n);if(!h)return this.realtime?.stop(),this.realtime=null,this;t.shellsPaint=n(e);let g=performance.now();if(this.salesClosed=!!h.salesClosed||!!this.opts.readOnly,c.dataset.eventMode=h.mode==="test"?"test":"live",!this.opts.locale&&h.locale&&this.setLocale(h.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),h.mode==="test"){let C=document.createElement("div");C.className="sl-testbadge",C.textContent=gr(B("picker.testMode"),xa()),C.setAttribute("aria-label",B("picker.testMode")),C.title=this.tf("picker.testModeExplained","Bookings here are not real and no card is charged"),this.regions["top-left"].appendChild(C)}let b=this.controller.doc?.theme;this.themeMode=this.opts.theme?.mode??null,this.applyThemeTokens(c),this.watchThemeMode(),this.currency=h.currency??this.opts.currency??"USD",this.eventTimezone=h.timezone??null,vr(this.els.logo,[this.opts.theme?.logoUrl,b?.logoUrl,h.posterUrl],this.opts.theme?.brandName??b?.brandName??h.eventName??"?"),this.els.name.textContent=h.eventName??"";let w=h.startsAt?Zt(h.startsAt,h.timezone??null,this.opts.locale):"";this.eventWhenText=w||null,this.els.meta.textContent=[h.venue,w].filter(Boolean).join(" \xB7 "),this.syncProjection(),this.buildBadge(b);let x=!!this.controller.doc&&this.controller.getExpandedSeats().some(C=>C.commercial?.restrictedView||C.commercial?.obstructedView);this.buildAccessibilityMenu(x),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"),c.appendChild(this.srEl),this.buildArenaChrome(),this.buildMinimap(),this.buildPriceFilter(),this.buildExtendPrompt(),this.buildBookedOverlay(),this.buildSoldoutOverlay(),this.buildPanelToggle(),this.opts.panelCollapsed&&this.setPanelCollapsed(!0),this.dockLayoutChrome(),t.buildBuyerControls=n(g);let y=performance.now();if(await this.restoreRememberedHold(),t.restoreHold=n(y),this.destroyed)return this;this.dismissSkeleton(),this.salesClosed&&this.applySalesClosed(),this.syncPrices(),this.syncTray(),this.resumeHostedOrder();let m=this.controller.doc,A=ri(this.opts.event),_=this.performanceGroup?.surface??(this.performanceGroup?"performance_group":null),k=_??"event",M={apiBase:this.apiBase,eventKey:this.opts.event,metricScope:k,surface:_==="season"?"season_picker":_==="performance_group"?"performance_group_picker":"seat_picker",ms:n(e),performanceProfile:t,chartDelivery:h.chartDelivery,seatCount:this.allSeats().length,objectCount:m?.objects.length??0,sectionCount:m?.objects.filter(C=>C.type==="section").length??0,floorCount:this.controller.getFloors().length,chartName:m?.name,view:this.buyerView,load:A,transport:this.opts.transport?"custom":"pubapi"};Ys(M,(C,D)=>this.emitAnalytics(C,D));let L=h.performanceProfile;return this.seatsRevealedReport=()=>this.emitAnalytics("chart_seats_revealed",gn({...M,performanceProfile:{...M.performanceProfile,...L}})),this.seatsRevealed&&this.seatsRevealedReport(),this.renderInfo=h,await this.registerAgentTools(),this}registerAgentTools(){return Ws(this)}webMcpHost(e){return fn(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=fa(()=>{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.zfs.addEventListener("click",()=>this.toggleFullscreen()),this.fsChangeHandler=()=>{document.fullscreenElement||this.setFsFallback(!1),this.syncFullscreenButtons(),requestAnimationFrame(()=>this.controller.refitCurrentView())},document.addEventListener("fullscreenchange",this.fsChangeHandler);let t=this.els.sheetHead;if(t){let r=this.els.sheetToggle,s=c=>{e.dataset.sheet=c?"open":"peek",r?.setAttribute("aria-expanded",String(c)),r?.setAttribute("aria-label",c?this.tf("picker.collapseTicketPanel","Collapse ticket panel"):this.tf("picker.openTicketPanel","Open ticket panel"))};s(e.dataset.sheet==="open"),r?.addEventListener("click",c=>{c.stopPropagation(),s(e.dataset.sheet!=="open")}),this.els.peek?.addEventListener("click",c=>{let p=c.target.closest(".sl-sheet-go");p&&(c.stopPropagation(),p.dataset.act==="checkout"?this.handleCta():p.dataset.act==="best"||p.dataset.act==="find"?(p.dataset.act==="best"&&(this.baReopen=!0,this.baQty=Math.max(1,Math.min(this.baQty,this.maxTickets-this.totalTicketCount())),this.syncTray()),s(!0),this.els.tray?.querySelector(".sl-ba")?.scrollIntoView({block:"nearest",behavior:this.reducedMotion()?"auto":"smooth"}),this.els.tray?.querySelector(".sl-ba-go")?.focus()):s(!0))});let o=0,a=!1,l=!1;t.addEventListener("pointerdown",c=>{if(c.target.closest?.(".sl-seccard,.sl-sheet-toggle,.sl-sheet-go")){l=!1;return}l=!0,a=!1,o=c.clientY,t.setPointerCapture?.(c.pointerId)}),t.addEventListener("pointermove",c=>{if(!l||a)return;let p=c.clientY-o;p<-18?(s(!0),a=!0):p>18&&(s(!1),a=!0)}),t.addEventListener("pointerup",c=>{l&&!a&&Math.abs(c.clientY-o)<6&&s(e.dataset.sheet!=="open"),l=!1,t.releasePointerCapture?.(c.pointerId)})}let n=()=>{if(this.root?.dataset.layout!=="narrow")return;let r=this.root.getAttribute("data-prices-open")==="true";if(this.root.setAttribute("data-prices-open",String(!r)),this.els.pricesSec?.setAttribute("aria-expanded",String(!r)),!r&&this.root.dataset.sheet!=="open"){this.root.dataset.sheet="open";let s=this.els.sheetToggle;s?.setAttribute("aria-expanded","true"),s?.setAttribute("aria-label","Collapse ticket panel")}};this.els.pricesSec?.addEventListener("click",r=>{r.target.closest("select,button")||n()}),this.els.pricesSec?.addEventListener("keydown",r=>{r.key!=="Enter"&&r.key!==" "||r.target.closest("select,button")||(r.preventDefault(),n())}),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",r=>{this.handleMapPointerDown(r)},!0),this.els.map.addEventListener("mousemove",r=>{if(this.tipPinned)return;let s=this.els.map.getBoundingClientRect();this.tipPos={x:r.clientX-s.left,y:r.clientY-s.top},this.tipEl&&this.tipEl.style.display!=="none"&&this.placeTooltip()}),this.els.cta.addEventListener("click",()=>{this.handleCta()})}collapseSheet(){let e=this.root;!e||e.dataset.layout!=="narrow"||e.dataset.sheet!=="open"||(e.dataset.sheet="peek",this.els.sheetToggle?.setAttribute("aria-expanded","false"),this.els.sheetToggle?.setAttribute("aria-label",this.tf("picker.openTicketPanel","Open ticket panel")))}observeLayout(e){let t=()=>{let n=e.clientWidth;if(n<=0)return;let r=e.clientHeight,s=n!==this.pickerLayoutSize.width||r!==this.pickerLayoutSize.height;this.pickerLayoutSize={width:n,height:r},this.reportFramedHeight();let o=n<640?"narrow":"wide",a=r<560?"compact":"comfortable";(e.dataset.layout!==o||e.dataset.density!==a)&&(e.dataset.layout=o,e.dataset.density=a,this.controller.getRenderer()?.setSectionFocusDim?.(o!=="narrow"),o==="narrow"&&!e.dataset.sheet&&(e.dataset.sheet="peek"),this.dockLayoutChrome(),this.syncMinimapForLayout(),this.lastTrayKeys.size&&this.syncTray(),this.syncMapStepBack(),this.refreshExtendPrompt()),this.syncFullscreenAffordance(),s&&(this.minimap?.refreshMinimap(),this.scheduleFit())};this.ro=new ResizeObserver(t),this.ro.observe(e),t(),requestAnimationFrame(t)}async loadChart(e,t,n){let r=performance.now(),s=await this.controller.render(e);return t.loadChartAndStatuses=n(r),this.destroyed?null:s?(Object.assign(t,s.performanceProfile),s):(xe({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:"load_chart",ms:t.loadChartAndStatuses,performanceProfile:t,view:"map",load:Me(this.opts.event),transport:this.opts.transport?"custom":"pubapi"}),this.els.boot.innerHTML=`<div class="sl-boot-title">${this.tf("picker.mapDidNotLoad","The seat map didn\u2019t load")}</div><div>${this.tf("picker.checkConnection","Check your connection and try again.")}</div><button type="button" class="sl-boot-retry">${this.tf("picker.accessRetry","Try again")}</button>`,this.els.boot.querySelector("button").addEventListener("click",()=>{let o=this.opts.container,a=this.opts;this.destroy(),new i({...a,container:o}).render()}),null)}resumeHostedOrder(){if(this.checkoutMode!=="hosted")return;let e=ya(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.regions["bottom-left"]??this.els.map;t&&(this.a11yMenu=new Ei(t,{event:String(this.opts.event),chart:()=>this.controller.doc?.name??null,needs:()=>this.controller.getAccessNeeds(),hasLimitedView:e,tf:(n,r)=>this.tf(n,r),isColorblindSafe:()=>this.cbSafe,setColorblindSafe:n=>this.setColorblindSafe(n),isLimitedViewHidden:()=>this.limitedViewFilter,setLimitedViewHidden:n=>{this.limitedViewFilter=n,this.controller.setCommercialLimitedFilter(n),this.pushAvailabilityTo3d()},applyAccessibilityFilter:n=>this.applyAccessibilityFilter(n),focusSeatsForFilter:()=>this.focusSeatsForFilter(),stepToAccessibleSection:n=>this.controller.focusNextAccessibleSection?.([n])??null}),this.cbEl=this.a11yMenu.colorblindRow())}focusSeatsForFilter(){if(this.controller.focusAccessibilityFilter?.()){this.explainAccessibilitySpread();return}this.rungsEl&&this.controller.getRung()!=="seats"&&(this.controller.setRung("seats"),this.collapseSectionCard(),this.syncRung())}explainAccessibilitySpread(){let e=this.controller.accessibilitySpread?.();!e?.wholeVenue||e.sections.length<2||this.toast(B("picker.accessSpreadHint",{count:e.spaces,sections:e.sections.length}),"neutral")}applyAccessibilityFilter(e){this.controller.setAccessibilityFilter(e),this.syncPrices(),this.minimap?.refreshMinimap(),this.pushAvailabilityTo3d()}setAccessibilityFilter(e){this.applyAccessibilityFilter(e),this.a11yMenu?.syncAccessibilityFilter(e),e?.length&&this.focusSeatsForFilter()}focusAccessibilityFilter(){this.focusSeatsForFilter()}dockLayoutChrome(){let e=this.root?.dataset.layout==="narrow";this.applyPanelCollapsed();let t=this.els.zfs,n=this.els.headInfo?.parentElement;t&&n&&t.parentElement!==n&&(t.classList.add("sl-fs-pill"),n.insertBefore(t,this.els.hold??null));let r=this.extendEl;if(r){let o=e?this.regions["bottom-center"]??this.els.map:n;o&&r.parentElement!==o&&(r.dataset.dock=e?"map":"head",o===n?o.insertBefore(r,this.els.close??null):o.appendChild(r))}let s=this.els.pricesSec;s&&(e?(s.setAttribute("role","button"),s.tabIndex=0,s.setAttribute("aria-expanded",String(this.root?.getAttribute("data-prices-open")==="true"))):(s.removeAttribute("role"),s.removeAttribute("aria-expanded"),s.tabIndex=-1)),this.lastSection&&this.renderSectionCard(this.lastSection)}buildExtendPrompt(){Po(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>${H(this.tf("picker.backToMap","Back to map"))}</span></button>`,this.root.appendChild(e),this.bookedEl=e,this.els.bookedSub=e.querySelector('[data-ref="bookedSub"]'),this.els.bookedList=e.querySelector('[data-ref="bookedList"]'),e.querySelector('[data-ref="bookedBack"]')?.addEventListener("click",()=>this.dismissBooked())}get onGAPromptHook(){return this.opts.onGAPrompt}tf(e,t){return v(e,t)}buildSoldoutOverlay(){if(!this.els.map)return;let e=document.createElement("div");e.className="sl-soldout",e.setAttribute("role","status");let t=(this.controller.doc?.theme?.brandName??this.opts.theme?.brandName??this.els.name?.textContent??this.tf("picker.soldOutEyebrow","This event")).toUpperCase(),n=document.createElement("div");n.className="sl-soldout-eyebrow",n.textContent=t;let r=document.createElement("div");r.className="sl-soldout-title",r.textContent=this.tf("picker.soldOutTitle","Sold out");let s=document.createElement("p");s.className="sl-soldout-copy",s.textContent=this.tf("picker.soldOutCopy","No reserved seats are currently available for this event."),e.append(n,r,s),this.els.map.appendChild(e),this.soldoutEl=e}syncSoldout(e,t){let n=this.controller.getGAAreas().length>0,r=this.isSoldOut(e,t,n);r!==this.soldOut&&(this.soldOut=r,this.soldoutEl?.classList.toggle("on",r))}isSoldOut(e,t,n){return!n&&e.length>0&&e.every(r=>(t[r.key]??0)===0)}setSalesClosed(e){let t=e||!!this.opts.readOnly;this.salesClosed!==t&&(this.salesClosed=t,this.applySalesClosed())}applySalesClosed(){this.salesClosed&&this.tableDialog&&!this.tableDialogHeld&&this.cancelTableDialog();let e=this.els.closedPill;if(e){e.classList.toggle("on",this.salesClosed);let t=this.els.closedPillText??e;t.textContent=this.tf("picker.salesClosedPill","Sales are closed")}this.root?.setAttribute("data-sales-closed",String(this.salesClosed)),this.salesClosed&&this.srEl&&(this.srEl.textContent=this.tf("picker.salesClosedToast","Sales are closed for this event.")),this.syncCta(),this.syncTray()}badgeHidden(e){return!!(this.opts.hideBadge||e?.hideBadge)}buildBadge(e){if(this.badgeHidden(e))return;let t=this.els.foot;if(!t)return;let n=document.createElement("a");n.className="sl-powered",n.href="https://seatlayer.io/?ref=picker",n.target="_blank",n.rel="noopener noreferrer",n.setAttribute("aria-label",this.tf("picker.poweredBy","Powered by SeatLayer"));let r=document.createElement("span");r.className="sl-powered-mark",r.setAttribute("aria-hidden","true"),r.innerHTML=Wt;let s=document.createElement("span");s.textContent=this.tf("picker.poweredBy","Powered by SeatLayer"),n.append(r,s),t.appendChild(n)}buildRegions(){if(!this.els.map)return;let e=["top-left","top-center","top-right","left-rail","bottom-left","bottom-center","bottom-right"];for(let t of e){let n=document.createElement("div");n.className="sl-anchor",n.dataset.region=t,this.els.map.appendChild(n),this.regions[t]=n}}cssVar(e){return this.root?getComputedStyle(this.root).getPropertyValue(e).trim():""}reducedMotion(){return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}scheduleMotion(e,t){let n=setTimeout(()=>{this.motionTimers.delete(n),this.destroyed||e()},t);this.motionTimers.add(n)}animateOnce(e,t,n=600){!e||this.reducedMotion()||(e.classList.remove(t),e.offsetWidth,e.classList.add(t),this.scheduleMotion(()=>e.classList.remove(t),n))}flashPickedSeat(e){this.reducedMotion()||this.controller.flashSeat(e,this.cssVar("--sl-accent")||"#f4b740")}flashHeldSeats(e){let t=this.reducedMotion(),n=(e.items??[]).filter(r=>r.objectType!=="ga").slice(0,10).map(r=>this.controller.seatByLabel(r.label)).filter(r=>!!r);Ar({regions:this.els,categories:this.controller.doc?.categories,pop:r=>this.controller.flashSeat(r,this.cssVar("--sl-accent")||"#f4b740"),focus:(r,s)=>this.controller.focusSection(r,s),focusSeats:r=>this.controller.focusSeats?.(r,{animate:!t})===!0,reducedMotion:t,screenPoint:r=>this.controller.worldToScreen(r),schedule:(r,s)=>this.scheduleMotion(r,s)},n)}committedSelection(){let e=this.confirmSeat?.id,t=this.tableDialog&&!this.tableDialogHeld?this.tableDialog.id:null;return this.controller.getSelection().filter(n=>n.id!==e&&n.id!==t)}pendingSelectionCount(){return Mo(this)}heldTicketCount(){return Ho(this)}totalTicketCount(){return Ro(this)}updateSelectionCapacity(){Oo(this)}syncCta(e=this.lastTrayCount,t=this.pendingSelectionCount()){Io(this,e,t)}setCtaPhase(e){_o(this,e)}runCheckoutHandoff(e,t){return Do(this,e,t)}holdStorageKey(){return Bo(this)}rememberedHoldId(){return No(this)}rememberHold(e){Fo(this,e)}forgetHold(){Vo(this)}resumeHoldFromServer(e){return $o(this,e)}restoreRememberedHold(){return zo(this)}activeFloorObjects(){let e=this.controller.doc;if(!e)return[];let t=e.floors;if(t?.length){let n=this.controller.getActiveFloorId();return(t.find(r=>r.id===n)??t[0]).objects??[]}return e.objects??[]}buildMinimap(){!this.els.map||this.root?.dataset.layout==="narrow"||(this.minimap=Ns({controller:this.controller,root:()=>this.root,cssVar:e=>this.cssVar(e),focusedSectionLabel:()=>this.lastSection?.label},this.regions["bottom-left"]??this.els.map))}syncMinimapForLayout(){let e=this.root?.dataset.layout==="narrow";if(e&&this.minimap){this.minimap.dispose(),this.minimap=null;return}!e&&!this.minimap&&this.buildMinimap()}catPrice(e){return yi(this,e)}catPriceRange(e){return wi(this,e)}buildPriceFilter(){Jo(this)}applyPriceBand(e){ea(this,e)}buildArenaChrome(){let e=this.controller.doc;if(!e||!this.els.map)return;let t=e.objects.some(n=>n.type==="section")||(e.floors??[]).some(n=>n.objects.some(r=>r.type==="section"));if(this.canOffer3d()){let n=document.createElement("div");n.className="sl-projection",n.setAttribute("role","group"),n.setAttribute("aria-label",this.tf("picker.venueView","Venue view")),n.innerHTML=`<button type="button" data-view="map" aria-pressed="true" title="${this.tf("picker.flat2dMap","Flat 2D map")}">${this.tf("picker.map","Map")}</button><button type="button" data-view="venue3d" aria-pressed="false" title="${this.tf("picker.interactive3dVenueView","Interactive 3D venue view")}">3D</button>`,n.querySelectorAll("button").forEach(r=>{if(r.dataset.view==="venue3d")for(let s of["pointerenter","focus","pointerdown"])r.addEventListener(s,Xt,{once:!0});r.addEventListener("click",()=>{this.setBuyerView(r.dataset.view)})}),this.regions["top-right"].appendChild(n),this.projectionEl=n,this.syncProjection()}if(t){let n=[...e.objects,...(e.floors??[]).flatMap(p=>p.objects)],r=new Set((e.zones??[]).map(p=>p.id)),o=n.some(p=>p.type==="section"&&typeof p.zone=="string"&&r.has(p.zone))?["zones","sections","seats"]:["sections","seats"],a=document.createElement("div");a.className="sl-rungs on sl-mo-indicator",a.setAttribute("role","group"),a.setAttribute("aria-label",B("picker.zoomLevel"));let l={zones:B("picker.rungLabel.zones"),sections:B("picker.rungLabel.sections"),seats:B("picker.rungLabel.seats")},c={zones:B("picker.rungTip.zones"),sections:B("picker.rungTip.sections"),seats:B("picker.rungTip.seats")};a.innerHTML=o.map(p=>`<button type="button" data-rung="${p}" title="${c[p]}" aria-pressed="false">${l[p]}</button>`).join(""),a.querySelectorAll("button").forEach(p=>{p.addEventListener("click",()=>{let d=p.dataset.rung;this.controller.setRung(d),d==="seats"&&this.collapseSectionCard()})}),this.regions["top-center"].appendChild(a),this.rungsEl=a,this.syncRung()}if(this.controller.isMultiFloor()){let n=cs({floors:this.controller.getFloors(),tf:(r,s)=>this.tf(r,s),onChoose:r=>{r===""?this.controller.setFloorOverview(!0):this.controller.setFloor(r),this.showSectionCard(null),this.syncFloors(),this.syncRung(),this.minimap?.refreshMinimap()}});this.regions["left-rail"].appendChild(n),this.floorsEl=n,this.syncFloors()}}syncRung(){let e=this.controller.getRung(),t=this.controller.seatsRevealed?.()??(e==="seats"||!!this.controller.getFocusedSection?.());this.root&&(this.root.dataset.zoomed=String(t)),this.syncMapStepBack(),this.minimap?.setAutoOpen(!1),this.rungsEl&&this.rungsEl.querySelectorAll("button").forEach(n=>{let r=n.dataset.rung===e;n.classList.toggle("on",r),n.setAttribute("aria-pressed",String(r))})}syncMapStepBack(){let e=this.els?.zout;if(!(!e||!this.root)){if(this.root.dataset.layout!=="narrow"){e.disabled&&(e.disabled=!1);return}e.disabled=Gr({focusedSection:this.controller.getFocusedSection?.()??null,seatsRevealed:this.controller.seatsRevealed?.()??!0})==="none"}}syncProjection(){this.els.pricesHint&&(this.els.pricesHint.textContent=this.buyerView==="venue3d"?this.tf("picker.priceHint3d","Colours in the venue are ticket types \u2014 choose one below to show just those seats."):this.tf("picker.priceHint","Colours on the map are ticket types \u2014 tap one below to show just those seats.")),this.projectionEl&&this.projectionEl.querySelectorAll("button").forEach(e=>{let t=e.dataset.view===this.buyerView;e.classList.toggle("on",t),e.setAttribute("aria-pressed",String(t))})}canOffer3d(){return this.opts.enable3D===!1||!this.controller.doc||!Yt()?!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)?Sa/2:Sa}syncFloors(){ds(this.floorsEl,this.controller.getActiveFloorId(),this.controller.isFloorOverview())}get sectionCard(){return this.sectionCardCache||(this.sectionCardCache=new di({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(r=>r.type==="section"&&!this.controller.isSectionClosed(r.id)&&this.controller.getSectionSeatCount(r.id)>0);if(t.length<2)return null;let n=t.findIndex(r=>r.id===e);return n<0?null:{previous:t[(n-1+t.length)%t.length],next:t[(n+1)%t.length]}}markedSeatAnnouncement(e){let t=ln(this.controller.getRenderer()?.getSeatMark?.(e.id),this.performanceGroup?.nights?.());return xs(t,e.displayLabel??e.label,this.opts.locale)}announceSeat(e){if(!this.srEl)return;if(!e){this.srEl.textContent="";return}let t=this.markedSeatAnnouncement(e);if(t){this.srEl.textContent=t;return}let n=this.controller.doc?.categories.find(h=>h.key===e.categoryKey),r=this.controller.getStatus(e.id)??"free",s=r==="free"?this.tf("picker.statusAvailable","available"):r==="held"?this.tf("picker.statusOnHold","on hold"):this.tf("picker.statusTaken2","taken"),o=n?this.catPriceRange(n):void 0,a=!this.suppressPricing&&o?o.min===o.max?this.money(o.min):`${this.money(o.min)}\u2013${this.money(o.max)}`:void 0,l=this.controller.tableSelection(e.id),c=l??this.controller.seatDetails(e.id),p=Fe(c),d=c?.rowLabel??c?.displayLabel??e.displayLabel??e.label,u=l?`${p} ${d}, ${l.bookingMode==="variable"?B("picker.minToMaxGuests",{min:l.minOccupancy,max:l.maxOccupancy}):B("picker.capacityGuests",{count:l.capacity})}`:c?.objectType==="booth"?`${p} ${d}`:c?.objectType==="table"?`${p} ${d}, ${B("picker.seatNumberLower",{label:c.seatNumber??e.label})}`:B("picker.seatLabel",{label:c?.displayLabel??e.displayLabel??e.label});this.srEl.textContent=`${u}, ${n?.label??e.categoryKey}${a?`, ${a}`:""}, ${s}`}showTableDialog(e,t,n){this.dismissTableDialog(!1),this.tableDialog={...e},this.tableDialogHeld=t,this.tableDialogReturnFocus=n??document.activeElement;let r=this.controller.doc?.categories.find(a=>a.key===e.categoryKey),s=e.bookingMode==="variable",o=document.createElement("div");o.className="sl-table-scrim",o.innerHTML=os(e,{variable:s,held:t,typeWord:Fe(e),categoryLabel:r?.label??e.categoryKey,suppressPricing:this.suppressPricing,unitPrice:this.money(this.paidPrice(e.categoryKey,e.tierId??null,e.price,e.label))}),this.root.appendChild(o),this.tableDialogEl=o,this.renderTableDialogState(),o.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()})}),o.querySelector(".sl-table-cancel").addEventListener("click",()=>this.cancelTableDialog()),o.querySelector(".sl-table-confirm").addEventListener("click",()=>{this.confirmTableDialog()}),o.addEventListener("mousedown",a=>{a.target===o&&this.cancelTableDialog()}),o.addEventListener("keydown",a=>{if(a.key!=="Tab")return;let l=[...o.querySelectorAll('button:not(:disabled),[tabindex]:not([tabindex="-1"])')];if(!l.length)return;let c=l[0],p=l[l.length-1];a.shiftKey&&document.activeElement===c?(a.preventDefault(),p.focus()):!a.shiftKey&&document.activeElement===p&&(a.preventDefault(),c.focus())}),requestAnimationFrame(()=>o.querySelector(s?'[data-table-step="-1"]':".sl-table-confirm")?.focus())}renderTableDialogState(){let e=this.tableDialog,t=this.tableDialogEl;if(!e||!t)return;let n=t.querySelector("output[data-table-qty]");n&&(n.value=String(e.quantity));let r=t.querySelector("input[data-table-qty]");r&&(r.value=String(e.quantity)),t.querySelectorAll("[data-table-step]").forEach(a=>{let l=Number(a.dataset.tableStep);a.disabled=l<0?e.quantity<=e.minOccupancy:e.quantity>=e.maxOccupancy});let s=this.paidPrice(e.categoryKey,e.tierId??null,e.price,e.label),o=t.querySelector("[data-table-total]");o&&(o.textContent=this.money(s*e.quantity))}async confirmTableDialog(){let e=this.tableDialog,t=this.tableDialogHeld;if(!e)return;let n=this.tableDialogEl?.querySelector(".sl-table-confirm");if(n&&(n.disabled=!0,n.textContent=t?this.tf("picker.updatingEllipsis","Updating\u2026"):this.tf("picker.selectingEllipsis","Selecting\u2026")),t){try{let r=await this.controller.replaceTableQuantity(e.label,e.quantity,this.opts.holdTtlMs);if(!r){this.toast(this.tf("picker.guestCountCouldNotBeSecured","That guest count could not be secured. Your current table hold is unchanged."),"warning"),this.renderTableDialogState(),n&&(n.disabled=!1,n.textContent=this.tf("picker.updateTable","Update table"));return}this.hold={holdId:r.holdId,expiresAt:r.expiresAt,seats:r.seats,items:r.items},this.startHoldTimer(r.expiresAt),this.dismissTableDialog(),this.syncTray(),this.emitHoldChange(),this.toast(B("picker.tableUpdatedForGuests",{label:e.label,count:e.quantity}),"success")}catch(r){this.opts.onError?.(r),this.toast(this.tf("picker.guestCountNoLongerAvailable","That guest count is no longer available. Your current hold is unchanged."),"error"),n&&(n.disabled=!1,n.textContent=this.tf("picker.updateTable","Update table"))}return}if(!this.controller.setTableQuantity(e.label,e.quantity)){n&&(n.disabled=!1,n.textContent=e.bookingMode==="variable"?this.tf("picker.selectTable","Select table"):this.tf("picker.selectWholeTable","Select whole table"));return}this.dismissTableDialog(),this.collapseSectionCard(),this.syncTray()}cancelTableDialog(){let e=this.tableDialog,t=this.tableDialogHeld;this.dismissTableDialog(),e&&!t&&this.controller.deselect(e.physicalSeatIds)}dismissTableDialog(e=!0){let t=this.tableDialogReturnFocus;this.tableDialogEl?.remove(),this.tableDialogEl=null,this.tableDialog=null,this.tableDialogHeld=!1,this.tableDialogReturnFocus=null,e&&requestAnimationFrame(()=>(t?.isConnected?t:this.root)?.focus())}get confirmCard(){return this.confirmCardCache||(this.confirmCardCache=new gi({controller:this.controller,root:()=>this.root,els:()=>this.els,regions:()=>this.regions,hideTooltip:()=>{this.tipEl&&(this.tipEl.style.display="none")},tf:(e,t)=>this.tf(e,t),money:e=>this.money(e),paidPrice:(e,t,n,r)=>this.paidPrice(e,t,n,r),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(),reanchor:()=>this.reanchorConfirm(),inviteCommit:(e,t)=>this.inviteCommit(e,t),addSeatLabel:e=>this.addSeatLabel(e)})),this.confirmCardCache}showConfirm(e,t="add"){this.confirmCard.show(e,t)}reanchorConfirm(){this.confirmCard.reanchor()}dismissConfirm(){this.confirmCard.dismiss()}async commitConfirm(){await this.confirmCard.commit()}cancelConfirm(){this.confirmCard.cancel()}closeConfirm(){this.dismissConfirm()}inviteCommit(e,t){Ds(e,t,this.reducedMotion())}addSeatLabel(e){return Bs(e,(t,n)=>this.tf(t,n))}seatViewEnabled(){return this.opts.seatView!==!1}allSeats(){return this.allSeatsCache||(this.allSeatsCache=[...this.controller.getExpandedSeats()]),this.allSeatsCache}async openSeatView(e){if(!this.root||!this.seatViewEnabled())return;let t=++this.seatViewGen,n=this.controller.doc,r=this.controller.getActiveFloorId(),s=e.focalPoint??n?.floors?.find(d=>d.id===r)?.focalPoint??n?.focalPoint??{x:0,y:0},o,a,l=!1;if(e.viewUrl){let d,u=null;try{let g=e.viewMeta?.previewUrl;g&&g!==e.viewUrl?(u=await this.buyerAssetUrls.resolve(g),d=e.viewUrl):d=await this.buyerAssetUrls.resolve(e.viewUrl)}catch(g){t===this.seatViewGen&&this.opts.onError?.(g);return}if(t!==this.seatViewGen||!d||e.viewMeta?.previewUrl&&e.viewMeta.previewUrl!==e.viewUrl&&!u||!this.root||!this.seatViewEnabled())return;let h={url:d,...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}:{}};o=h,a=Zd(h),l=Qd(h)}else{let d;try{let{generateSeatPanorama:u}=await Qt();d=u(e,s,this.allSeats())}catch(u){t===this.seatViewGen&&this.opts.onError?.(u);return}if(t!==this.seatViewGen||!this.root||!this.seatViewEnabled())return;o={url:d.url,generated:!0},a=B("picker.illustrationCaption",{m:d.distanceM})}this.closeSeatView(!1);let c=B("picker.viewFromSeat",{label:e.label}),p=ti({root:this.root,source:o,caption:a,real:l,closeLabel:this.tf("picker.close","Close"),dragHint:De(),viewFromSeatLabel:c,real360Label:B("picker.real360"),previewLabel:B("picker.preview"),resolveAsset:d=>this.buyerAssetUrls.resolve(d),onClose:()=>this.closeSeatView()});this.viewEl=p.element,this.viewCleanup=()=>p.dispose()}closeSeatView(e=!0){e&&(this.seatViewGen+=1),this.viewCleanup?.(),this.viewCleanup=null,this.viewEl?.remove(),this.viewEl=null}money(e){let t=this.opts.pricing?.formatter;if(t)return t(e,this.currency);let n=Number.isInteger(e);return Wd(e,this.currency,{locale:this.opts.locale,fallback:(r,s)=>`${r} ${s}`,...n?{minimumFractionDigits:0,maximumFractionDigits:0}:{}})}scheduleOfferBoundary(e){if(this.offerBoundaryTimer&&clearTimeout(this.offerBoundaryTimer),this.offerBoundaryTimer=null,!this.api.availability||this.destroyed)return;let t=Date.now(),n=jr(e,t);if(n==null)return;let r=6*36e5,s=Math.min(Math.max(n-t+1e3,1e3),r);this.offerBoundaryTimer=setTimeout(()=>{this.offerBoundaryTimer=null,!document.hidden&&this.refreshOfferAvailability(!1)},s)}offerReadIsCurrent(){return!!this.offerReadInFlight||Date.now()-this.offerReadSettledAt<tp}scheduleOfferRefresh(e){!this.api.availability||this.destroyed||this.offerReadIsCurrent()||(this.offerRefreshTimer&&clearTimeout(this.offerRefreshTimer),this.offerRefreshTimer=setTimeout(()=>{this.offerRefreshTimer=null,this.refreshOfferAvailability(e)},e?180:0))}refreshOfferAvailability(e){if(!this.api.availability||this.destroyed)return Promise.resolve();if(this.offerReadInFlight)return this.offerReadInFlight;if(this.offerReadIsCurrent())return Promise.resolve();let t=this.readOfferAvailability(e).finally(()=>{this.offerReadInFlight===t&&(this.offerReadInFlight=null)});return this.offerReadInFlight=t,t}async readOfferAvailability(e){if(!(!this.api.availability||this.destroyed))try{let t=await this.api.availability(this.opts.event,e);if(this.destroyed)return;this.offerReadSettledAt=Date.now();let n=en(t);if(!n)return;this.offerAvailability=n,this.applyChannelPricing(n.channelPricing),this.scheduleOfferBoundary(n);let r=tn(n),s={...this.hostPricing?.prices??{},...r},o=Object.keys(s).length>0||this.hostPricing?.formatter?{prices:s,...this.hostPricing?.formatter?{formatter:this.hostPricing.formatter}:{}}:void 0;this.setPricing(o),this.syncOffer(),this.opts.onOfferAvailabilityChange?.(n)}catch{!this.destroyed&&!this.offerBoundaryTimer&&!document.hidden&&(this.offerBoundaryTimer=setTimeout(()=>{this.offerBoundaryTimer=null,!document.hidden&&this.refreshOfferAvailability(!1)},3e4))}}offerPrice(e){return e?this.offerAvailability?.prices.find(t=>t.categoryKey===e)??null:null}applyChannelPricing(e){this.channelByObject.clear(),this.pricesByChannel.clear();for(let t of e?.channels??[])this.pricesByChannel.set(t.channelId,t.priceOverrides);for(let t of e?.objects??[])this.pricesByChannel.has(t.channelId)&&this.channelByObject.set(t.label,t.channelId)}syncOffer(){let e=this.els.offer;if(!e)return;if(this.suppressPricing){e.classList.remove("has"),e.replaceChildren();return}let t=this.offerAvailability,n=t?.release??null,r=n?null:t?.upcoming??null;if(!t||t.state==="closed"||t.state==="sold-out"||!n&&!r){e.classList.remove("has"),e.replaceChildren();return}let s=n??r,o=document.createElement("div");o.className="sl-offer-main";let a=document.createElement("div");a.className="sl-offer-copy";let l=document.createElement("span");l.className="sl-offer-kicker",l.textContent=n?this.tf("picker.currentTicketOffer","Current ticket offer"):this.tf("picker.upcomingTicketOffer","Upcoming ticket offer");let c=document.createElement("strong");c.className="sl-offer-name",c.textContent=s.name||(n?this.tf("picker.currentOffer","Current offer"):this.tf("picker.scheduledOffer","Scheduled offer"));let p=document.createElement("span");p.className="sl-offer-line";let d=[];n&&t.fromPrice!=null&&d.push(this.money(t.fromPrice/100)),n&&s.remaining!=null&&d.push(B("picker.offerRemainingAvailable",{count:s.remaining})),n&&s.endsAt!=null&&d.push(B("picker.offerUntil",{time:Zt(s.endsAt,this.eventTimezone,this.opts.locale)})),r?.startsAt!=null&&d.push(B("picker.offerStarts",{time:Zt(r.startsAt,this.eventTimezone,this.opts.locale)})),p.textContent=d.join(" \xB7 "),a.append(l,c,p);let u=document.createElement("details");u.className="sl-offer-info";let h=document.createElement("summary");h.setAttribute("aria-label",B("picker.howOfferWorks",{name:c.textContent??""})),h.textContent="i";let g=document.createElement("div");g.className="sl-offer-detail",g.textContent=n?this.tf("picker.offerDetailActive","This price applies automatically to eligible seats. Tickets in active carts temporarily reduce the available quantity; released or expired holds return it. When the offer ends, the next matching offer or normal ticket price takes over."):this.tf("picker.offerDetailUpcoming","Tickets are available at their normal price now. This scheduled offer will apply automatically to eligible seats when it starts."),u.append(h,g),o.append(a,u),e.replaceChildren(o),e.classList.add("has")}paidPrice(e,t,n,r){let s=r?this.channelByObject.get(r):void 0;if(s&&e){let a=this.pricesByChannel.get(s)?.find(l=>l.categoryKey===e&&l.tierId===(t??null));if(a)return a.price}let o=e?this.opts.pricing?.prices?.[e]:void 0;return o===void 0?n:typeof o=="number"?o:t&&o.tiers?.[t]!==void 0?o.tiers[t]:o.base??n}legendDeps(){return ta(this)}syncPriceRail(e,t,n=this.legendDeps()){ia(this,e,t,n)}syncPrices(){na(this)}focusCategory(e){ra(this,e)}evictTakenSelections(){let e=new Set([...this.controller.currentHold()?.labels??[],...this.holdingLabels]),t=this.controller.getSelection().filter(n=>!e.has(n.label)&&(this.controller.getStatus(n.id)??"free")!=="free");t.length&&(this.controller.deselect(t.map(n=>n.id)),this.toast(B("picker.seatJustTakenByAnother",{label:t[0].label}),"error"))}syncTray(){if(!this.els.tray)return;this.updateSelectionCapacity();let{seats:e,gaAreas:t,heldItems:n,heldLabels:r,total:s,count:o}=vi(this),a=[],l=new Set;if(!this.salesClosed){let m=this.performanceGroup?.nightSummary?.()??[];m.length&&a.push(fs(m,{title:this.tf("picker.group.yourSeatsByNight","Your seats by night"),empty:this.tf("picker.group.noSeatsChosenYet","No seats yet")}));let A=this.performanceGroup?.selectionModeSwitch;A&&a.push(`<button type="button" class="sl-pg-switch" data-pg-switch-mode>${H(A.label)}</button>`)}a.push(Co({salesClosed:this.salesClosed,hasPicks:e.length>0||n.length>0,hasGaAreas:t.length>0,groupMode:this.performanceGroup?this.performanceGroup.selectionMode??"same_seat":null,seated:!!this.controller.doc?.objects?.some(m=>m.type!=="gaArea"),venue3d:this.buyerView==="venue3d",whenText:this.eventWhenText?String(this.eventWhenText):void 0}));let c=!e.length&&!n.length&&!Le(this.gaQty,this.hold?.items??[]);if((c||this.root?.dataset.layout==="narrow")&&(this.baReopen=!1),!this.performanceGroup&&!this.salesClosed&&!this.hold&&(c||this.baReopen||this.bestAvailableBusy||this.bestAvailableConfirm)){let m=(this.controller.doc?.categories??[]).filter(_=>!_.notForSale),A=this.controller.getBestAvailableZones();this.baZone&&!A.some(_=>_.id===this.baZone)&&(this.baZone=""),a.push(Eo({confirming:this.bestAvailableConfirm,busy:this.bestAvailableBusy,reopened:this.baReopen,quantity:this.baQty,premium:this.baPremium,offerPremium:this.controller.hasPremiumSeats(),categories:m,zones:A,selectedCategory:this.baCat,selectedZone:this.baZone}))}let p=(m,A,_,k=1,M,L,C)=>So({categoryLabel:C,d:m?this.controller.seatDetails(m):null,area:_==="ga"?t.find(D=>D.id===M):void 0,label:A,objectType:_,quantity:k,identity:L,performanceLabel:this.performanceGroup?.activePerformanceLabel?.(),performanceDates:this.performanceGroup?.selectedPerformanceDates?.()}),d=H,u=[];for(let m of rr(n)){let A=m.objectType==="ga"?`held:ga:${m.objectId}:${m.tierId??""}`:`held:${m.label}`;l.add(A);let _=this.controller.doc?.categories.find(j=>j.key===m.categoryKey),k=m.tierId?_?.tiers?.find(j=>j.id===m.tierId)?.name:void 0,M=m.objectType!=="ga"?this.controller.seatByLabel(m.label):null,L=m.objectType==="table"?this.controller.tableSelection(m.label):null,C=M?this.controller.seatDetails(M.id):null,D=this.seatViewEnabled()&&!!M&&m.objectType!=="table"&&!!this.deliverableViewReference(M),R=d(this.tf("picker.heldForYou","Held for you")),N=(L?.bookingMode==="variable"?`<button type="button" class="sl-table-edit" data-table-edit="${d(encodeURIComponent(m.label))}">${d(B("picker.guestsCountEdit",{count:m.quantity??1}))}</button>`:"")+At(M?.wheelchairSpaceType)+rn(M?.commercial),te=this.paidPrice(m.categoryKey,m.tierId,m.unitPrice,m.label)*(m.quantity??1);u.push({key:A,fresh:!this.lastTrayKeys.has(A),held:!0,seatIds:[],heldLabels:m.labels,removeAria:B("picker.removeHeldTicketLabel",{label:$i(m,t)}),locateId:M?.id??null,section:C?.sectionLabel??"",rowLabel:C&&U(C)||"",seatLabel:C?.seatNumber??m.label,categoryLabel:`${_?.label??m.categoryKey}${k?` \xB7 ${k}`:""}`,categoryColor:this.controller.getRenderer?.()?.categoryDisplayColor?.(m.categoryKey)??_?.color??"",identityHtml:p(M?.id??null,m.label,m.objectType,m.quantity??1,m.objectId,L??void 0,`${_?.label??m.categoryKey}${k?` \xB7 ${k}`:""}`),stateHtml:`<span class="sl-ticket-state held" aria-label="${R}" title="${R}"><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:N,amount:te,amountText:this.suppressPricing?"":this.money(te),noteHtml:sn(M?.commercial),railHtml:this.performanceGroup?"":yn(B("picker.removeHeldTicketLabel",{label:$i(m,t)}),D?m.label:null),groupable:!N&&!!C?.sectionLabel&&!this.performanceGroup})}let h=this.seatViewEnabled();for(let m of e.filter(A=>!r.has(A.label))){let A=`seat:${m.id}`;l.add(A);let _=this.controller.doc?.categories.find(j=>j.key===m.categoryKey),k=m.tiers&&m.tiers.length&&!this.suppressPricing?`<select class="tier" data-tier="${d(m.id)}" aria-label="${d(B("picker.ticketTierFor",{label:m.label}))}">`+m.tiers.map(j=>`<option value="${d(j.id)}"${j.id===m.tierId?" selected":""}>${d(j.name)} \xB7 ${d(this.money(this.paidPrice(m.categoryKey,j.id,j.price,m.label)))}</option>`).join("")+"</select>":"",M=m.tiers?.find(j=>j.id===m.tierId)??m.tiers?.[0],L=M?.buyerMessage?.trim()||(M?.restriction==="companion"?this.tf("picker.companionRequiresWheelchair","Requires the adjacent wheelchair place"):""),C=this.controller.seatDetails(m.id),D=d(this.tf("picker.selected","Selected")),R=B("picker.removeSeatLabel",{label:m.label}),N=(m.objectType==="table"&&m.bookingMode==="variable"?`<button type="button" class="sl-table-edit" data-table-edit="${d(encodeURIComponent(m.label))}">${d(B("picker.guestsCountEdit",{count:m.quantity??1}))}</button>`:"")+At(m.wheelchairSpaceType)+rn(m.commercial)+k,te=this.paidPrice(m.categoryKey,m.tierId??null,m.price,m.label)*(m.quantity??1);u.push({key:A,fresh:!this.lastTrayKeys.has(A),held:!1,seatIds:[m.id],heldLabels:[],locateId:m.id,section:C?.sectionLabel??"",rowLabel:C&&U(C)||"",seatLabel:C?.seatNumber??m.label,categoryLabel:_?.label??m.categoryKey,identityHtml:p(m.id,m.label,m.objectType,m.quantity??1,m.objectId,m,_?.label??m.categoryKey),categoryColor:this.controller.getRenderer?.()?.categoryDisplayColor?.(m.categoryKey)??_?.color??"",stateHtml:`<span class="sl-ticket-state" aria-label="${D}" title="${D}"><svg viewBox="0 0 24 24"><path d="M5 12l4 4L19 6"/></svg></span>`,extrasHtml:N,amount:te,amountText:this.suppressPricing?"":this.money(te),removeAria:R,noteHtml:sn(m.commercial)+(L?`<small class="sl-tier-note">${d(L)}</small>`:""),railHtml:yn(R,h&&m.objectType!=="table"&&this.deliverableViewReference(this.controller.seatByLabel(m.label)??{})?m.label:null),groupable:!N&&!L&&!!C?.sectionLabel&&!this.performanceGroup})}u.length&&a.push(this.root?.dataset.layout==="narrow"?ha(u,{money:m=>this.money(m),suppressPricing:this.suppressPricing}):u.map(pa).join("")),t.length&&a.push(cr(this,t,n)),!this.performanceGroup&&!this.salesClosed&&!this.hold&&!c&&!this.baReopen&&!this.bestAvailableBusy&&!this.bestAvailableConfirm&&a.push(`<button type="button" class="sl-ba-reopen" data-ba-reopen><span aria-hidden="true">\u2726</span>${d(this.tf("picker.findTogetherInstead","Find seats together instead"))}</button>`),this.els.tray.innerHTML=a.join("")+(this.salesClosed?"":this.lapse.noteHtml()),this.lastTrayKeys=l,ua(this.els.tray),this.lapse.wire(this.els.tray),this.els.tray.querySelector("[data-pg-switch-mode]")?.addEventListener("click",()=>this.performanceGroup?.selectionModeSwitch?.activate());let g=this.performanceGroup?.selectNight;g&&Cs(this.els.tray,m=>g(m)),this.els.tray.querySelectorAll("[data-ba]").forEach(m=>{m.addEventListener("click",()=>{this.baQty=Math.max(1,Math.min(this.maxTickets,this.baQty+Number(m.dataset.ba))),this.syncTray()})}),this.els.tray.querySelector("[data-ba-cat]")?.addEventListener("change",m=>{this.baCat=m.target.value}),this.els.tray.querySelector("[data-ba-zone]")?.addEventListener("change",m=>{this.baZone=m.target.value}),this.els.tray.querySelector("[data-ba-premium]")?.addEventListener("click",()=>{this.baPremium=!this.baPremium,this.syncTray()}),this.els.tray.querySelector(".sl-ba-go")?.addEventListener("click",()=>{if(this.pendingSelectionCount()>0){this.bestAvailableConfirm=!0,this.syncTray(),this.els.tray.querySelector("[data-ba-replace]")?.focus();return}this.bestAvailable(this.baQty,this.baCat||void 0,{preferPremium:this.baPremium,zoneId:this.baZone||void 0})}),this.els.tray.querySelector("[data-ba-cancel]")?.addEventListener("click",()=>{this.bestAvailableConfirm=!1,this.syncTray(),this.els.tray.querySelector(".sl-ba-go")?.focus()}),this.els.tray.querySelector("[data-ba-reopen]")?.addEventListener("click",()=>{this.baReopen=!0,this.syncTray(),this.els.tray.querySelector(".sl-ba-go")?.focus()}),this.els.tray.querySelector("[data-ba-close]")?.addEventListener("click",()=>{this.baReopen=!1,this.syncTray(),this.els.tray.querySelector("[data-ba-reopen]")?.focus()}),this.els.tray.querySelector("[data-ba-replace]")?.addEventListener("click",()=>{this.bestAvailableConfirm=!1,this.bestAvailable(this.baQty,this.baCat||void 0,{preferPremium:this.baPremium,zoneId:this.baZone||void 0})}),this.els.tray.querySelectorAll(".sl-chip .rm").forEach(m=>{m.addEventListener("click",()=>{let A=m.closest(".sl-chip");if(A.dataset.held){this.removeHeldLabels(decodeURIComponent(A.dataset.held).split(`
2794
- `),A);return}let _=A.dataset.seat.split(" "),k=()=>{this.controller.deselect(_)};if(this.reducedMotion()){k();return}A.classList.remove("sl-enter"),A.classList.add("sl-leave","sl-mo-collapse"),this.scheduleMotion(k,q.collapse)})}),this.els.tray.querySelectorAll("[data-table-edit]").forEach(m=>{m.addEventListener("click",A=>{A.stopPropagation();let _=decodeURIComponent(m.dataset.tableEdit??""),k=this.controller.tableSelection(_);if(!k)return;let M=n.find(L=>L.label===_&&L.objectType==="table");this.showTableDialog({...k,quantity:M?.quantity??k.quantity},!!M,m)})}),this.els.tray.querySelectorAll(".sl-chip .tier").forEach(m=>{m.addEventListener("change",()=>this.controller.setSeatTier(m.dataset.tier,m.value||null))}),this.els.tray.querySelectorAll(".sl-chip .view[data-view-label]").forEach(m=>{m.addEventListener("click",()=>{let A=this.controller.seatByLabel(m.dataset.viewLabel);A&&this.openSeatView(A)})}),this.els.tray.querySelectorAll(".sl-chip[data-locate]").forEach(m=>{let A=()=>this.controller.flashSeat(m.dataset.locate,this.cssVar("--sl-accent")||"#f4b740");m.addEventListener("mouseenter",A),m.addEventListener("focusin",A)}),dr(this,this.els.tray,t),this.controller.setGASelection(tr(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(m=>{m.disabled=!0});let b=this.pendingSelectionCount(),w=this.lastTrayCount,x=this.lastTrayTotal,y=Es(this.performanceGroup?.groupSelectionSummary?.(),this.performanceGroup?.selectionMode??"same_seat");this.els.count.textContent=y||(o?Li("picker.ticketsCount",o):this.tf("picker.noSeatsSelected","No seats selected")),this.els.total.textContent=o&&!this.suppressPricing?this.money(s):"",this.root?.setAttribute("data-has-selection",String(o>0)),this.root?.setAttribute("data-ba-active",String(this.bestAvailableConfirm||this.bestAvailableBusy||this.baReopen)),this.els.foot?.classList.toggle("empty",o===0),this.els.seatSummary&&(this.els.seatSummary.textContent=y||(o?Li("picker.seatsSelectedCount",o):"")),this.syncCta(o,b),o!==w&&this.animateOnce(this.els.count,"sl-value-pop",380),s!==x&&this.animateOnce(this.els.total,"sl-value-pop",380),w===0&&o>0&&(this.animateOnce(this.els.cta,"sl-ready",520),this.sideCollapsed&&this.root?.dataset.layout!=="narrow"&&this.setPanelCollapsed(!1)),this.renderPeek(o,s,b,o>w),this.lastTrayCount=o,this.lastTrayTotal=s,this.opts.onSelectionChange?.(e),this.emitSelectionValidity(o,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(){Nr(this.confirmEl?.querySelector(".sl-confirm-row")),this.els.tray?.querySelectorAll(".sl-chip-pos").forEach(Fr),this.els.tray?.querySelectorAll(".sl-ba-go,.sl-ba-reopen").forEach(Ji),this.els.peek?.querySelectorAll(".sl-sheet-go").forEach(Ji)}emitSelectionValidity(e,t){let n=this.controller.getSelectionValidity(e);n&&(n.seats=t,this.opts.onSelectionValidityChange?.(n),n.isValid?this.lastSelectionValidity!==!0&&this.opts.onSelectionValid?.(t):this.lastSelectionValidity!==!1&&this.opts.onSelectionInvalid?.(n),this.lastSelectionValidity=n.isValid)}renderPeek(e,t,n,r=!1){if(!this.els.peek)return;let s=(this.controller.doc?.categories??[]).map(o=>this.catPrice(o)).filter(o=>o!=null);this.els.peek.innerHTML=To({count:e,total:t,pendingCount:n,ctaPhase:this.ctaPhase,hasHold:!!this.hold,salesClosed:this.salesClosed,suppressPricing:this.suppressPricing,fromPrice:s.length?Math.min(...s):null,addMore:this.root?.dataset.layout==="narrow"?null:ko({salesClosed:this.salesClosed,hasHold:!!this.hold,ctaPhase:this.ctaPhase,formOpen:this.baReopen||this.bestAvailableBusy||this.bestAvailableConfirm,room:this.maxTickets-this.totalTicketCount(),wanted:this.baQty}),offerFind:!this.performanceGroup&&!this.salesClosed&&!this.hold,holdTime:this.hold&&this.holdTimer?Mt(Math.max(0,this.holdExpiresAt-Date.now())):null,money:o=>this.money(o)}),this.root&&(this.root.dataset.peekClock=String(!!this.els.peek.querySelector(".sl-peek-time"))),r&&this.animateOnce(this.els.peek.querySelector(".sl-peek-sum")??void 0,"sl-peek-bump",240),this.scheduleFit()}async removeHeldLabels(e,t){let n=e.filter(o=>o&&!this.releasingLabels.has(o));if(!n.length)return!1;let r=n[0];n.forEach(o=>this.releasingLabels.add(o)),t?.setAttribute("aria-busy","true");let s=t?.querySelector(".rm");s&&(s.disabled=!0);try{let o=this.handedOff;if(!await this.controller.releaseLabels(n))return this.toast(B("picker.couldNotRemoveLabel",{label:r}),"error"),!1;sr(this.gaQty,this.hold?.items??[],n);let l=this.controller.currentHold();return this.hold=l?{holdId:l.holdId,expiresAt:l.expiresAt,seats:l.seats,items:l.items}:null,this.handedOff=!!this.hold&&o,this.bookedShown=!1,this.ctaPhase="idle",this.hold?this.startHoldTimer(this.hold.expiresAt):(this.stopHoldTimer(),this.forgetHold()),this.syncTray(),this.emitHoldChange(),!0}finally{n.forEach(o=>this.releasingLabels.delete(o)),t?.removeAttribute("aria-busy"),s?.isConnected&&(s.disabled=!1)}}async handleCta(){if(this.salesClosed)return;let e=this.controller.getSelectionValidity(this.totalTicketCount());if(e&&!e.isValid){this.toast(ki(e,(n,r)=>this.tf(n,r)),"warning");return}if(this.totalTicketCount()>this.maxTickets){this.toast(B("picker.removeTicketsUntilOrFewer",{count:this.maxTickets}),"warning");return}let t=this.committedSelection();if(this.hold&&!t.some(n=>!(this.hold.items??[]).some(r=>r.label===n.label))){let n=this.hold.seats??t;this.handedOff=!0,this.holdConflicted=!1,await this.runCheckoutHandoff(this.hold,n);return}this.holdingLabels=new Set(t.map(n=>n.label)),this.setCtaPhase("holding");try{let n=null,r=er(this.gaQty),s=this.committedSelection();if(s.length){let o=await this.controller.hold(void 0,this.opts.holdTtlMs);n=o?{holdId:o.holdId,expiresAt:o.expiresAt,seats:o.seats,items:o.items}:null}for(let{areaId:o,tierId:a,qty:l}of r){let c=await this.controller.holdGA(o,l,{tierId:a,ttlMs:this.opts.holdTtlMs});n=c?{holdId:c.holdId,expiresAt:c.expiresAt,seats:c.seats,items:c.items}:n}if(!n){this.raiseHoldConflict(this.tf("picker.seatsJustTaken","One or more seats were just taken. Please pick again.")),this.setCtaPhase("idle"),this.syncTray();return}this.hold=n,this.holdConflicted=!1,this.handedOff=!this.performanceGroup,this.startHoldTimer(n.expiresAt),this.flashHeldSeats(n),this.emitHoldChange(),this.performanceGroup?this.setCtaPhase("idle"):await this.runCheckoutHandoff(n,n.seats??s)}catch(n){this.opts.onError?.(n);let r=n,s=(r.conflicts??[]).map(a=>a.label).filter(Boolean).slice(0,3);r.reason==="event_closed"&&this.setSalesClosed(!0);let o=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?B("picker.labelsNoLongerAvailable.one",{labels:s.join(", ")}):B("picker.labelsNoLongerAvailable.other",{labels:s.join(", ")}):this.tf("picker.seatsJustTaken","One or more seats were just taken. Please pick again.");this.raiseHoldConflict(o),this.setCtaPhase("idle")}finally{this.holdingLabels.clear(),this.ctaPhase==="holding"&&(this.ctaPhase="idle"),this.syncTray()}}startHoldTimer(e){jo(this,e)}stopHoldTimer(){Go(this)}setExtendPrompt(e,t){qo(this,e,t)}refreshExtendPrompt(){Uo(this)}handleExtend(){return Ko(this)}detectBooked(){this.bookedShown||!this.handedOff||!this.hold||this.controller.currentHold()===null&&(this.holdConflicted||this.showBooked())}raiseHoldConflict(e){this.holdConflicted=!0,this.bookedShown&&(this.bookedShown=!1,this.bookedEl?.classList.remove("on")),this.toast(e,"error")}showBooked(){if(this.bookedShown||!this.hold||this.holdConflicted)return;this.bookedShown=!0;let e=this.buildHandoff(this.hold);this.stopHoldTimer(),this.forgetHold();let t=e.lineItems.reduce((r,s)=>r+s.quantity,0),n=this.performanceGroup?.groupSelectionSummary?.();this.els.bookedSub&&(this.els.bookedSub.innerHTML=n?.seats?`<span class="sl-booked-seats">${Li("picker.group.ticketsConfirmedAcross",n.seats,{performances:n.performances})}</span>`:`<span class="sl-booked-seats">${Li("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(r=>{let o=[r.sectionLabel,r.rowLabel&&`${this.tf("picker.row","Row")} ${r.rowLabel}`,r.seatNumber&&`${this.tf("picker.seat","Seat")} ${r.seatNumber}`].filter(Boolean).join(" \xB7 ")||r.displayLabel||r.label,a=r.quantity>1?` <span class="sl-booked-qty">\xD7${r.quantity}</span>`:"";return`<li>${H(o)}${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.root?.focus({preventScroll:!0})}notifyGroupSettled(e){e==="booked"?this.showBooked():this.dismissConfirm(),this.hold=null,this.handedOff=!1,this.ctaPhase="idle",this.stopHoldTimer(),this.forgetHold(),this.syncTray(),this.syncCta()}async checkoutHandoff(e,t){if(this.checkoutMode==="hosted"){await this.startHostedCheckout(e,t);return}await this.opts.onCheckout?.(e,t,this.buildHandoff(e))}async startHostedCheckout(e,t){let n=this.buildHandoff(e),r=null;try{r=await(this.paymentOptions??=this.pubApi.paymentOptions(this.opts.event))}catch(o){this.opts.onError?.(o)}if(this.destroyed)return;let s=r?.providers?.[0];if(!s){let o=wr(r?.reason),a=!!this.opts.onCheckoutUnavailable||!!this.opts.onCheckout;this.opts.onCheckoutUnavailable?.({reason:o,handoff:n}),this.opts.onCheckout?.(e,t,n),a||this.openCheckoutPanel({kind:"unavailable",reason:o,seatCount:n.lineItems.reduce((l,c)=>l+c.quantity,0)});return}await this.openCheckoutPanel({kind:"pay",provider:s,order:{holdId:n.holdId,expiresAt:n.expiresAt,currency:n.currency,total:n.total,labels:n.lineItems.map(o=>o.displayLabel??o.label)}})}async openCheckoutPanel(e){let t;try{({mountCheckout:t}=await yr())}catch(n){this.opts.onError?.(n),this.toast(this.tf("picker.checkoutCouldNotBeOpened","Checkout could not be opened. Your seats are still held \u2014 please try again."),"error"),this.setCtaPhase("idle");return}this.destroyed||!this.root||(this.closeCheckoutPanel(),this.checkoutPanel=t({root:this.root,state:e,eventKey:this.opts.event,formatMoney:n=>this.money(n),startSession:n=>this.pubApi.startCheckout(this.opts.event,{...n,...this.opts.returnUrl?{returnUrl:this.opts.returnUrl}:{}}),orderStatus:n=>this.pubApi.orderStatus(n),onCancel:()=>{this.checkoutPanel=null,this.hold||this.setCtaPhase("idle")},onConfirmed:n=>{this.opts.onOrderConfirmed?.(n),this.controller.refresh()},onError:n=>this.opts.onError?.(n)}))}closeCheckoutPanel(){this.checkoutPanel?.destroy(),this.checkoutPanel=null}buildHandoff(e){let n=(e.items??[]).map(o=>{let a=this.controller.lineItemDisplay(o);return{label:o.label,...a.displayLabel?{displayLabel:a.displayLabel}:{},...a.displayType?{displayType:a.displayType}:{},objectId:o.objectId,objectType:o.objectType,categoryKey:o.categoryKey,tierId:o.tierId,unitPrice:this.paidPrice(o.categoryKey,o.tierId,o.unitPrice,o.label),currency:o.currency??this.currency,quantity:o.quantity??1}}),r=n[0]?.currency??this.currency,s=n.reduce((o,a)=>o+a.unitPrice*a.quantity,0);return{holdId:e.holdId,expiresAt:e.expiresAt,currency:r,lineItems:n,total:s}}emitHoldChange(){let e=this.hold;this.scheduleOfferRefresh(!0),this.opts.onHoldChange?.(e,e?.seats??[],e?this.buildHandoff(e):null)}toast(e,t="neutral",n){let r=this.els.toast;if(!r)return;r.replaceChildren();let s=document.createElement("span");if(s.textContent=e,r.appendChild(s),r.classList.toggle("has-action",!!n),n){let o=document.createElement("button");o.type="button",o.className="sl-toast-action",o.textContent=n.label,o.addEventListener("click",n.onClick,{once:!0}),r.appendChild(o)}r.dataset.tone=t,r.classList.add("on","sl-mo-rise"),this.liftToastOverConfirmSoon(),this.toastTimer&&clearTimeout(this.toastTimer),this.toastTimer=setTimeout(()=>{r.classList.remove("on","sl-mo-rise"),r.classList.remove("has-action"),r.dataset.tone="neutral",this.liftToastOverConfirm()},4200)}liftToastOverConfirm(){let e=this.regions["bottom-center"];if(!e)return;let t=this.els.toast?.classList.contains("on")||this.extendEl?.classList.contains("on"),n=this.confirmEl;if(!t||!n?.isConnected){e.style.removeProperty("bottom");return}let r=this.els.map.clientHeight;if(r<=0)return;let s=n.getBoundingClientRect(),o=s.height||n.offsetHeight||rp,a=s.height?s.top-this.els.map.getBoundingClientRect().top:r-dn-o,l=Math.round(r-a+ip);if(l+np>r){e.style.removeProperty("bottom");return}e.style.bottom=`${l}px`}liftToastOverConfirmSoon(){this.liftToastOverConfirm(),typeof requestAnimationFrame=="function"&&requestAnimationFrame(()=>{this.destroyed||this.liftToastOverConfirm()})}dismissSkeleton(){zs({boot:this.els.boot,map:this.els.map,rail:this.els.rail,root:this.root,reducedMotion:this.reducedMotion()})}placeTooltip(){if(!this.tipEl)return;let e={width:this.els.map.clientWidth,height:this.els.map.clientHeight},t={width:this.tipEl.offsetWidth,height:this.tipEl.offsetHeight},n=this.tipPinned?Ls(this.tipPos,e,t):null,r=n??Ps(this.tipPos,e.width,e.height,t);this.tipEl.style.left=`${r.left}px`,this.tipEl.style.top=`${r.top}px`,n?this.tipEl.dataset.placement=n.placement:delete this.tipEl.dataset.placement}nightStripFor(e,t){let n=this.performanceGroup,r=ln(e.mark,n?.nights?.()),s=r?.states.filter(o=>o.free).length??0;return gs(r,{locale:this.opts.locale,switchLabel:n?.selectionModeSwitch?.label??null,selectPartialLabel:n?.partialSeatSelection?.label(s)??null,pinned:t})}unavailableReason(e){return!e.unavailable||e.mark?.kind==="partial"?"":e.status==="held"?this.tf("picker.heldByOther","Held by another buyer \u2014 may become available"):e.status==="not_for_sale"?this.tf("picker.notForSaleExplanation","This seat is not included in the current sale."):e.status==="free"?"":this.tf("picker.soldSeatExplanation","This seat has already been booked.")}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()}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}let n=this.unavailableReason(e),r=e.mark?.kind==="partial"&&(e.interaction==="press"||this.lastPointerType!=="mouse"||t)||!!n&&e.interaction==="press";this.tipMarkedHoverLabel=e.mark?.kind==="partial"?e.label:null;let s=this.nightStripFor(e,r);this.tipEl.style.setProperty("--sl-cat",e.categoryColor),this.tipEl.innerHTML=As(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:Fe(e),reason:n,extra:s+(r?`<button type="button" class="sl-tip-close" data-pg-tip-close aria-label="${H(this.tf("picker.group.closeSeatDetails","Close seat details"))}">\xD7</button>`:"")}),this.tipPinned=r,this.tipEl.classList.toggle("sl-tip-pinned",r),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()}),Rs(this.tipEl,this.performanceGroup?.partialSeatSelection?.label,o=>{this.unpinTooltip(),this.performanceGroup?.partialSeatSelection?.activate(e.id,o)}),this.tipEl.style.display="block",this.placeTooltip()}syncSeatMarks(){let e=this.performanceGroup?.seatMarks,t=this.controller.getRenderer();if(!e||!t?.setSeatMarks)return;let n={};for(let[r,s]of Object.entries(e())){let o=this.controller.idForLabel(r);o&&(n[o]=s)}Object.keys(n).length&&t.setSeatMarks(n)}getSelection(){return this.committedSelection()}selectObjects(e){return this.controller.select(e)}selectObjectsWithoutConfirmation(e){let t=new Set(e),n=this.controller.getSelection().filter(r=>t.has(r.id)||t.has(r.label));if(n.length===t.size)return n;this.suppressConfirmationSeatId=e[0]??null;try{return this.controller.select(e)}finally{this.suppressConfirmationSeatId=null}}deselectObjects(e){this.controller.deselect(e)}clearSelection(){this.dismissConfirm(),this.dismissTableDialog(),this.controller.clearSelection()}categoryLegendColor(){let e=(this.controller.doc?.categories??[]).find(t=>!t.notForSale);return(e?this.controller.getRenderer()?.categoryDisplayColor?.(e.key):null)||e?.color||"#2563eb"}async refreshAvailability(){await this.controller.refresh(),this.syncSeatMarks(),this.syncTray()}refreshPerformanceGroupComposition(){this.syncTray()}async adoptRestoredHold(e){!e||this.hold||await this.resumeHoldFromServer(e)}selectCategories(e){return this.controller.selectCategories(e)}deselectCategories(e){this.controller.deselectCategories(e)}setSelectableObjects(e){this.controller.setSelectableObjects(e)}setMaxSelection(e){this.maxTickets=Math.max(this.exactTickets??1,Math.floor(e)),this.controller.setMaxSelection(this.maxTickets),this.updateSelectionCapacity(),this.syncTray()}getSelectionValidity(){let e=this.controller.getSelectionValidity(this.totalTicketCount());return e&&(e.seats=this.committedSelection()),e}setMapTheme(e){this.destroyed||(this.opts.theme={...this.opts.theme??{},map:e??void 0},this.controller.setMapTheme(e),this.applyMapChromeTokens(),this.minimap?.refreshMinimap())}applyThemeTokens(e){let t=Bt(this.themeMode),n=Ue(this.controller.doc?.theme,this.opts.theme,t);for(let[r,s]of Object.entries(n))e.style.setProperty(r,s);t?e.dataset.theme=t:delete e.dataset.theme,this.applyMapChromeTokens()}watchThemeMode(){this.colorSchemeStop?.(),this.colorSchemeStop=null,this.themeMode==="auto"&&(this.colorSchemeStop=Nt(()=>{this.destroyed||this.repaintForThemeMode()}))}repaintForThemeMode(){this.root&&(this.applyThemeTokens(this.root),this.controller.setMapTheme(qe(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:Bt(e)??null}))}getThemeMode(){return this.themeMode}applyMapChromeTokens(){let e=this.els.map?.parentElement;if(!e||!this.root)return;let t=Bt(this.themeMode),n=Ue(this.controller.doc?.theme,this.opts.theme,t),r=qe(this.opts.theme,this.themeMode)?.background??this.controller.doc?.theme?.background??void 0,s=Vn(n,r);for(let o of Fn)s?e.style.setProperty(o,s[o]):e.style.removeProperty(o)}setEventDetailsHidden(e){this.eventDetailsHidden=e,this.syncFullscreenButtons()}setPricing(e){let t=JSON.stringify(this.opts.pricing??null),n=JSON.stringify(e??null);t!==n&&(this.opts.pricing=e,!(this.destroyed||!this.els.prices)&&(this.els.pricesSec?.querySelector(".sl-price-select")?.remove(),this.buildPriceFilter(),this.syncPrices(),this.syncTray(),this.lastSection&&this.showSectionCard(this.lastSection)))}buildLanguageSwitcher(e){this.langSel=Wn(e,{languages:this.opts.languages,label:this.tf("picker.preferredTicketType","Language"),onChange:t=>{this.setLocale(t)}})}async setLocale(e){let t=xa(),n=this.localeGeneration+=1,r=await Yd(e);return this.opts.messages&&Xd(this.opts.messages),r===t||this.applyActiveLocale(r,n),r}applyActiveLocale(e,t){t===this.localeGeneration&&this.root&&(Yn(e,{root:this.root,painters:[()=>this.syncTray(),()=>this.syncPrices(),()=>this.syncOffer(),()=>this.syncRung(),()=>this.syncFloors(),()=>this.syncPanelToggle(),()=>this.syncFullscreenButtons()],refreshMapCopy:()=>this.controller.refreshMapCopy(),languageSelect:this.langSel}),this.scheduleFit())}isColorblindSafe(){return this.cbSafe}setColorblindSafe(e){e!==this.cbSafe&&(this.cbSafe=e,this.cbEl?.setAttribute("aria-pressed",String(e)),this.controller.setColorblindSafe(e),this.syncPrices(),this.minimap?.refreshMinimap(),op(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 no(this)}setBuyerView(e,t){ro(this,e,t)}seatState3dFor(e){return so(this,e)}pushAvailabilityTo3d(){oo(this)}syncSelectionTo3d(){ao(this)}seatViewFor3d(e){return lo(this,e)}onView3dSeatPick(e){co(this,e)}seatViewCaption(e){return po(this,e)}showUnavailable3dSeat(e,t,n){ho(this,e,t,n)}dismissUnavailable3dSeat(){uo(this)}saveView3dComparisonSeat(e){mo(this,e)}clearView3dComparison(){fo(this)}view3dComparisonSnapshot(e){return go(this,e)}enter3d(e){return bo(this,e)}publish3dTopInset(){vo(this)}exit3d(){yo(this)}openSeatConfidencePassport(e,t=null){bn(this,e,t)}closeSeatConfidencePassport(e=!0){Lt(this,e)}openView3dComparison(){Zs(this)}closeView3dComparison(e=!0){Ve(this,e)}getCurrentHold(){return this.hold}async resumeHold(e){return this.resumeHoldFromServer(e)}async removeHeldTicket(e){return this.removeHeldLabels([e])}async bestAvailable(e,t,n={}){if(this.salesClosed||this.bestAvailableBusy)return null;e=Math.max(1,Math.min(this.maxTickets,Math.floor(e)));try{return await this.bestAvailableOrThrow(e,t,n)}catch(r){this.opts.onError?.(r);let s=r?.reason,o=s==="not_enough_together"?B("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(o,"error"),null}}async bestAvailableOrThrow(e,t,n={}){if(this.salesClosed)throw new Error("seatlayer: seat sales are closed");if(this.bestAvailableBusy)throw new Error("seatlayer: Best Available is already in progress");if(!Number.isInteger(e)||e<1)throw new Error("seatlayer: Best Available quantity must be a positive integer");this.confirmSeat&&this.cancelConfirm(),this.bestAvailableConfirm=!1,this.bestAvailableBusy=!0;let 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,{...n,ttlMs:this.opts.holdTtlMs});return s?(this.hold={holdId:s.holdId,expiresAt:s.expiresAt,seats:s.seats,items:s.items},this.handedOff=!1,this.bookedShown=!1,this.gaQty.clear(),this.startHoldTimer(s.expiresAt),this.flashHeldSeats(this.hold),this.syncTray(),this.emitHoldChange(),n.preferPremium&&s.seats.length&&!s.seats.every(o=>o.commercial?.premium)&&this.toast(B("picker.premiumFallbackNote",{count:e}),"neutral"),this.hold):null}finally{this.bestAvailableBusy=!1,this.syncTray()}}async release(){let e=this.hold,t=this.controller.currentHold(),n=!0;if(t)n=await this.controller.release();else if(e){let r=[...new Set([...(e.items??[]).map(s=>s.label),...(e.seats??[]).map(s=>s.label)])];if(r.length)try{await this.api.release(this.opts.event,r,e.holdId)}catch(s){this.opts.onError?.(s),n=!1}}if(!n){this.toast(this.tf("picker.couldNotReleaseTickets","Couldn't release your tickets. Your hold is unchanged."),"error");return}this.hold=null,this.forgetHold(),this.handedOff=!1,this.bookedShown=!1,this.ctaPhase="idle",this.stopHoldTimer(),this.gaQty.clear(),this.syncTray(),this.emitHoldChange()}startRealtime(){if(!this.access?.configured||!this.pubApi||this.realtime)return;let e=this.opts.event;this.realtime=new ve({url:this.pubApi.subscribeUrl(e),mintTicket:()=>this.pubApi.subscribeTicket(e),onAccessUnavailable:t=>{this.opts.onAccessUnavailable?.(t),this.showAccessPanel(t)},sink:mt(this.controller,{flashOnLiveChange:!0,ownLabels:()=>this.holdingLabels,onStatusChange:()=>{this.syncPrices(),this.scheduleOfferRefresh(!0),this.detectBooked(),this.minimap?.refreshMinimap(),this.pushAvailabilityTo3d()},onSelectedObjectUnavailable:(t,n)=>{this.opts.onSelectedObjectUnavailable?.({labels:t,reason:n}),this.syncTray(),this.toast(n==="ineligible"?this.tf("picker.seatNoLongerYours","Some seats are no longer available to you. They have been removed from your order."):this.tf("picker.seatTaken","Someone else took a seat you had picked. It has been removed from your order."),"warning")}})}),this.realtime.start()}async refreshAccess(){return!this.access?.configured||!await this.access.refresh("manual")?!1:(this.dismissAccessPanel(),await this.controller.refresh(),this.realtime?this.realtime.restart():this.startRealtime(),!0)}clearDecisionSurfaces(){this.dismissConfirm(),this.dismissTableDialog(!1),pe(this,!1)}showAccessPanel(e){if(this.destroyed||!this.root)return;this.dismissAccessPanel(),this.clearDecisionSurfaces();let t=as(e.reason,()=>this.recoverAccess());(this.root.querySelector(".sl-body")??this.root).appendChild(t),this.accessEl=t}async recoverAccess(){return await this.refreshAccess()?!0:(this.opts.onAccessUnavailable||typeof window>"u"||window.location.reload(),!1)}dismissAccessPanel(){this.accessEl?.remove(),this.accessEl=null}showHoldExpired(){if(this.destroyed||!this.root||this.holdExpiredEl)return;this.clearDecisionSurfaces();let e=aa({restart:()=>this.restartAfterHoldExpiry()},this.holdExpiredUnits);this.root.appendChild(e),this.holdExpiredEl=e,requestAnimationFrame(()=>e.querySelector(".sl-interrupt-act")?.focus())}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}),this.refreshAvailability().then(()=>{this.destroyed||oa({reducedMotion:this.reducedMotion(),accent:this.cssVar("--sl-accent")||"#f4b740",seatByLabel:t=>this.controller.seatByLabel(t),statusOf:t=>this.controller.getStatus(t),flash:(t,n)=>this.controller.flashSeat(t,n)},e)}).catch(()=>{})}destroy(){this.destroyed=!0,mn(this),this.colorSchemeStop?.(),this.colorSchemeStop=null,this.realtime?.stop(),this.realtime=null,this.dismissAccessPanel(),this.dismissHoldExpired(),this.access?.clear(),this.hold&&!this.handedOff&&this.controller.release(),this.closeConfirm(),this.dismissTableDialog(!1),pe(this,!1),this.closeSeatView(),this.closeCheckoutPanel(),this.exit3d(),this.buyerAssetUrls.dispose(),this.stopHoldTimer(),this.detachAttention?.(),this.toastTimer&&clearTimeout(this.toastTimer),this.offerRefreshTimer&&clearTimeout(this.offerRefreshTimer),this.offerBoundaryTimer&&clearTimeout(this.offerBoundaryTimer),this.offerRefreshTimer=null,this.offerBoundaryTimer=null,this.offerVisibilityHandler&&(document.removeEventListener("visibilitychange",this.offerVisibilityHandler),this.offerVisibilityHandler=null);for(let e of this.motionTimers)clearTimeout(e);this.motionTimers.clear(),this.ro?.disconnect(),this.ro=null,this.framedFs&&this.setFramedFs(!1),this.escHandler&&document.removeEventListener("keydown",this.escHandler),this.fsChangeHandler&&document.removeEventListener("fullscreenchange",this.fsChangeHandler),this.fsEscHandler&&window.removeEventListener("keydown",this.fsEscHandler),this.controller.destroy(),this.projectionEl=null,this.root?.remove(),this.root=null,this.modalScrim&&(this.modalScrim.remove(),this.modalScrim=null,this.prevFocus?.isConnected&&this.prevFocus.focus({preventScroll:!0}),this.prevFocus=null)}};import{formatMoney as vp,loadLocale as yp,setStringOverrides as wp,t as xp}from"@seatlayer/core";var Ea="seatlayer-performance-group-picker-style";function Ca(){if(document.getElementById(Ea))return;let i=document.createElement("style");i.id=Ea,i.textContent=`
2807
+ }`,e.append(t);let n="linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.10) 37%, rgba(255,255,255,0.04) 63%)",r=document.createElement("div");Object.assign(r.style,{position:"absolute",inset:"0",display:"flex",flexDirection:"column",padding:"16px",gap:"14px",opacity:"0.9"});let s=c=>{let p=document.createElement("div");return p.className="sl-shimmer",Object.assign(p.style,{background:n,borderRadius:"8px"}),Object.assign(p.style,c),p};r.append(s({height:"40px",width:"100%",flex:"0 0 auto"}));let o=document.createElement("div");Object.assign(o.style,{display:"flex",gap:"14px",flex:"1 1 auto",minHeight:"0"}),o.append(s({width:"220px",height:"100%",flex:"0 0 auto"})),o.append(s({flex:"1 1 auto",height:"100%"})),r.append(o),e.append(r);let a=document.createElement("div");Object.assign(a.style,{position:"relative",zIndex:"1",display:"flex",alignItems:"center",gap:"10px",padding:"10px 16px",borderRadius:"999px",background:"rgba(16, 22, 37, 0.72)",fontSize:"13px",fontWeight:"500",letterSpacing:"0.01em"});let l=document.createElement("span");l.className="sl-shimmer",Object.assign(l.style,{width:"9px",height:"9px",borderRadius:"50%",background:n,flex:"0 0 auto"}),a.append(l),a.append(document.createTextNode("Loading designer\u2026")),e.append(a)}buildErrorCard(e,t){let n=vc[t],r=document.createElement("div");Object.assign(r.style,{maxWidth:"420px",margin:"0 24px",padding:"28px",textAlign:"center",background:"rgba(255, 255, 255, 0.03)",border:"1px solid rgba(255, 255, 255, 0.08)",borderRadius:"16px",boxShadow:"0 12px 40px rgba(0, 0, 0, 0.35)"});let s=document.createElement("h2");s.textContent=n.title,Object.assign(s.style,{margin:"0 0 8px",fontSize:"17px",fontWeight:"600",color:"#f4f7ff"});let o=document.createElement("p");o.textContent=n.body,Object.assign(o.style,{margin:"0 0 20px",fontSize:"13.5px",lineHeight:"1.5",color:"#aab4c8"});let a=document.createElement("button");a.type="button",a.textContent="Try again",Object.assign(a.style,{appearance:"none",cursor:"pointer",border:"0",borderRadius:"10px",padding:"10px 22px",fontSize:"14px",fontWeight:"600",color:"#101625",background:"#7aa2ff"}),a.addEventListener("click",()=>this.handleTryAgain()),r.append(s,o,a),e.append(r)}};import{PickerController as Wd,formatMoney as Yd,getLocale as Ta,loadLocale as Xd,setStringOverrides as Qd,t as B,tCount as Li}from"@seatlayer/core";import{isAuthoredSeatView as Zd,seatViewDisclosure as Jd}from"@seatlayer/core/view3d/crossfade/panorama";function Dr(i){return!!i&&i.clientWidth>0&&i.scrollWidth>i.clientWidth+1}function yc(i){return i.some(e=>Dr(e))}var ci="data-fit-gone",wc=12;function Zi(i,e,t=Dr){if(!i)return 0;for(let n of e)i.classList.remove(n.cls);if(i.querySelectorAll(`[${ci}]`).forEach(n=>{n.removeAttribute(ci),n.hidden=!1}),i.dataset.fit="0",i.clientWidth<=0||!t(i))return 0;for(let n=0;n<e.length;n+=1){let r=e[n];n>0&&i.classList.remove(e[n-1].cls),i.classList.add(r.cls),i.dataset.fit=String(n+1);let s=r.give?r.give(i):!0;if(!t(i))return n+1;if(r.repeat&&r.give){for(let o=1;s&&o<wc;o+=1)if(s=r.give(i),!t(i))return n+1}}return e.length}function xc(i,e="[data-fit-seg]"){let t=[...i.querySelectorAll(e)].filter(n=>!n.hidden);return t.length<2?!1:Br(t[t.length-1])}function Sc(i,e){let t=i.querySelector(e);return t&&!t.hidden?Br(t):!1}function Br(i){let e=i.previousElementSibling;return e instanceof HTMLElement&&e.tagName==="I"&&(e.setAttribute(ci,""),e.hidden=!0),i.setAttribute(ci,""),i.hidden=!0,!0}function kc(i){if(!i)return!1;let e=(i.getAttribute("aria-label")||i.textContent||"").trim();return e?(i.setAttribute("aria-label",e),i.setAttribute("title",e),!0):!1}function Nr(i){if(!i)return 0;let e=i.querySelector(".sl-confirm-cancel"),t=i.querySelector(".sl-confirm-add-t");return Zi(i,[{cls:"sl-fit-track"},{cls:"sl-fit-type"},{cls:"sl-fit-icon",give:()=>kc(e)}],()=>yc([e,t]))}function Fr(i){return Zi(i,[{cls:"sl-fit-notype",give:e=>Sc(e,"[data-fit-type]")},{cls:"sl-fit-short",give:e=>xc(e),repeat:!0}])}function Ji(i){return i?(i.classList.add("sl-fitpill"),Zi(i,[{cls:"sl-fit-p1"},{cls:"sl-fit-p2"},{cls:"sl-fit-p3"}])):0}var Tc=["on-sale","low","sold-out","presale","closed"];function Ct(i){return i==null?null:typeof i=="number"&&Number.isFinite(i)&&i>=0?i:void 0}function $r(i){return i==null?null:typeof i=="number"&&Number.isFinite(i)&&i>=0?i:void 0}function Vr(i){if(i==null)return null;if(typeof i!="object"||Array.isArray(i))return;let e=i,t=e.count,n=e.index;if(typeof n!="number"||!Number.isInteger(n)||n<1||typeof t!="number"||!Number.isInteger(t)||t<n)return;let r=e.remaining;if(r!=null&&(typeof r!="number"||!Number.isInteger(r)||r<0))return;let s={index:n,count:t,remaining:r??null};if(e.id!==void 0){if(typeof e.id!="string"||!e.id.trim())return;s.id=e.id.trim()}if(e.name!==void 0){if(typeof e.name!="string"||!e.name.trim())return;s.name=e.name.trim()}if(e.categoryKey!==void 0){if(e.categoryKey!==null&&(typeof e.categoryKey!="string"||!e.categoryKey.trim()))return;s.categoryKey=e.categoryKey==null?null:e.categoryKey.trim()}for(let o of["startsAt","endsAt"]){if(e[o]===void 0)continue;let a=$r(e[o]);if(a===void 0)return;s[o]=a}return s}function Ec(i){if(i==null)return null;if(typeof i!="object"||Array.isArray(i))return;let e=i;if(!Number.isInteger(e.assignmentVersion)||e.assignmentVersion<0||!Array.isArray(e.channels)||!Array.isArray(e.objects))return;let t=[],n=new Set;for(let o of e.channels){if(!o||typeof o!="object"||Array.isArray(o))return;let a=o,l=typeof a.channelId=="string"?a.channelId.trim():"";if(!l||n.has(l)||!Number.isInteger(a.pricingVersion)||a.pricingVersion<0||!Array.isArray(a.priceOverrides))return;let c=[],p=new Set;for(let d of a.priceOverrides){if(!d||typeof d!="object"||Array.isArray(d))return;let u=d,h=typeof u.categoryKey=="string"?u.categoryKey.trim():"",g=u.tierId===null?null:typeof u.tierId=="string"&&u.tierId.trim()?u.tierId.trim():void 0,b=Ct(u.price);if(!h||g===void 0||b===void 0||b===null)return;let w=`${h}\0${g??""}`;if(p.has(w))return;p.add(w),c.push({categoryKey:h,tierId:g,price:b})}n.add(l),t.push({channelId:l,pricingVersion:a.pricingVersion,priceOverrides:c})}let r=[],s=new Set;for(let o of e.objects){if(!o||typeof o!="object"||Array.isArray(o))return;let a=o,l=typeof a.label=="string"?a.label.trim():"",c=typeof a.channelId=="string"?a.channelId.trim():"";if(!l||s.has(l)||!n.has(c))return;s.add(l),r.push({label:l,channelId:c})}return{assignmentVersion:e.assignmentVersion,channels:t,objects:r}}function en(i){if(!i||typeof i!="object"||Array.isArray(i))return null;let e=i,t=Tc.find(p=>p===e.state);if(!t)return null;let n=Ct(e.fromPrice),r=Ct(e.previousPrice);if(n===void 0||r===void 0)return null;let s=e.currency==null?null:typeof e.currency=="string"&&e.currency.trim()?e.currency.trim():void 0;if(s===void 0)return null;let o=Vr(e.release);if(o===void 0)return null;let a=e.upcoming===void 0?null:Vr(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 d of e.prices){if(!d||typeof d!="object"||Array.isArray(d))return null;let u=d,h=typeof u.categoryKey=="string"?u.categoryKey.trim():"";if(!h)return null;let g=Ct(u.price),b=Ct(u.previousPrice);if(g==null||b===void 0)return null;let w={categoryKey:h,price:g,previousPrice:b};if(u.offerId!==void 0){if(typeof u.offerId!="string"||!u.offerId.trim())return null;w.offerId=u.offerId.trim()}if(u.offerName!==void 0){if(typeof u.offerName!="string"||!u.offerName.trim())return null;w.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;w.remaining=u.remaining==null?null:u.remaining}for(let x of["startsAt","endsAt"]){if(u[x]===void 0)continue;let y=$r(u[x]);if(y===void 0)return null;w[x]=y}p.push(w)}l=p}let c=Ec(e.channelPricing);return c===void 0?null:{state:t,fromPrice:n,previousPrice:r,currency:s,release:o,upcoming:a,prices:l,channelPricing:c}}function zr(i){return i?.changed!==!1}function jr(i,e){if(!i)return null;let t=null,n=r=>{r!=null&&r>e&&(t===null||r<t)&&(t=r)};for(let r of[i.release,i.upcoming])n(r?.startsAt),n(r?.endsAt);for(let r of i.prices)n(r.startsAt),n(r.endsAt);return t}function tn(i){let e={};for(let t of i?.prices??[])e[t.categoryKey]=t.price;return e}function Gr(i){return i.focusedSection!==null?i.deeperThanSectionFrame===!1?"venue":"section":i.seatsRevealed?"venue":"none"}import{compactRowLabel as Cc,t as Be}from"@seatlayer/core";import{seatConfidenceDisclosure as Ac}from"@seatlayer/core/core/seatConfidence";function nn(i){return String(i??"\u2014").replace(/[&<>"]/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[e])}function S(i){return String(i??"").replace(/[&<>"]/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[e])}function Se(i){return i?.restrictedView?v("picker.restrictedView","Restricted view"):i?.obstructedView?v("picker.obstructedView","Obstructed view"):""}function Ur(i){if(!i)return"";let e=[];i.premium&&e.push(`<div class="sl-cx-premium"><span class="sl-cx-star" aria-hidden="true">\u2605</span>${v("picker.premiumSeat","Premium seat")}</div>`);let t=Se(i);return t?e.push(`<div class="sl-cx-warn"><span class="sl-cx-glyph" aria-hidden="true">\u25D0</span><span class="sl-cx-txt"><b>${t}</b>${i.note?`<span class="sl-cx-note">${S(i.note)}</span>`:""}</span></div>`):i.note&&e.push(`<div class="sl-cx-warn"><span class="sl-cx-glyph" aria-hidden="true">\u2139</span><span class="sl-cx-txt"><span class="sl-cx-note">${S(i.note)}</span></span></div>`),e.length?`<div class="sl-cx">${e.join("")}</div>`:""}function rn(i){if(!i)return"";let e=[];if(i.premium){let n=S(v("picker.premiumSeat","Premium seat"));e.push(`<span class="sl-cx-mark sl-cx-mark-premium" role="img" aria-label="${n}" title="${n}">\u2605</span>`)}let t=Se(i);if(t){let n=S(i.note?`${t}: ${i.note}`:t);e.push(`<span class="sl-cx-mark sl-cx-mark-limited" role="img" aria-label="${n}" title="${n}">\u25D0</span>`)}else if(i.note){let n=S(i.note);e.push(`<span class="sl-cx-mark sl-cx-mark-info" role="img" aria-label="${n}" title="${n}">\u2139</span>`)}return e.join("")}function sn(i){if(!i)return"";let e=[];i.premium&&e.push(`<span class="sl-chip-cx-tag premium"><span aria-hidden="true">\u2605</span>${v("picker.premiumSeat","Premium seat")}</span>`);let t=Se(i);return t&&e.push(`<span class="sl-chip-cx-tag limited"><span aria-hidden="true">\u25D0</span>${S(t)}</span>`),!e.length&&!i.note?"":'<div class="sl-chip-cx">'+(e.length?`<div class="sl-chip-cx-tags">${e.join("")}</div>`:"")+(i.note?`<div class="sl-chip-cx-note">${S(i.note)}</div>`:"")+"</div>"}function st(i){return i==="no-seat"?v("picker.emptyWheelchairSpace","Empty wheelchair space"):i==="seat-present"?v("picker.accessiblePhysicalSeat","Accessible physical seat"):""}function Kr(i){let e=st(i);return e?`<div class="sl-cx"><div class="sl-cx-warn"><span class="sl-cx-glyph" aria-hidden="true">\u267F</span><span class="sl-cx-txt"><b>${e}</b></span></div></div>`:""}function At(i){let e=st(i);return e?`<span class="sl-cx-mark" role="img" aria-label="${e}" title="${e}">\u267F</span>`:""}function on(i,e){if(!i)return"";let t=e?v("picker.viewFromThisSeat","View from this seat"):v("picker.seeItIn3d","See it in 3D"),n=e?v("picker.viewFromHere","View from here"):t;return`<button type="button" class="sl-confirm-3d" aria-label="${t}"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2l9 5v10l-9 5-9-5V7z"/><path d="M12 12l9-5M12 12v10M12 12L3 7"/></svg><span>${n}</span></button>`}function Wr(i){if(!i)return"";let e=i.previous.label||i.previous.id,t=i.next.label||i.next.id;return`<span class="sl-seccard-nav" aria-label="${v("picker.browseSections","Browse sections")}"><button type="button" data-section-nav="${H(i.previous.id)}" aria-label="${v("picker.previousSection","Previous section")}: ${H(e)}" title="${H(e)}">\u2190</button><button type="button" data-section-nav="${H(i.next.id)}" aria-label="${v("picker.nextSection","Next section")}: ${H(t)}" title="${H(t)}">\u2192</button></span>`}function Yr(i,e){if(!e)return"";let t=e,n=t.includes(i.id),r=n?t.length>1?v("picker.openComparison","Open comparison"):v("picker.savedForComparison","Saved for comparison"):t.length?v("picker.compareWithSaved","Compare with saved"):v("picker.saveToCompare","Save to compare");return`<button type="button" class="sl-confirm-compare"${n&&t.length===1?" disabled":""}><span aria-hidden="true">\u21C4</span><span>${S(r)}</span></button>`}function Xr(i,e,t){if(!t)return"";let n=Ac(i.confidenceEvidence),r=n.modeledTarget??n.reality;return`<button type="button" class="sl-confirm-confidence" aria-label="Open seat confidence passport for ${S(i.displayLabel??i.label)}"><span><em>${S(e)}</em><strong>${S(n.headline)}</strong><small>${S(r)}</small></span><b>Passport</b></button>`}function G(i){let e=i?.rowLabel,t=i?.sectionLabel;if(!e||!t)return e;for(let n of["-"," ","\xB7","/","_"]){let r=`${t}${n}`;if(e.startsWith(r)&&e.length>r.length)return e.slice(r.length)}return Cc(e,t)}function Pc(i){switch(i){case"paused":return{title:v("picker.accessPausedTitle","These seats are on hold right now"),body:v("picker.accessPausedBody","The organizer has paused this selection. Try again in a few minutes."),action:v("picker.accessRetry","Try again")};case"revoked":return{title:v("picker.accessRevokedTitle","This access link is no longer active"),body:v("picker.accessRevokedBody","Ask whoever sent you here for a new link to keep booking these seats."),action:v("picker.accessRefresh","Refresh")};case"no_token":case"provider_failed":return{title:v("picker.accessExpiredTitle","The seat map timed out"),body:v("picker.accessExpiredBody","Any seats you\u2019re holding stay held. Refresh to see what\u2019s available now."),action:v("picker.accessRefresh","Refresh")};default:return{title:v("picker.accessInvalidTitle","We couldn\u2019t verify your access"),body:v("picker.accessInvalidBody","You can still book anything shown as available. Contact whoever sent you here for access to the rest."),action:v("picker.accessRefresh","Refresh")}}}var Lc=6;function Qr(i,e,t){let n=nn;return[i?.sectionLabel?`<div class="sl-confirm-field sl-confirm-sec${i.sectionLabel.length>Lc?" sl-confirm-sec-long":""}"><span class="sl-confirm-key">${v("picker.section","Section")}</span><span class="sl-confirm-value">${n(i.sectionLabel)}</span></div>`:"",i?.rowLabel||i?.objectType==="booth"?`<div class="sl-confirm-field"><span class="sl-confirm-key">${n(t)}</span><span class="sl-confirm-value">${n(G(i)??i?.displayLabel??e)}</span></div>`:"",i?.objectType!=="booth"?`<div class="sl-confirm-field"><span class="sl-confirm-key">${v("picker.seat","Seat")}</span><span class="sl-confirm-value">${n(i?.seatNumber??i?.displayLabel??e)}</span></div>`:""].filter(Boolean).join("")}function Zr(i,e,t){let n=nn,r=i?.objectType==="booth",s=i?.objectType==="table"&&!!i?.bookingMode,o=r||s||!i?.seatNumber,a=i?.sectionLabel??(o?void 0:i?.displayLabel),l=s?`${v("picker.guests","Guests")} ${i?.bookingMode==="variable"?`${i?.minOccupancy}\u2013${i?.maxOccupancy}`:i?.capacity}`:void 0,p=(o?[l,a?i?.rowLabel??i?.displayLabel:void 0]:[i?.rowLabel?`${t} ${G(i)??""}`.trim():void 0,`${v("picker.seat","Seat")} ${i?.seatNumber??e}`]).filter(Boolean).join(" \xB7 ");return(a?`<span class="sl-confirm-place">${n(a)}</span>`:"")+(p?`<span class="sl-confirm-pos">${a?" \xB7 ":""}${n(p)}</span>`:"")+(a||p?"":`<span class="sl-confirm-pos">${n(e)}</span>`)}function Jr(i,e){if(!i)return"";let t=e?v("picker.viewFromThisSeat","View from this seat"):v("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 es(i,e){if(!i||e)return"";let t=v("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 qr(i){return i.buyerMessage?.trim()||(i.restriction==="companion"?v("picker.companionRequiresWheelchair","Requires the adjacent wheelchair place"):void 0)}function ts(i,e,t){let n=nn;if(i.length>1)return`<fieldset class="sl-confirm-tiers"><legend>${v("picker.ticketType","Ticket type")}</legend>`+i.map(o=>{let a=qr(o);return`<button type="button" class="sl-confirm-tier" data-confirm-tier="${n(o.id)}" aria-pressed="${o.id===e}"><span class="sl-confirm-tier-copy"><span class="sl-confirm-tier-name">${n(o.name)}</span>`+(a?`<small class="sl-confirm-tier-note">${n(a)}</small>`:"")+`</span><span class="sl-confirm-tier-price">${n(t(o))}</span></button>`}).join("")+"</fieldset>";let r=i[0],s=r?qr(r):void 0;return s?`<p class="sl-confirm-tier-note">${n(s)}</p>`:""}function is(i){return`<span class="sl-seccard-dot" style="background:${S(i.color)}"></span><span class="sl-seccard-name">${S(i.label)}</span><span class="sl-seccard-left" data-full="${S(i.leftLabel)}" data-short="${S(i.leftShortLabel??i.leftLabel)}">${S(i.leftLabel)}</span>`+i.nav+i.close}function ns(i){return`<div class="sl-seccard-head"><span class="sl-seccard-dot" style="background:${S(i.color)}"></span><span class="sl-seccard-name">${S(i.label)}</span>`+(i.showPrice?`<span class="sl-seccard-price">${S(i.priceLabel)}</span>`:"")+i.close+`</div><div class="sl-seccard-zone">${i.zoneLabel?`${S(i.zoneLabel)} \xB7 `:""}<span class="sl-seccard-left">${S(i.leftLabel)}</span></div>`+(i.entrance?`<div class="sl-seccard-entrance">${S(i.entrance)}</div>`:"")+(i.mix?`<div class="sl-seccard-mix">${i.mix}</div>`:"")+`<div class="sl-seccard-foot"><button type="button" class="sl-seccard-overview">\u2190 ${S(i.overviewLabel)}</button>`+i.nav+`<span class="sl-seccard-hint">${S(i.hint)}</span></div>`}function rs(i){return`<span class="sl-seccard-mix-item${i.dim?" sl-dim":""}"><span class="sl-seccard-mix-dot" style="background:${S(i.color)}"></span>${S(i.label)} <span class="sl-seccard-mix-price">${S(i.rangeLabel)}</span></span>`}function ss(i){return'<div class="sl-confirm-grid">'+i.identityFields+`</div><div class="sl-confirm-cat"><span class="sl-confirm-cat-name">${S(i.categoryLabel)}</span>`+(i.priceLabel?`<span class="sl-confirm-price">${S(i.priceLabel)}</span>`:"")+'</div><div class="sl-confirm-id">'+i.marker+`<span class="sl-confirm-dot" style="background:${S(i.categoryColor)}" aria-hidden="true"></span><span class="sl-sr">${S(i.categoryLabel)}</span><span class="sl-confirm-who">`+i.identity+"</span>"+(i.priceLabel?`<span class="sl-confirm-idprice">${S(i.priceLabel)}</span>`:"")+'</div><div class="sl-confirm-body">'+i.tierChoices+i.groupDates+i.wheelchair+i.commercial+(i.thumb||i.see3dPill?`<div class="sl-confirm-strip">${i.thumb}<span class="sl-confirm-pills">${i.see3dPill}</span></div>`:"")+i.inspect+'<div class="sl-confirm-row">'+(i.see3dRow??"")+`<button type="button" class="sl-confirm-cancel">${S(i.cancelLabel)}</button><button type="button" class="sl-confirm-add"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M5 12.5l4 4L19 7"/></svg><span class="sl-confirm-add-t">${S(i.selectLabel)}</span></button></div></div>`}function os(i,e){let t=H,{variable:n}=e;return`<section class="sl-table-dialog" role="dialog" aria-modal="true" aria-labelledby="sl-table-title" aria-describedby="sl-table-copy"><div class="sl-table-head"><div class="sl-table-eyebrow">${t(n?Be("picker.flexiblePartyTypeWord",{typeWord:e.typeWord}):Be("picker.wholeTypeWord",{typeWord:e.typeWord}))}</div><h2 class="sl-table-title" id="sl-table-title">${t(i.displayLabel??i.label)}</h2><p class="sl-table-copy" id="sl-table-copy">${t(n?v("picker.chooseGuestsCopy","Choose how many guests will sit together. This table is held exclusively for your party."):Be("picker.allPlacesBookedTogether",{count:i.capacity}))}</p></div><div class="sl-table-body"><div class="sl-table-summary"><span>${t(e.categoryLabel)}</span>`+(e.suppressPricing?"":`<b data-table-unit>${t(Be("picker.perGuestPrice",{price:e.unitPrice}))}</b>`)+`<span class="muted">${t(v("picker.tableCapacity","Table capacity"))}</span><span>${t(Be("picker.guestsCount",{count:i.capacity}))}</span>`+(e.suppressPricing?"":`<span class="muted">${t(v("picker.total","Total"))}</span><b data-table-total></b>`)+"</div>"+(n?`<label class="sl-table-qtylabel" id="sl-table-qty-label">${t(v("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(v("picker.fewerGuests","Fewer guests"))}">\u2212</button><output aria-live="polite" data-table-qty>${i.quantity}</output><button type="button" data-table-step="1" aria-label="${t(v("picker.moreGuests","More guests"))}">+</button></div><div class="sl-table-range">${t(Be("picker.chooseMinMaxGuests",{min:i.minOccupancy,max:i.maxOccupancy}))}</div>`:`<input type="hidden" data-table-qty value="${i.capacity}">`)+`<div class="sl-table-actions"><button type="button" class="sl-table-cancel">${t(Be("common.cancel"))}</button><button type="button" class="sl-table-confirm">${t(e.held?v("picker.updateTable","Update table"):n?v("picker.selectTable","Select table"):v("picker.selectWholeTable","Select whole table"))}</button></div></div></section>`}function as(i,e){let t=Pc(i),n=document.createElement("div");n.className="sl-interrupt sl-access",n.setAttribute("role","status"),n.setAttribute("aria-live","polite");let r=document.createElement("div");r.className="sl-interrupt-card";let s=document.createElement("div");s.className="sl-interrupt-title",s.textContent=t.title;let o=document.createElement("div");o.className="sl-interrupt-body",o.textContent=t.body,r.append(s,o);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 p=document.createElement("span");return p.textContent=t.action,l.append(c,p),l.addEventListener("click",async()=>{n.classList.add("is-reloading"),l.disabled=!0;try{await e()}catch{}finally{n.isConnected&&(n.classList.remove("is-reloading"),l.disabled=!1)}}),a.appendChild(l),r.appendChild(a),n.appendChild(r),n}function ls(i){return i.map(e=>`<button type="button" role="switch" class="sl-a11yrow${e.className?` ${e.className}`:""}${e.on?" on":""}" data-a11y-row="${S(e.key)}" aria-checked="${e.on}" aria-pressed="${e.on}"`+(e.disabled?' disabled aria-disabled="true"':"")+`><span class="sl-a11yrow-i" aria-hidden="true">${S(e.icon)}</span><span class="sl-a11yrow-t"><span class="sl-a11yrow-l">${S(e.label)}</span>`+(e.note?`<span class="sl-a11yrow-n">${S(e.note)}</span>`:"")+"</span>"+(e.count?`<span class="sl-a11yrow-c">${S(e.count)}</span>`:"")+'<span class="sl-a11yrow-s" aria-hidden="true"></span></button>').join("")}function cs(i){let e=document.createElement("div");e.className="sl-floors on",e.setAttribute("role","group"),e.setAttribute("aria-label",i.tf("picker.chooseLevel","Choose level"));let t=[{id:"",name:i.tf("picker.allFloors","All floors")},...i.floors.map(s=>({id:s.id,name:s.name}))];for(let s of t){let o=document.createElement("button");o.type="button",o.dataset.floor=s.id,o.textContent=s.name,o.setAttribute("aria-pressed","false"),o.addEventListener("click",()=>i.onChoose(s.id)),e.appendChild(o)}let n=document.createElement("button");n.type="button",n.className="sl-floor-info",n.textContent="i";let r=i.tf("picker.floorHelp","All floors shows the complete venue. Choose one level to inspect and select its seats.");return n.setAttribute("aria-label",r),n.title=r,e.appendChild(n),e}function ds(i,e,t){if(!i)return;let n=t?"":e;i.querySelectorAll("button[data-floor]").forEach(r=>{r.setAttribute("aria-pressed",String(r.dataset.floor===n))})}import{t as Ne,tCount as Mc}from"@seatlayer/core";var di=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()}wireNavigation(e){e.querySelectorAll("[data-section-nav]").forEach(t=>{t.addEventListener("click",n=>{n.preventDefault(),n.stopPropagation();let r=t.dataset.sectionNav;r&&this.host.controller.focusSection(r)})})}render(e){let t=this.host.map();if(!t)return;if(this.host.root()?.dataset.layout==="narrow"){this.el?.remove(),this.el=null;return}let n=e.categories.length?e.categories.map(h=>{let g=this.host.controller.doc?.categories.find(b=>b.key===h.key);return g?this.host.catPriceRange(g):{min:h.priceMin,max:h.priceMax}}).filter(h=>h!=null):[{min:e.priceMin,max:e.priceMax}],r=Math.min(...n.map(h=>h.min)),s=Math.max(...n.map(h=>h.max)),o=r===s?this.host.money(r):`${this.host.money(r)}\u2013${this.host.money(s)}`,a=Mc("picker.seatsLeftInSection",e.seatsLeft),l=Ne("picker.seatsLeftShort",{count:e.seatsLeft}),c=`<button type="button" class="sl-seccard-x" aria-label="${Ne("picker.closeSectionSummary")}">\u2715</button>`,p=Wr(this.host.sectionNeighbours(e.id)),d={label:e.label,color:e.color,leftLabel:a,leftShortLabel:l,nav:p,close:c};this.el?.remove();let u=document.createElement("div");if(this.collapsed)u.className="sl-seccard mini on",u.setAttribute("role","button"),u.setAttribute("aria-label",Ne("picker.sectionSummaryAria",{label:e.label})),u.innerHTML=is(d),this.wireNavigation(u),u.addEventListener("click",h=>{h.target.closest(".sl-seccard-x")||(this.collapsed=!1,this.shownAt=Date.now(),this.render(e))}),u.querySelector(".sl-seccard-x").addEventListener("click",()=>this.host.controller.overview()),(this.host.region("top-center")??t).appendChild(u);else{u.className="sl-seccard on",u.setAttribute("role","dialog"),u.setAttribute("aria-label",Ne("picker.sectionSummaryAria",{label:e.label}));let h=this.host.priceBandKeys(),g=this.host.suppressPricing(),b=e.categories.map(w=>{let x=this.host.controller.doc?.categories.find(m=>m.key===w.key),y=x?this.host.catPriceRange(x):{min:w.priceMin,max:w.priceMax};return rs({label:w.label,color:w.color,dim:h!=null&&!h.has(w.key),rangeLabel:g?"":y&&y.min!==y.max?`${this.host.money(y.min)}\u2013${this.host.money(y.max)}`:this.host.money(y?.min??w.price)})}).join("");u.innerHTML=ns({...d,priceLabel:o,showPrice:!g&&e.categories.length>0,zoneLabel:e.zoneLabel,entrance:e.entrance?`${Ne("picker.entrance")} ${e.entrance}`:void 0,mix:b,overviewLabel:Ne("picker.overview"),hint:Ne("picker.tapSeatHint")}),this.wireNavigation(u),u.querySelector(".sl-seccard-x").addEventListener("click",()=>this.host.controller.overview()),u.querySelector(".sl-seccard-overview").addEventListener("click",()=>this.host.controller.overview()),(this.host.region("top-center")??t).appendChild(u)}this.el=u}collapse(){!this.el||this.collapsed||!this.current||(this.collapsed=!0,this.render(this.current))}onView(){if(!(!this.el||this.collapsed||!this.current)){if(this.host.controller.getRung()==="seats"){this.collapse();return}if(Date.now()-this.shownAt<1400){this.coverage()>.25&&this.collapse();return}this.collapse()}}coverage(){let e=this.el,t=this.current,n=this.host.map();if(!e||!t||!n)return 0;let r=this.host.activeFloorObjects().find(y=>y.type==="section"&&y.id===t.id)?.outline;if(!r||r.length<3)return 0;let s=r.map(y=>this.host.controller.worldToScreen(y)),o=s.map(y=>y.x),a=s.map(y=>y.y),l=Math.min(...o),c=Math.min(...a),p=Math.max(...o)-l,d=Math.max(...a)-c;if(p<=0||d<=0)return 0;let u=n.getBoundingClientRect(),h=e.getBoundingClientRect(),g=h.left-u.left,b=h.top-u.top,w=Math.max(0,Math.min(g+h.width,l+p)-Math.max(g,l)),x=Math.max(0,Math.min(b+h.height,c+d)-Math.max(b,c));return w*x/(p*d)}};import{t as fi,tCount as Gc}from"@seatlayer/core";import{contrastRatio as qc}from"@seatlayer/core/core/color";import{t as ps,tCount as pi}from"@seatlayer/core";function an(i,e,t){try{return new Intl.DateTimeFormat(e,{...t,...i.timezone?{timeZone:i.timezone}:{}}).format(new Date(i.startsAt))}catch{return new Date(i.startsAt).toLocaleString(e)}}var hi=(i,e)=>an(i,e,{dateStyle:"medium"}),ui=(i,e)=>an(i,e,{timeStyle:"short"}),mi=(i,e)=>an(i,e,{weekday:"short",day:"numeric",month:"short"});function hs(i,e,t,n){return!i.length||i.length>=e?null:{summary:n,labels:i.map(r=>`${hi(r,t)} \xB7 ${ui(r,t)}`)}}function Hc(i,e){let t=new Set(e);return i.map(n=>({...n,free:!t.has(n.eventKey)}))}function us(i,e){let t=[...i];if(t.length<=1)return t[0]??"";try{return new Intl.ListFormat(e,{style:"long",type:"conjunction"}).format(t)}catch{return t.join(", ")}}function Rc(i,e,t="",n=!1){if(!i.length)return"";let r=i.map(s=>{let o=s.free?e.free:e.blocked,a=n&&s.free?`<input class="sl-night-choice" type="checkbox" data-pg-event-key="${S(s.eventKey)}" aria-label="${S(`${s.shortDate}: ${o}`)}" checked>`:"";return`<li class="sl-night${s.free?" ok":" no"}" aria-label="${S(`${s.shortDate}: ${o}`)}">`+a+`<i class="sl-night-dot" aria-hidden="true"></i><span class="d">${S(s.shortDate)}</span><span class="st">${S(o)}</span></li>`}).join("");return`<div class="sl-tip-nights"><div class="sl-tip-nights-title">${S(e.title)}</div><ul class="sl-nightstrip">${r}</ul><p class="sl-tip-nights-note">${S(e.notAvailableOn)}</p>`+t+"</div>"}function Oc(i){return i.selectPartialLabel&&i.pinned?`<button type="button" class="sl-tip-switch" data-pg-select-partial>${S(i.selectPartialLabel)}</button>`:i.switchLabel&&i.pinned?`<button type="button" class="sl-tip-switch" data-pg-switch-mode>${S(i.switchLabel)}</button>`:i.switchLabel||i.selectPartialLabel?"":`<p class="sl-tip-advice">${S(i.advice)}</p>`}function Ic(i){return Number(i.available)+Number(i.selected)+Number(i.partial)+Number(i.unavailable)}function ms(i,e,t){if(Ic(i)<2)return"";let n=(s,o,a="")=>`<li class="sl-pg-legend-item"><i class="sl-pg-sw ${s}"${a}></i>${S(o)}</li>`,r=[];return i.available&&r.push(n("sl-pg-sw-free",e.available,` style="background:${S(t)}"`)),i.selected&&r.push(n("sl-pg-sw-sel",e.selected)),i.partial&&r.push(n("sl-pg-sw-split",e.partial,` style="--sl-pg-sw-cat:${S(t)}"`)),i.unavailable&&r.push(n("sl-pg-sw-off",e.unavailable)),`<ul class="sl-pg-legend-list" aria-label="${S(e.title)}">${r.join("")}</ul>`}function fs(i,e){if(!i.length)return"";let t=i.map(n=>{let r=n.labels.length?n.labels.join(", "):e.empty;return`<li class="sl-pg-night-row${n.labels.length?"":" empty"}${n.active?" active":""}" role="button" tabindex="0"${n.active?' aria-current="true"':""} data-event-key="${S(n.eventKey)}"><span class="n">${S(n.name)}</span><span class="s">${S(r)}</span></li>`}).join("");return`<div class="sl-pg-nights" role="group" aria-label="${S(e.title)}"><div class="sl-pg-nights-title">${S(e.title)}</div><ul class="sl-pg-nights-list">${t}</ul></div>`}function ln(i,e){if(i?.kind!=="partial"||!e?.length)return null;let t=i.data?.blockedEventKeys??[],n=Hc(e,t);return{states:n,missing:n.filter(r=>!r.free).map(r=>r.shortDate)}}function gs(i,e){return i?Rc(i.states,{title:v("picker.group.partlyAvailableTitle","Free on some nights only"),free:v("picker.group.nightFree","Free"),blocked:v("picker.group.nightBlocked","Not available"),notAvailableOn:ps("picker.group.notAvailableOn",{dates:us(i.missing,e.locale)})},Oc({switchLabel:e.switchLabel??null,selectPartialLabel:e.selectPartialLabel??null,pinned:e.pinned,advice:v("picker.group.pickSeatFreeEveryNight","Pick a seat that is free every night.")}),!!e.selectPartialLabel&&!!e.pinned):""}function _c(i,e,t,n){if(!i.length)return"";let r=new Set(e),s=new Set(t),o=i.map(a=>{let l=r.has(a.eventKey);return`<li class="sl-confirm-date${l?"":" blocked"}"><label><input type="checkbox" data-pg-confirm-event-key="${S(a.eventKey)}" aria-label="${S(`${a.shortDate}: ${l?n.available:n.unavailable}`)}"${l&&s.has(a.eventKey)?" checked":""}${l?"":" disabled"}><span class="sl-confirm-date-label">${S(a.shortDate)}</span><span class="sl-confirm-date-state">${S(l?n.available:n.unavailable)}</span></label></li>`}).join("");return`<fieldset class="sl-confirm-dates" data-pg-confirm-dates><legend>${S(n.title)}</legend><p class="sl-confirm-dates-copy">${S(n.copy)}</p><label class="sl-confirm-date-all"><input type="checkbox" data-pg-confirm-all><span>${S(n.selectAll)}</span></label><ul>${o}</ul><p class="sl-confirm-dates-summary" data-pg-confirm-summary aria-live="polite"></p></fieldset>`}function bs(i,e,t,n){let r=e.availableEventKeys(t);return _c(i,r,e.includedEventKeys(),{title:n("picker.group.confirmDatesTitle","Choose performance dates"),copy:r.length===i.length?n("picker.group.confirmAllDatesCopy","This seat is available for all {count} dates. Keep all selected, or remove dates you do not want.").replace("{count}",String(i.length)):n("picker.group.confirmPartialDatesCopy","This seat is available for {available} of {total} dates. Choose one date or keep every available date.").replace("{available}",String(r.length)).replace("{total}",String(i.length)),selectAll:n("picker.group.confirmSelectAll","Select all available dates"),available:n("picker.group.nightFree","Available"),unavailable:n("picker.group.nightBlocked","Unavailable")})}function vs(i){return[...i.querySelectorAll("[data-pg-confirm-event-key]")].filter(e=>e.checked&&!e.disabled).map(e=>e.dataset.pgConfirmEventKey).filter(Boolean)}function ys(i,e,t,n){let r=[...i.querySelectorAll("[data-pg-confirm-event-key]")];if(!e||!r.length)return;let s=i.querySelector(".sl-confirm-add"),o=i.querySelector("[data-pg-confirm-all]"),a=()=>{let l=r.filter(d=>!d.disabled),c=vs(i).length;o&&(o.checked=c===l.length,o.indeterminate=c>0&&c<l.length);let p=i.querySelector("[data-pg-confirm-summary]");p&&(p.textContent=c===l.length?t("picker.group.confirmAllSelected","All {count} available dates are selected.").replace("{count}",String(c)):t("picker.group.confirmSelectedOfAvailable","{selected} of {available} available dates selected.").replace("{selected}",String(c)).replace("{available}",String(l.length))),s.disabled=c===0,s.textContent=c?e.label(c):t("picker.group.confirmChooseOne","Choose at least 1 date"),n()};r.forEach(l=>l.addEventListener("change",a)),o?.addEventListener("change",()=>{r.filter(l=>!l.disabled).forEach(l=>{l.checked=o.checked}),a()}),a()}async function ws(i,e,t){if(!i||!t||!i.querySelector("[data-pg-confirm-event-key]"))return!0;let n=vs(i);if(!n.length)return!1;let r=i.querySelector(".sl-confirm-add");return r?.setAttribute("aria-busy","true"),r&&(r.disabled=!0),await t.apply(e,n)?!0:(r?.removeAttribute("aria-busy"),r?.isConnected&&(r.disabled=!1),!1)}function xs(i,e,t){return i?ps("picker.group.seatPartlyAvailable",{label:e,free:i.states.length-i.missing.length,total:i.states.length,dates:us(i.missing,t)}):""}function Ss(i,e){let t=i.map((n,r)=>{let s=n.state==="done"?e.done:n.state==="current"?e.current:e.upcoming;return`<li class="sl-pg-step-item" data-step="${S(n.id)}" data-state="${S(n.state)}"${n.state==="current"?' aria-current="step"':""}><span class="i" aria-hidden="true">${n.state==="done"?"\u2713":String(r+1)}</span><span class="l">${S(n.label)}</span><span class="sl-pg-sr">${S(s)}</span></li>`}).join("");return`<ol class="sl-pg-steps" aria-label="${S(e.label)}">${t}</ol>`}function cn(i,e){return`<ul class="sl-pg-cards">${i.map(n=>`<li class="sl-pg-card" data-event-key="${S(n.eventKey)}"><span class="n">${S(n.name)}</span><time datetime="${S(n.iso)}"><span class="d">${S(n.date)}</span><span class="t">${S(n.time)}</span></time></li>`).join("")}</ul><p class="sl-pg-included">${S(e)}</p>`}function ks(i){let e=i.rows.map(t=>`<li class="sl-pg-pane-row${t.labels.length?"":" empty"}" data-event-key="${S(t.eventKey)}"><span class="n">${S(t.name)}</span><span class="s">${S(t.labels.length?t.labels.join(", "):i.empty)}</span></li>`).join("");return`<div class="sl-pg-pane-title">${S(i.title)}</div><ul class="sl-pg-pane-list">${e}</ul>`+(i.note?`<p class="sl-pg-pane-note">${S(i.note)}</p>`:"")+(i.total?`<div class="sl-pg-pane-total"><span>${S(i.total.label)}</span><b>${S(i.total.amount)}</b></div>`:"")+(i.holdStatus?`<p class="sl-pg-hold-status" role="status">${S(i.holdStatus)}</p>`:"")}function Ts(i){let e=Math.max(0,i);return`${Math.floor(e/6e4)}:${String(Math.floor(e/1e3)%60).padStart(2,"0")}`}function Es(i,e){if(!i||i.seats<=0)return"";if(e==="same_seat"){let t=i.perPerformance??i.seats;return i.totalPerformances&&i.performances<i.totalPerformances?pi("picker.group.performancesChosenOf",t,{chosen:i.performances,total:i.totalPerformances}):pi("picker.group.seatsEveryPerformance",t)}return i.perPerformance!=null&&i.performancesChosen===i.performances?pi("picker.group.seatsPerPerformance",i.seats,{per:i.perPerformance}):pi("picker.group.performancesChosenOf",i.seats,{chosen:i.performancesChosen,total:i.performances})}function Cs(i,e){i.querySelectorAll(".sl-pg-night-row[data-event-key]").forEach(t=>{let n=()=>e(t.dataset.eventKey);t.addEventListener("click",n),t.addEventListener("keydown",r=>{r.key!=="Enter"&&r.key!==" "||(r.preventDefault(),n())})})}import{t as Dc}from"@seatlayer/core";function he(i){return String(i??"\u2014").replace(/[&<>"]/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[e])}function Bc(i,e){let t=i.objectType==="table"&&!!i.bookingMode,n=i.objectType==="booth",r=t||n||!i.seatNumber,s=r?i.rowLabel??i.displayLabel??i.label:i.seatNumber,o=t?`${v("picker.guests","Guests")} ${i.bookingMode==="variable"?`${i.minOccupancy}\u2013${i.maxOccupancy}`:i.capacity}`:!n&&i.rowLabel?`${e} ${G(i)??""}`.trim():"";return`<div class="sl-tip-head"><div class="sl-tip-id"><span class="sl-tip-seat${r?" name":""}">${he(s)}</span>`+(o?`<span class="sl-tip-row">${he(o)}</span>`:"")+"</div>"+(i.sectionLabel?`<div class="sl-tip-sec"><span class="sl-tip-eyebrow">${v("picker.section","Section")}</span><span class="sl-tip-secname">${he(i.sectionLabel)}</span></div>`:"")+"</div>"}function As(i,e){let t=i.status==="not_for_sale",n=i.mark?.kind==="partial",r=i.status==="free"||n?"":`<span class="sl-tip-tag">${t?v("picker.notAvailable","Not available"):i.status==="held"?Dc("map.statusHeld"):v("picker.sold","Sold")}</span>`,s=t?"":e.price,o=s?`<span class="sl-tip-amt">${he(s)}</span>`:"",a=!s&&e.priceNote?`<div class="sl-tip-note">${he(e.priceNote)}</div>`:"",l=Se(i.commercial),c=l?`<div class="sl-tip-cx"><span class="g" aria-hidden="true">\u25D0</span>${he(l)}</div>`:"",p=st(i.wheelchairSpaceType),d=p?`<div class="sl-tip-cx"><span class="g" aria-hidden="true">\u267F</span>${he(p)}</div>`:"",u=e.reason?`<div class="sl-tip-reason">${he(e.reason)}</div>`:"";return'<i class="sl-tip-rail" aria-hidden="true"></i>'+Bc(i,e.rowTypeWord)+`<div class="sl-tip-cat"><span class="sl-tip-dot" style="background:${he(i.categoryColor)}"></span><span class="sl-tip-name">${he(i.categoryLabel)}</span>`+r+o+"</div>"+a+u+d+c+(e.extra??"")}function Ps(i,e,t,n){let r=i.x+14,s=i.y-n.height-12,o=i.y+18,a=s;r+n.width>e-8&&(r=i.x-n.width-14),s<8&&o+n.height<=t-8&&(a=o);let l=Math.max(8,t-n.height-8);return{left:Math.max(8,Math.min(r,Math.max(8,e-n.width-8))),top:Math.max(8,Math.min(a,l))}}function Ls(i,e,t,n=22){let r=Math.max(8,Math.min(i.x-t.width/2,Math.max(8,e.width-t.width-8))),s=i.y-n-t.height,o=i.y+n;return s>=8?{left:r,top:s,placement:"above"}:o+t.height<=e.height-8?{left:r,top:o,placement:"below"}:{left:r,top:Math.max(8,Math.min(s<8?o:s,Math.max(8,e.height-t.height-8))),placement:s<8?"below":"above"}}var dn=14,Nc=12,Fc=12,Vc=8;function Ms(i,e,t,n=Nc){let r=e.height-dn-t.height,s=Fc,o=r-n;if(o<=s)return{placement:"sheet",nudgeY:0};let a=(s+o)/2-i;return Math.abs(a)<=Vc?{placement:"sheet",nudgeY:0}:{placement:"sheet",nudgeY:Math.round(a)}}function Hs(i,e,t,n,r=0){let s=t.width/2+12,o=Math.max(s,Math.min(e.width-s,i.x)),a=i.y+r+t.height+24<=e.height,l=i.y-r<t.height+24&&a?"below":"above",c=l==="above"?i.y-r:i.y+r,p=n&&l==="above"?Math.max(t.height+24,c):c;return{left:o,top:Math.max(8,Math.min(e.height-8,p)),placement:l}}function Rs(i,e,t){let n=i.querySelector("[data-pg-select-partial]"),r=[...i.querySelectorAll("[data-pg-event-key]")],s=()=>r.filter(a=>a.checked).map(a=>a.dataset.pgEventKey).filter(Boolean),o=()=>{if(!n)return;let a=s().length;n.disabled=a===0,n.textContent=e?.(a)??n.textContent};r.forEach(a=>{a.addEventListener("change",o);let l=a.closest(".sl-night");l?.classList.add("selectable"),l?.addEventListener("click",c=>{c.target!==a&&(a.checked=!a.checked,o())})}),n?.addEventListener("click",()=>{let a=s();a.length&&t?.(a)})}function Fe(i){let e=i?.displayType?.trim()||i?.rowType?.trim();return e||(i?.objectType==="table"?v("picker.table","Table"):i?.objectType==="booth"?v("picker.booth","Booth"):v("picker.row","Row"))}var $c="sl-confirm-scrim",zc="--sl-scrim-mask";function jc(i){let e=Math.round(i.x),t=Math.round(i.y);return`radial-gradient(circle at ${e}px ${t}px, transparent 0 56px, #000 88px)`}function Os(i,e,t,n){let r=i??document.createElement("div");return i||(r.className=$c),r.style.setProperty(zc,jc(n)),t.parentNode===e?r.nextSibling!==t&&e.insertBefore(r,t):r.parentNode!==e&&e.appendChild(r),r}function pn(i){return i?.remove(),null}var Uc=360,Kc=160,Wc=700,Is=450;function _s(){try{return globalThis.matchMedia?.("(pointer: coarse)").matches??!1}catch{return!1}}function Yc(i){return qc("#ffffff",i)>=3?"#ffffff":"#0b0f19"}var gi=class{constructor(e){this.el=null;this.seat=null;this.outsideTap=null;this.scrim=null;this.shownAt=0;this.lift=null;this.framing=null;this.mode="add";this.host=e}get element(){return this.el}set element(e){this.el=e}get candidate(){return this.seat}set candidate(e){this.seat=e}thumbHtml(e){let t=this.host.controller.doc;if(!t)return"";let n=rt(e)?e.viewUrl??"":"",r=ai(t);if(!n&&!r)return"";let s=n?null:li(e,e.focalPoint??t.focalPoint);if(!n&&s==null)return"";let o=r&&s!=null?`<div class="sl-confirm-sight">${H(fi("picker.sightline",{m:s}))}</div>`:"";if(!n)return o;let a=H(fi("picker.viewFromSeat",{label:e.label})),l=H(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>`+o}show(e,t="add"){let n=this.host;this.mode=t;let r=this.seat?.id;this.el?.remove(),this.el=null,this.seat=e,n.root()?.setAttribute("data-confirming","true"),n.els().side?.toggleAttribute("inert",!0),Object.values(n.regions()).forEach(L=>L.toggleAttribute("inert",!0)),n.controller.setSelectionFocus(e.id),r&&r!==e.id&&n.controller.deselect([r]),n.hideTooltip();let s=n.controller.seatDetails(e.id),o=n.controller.doc?.categories.find(L=>L.key===e.categoryKey),a=s?.price??(o?.tiers?.length?o.tiers[0].price:o?.price),l=a!=null?n.paidPrice(e.categoryKey,s?.tierId??o?.tiers?.[0]?.id??null,a,e.label):void 0,c=Qr(s,e.displayLabel??e.label,Fe(s)),p=s?.tiers??o?.tiers??[],d=s?.tierId??p[0]?.id,u=n.suppressPricing()?"":ts(p,d,L=>n.money(n.paidPrice(e.categoryKey,L.id,L.price,e.label))),h=n.buyerView()==="venue3d",g=n.performanceGroup()?.confirmDateSelection??void 0,b=g?n.performanceGroup()?.nights?.()??[]:[],w=g?bs(b,g,e.id,(L,C)=>n.tf(L,C)):"";this.shownAt=performance.now();let x=document.createElement("div");x.className="sl-confirm sl-mo-in",t==="remove"&&x.classList.add("sl-confirm-removing"),w&&x.classList.add("sl-confirm-group-dates"),x.setAttribute("role","dialog"),x.setAttribute("aria-label",fi("picker.confirmSeatLabel",{label:e.label}));let y=o?.color??"#6e7bff";x.style.setProperty("--sl-cat",y),x.style.setProperty("--sl-cat-ink",Yc(y));let m=String(s?.categoryLabel??o?.label??e.categoryKey),A=n.controller.categoryAvailability()[e.categoryKey],_=typeof A=="number"&&A>0?Gc("picker.leftCount",A):"";x.innerHTML=ss({identityFields:c,identity:Zr(s,e.displayLabel??e.label,Fe(s)),marker:At(s?.wheelchairSpaceType),see3dPill:Jr(n.canOffer3d(),h),categoryColor:o?.color??"#6e7bff",categoryLabel:m,priceLabel:!n.suppressPricing()&&l!=null?n.money(l):"",categoryLeftLabel:_,tierChoices:u,groupDates:w,wheelchair:Kr(s?.wheelchairSpaceType),commercial:Ur(e.commercial),thumb:n.seatViewEnabled()&&n.buyerView()!=="venue3d"?this.thumbHtml(e):"",inspect:h?`<div class="sl-confirm-inspect-row">${Xr(e,n.suppressPricing()?`${s?.displayLabel??e.displayLabel??e.label}`:`${s?.displayLabel??e.displayLabel??e.label} \xB7 ${l==null?n.tf("picker.priceNotSupplied","Price not supplied"):n.money(l)}`,h)}${Yr(e,h?n.view3dCompareSeatIds():null)}${on(n.canOffer3d(),h)}</div>`:on(n.canOffer3d(),h),see3dRow:es(n.canOffer3d(),h),cancelLabel:fi("common.cancel"),selectLabel:t==="remove"?n.tf("picker.removeSeat","Remove seat"):n.addSeatLabel(s?.objectType)}),t==="remove"&&x.querySelector(".sl-confirm-add svg path")?.setAttribute("d","M6 6l12 12M18 6L6 18"),n.els().map.appendChild(x),this.el=x;let k=x.querySelector(".sl-confirm-thumb"),M=k?.closest(".sl-confirm-thumbwrap")??null;if(k&&M){let L=!1,C=()=>{if(L||!M.isConnected)return;L=!0;let R=()=>{M.remove(),this.el===x&&n.reanchor()};if(n.reducedMotion()||typeof requestAnimationFrame!="function"){R();return}M.style.height=`${M.offsetHeight}px`,M.classList.add("sl-confirm-thumb-out"),requestAnimationFrame(()=>{M.style.height="0px",M.style.opacity="0"}),setTimeout(R,Kc)};k.addEventListener("error",C),k.addEventListener("load",()=>{k.naturalWidth||C()});let D=e.viewMeta?.previewUrl??e.viewUrl;D?n.resolveAssetUrl(D).then(R=>{if(!(!x.isConnected||this.el!==x)){if(!R){C();return}k.src=R}}).catch(R=>{C(),n.onError(R)}):C()}n.reanchor(),this.liftSeatClearOfSheet(e),x.querySelector(".sl-confirm-view")?.addEventListener("click",()=>{n.openSeatView(e)}),x.querySelector(".sl-confirm-confidence")?.addEventListener("click",L=>{n.openSeatConfidencePassport(e,L.currentTarget instanceof HTMLElement?L.currentTarget:null)}),x.querySelector(".sl-confirm-compare")?.addEventListener("click",()=>n.saveView3dComparisonSeat(e)),x.querySelectorAll("[data-confirm-tier]").forEach(L=>{L.addEventListener("click",()=>{let C=L.dataset.confirmTier,D=p.find(N=>N.id===C);if(!D)return;n.controller.setSeatTier(e.id,D.id),x.querySelectorAll("[data-confirm-tier]").forEach(N=>{N.setAttribute("aria-pressed",String(N===L))});let R=x.querySelector(".sl-confirm-price");R&&(R.textContent=n.money(n.paidPrice(e.categoryKey,D.id,D.price,e.label))),n.reanchor()})}),x.querySelectorAll(".sl-confirm-3d,.sl-confirm-3dpill,.sl-confirm-3drow").forEach(L=>{L.addEventListener("pointerdown",Xt,{once:!0}),L.addEventListener("click",()=>{n.buyerView()==="venue3d"?(n.dismiss(),n.view3dHandle()?.flyToSeat(e.id)):(n.rememberView3dReturnSeat(e),n.dismiss(),n.enter3d(e.id))})}),ys(x,g,(L,C)=>n.tf(L,C),()=>n.reanchor()),x.querySelector(".sl-confirm-add").addEventListener("click",()=>{if(!this.ghostActivation()){if(this.mode==="remove"){this.removeCommitted();return}this.commit()}}),x.querySelector(".sl-confirm-cancel").addEventListener("click",()=>{this.ghostActivation()||this.cancel()}),this.armOutsideTap(x),requestAnimationFrame(()=>{let L=x.querySelector(".sl-confirm-add");L?.focus(),n.liftToastOverConfirm(),n.fitTranslatedRows(),n.inviteCommit(x,L)})}liftSeatClearOfSheet(e){let t=this.host.controller.getRenderer();this.framing={gestures:t?.getCameraGestureCount?.()??0,quietUntil:0},this.frameSeatForSheet(e)}frameSeatForSheet(e){let t=this.host,n=t.root();if(!this.el||n?.dataset.layout!=="narrow"||n?.dataset.view3d==="on")return;let r=t.els().map;if(!r)return;let s=t.controller.worldToScreen({x:e.x,y:e.y}),o=t.controller.getRenderer(),a=o?.getCameraGestureCount?.()??0,{nudgeY:l}=Ms(s.y,{height:r.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 p=!t.reducedMotion();o?.panScreenBy?.({x:0,y:l},{animate:p}),this.lift={dy:c+l,gestures:a},this.framing&&(this.framing.gestures=a,this.framing.quietUntil=p?this.now()+Wc:0)}reframeSeatForSheet(){let e=this.framing,t=this.seat;!e||!t||e.quietUntil&&this.now()<e.quietUntil||(this.host.controller.getRenderer()?.getCameraGestureCount?.()??e.gestures)!==e.gestures||this.frameSeatForSheet(t)}now(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}settleLift(){let e=this.lift;if(this.lift=null,this.framing=null,!e)return;let t=this.host.controller.getRenderer();(t?.getCameraGestureCount?.()??e.gestures)===e.gestures&&t?.panScreenBy?.({x:0,y:-e.dy},{animate:!this.host.reducedMotion()})}reanchor(){let e=this.host;if(!this.el||!this.seat||e.root()?.dataset.view3d==="on")return;let t=e.controller.worldToScreen({x:this.seat.x,y:this.seat.y}),n=e.els().map;if(e.root()?.dataset.layout==="narrow"){this.el.removeAttribute("data-placement"),this.el.style.removeProperty("bottom"),this.scrim=Os(this.scrim,n,this.el,t),Qn(this.el,t,n),e.liftToastOverConfirm(),this.reframeSeatForSheet();return}this.scrim=pn(this.scrim);let r=n.clientWidth,s=n.clientHeight,o=this.el.offsetWidth||276,a=this.el.offsetHeight||230,l=this.el.classList.contains("sl-confirm-group-dates"),c=e.controller.seatScreenRadius()*1.5,p=Hs(t,{width:r,height:s},{width:o,height:a},l,c);this.el.dataset.placement=p.placement,this.el.style.left=`${p.left}px`,this.el.style.top=`${p.top}px`,qt(this.el,t,{left:p.left,top:p.top,width:o,height:a})}ghostActivation(){return _s()?performance.now()-this.shownAt<Is:!1}armOutsideTap(e){this.disarmOutsideTap();let t=this.host,n=s=>{if(this.el!==e){this.disarmOutsideTap();return}let o=s.target;!o||e.contains(o)||t.els().tray?.contains(o)||this.cancel()};this.outsideTap=n;let r=t.root();setTimeout(()=>{this.outsideTap===n&&(r??document).addEventListener("pointerdown",n,!0)},_s()?Is:0)}disarmOutsideTap(){if(!this.outsideTap)return;let e=this.outsideTap;this.outsideTap=null,(this.host.root()??document).removeEventListener("pointerdown",e,!0),document.removeEventListener("pointerdown",e,!0)}dismiss(){let e=this.host;this.disarmOutsideTap(),this.scrim=pn(this.scrim),this.settleLift(),this.el&&Qe(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)}async commit(){let e=this.host,t=this.seat;if(!t)return;let r=this.el?.querySelector(".sl-confirm-add")??null;if(r?.classList.contains("is-adding")||!await ws(this.el,t.id,e.performanceGroup()?.confirmDateSelection??void 0))return;e.collapseSectionCard(),this.seat=null,e.syncTray(),e.syncSelectionTo3d();let s=()=>{e.dismiss(),Ki(e.els(),e.controller.worldToScreen(t),t,e.controller.doc?.categories)};if(!r||e.reducedMotion()){s();return}r.classList.remove("sl-confirm-add-invite"),r.classList.add("is-adding"),r.setAttribute("aria-disabled","true");let o=r.querySelector(".sl-confirm-add-t");o&&(o.textContent=e.tf("picker.added","Added")),e.scheduleMotion(s,Uc)}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;t&&(e.controller.deselect([t.id]),e.dismiss(),e.syncTray(),e.syncSelectionTo3d(),e.root()?.focus({preventScroll:!0}))}};function Ds(i,e,t){if(!e||t)return;e.classList.add("sl-confirm-add-invite");let n=()=>e.classList.remove("sl-confirm-add-invite");i.addEventListener("pointerdown",n,{once:!0}),i.addEventListener("keydown",n,{once:!0}),e.addEventListener("focus",n,{once:!0})}function Bs(i,e){return i&&i!=="seat"?e("picker.select","Select"):e("picker.addSeat","Add seat")}import{pointInPolygon as Xc}from"@seatlayer/core";import{createMinimapTransform as Qc,minimapPointToWorld as Zc,minimapViewportPlan as Jc}from"@seatlayer/core/picker/minimapGeometry";function ed(i,e){return i.x<=e.x&&i.y<=e.y&&i.x+i.width>=e.x+e.width&&i.y+i.height>=e.y+e.height}function Ns(i,e){let t=new hn(i);return t.build(e),t}var hn=class{constructor(e){this.host=e;this.miniCanvas=null;this.miniBase=null;this.miniWrap=null;this.miniToggle=null;this.miniLabel=null;this.miniTf=null;this.miniDrag=null;this.miniSuppressClick=!1;this.userClosed=!1}dispose(){this.miniToggle?.remove(),this.miniWrap?.remove(),this.miniToggle=null,this.miniWrap=null,this.miniCanvas=null,this.miniBase=null,this.miniLabel=null,this.miniTf=null,this.miniDrag=null,this.host.root()?.removeAttribute("data-minimap-open")}build(e){if(!this.host.controller.getViewport())return;let n=document.createElement("button");n.type="button",n.className="sl-minimap-toggle",n.setAttribute("aria-label",v("picker.openVenueMap","Open venue overview map")),n.setAttribute("aria-expanded","false"),n.innerHTML='<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M3 6l5-2 8 3 5-2v13l-5 2-8-3-5 2zM8 4v13M16 7v13"/></svg>',e.appendChild(n),this.miniToggle=n;let r=document.createElement("div");r.className="sl-minimap",r.setAttribute("role","group");let s=document.createElement("div");s.className="sl-minimap-bar";let o=document.createElement("span");o.className="sl-minimap-label";let a=document.createElement("span");a.className="sl-minimap-key",a.setAttribute("aria-label",v("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",v("picker.closeVenueMap","Close venue overview map")),l.textContent="\xD7",s.append(o,a,l);let c=document.createElement("canvas");c.tabIndex=0,c.setAttribute("role","application"),c.setAttribute("aria-label",v("picker.venueMapInstructions","Venue overview map. Drag the viewport, click a section, or use arrow keys to pan.")),r.append(s,c),e.appendChild(r),this.miniWrap=r,this.miniLabel=o,this.miniCanvas=c;let p=document.createElement("canvas");this.miniBase=p,n.addEventListener("click",()=>{let d=this.host.root()?.dataset.minimapOpen==="true";this.userClosed=d,this.setMinimapOpen(!d)}),l.addEventListener("click",()=>{this.userClosed=!0,this.setMinimapOpen(!1)}),c.addEventListener("click",d=>{if(this.miniSuppressClick){this.miniSuppressClick=!1;return}this.minimapJump(d)}),c.addEventListener("pointerdown",d=>this.minimapPointerDown(d)),c.addEventListener("pointermove",d=>this.minimapPointerMove(d)),c.addEventListener("pointerup",d=>this.minimapPointerUp(d)),c.addEventListener("pointercancel",d=>this.minimapPointerUp(d)),c.addEventListener("keydown",d=>this.minimapKeydown(d)),this.layoutMinimap(),this.syncMinimapLabel(),this.drawMinimapStatic(),this.drawMinimapRect()}setAutoOpen(e){if(this.miniWrap){if(!e){this.userClosed=!1,this.host.root()?.dataset.minimapOpen==="true"&&this.setMinimapOpen(!1,!1);return}this.userClosed||this.host.root()?.dataset.minimapOpen==="true"||this.setMinimapOpen(!0,!1)}}setMinimapOpen(e,t=!0){this.host.root()?.setAttribute("data-minimap-open",String(e)),this.miniToggle?.setAttribute("aria-expanded",String(e)),t&&(e?this.miniCanvas?.focus():this.miniToggle?.focus())}layoutMinimap(){let e=this.miniCanvas,t=this.miniBase,n=this.host.controller.getViewport()?.bounds;if(!e||!t||!n||!(n.width>0&&n.height>0))return;let r=196,s=146,o=6,a=n.width/Math.max(1,n.height),l=r,c=Math.round(r/a);c>s&&(c=s,l=Math.round(s*a)),l=Math.max(64,l),c=Math.max(48,c);let p=Math.min(2,window.devicePixelRatio||1);e.width=Math.round(l*p),e.height=Math.round(c*p),e.style.width=`${l}px`,e.style.height=`${c}px`,t.width=e.width,t.height=e.height,this.miniTf=Qc(n,e.width,e.height,p,o)}syncMinimapLabel(){if(!this.miniLabel||!this.miniWrap)return;let e=this.host.controller.getFloors(),t=this.host.controller.isFloorOverview()?v("picker.allFloors","All floors"):e.find(p=>p.id===this.host.controller.getActiveFloorId())?.name??v("picker.venueOverview","Venue overview"),n=this.host.controller.getMinimapSnapshot().sections,s=n.find(p=>p.active)?.label??this.host.focusedSectionLabel(),o=s?`${t} \xB7 ${s}`:t;this.miniLabel.textContent=o;let a=n.filter(p=>p.state==="selected").length,l=n.filter(p=>p.state==="available").length,c=n.filter(p=>p.state==="inactive").length;this.miniWrap.setAttribute("aria-label",n.length?`${o}. ${a} selected, ${l} available, ${c} inactive sections.`:o),this.miniCanvas?.setAttribute("aria-label",n.length?`${o}. ${a} selected, ${l} available, ${c} inactive sections. ${v("picker.venueMapInstructions","The outlined region is the visible map area. Drag it, click a section, or use arrow keys to pan.")}`:`${o}. ${v("picker.venueMapInstructions","The outlined region is the visible map area. Drag it, click elsewhere, or use arrow keys to pan.")}`)}refreshMinimap(){this.miniBase&&(this.layoutMinimap(),this.syncMinimapLabel(),this.drawMinimapStatic(),this.drawMinimapRect())}drawMinimapStatic(){let e=this.miniBase,t=this.miniTf;if(!e||!t)return;let n=e.getContext("2d");if(!n)return;n.clearRect(0,0,e.width,e.height);let r=d=>d*t.scale+t.offX,s=d=>d*t.scale+t.offY,o=this.host.cssVar("--sl-line")||"rgba(139,147,167,.5)",a=this.host.cssVar("--sl-muted")||"#8b93a7",l=this.host.cssVar("--sl-accent")||"#6e7bff",c=this.host.cssVar("--sl-success")||"#22a06b",p=this.host.controller.getMinimapSnapshot();for(let d of p.sections){if(d.outline.length<3)continue;n.beginPath(),d.outline.forEach((h,g)=>g===0?n.moveTo(r(h.x),s(h.y)):n.lineTo(r(h.x),s(h.y))),n.closePath();let u=d.paint;if(n.globalAlpha=d.state==="inactive"?.5:.92,u?n.fillStyle=u.fill:(n.globalAlpha=d.state==="inactive"?.18:d.state==="selected"?.72:.34,n.fillStyle=d.state==="inactive"?a:d.state==="selected"?l:c),n.fill(),n.globalAlpha=.82,n.lineWidth=Math.max(1,t.dpr),n.strokeStyle=u?.stroke||o,n.stroke(),d.owned){n.globalAlpha=1,n.lineWidth=Math.max(2,t.dpr*1.5),n.strokeStyle=l,n.stroke();let h=d.outline.reduce((g,b)=>({x:g.x+b.x,y:g.y+b.y}),{x:0,y:0});n.beginPath(),n.arc(r(h.x/d.outline.length),s(h.y/d.outline.length),Math.max(1.5,t.dpr*1.6),0,Math.PI*2),n.fillStyle=l,n.fill(),n.beginPath(),d.outline.forEach((g,b)=>b===0?n.moveTo(r(g.x),s(g.y)):n.lineTo(r(g.x),s(g.y))),n.closePath()}d.active&&(n.globalAlpha=1,n.lineJoin="round",n.lineWidth=Math.max(4,t.dpr*3.5),n.strokeStyle=this.host.cssVar("--sl-surface")||"#fff",n.stroke(),n.lineWidth=Math.max(2,t.dpr*1.75),n.strokeStyle=l,n.stroke())}if(n.globalAlpha=1,!p.sections.length){let d=Math.max(1,t.dpr),u=this.host.controller.getRenderer?.(),h=new Map,g=b=>{let w=h.get(b);if(w)return w;let x=u?.categoryDisplayColor?.(b)||c;return h.set(b,x),x};for(let b of p.seats)n.globalAlpha=b.state==="inactive"?.22:.78,n.fillStyle=b.state==="inactive"?a:b.state==="selected"?l:g(b.categoryKey),n.beginPath(),n.arc(r(b.x),s(b.y),d,0,Math.PI*2),n.fill();n.globalAlpha=1}}drawMinimapRect(){let e=this.miniCanvas,t=this.miniBase,n=this.miniTf;if(!e||!t||!n)return;let r=e.getContext("2d");if(!r)return;r.clearRect(0,0,e.width,e.height),r.drawImage(t,0,0);let s=this.host.controller.getViewport();if(!s||ed(s.visible,s.bounds))return;let o=Jc(s.visible,n,e.width,e.height,Math.max(2,n.dpr*2)),a=this.host.cssVar("--sl-text")||"#12151c",l=this.host.cssVar("--sl-surface")||"#fff";r.save(),r.globalAlpha=.1,r.fillStyle=a,r.fillRect(o.raw.x,o.raw.y,o.raw.width,o.raw.height),r.globalAlpha=.9,r.lineJoin="round",r.lineWidth=Math.max(4,n.dpr*3.25),r.strokeStyle=l,r.strokeRect(o.raw.x,o.raw.y,o.raw.width,o.raw.height),r.globalAlpha=1,r.lineWidth=Math.max(2,n.dpr*1.75),r.strokeStyle=a,r.strokeRect(o.raw.x,o.raw.y,o.raw.width,o.raw.height),o.clipped&&Object.values(o.clippedEdges).some(Boolean)&&(r.setLineDash([Math.max(3,n.dpr*3),Math.max(2,n.dpr*2)]),r.strokeRect(o.clipped.x,o.clipped.y,o.clipped.width,o.clipped.height)),r.restore()}minimapWorldPoint(e){let t=this.miniCanvas,n=this.miniTf;if(!t||!n)return null;let r=t.getBoundingClientRect(),s=(e.clientX-r.left)*(t.width/Math.max(1,r.width)),o=(e.clientY-r.top)*(t.height/Math.max(1,r.height));return{...Zc({x:s,y:o},n),px:s,py:o}}minimapPointerDown(e){let t=this.minimapWorldPoint(e),n=this.host.controller.getViewport()?.visible;!t||!n||!(t.x>=n.x&&t.x<=n.x+n.width&&t.y>=n.y&&t.y<=n.y+n.height)||(this.miniDrag={pointerId:e.pointerId,offsetX:t.x-(n.x+n.width/2),offsetY:t.y-(n.y+n.height/2),startX:e.clientX,startY:e.clientY,moved:!1},this.miniCanvas?.setPointerCapture(e.pointerId),this.miniCanvas?.classList.add("sl-dragging"),e.preventDefault())}minimapPointerMove(e){let t=this.miniDrag;if(!t||t.pointerId!==e.pointerId)return;let n=this.minimapWorldPoint(e);n&&(!t.moved&&Math.hypot(e.clientX-t.startX,e.clientY-t.startY)>2&&(t.moved=!0,this.host.controller.clearSectionFocus()),this.host.controller.panToWorld({x:n.x-t.offsetX,y:n.y-t.offsetY}),e.preventDefault())}minimapPointerUp(e){let t=this.miniDrag;!t||t.pointerId!==e.pointerId||(this.miniSuppressClick=t.moved,this.miniDrag=null,this.miniCanvas?.classList.remove("sl-dragging"),this.miniCanvas?.hasPointerCapture(e.pointerId)&&this.miniCanvas.releasePointerCapture(e.pointerId))}minimapKeydown(e){let t=this.host.controller.getViewport()?.visible;if(!t)return;if(e.key==="Home"){this.host.controller.overview(),e.preventDefault();return}let n=e.key==="ArrowLeft"?-t.width*.2:e.key==="ArrowRight"?t.width*.2:0,r=e.key==="ArrowUp"?-t.height*.2:e.key==="ArrowDown"?t.height*.2:0;!n&&!r||(this.host.controller.clearSectionFocus(),this.host.controller.panToWorld({x:t.x+t.width/2+n,y:t.y+t.height/2+r}),e.preventDefault())}minimapJump(e){let t=this.minimapWorldPoint(e);if(t){for(let n of this.host.controller.getMinimapSnapshot().sections)if(!(n.state==="inactive"||n.outline.length<3)&&Xc(t,n.outline)){this.host.controller.focusSection(n.id);return}this.host.controller.clearSectionFocus(),this.host.controller.panToWorld(t)}}};import{t as un}from"@seatlayer/core";var td=12;function Fs(i,e){let t=e.floors(),n=new Set(t.map(k=>k.label.trim().toLocaleLowerCase())),r=e.zones().filter(k=>k.seatCount>0&&!n.has(k.label.trim().toLocaleLowerCase())),s=e.sections().filter(k=>k.seatCount>0&&!n.has(k.label.trim().toLocaleLowerCase())),o=r.length>1?[]:s,a=t.length>1,l=r.length>1,c=o.length>1;if(!a&&!l&&!c)return null;let p=document.createElement("div");p.className="sl-view3d-nav";let d=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>',g=document.createElement("span");u.innerHTML=h,u.appendChild(g);let b=()=>{for(let k of p.querySelectorAll(":scope > div")){let M=k.querySelector('[aria-pressed="true"]');!M||k.scrollWidth<=k.clientWidth||M.scrollIntoView({block:"nearest",inline:"nearest"})}},w=()=>{if(d)return d;for(let k of p.querySelectorAll(":scope > div")){let M=k.querySelector('button[aria-pressed="true"]'),L=M?.textContent?.trim();if(L&&M?.dataset.floor!=="")return L}return a&&(l||c)?v("picker.levelsAndAreas","Levels & areas"):a?v("picker.levels","Levels"):v("picker.areas","Areas")},x=k=>{p.classList.toggle("is-open",k),u.setAttribute("aria-expanded",String(k)),k&&typeof requestAnimationFrame=="function"&&requestAnimationFrame(b),g.textContent=w()};u.addEventListener("click",()=>x(!p.classList.contains("is-open"))),p.addEventListener("keydown",k=>{k.key!=="Escape"||!p.classList.contains("is-open")||(k.preventDefault(),k.stopPropagation(),x(!1),u.focus())});let y=document.createElement("button");y.type="button",y.className="sl-view3d-nav-close",y.innerHTML='<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M18 6L6 18M6 6l12 12"/></svg>';let m=v("picker.closeVenueNavigation","Close venue navigation");y.setAttribute("aria-label",m),y.title=m,y.addEventListener("click",()=>{x(!1),u.focus()}),x(!1),p.appendChild(u);let A=k=>{},_=k=>{};if(a){let k=document.createElement("div");k.setAttribute("role","group"),k.setAttribute("aria-label",v("picker.levels","Levels"));let M=[];_=D=>{M.forEach(R=>{R.setAttribute("aria-pressed",String((R.dataset.floor===""?null:Number(R.dataset.floor))===D))})};let L=D=>{e.focusFloor(D)&&(_(D),A(D))},C=(D,R)=>{let N=document.createElement("button");N.type="button",N.textContent=D,N.dataset.floor=R===null?"":String(R),N.setAttribute("aria-pressed",String(R===null)),N.addEventListener("click",()=>{L(R),x(!1)}),M.push(N),k.appendChild(N)};C(v("picker.allLevels","All levels"),null);for(let D of t)C(D.label||un("picker.levelNumber",{number:D.index+1}),D.index);p.appendChild(k)}if(l||c){let k=document.createElement("div");k.setAttribute("role","group"),k.setAttribute("aria-label",v("picker.areas","Areas"));let M=l?r.map(C=>({id:C.id,label:C.label||C.id,go:()=>{e.focusZone(C.id)}})):o.map(C=>({id:C.id,label:C.label||C.id,floorIndex:C.floorIndex,go:()=>{e.focusSection(C.id),Number.isFinite(C.floorIndex)&&_(C.floorIndex)}})),L=C=>{let D=l||C===null?M:M.filter(R=>R.floorIndex===void 0||R.floorIndex===C);if(k.replaceChildren(),!D.length){k.remove();return}if(k.isConnected||p.insertBefore(k,y.isConnected?y:null),!l&&D.length>td){let R=document.createElement("select");R.setAttribute("aria-label",v("picker.jumpToSection","Jump to section"));let N=document.createElement("option");N.value="",N.textContent=v("picker.jumpToSection","Jump to section"),R.appendChild(N);for(let te of D){let j=document.createElement("option");j.value=te.id,j.textContent=te.label,R.appendChild(j)}R.addEventListener("change",()=>{D.find(te=>te.id===R.value)?.go()}),k.appendChild(R);return}for(let R of D){let N=document.createElement("button");N.type="button",N.textContent=R.label,N.dataset.area=R.id,N.addEventListener("click",()=>{d=R.label,R.go(),x(!1)}),k.appendChild(N)}};A=L,L(null)}return p.appendChild(y),i.appendChild(p),p}var bi=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",v("picker.savedSeatComparison","Saved seat comparison"));let s=document.createElement("button");s.type="button",s.className="main",s.addEventListener("click",()=>{this.host.savedSeatIds().length>1?this.host.openComparison():this.host.toast(v("picker.chooseAnotherToCompare","Choose another seat to compare."),"neutral")});let o=document.createElement("button");o.type="button",o.className="clear",o.textContent="\xD7",o.setAttribute("aria-label",v("picker.clearSavedSeatComparison","Clear saved seat comparison")),o.addEventListener("click",()=>this.host.clearComparison()),t.append(s,o),e.appendChild(t),this.chip=t}let n=this.host.savedSeatIds().length,r=t.querySelector(".main");r&&(r.textContent=n>1?un("picker.compareCount",{count:n}):v("picker.oneSeatSaved","1 seat saved"),r.setAttribute("aria-label",n>1?un("picker.openComparisonOfSeats",{count:n}):v("picker.oneSeatSavedChooseAnother","One seat saved; choose another to compare")))}remove(){this.chip?.remove(),this.chip=null}mainButton(){return this.chip?.querySelector(".main")??null}};function Vs(i){return!i?.querySelector('[data-ref="zfs"]')}var $s="sl:sheet-hint";function zs(i){let e=i.boot;if(!e?.isConnected)return;if(i.reducedMotion){e.remove();return}e.classList.add("is-going"),setTimeout(()=>e.remove(),200);let t=document.createElement("div");t.className="sl-shells-in",t.setAttribute("aria-hidden","true"),i.map?.appendChild(t),setTimeout(()=>t.remove(),650),i.rail?.classList.add("is-in"),i.root?.classList.add("is-arriving"),setTimeout(()=>{i.rail?.classList.remove("is-in"),i.root?.classList.remove("is-arriving"),id(i.root)},900)}function id(i){if(!i||i.dataset.layout!=="narrow")return;try{if(window.sessionStorage.getItem($s))return;window.sessionStorage.setItem($s,"1")}catch{}let e=i.querySelector(".sl-sheet-grab");e&&(e.classList.add("sl-mo-hint"),e.addEventListener("animationend",()=>e.classList.remove("sl-mo-hint"),{once:!0}))}function js(i,e){i.addEventListener("keydown",t=>{if(t.key==="Escape"){for(let n of e())if(n.open()){t.preventDefault(),t.stopPropagation(),n.close();return}}})}function vi(i){let e=i.committedSelection(),t=i.controller.getGAAreas(),n=i.hold?.items??[],r=new Set(n.map(u=>u.label)),s=nr(i,t,n),o=Le(i.gaQty,n),a=n.reduce((u,h)=>u+i.paidPrice(h.categoryKey,h.tierId,h.unitPrice,h.label)*(h.quantity??1),0),l=n.reduce((u,h)=>u+(h.quantity??1),0),c=e.filter(u=>!r.has(u.label)),p=c.reduce((u,h)=>u+i.paidPrice(h.categoryKey,h.tierId??null,h.price,h.label)*(h.quantity??1),0)+s+a,d=c.reduce((u,h)=>u+(h.quantity??1),0)+o+l;return{seats:e,freshSeats:c,gaAreas:t,heldItems:n,heldLabels:r,heldCount:l,total:p,count:d}}function yi(i,e){let t=e.tiers?.length?e.tiers[0].price:e.price;return t===void 0||!e.key?t:i.paidPrice(e.key,e.tiers?.[0]?.id??null,t)}function wi(i,e){let t=e.tiers?.length?e.tiers.map(n=>i.paidPrice(e.key,n.id??null,n.price)):e.price==null?[]:[i.paidPrice(e.key,null,e.price)];if(e.key)for(let n of i.pricesByChannel.values())for(let r of n)r.categoryKey===e.key&&t.push(r.price);return t.length?{min:Math.min(...t),max:Math.max(...t)}:void 0}var Pt="seatlayer_";function nd(){let i=globalThis;return i.document?.modelContext??i.navigator?.modelContext??null}function re(i,e){return e?{ok:!1,reason:i,message:e}:{ok:!1,reason:i}}function rd(i){return Array.isArray(i)?i.filter(e=>typeof e=="string"&&!!e):[]}function sd(i,e){let t=i.event();if(!t)return re("not_loaded","The seat map has not finished loading.");let n=i.selectionLimits();return{ok:!0,event:t,selection:{max:n.max,...n.required!=null?{required:n.required}:{}},categories:i.categories(),zones:i.zones(),hasPremiumSeats:i.hasPremiumSeats(),holdsAllowed:e}}function Gs(i,e){let t=r=>!!r&&r.toLowerCase()===e.toLowerCase(),n=i.find(r=>t(r.key??r.id))??i.find(r=>t(r.label));return n?.key??n?.id??null}function qs(i,e){let t=e.map(n=>i.describeSeat(n.id));return{seatIds:e.map(n=>n.id),labels:e.map(n=>n.label),section:t[0]?.section??"",row:t[0]?.row??"",seats:e.map((n,r)=>t[r]?.seat||n.label),category:t[0]?.category??e[0].categoryKey,unitPrice:e[0].price,total:e.reduce((n,r)=>n+r.price,0)}}function od(i,e,t){let n=new Map;for(let s of e){let o=n.get(s.rowKey);o?o.push(s):n.set(s.rowKey,[s])}let r=[];for(let s of n.values()){let o=[...s].sort((l,c)=>l.index-c.index),a=0;for(let l=1;l<=o.length;l++)if(l===o.length||o[l].index!==o[l-1].index+1||o[l].categoryKey!==o[l-1].categoryKey){for(let p=a;p+t<=l;p+=t)r.push(qs(i,o.slice(p,p+t)));a=l}}return r}function ad(i,e,t){let n=new Map;for(let s of e){let o=n.get(s.sectionKey);o?o.push(s):n.set(s.sectionKey,[s])}let r=[];for(let s of n.values()){if(s.length<t)continue;let o=[...s].sort((a,l)=>a.price!==l.price?l.price-a.price:a.rowKey.localeCompare(l.rowKey)||a.index-l.index);r.push(qs(i,o.slice(0,t)))}return r}function ld(i,e){if(!i.event())return re("not_loaded","The seat map has not finished loading.");let n=i.selectionLimits(),r=Math.floor(Number(e.count));if(!Number.isInteger(r)||r<1||r>n.max)return re("bad_count",`count must be a whole number between 1 and ${n.max}.`);let s=Number.isInteger(Number(e.limit))?Math.max(1,Math.min(20,Number(e.limit))):5,o=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,p=l?Gs(i.categories(),l):null;if(l&&!p)return re("no_match",`No ticket type called "${l}".`);let d=c?Gs(i.zones(),c):null;if(c&&!d)return re("no_match",`No zone called "${c}".`);let u=i.seats().filter(b=>b.available);if(!u.length)return re("sold_out");let h=u.filter(b=>(!p||b.categoryKey===p)&&(!d||b.zoneId===d)&&(a==null||b.price<=a));if(!h.length)return re("no_match");let g=o?od(i,h,r):ad(i,h,r);return g.length?(g.sort((b,w)=>w.unitPrice!==b.unitPrice?w.unitPrice-b.unitPrice:b.row.localeCompare(w.row)||b.labels[0].localeCompare(w.labels[0])),{ok:!0,groups:g.slice(0,s),searched:{count:r,filters:{...a!=null?{max_price:a}:{},...p?{category:p}:{},...d?{zone:d}:{},together:o}}}):re(o?"not_enough_together":"no_match")}function Us(i){return{ok:!0,...i.selection()}}function cd(i,e){let t=i.event();if(!t)return re("not_loaded","The seat map has not finished loading.");if(t.salesClosed)return re("event_closed","Sales are closed for this event.");let n=rd(e.seat_ids);return n.length?(i.clearSelection(),i.selectObjects(n),Us(i)):re("nothing_requested","Pass one or more seat ids or labels in seat_ids.")}function dd(i,e){let t=async r=>{try{return await r()}catch(s){return re("error",s instanceof Error?s.message:String(s))}},n=[{name:`${Pt}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(()=>sd(i,e))},{name:`${Pt}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:r=>t(()=>ld(i,r))},{name:`${Pt}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:r=>t(()=>cd(i,r))},{name:`${Pt}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(()=>Us(i))}];return e&&n.push({name:`${Pt}hold_selection`,title:"Reserve the selected seats",description:"Reserve the currently selected seats for this buyer for a limited time, exactly as pressing the checkout button would. Confirm with the buyer before calling this.",inputSchema:{type:"object",properties:{},additionalProperties:!1},annotations:{readOnlyHint:!1,untrustedContentHint:!0},execute:()=>t(()=>i.hold())}),n}async function Ks(i,e={}){let t=nd();if(!t||typeof t.registerTool!="function")return null;let n=new AbortController,r=dd(i,!!e.holds),s=[],o=e.exposedTo?.length?[...new Set(e.exposedTo)]:void 0;try{for(let a of r)await t.registerTool(a,{signal:n.signal,...o?{exposedTo:o}:{}}),s.push(a.name)}catch(a){console.warn("seatmap: WebMCP tools could not be registered",a)}return s.length?{names:s,dispose:()=>{if(n.abort(),typeof t.unregisterTool=="function")for(let a of s)try{t.unregisterTool(a)}catch{}}}:null}async function Ws(i){let e=i.opts.webMcp;if(!e||i.destroyed)return;let t=typeof e=="object"&&!!e.holds,n=typeof e=="object"?e.exposedTo:void 0;try{i.webMcp=await Ks(fn(i,t),{holds:t,exposedTo:n}),i.destroyed&&mn(i)}catch(r){console.warn("seatmap: WebMCP registration failed",r)}}function mn(i){i.webMcp?.dispose(),i.webMcp=null}function fn(i,e){let t=(n,r)=>{if(Number.isInteger(n.logicalSeatIndex))return n.logicalSeatIndex;let s=n.id.lastIndexOf(":"),o=s<0?NaN:Number(n.id.slice(s+1));return Number.isFinite(o)?o:r};return{event:()=>{let n=i.renderInfo;return n?{name:n.eventName??"",venue:n.venue??null,startsAt:n.startsAt??null,timezone:n.timezone??null,currency:i.currency,salesClosed:i.salesClosed}:null},selectionLimits:()=>({max:i.maxTickets,required:i.exactTickets}),categories:()=>{let n=i.controller.categoryAvailability();return(i.controller.doc?.categories??[]).filter(r=>!r.notForSale).map(r=>{let s=wi(i,r),o=yi(i,r);return{key:r.key,label:r.label??r.key,...o===void 0?{}:{price:o},...s&&s.min!==s.max?{priceRange:s}:{},available:n[r.key]??0}})},zones:()=>i.controller.getBestAvailableZones(),hasPremiumSeats:()=>i.controller.hasPremiumSeats(),seats:()=>{let n=i.controller.getActiveFloorId(),r=[];return i.allSeats().forEach((s,o)=>{if(s.floorId&&n&&s.floorId!==n)return;let a=i.controller.getStatus(s.id)??"free",l=i.controller.doc?.categories.find(p=>p.key===s.categoryKey),c=l?.tiers?.length?l.tiers[0].price:l?.price??0;r.push({id:s.id,label:s.label,rowKey:s.logicalRowId??s.rowId,sectionKey:s.sectionId??s.rowId,index:t(s,o),categoryKey:s.categoryKey,price:i.paidPrice(s.categoryKey,l?.tiers?.[0]?.id??null,c,s.label),...s.zoneId?{zoneId:s.zoneId}:{},available:a==="free"&&!l?.notForSale})}),r},describeSeat:n=>{let r=i.controller.seatDetails(n);return r?{section:r.sectionLabel??"",row:G(r)??"",seat:r.seatNumber??r.label,category:r.categoryLabel??r.categoryKey}:null},selection:()=>{let{freshSeats:n,total:r,count:s}=vi(i);return{seats:n.map(o=>({id:o.id,label:o.label,section:o.sectionLabel??"",row:G(o)??"",seat:o.seatNumber??o.label,category:o.categoryKey,price:i.paidPrice(o.categoryKey,o.tierId??null,o.price,o.label)})),count:s,total:r,currency:i.currency,hold:i.hold?{id:i.hold.holdId,expiresAt:i.hold.expiresAt}:null,validity:i.getSelectionValidity()}},clearSelection:()=>i.clearSelection(),selectObjects:n=>{i.selectObjects(n)},hold:()=>e?pd(i):Promise.resolve({ok:!1,reason:"not_allowed"})}}async function pd(i){if(i.salesClosed)return{ok:!1,reason:"event_closed"};if(!i.totalTicketCount())return{ok:!1,reason:"nothing_selected"};let e=i.controller.getSelectionValidity(i.totalTicketCount());return e&&!e.isValid?{ok:!1,reason:"invalid_selection"}:(await i.handleCta(),i.hold?{ok:!0,hold:{id:i.hold.holdId,expiresAt:i.hold.expiresAt}}:{ok:!1,reason:"hold_failed"})}function gn(i){return{renderingTimeMillis:i.ms,performanceProfile:i.performanceProfile,seatCount:i.seatCount,objectCount:i.objectCount,sectionCount:i.sectionCount,view:i.view,eventKey:i.eventKey,chartName:i.chartName,floorCount:i.floorCount,transport:i.transport,load:i.load,metricScope:i.metricScope,operationalTelemetryReporter:"sdk"}}function Ys(i,e){xe({apiBase:i.apiBase,event:i.eventKey,scope:i.metricScope,surface:i.surface,outcome:"success",ms:i.ms,performanceProfile:i.performanceProfile,chartDelivery:i.chartDelivery,seats:i.seatCount,floors:i.floorCount,view:i.view,load:i.load,transport:i.transport}),e("chart_rendered",gn(i))}import{seatConfidenceDisclosure as hd}from"@seatlayer/core/core/seatConfidence";function Y(i){return String(i??"").replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#39;")}function Xs(i){let e=hd(i.seat.confidenceEvidence),t=i.seat.confidenceEvidence,n=e.limitations.length?`<h4>Known limits</h4><ul>${e.limitations.map(c=>`<li>${Y(c)}</li>`).join("")}</ul>`:"",r=e.modeledTarget?`<div><dt>Modeled target</dt><dd>${Y(e.modeledTarget)}</dd></div>`:"",s=t?`<div><dt>Evidence ID</dt><dd>${Y(t.evidenceId)}</dd></div><div><dt>Model version</dt><dd>${Y(t.modelVersion)}</dd></div><div><dt>Event configuration</dt><dd>${Y(t.eventConfigurationId??"Not configuration-specific")}</dd></div><div><dt>Approval</dt><dd>${Y(t.approvedByRole??"No external approval supplied")}</dd></div>`+(t.validUntil?`<div><dt>Valid until</dt><dd>${Y(t.validUntil.slice(0,10))}</dd></div>`:""):"<div><dt>Evidence ID</dt><dd>None supplied</dd></div>",o=Se(i.seat.commercial)||i.restrictionFallback,a=`<div><dt>View restriction</dt><dd>${Y(o)}</dd></div>`+(i.seat.commercial?.note?`<div><dt>Organizer note</dt><dd>${Y(i.seat.commercial.note)}</dd></div>`:""),l=i.canReport?'<button type="button" data-report>Report this view</button><p data-report-status role="status" aria-live="polite"></p>':"";return`<div class="sl-view3d-passport-scrim" aria-hidden="true"></div><section class="sl-view3d-passport" role="dialog" aria-modal="true" aria-labelledby="sl-view3d-passport-title"><header><div><span>Seat confidence passport</span><strong id="sl-view3d-passport-title">${Y(i.title)}</strong></div><button type="button" data-close aria-label="Close seat confidence passport">\xD7</button></header><div class="sl-view3d-passport-summary"><strong>${Y(e.headline)}</strong><span>${Y(e.coverage)} \xB7 ${Y(e.freshness)}</span></div><dl><div><dt>Model status</dt><dd>${Y(e.model)}</dd></div><div><dt>Reality evidence</dt><dd>${Y(e.reality)}</dd></div><div><dt>Source</dt><dd>${Y(e.provenance)}</dd></div>`+a+r+s+`</dl>${n}<p class="sl-view3d-passport-note">This passport describes supplied evidence and known limits. It does not guarantee that every temporary obstruction or real-world condition is knowable before the event build.</p>`+l+"</section>"}function Qs(i){return i?i.closest("[data-report]")?"report":i.closest("[data-close]")||i.classList.contains("sl-view3d-passport-scrim")?"close":null:null}function xi(i,e,t){let n=i?.querySelector("[data-report]"),r=i?.querySelector("[data-report-status]");n&&(n.disabled=e!=="failed",n.textContent=e==="received"?"Report received":"Report this view"),r&&(r.setAttribute("role",e==="failed"?"alert":"status"),r.textContent=e==="sending"?"Sending report\u2026":e==="received"?`Report received. Reference ${t??""}.`:"The report could not be sent. Please try again.")}function bn(i,e,t=null){let n=i.view3dEl;if(!n)return;Lt(i,!1);let r=e.confidenceEvidence,s=i.controller.seatDetails(e.id),o=document.createElement("div");o.className="sl-view3d-passport-shell",o.innerHTML=Xs({seat:e,title:s?.displayLabel??e.displayLabel??e.label,restrictionFallback:i.tf("picker.noAuthoredRestriction","No organizer-authored restriction"),canReport:typeof i.api.reportViewEvidence=="function"});let a=[...new Set([...n.children,...[...i.els.map.children].filter(u=>u!==n)])].filter(u=>u instanceof HTMLElement),l=a.map(u=>({element:u,inert:u.inert,ariaHidden:u.getAttribute("aria-hidden")}));for(let u of a)u.inert=!0,u.setAttribute("aria-hidden","true");n.appendChild(o),n.classList.add("has-passport"),i.view3dPassportEl=o;let c=o.querySelector(".sl-view3d-passport"),p=()=>[...c.querySelectorAll('button:not(:disabled),[href],[tabindex]:not([tabindex="-1"])')],d=u=>{if(u.key==="Escape"){u.preventDefault(),u.stopPropagation(),u.stopImmediatePropagation(),Lt(i);return}if(u.key!=="Tab")return;let h=p();if(!h.length)return;let g=h[0],b=h[h.length-1];u.shiftKey&&document.activeElement===g?(u.preventDefault(),b.focus()):!u.shiftKey&&document.activeElement===b&&(u.preventDefault(),g.focus())};window.addEventListener("keydown",d,!0),i.view3dPassportCleanup=()=>{window.removeEventListener("keydown",d,!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 u=t?.isConnected?t:i.confirmEl?.querySelector(".sl-confirm-confidence")??i.view3dCompareEl?.querySelector("[data-passport-seat]")??null,h=u?.closest(".sl-confirm,.sl-view3d-compare");h?.isConnected&&(h.inert=!1,h.removeAttribute("aria-hidden")),o.remove(),n.classList.remove("has-passport"),i.view3dPassportEl===o&&(i.view3dPassportEl=null);let g=u??i.view3dCompareEl?.querySelector("[data-passport-seat]")??i.confirmEl?.querySelector(".sl-confirm-confidence")??i.view3dCompareChip.mainButton();(t?.isConnected?t:g)?.focus()},o.addEventListener("click",u=>{let h=Qs(u.target instanceof HTMLElement?u.target:null);h==="close"&&Lt(i),h==="report"&&ud(i,e)}),requestAnimationFrame(()=>p()[0]?.focus()),i.emit3dAnalytics("3d_confidence_passport_opened",{seatId:e.id,evidenceId:r?.evidenceId??null,eventConfigurationId:r?.eventConfigurationId??null,modelLevel:r?.modelLevel??"unverified",realityLevel:r?.realityLevel??"none"})}async function ud(i,e){if(i.api.reportViewEvidence){xi(i.view3dPassportEl,"sending");try{let t=await i.api.reportViewEvidence(i.opts.event,{seatId:e.id,evidenceId:e.confidenceEvidence?.evidenceId});i.emit3dAnalytics("3d_confidence_view_reported",{seatId:e.id,evidenceId:e.confidenceEvidence?.evidenceId??null}),xi(i.view3dPassportEl,"received",t.report.id)}catch{xi(i.view3dPassportEl,"failed")}}}function Lt(i,e=!0){let t=i.view3dPassportCleanup;if(i.view3dPassportCleanup=null,!t){i.view3dPassportEl?.remove(),i.view3dPassportEl=null,i.view3dEl?.classList.remove("has-passport");return}e||(document.activeElement instanceof HTMLElement?document.activeElement:null)?.blur(),t(),e||i.root?.focus({preventScroll:!0})}function Zs(i){let e=i.view3dEl;if(!e||i.view3dCompareSeatIds.length<2)return;Ve(i,!1);let t=i.view3dCompareSeatIds.map(h=>i.view3dComparisonSnapshot(h)).filter(h=>!!h);if(t.length<2){i.clearView3dComparison();return}let n=h=>S(h),r=t.some(h=>!!h.price),s=document.createElement("div");s.className="sl-view3d-compare-shell";let o=t.map((h,g)=>`<article><span>Seat ${g===0?"A":"B"}</span><strong>${n(h.label)}</strong><small>Section ${n(h.section)} \xB7 Row ${n(h.row)}</small><dl>`+(r?`<div><dt>Current price</dt><dd>${n(h.price)}</dd></div>`:"")+`<div><dt>Ticket type</dt><dd>${n(h.category)}</dd></div><div><dt>Availability</dt><dd>${n(h.availability)}</dd></div><div><dt>View source</dt><dd>${n(h.viewSource)}</dd></div><div><dt>View restriction</dt><dd>${n(h.limited)}</dd></div><div><dt>Seat confidence</dt><dd>${n(h.confidence.headline)}</dd></div><div><dt>Reality check</dt><dd>${n(h.confidence.reality)}</dd></div><div><dt>Accessibility</dt><dd>${n(h.accessibility)}</dd></div></dl><div class="sl-view3d-compare-actions"><button type="button" data-passport-seat="${n(h.seat.id)}">Passport</button><button type="button" data-view-seat="${n(h.seat.id)}">View seat</button><button type="button" class="select" data-select-seat="${n(h.seat.id)}"${h.selectable?"":" disabled"}>Select seat</button></div></article>`).join("");s.innerHTML=`<div class="sl-view3d-compare-scrim" aria-hidden="true"></div><section class="sl-view3d-compare" role="dialog" aria-modal="true" aria-labelledby="sl-view3d-compare-title"><header><div><span>Seat inspection</span><strong id="sl-view3d-compare-title">Compare disclosed attributes</strong></div><button type="button" data-close aria-label="Close seat comparison">\xD7</button></header><p class="sl-view3d-compare-note">${r?"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">${o}</div></section>`;let a=document.activeElement instanceof HTMLElement?document.activeElement:null,l=[...e.children].filter(h=>h instanceof HTMLElement),c=l.map(h=>({element:h,inert:h.inert,ariaHidden:h.getAttribute("aria-hidden")}));for(let h of l)h.inert=!0,h.setAttribute("aria-hidden","true");e.appendChild(s),e.classList.add("has-comparison"),i.view3dCompareEl=s;let p=s.querySelector(".sl-view3d-compare"),d=()=>[...p.querySelectorAll('button:not(:disabled),[href],[tabindex]:not([tabindex="-1"])')],u=h=>{if(h.key==="Escape"){h.preventDefault(),Ve(i);return}if(h.key!=="Tab")return;let g=d();if(!g.length)return;let b=g[0],w=g[g.length-1];h.shiftKey&&document.activeElement===b?(h.preventDefault(),w.focus()):!h.shiftKey&&document.activeElement===w&&(h.preventDefault(),b.focus())};window.addEventListener("keydown",u),i.view3dCompareCleanup=()=>{window.removeEventListener("keydown",u);for(let h of c)h.element.inert=h.inert,h.ariaHidden===null?h.element.removeAttribute("aria-hidden"):h.element.setAttribute("aria-hidden",h.ariaHidden);s.remove(),e.classList.remove("has-comparison"),i.view3dCompareEl===s&&(i.view3dCompareEl=null),a?.isConnected?a.focus():i.view3dCompareChip.mainButton()?.focus()},s.querySelector("[data-close]")?.addEventListener("click",()=>Ve(i)),s.querySelectorAll("[data-passport-seat]").forEach(h=>h.addEventListener("click",()=>{let g=h.dataset.passportSeat,b=g?i.allSeats().find(w=>w.id===g):void 0;b&&bn(i,b,h)})),s.querySelectorAll("[data-view-seat]").forEach(h=>h.addEventListener("click",()=>{let g=h.dataset.viewSeat;Ve(i,!1),g&&i.view3dHandle?.flyToSeat(g)})),s.querySelectorAll("[data-select-seat]").forEach(h=>h.addEventListener("click",()=>{let g=h.dataset.selectSeat;g&&md(i,g)})),requestAnimationFrame(()=>d()[0]?.focus()),i.emit3dAnalytics("3d_comparison_opened",{seatIds:i.view3dCompareSeatIds.slice()})}function Ve(i,e=!0){let t=i.view3dCompareCleanup;if(i.view3dCompareCleanup=null,!t){i.view3dCompareEl?.remove(),i.view3dCompareEl=null,i.view3dEl?.classList.remove("has-comparison");return}e||(document.activeElement instanceof HTMLElement?document.activeElement:null)?.blur(),t(),e||i.root?.focus({preventScroll:!0})}function md(i,e){if(i.salesClosed){i.toast(i.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}let t=i.allSeats().find(r=>r.id===e);if(!t)return;if(Ve(i,!1),!i.controller.select([e]).length){i.syncSelectionTo3d(),i.toast(i.tf("picker.seatNoLongerAvailable","That seat is no longer available."),"warning");return}i.syncSelectionTo3d(),i.showConfirm(t),i.emit3dAnalytics("3d_comparison_selected",{seatId:e})}import{t as xd}from"@seatlayer/core";import{seatViewDisclosure as Sd}from"@seatlayer/core/view3d/crossfade/panorama";import{t as Js}from"@seatlayer/core";var fd=900,gd=450;function bd(i){switch(i){case"seat":return v("picker.stopYourSeat","Your seat");case"row":return v("picker.stopYourRow","Your row");case"section":return v("picker.stopYourSection","Your section");default:return v("picker.stopWholeVenue","Whole venue")}}function eo(i,e){let t=document.createElement("button");t.type="button",t.className="sl-view3d-recentre sl-mo-rotate-in",t.textContent="\u25CE";let n=v("picker.recentreOnStage","Recentre on the stage");t.setAttribute("aria-label",n),t.title=n,t.addEventListener("click",()=>{e.handle()?.recentreSeatView()});let r=document.createElement("div");r.className="sl-view3d-stop",r.setAttribute("role","status"),r.setAttribute("aria-live","polite"),i.append(t,r);let s=null,o=null;return{onStopChange(a){if(s&&(clearTimeout(s),s=null),o&&(clearTimeout(o),o=null),!a){r.classList.remove("is-shown"),r.textContent="",o=setTimeout(()=>{o=null,i.classList.remove("is-seat-view")},gd);return}i.classList.add("is-seat-view"),r.textContent=bd(a),r.classList.add("is-shown"),s=setTimeout(()=>{s=null,r.classList.remove("is-shown")},fd)},dispose(){s&&(clearTimeout(s),s=null),o&&(clearTimeout(o),o=null),t.remove(),r.remove(),i.classList.remove("is-seat-view")}}}var vd=44,yd=92;function to(i,e,t,n={}){let r=i?.sectionLabel,s=G(i),o=wd(i,e),a=[r,s?Js("picker.rowLabel",{label:s}):null,o?Js("picker.seatLabel",{label:o}):null].filter(Boolean).join(" \xB7 "),l=n.maxChars??(n.narrow?vd:yd);for(let c of[t,n.shortTail??t,null]){let p=[a,c].filter(Boolean).join(" \xB7 ");if(p.length<=l||c==null)return p}return a}function wd(i,e){if(i?.seatNumber)return i.seatNumber;let t=i?.displayLabel??e,n=r=>{!r||!t.startsWith(r)||t.length<=r.length||(t=t.slice(r.length).replace(/^[\s·\-\/_]+/,""))};return n(i?.sectionLabel),n(G(i)),t}import{seatConfidenceDisclosure as kd}from"@seatlayer/core/core/seatConfidence";function io(i,e){i.querySelector(".sl-view3d-unavailable")?.remove();let{tf:t}=e,n=e.status==="held"?{title:t("picker.temporarilyHeld","Temporarily held"),message:t("picker.heldSeatExplanation","Another buyer is holding this seat. It may become available again.")}:e.status==="booked"?{title:t("picker.sold","Sold"),message:t("picker.soldSeatExplanation","This seat has already been booked.")}:{title:t("picker.notForSale","Not for sale"),message:t("picker.notForSaleExplanation","This seat is not included in the current sale.")},r=document.createElement("div");r.className="sl-view3d-unavailable",r.dataset.state=e.visualState,r.setAttribute("role","status"),r.setAttribute("aria-live","polite");let s=document.createElement("span");s.className="sl-view3d-unavailable-eyebrow",s.textContent=e.location;let o=document.createElement("strong");o.textContent=n.title;let a=document.createElement("div");a.className="sl-view3d-unavailable-copy",a.append(s,o);let l=document.createElement("button");l.type="button",l.setAttribute("aria-label",t("picker.closeSeatStatus","Close seat status")),l.textContent="\xD7";let c=document.createElement("p");c.textContent=n.message,r.append(a,l,c),l.addEventListener("click",()=>vn(i)),i.appendChild(r),Ut(r,e.anchor??null)}function vn(i){let e=i?.querySelector(".sl-view3d-unavailable:not([data-leaving])");e&&(e.dataset.leaving="true",Qe(e))}function no(i){return i.buyerView}function ro(i,e,t){if(e==="map"){i.exit3d();return}let n=t?.flyToSeatId;if(i.buyerView==="venue3d"){n?(i.opts.onBuyerViewChange?.({view:"venue3d",seatId:n}),i.view3dHandle?.flyToSeat(n)):t?.resetView&&i.view3dHandle?.focusOverview();return}i.enter3d(n)}function so(i,e){switch(i.controller.getStatus(e.id)){case"held":return"held";case"booked":return"sold";case"not_for_sale":return"dimmed";default:break}return i.priceBandKeys!=null&&!i.priceBandKeys.has(e.categoryKey)||i.controller.accessibilityFilterDims?.(e)||i.limitedViewFilter&&(e.commercial?.restrictedView||e.commercial?.obstructedView)?"dimmed":"available"}function oo(i){if(!i.view3dHandle)return;let e=i.allSeats().map(t=>({seatId:t.id,state:i.seatState3dFor(t)}));i.view3dHandle.setAvailability(e)}function ao(i){i.view3dHandle&&i.view3dHandle.setSelection(i.controller.getSelection().map(e=>e.id))}async function lo(i,e){let t=i.allSeats().find(n=>n.id===e);if(!t)return null;if(t.viewUrl)try{let n=t.viewMeta?.previewUrl,r=!!n&&n!==t.viewUrl,s=r?await i.buyerAssetUrls.resolve(n):null,o=r?t.viewUrl:await i.buyerAssetUrls.resolve(t.viewUrl);return!o||r&&!s?null:{url:o,...s?{previewUrl:s}:{},...r?{resolveUrl:a=>i.buyerAssetUrls.resolve(a)}:{},...t.viewMeta?.sourceWidth!==void 0?{sourceWidth:t.viewMeta.sourceWidth}:{},...t.viewMeta?.sourceHeight!==void 0?{sourceHeight:t.viewMeta.sourceHeight}:{},...t.viewMeta?.previewWidth!==void 0?{previewWidth:t.viewMeta.previewWidth}:{},...t.viewMeta?.previewHeight!==void 0?{previewHeight:t.viewMeta.previewHeight}:{},...t.viewMeta?.variants?.length?{variants:t.viewMeta.variants}:{},...t.viewMeta?.initialBearingDeg!==void 0?{initialBearingDeg:t.viewMeta.initialBearingDeg}:{},...t.viewMeta?.initialPitchDeg!==void 0?{initialPitchDeg:t.viewMeta.initialPitchDeg}:{},...t.viewMeta?.coverage?{coverage:t.viewMeta.coverage}:{},...t.viewMeta?.capturedAt?{capturedAt:t.viewMeta.capturedAt}:{},...t.viewMeta?.sourceLabel?{sourceLabel:t.viewMeta.sourceLabel}:{}}}catch(n){return i.opts.onError?.(n),null}return{url:"",generated:!0,mediaKind:"model",coverage:"exact-seat",sourceLabel:i.tf("picker.chartDerivedModel","Chart-derived model")}}function co(i,e){if(i.salesClosed){i.toast(i.tf("picker.salesClosedToast","Sales are closed for this event."),"warning"),i.syncSelectionTo3d();return}let t=i.allSeats().find(a=>a.id===e);if(!t)return;let n=i.controller.tableSelection(e);if(i.committedSelection().some(a=>n?a.label===n.label:a.id===e)){i.controller.deselect([e]),i.dismissConfirm(),i.syncSelectionTo3d();return}let s=i.controller.getStatus(t.id);if(s==="held"||s==="booked"||s==="not_for_sale"){i.showUnavailable3dSeat(t,i.seatState3dFor(t),s),i.syncSelectionTo3d();return}if(i.dismissUnavailable3dSeat(),!i.controller.select([e]).length){i.syncSelectionTo3d(),i.dismissConfirm();return}if(i.opts.onBuyerViewChange?.({view:"venue3d",seatId:e}),i.flashPickedSeat(e),n){i.showTableDialog(n,!1),i.syncSelectionTo3d();return}i.opts.confirmSelection!==!1?i.showConfirm(t):i.syncTray(),i.syncSelectionTo3d()}function po(i,e){let t=i.allSeats().find(n=>n.id===e);return to(i.controller.seatDetails(e),t?.displayLabel??t?.label??e,i.tf("picker.viewFromYourSeat","view from your seat"),{narrow:i.root?.dataset.layout==="narrow",shortTail:i.tf("picker.fromYourSeat","from your seat")})}function ho(i,e,t,n){let r=i.view3dEl;if(!r)return;let s=i.controller.seatDetails(e.id),o=s?.displayLabel??e.displayLabel??e.label,a=G(s);io(r,{status:n,visualState:t,location:[s?.sectionLabel,a?xd("picker.rowLabel",{label:a}):null,o].filter(Boolean).join(" \xB7 ")||o,tf:(l,c)=>i.tf(l,c)}),i.announceSeat(e)}function uo(i){vn(i.view3dEl)}function mo(i,e){if(i.buyerView!=="venue3d")return;let t=i.view3dCompareSeatIds;t.includes(e.id)||(i.view3dCompareSeatIds=t.length===0?[e.id]:[t[0],e.id]),i.confirmSeat?.id===e.id&&(i.controller.deselect([e.id]),i.dismissConfirm(),i.syncSelectionTo3d(),i.syncTray()),i.view3dCompareChip.sync(),i.emit3dAnalytics("3d_comparison_saved",{seatId:e.id,count:i.view3dCompareSeatIds.length}),i.view3dCompareSeatIds.length>1?i.openView3dComparison():i.toast(i.tf("picker.chooseAnotherToCompare","Seat saved. Choose another seat to compare."),"success")}function fo(i){i.closeView3dComparison(!1),i.view3dCompareSeatIds=[],i.view3dCompareChip.remove(),i.emit3dAnalytics("3d_comparison_cleared")}function go(i,e){let t=i.allSeats().find(h=>h.id===e);if(!t)return null;let n=i.controller.seatDetails(t.id),r=i.controller.doc?.categories.find(h=>h.key===t.categoryKey),s=n?.price??(r?.tiers?.length?r.tiers[0].price:r?.price),o=s!=null?i.paidPrice(t.categoryKey,n?.tierId??r?.tiers?.[0]?.id??null,s,t.label):void 0,a=i.controller.getStatus(t.id),l=a==="held"?i.tf("picker.temporarilyHeld","Temporarily held"):a==="booked"?i.tf("picker.sold","Sold"):a==="not_for_sale"?i.tf("picker.notForSale","Not for sale"):i.tf("picker.available","Available"),c=t.viewUrl?Sd({url:t.viewUrl,...t.viewMeta?.coverage?{coverage:t.viewMeta.coverage}:{},...t.viewMeta?.capturedAt?{capturedAt:t.viewMeta.capturedAt}:{},...t.viewMeta?.sourceLabel?{sourceLabel:t.viewMeta.sourceLabel}:{}}):i.tf("picker.chartDerivedSeatEye","Live 3D \xB7 chart-derived seat-eye \xB7 not surveyed"),p=Se(t.commercial)||i.tf("picker.noAuthoredRestriction","No organizer-authored restriction"),d=n?.wheelchairSpaceType?`${st(n.wheelchairSpaceType)} \xB7 metadata, not access certification`:i.tf("picker.noAccessibilityMetadata","No accessibility metadata supplied"),u=kd(t.confidenceEvidence);return{seat:t,label:n?.displayLabel??t.displayLabel??t.label,section:n?.sectionLabel??t.sectionId??"\u2014",row:G(n)??n?.rowLabel??"\u2014",category:n?.categoryLabel??r?.label??t.categoryKey,price:i.suppressPricing||o==null?"":i.money(o),availability:l,selectable:a==null||a==="free",viewSource:c,limited:p,accessibility:d,confidence:u}}async function bo(i,e){if(i.view3dEl||!i.canOffer3d()||!i.els.map)return;let t=i.controller.doc;if(!t)return;i.buyerView="venue3d",i.view3dTargetSeatId=null,i.opts.onBuyerViewChange?.({view:"venue3d",...e?{seatId:e}:{}}),i.root?.setAttribute("data-view3d","on"),i.dismissConfirm(),i.syncProjection(),i.syncTray();let n=document.createElement("div");n.className="sl-view3d sl-mo-zoom",n.setAttribute("role","group"),n.setAttribute("aria-label",i.tf("picker.interactive3dVenueView","Interactive 3D venue view"));let r=document.createElement("button");r.type="button",r.className="sl-view3d-back",r.innerHTML=`<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M15 18l-6-6 6-6"/></svg><span>${i.tf("picker.backToMap","Back to map")}</span>`;let s=r.querySelector("span"),o=c=>{i.view3dTargetSeatId=c;let p=!!c;n.classList.toggle("is-seat-focused",p),i.root&&(i.root.dataset.view3dSeat=p?"on":"off");let d=p?i.tf("picker.backToVenue","Back to venue"):i.tf("picker.backToMap","Back to map");s&&(s.textContent=d),r.setAttribute("aria-label",d)};if(r.addEventListener("click",()=>{if(i.view3dTargetSeatId&&i.view3dHandle){i.view3dHandle.focusOverview();return}i.exit3d()}),i.regions["top-left"]?.prepend(r),i.view3dBack=r,i.publish3dTopInset(),Vs(i.root)){let c=document.createElement("button");c.type="button",c.className="sl-view3d-fs",c.textContent="\u26F6",c.setAttribute("aria-label",i.tf("picker.fullScreen","Full screen")),c.setAttribute("aria-pressed",String(!!document.fullscreenElement||i.fsFallback||i.framedFs)),c.addEventListener("click",()=>i.toggleFullscreen()),n.appendChild(c)}let a=document.createElement("div");a.className="sl-view3d-loading",a.setAttribute("role","status"),a.setAttribute("aria-live","polite"),a.textContent=i.tf("picker.loading3d","Building the 3D venue\u2026"),n.appendChild(a),i.els.map.appendChild(n),i.view3dEl=n,i.view3dCompareChip.sync(),requestAnimationFrame(()=>{n.style.opacity="1"});let l=++i.view3dGen;try{let c=i.allSeats(),[p,d]=await Promise.all([St(),i.controller.loadEventConfiguration()]),u=d?await Jt(d,y=>i.buyerAssetUrls.resolve(y)):null,h=t.theme?.venue3d?.shellAssetUrl,g=await ei(h,y=>i.buyerAssetUrls.resolve(y));if(l!==i.view3dGen||i.buyerView!=="venue3d"||i.view3dEl!==n)return;let b={doc:t,seats:c,...u?{eventConfigurationId:u.id,eventConfiguration:u}:{},...g?{registeredShellGlb:g}:{}};a.textContent=i.tf("picker.building3d","Building venue geometry\u2026");let w=await p.prepareVenue3D(b);if(l!==i.view3dGen||i.buyerView!=="venue3d"||i.view3dEl!==n)return;let x=p.mountVenue3D(n,{...b,prepared:w},{portraitOverviewCrop:!0,arriveAtSeatEye:!0,lookAroundHint:De(),seatViewActionLabel:y=>i.allSeats().find(m=>m.id===y)?.viewUrl?i.tf("picker.openAuthored360","Open venue 360\xB0"):i.tf("picker.lookAroundLive3d","Look around in live 3D"),seatViewCaption:y=>i.seatViewCaption(y),onSeatViewStopChange:y=>i.view3dSeatViewChrome?.onStopChange(y),onSeatPick:y=>i.onView3dSeatPick(y),onSeatInspect:y=>i.onView3dSeatPick(y),onSectionFocusChange:y=>{let m=n.querySelector('select[data-locator="section"]'),A=y??"";!m||m.value===A||(m.value=A,m.dispatchEvent(new Event("change")))},onViewTargetChange:y=>{n.querySelector(".sl-view3d-nav")?.classList.toggle("is-seat-focused",!!y),o(y),i.opts.onBuyerViewChange?.({view:"venue3d",...y?{seatId:y}:{}})},...i.seatViewEnabled()?{getSeatView:y=>new Promise((m,A)=>{let _=()=>{i.seatViewFor3d(y).then(M=>{M?m(M):A(new Error("seat_view_unavailable"))})},k=globalThis.requestIdleCallback;typeof k=="function"?k(_,{timeout:1500}):setTimeout(_,50)})}:{},onAnalytics:(y,m)=>i.emit3dAnalytics(y,m)});i.view3dHandle=x,i.view3dSeatViewChrome=eo(n,{handle:()=>i.view3dHandle}),requestAnimationFrame(()=>a.remove()),i.pushAvailabilityTo3d(),i.syncSelectionTo3d(),i.view3dNav=Fs(i.regions["bottom-left"]??n,x),e&&x.flyToSeat(e)}catch(c){if(l!==i.view3dGen||i.buyerView!=="venue3d"||i.view3dEl!==n)return;i.opts.onError?.(c),i.toast(i.tf("picker.unavailable3d","3D could not start. The seat map is still available."),"warning"),i.exit3d()}}function vo(i){let e=i.regions["top-left"];if(!i.root||!e)return;let t=()=>{!i.root||i.root.dataset.view3d!=="on"||i.root.style.setProperty("--sl-3d-top-inset",`${Math.max(44,Math.ceil(e.offsetHeight))}px`)};t(),typeof requestAnimationFrame=="function"&&requestAnimationFrame(t)}function yo(i){if(i.buyerView!=="venue3d"&&!i.view3dEl)return;i.view3dGen++,i.buyerView="map",i.view3dTargetSeatId=null,i.opts.onBuyerViewChange?.({view:"map"}),i.root?.removeAttribute("data-view3d"),i.closeSeatConfidencePassport(!1),i.closeView3dComparison(!1),i.view3dCompareChip.remove(),i.view3dSeatViewChrome?.dispose(),i.view3dSeatViewChrome=null,i.view3dBack?.remove(),i.view3dBack=null,i.view3dNav?.remove(),i.view3dNav=null,i.root?.removeAttribute("data-view3d-seat"),i.root?.style.removeProperty("--sl-3d-top-inset");try{i.view3dHandle?.dispose()}catch{}i.view3dHandle=null;let e=i.view3dEl;i.view3dEl=null,e&&(e.style.opacity="0",setTimeout(()=>e.remove(),320)),i.syncProjection(),i.syncTray();let t=i.view3dReturnSeat;i.view3dReturnSeat=null,t&&i.committedSelection().some(n=>n.id===t.id)&&i.opts.confirmSelection!==!1&&i.showConfirm(t)}import{t as Cd}from"@seatlayer/core";import{t as Si}from"@seatlayer/core";function wo(i){return Array.isArray(i)?i.reduce((e,t)=>t.type==="minimumSelectedPlaces"?Math.max(e,t.minimum):e,0):0}function ki(i,e,t=!1){let n=i.violations[0];return n==="numberOfPlacesToSelect"?i.remaining>0?Si("picker.selectExactMore",{count:i.remaining}):Si("picker.selectExactCount",{count:i.required}):n==="minimumSelectedPlaces"?Si("picker.selectMinimumMore",{count:i.remaining}):t?e("picker.adjustSeatSelection","Adjust seat selection"):n==="consecutiveSeats"?e("picker.selectSeatsTogether","Choose seats together in the same row and ticket category."):Si("picker.orphanHint")}import{t as Ti,tCount as xo}from"@seatlayer/core";function Mt(i){let e=Math.max(0,i),t=Math.floor(e/6e4),n=String(Math.floor(e%6e4/1e3)).padStart(2,"0");return`${t}:${n}`}function So(i){let e=i.performanceLabel?`<div class="sl-chip-when">${H(i.performanceLabel)}</div>`:"",t=i.performanceDates?.labels.length?`<div class="sl-chip-dates"><span class="sl-chip-dates-summary">${H(i.performanceDates.summary)}</span><span class="sl-chip-date-list">${i.performanceDates.labels.map(n=>`<span class="sl-chip-date">${H(n)}</span>`).join("")}</span></div>`:"";return e+Ed(i)+t}function Ed(i){let{d:e,area:t,label:n,objectType:r,quantity:s=1,identity:o}=i,a=m=>String(m??"\u2014").replace(/[&<>"]/g,A=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[A]),l=r==="ga"?"ga":e?.objectType??r,c=o?.displayType?.trim()||e?.displayType?.trim()||t?.displayType?.trim()||(l==="table"?v("picker.table","Table"):l==="booth"?v("picker.booth","Booth"):l==="ga"?v("picker.generalAdmission","General admission"):v("picker.row","Row")),p=o?.rowLabel??o?.displayLabel??e?.rowLabel??e?.displayLabel??t?.label??n,d=i.categoryLabel?.trim()??"",u="",h=[];l==="table"&&o?.bookingMode?(u=`${c} ${p}`,h.push([v("picker.guests","Guests"),String(s)])):l==="ga"?(u=String(t?.displayLabel??p),s>1&&h.push([v("picker.tickets","Tickets"),String(s)])):l==="booth"?(u=e?.sectionLabel??`${c} ${p}`,e?.sectionLabel&&h.push([c,String(p)])):!e?.sectionLabel&&!e?.rowLabel&&!e?.seatNumber?u=String(p):(u=e.sectionLabel??"",e.rowLabel&&h.push([c,String(G(e)??e.rowLabel)]),e.seatNumber&&h.push([v("picker.seat","Seat"),String(e.seatNumber)]));let g=!u&&!!d,b=u||d||String(p),w=!!d&&!g&&d!==b,x=h.map(([m,A])=>`<span class="sl-chip-seg" data-fit-seg><span class="w">${a(m)}</span> <b>${a(A)}</b></span>`);w&&x.push(`<span class="sl-chip-seg" data-fit-seg data-fit-type><span class="w">${a(d)}</span></span>`);let y=[b,...h.map(([m,A])=>`${m} ${A}`),w?d:""].filter(Boolean).join(" \xB7 ");return`<div class="sl-chip-id"><span class="sl-sr">${a(y)}</span><span class="sl-chip-name" aria-hidden="true">${a(b)}</span>`+(x.length?`<span class="sl-chip-pos" aria-hidden="true">${x.join("<i>\xB7</i>")}</span>`:"")+"</div>"}function yn(i,e){let t=H(i),n=e?H(e):"";return'<div class="sl-chip-rail">'+(e?`<button type="button" class="view" data-view-label="${n}" aria-label="${H(Ti("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 ko(i){return i.salesClosed||i.hasHold||i.ctaPhase!=="idle"||i.formOpen||i.room<=0?null:Math.max(1,Math.min(i.wanted,i.room))}function To({count:i,total:e,pendingCount:t,ctaPhase:n,hasHold:r,salesClosed:s,suppressPricing:o=!1,fromPrice:a,addMore:l,offerFind:c=!1,holdTime:p,money:d}){if(i&&n==="holding")return`<span>${v("picker.securingSeats","Securing your seats\u2026")}</span>`;if(i&&n==="checkout")return o?`<span>${v("picker.seatsSecuredOpeningCheckout","Seats secured. Opening checkout\u2026")}</span>`:`<span>${Ti("picker.peekSecured",{count:i,total:d(e)})}</span>`;if(i)return`<span class="sl-peek-sum">${xo("picker.ticketsCount",i)}</span>`+(l&&!o?`<button type="button" class="go ghost sl-sheet-go sl-sheet-best" data-act="best" aria-label="${v("picker.findTogetherInstead","Find seats together instead")}"><span aria-hidden="true">\u2726</span>${v("picker.seatsTogether","Seats together")}</button>`:"")+`<button type="button" class="go sl-sheet-go" data-act="checkout">${r&&t?v("picker.secureMore","Secure more"):v("picker.continue","Continue")}`+(o?"":`<span class="sl-peek-total">${d(e)}</span>`)+(r&&p?`<span class="sl-peek-time" aria-hidden="true">${p}</span>`:"")+"</button>";if(s)return`<span>${v("picker.salesClosedPill","Sales are closed")}</span>`;let u=!o&&a!=null?d(a):null;return`<span class="sl-peek-sum">${u!=null?Ti("picker.peekFromPrice",{price:u}).replace(u,`<b class="sl-peek-price">${u}</b>`):v("picker.pickYourSeats","Pick your seats")}</span>`+(c?`<button type="button" class="go sl-sheet-go sl-sheet-find" data-act="find"><span class="sl-peek-spark" aria-hidden="true">\u2726</span>${v("picker.findSeats","Find seats")}</button>`:"")}function Eo(i){return i.confirming?`<div class="sl-ba" role="alert"><div class="sl-ba-title"><span class="spark" aria-hidden="true">\u2726</span>${v("picker.replaceCurrentChoices","Replace your current choices?")}</div><div class="sl-ba-replace"><b>${Ti("picker.willFindSeatsTogether",{count:i.quantity})}</b><span>${v("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>${v("picker.keepMine","Keep mine")}</button><button type="button" class="replace" data-ba-replace>${v("picker.findNewSeats","Find new seats")}</button></div></div>`:`<div class="sl-ba"><div class="sl-ba-title"><span class="spark" aria-hidden="true">\u2726</span>${v("picker.findClosestSeatsTogether","Find the closest seats together")}</div><div class="sl-ba-copy">${v("picker.closestGroupChosenInstantly","Closest available group, chosen instantly.")}</div>`+(i.offerPremium?`<button type="button" class="sl-ba-premium${i.premium?" on":""}" data-ba-premium aria-pressed="${i.premium?"true":"false"}"><span class="star" aria-hidden="true">\u2605</span>${v("picker.bestSeatsPremium","Best seats")}</button>`:"")+`<div class="sl-ba-qty"><button type="button" data-ba="-1" aria-label="${v("picker.fewerSeats","Fewer seats")}">\u2212</button><span>${i.quantity}</span><button type="button" data-ba="1" aria-label="${v("picker.moreSeats","More seats")}">+</button></div>`+(i.categories.length>1?`<select class="sl-ba-cat" aria-label="${H(v("picker.preferredTicketType","Preferred ticket type"))}" data-ba-cat><option value="">${H(v("picker.anyTicketType","Any ticket type"))}</option>`+i.categories.map(e=>`<option value="${H(e.key)}"${i.selectedCategory===e.key?" selected":""}>${H(e.label)}</option>`).join("")+"</select>":'<span class="sl-ba-cat" aria-hidden="true"></span>')+(i.zones.length?`<select class="sl-ba-zone" aria-label="${v("picker.preferredVenueZone","Preferred venue zone")}" data-ba-zone><option value="">${v("picker.anyVenueZone","Any venue zone")}</option>`+i.zones.map(e=>`<option value="${H(e.id)}"${i.selectedZone===e.id?" selected":""}>${H(e.label)}</option>`).join("")+"</select>":"")+`<button type="button" class="sl-ba-go${i.busy?" sl-busy":""}"${i.busy?" disabled":""}>`+(i.busy?`<span class="sl-ba-spin" aria-hidden="true"></span>${v("picker.findingBestSeats","Finding the best seats\u2026")}`:xo("picker.findBestSeatsCount",i.quantity))+"</button>"+(i.reopened?`<button type="button" class="sl-ba-back" data-ba-close>${v("picker.keepMyPicks","Keep my picks")}</button>`:"")+"</div>"}function Co(i){if(i.salesClosed&&!i.hasPicks){let e=i.whenText?`<span class="when">${H(i.whenText)}</span>`:"";return`<div class="sl-closed-note" role="status"><b>${v("picker.salesClosedPill","Sales are closed")}</b><span>${v("picker.salesClosedCopy","Ticket sales for this event have ended.")}${e}</span></div>`}return i.hasPicks?"":i.hasGaAreas?`<div class="sl-tray-hint">${i.seated?i.venue3d?v("picker.trayHintChoose3dOrStanding","Choose a seat in the 3D venue \u2014 or grab standing tickets below."):v("picker.trayHintTapOrStanding","Tap a seat on the map \u2014 or grab standing tickets below."):i.venue3d?v("picker.gaTrayHintChoose3dArea","Choose an area in the 3D venue to select tickets."):v("picker.gaTrayHintTapArea","Tap an area on the map to choose tickets.")}</div>`:`<div class="sl-tray-hint">${i.groupMode==="per_performance"?v("picker.groupPerPerformanceTrayHint","Choose seats for this performance, then complete every date above."):i.groupMode?v("picker.groupTrayHint","Choose seats once \u2014 the same seats will be held for every performance."):i.venue3d?v("picker.trayHintChoose3dOrBest","Choose a seat in the 3D venue, or let us pick the best available for you."):v("picker.trayHintTapOrBest","Tap a seat on the map, or let us pick the best available for you.")}</div>`}var wn=6e4,Ao=5*6e4,Ad=String(Math.round(Ao/6e4));function Po(i){let e=document.createElement("div");e.className="sl-extend",e.dataset.dock="map",e.setAttribute("role","status"),e.innerHTML='<button type="button" class="sl-extend-btn" data-ref="extendBtn"></button><button type="button" class="sl-extend-x" data-ref="extendDismiss" aria-label=""><svg viewBox="0 0 16 16" width="12" height="12" aria-hidden="true" focusable="false"><path d="M3.5 3.5 12.5 12.5M12.5 3.5 3.5 12.5" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg></button>',(i.regions["bottom-center"]??i.els.map).appendChild(e),i.extendEl=e,i.els.extendBtn=e.querySelector('[data-ref="extendBtn"]'),i.els.extendDismiss=e.querySelector('[data-ref="extendDismiss"]'),i.els.extendBtn.textContent=Lo(i),i.els.extendDismiss.setAttribute("aria-label",i.tf("picker.close","Close")),i.els.extendBtn.addEventListener("click",()=>{i.handleExtend()}),i.els.extendDismiss.addEventListener("click",()=>{i.extendDismissed=!0,i.setExtendPrompt(!1,0)})}function Lo(i){return i.tf("picker.addMinutes","+{count} min").replace("{count}",Ad)}function Mo(i){let e=i.hold?.items??[],t=new Set(e.map(r=>r.label));return i.committedSelection().filter(r=>!t.has(r.label)).reduce((r,s)=>r+(s.quantity??1),0)+Le(i.gaQty,i.hold?.items??[])}function Ho(i){return(i.hold?.items??[]).reduce((e,t)=>e+(t.quantity??1),0)}function Ro(i){let e=new Set((i.hold?.items??[]).map(n=>n.label)),t=i.committedSelection().filter(n=>!e.has(n.label)).reduce((n,r)=>n+(r.quantity??1),0);return i.heldTicketCount()+t+Le(i.gaQty,i.hold?.items??[])}function Oo(i){let e=new Set((i.hold?.items??[]).map(r=>r.label)),t=i.committedSelection().filter(r=>e.has(r.label)).reduce((r,s)=>r+(s.quantity??1),0),n=Math.max(0,i.maxTickets-i.heldTicketCount()-Le(i.gaQty,i.hold?.items??[]));i.controller.setMaxSelection(t+n)}function Io(i,e=i.lastTrayCount,t=i.pendingSelectionCount()){let n=i.els.cta;if(!n)return;if(i.salesClosed){n.disabled=!0,n.textContent=i.tf("picker.salesClosedCta","Sales closed");return}if(i.confirmSeat||i.tableDialog&&!i.tableDialogHeld){n.disabled=!0,n.textContent=i.tableDialog?i.tf("picker.confirmYourTable","Confirm your table"):i.tf("picker.confirmOrCancelSeat","Confirm or cancel this seat");return}if(i.ctaPhase==="holding"){n.disabled=!0,n.innerHTML=`<span class="sl-cta-spin" aria-hidden="true"></span>${i.tf("picker.securingSeats","Securing your seats\u2026")}`;return}if(i.ctaPhase==="checkout"){n.disabled=!0,n.innerHTML=`<span class="sl-cta-spin" aria-hidden="true"></span>${i.tf("picker.openingCheckout","Opening secure checkout\u2026")}`;return}let r=!i.hold&&i.performanceGroup?.selectionMode==="per_performance"?i.performanceGroup.submissionState?.():null;if(r&&!r.ready){n.disabled=!0,n.textContent=i.tf("picker.completeAllPerformances","Complete all performances ({complete}/{total})").replace("{complete}",String(r.complete)).replace("{total}",String(r.total));return}let s=i.controller.getSelectionValidity(e);if(s&&!s.isValid){n.disabled=!0,n.textContent=ki(s,(o,a)=>i.tf(o,a),!0);return}n.disabled=e===0,n.textContent=i.hold?t?Cd("picker.secureMoreAndCheckout",{count:t}):i.tf("picker.continueToCheckout","Continue to checkout"):e?i.performanceGroup?i.tf("picker.holdSeatsForAllPerformances","Hold seats for all {count} performances").replace("{count}",String(i.performanceGroup.performanceCount)):i.tf("picker.holdSeatsAndCheckout","Hold seats & checkout"):i.tf("picker.selectSeats","Select seats")}function _o(i,e){i.ctaPhase=e,i.syncCta(),i.renderPeek(i.lastTrayCount,i.lastTrayTotal,i.pendingSelectionCount())}async function Do(i,e,t){i.setCtaPhase("checkout");try{await i.checkoutHandoff(e,t)}finally{i.ctaPhase==="checkout"&&!i.bookedShown&&i.setCtaPhase("idle")}}function Bo(i){return`@seatlayer/hold/v1/${encodeURIComponent(i.apiBase)}/${encodeURIComponent(i.opts.event)}`}function No(i){if(i.opts.initialHoldId)return i.opts.initialHoldId;if(i.opts.restoreHold===!1||typeof window>"u")return null;try{return window.sessionStorage.getItem(i.holdStorageKey())}catch{return null}}function Fo(i,e){if(!(i.opts.restoreHold===!1||typeof window>"u"))try{window.sessionStorage.setItem(i.holdStorageKey(),e.holdId)}catch{}}function Vo(i){if(!(typeof window>"u"))try{window.sessionStorage.removeItem(i.holdStorageKey())}catch{}}async function $o(i,e){try{let t=await i.controller.resumeHold(e);if(!t||i.destroyed)return null;let n={holdId:t.holdId,expiresAt:t.expiresAt,seats:t.seats,items:t.items};return i.hold=n,i.handedOff=!0,i.bookedShown=!1,i.ctaPhase="idle",i.startHoldTimer(n.expiresAt),i.rememberHold(n),i.syncTray(),i.emitHoldChange(),i.opts.onHoldRestored?.(n,n.seats??[],i.buildHandoff(n)),n}catch(t){let n=t?.status;return n===404||n===409?i.forgetHold():i.opts.onError?.(t),null}}async function zo(i){let e=i.rememberedHoldId();e&&await i.resumeHoldFromServer(e)}function jo(i,e){i.stopHoldTimer(),i.holdExpiresAt=e,i.extendDismissed=!1,i.extendUsed=!1,i.hold&&i.rememberHold(i.hold);let t=i.els.hold;t.innerHTML=`<span class="sl-hold-dot" aria-hidden="true"></span><span>${i.tf("picker.held","Held")}</span><span class="sl-hold-time" data-ref="holdTime"></span>`;let n=t.querySelector('[data-ref="holdTime"]'),r=()=>{let s=Math.max(0,i.holdExpiresAt-Date.now());n&&(n.textContent=Mt(s));let o=i.els.peek?.querySelector(".sl-peek-time");o&&(o.textContent=Mt(s)),t.classList.add("on"),t.classList.toggle("is-expiring",s>0&&s<=wn),i.setExtendPrompt(s>0&&s<=wn,s),(s<=0||!i.controller.currentHold())&&i.stopHoldTimer()};i.holdTimer=setInterval(r,500),r()}function Go(i){i.holdTimer&&clearInterval(i.holdTimer),i.holdTimer=null,i.els.hold?.classList.remove("on","is-expiring"),i.root&&delete i.root.dataset.peekClock,i.setExtendPrompt(!1,0)}function qo(i,e,t){if(!i.extendEl)return;let n=e&&t>0&&i.root?.dataset.layout!=="narrow"&&!i.extendDismissed&&!i.extendUsed&&!!i.controller.currentHold()&&!i.bookedShown;i.extendEl.classList.toggle("on",n)}function Uo(i){if(!i.holdTimer)return;let e=Math.max(0,i.holdExpiresAt-Date.now());i.setExtendPrompt(e>0&&e<=wn,e)}async function Ko(i){let e=i.els.extendBtn,t=i.controller.currentHold();if(!(!t||!i.api.extend||i.extendUsed)){e.disabled=!0,e.textContent=i.tf("picker.addingEllipsis","Adding\u2026");try{let n=await i.api.extend(i.controller.key,t.holdId,Ao);if(i.controller.currentHold()?.holdId!==t.holdId)return;i.controller.setHold({holdId:t.holdId,labels:t.labels,expiresAt:n.expiresAt,items:t.items});let r=i.controller.currentHold();if(!r)return;i.hold={holdId:r.holdId,expiresAt:r.expiresAt,seats:r.seats,items:r.items},i.holdExpiresAt=r.expiresAt,i.extendUsed=!0,i.extendEl?.classList.remove("on"),i.rememberHold(i.hold),i.emitHoldChange(),i.toast(i.tf("picker.moreTimeAdded","More time added \u2014 your seats are still held."),"success")}catch(n){if(n?.reason==="extend_limit"){i.extendUsed=!0,i.setExtendPrompt(!1,0);return}i.opts.onError?.(n),i.toast(i.tf("picker.couldNotAddMoreTime","Couldn't add more time \u2014 please head to checkout now."),"warning")}finally{e.disabled=!1,e.textContent=Lo(i)}}}import{t as Zo,tCount as Hd}from"@seatlayer/core";function Wo(i){return i?.previousPrice!=null&&i.previousPrice>i.price?i.previousPrice:null}function Yo(i){return Ld(i)+(i.moreLabel?`<button type="button" class="sl-price-more" aria-expanded="${!i.collapsed}">${i.esc(i.moreLabel)}</button>`:"")+Md(i.status)}function Ld(i){let{esc:e,money:t}=i;return i.categories.map(n=>{let r=i.priceOf(n),s=i.rangeOf(n),o=i.offerOf(n.key),a=Wo(o),l=i.activeKey===n.key;return`<div class="sl-price-row${i.bandKeys!=null&&!i.bandKeys.has(n.key)?" sl-dim":""}${l?" sl-active":""}" data-cat="${e(n.key)}" role="button" tabindex="0" aria-pressed="${l}" title="${e(i.titleFor(n,l))}"><span class="sl-dot" style="--sl-cat-dot:${e(i.colorOf(n))}"></span><span class="sl-price-label">${e(n.label)}`+(o?.offerName?`<small class="sl-price-offer">${e(o.offerName)}</small>`:"")+`</span><span class="sl-price-left">${e(i.leftCount(i.left[n.key]??0))}</span>`+(a!=null?`<span class="sl-price-was">${e(t(a))}</span>`:"")+(s!=null?`<span class="sl-price-amt">${s.min===s.max?e(t(s.min)):`${e(t(s.min))}\u2013${e(t(s.max))}`}</span>`:r!=null?`<span class="sl-price-amt">${e(t(r))}</span>`:"")+"</div>"}).join("")}function Md(i){let e=t=>t.replace(/[&<>"']/g,n=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[n]);return`<div class="sl-status-key" aria-label="${e(i.legend)}"><span class="sl-status-item"><i class="sl-status-icon held" aria-hidden="true"><svg viewBox="0 0 24 24"><rect x="5" y="10" width="14" height="10" rx="2"/><path d="M8 10V7a4 4 0 0 1 8 0v3"/></svg></i>${e(i.held)}</span><span class="sl-status-item"><i class="sl-status-icon sold" aria-hidden="true"><svg viewBox="0 0 24 24"><path d="M7 17L17 7"/></svg></i>${e(i.sold)}</span></div>`}function xn(i){let e=Math.abs(i.scrollLeft),t=e>2,n=e+i.clientWidth<i.scrollWidth-2;return i.dataset.fadeStart=String(t),i.dataset.fadeEnd=String(n),{start:t,end:n}}function Xo(i){let{esc:e,money:t}=i;return`<button type="button" class="sl-rc sl-rc-all" data-rail-all aria-pressed="${i.allActive}" title="${e(i.allWord)}"><span class="sl-rc-t">${e(i.allWord)}</span></button>`+i.categories.map(r=>{let s=i.rangeOf(r),o=i.priceOf(r),a=s?s.min===s.max?t(s.min):`${t(s.min)}+`:o!=null?t(o):null,l=Object.prototype.hasOwnProperty.call(i.left,r.key)&&i.left[r.key]<=0,c=Wo(i.offerOf(r.key)),p=a?`${r.label} \u2014 ${a}${l?` (${i.soldOutWord})`:""}`:r.label;return`<button type="button" class="sl-rc" data-cat="${e(r.key)}" aria-pressed="${i.activeKey===r.key}" aria-label="${e(p)}" title="${e(p)}"${l?" disabled":""}><i class="sl-rc-dot" style="--sl-cat-dot:${e(i.colorOf(r))}"></i>`+(c!=null?`<span class="sl-rc-was">${e(t(c))}</span>`:"")+`<span class="sl-rc-t">${e(a??r.label)}</span></button>`}).join("")}function Qo(i,e){let t=i.map(a=>({key:a.key,range:e.rangeOf(a)})).filter(a=>a.range!=null);if(!t.length)return[];let n=[...new Map(t.map(a=>[`${a.range.min}:${a.range.max}`,a.range])).values()].sort((a,l)=>a.min-l.min||a.max-l.max);if(n.length<=5)return n.map(a=>({id:`p${a.min}-${a.max}`,label:a.min===a.max?e.money(a.min):`${e.money(a.min)}\u2013${e.money(a.max)}`,keys:t.filter(l=>l.range.min===a.min&&l.range.max===a.max).map(l=>l.key),min:a.min,max:a.max}));let r=[...t].sort((a,l)=>a.range.min-l.range.min||a.range.max-l.range.max),s=Math.ceil(r.length/4),o=[];for(let a=0;a<r.length;a+=s){let l=r.slice(a,a+s),c=Math.min(...l.map(d=>d.range.min)),p=Math.max(...l.map(d=>d.range.max));o.push({id:`b${a}`,label:c===p?e.money(c):`${e.money(c)}\u2013${e.money(p)}`,keys:l.map(d=>d.key),min:c,max:p})}return o}function Jo(i){if(i.suppressPricing||!i.els.prices||!i.els.pricesSec)return;let e=Qo(i.controller.doc?.categories??[],i.legendDeps());if(e.length<2)return;let t=document.createElement("select");t.className="sl-price-select",t.setAttribute("aria-label",i.tf("picker.filterAndFocusByPrice","Filter and focus seats by price"));let n=document.createElement("option");n.value="all",n.textContent=i.tf("picker.allPrices","All prices"),t.appendChild(n);for(let r of e){let s=document.createElement("option");s.value=r.id,s.textContent=r.label,t.appendChild(s)}i.els.pricesSec.appendChild(t),i.priceSelect=t,t.addEventListener("change",()=>{i.applyPriceBand(e.find(r=>r.id===t.value)?.keys??null)})}function ea(i,e){if(i.focusedCatKey=null,i.priceBandKeys=e?new Set(e):null,i.priceSelect){let t=e?i.priceSelect.value:"all";i.priceSelect.value!==t&&(i.priceSelect.value=t)}i.controller.setCategoryFilter(e),i.controller.focusCategoryFilter(e),i.pushAvailabilityTo3d(),i.syncFloors(),i.syncRung(),i.minimap?.refreshMinimap(),i.syncPrices(),i.lastSection&&i.showSectionCard(i.lastSection)}function ta(i){return{colorOf:e=>i.controller.getRenderer()?.categoryDisplayColor?.(e.key)??e.color,rangeOf:e=>i.catPriceRange(e),priceOf:e=>i.catPrice(e),offerOf:e=>i.offerPrice(e),money:e=>i.money(e),esc:H}}function ia(i,e,t,n=i.legendDeps()){let r=i.els.railScroll,s=e.length>1;if(i.els.rail?.classList.toggle("has",s),!r)return;r.innerHTML=s?Xo({...n,categories:e,left:t,activeKey:i.focusedCatKey,soldOutWord:i.tf("picker.soldOut","Sold out"),allWord:i.tf("picker.allPrices","All prices"),allActive:!i.focusedCatKey&&!i.priceBandKeys}):"";let o=e.map(a=>a.key).join("|");i.lastRailSignature!==o&&(i.lastRailSignature=o,r.scrollLeft=0),r.querySelectorAll(".sl-rc").forEach(a=>{a.addEventListener("click",()=>{if(a.hasAttribute("data-rail-all")){i.applyPriceBand(null);return}i.focusCategory(a.dataset.cat??"")})}),i.railEdgesBound||(i.railEdgesBound=!0,r.addEventListener("scroll",()=>xn(r),{passive:!0})),requestAnimationFrame(()=>xn(r))}function na(i){let e=i.controller.doc;if(!e||!i.els.prices)return;let t=i.controller.categoryAvailability(),n=e.categories.filter(d=>!d.notForSale);i.syncSoldout(n,t);let r=i.legendDeps(),s=i.suppressPricing,o=s?{...r,priceOf:()=>{},rangeOf:()=>{},offerOf:()=>null}:r;s&&(i.els.pricesSec?.querySelector("span")?.replaceChildren(i.tf("picker.seatCategories","Seat categories")),i.els.pricesHint?.remove()),i.syncPriceRail(n,t,o);let a=5,l=n.length-a,c=l>1&&!i.pricesExpanded,p=c?n.slice(0,a):n;i.els.prices.classList.toggle("sl-expanded",l>1&&i.pricesExpanded),i.els.prices.innerHTML=Yo({...o,categories:p,left:t,collapsed:c,activeKey:i.focusedCatKey,bandKeys:i.priceBandKeys,leftCount:d=>Hd("picker.leftCount",d),titleFor:(d,u)=>u?i.tf("picker.showAllSeats","Show all seats"):Zo("picker.showLabelSeatsOnMap",{label:d.label}),moreLabel:l>1?c?s?i.tf("picker.showAllCategories","Show all categories"):Zo("picker.showAllTicketTypes",{count:n.length}):i.tf("picker.showFewer","Show fewer"):null,status:{legend:i.tf("picker.seatStatusLegend","Seat status legend"),held:i.tf("picker.temporarilyHeld","Temporarily held"),sold:i.tf("picker.sold","Sold")}}),i.els.prices.querySelectorAll(".sl-price-row").forEach(d=>{d.addEventListener("mouseenter",()=>i.controller.getRenderer()?.setCategoryHighlight?.(d.dataset.cat??null)),d.addEventListener("mouseleave",()=>i.controller.getRenderer()?.setCategoryHighlight?.(null));let u=()=>i.focusCategory(d.dataset.cat??"");d.addEventListener("click",u),d.addEventListener("keydown",h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),u())})}),i.els.prices.querySelector(".sl-price-more")?.addEventListener("click",()=>{i.pricesExpanded=!i.pricesExpanded,i.syncPrices()})}function ra(i,e){if(!e)return;let t=i.focusedCatKey===e?null:e;i.focusedCatKey=t,i.priceBandKeys=t?new Set([t]):null;let n=i.els.pricesSec?.querySelector(".sl-price-select");n&&(n.value="all"),i.controller.setCategoryFilter(t?[t]:null),i.controller.focusCategoryFilter(t?[t]:null),i.pushAvailabilityTo3d(),i.syncFloors(),i.syncRung(),i.minimap?.refreshMinimap(),i.syncPrices(),i.lastSection&&i.showSectionCard(i.lastSection)}import{t as sa,tCount as oa}from"@seatlayer/core";function se(i,e,t){let n=sa(i,t);return n&&n!==i?n:t?e.replace(/\{(\w+)\}/g,(r,s)=>s in t?String(t[s]):r):e}function Od(i){let e=oa("picker.seatCount",i);return e.includes("picker.seatCount")?`${i} ${i===1?"seat":"seats"}`:e}function Id(i){try{let e=Intl.ListFormat;if(e)return new e(void 0,{style:"long",type:"conjunction"}).format(i)}catch{}return i.join(", ")}function _d(i){if(i.length<2)return!1;let e=[...i].sort((t,n)=>t-n);return new Set(e).size!==e.length?!1:e[e.length-1]-e[0]===e.length-1}function Dd(i){let e=i.filter(r=>r.objectType==="ga"),t=i.filter(r=>r.objectType!=="ga"),n=[];if(t.length){let r=Od(t.length),s=[...new Set(t.map(l=>l.sectionLabel).filter(Boolean))],o=[...new Set(t.map(l=>l.rowLabel).filter(Boolean))],a=t.map(l=>Number(l.seatNumber)).filter(l=>Number.isFinite(l));if(s.length===1&&o.length===1&&a.length===t.length){let l=t.length===1?se("picker.releasedSeatPlace","Section {section}, Row {row}, Seat {seat}",{section:s[0],row:o[0],seat:String(t[0].seatNumber??"")}):_d(a)?se("picker.releasedSeatRange","Section {section}, Row {row}, Seats {from}\u2013{to}",{section:s[0],row:o[0],from:Math.min(...a),to:Math.max(...a)}):"";n.push(l?se("picker.releasedPair","{first} \xB7 {second}",{first:r,second:l}):se("picker.releasedInSection","{seats} in Section {section}",{seats:r,section:s[0]}))}else s.length===1?n.push(se("picker.releasedInSection","{seats} in Section {section}",{seats:r,section:s[0]})):s.length>1?n.push(se("picker.releasedInSections","{seats} in Sections {sections}",{seats:r,sections:Id(s)})):n.push(r)}for(let r of e)n.push(se("picker.releasedGa","{quantity} \xD7 {area}",{quantity:r.quantity??1,area:r.label}));return n.length?n.reduce((r,s)=>se("picker.releasedPair","{first} \xB7 {second}",{first:r,second:s})):""}function aa(i){if(!i)return[];let e=new Map((i.seats??[]).map(r=>[r.label,r])),t=i.items??[];return(t.length?t.map(r=>({label:r.label,objectType:r.objectType,quantity:r.quantity})):[...e.keys()].map(r=>({label:r}))).map(r=>{let s=e.get(r.label);return{label:r.label,...r.objectType?{objectType:r.objectType}:{},...r.quantity==null?{}:{quantity:r.quantity},...s?.sectionLabel?{sectionLabel:s.sectionLabel}:{},...s?.rowLabel?{rowLabel:G(s)??s.rowLabel}:{},...s?.seatNumber?{seatNumber:s.seatNumber}:{}}})}function la(i,e){if(!i.reducedMotion)for(let t of e.slice(0,10)){if(t.objectType==="ga")continue;let n=i.seatByLabel(t.label);!n||i.statusOf(n.id)!=="free"||i.flash(n.id,i.accent)}}function ca(i,e){if(!e.recoverable.length||!i.isConnected)return;let t=i.querySelector(".sl-hold-expired-next");t&&(e.taken.length?t.textContent=e.taken.slice(0,3).map(o=>sa("picker.seatJustTakenByAnother",{label:o})).join(" "):t.remove());let n=i.querySelector(".sl-interrupt-actions"),r=n?.querySelector(".sl-interrupt-act");if(!n||!r)return;r.classList.add("sl-interrupt-act-secondary");let s=document.createElement("button");s.type="button",s.className="sl-interrupt-act sl-hold-expired-recover",s.textContent=oa("picker.holdLapsedSelectAgain",e.recoverable.length),s.addEventListener("click",()=>e.onRecover([...e.recoverable])),n.insertBefore(s,r),i.classList.add("has-recovery"),s.focus()}function da(i,e=[]){let t=document.createElement("div");t.className="sl-interrupt sl-hold-expired sl-mo-scrim",t.setAttribute("role","alertdialog"),t.setAttribute("aria-modal","true");let n=document.createElement("div");n.className="sl-interrupt-card sl-mo-in";let r=document.createElement("div");r.className="sl-interrupt-title",r.id="sl-hold-expired-title";let s=document.createElement("span");s.className="sl-interrupt-glyph",s.setAttribute("aria-hidden","true"),s.textContent="\u23F1";let o=document.createElement("span");o.textContent=se("picker.holdExpiredTitle","Your seats were released"),r.append(s,o);let a=document.createElement("div");a.className="sl-interrupt-body",a.id="sl-hold-expired-body",a.textContent=se("picker.holdExpiredBody","Your hold time ran out and the seats went back on sale."),n.append(r,a);let l=Dd(e);if(l){let u=document.createElement("div");u.className="sl-interrupt-body sl-interrupt-fact sl-hold-expired-seats",u.textContent=l,n.appendChild(u)}let c=document.createElement("div");c.className="sl-interrupt-body sl-hold-expired-next",c.textContent=se("picker.holdExpiredPickAgain","Pick your seats again to continue \u2014 they may already be taken."),n.appendChild(c),t.setAttribute("aria-labelledby",r.id),t.setAttribute("aria-describedby",a.id);let p=document.createElement("div");p.className="sl-interrupt-actions";let d=document.createElement("button");return d.type="button",d.className="sl-interrupt-act sl-hold-expired-restart",d.textContent=se("picker.holdExpiredRestart","Choose seats again"),d.addEventListener("click",()=>i.restart()),p.appendChild(d),n.appendChild(p),t.appendChild(n),t.addEventListener("pointerdown",u=>{u.target===t&&i.restart()}),t}import{t as kn,tCount as Bd}from"@seatlayer/core";var Sn=4,Nd=6;function Fd(i){let e=i.trim();return/^[0-9]{1,4}$/.test(e)?Number(e):null}function pa(i){return[i.held?"h":"s",i.section,i.rowLabel,i.categoryLabel,i.amountText].join(" ")}function Vd(i){if(i.length===1)return i[0];let e=i.map(Fd);if(e.every(n=>n!==null)){let n=[...e].sort((o,a)=>o-a);if(n.every((o,a)=>a===0||o===n[a-1]+1))return`${n[0]}\u2013${n[n.length-1]}`;let s=n.slice(0,3).join(", ");return n.length>3?`${s} +${n.length-3}`:s}let t=i.slice(0,3).join(", ");return i.length>3?`${t} +${i.length-3}`:t}function $d(i){let e=[];for(let t of i){let n=e[e.length-1];!!n&&t.groupable&&n.members[0].groupable&&pa(n.members[0])===pa(t)?n.members.push(t):e.push({members:[t],seatsLabel:""})}for(let t of e)t.seatsLabel=Vd(t.members.map(n=>n.seatLabel));return e}function ua(i,e,t,n){let r=H;return` data-key="${r(i)}"`+(t.length?` data-held="${r(encodeURIComponent(t.join(`
2808
+ `)))}"`:"")+(e.length?` data-seat="${r(e.join(" "))}"`:"")+(n?` data-locate="${r(n)}"`:"")}function ma(i){let e=H;return`<div class="sl-chip${i.held?" sl-held":""}${i.fresh?" sl-enter":""}"`+ua(i.key,i.seatIds,i.heldLabels,i.locateId)+">"+(i.held?i.stateHtml:`<span class="sl-chip-dot" style="background:${S(i.categoryColor)}" aria-hidden="true"></span>`)+`<div class="sl-chip-main">${i.identityHtml}`+(i.extrasHtml?`<div class="sl-chip-sub">${i.extrasHtml}</div>`:"")+`${i.noteHtml}</div>`+(i.amountText?`<span class="amt">${e(i.amountText)}</span>`:"")+i.railHtml+"</div>"}function ha(i,e,t,n,r){let s=H,o=e?.members.length??1,a=o>1,l=e?e.seatsLabel:i.seatLabel,c=e?e.members.reduce((u,h)=>u+h.amount,0):i.amount,p=e?e.members.flatMap(u=>u.seatIds):i.seatIds,d=e?e.members.flatMap(u=>u.heldLabels):i.heldLabels;return`<div class="sl-chip sl-tline${i.held?" sl-held":""}${i.fresh?" sl-enter":""}${e?"":" sl-tsub"}"${n?' data-overflow="true"':""}`+(e?` data-run="${t}"`:` data-run-of="${t}"`)+ua(i.key,p,d,i.locateId)+">"+(a?`<button type="button" class="sl-trun-toggle" aria-expanded="false" aria-label="${s(Bd("picker.seatsSelectedCount",o))}"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M9 6l6 6-6 6"/></svg></button>`:i.held?i.stateHtml:`<span class="sl-tline-dot" style="background:${S(i.categoryColor)}" aria-hidden="true"></span>`)+`<span class="sl-sr">${s(i.categoryLabel)}</span><span class="sl-tline-id"><b>${s(i.section||i.seatLabel)}</b>`+(i.rowLabel?`<i>\xB7</i><span>${s(i.rowLabel)}</span>`:"")+(i.section&&l?`<i>\xB7</i><span>${s(l)}</span>`:"")+"</span>"+i.extrasHtml+(r.suppressPricing||!i.amountText?"":(a?`<span class="sl-tline-mult">${o}\xD7</span>`:"")+`<span class="amt">${s(r.money(c))}</span>`)+(i.railHtml?`<button type="button" class="rm" aria-label="${s(a?kn("picker.removeSeatLabel",{label:[i.section,i.rowLabel,l].filter(Boolean).join(" \xB7 ")}):i.removeAria)}"><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 fa(i,e){if(!i.length)return"";let t=$d(i),n=[v("picker.section","Section"),v("picker.row","Row"),v("picker.seat","Seat")].join(" \xB7 "),r=t.length>=Nd,s=t.map((a,l)=>{let c=r&&l>=Sn;return ha(a.members[0],a,l,c,e)+(a.members.length>1?a.members.map(p=>ha(p,null,l,c,e)).join(""):"")}).join(""),o=r?`<button type="button" class="sl-tmore" data-tmore aria-expanded="false" data-more="${H(kn("picker.moreCount",{count:t.length-Sn}))}" data-less="${H(v("picker.showLess","Show less"))}"><span>${H(kn("picker.moreCount",{count:t.length-Sn}))}</span><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M6 9l6 6 6-6"/></svg></button>`:"";return`<div class="sl-tlist"${r?' data-collapsed="true"':""}><div class="sl-tlist-head sl-sr">${H(n)}</div>${s}${o}</div>`}function ga(i){i.dataset.denseWired!=="true"&&(i.dataset.denseWired="true",i.addEventListener("click",e=>{let t=e.target,n=t.closest("[data-tmore]");if(n){let l=n.closest(".sl-tlist"),c=l?.getAttribute("data-collapsed")==="true";l?.setAttribute("data-collapsed",c?"false":"true"),n.setAttribute("aria-expanded",c?"true":"false");let p=n.querySelector("span");p&&(p.textContent=(c?n.dataset.less:n.dataset.more)??p.textContent);return}let r=t.closest(".sl-trun-toggle");if(!r)return;e.stopPropagation();let s=r.closest(".sl-tline"),o=s?.dataset.run;if(!s||o===void 0)return;let a=r.getAttribute("aria-expanded")!=="true";r.setAttribute("aria-expanded",a?"true":"false"),s.setAttribute("data-open",a?"true":"false"),s.parentElement?.querySelectorAll(`.sl-tsub[data-run-of="${o}"]`).forEach(l=>l.setAttribute("data-open",a?"true":"false"))}))}import{ACCESSIBILITY_TYPES as Tn,t as ba}from"@seatlayer/core";var zd='<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>',jd='<svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="12" r="8.4"/><circle cx="8.6" cy="10.2" r="1.15"/><circle cx="12" cy="8.2" r="1.15"/><circle cx="15.4" cy="10.2" r="1.15"/><path d="M12 20.4a2.6 2.6 0 0 1 0-5.2 2.2 2.2 0 0 0 0-4.4"/></svg>',Ei=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 n=this.offered().length>0;this.button.setAttribute("aria-label",n?t.tf("picker.accessibilityOptions","Accessibility and colour options"):t.tf("picker.displayOptions","Display options")),this.button.innerHTML=n?zd:jd,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=ls(this.rows()),this.root.append(this.menu,this.button),e.appendChild(this.root),this.button.addEventListener("click",r=>{r.stopPropagation(),this.open(this.menu.hidden)}),this.menu.addEventListener("pointerdown",r=>r.stopPropagation()),this.menu.addEventListener("click",r=>r.stopPropagation()),this.dismiss=()=>this.open(!1),this.escape=r=>{r.key==="Escape"&&this.open(!1)},document.addEventListener("pointerdown",this.dismiss),document.addEventListener("keydown",this.escape),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:n,count:r})=>[n,r])),t=!1;for(let n of this.menu.querySelectorAll("[data-a11y-row]")){let r=n.dataset.a11yRow??"";if(!r.startsWith("a11y:"))continue;let s=r.slice(5),o=e.get(s);if(o===void 0)continue;let a=this.countNode(n),l=o==null?"":o>0?ba("picker.accessFreeCount",{count:o}):this.deps.tf("picker.accessNoneLeft","None left");a&&(a.textContent=l);let c=o===0;a instanceof HTMLButtonElement&&(a.disabled=c,a.setAttribute("aria-label",this.jumpLabel(s,l))),n.disabled=c,c?n.setAttribute("aria-disabled","true"):n.removeAttribute("aria-disabled"),c&&this.active.delete(s)&&(this.paint(n,!1),t=!0)}t&&this.applyFilter()}syncAccessibilityFilter(e){this.active.clear();for(let t of e??[])this.active.add(t);this.remember(e&&e.length?e:null);for(let t of this.menu.querySelectorAll("[data-a11y-row]")){let n=t.dataset.a11yRow??"";n.startsWith("a11y:")&&this.paint(t,this.active.has(n.slice(5)))}}destroy(){document.removeEventListener("pointerdown",this.dismiss),document.removeEventListener("keydown",this.escape),this.root.remove()}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;let t=this.button.getBoundingClientRect();Fi(this.menu,{x:t.left+t.width/2,y:t.top}),Zn(this.menu),Ut(this.menu)}rows(){return[...this.filterRows(),...this.deps.hasLimitedView?[{key:"limited",icon:"\u25D0",label:this.deps.tf("picker.hideLimitedView","Hide limited-view seats"),on:this.deps.isLimitedViewHidden()}]:[],{key:"colorblind",icon:"\u25D0",className:"sl-cbbtn",label:this.deps.tf("picker.colorblindColors","Colourblind-friendly colours"),on:this.deps.isColorblindSafe()}]}offered(){let e=this.deps.needs?.();if(e)return e.map(({key:n,count:r})=>({key:n,count:r}));let t=this.deps.present;return t?Tn.filter(({key:n})=>t.has(n)).map(({key:n})=>({key:n,count:null})):[]}offeredKeys(){return new Set(this.offered().map(({key:e})=>e))}offeredFree(){return new Set(this.offered().filter(({count:e})=>e!==0).map(({key:e})=>e))}filterRows(){let e=this.offeredKeys(),t=new Map(Tn.map(n=>[n.key,n]));return this.offered().flatMap(({key:n,count:r})=>{let s=t.get(n);return s?[{key:`a11y:${n}`,icon:s.icon,label:s.label,...n==="wheelchair"&&e.has("companion")?{note:this.deps.tf("picker.companionSeatsNote","Companion places beside them stay selectable")}:{},...r==null?{}:{count:r>0?ba("picker.accessFreeCount",{count:r}):this.deps.tf("picker.accessNoneLeft","None left"),disabled:r===0},on:this.active.has(n)}]:[]})}wire(){for(let e of this.menu.querySelectorAll("[data-a11y-row]"))e.addEventListener("click",()=>{let t=e.dataset.a11yRow??"";if(t==="colorblind"){let s=!this.deps.isColorblindSafe();this.deps.setColorblindSafe(s),this.paint(e,s);return}if(t==="limited"){let s=!this.deps.isLimitedViewHidden();this.deps.setLimitedViewHidden(s),s&&this.deps.focusSeatsForFilter(),this.paint(e,s);return}let n=t.slice(5),r=!this.active.has(n);r?this.active.add(n):this.active.delete(n),this.paint(e,r),this.applyFilter()})}promoteCounts(){if(this.deps.stepToAccessibleSection)for(let e of this.menu.querySelectorAll('[data-a11y-row^="a11y:"]')){let t=e.querySelector(".sl-a11yrow-c");if(!t)continue;let n=(e.dataset.a11yRow??"").slice(5),r=document.createElement("div");r.className="sl-a11yrow-w",e.replaceWith(r);let s=document.createElement("button");s.type="button",s.className="sl-a11yrow-c sl-a11yjump",s.dataset.a11yJump=n,s.textContent=t.textContent,s.disabled=e.disabled,s.setAttribute("aria-label",this.jumpLabel(n,t.textContent??"")),t.remove(),e.setAttribute("aria-label",this.rowLabel(n,s.textContent??"")),r.append(e,s),s.addEventListener("click",o=>{o.stopPropagation(),this.active.has(n)||(this.active.add(n),this.paint(e,!0),this.applyFilter({focus:!1}));let a=this.deps.stepToAccessibleSection?.(n);a&&s.setAttribute("aria-label",this.jumpLabel(n,s.textContent??"",a.label))})}}countNode(e){return e.querySelector(".sl-a11yrow-c")??e.parentElement?.querySelector(".sl-a11yrow-c")??null}typeLabel(e){return Tn.find(t=>t.key===e)?.label??e}jumpLabel(e,t,n){return[this.deps.tf("picker.jumpToSection","Jump to section"),this.typeLabel(e),t,...n?[`${this.deps.tf("picker.section","Section")} ${n}`]:[]].filter(Boolean).join(" \xB7 ")}rowLabel(e,t){return[this.typeLabel(e),t].filter(Boolean).join(" \xB7 ")}paint(e,t){e.classList.toggle("on",t),e.setAttribute("aria-checked",String(t)),e.setAttribute("aria-pressed",String(t))}applyFilter(e={}){let t=this.active.size?[...this.active]:null;this.deps.applyAccessibilityFilter(t),this.remember(t),t&&e.focus!==!1&&this.deps.focusSeatsForFilter()}key(){let e=this.deps.chart?.();return`seatmap.a11y.filter.${this.deps.event}${e?`.${e}`:""}`}stored(){try{let e=window.sessionStorage.getItem(this.key()),t=e?JSON.parse(e):null;return Array.isArray(t)?t:[]}catch{return[]}}remember(e){try{e&&e.length?window.sessionStorage.setItem(this.key(),JSON.stringify(e)):window.sessionStorage.removeItem(this.key())}catch{}}};import{attachVisibilityCatchUp as Gd}from"@seatlayer/core";var qd=250;function va(i,e=qd){let t=null,n=()=>{t===null&&(t=setTimeout(()=>{t=null,i()},e))},r=Gd(n),s=typeof window<"u"&&typeof window.addEventListener=="function";return s&&window.addEventListener("focus",n),()=>{t!==null&&(clearTimeout(t),t=null),r(),s&&window.removeEventListener("focus",n)}}import{holdRecoveryShape as Ud,tCount as Ci}from"@seatlayer/core";var Ai=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=Ud(e),n=e.lapsedLabels.length,r=n-e.recoverable.length,s=t==="all"?Ci("picker.holdLapsedStillFree",n):t==="partial"?Ci("picker.holdLapsedSomeTaken",r):Ci("picker.holdLapsedAllTaken",n);this.note={message:s,recoverable:t==="none"?[]:[...e.recoverable]},this.deps.toast(s,t==="none"?"error":"warning",t==="none"?void 0:{label:this.actionLabel(),onClick:()=>this.recover()}),this.deps.syncTray()}noteHtml(){if(!this.note)return"";let e=this.note.recoverable.length?`<button type="button" data-lapse-again>${H(this.actionLabel())}</button>`:"";return`<div class="sl-lapse-note" role="status"><span>${H(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 Ci("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 ya=Symbol("seatlayer.performance-group-picker");function Pi(i,e){return Object.defineProperty(i,ya,{configurable:!1,enumerable:!1,value:Object.freeze({...e})}),i}function wa(i){return i[ya]??null}var xa="@seatlayer/pending-checkout/v1";function Kd(i){return typeof i=="string"&&i.length<=160&&/^ord_[A-Za-z0-9_-]+$/.test(i)}function Sa(i){if(typeof location>"u")return null;let e=new URLSearchParams(location.search),t=e.get("seatlayer_checkout");if(t!=="success"&&t!=="cancelled")return null;let n=null;try{let r=window.sessionStorage.getItem(xa);if(r){let s=null;try{s=JSON.parse(r)}catch{}if(s&&Kd(s.orderId)){let o=Date.now()-Number(s.storedAt);if(o>=0&&o<=144e5){if(s.eventKey&&s.eventKey!==i)return null;n=s.orderId}}}window.sessionStorage.removeItem(xa)}catch{}e.delete("seatlayer_checkout");try{let r=e.toString();history.replaceState(history.state,"",`${location.pathname}${r?`?${r}`:""}${location.hash}`)}catch{}return{outcome:t,orderId:n}}function ka(i){if(!i.framed)return null;let e=i.ancestorOrigins?.length?i.ancestorOrigins[0]:null;for(let t of[e,i.referrer])if(t)try{return new URL(t).origin}catch{}return null}var ep="https://api.seatlayer.io",tp=10,ip=250,Ea=6e4,Ca=4,np=10,rp=40,sp=220,Aa="seatmap.a11y.cb";function op(){try{if(typeof window>"u")return null;let i=window.localStorage.getItem(Aa);return i==null?null:i==="1"}catch{return null}}function ap(i){try{window.localStorage.setItem(Aa,i?"1":"0")}catch{}}var $e=class i{constructor(e){this.realtime=null;this.accessEl=null;this.lastSelectionValidity=null;this.root=null;this.mapHost=null;this.rendered=!1;this.destroyed=!1;this.renderInfo=null;this.webMcp=null;this.localeGeneration=0;this.els={};this.regions={};this.ro=null;this.holdTimer=null;this.toastTimer=null;this.offerReadInFlight=null;this.offerReadSettledAt=0;this.offerRefreshTimer=null;this.offerBoundaryTimer=null;this.offerVisibilityHandler=null;this.motionTimers=new Set;this.currency="USD";this.eventTimezone=null;this.eventWhenText=null;this.offerAvailability=null;this.channelByObject=new Map;this.pricesByChannel=new Map;this.hold=null;this.holdExpiresAt=0;this.handedOff=!1;this.bookedShown=!1;this.holdConflicted=!1;this.paymentOptions=null;this.checkoutPanel=null;this.extendEl=null;this.extendDismissed=!1;this.extendUsed=!1;this.bookedEl=null;this.holdExpiredEl=null;this.holdExpiredFresh=!1;this.holdExpiredUnits=[];this.gaQty=new Map;this.gaPromptEl=null;this.gaPromptReturnFocus=null;this.gaAreasExpanded=!1;this.lastMapPoint=null;this.tipEl=null;this.tipPos={x:0,y:0};this.tipPinned=!1;this.tipMarkedHoverLabel=null;this.lastPointerType="mouse";this.themeMode=null;this.colorSchemeStop=null;this.seatsRevealed=!1;this.seatsRevealedReport=null;this.confirmCardCache=null;this.suppressConfirmationSeatId=null;this.tableDialogEl=null;this.tableDialog=null;this.tableDialogHeld=!1;this.tableDialogReturnFocus=null;this.srEl=null;this.baQty=2;this.baCat="";this.baZone="";this.baPremium=!1;this.baReopen=!1;this.bestAvailableConfirm=!1;this.salesClosed=!1;this.soldOut=!1;this.soldoutEl=null;this.cbSafe=!1;this.rungsEl=null;this.projectionEl=null;this.buyerView="map";this.view3dEl=null;this.view3dHandle=null;this.view3dGen=0;this.view3dReturnSeat=null;this.view3dTargetSeatId=null;this.view3dCompareSeatIds=[];this.view3dCompareChip=new bi({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.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.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 Ai({toast:(e,t,n)=>this.toast(e,t,n),reselect:e=>{this.controller.select(e),this.handleCta()},syncTray:()=>this.syncTray()});this.railEdgesBound=!1;this.fsFallback=!1;this.fsChangeHandler=null;this.fsEscHandler=null;this.eventDetailsHidden=!1;this.sideCollapsed=!1;this.sideToggleEl=null;this.framedFs=!1;this.lastPostedHeight=0;this.cbEl=null;this.modalScrim=null;this.prevFocus=null;this.escHandler=null;this.closeModal=null;this.fitScheduled=!1;this.perspectiveWarned=!1;if(!e||typeof e!="object")throw new Error("seatmap: options object is required");if(!e.event||typeof e.event!="string")throw new Error("seatmap: `event` key is required");if(!e.container)throw new Error("seatmap: `container` is required (or use SeatPicker.open())");this.performanceGroup=wa(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??ep).replace(/\/+$/,"");let t={onExpired:a=>{this.opts.onAccessExpired?.(a),a.refreshed||this.showAccessPanel({reason:"no_token",retryable:!1})},onUnavailable:a=>{this.opts.onAccessUnavailable?.(a),this.showAccessPanel(a)}},n=!e.transport&&e.publicKey&&!e.buyerAccessTokenProvider&&!e.buyerAccessToken?jt({base:this.apiBase,event:e.event,publicKey:e.publicKey,accessHooks:t,apiOptions:{referral:e.referral,onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)}}):null;this.access=e.transport?null:n?.access??yt(e,t),this.pubApi=e.transport?null:n?.api??new Ae(this.apiBase,{access:this.access??void 0,referral:e.referral,onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)}),this.api=e.transport??this.pubApi,this.buyerAssetUrls=new et(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 r=e.numberOfPlacesToSelect;if(r!=null&&(!Number.isInteger(r)||r<1))throw new Error("seatmap: `numberOfPlacesToSelect` must be a positive integer");this.exactTickets=r??null;let s=wo(e.selectionValidators);if(this.exactTickets!=null&&s>this.exactTickets)throw new Error("seatmap: `minimumSelectedPlaces.minimum` cannot exceed `numberOfPlacesToSelect`");let o=Math.max(1,Math.floor(e.maxSelection??this.exactTickets??Math.max(tp,s)));if(this.exactTickets!=null&&o<this.exactTickets)throw new Error("seatmap: `maxSelection` cannot be lower than `numberOfPlacesToSelect`");if(e.maxSelection!=null&&o<s)throw new Error("seatmap: `maxSelection` cannot be lower than `minimumSelectedPlaces.minimum`");this.maxTickets=this.exactTickets??o,this.cbSafe=op()??!!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 rt(e)}isFramed(){return typeof window<"u"&&window.parent!==window}postToHost(e){if(!this.isFramed())return;let t=ka({framed:!0,ancestorOrigins:window.location.ancestorOrigins,referrer:document.referrer});if(t)try{window.parent.postMessage(e,t)}catch{}}measureFramedHeight(){let e=this.root;if(!e)return 0;let t=e.clientWidth||(typeof window<"u"?window.innerWidth:0)||0;if(t<=0)return 0;let n=t<640?1.2:.62;return Math.max(420,Math.round(t*n))}reportFramedHeight(){if(!this.isFramed())return;let e=this.measureFramedHeight();e<=0||e===this.lastPostedHeight||(this.lastPostedHeight=e,this.postToHost({type:"seatlayer:height",px:e}))}toggleFullscreen(){let e=this.root;if(!e)return;!!document.fullscreenElement||this.fsFallback||this.framedFs?document.fullscreenElement?document.exitFullscreen().catch(()=>{}):this.framedFs?this.setFramedFs(!1):this.setFsFallback(!1):e.requestFullscreen?e.requestFullscreen().catch(()=>this.enterFsFallback()):this.enterFsFallback()}fillsViewport(){let e=this.root;if(!e||typeof window>"u")return!1;let t=e.getBoundingClientRect();return t.height>=window.innerHeight-Ca&&t.width>=window.innerWidth-Ca}syncFullscreenAffordance(){let e=this.els.zfs;if(!e)return;let n=!(!!document.fullscreenElement||this.fsFallback||this.framedFs)&&this.root?.dataset.layout==="narrow"&&this.fillsViewport();e.hidden=n,e.tabIndex=n?-1:0,e.setAttribute("aria-hidden",String(n))}syncFullscreenButtons(){let e=!!document.fullscreenElement||this.fsFallback||this.framedFs,t=this.eventDetailsHidden&&!e;this.root?.setAttribute("data-event-details-hidden",String(t)),this.root?.setAttribute("data-fs",String(e)),this.els.zfs?.setAttribute("aria-pressed",String(e)),this.els.zfs?.setAttribute("title",e?this.tf("picker.exitFullScreen","Exit full screen"):this.tf("picker.fullScreen","Full screen"));let n=this.els.zfs?.querySelector(".sl-zfs-lbl");n&&(n.textContent=e?this.tf("picker.exitFullScreen","Exit full screen"):this.tf("picker.fullScreen","Full screen")),this.view3dEl?.querySelector(".sl-view3d-fs")?.setAttribute("aria-pressed",String(e)),this.syncFullscreenAffordance()}enterFsFallback(){this.isFramed()?this.setFramedFs(!0):this.setFsFallback(!0)}setFramedFs(e){this.framedFs!==e&&(this.framedFs=e,this.syncFullscreenButtons(),this.postToHost({type:"seatlayer:fullscreen",on:e,background:this.cssVar("--sl-bg")||void 0}),e&&!this.fsEscHandler?(this.fsEscHandler=t=>{t.key==="Escape"&&!document.fullscreenElement&&this.setFramedFs(!1)},window.addEventListener("keydown",this.fsEscHandler)):!e&&this.fsEscHandler&&(window.removeEventListener("keydown",this.fsEscHandler),this.fsEscHandler=null),requestAnimationFrame(()=>this.controller.refitCurrentView()))}setFsFallback(e){this.fsFallback!==e&&(this.fsFallback=e,this.root?.classList.toggle("sl-fs",e),this.syncFullscreenButtons(),e&&!this.fsEscHandler?(this.fsEscHandler=t=>{t.key==="Escape"&&!document.fullscreenElement&&this.setFsFallback(!1)},window.addEventListener("keydown",this.fsEscHandler)):!e&&this.fsEscHandler&&(window.removeEventListener("keydown",this.fsEscHandler),this.fsEscHandler=null),requestAnimationFrame(()=>this.controller.refitCurrentView()))}close(){this.closeModal?this.closeModal():this.destroy()}static async open(e){tt();let t=document.activeElement instanceof HTMLElement?document.activeElement:null,n=document.createElement("div");n.className="sl-modal-scrim";let r=document.createElement("div");r.className="sl-modal-frame",r.style.setProperty("--sl-bg",Ue(void 0,e.theme)["--sl-bg"]),r.setAttribute("role","dialog"),r.setAttribute("aria-modal","true"),r.setAttribute("aria-label",v("picker.seatSelection","Seat selection")),r.tabIndex=-1,n.appendChild(r),document.body.appendChild(n);let s=document.body.style.overflow;document.body.style.overflow="hidden";let o=new i({...e,container:r});o.modalScrim=n,o.prevFocus=t;let a=["a[href]","area[href]","button","input","select","textarea","iframe","object","embed","summary","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"[tabindex]"].join(","),l=()=>{let g=[...r.querySelectorAll('[role="dialog"][aria-modal="true"]')].filter(b=>b.isConnected&&!b.closest('[hidden], [aria-hidden="true"], [inert]'));return g[g.length-1]??r},c=(g,b)=>{let w=g;for(;w;){let x=window.getComputedStyle(w);if(w.hidden||w.getAttribute("aria-hidden")==="true"||w.hasAttribute("inert")||x.display==="none"||x.visibility==="hidden"||x.visibility==="collapse")return!0;if(w===b)return!1;w=w.parentElement}return!0},p=g=>[...g.querySelectorAll(a)].filter(b=>b.tabIndex>=0&&!b.matches(":disabled")&&!c(b,g)),d=(g,b)=>{let w=p(g),x=b?w[w.length-1]:w[0];x?x.focus({preventScroll:!0}):(g.hasAttribute("tabindex")||(g.tabIndex=-1),g.focus({preventScroll:!0}))},u=!1,h=()=>{if(u)return;u=!0,document.body.style.overflow=s,o.escHandler&&document.removeEventListener("keydown",o.escHandler),n.remove(),o.modalScrim=null;let g=o.prevFocus;o.prevFocus=null,g?.isConnected&&g.focus({preventScroll:!0});let b=()=>{o.destroy(),e.onClose?.()};o.hold&&!o.handedOff?o.release().finally(b):b()};return o.closeModal=h,n.addEventListener("mousedown",g=>{g.target===n&&h()}),o.escHandler=g=>{if(g.key==="Tab"){if(g.defaultPrevented)return;let b=l(),w=p(b),x=w[0],y=w[w.length-1],m=document.activeElement;!x||!y?(g.preventDefault(),d(b,g.shiftKey)):m===b||!m||!b.contains(m)?(g.preventDefault(),(g.shiftKey?y:x).focus({preventScroll:!0})):g.shiftKey&&m===x?(g.preventDefault(),y.focus({preventScroll:!0})):!g.shiftKey&&m===y&&(g.preventDefault(),x.focus({preventScroll:!0}));return}g.key==="Escape"&&(o.tableDialog?(g.preventDefault(),o.cancelTableDialog()):o.confirmSeat?(g.preventDefault(),o.cancelConfirm()):o.bestAvailableConfirm?(g.preventDefault(),o.bestAvailableConfirm=!1,o.syncTray()):(g.preventDefault(),h()))},document.addEventListener("keydown",o.escHandler),await o.render(),o.els.close?.classList.add("on"),o.els.close?.addEventListener("click",h),d(l(),!1),o}wireController(e){return new Wd({transport:this.api,eventKey:e.event,maxSelection:this.maxTickets,selectedObjects:e.selectedObjects,selectableObjects:e.selectableObjects,numberOfPlacesToSelect:e.numberOfPlacesToSelect,selectionValidators:e.selectionValidators,currency:e.currency,flashOnLiveChange:!0,colorblindSafe:this.cbSafe,...e.loadingReveal?{loadingReveal:e.loadingReveal}:{},mapTheme:qe(e.theme),onSeatsRevealed:()=>{this.seatsRevealed=!0,e.onSeatsRevealed?.(),this.seatsRevealedReport?.()},onGAClick:t=>{let n=this.controller.getGAAreas().find(r=>r.id===t);n&&(this.collapseSheet(),zi(this,n,this.lastMapPoint))},onSelectionChange:()=>{this.syncTray(),this.minimap?.refreshMinimap(),this.committedSelection().length&&this.collapseSectionCard(),this.syncSelectionTo3d()},onStatusChange:(t=>{this.syncSeatMarks(),this.syncPrices(),this.a11yMenu?.syncCounts(),zr(t)&&this.scheduleOfferRefresh(!0),this.evictTakenSelections(),this.detectBooked(),this.minimap?.refreshMinimap(),this.pushAvailabilityTo3d()}),onHoldExpired:()=>{let t=this.handedOff,n=this.holdConflicted;this.holdExpiredUnits=aa(this.hold),this.hold=null,this.forgetHold(),this.handedOff=!1,this.bookedShown=!1,this.holdConflicted=!1,this.ctaPhase="idle",this.stopHoldTimer(),this.gaQty.clear(),this.lapse.deferExpiryToast(()=>{if(t||n){this.toast(B("picker.holdExpired",void 0)||"Your hold expired \u2014 seats released. Pick again.","warning");return}this.showHoldExpired()}),this.syncTray(),this.emitHoldChange(),this.opts.onHoldExpired?.()},onAvailabilityRefresh:t=>this.lapse.handle(t),confirmSelection:this.opts.confirmSelection,onSelect:t=>{if(this.salesClosed){this.controller.deselect([t.id]),this.toast(this.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}this.controller.tableSelection(t.id)||(this.collapseSheet(),this.flashPickedSeat(t.id),this.opts.confirmSelection&&this.suppressConfirmationSeatId!==t.id&&this.showConfirm(t))},onTableSelectionRequest:t=>{if(this.salesClosed){this.controller.deselect(t.physicalSeatIds),this.toast(this.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}this.showTableDialog(t,!1)},onDeselect:t=>{if(this.controller.currentHold()?.labels.includes(t.label)){this.removeHeldLabels([t.label]);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(B("picker.maxTicketsForOrder",{count:this.maxTickets}),"warning"),this.opts.onSelectionLimit?.(this.maxTickets)},onViewChange:()=>{this.reanchorConfirm(),this.syncRung(),this.syncProjection(),this.minimap?.drawMinimapRect(),this.sectionCardOnView()},onSectionFocus:t=>this.showSectionCard(t),onDeckTap:()=>{this.showSectionCard(null),this.syncFloors(),this.syncRung(),this.minimap?.refreshMinimap()},onFocusSeat:t=>this.announceSeat(t),onSeatHover:t=>this.updateTooltip(t),hostCardOpen:()=>this.tipPinned||!!this.confirmSeat,onHint:t=>{t&&this.toast(t)},onSalesClosed:()=>this.setSalesClosed(!0),onError:t=>this.opts.onError?.(t)})}async render(){if(this.rendered)return this;let e=performance.now(),t={},n=C=>Math.round((performance.now()-C)*100)/100;this.rendered=!0,tt();let r=performance.now(),s=Vt(this.opts.locale,this.opts.messages),o=this.localeGeneration+=1;this.checkoutMode==="hosted"&&(this.paymentOptions=this.pubApi.paymentOptions(this.opts.event));let a=performance.now(),l=br(this.opts.container),{root:c,els:p,mapHost:d}=Gn(l,(C,D)=>this.tf(C,D),this.opts.theme);this.root=c,this.els=p,this.mapHost=d,$t(c,s,C=>{t.loadLocale=n(r),this.destroyed||this.applyActiveLocale(C,o)}),js(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");u.style.cssText="position:absolute;inset:0",this.mapHost.appendChild(u),t.mountBuyerShell=n(a),t.skeletonPaint=n(e),this.startRealtime();let h=await this.loadChart(u,t,n);if(!h)return this.realtime?.stop(),this.realtime=null,this;t.shellsPaint=n(e);let g=performance.now();if(this.salesClosed=!!h.salesClosed||!!this.opts.readOnly,c.dataset.eventMode=h.mode==="test"?"test":"live",!this.opts.locale&&h.locale&&this.setLocale(h.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),h.mode==="test"){let C=document.createElement("div");C.className="sl-testbadge",C.textContent=gr(B("picker.testMode"),Ta()),C.setAttribute("aria-label",B("picker.testMode")),C.title=this.tf("picker.testModeExplained","Bookings here are not real and no card is charged"),this.regions["top-left"].appendChild(C)}let b=this.controller.doc?.theme;this.themeMode=this.opts.theme?.mode??null,this.applyThemeTokens(c),this.watchThemeMode(),this.currency=h.currency??this.opts.currency??"USD",this.eventTimezone=h.timezone??null,vr(this.els.logo,[this.opts.theme?.logoUrl,b?.logoUrl,h.posterUrl],this.opts.theme?.brandName??b?.brandName??h.eventName??"?"),this.els.name.textContent=h.eventName??"";let w=h.startsAt?Zt(h.startsAt,h.timezone??null,this.opts.locale):"";this.eventWhenText=w||null,this.els.meta.textContent=[h.venue,w].filter(Boolean).join(" \xB7 "),this.syncProjection(),this.buildBadge(b);let x=!!this.controller.doc&&this.controller.getExpandedSeats().some(C=>C.commercial?.restrictedView||C.commercial?.obstructedView);this.buildAccessibilityMenu(x),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"),c.appendChild(this.srEl),this.buildArenaChrome(),this.buildMinimap(),this.buildPriceFilter(),this.buildExtendPrompt(),this.buildBookedOverlay(),this.buildSoldoutOverlay(),this.buildPanelToggle(),this.opts.panelCollapsed&&this.setPanelCollapsed(!0),this.dockLayoutChrome(),t.buildBuyerControls=n(g);let y=performance.now();if(await this.restoreRememberedHold(),t.restoreHold=n(y),this.destroyed)return this;this.dismissSkeleton(),this.salesClosed&&this.applySalesClosed(),this.syncPrices(),this.syncTray(),this.resumeHostedOrder();let m=this.controller.doc,A=ri(this.opts.event),_=this.performanceGroup?.surface??(this.performanceGroup?"performance_group":null),k=_??"event",M={apiBase:this.apiBase,eventKey:this.opts.event,metricScope:k,surface:_==="season"?"season_picker":_==="performance_group"?"performance_group_picker":"seat_picker",ms:n(e),performanceProfile:t,chartDelivery:h.chartDelivery,seatCount:this.allSeats().length,objectCount:m?.objects.length??0,sectionCount:m?.objects.filter(C=>C.type==="section").length??0,floorCount:this.controller.getFloors().length,chartName:m?.name,view:this.buyerView,load:A,transport:this.opts.transport?"custom":"pubapi"};Ys(M,(C,D)=>this.emitAnalytics(C,D));let L=h.performanceProfile;return this.seatsRevealedReport=()=>this.emitAnalytics("chart_seats_revealed",gn({...M,performanceProfile:{...M.performanceProfile,...L}})),this.seatsRevealed&&this.seatsRevealedReport(),this.renderInfo=h,await this.registerAgentTools(),this}registerAgentTools(){return Ws(this)}webMcpHost(e){return fn(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=va(()=>{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.zfs.addEventListener("click",()=>this.toggleFullscreen()),this.fsChangeHandler=()=>{document.fullscreenElement||this.setFsFallback(!1),this.syncFullscreenButtons(),requestAnimationFrame(()=>this.controller.refitCurrentView())},document.addEventListener("fullscreenchange",this.fsChangeHandler);let t=this.els.sheetHead;if(t){let r=this.els.sheetToggle,s=c=>{e.dataset.sheet=c?"open":"peek",r?.setAttribute("aria-expanded",String(c)),r?.setAttribute("aria-label",c?this.tf("picker.collapseTicketPanel","Collapse ticket panel"):this.tf("picker.openTicketPanel","Open ticket panel"))};s(e.dataset.sheet==="open"),r?.addEventListener("click",c=>{c.stopPropagation(),s(e.dataset.sheet!=="open")}),this.els.peek?.addEventListener("click",c=>{let p=c.target.closest(".sl-sheet-go");p&&(c.stopPropagation(),p.dataset.act==="checkout"?this.handleCta():p.dataset.act==="best"||p.dataset.act==="find"?(p.dataset.act==="best"&&(this.baReopen=!0,this.baQty=Math.max(1,Math.min(this.baQty,this.maxTickets-this.totalTicketCount())),this.syncTray()),s(!0),this.els.tray?.querySelector(".sl-ba")?.scrollIntoView({block:"nearest",behavior:this.reducedMotion()?"auto":"smooth"}),this.els.tray?.querySelector(".sl-ba-go")?.focus()):s(!0))});let o=0,a=!1,l=!1;t.addEventListener("pointerdown",c=>{if(c.target.closest?.(".sl-seccard,.sl-sheet-toggle,.sl-sheet-go")){l=!1;return}l=!0,a=!1,o=c.clientY,t.setPointerCapture?.(c.pointerId)}),t.addEventListener("pointermove",c=>{if(!l||a)return;let p=c.clientY-o;p<-18?(s(!0),a=!0):p>18&&(s(!1),a=!0)}),t.addEventListener("pointerup",c=>{l&&!a&&Math.abs(c.clientY-o)<6&&s(e.dataset.sheet!=="open"),l=!1,t.releasePointerCapture?.(c.pointerId)})}let n=()=>{if(this.root?.dataset.layout!=="narrow")return;let r=this.root.getAttribute("data-prices-open")==="true";if(this.root.setAttribute("data-prices-open",String(!r)),this.els.pricesSec?.setAttribute("aria-expanded",String(!r)),!r&&this.root.dataset.sheet!=="open"){this.root.dataset.sheet="open";let s=this.els.sheetToggle;s?.setAttribute("aria-expanded","true"),s?.setAttribute("aria-label","Collapse ticket panel")}};this.els.pricesSec?.addEventListener("click",r=>{r.target.closest("select,button")||n()}),this.els.pricesSec?.addEventListener("keydown",r=>{r.key!=="Enter"&&r.key!==" "||r.target.closest("select,button")||(r.preventDefault(),n())}),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",r=>{this.handleMapPointerDown(r)},!0),this.els.map.addEventListener("mousemove",r=>{if(this.tipPinned)return;let s=this.els.map.getBoundingClientRect();this.tipPos={x:r.clientX-s.left,y:r.clientY-s.top},this.tipEl&&this.tipEl.style.display!=="none"&&this.placeTooltip()}),this.els.cta.addEventListener("click",()=>{this.handleCta()})}collapseSheet(){let e=this.root;!e||e.dataset.layout!=="narrow"||e.dataset.sheet!=="open"||(e.dataset.sheet="peek",this.els.sheetToggle?.setAttribute("aria-expanded","false"),this.els.sheetToggle?.setAttribute("aria-label",this.tf("picker.openTicketPanel","Open ticket panel")))}observeLayout(e){let t=()=>{let n=e.clientWidth;if(n<=0)return;let r=e.clientHeight,s=n!==this.pickerLayoutSize.width||r!==this.pickerLayoutSize.height;this.pickerLayoutSize={width:n,height:r},this.reportFramedHeight();let o=n<640?"narrow":"wide",a=r<560?"compact":"comfortable";(e.dataset.layout!==o||e.dataset.density!==a)&&(e.dataset.layout=o,e.dataset.density=a,this.controller.getRenderer()?.setSectionFocusDim?.(o!=="narrow"),o==="narrow"&&!e.dataset.sheet&&(e.dataset.sheet="peek"),this.dockLayoutChrome(),this.syncMinimapForLayout(),this.lastTrayKeys.size&&this.syncTray(),this.syncMapStepBack(),this.refreshExtendPrompt()),this.syncFullscreenAffordance(),s&&(this.minimap?.refreshMinimap(),this.scheduleFit())};this.ro=new ResizeObserver(t),this.ro.observe(e),t(),requestAnimationFrame(t)}async loadChart(e,t,n){let r=performance.now(),s=await this.controller.render(e);return t.loadChartAndStatuses=n(r),this.destroyed?null:s?(Object.assign(t,s.performanceProfile),s):(xe({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:"load_chart",ms:t.loadChartAndStatuses,performanceProfile:t,view:"map",load:Me(this.opts.event),transport:this.opts.transport?"custom":"pubapi"}),this.els.boot.innerHTML=`<div class="sl-boot-title">${this.tf("picker.mapDidNotLoad","The seat map didn\u2019t load")}</div><div>${this.tf("picker.checkConnection","Check your connection and try again.")}</div><button type="button" class="sl-boot-retry">${this.tf("picker.accessRetry","Try again")}</button>`,this.els.boot.querySelector("button").addEventListener("click",()=>{let o=this.opts.container,a=this.opts;this.destroy(),new i({...a,container:o}).render()}),null)}resumeHostedOrder(){if(this.checkoutMode!=="hosted")return;let e=Sa(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.regions["bottom-left"]??this.els.map;t&&(this.a11yMenu=new Ei(t,{event:String(this.opts.event),chart:()=>this.controller.doc?.name??null,needs:()=>this.controller.getAccessNeeds(),hasLimitedView:e,tf:(n,r)=>this.tf(n,r),isColorblindSafe:()=>this.cbSafe,setColorblindSafe:n=>this.setColorblindSafe(n),isLimitedViewHidden:()=>this.limitedViewFilter,setLimitedViewHidden:n=>{this.limitedViewFilter=n,this.controller.setCommercialLimitedFilter(n),this.pushAvailabilityTo3d()},applyAccessibilityFilter:n=>this.applyAccessibilityFilter(n),focusSeatsForFilter:()=>this.focusSeatsForFilter(),stepToAccessibleSection:n=>this.controller.focusNextAccessibleSection?.([n])??null}),this.cbEl=this.a11yMenu.colorblindRow())}focusSeatsForFilter(){if(this.controller.focusAccessibilityFilter?.()){this.explainAccessibilitySpread();return}this.rungsEl&&this.controller.getRung()!=="seats"&&(this.controller.setRung("seats"),this.collapseSectionCard(),this.syncRung())}explainAccessibilitySpread(){let e=this.controller.accessibilitySpread?.();!e?.wholeVenue||e.sections.length<2||this.toast(B("picker.accessSpreadHint",{count:e.spaces,sections:e.sections.length}),"neutral")}applyAccessibilityFilter(e){this.controller.setAccessibilityFilter(e),this.syncPrices(),this.minimap?.refreshMinimap(),this.pushAvailabilityTo3d()}setAccessibilityFilter(e){this.applyAccessibilityFilter(e),this.a11yMenu?.syncAccessibilityFilter(e),e?.length&&this.focusSeatsForFilter()}focusAccessibilityFilter(){this.focusSeatsForFilter()}dockLayoutChrome(){let e=this.root?.dataset.layout==="narrow";this.applyPanelCollapsed();let t=this.els.zfs,n=this.els.headInfo?.parentElement;t&&n&&t.parentElement!==n&&(t.classList.add("sl-fs-pill"),n.insertBefore(t,this.els.hold??null));let r=this.extendEl;if(r){let o=e?this.regions["bottom-center"]??this.els.map:n;o&&r.parentElement!==o&&(r.dataset.dock=e?"map":"head",o===n?o.insertBefore(r,this.els.close??null):o.appendChild(r))}let s=this.els.pricesSec;s&&(e?(s.setAttribute("role","button"),s.tabIndex=0,s.setAttribute("aria-expanded",String(this.root?.getAttribute("data-prices-open")==="true"))):(s.removeAttribute("role"),s.removeAttribute("aria-expanded"),s.tabIndex=-1)),this.lastSection&&this.renderSectionCard(this.lastSection)}buildExtendPrompt(){Po(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>${H(this.tf("picker.backToMap","Back to map"))}</span></button>`,this.root.appendChild(e),this.bookedEl=e,this.els.bookedSub=e.querySelector('[data-ref="bookedSub"]'),this.els.bookedList=e.querySelector('[data-ref="bookedList"]'),e.querySelector('[data-ref="bookedBack"]')?.addEventListener("click",()=>this.dismissBooked())}get onGAPromptHook(){return this.opts.onGAPrompt}tf(e,t){return v(e,t)}buildSoldoutOverlay(){if(!this.els.map)return;let e=document.createElement("div");e.className="sl-soldout",e.setAttribute("role","status");let t=(this.controller.doc?.theme?.brandName??this.opts.theme?.brandName??this.els.name?.textContent??this.tf("picker.soldOutEyebrow","This event")).toUpperCase(),n=document.createElement("div");n.className="sl-soldout-eyebrow",n.textContent=t;let r=document.createElement("div");r.className="sl-soldout-title",r.textContent=this.tf("picker.soldOutTitle","Sold out");let s=document.createElement("p");s.className="sl-soldout-copy",s.textContent=this.tf("picker.soldOutCopy","No reserved seats are currently available for this event."),e.append(n,r,s),this.els.map.appendChild(e),this.soldoutEl=e}syncSoldout(e,t){let n=this.controller.getGAAreas().length>0,r=this.isSoldOut(e,t,n);r!==this.soldOut&&(this.soldOut=r,this.soldoutEl?.classList.toggle("on",r))}isSoldOut(e,t,n){return!n&&e.length>0&&e.every(r=>(t[r.key]??0)===0)}setSalesClosed(e){let t=e||!!this.opts.readOnly;this.salesClosed!==t&&(this.salesClosed=t,this.applySalesClosed())}applySalesClosed(){this.salesClosed&&this.tableDialog&&!this.tableDialogHeld&&this.cancelTableDialog();let e=this.els.closedPill;if(e){e.classList.toggle("on",this.salesClosed);let t=this.els.closedPillText??e;t.textContent=this.tf("picker.salesClosedPill","Sales are closed")}this.root?.setAttribute("data-sales-closed",String(this.salesClosed)),this.salesClosed&&this.srEl&&(this.srEl.textContent=this.tf("picker.salesClosedToast","Sales are closed for this event.")),this.syncCta(),this.syncTray()}badgeHidden(e){return!!(this.opts.hideBadge||e?.hideBadge)}buildBadge(e){if(this.badgeHidden(e))return;let t=this.els.foot;if(!t)return;let n=document.createElement("a");n.className="sl-powered",n.href="https://seatlayer.io/?ref=picker",n.target="_blank",n.rel="noopener noreferrer",n.setAttribute("aria-label",this.tf("picker.poweredBy","Powered by SeatLayer"));let r=document.createElement("span");r.className="sl-powered-mark",r.setAttribute("aria-hidden","true"),r.innerHTML=Wt;let s=document.createElement("span");s.textContent=this.tf("picker.poweredBy","Powered by SeatLayer"),n.append(r,s),t.appendChild(n)}buildRegions(){if(!this.els.map)return;let e=["top-left","top-center","top-right","left-rail","bottom-left","bottom-center","bottom-right"];for(let t of e){let n=document.createElement("div");n.className="sl-anchor",n.dataset.region=t,this.els.map.appendChild(n),this.regions[t]=n}}cssVar(e){return this.root?getComputedStyle(this.root).getPropertyValue(e).trim():""}reducedMotion(){return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}scheduleMotion(e,t){let n=setTimeout(()=>{this.motionTimers.delete(n),this.destroyed||e()},t);this.motionTimers.add(n)}animateOnce(e,t,n=600){!e||this.reducedMotion()||(e.classList.remove(t),e.offsetWidth,e.classList.add(t),this.scheduleMotion(()=>e.classList.remove(t),n))}flashPickedSeat(e){this.reducedMotion()||this.controller.flashSeat(e,this.cssVar("--sl-accent")||"#f4b740")}flashHeldSeats(e){let t=this.reducedMotion(),n=(e.items??[]).filter(r=>r.objectType!=="ga").slice(0,10).map(r=>this.controller.seatByLabel(r.label)).filter(r=>!!r);Ar({regions:this.els,categories:this.controller.doc?.categories,pop:r=>this.controller.flashSeat(r,this.cssVar("--sl-accent")||"#f4b740"),focus:(r,s)=>this.controller.focusSection(r,s),focusSeats:r=>this.controller.focusSeats?.(r,{animate:!t})===!0,reducedMotion:t,screenPoint:r=>this.controller.worldToScreen(r),schedule:(r,s)=>this.scheduleMotion(r,s)},n)}committedSelection(){let e=this.confirmSeat?.id,t=this.tableDialog&&!this.tableDialogHeld?this.tableDialog.id:null;return this.controller.getSelection().filter(n=>n.id!==e&&n.id!==t)}pendingSelectionCount(){return Mo(this)}heldTicketCount(){return Ho(this)}totalTicketCount(){return Ro(this)}updateSelectionCapacity(){Oo(this)}syncCta(e=this.lastTrayCount,t=this.pendingSelectionCount()){Io(this,e,t)}setCtaPhase(e){_o(this,e)}runCheckoutHandoff(e,t){return Do(this,e,t)}holdStorageKey(){return Bo(this)}rememberedHoldId(){return No(this)}rememberHold(e){Fo(this,e)}forgetHold(){Vo(this)}resumeHoldFromServer(e){return $o(this,e)}restoreRememberedHold(){return zo(this)}activeFloorObjects(){let e=this.controller.doc;if(!e)return[];let t=e.floors;if(t?.length){let n=this.controller.getActiveFloorId();return(t.find(r=>r.id===n)??t[0]).objects??[]}return e.objects??[]}buildMinimap(){!this.els.map||this.root?.dataset.layout==="narrow"||(this.minimap=Ns({controller:this.controller,root:()=>this.root,cssVar:e=>this.cssVar(e),focusedSectionLabel:()=>this.lastSection?.label},this.regions["bottom-left"]??this.els.map))}syncMinimapForLayout(){let e=this.root?.dataset.layout==="narrow";if(e&&this.minimap){this.minimap.dispose(),this.minimap=null;return}!e&&!this.minimap&&this.buildMinimap()}catPrice(e){return yi(this,e)}catPriceRange(e){return wi(this,e)}buildPriceFilter(){Jo(this)}applyPriceBand(e){ea(this,e)}buildArenaChrome(){let e=this.controller.doc;if(!e||!this.els.map)return;let t=e.objects.some(n=>n.type==="section")||(e.floors??[]).some(n=>n.objects.some(r=>r.type==="section"));if(this.canOffer3d()){let n=document.createElement("div");n.className="sl-projection",n.setAttribute("role","group"),n.setAttribute("aria-label",this.tf("picker.venueView","Venue view")),n.innerHTML=`<button type="button" data-view="map" aria-pressed="true" title="${this.tf("picker.flat2dMap","Flat 2D map")}">${this.tf("picker.map","Map")}</button><button type="button" data-view="venue3d" aria-pressed="false" title="${this.tf("picker.interactive3dVenueView","Interactive 3D venue view")}">3D</button>`,n.querySelectorAll("button").forEach(r=>{if(r.dataset.view==="venue3d")for(let s of["pointerenter","focus","pointerdown"])r.addEventListener(s,Xt,{once:!0});r.addEventListener("click",()=>{this.setBuyerView(r.dataset.view)})}),this.regions["top-right"].appendChild(n),this.projectionEl=n,this.syncProjection()}if(t){let n=[...e.objects,...(e.floors??[]).flatMap(p=>p.objects)],r=new Set((e.zones??[]).map(p=>p.id)),o=n.some(p=>p.type==="section"&&typeof p.zone=="string"&&r.has(p.zone))?["zones","sections","seats"]:["sections","seats"],a=document.createElement("div");a.className="sl-rungs on sl-mo-indicator",a.setAttribute("role","group"),a.setAttribute("aria-label",B("picker.zoomLevel"));let l={zones:B("picker.rungLabel.zones"),sections:B("picker.rungLabel.sections"),seats:B("picker.rungLabel.seats")},c={zones:B("picker.rungTip.zones"),sections:B("picker.rungTip.sections"),seats:B("picker.rungTip.seats")};a.innerHTML=o.map(p=>`<button type="button" data-rung="${p}" title="${c[p]}" aria-pressed="false">${l[p]}</button>`).join(""),a.querySelectorAll("button").forEach(p=>{p.addEventListener("click",()=>{let d=p.dataset.rung;this.controller.setRung(d),d==="seats"&&this.collapseSectionCard()})}),this.regions["top-center"].appendChild(a),this.rungsEl=a,this.syncRung()}if(this.controller.isMultiFloor()){let n=cs({floors:this.controller.getFloors(),tf:(r,s)=>this.tf(r,s),onChoose:r=>{r===""?this.controller.setFloorOverview(!0):this.controller.setFloor(r),this.showSectionCard(null),this.syncFloors(),this.syncRung(),this.minimap?.refreshMinimap()}});this.regions["left-rail"].appendChild(n),this.floorsEl=n,this.syncFloors()}}syncRung(){let e=this.controller.getRung(),t=this.controller.seatsRevealed?.()??(e==="seats"||!!this.controller.getFocusedSection?.());this.root&&(this.root.dataset.zoomed=String(t)),this.syncMapStepBack(),this.minimap?.setAutoOpen(!1),this.rungsEl&&this.rungsEl.querySelectorAll("button").forEach(n=>{let r=n.dataset.rung===e;n.classList.toggle("on",r),n.setAttribute("aria-pressed",String(r))})}syncMapStepBack(){let e=this.els?.zout;if(!(!e||!this.root)){if(this.root.dataset.layout!=="narrow"){e.disabled&&(e.disabled=!1);return}e.disabled=Gr({focusedSection:this.controller.getFocusedSection?.()??null,seatsRevealed:this.controller.seatsRevealed?.()??!0})==="none"}}syncProjection(){this.els.pricesHint&&(this.els.pricesHint.textContent=this.buyerView==="venue3d"?this.tf("picker.priceHint3d","Colours in the venue are ticket types \u2014 choose one below to show just those seats."):this.tf("picker.priceHint","Colours on the map are ticket types \u2014 tap one below to show just those seats.")),this.projectionEl&&this.projectionEl.querySelectorAll("button").forEach(e=>{let t=e.dataset.view===this.buyerView;e.classList.toggle("on",t),e.setAttribute("aria-pressed",String(t))})}canOffer3d(){return this.opts.enable3D===!1||!this.controller.doc||!Yt()?!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)?Ea/2:Ea}syncFloors(){ds(this.floorsEl,this.controller.getActiveFloorId(),this.controller.isFloorOverview())}get sectionCard(){return this.sectionCardCache||(this.sectionCardCache=new di({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(r=>r.type==="section"&&!this.controller.isSectionClosed(r.id)&&this.controller.getSectionSeatCount(r.id)>0);if(t.length<2)return null;let n=t.findIndex(r=>r.id===e);return n<0?null:{previous:t[(n-1+t.length)%t.length],next:t[(n+1)%t.length]}}markedSeatAnnouncement(e){let t=ln(this.controller.getRenderer()?.getSeatMark?.(e.id),this.performanceGroup?.nights?.());return xs(t,e.displayLabel??e.label,this.opts.locale)}announceSeat(e){if(!this.srEl)return;if(!e){this.srEl.textContent="";return}let t=this.markedSeatAnnouncement(e);if(t){this.srEl.textContent=t;return}let n=this.controller.doc?.categories.find(h=>h.key===e.categoryKey),r=this.controller.getStatus(e.id)??"free",s=r==="free"?this.tf("picker.statusAvailable","available"):r==="held"?this.tf("picker.statusOnHold","on hold"):this.tf("picker.statusTaken2","taken"),o=n?this.catPriceRange(n):void 0,a=!this.suppressPricing&&o?o.min===o.max?this.money(o.min):`${this.money(o.min)}\u2013${this.money(o.max)}`:void 0,l=this.controller.tableSelection(e.id),c=l??this.controller.seatDetails(e.id),p=Fe(c),d=c?.rowLabel??c?.displayLabel??e.displayLabel??e.label,u=l?`${p} ${d}, ${l.bookingMode==="variable"?B("picker.minToMaxGuests",{min:l.minOccupancy,max:l.maxOccupancy}):B("picker.capacityGuests",{count:l.capacity})}`:c?.objectType==="booth"?`${p} ${d}`:c?.objectType==="table"?`${p} ${d}, ${B("picker.seatNumberLower",{label:c.seatNumber??e.label})}`:B("picker.seatLabel",{label:c?.displayLabel??e.displayLabel??e.label});this.srEl.textContent=`${u}, ${n?.label??e.categoryKey}${a?`, ${a}`:""}, ${s}`}showTableDialog(e,t,n){this.dismissTableDialog(!1),this.tableDialog={...e},this.tableDialogHeld=t,this.tableDialogReturnFocus=n??document.activeElement;let r=this.controller.doc?.categories.find(a=>a.key===e.categoryKey),s=e.bookingMode==="variable",o=document.createElement("div");o.className="sl-table-scrim",o.innerHTML=os(e,{variable:s,held:t,typeWord:Fe(e),categoryLabel:r?.label??e.categoryKey,suppressPricing:this.suppressPricing,unitPrice:this.money(this.paidPrice(e.categoryKey,e.tierId??null,e.price,e.label))}),this.root.appendChild(o),this.tableDialogEl=o,this.renderTableDialogState(),o.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()})}),o.querySelector(".sl-table-cancel").addEventListener("click",()=>this.cancelTableDialog()),o.querySelector(".sl-table-confirm").addEventListener("click",()=>{this.confirmTableDialog()}),o.addEventListener("mousedown",a=>{a.target===o&&this.cancelTableDialog()}),o.addEventListener("keydown",a=>{if(a.key!=="Tab")return;let l=[...o.querySelectorAll('button:not(:disabled),[tabindex]:not([tabindex="-1"])')];if(!l.length)return;let c=l[0],p=l[l.length-1];a.shiftKey&&document.activeElement===c?(a.preventDefault(),p.focus()):!a.shiftKey&&document.activeElement===p&&(a.preventDefault(),c.focus())}),requestAnimationFrame(()=>o.querySelector(s?'[data-table-step="-1"]':".sl-table-confirm")?.focus())}renderTableDialogState(){let e=this.tableDialog,t=this.tableDialogEl;if(!e||!t)return;let n=t.querySelector("output[data-table-qty]");n&&(n.value=String(e.quantity));let r=t.querySelector("input[data-table-qty]");r&&(r.value=String(e.quantity)),t.querySelectorAll("[data-table-step]").forEach(a=>{let l=Number(a.dataset.tableStep);a.disabled=l<0?e.quantity<=e.minOccupancy:e.quantity>=e.maxOccupancy});let s=this.paidPrice(e.categoryKey,e.tierId??null,e.price,e.label),o=t.querySelector("[data-table-total]");o&&(o.textContent=this.money(s*e.quantity))}async confirmTableDialog(){let e=this.tableDialog,t=this.tableDialogHeld;if(!e)return;let n=this.tableDialogEl?.querySelector(".sl-table-confirm");if(n&&(n.disabled=!0,n.textContent=t?this.tf("picker.updatingEllipsis","Updating\u2026"):this.tf("picker.selectingEllipsis","Selecting\u2026")),t){try{let r=await this.controller.replaceTableQuantity(e.label,e.quantity,this.opts.holdTtlMs);if(!r){this.toast(this.tf("picker.guestCountCouldNotBeSecured","That guest count could not be secured. Your current table hold is unchanged."),"warning"),this.renderTableDialogState(),n&&(n.disabled=!1,n.textContent=this.tf("picker.updateTable","Update table"));return}this.hold={holdId:r.holdId,expiresAt:r.expiresAt,seats:r.seats,items:r.items},this.startHoldTimer(r.expiresAt),this.dismissTableDialog(),this.syncTray(),this.emitHoldChange(),this.toast(B("picker.tableUpdatedForGuests",{label:e.label,count:e.quantity}),"success")}catch(r){this.opts.onError?.(r),this.toast(this.tf("picker.guestCountNoLongerAvailable","That guest count is no longer available. Your current hold is unchanged."),"error"),n&&(n.disabled=!1,n.textContent=this.tf("picker.updateTable","Update table"))}return}if(!this.controller.setTableQuantity(e.label,e.quantity)){n&&(n.disabled=!1,n.textContent=e.bookingMode==="variable"?this.tf("picker.selectTable","Select table"):this.tf("picker.selectWholeTable","Select whole table"));return}this.dismissTableDialog(),this.collapseSectionCard(),this.syncTray()}cancelTableDialog(){let e=this.tableDialog,t=this.tableDialogHeld;this.dismissTableDialog(),e&&!t&&this.controller.deselect(e.physicalSeatIds)}dismissTableDialog(e=!0){let t=this.tableDialogReturnFocus;this.tableDialogEl?.remove(),this.tableDialogEl=null,this.tableDialog=null,this.tableDialogHeld=!1,this.tableDialogReturnFocus=null,e&&requestAnimationFrame(()=>(t?.isConnected?t:this.root)?.focus())}get confirmCard(){return this.confirmCardCache||(this.confirmCardCache=new gi({controller:this.controller,root:()=>this.root,els:()=>this.els,regions:()=>this.regions,hideTooltip:()=>{this.tipEl&&(this.tipEl.style.display="none")},tf:(e,t)=>this.tf(e,t),money:e=>this.money(e),paidPrice:(e,t,n,r)=>this.paidPrice(e,t,n,r),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(),reanchor:()=>this.reanchorConfirm(),inviteCommit:(e,t)=>this.inviteCommit(e,t),addSeatLabel:e=>this.addSeatLabel(e)})),this.confirmCardCache}showConfirm(e,t="add"){this.confirmCard.show(e,t)}reanchorConfirm(){this.confirmCard.reanchor()}dismissConfirm(){this.confirmCard.dismiss()}async commitConfirm(){await this.confirmCard.commit()}cancelConfirm(){this.confirmCard.cancel()}closeConfirm(){this.dismissConfirm()}inviteCommit(e,t){Ds(e,t,this.reducedMotion())}addSeatLabel(e){return Bs(e,(t,n)=>this.tf(t,n))}seatViewEnabled(){return this.opts.seatView!==!1}allSeats(){return this.allSeatsCache||(this.allSeatsCache=[...this.controller.getExpandedSeats()]),this.allSeatsCache}async openSeatView(e){if(!this.root||!this.seatViewEnabled())return;let t=++this.seatViewGen,n=this.controller.doc,r=this.controller.getActiveFloorId(),s=e.focalPoint??n?.floors?.find(d=>d.id===r)?.focalPoint??n?.focalPoint??{x:0,y:0},o,a,l=!1;if(e.viewUrl){let d,u=null;try{let g=e.viewMeta?.previewUrl;g&&g!==e.viewUrl?(u=await this.buyerAssetUrls.resolve(g),d=e.viewUrl):d=await this.buyerAssetUrls.resolve(e.viewUrl)}catch(g){t===this.seatViewGen&&this.opts.onError?.(g);return}if(t!==this.seatViewGen||!d||e.viewMeta?.previewUrl&&e.viewMeta.previewUrl!==e.viewUrl&&!u||!this.root||!this.seatViewEnabled())return;let h={url:d,...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}:{}};o=h,a=Jd(h),l=Zd(h)}else{let d;try{let{generateSeatPanorama:u}=await Qt();d=u(e,s,this.allSeats())}catch(u){t===this.seatViewGen&&this.opts.onError?.(u);return}if(t!==this.seatViewGen||!this.root||!this.seatViewEnabled())return;o={url:d.url,generated:!0},a=B("picker.illustrationCaption",{m:d.distanceM})}this.closeSeatView(!1);let c=B("picker.viewFromSeat",{label:e.label}),p=ti({root:this.root,source:o,caption:a,real:l,closeLabel:this.tf("picker.close","Close"),dragHint:De(),viewFromSeatLabel:c,real360Label:B("picker.real360"),previewLabel:B("picker.preview"),resolveAsset:d=>this.buyerAssetUrls.resolve(d),onClose:()=>this.closeSeatView()});this.viewEl=p.element,this.viewCleanup=()=>p.dispose()}closeSeatView(e=!0){e&&(this.seatViewGen+=1),this.viewCleanup?.(),this.viewCleanup=null,this.viewEl?.remove(),this.viewEl=null}money(e){let t=this.opts.pricing?.formatter;if(t)return t(e,this.currency);let n=Number.isInteger(e);return Yd(e,this.currency,{locale:this.opts.locale,fallback:(r,s)=>`${r} ${s}`,...n?{minimumFractionDigits:0,maximumFractionDigits:0}:{}})}scheduleOfferBoundary(e){if(this.offerBoundaryTimer&&clearTimeout(this.offerBoundaryTimer),this.offerBoundaryTimer=null,!this.api.availability||this.destroyed)return;let t=Date.now(),n=jr(e,t);if(n==null)return;let r=6*36e5,s=Math.min(Math.max(n-t+1e3,1e3),r);this.offerBoundaryTimer=setTimeout(()=>{this.offerBoundaryTimer=null,!document.hidden&&this.refreshOfferAvailability(!1)},s)}offerReadIsCurrent(){return!!this.offerReadInFlight||Date.now()-this.offerReadSettledAt<ip}scheduleOfferRefresh(e){!this.api.availability||this.destroyed||this.offerReadIsCurrent()||(this.offerRefreshTimer&&clearTimeout(this.offerRefreshTimer),this.offerRefreshTimer=setTimeout(()=>{this.offerRefreshTimer=null,this.refreshOfferAvailability(e)},e?180:0))}refreshOfferAvailability(e){if(!this.api.availability||this.destroyed)return Promise.resolve();if(this.offerReadInFlight)return this.offerReadInFlight;if(this.offerReadIsCurrent())return Promise.resolve();let t=this.readOfferAvailability(e).finally(()=>{this.offerReadInFlight===t&&(this.offerReadInFlight=null)});return this.offerReadInFlight=t,t}async readOfferAvailability(e){if(!(!this.api.availability||this.destroyed))try{let t=await this.api.availability(this.opts.event,e);if(this.destroyed)return;this.offerReadSettledAt=Date.now();let n=en(t);if(!n)return;this.offerAvailability=n,this.applyChannelPricing(n.channelPricing),this.scheduleOfferBoundary(n);let r=tn(n),s={...this.hostPricing?.prices??{},...r},o=Object.keys(s).length>0||this.hostPricing?.formatter?{prices:s,...this.hostPricing?.formatter?{formatter:this.hostPricing.formatter}:{}}:void 0;this.setPricing(o),this.syncOffer(),this.opts.onOfferAvailabilityChange?.(n)}catch{!this.destroyed&&!this.offerBoundaryTimer&&!document.hidden&&(this.offerBoundaryTimer=setTimeout(()=>{this.offerBoundaryTimer=null,!document.hidden&&this.refreshOfferAvailability(!1)},3e4))}}offerPrice(e){return e?this.offerAvailability?.prices.find(t=>t.categoryKey===e)??null:null}applyChannelPricing(e){this.channelByObject.clear(),this.pricesByChannel.clear();for(let t of e?.channels??[])this.pricesByChannel.set(t.channelId,t.priceOverrides);for(let t of e?.objects??[])this.pricesByChannel.has(t.channelId)&&this.channelByObject.set(t.label,t.channelId)}syncOffer(){let e=this.els.offer;if(!e)return;if(this.suppressPricing){e.classList.remove("has"),e.replaceChildren();return}let t=this.offerAvailability,n=t?.release??null,r=n?null:t?.upcoming??null;if(!t||t.state==="closed"||t.state==="sold-out"||!n&&!r){e.classList.remove("has"),e.replaceChildren();return}let s=n??r,o=document.createElement("div");o.className="sl-offer-main";let a=document.createElement("div");a.className="sl-offer-copy";let l=document.createElement("span");l.className="sl-offer-kicker",l.textContent=n?this.tf("picker.currentTicketOffer","Current ticket offer"):this.tf("picker.upcomingTicketOffer","Upcoming ticket offer");let c=document.createElement("strong");c.className="sl-offer-name",c.textContent=s.name||(n?this.tf("picker.currentOffer","Current offer"):this.tf("picker.scheduledOffer","Scheduled offer"));let p=document.createElement("span");p.className="sl-offer-line";let d=[];n&&t.fromPrice!=null&&d.push(this.money(t.fromPrice/100)),n&&s.remaining!=null&&d.push(B("picker.offerRemainingAvailable",{count:s.remaining})),n&&s.endsAt!=null&&d.push(B("picker.offerUntil",{time:Zt(s.endsAt,this.eventTimezone,this.opts.locale)})),r?.startsAt!=null&&d.push(B("picker.offerStarts",{time:Zt(r.startsAt,this.eventTimezone,this.opts.locale)})),p.textContent=d.join(" \xB7 "),a.append(l,c,p);let u=document.createElement("details");u.className="sl-offer-info";let h=document.createElement("summary");h.setAttribute("aria-label",B("picker.howOfferWorks",{name:c.textContent??""})),h.textContent="i";let g=document.createElement("div");g.className="sl-offer-detail",g.textContent=n?this.tf("picker.offerDetailActive","This price applies automatically to eligible seats. Tickets in active carts temporarily reduce the available quantity; released or expired holds return it. When the offer ends, the next matching offer or normal ticket price takes over."):this.tf("picker.offerDetailUpcoming","Tickets are available at their normal price now. This scheduled offer will apply automatically to eligible seats when it starts."),u.append(h,g),o.append(a,u),e.replaceChildren(o),e.classList.add("has")}paidPrice(e,t,n,r){let s=r?this.channelByObject.get(r):void 0;if(s&&e){let a=this.pricesByChannel.get(s)?.find(l=>l.categoryKey===e&&l.tierId===(t??null));if(a)return a.price}let o=e?this.opts.pricing?.prices?.[e]:void 0;return o===void 0?n:typeof o=="number"?o:t&&o.tiers?.[t]!==void 0?o.tiers[t]:o.base??n}legendDeps(){return ta(this)}syncPriceRail(e,t,n=this.legendDeps()){ia(this,e,t,n)}syncPrices(){na(this)}focusCategory(e){ra(this,e)}evictTakenSelections(){let e=new Set([...this.controller.currentHold()?.labels??[],...this.holdingLabels]),t=this.controller.getSelection().filter(n=>!e.has(n.label)&&(this.controller.getStatus(n.id)??"free")!=="free");t.length&&(this.controller.deselect(t.map(n=>n.id)),this.toast(B("picker.seatJustTakenByAnother",{label:t[0].label}),"error"))}syncTray(){if(!this.els.tray)return;this.updateSelectionCapacity();let{seats:e,gaAreas:t,heldItems:n,heldLabels:r,total:s,count:o}=vi(this),a=[],l=new Set;if(!this.salesClosed){let m=this.performanceGroup?.nightSummary?.()??[];m.length&&a.push(fs(m,{title:this.tf("picker.group.yourSeatsByNight","Your seats by night"),empty:this.tf("picker.group.noSeatsChosenYet","No seats yet")}));let A=this.performanceGroup?.selectionModeSwitch;A&&a.push(`<button type="button" class="sl-pg-switch" data-pg-switch-mode>${H(A.label)}</button>`)}a.push(Co({salesClosed:this.salesClosed,hasPicks:e.length>0||n.length>0,hasGaAreas:t.length>0,groupMode:this.performanceGroup?this.performanceGroup.selectionMode??"same_seat":null,seated:!!this.controller.doc?.objects?.some(m=>m.type!=="gaArea"),venue3d:this.buyerView==="venue3d",whenText:this.eventWhenText?String(this.eventWhenText):void 0}));let c=!e.length&&!n.length&&!Le(this.gaQty,this.hold?.items??[]);if((c||this.root?.dataset.layout==="narrow")&&(this.baReopen=!1),!this.performanceGroup&&!this.salesClosed&&!this.hold&&(c||this.baReopen||this.bestAvailableBusy||this.bestAvailableConfirm)){let m=(this.controller.doc?.categories??[]).filter(_=>!_.notForSale),A=this.controller.getBestAvailableZones();this.baZone&&!A.some(_=>_.id===this.baZone)&&(this.baZone=""),a.push(Eo({confirming:this.bestAvailableConfirm,busy:this.bestAvailableBusy,reopened:this.baReopen,quantity:this.baQty,premium:this.baPremium,offerPremium:this.controller.hasPremiumSeats(),categories:m,zones:A,selectedCategory:this.baCat,selectedZone:this.baZone}))}let p=(m,A,_,k=1,M,L,C)=>So({categoryLabel:C,d:m?this.controller.seatDetails(m):null,area:_==="ga"?t.find(D=>D.id===M):void 0,label:A,objectType:_,quantity:k,identity:L,performanceLabel:this.performanceGroup?.activePerformanceLabel?.(),performanceDates:this.performanceGroup?.selectedPerformanceDates?.()}),d=H,u=[];for(let m of rr(n)){let A=m.objectType==="ga"?`held:ga:${m.objectId}:${m.tierId??""}`:`held:${m.label}`;l.add(A);let _=this.controller.doc?.categories.find(j=>j.key===m.categoryKey),k=m.tierId?_?.tiers?.find(j=>j.id===m.tierId)?.name:void 0,M=m.objectType!=="ga"?this.controller.seatByLabel(m.label):null,L=m.objectType==="table"?this.controller.tableSelection(m.label):null,C=M?this.controller.seatDetails(M.id):null,D=this.seatViewEnabled()&&!!M&&m.objectType!=="table"&&!!this.deliverableViewReference(M),R=d(this.tf("picker.heldForYou","Held for you")),N=(L?.bookingMode==="variable"?`<button type="button" class="sl-table-edit" data-table-edit="${d(encodeURIComponent(m.label))}">${d(B("picker.guestsCountEdit",{count:m.quantity??1}))}</button>`:"")+At(M?.wheelchairSpaceType)+rn(M?.commercial),te=this.paidPrice(m.categoryKey,m.tierId,m.unitPrice,m.label)*(m.quantity??1);u.push({key:A,fresh:!this.lastTrayKeys.has(A),held:!0,seatIds:[],heldLabels:m.labels,removeAria:B("picker.removeHeldTicketLabel",{label:$i(m,t)}),locateId:M?.id??null,section:C?.sectionLabel??"",rowLabel:C&&G(C)||"",seatLabel:C?.seatNumber??m.label,categoryLabel:`${_?.label??m.categoryKey}${k?` \xB7 ${k}`:""}`,categoryColor:this.controller.getRenderer?.()?.categoryDisplayColor?.(m.categoryKey)??_?.color??"",identityHtml:p(M?.id??null,m.label,m.objectType,m.quantity??1,m.objectId,L??void 0,`${_?.label??m.categoryKey}${k?` \xB7 ${k}`:""}`),stateHtml:`<span class="sl-ticket-state held" aria-label="${R}" title="${R}"><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:N,amount:te,amountText:this.suppressPricing?"":this.money(te),noteHtml:sn(M?.commercial),railHtml:this.performanceGroup?"":yn(B("picker.removeHeldTicketLabel",{label:$i(m,t)}),D?m.label:null),groupable:!N&&!!C?.sectionLabel&&!this.performanceGroup})}let h=this.seatViewEnabled();for(let m of e.filter(A=>!r.has(A.label))){let A=`seat:${m.id}`;l.add(A);let _=this.controller.doc?.categories.find(j=>j.key===m.categoryKey),k=m.tiers&&m.tiers.length&&!this.suppressPricing?`<select class="tier" data-tier="${d(m.id)}" aria-label="${d(B("picker.ticketTierFor",{label:m.label}))}">`+m.tiers.map(j=>`<option value="${d(j.id)}"${j.id===m.tierId?" selected":""}>${d(j.name)} \xB7 ${d(this.money(this.paidPrice(m.categoryKey,j.id,j.price,m.label)))}</option>`).join("")+"</select>":"",M=m.tiers?.find(j=>j.id===m.tierId)??m.tiers?.[0],L=M?.buyerMessage?.trim()||(M?.restriction==="companion"?this.tf("picker.companionRequiresWheelchair","Requires the adjacent wheelchair place"):""),C=this.controller.seatDetails(m.id),D=d(this.tf("picker.selected","Selected")),R=B("picker.removeSeatLabel",{label:m.label}),N=(m.objectType==="table"&&m.bookingMode==="variable"?`<button type="button" class="sl-table-edit" data-table-edit="${d(encodeURIComponent(m.label))}">${d(B("picker.guestsCountEdit",{count:m.quantity??1}))}</button>`:"")+At(m.wheelchairSpaceType)+rn(m.commercial)+k,te=this.paidPrice(m.categoryKey,m.tierId??null,m.price,m.label)*(m.quantity??1);u.push({key:A,fresh:!this.lastTrayKeys.has(A),held:!1,seatIds:[m.id],heldLabels:[],locateId:m.id,section:C?.sectionLabel??"",rowLabel:C&&G(C)||"",seatLabel:C?.seatNumber??m.label,categoryLabel:_?.label??m.categoryKey,identityHtml:p(m.id,m.label,m.objectType,m.quantity??1,m.objectId,m,_?.label??m.categoryKey),categoryColor:this.controller.getRenderer?.()?.categoryDisplayColor?.(m.categoryKey)??_?.color??"",stateHtml:`<span class="sl-ticket-state" aria-label="${D}" title="${D}"><svg viewBox="0 0 24 24"><path d="M5 12l4 4L19 6"/></svg></span>`,extrasHtml:N,amount:te,amountText:this.suppressPricing?"":this.money(te),removeAria:R,noteHtml:sn(m.commercial)+(L?`<small class="sl-tier-note">${d(L)}</small>`:""),railHtml:yn(R,h&&m.objectType!=="table"&&this.deliverableViewReference(this.controller.seatByLabel(m.label)??{})?m.label:null),groupable:!N&&!L&&!!C?.sectionLabel&&!this.performanceGroup})}u.length&&a.push(this.root?.dataset.layout==="narrow"?fa(u,{money:m=>this.money(m),suppressPricing:this.suppressPricing}):u.map(ma).join("")),t.length&&a.push(cr(this,t,n)),!this.performanceGroup&&!this.salesClosed&&!this.hold&&!c&&!this.baReopen&&!this.bestAvailableBusy&&!this.bestAvailableConfirm&&a.push(`<button type="button" class="sl-ba-reopen" data-ba-reopen><span aria-hidden="true">\u2726</span>${d(this.tf("picker.findTogetherInstead","Find seats together instead"))}</button>`),this.els.tray.innerHTML=a.join("")+(this.salesClosed?"":this.lapse.noteHtml()),this.lastTrayKeys=l,ga(this.els.tray),this.lapse.wire(this.els.tray),this.els.tray.querySelector("[data-pg-switch-mode]")?.addEventListener("click",()=>this.performanceGroup?.selectionModeSwitch?.activate());let g=this.performanceGroup?.selectNight;g&&Cs(this.els.tray,m=>g(m)),this.els.tray.querySelectorAll("[data-ba]").forEach(m=>{m.addEventListener("click",()=>{this.baQty=Math.max(1,Math.min(this.maxTickets,this.baQty+Number(m.dataset.ba))),this.syncTray()})}),this.els.tray.querySelector("[data-ba-cat]")?.addEventListener("change",m=>{this.baCat=m.target.value}),this.els.tray.querySelector("[data-ba-zone]")?.addEventListener("change",m=>{this.baZone=m.target.value}),this.els.tray.querySelector("[data-ba-premium]")?.addEventListener("click",()=>{this.baPremium=!this.baPremium,this.syncTray()}),this.els.tray.querySelector(".sl-ba-go")?.addEventListener("click",()=>{if(this.pendingSelectionCount()>0){this.bestAvailableConfirm=!0,this.syncTray(),this.els.tray.querySelector("[data-ba-replace]")?.focus();return}this.bestAvailable(this.baQty,this.baCat||void 0,{preferPremium:this.baPremium,zoneId:this.baZone||void 0})}),this.els.tray.querySelector("[data-ba-cancel]")?.addEventListener("click",()=>{this.bestAvailableConfirm=!1,this.syncTray(),this.els.tray.querySelector(".sl-ba-go")?.focus()}),this.els.tray.querySelector("[data-ba-reopen]")?.addEventListener("click",()=>{this.baReopen=!0,this.syncTray(),this.els.tray.querySelector(".sl-ba-go")?.focus()}),this.els.tray.querySelector("[data-ba-close]")?.addEventListener("click",()=>{this.baReopen=!1,this.syncTray(),this.els.tray.querySelector("[data-ba-reopen]")?.focus()}),this.els.tray.querySelector("[data-ba-replace]")?.addEventListener("click",()=>{this.bestAvailableConfirm=!1,this.bestAvailable(this.baQty,this.baCat||void 0,{preferPremium:this.baPremium,zoneId:this.baZone||void 0})}),this.els.tray.querySelectorAll(".sl-chip .rm").forEach(m=>{m.addEventListener("click",()=>{let A=m.closest(".sl-chip");if(A.dataset.held){this.removeHeldLabels(decodeURIComponent(A.dataset.held).split(`
2809
+ `),A);return}let _=A.dataset.seat.split(" "),k=()=>{this.controller.deselect(_)};if(this.reducedMotion()){k();return}A.classList.remove("sl-enter"),A.classList.add("sl-leave","sl-mo-collapse"),this.scheduleMotion(k,U.collapse)})}),this.els.tray.querySelectorAll("[data-table-edit]").forEach(m=>{m.addEventListener("click",A=>{A.stopPropagation();let _=decodeURIComponent(m.dataset.tableEdit??""),k=this.controller.tableSelection(_);if(!k)return;let M=n.find(L=>L.label===_&&L.objectType==="table");this.showTableDialog({...k,quantity:M?.quantity??k.quantity},!!M,m)})}),this.els.tray.querySelectorAll(".sl-chip .tier").forEach(m=>{m.addEventListener("change",()=>this.controller.setSeatTier(m.dataset.tier,m.value||null))}),this.els.tray.querySelectorAll(".sl-chip .view[data-view-label]").forEach(m=>{m.addEventListener("click",()=>{let A=this.controller.seatByLabel(m.dataset.viewLabel);A&&this.openSeatView(A)})}),this.els.tray.querySelectorAll(".sl-chip[data-locate]").forEach(m=>{let A=()=>this.controller.flashSeat(m.dataset.locate,this.cssVar("--sl-accent")||"#f4b740");m.addEventListener("mouseenter",A),m.addEventListener("focusin",A)}),dr(this,this.els.tray,t),this.controller.setGASelection(tr(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(m=>{m.disabled=!0});let b=this.pendingSelectionCount(),w=this.lastTrayCount,x=this.lastTrayTotal,y=Es(this.performanceGroup?.groupSelectionSummary?.(),this.performanceGroup?.selectionMode??"same_seat");this.els.count.textContent=y||(o?Li("picker.ticketsCount",o):this.tf("picker.noSeatsSelected","No seats selected")),this.els.total.textContent=o&&!this.suppressPricing?this.money(s):"",this.root?.setAttribute("data-has-selection",String(o>0)),this.root?.setAttribute("data-ba-active",String(this.bestAvailableConfirm||this.bestAvailableBusy||this.baReopen)),this.els.foot?.classList.toggle("empty",o===0),this.els.seatSummary&&(this.els.seatSummary.textContent=y||(o?Li("picker.seatsSelectedCount",o):"")),this.syncCta(o,b),o!==w&&this.animateOnce(this.els.count,"sl-value-pop",380),s!==x&&this.animateOnce(this.els.total,"sl-value-pop",380),w===0&&o>0&&(this.animateOnce(this.els.cta,"sl-ready",520),this.sideCollapsed&&this.root?.dataset.layout!=="narrow"&&this.setPanelCollapsed(!1)),this.renderPeek(o,s,b,o>w),this.lastTrayCount=o,this.lastTrayTotal=s,this.opts.onSelectionChange?.(e),this.emitSelectionValidity(o,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(){Nr(this.confirmEl?.querySelector(".sl-confirm-row")),this.els.tray?.querySelectorAll(".sl-chip-pos").forEach(Fr),this.els.tray?.querySelectorAll(".sl-ba-go,.sl-ba-reopen").forEach(Ji),this.els.peek?.querySelectorAll(".sl-sheet-go").forEach(Ji)}emitSelectionValidity(e,t){let n=this.controller.getSelectionValidity(e);n&&(n.seats=t,this.opts.onSelectionValidityChange?.(n),n.isValid?this.lastSelectionValidity!==!0&&this.opts.onSelectionValid?.(t):this.lastSelectionValidity!==!1&&this.opts.onSelectionInvalid?.(n),this.lastSelectionValidity=n.isValid)}renderPeek(e,t,n,r=!1){if(!this.els.peek)return;let s=(this.controller.doc?.categories??[]).map(o=>this.catPrice(o)).filter(o=>o!=null);this.els.peek.innerHTML=To({count:e,total:t,pendingCount:n,ctaPhase:this.ctaPhase,hasHold:!!this.hold,salesClosed:this.salesClosed,suppressPricing:this.suppressPricing,fromPrice:s.length?Math.min(...s):null,addMore:this.root?.dataset.layout==="narrow"?null:ko({salesClosed:this.salesClosed,hasHold:!!this.hold,ctaPhase:this.ctaPhase,formOpen:this.baReopen||this.bestAvailableBusy||this.bestAvailableConfirm,room:this.maxTickets-this.totalTicketCount(),wanted:this.baQty}),offerFind:!this.performanceGroup&&!this.salesClosed&&!this.hold,holdTime:this.hold&&this.holdTimer?Mt(Math.max(0,this.holdExpiresAt-Date.now())):null,money:o=>this.money(o)}),this.root&&(this.root.dataset.peekClock=String(!!this.els.peek.querySelector(".sl-peek-time"))),r&&this.animateOnce(this.els.peek.querySelector(".sl-peek-sum")??void 0,"sl-peek-bump",240),this.scheduleFit()}async removeHeldLabels(e,t){let n=e.filter(o=>o&&!this.releasingLabels.has(o));if(!n.length)return!1;let r=n[0];n.forEach(o=>this.releasingLabels.add(o)),t?.setAttribute("aria-busy","true");let s=t?.querySelector(".rm");s&&(s.disabled=!0);try{let o=this.handedOff;if(!await this.controller.releaseLabels(n))return this.toast(B("picker.couldNotRemoveLabel",{label:r}),"error"),!1;sr(this.gaQty,this.hold?.items??[],n);let l=this.controller.currentHold();return this.hold=l?{holdId:l.holdId,expiresAt:l.expiresAt,seats:l.seats,items:l.items}:null,this.handedOff=!!this.hold&&o,this.bookedShown=!1,this.ctaPhase="idle",this.hold?this.startHoldTimer(this.hold.expiresAt):(this.stopHoldTimer(),this.forgetHold()),this.syncTray(),this.emitHoldChange(),!0}finally{n.forEach(o=>this.releasingLabels.delete(o)),t?.removeAttribute("aria-busy"),s?.isConnected&&(s.disabled=!1)}}async handleCta(){if(this.salesClosed)return;let e=this.controller.getSelectionValidity(this.totalTicketCount());if(e&&!e.isValid){this.toast(ki(e,(n,r)=>this.tf(n,r)),"warning");return}if(this.totalTicketCount()>this.maxTickets){this.toast(B("picker.removeTicketsUntilOrFewer",{count:this.maxTickets}),"warning");return}let t=this.committedSelection();if(this.hold&&!t.some(n=>!(this.hold.items??[]).some(r=>r.label===n.label))){let n=this.hold.seats??t;this.handedOff=!0,this.holdConflicted=!1,await this.runCheckoutHandoff(this.hold,n);return}this.holdingLabels=new Set(t.map(n=>n.label)),this.setCtaPhase("holding");try{let n=null,r=er(this.gaQty),s=this.committedSelection();if(s.length){let o=await this.controller.hold(void 0,this.opts.holdTtlMs);n=o?{holdId:o.holdId,expiresAt:o.expiresAt,seats:o.seats,items:o.items}:null}for(let{areaId:o,tierId:a,qty:l}of r){let c=await this.controller.holdGA(o,l,{tierId:a,ttlMs:this.opts.holdTtlMs});n=c?{holdId:c.holdId,expiresAt:c.expiresAt,seats:c.seats,items:c.items}:n}if(!n){this.raiseHoldConflict(this.tf("picker.seatsJustTaken","One or more seats were just taken. Please pick again.")),this.setCtaPhase("idle"),this.syncTray();return}this.hold=n,this.holdConflicted=!1,this.handedOff=!this.performanceGroup,this.startHoldTimer(n.expiresAt),this.flashHeldSeats(n),this.emitHoldChange(),this.performanceGroup?this.setCtaPhase("idle"):await this.runCheckoutHandoff(n,n.seats??s)}catch(n){this.opts.onError?.(n);let r=n,s=(r.conflicts??[]).map(a=>a.label).filter(Boolean).slice(0,3);r.reason==="event_closed"&&this.setSalesClosed(!0);let o=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?B("picker.labelsNoLongerAvailable.one",{labels:s.join(", ")}):B("picker.labelsNoLongerAvailable.other",{labels:s.join(", ")}):this.tf("picker.seatsJustTaken","One or more seats were just taken. Please pick again.");this.raiseHoldConflict(o),this.setCtaPhase("idle")}finally{this.holdingLabels.clear(),this.ctaPhase==="holding"&&(this.ctaPhase="idle"),this.syncTray()}}startHoldTimer(e){jo(this,e)}stopHoldTimer(){Go(this)}setExtendPrompt(e,t){qo(this,e,t)}refreshExtendPrompt(){Uo(this)}handleExtend(){return Ko(this)}detectBooked(){this.bookedShown||!this.handedOff||!this.hold||this.controller.currentHold()===null&&(this.holdConflicted||this.showBooked())}raiseHoldConflict(e){this.holdConflicted=!0,this.bookedShown&&(this.bookedShown=!1,this.bookedEl?.classList.remove("on")),this.toast(e,"error")}showBooked(){if(this.bookedShown||!this.hold||this.holdConflicted)return;this.bookedShown=!0;let e=this.buildHandoff(this.hold);this.stopHoldTimer(),this.forgetHold();let t=e.lineItems.reduce((r,s)=>r+s.quantity,0),n=this.performanceGroup?.groupSelectionSummary?.();this.els.bookedSub&&(this.els.bookedSub.innerHTML=n?.seats?`<span class="sl-booked-seats">${Li("picker.group.ticketsConfirmedAcross",n.seats,{performances:n.performances})}</span>`:`<span class="sl-booked-seats">${Li("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(r=>{let o=[r.sectionLabel,r.rowLabel&&`${this.tf("picker.row","Row")} ${r.rowLabel}`,r.seatNumber&&`${this.tf("picker.seat","Seat")} ${r.seatNumber}`].filter(Boolean).join(" \xB7 ")||r.displayLabel||r.label,a=r.quantity>1?` <span class="sl-booked-qty">\xD7${r.quantity}</span>`:"";return`<li>${H(o)}${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.root?.focus({preventScroll:!0})}notifyGroupSettled(e){e==="booked"?this.showBooked():this.dismissConfirm(),this.hold=null,this.handedOff=!1,this.ctaPhase="idle",this.stopHoldTimer(),this.forgetHold(),this.syncTray(),this.syncCta()}async checkoutHandoff(e,t){if(this.checkoutMode==="hosted"){await this.startHostedCheckout(e,t);return}await this.opts.onCheckout?.(e,t,this.buildHandoff(e))}async startHostedCheckout(e,t){let n=this.buildHandoff(e),r=null;try{r=await(this.paymentOptions??=this.pubApi.paymentOptions(this.opts.event))}catch(o){this.opts.onError?.(o)}if(this.destroyed)return;let s=r?.providers?.[0];if(!s){let o=wr(r?.reason),a=!!this.opts.onCheckoutUnavailable||!!this.opts.onCheckout;this.opts.onCheckoutUnavailable?.({reason:o,handoff:n}),this.opts.onCheckout?.(e,t,n),a||this.openCheckoutPanel({kind:"unavailable",reason:o,seatCount:n.lineItems.reduce((l,c)=>l+c.quantity,0)});return}await this.openCheckoutPanel({kind:"pay",provider:s,order:{holdId:n.holdId,expiresAt:n.expiresAt,currency:n.currency,total:n.total,labels:n.lineItems.map(o=>o.displayLabel??o.label)}})}async openCheckoutPanel(e){let t;try{({mountCheckout:t}=await yr())}catch(n){this.opts.onError?.(n),this.toast(this.tf("picker.checkoutCouldNotBeOpened","Checkout could not be opened. Your seats are still held \u2014 please try again."),"error"),this.setCtaPhase("idle");return}this.destroyed||!this.root||(this.closeCheckoutPanel(),this.checkoutPanel=t({root:this.root,state:e,eventKey:this.opts.event,formatMoney:n=>this.money(n),startSession:n=>this.pubApi.startCheckout(this.opts.event,{...n,...this.opts.returnUrl?{returnUrl:this.opts.returnUrl}:{}}),orderStatus:n=>this.pubApi.orderStatus(n),onCancel:()=>{this.checkoutPanel=null,this.hold||this.setCtaPhase("idle")},onConfirmed:n=>{this.opts.onOrderConfirmed?.(n),this.controller.refresh()},onError:n=>this.opts.onError?.(n)}))}closeCheckoutPanel(){this.checkoutPanel?.destroy(),this.checkoutPanel=null}buildHandoff(e){let n=(e.items??[]).map(o=>{let a=this.controller.lineItemDisplay(o);return{label:o.label,...a.displayLabel?{displayLabel:a.displayLabel}:{},...a.displayType?{displayType:a.displayType}:{},objectId:o.objectId,objectType:o.objectType,categoryKey:o.categoryKey,tierId:o.tierId,unitPrice:this.paidPrice(o.categoryKey,o.tierId,o.unitPrice,o.label),currency:o.currency??this.currency,quantity:o.quantity??1}}),r=n[0]?.currency??this.currency,s=n.reduce((o,a)=>o+a.unitPrice*a.quantity,0);return{holdId:e.holdId,expiresAt:e.expiresAt,currency:r,lineItems:n,total:s}}emitHoldChange(){let e=this.hold;this.scheduleOfferRefresh(!0),this.opts.onHoldChange?.(e,e?.seats??[],e?this.buildHandoff(e):null)}toast(e,t="neutral",n){let r=this.els.toast;if(!r)return;r.replaceChildren();let s=document.createElement("span");if(s.textContent=e,r.appendChild(s),r.classList.toggle("has-action",!!n),n){let o=document.createElement("button");o.type="button",o.className="sl-toast-action",o.textContent=n.label,o.addEventListener("click",n.onClick,{once:!0}),r.appendChild(o)}r.dataset.tone=t,r.classList.add("on","sl-mo-rise"),this.liftToastOverConfirmSoon(),this.toastTimer&&clearTimeout(this.toastTimer),this.toastTimer=setTimeout(()=>{r.classList.remove("on","sl-mo-rise"),r.classList.remove("has-action"),r.dataset.tone="neutral",this.liftToastOverConfirm()},4200)}liftToastOverConfirm(){let e=this.regions["bottom-center"];if(!e)return;let t=this.els.toast?.classList.contains("on")||this.extendEl?.classList.contains("on"),n=this.confirmEl;if(!t||!n?.isConnected){e.style.removeProperty("bottom");return}let r=this.els.map.clientHeight;if(r<=0)return;let s=n.getBoundingClientRect(),o=s.height||n.offsetHeight||sp,a=s.height?s.top-this.els.map.getBoundingClientRect().top:r-dn-o,l=Math.round(r-a+np);if(l+rp>r){e.style.removeProperty("bottom");return}e.style.bottom=`${l}px`}liftToastOverConfirmSoon(){this.liftToastOverConfirm(),typeof requestAnimationFrame=="function"&&requestAnimationFrame(()=>{this.destroyed||this.liftToastOverConfirm()})}dismissSkeleton(){zs({boot:this.els.boot,map:this.els.map,rail:this.els.rail,root:this.root,reducedMotion:this.reducedMotion()})}placeTooltip(){if(!this.tipEl)return;let e={width:this.els.map.clientWidth,height:this.els.map.clientHeight},t={width:this.tipEl.offsetWidth,height:this.tipEl.offsetHeight},n=this.tipPinned?Ls(this.tipPos,e,t):null,r=n??Ps(this.tipPos,e.width,e.height,t);this.tipEl.style.left=`${r.left}px`,this.tipEl.style.top=`${r.top}px`,n?this.tipEl.dataset.placement=n.placement:delete this.tipEl.dataset.placement}nightStripFor(e,t){let n=this.performanceGroup,r=ln(e.mark,n?.nights?.()),s=r?.states.filter(o=>o.free).length??0;return gs(r,{locale:this.opts.locale,switchLabel:n?.selectionModeSwitch?.label??null,selectPartialLabel:n?.partialSeatSelection?.label(s)??null,pinned:t})}unavailableReason(e){return!e.unavailable||e.mark?.kind==="partial"?"":e.status==="held"?this.tf("picker.heldByOther","Held by another buyer \u2014 may become available"):e.status==="not_for_sale"?this.tf("picker.notForSaleExplanation","This seat is not included in the current sale."):e.status==="free"?"":this.tf("picker.soldSeatExplanation","This seat has already been booked.")}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()}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}let n=this.unavailableReason(e),r=e.mark?.kind==="partial"&&(e.interaction==="press"||this.lastPointerType!=="mouse"||t)||!!n&&e.interaction==="press";this.tipMarkedHoverLabel=e.mark?.kind==="partial"?e.label:null;let s=this.nightStripFor(e,r);this.tipEl.style.setProperty("--sl-cat",e.categoryColor),this.tipEl.innerHTML=As(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:Fe(e),reason:n,extra:s+(r?`<button type="button" class="sl-tip-close" data-pg-tip-close aria-label="${H(this.tf("picker.group.closeSeatDetails","Close seat details"))}">\xD7</button>`:"")}),this.tipPinned=r,this.tipEl.classList.toggle("sl-tip-pinned",r),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()}),Rs(this.tipEl,this.performanceGroup?.partialSeatSelection?.label,o=>{this.unpinTooltip(),this.performanceGroup?.partialSeatSelection?.activate(e.id,o)}),this.tipEl.style.display="block",this.placeTooltip()}syncSeatMarks(){let e=this.performanceGroup?.seatMarks,t=this.controller.getRenderer();if(!e||!t?.setSeatMarks)return;let n={};for(let[r,s]of Object.entries(e())){let o=this.controller.idForLabel(r);o&&(n[o]=s)}Object.keys(n).length&&t.setSeatMarks(n)}getSelection(){return this.committedSelection()}selectObjects(e){return this.controller.select(e)}selectObjectsWithoutConfirmation(e){let t=new Set(e),n=this.controller.getSelection().filter(r=>t.has(r.id)||t.has(r.label));if(n.length===t.size)return n;this.suppressConfirmationSeatId=e[0]??null;try{return this.controller.select(e)}finally{this.suppressConfirmationSeatId=null}}deselectObjects(e){this.controller.deselect(e)}clearSelection(){this.dismissConfirm(),this.dismissTableDialog(),this.controller.clearSelection()}categoryLegendColor(){let e=(this.controller.doc?.categories??[]).find(t=>!t.notForSale);return(e?this.controller.getRenderer()?.categoryDisplayColor?.(e.key):null)||e?.color||"#2563eb"}async refreshAvailability(){await this.controller.refresh(),this.syncSeatMarks(),this.syncTray()}refreshPerformanceGroupComposition(){this.syncTray()}async adoptRestoredHold(e){!e||this.hold||await this.resumeHoldFromServer(e)}selectCategories(e){return this.controller.selectCategories(e)}deselectCategories(e){this.controller.deselectCategories(e)}setSelectableObjects(e){this.controller.setSelectableObjects(e)}setMaxSelection(e){this.maxTickets=Math.max(this.exactTickets??1,Math.floor(e)),this.controller.setMaxSelection(this.maxTickets),this.updateSelectionCapacity(),this.syncTray()}getSelectionValidity(){let e=this.controller.getSelectionValidity(this.totalTicketCount());return e&&(e.seats=this.committedSelection()),e}setMapTheme(e){this.destroyed||(this.opts.theme={...this.opts.theme??{},map:e??void 0},this.controller.setMapTheme(e),this.applyMapChromeTokens(),this.minimap?.refreshMinimap())}applyThemeTokens(e){let t=Bt(this.themeMode),n=Ue(this.controller.doc?.theme,this.opts.theme,t);for(let[r,s]of Object.entries(n))e.style.setProperty(r,s);t?e.dataset.theme=t:delete e.dataset.theme,this.applyMapChromeTokens()}watchThemeMode(){this.colorSchemeStop?.(),this.colorSchemeStop=null,this.themeMode==="auto"&&(this.colorSchemeStop=Nt(()=>{this.destroyed||this.repaintForThemeMode()}))}repaintForThemeMode(){this.root&&(this.applyThemeTokens(this.root),this.controller.setMapTheme(qe(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:Bt(e)??null}))}getThemeMode(){return this.themeMode}applyMapChromeTokens(){let e=this.els.map?.parentElement;if(!e||!this.root)return;let t=Bt(this.themeMode),n=Ue(this.controller.doc?.theme,this.opts.theme,t),r=qe(this.opts.theme,this.themeMode)?.background??this.controller.doc?.theme?.background??void 0,s=Vn(n,r);for(let o of Fn)s?e.style.setProperty(o,s[o]):e.style.removeProperty(o)}setEventDetailsHidden(e){this.eventDetailsHidden=e,this.syncFullscreenButtons()}setPricing(e){let t=JSON.stringify(this.opts.pricing??null),n=JSON.stringify(e??null);t!==n&&(this.opts.pricing=e,!(this.destroyed||!this.els.prices)&&(this.els.pricesSec?.querySelector(".sl-price-select")?.remove(),this.buildPriceFilter(),this.syncPrices(),this.syncTray(),this.lastSection&&this.showSectionCard(this.lastSection)))}buildLanguageSwitcher(e){this.langSel=Wn(e,{languages:this.opts.languages,label:this.tf("picker.preferredTicketType","Language"),onChange:t=>{this.setLocale(t)}})}async setLocale(e){let t=Ta(),n=this.localeGeneration+=1,r=await Xd(e);return this.opts.messages&&Qd(this.opts.messages),r===t||this.applyActiveLocale(r,n),r}applyActiveLocale(e,t){t===this.localeGeneration&&this.root&&(Yn(e,{root:this.root,painters:[()=>this.syncTray(),()=>this.syncPrices(),()=>this.syncOffer(),()=>this.syncRung(),()=>this.syncFloors(),()=>this.syncPanelToggle(),()=>this.syncFullscreenButtons()],refreshMapCopy:()=>this.controller.refreshMapCopy(),languageSelect:this.langSel}),this.scheduleFit())}isColorblindSafe(){return this.cbSafe}setColorblindSafe(e){e!==this.cbSafe&&(this.cbSafe=e,this.cbEl?.setAttribute("aria-pressed",String(e)),this.controller.setColorblindSafe(e),this.syncPrices(),this.minimap?.refreshMinimap(),ap(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 no(this)}setBuyerView(e,t){ro(this,e,t)}seatState3dFor(e){return so(this,e)}pushAvailabilityTo3d(){oo(this)}syncSelectionTo3d(){ao(this)}seatViewFor3d(e){return lo(this,e)}onView3dSeatPick(e){co(this,e)}seatViewCaption(e){return po(this,e)}showUnavailable3dSeat(e,t,n){ho(this,e,t,n)}dismissUnavailable3dSeat(){uo(this)}saveView3dComparisonSeat(e){mo(this,e)}clearView3dComparison(){fo(this)}view3dComparisonSnapshot(e){return go(this,e)}enter3d(e){return bo(this,e)}publish3dTopInset(){vo(this)}exit3d(){yo(this)}openSeatConfidencePassport(e,t=null){bn(this,e,t)}closeSeatConfidencePassport(e=!0){Lt(this,e)}openView3dComparison(){Zs(this)}closeView3dComparison(e=!0){Ve(this,e)}getCurrentHold(){return this.hold}async resumeHold(e){return this.resumeHoldFromServer(e)}async removeHeldTicket(e){return this.removeHeldLabels([e])}async bestAvailable(e,t,n={}){if(this.salesClosed||this.bestAvailableBusy)return null;e=Math.max(1,Math.min(this.maxTickets,Math.floor(e)));try{return await this.bestAvailableOrThrow(e,t,n)}catch(r){this.opts.onError?.(r);let s=r?.reason,o=s==="not_enough_together"?B("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(o,"error"),null}}async bestAvailableOrThrow(e,t,n={}){if(this.salesClosed)throw new Error("seatlayer: seat sales are closed");if(this.bestAvailableBusy)throw new Error("seatlayer: Best Available is already in progress");if(!Number.isInteger(e)||e<1)throw new Error("seatlayer: Best Available quantity must be a positive integer");this.confirmSeat&&this.cancelConfirm(),this.bestAvailableConfirm=!1,this.bestAvailableBusy=!0;let 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,{...n,ttlMs:this.opts.holdTtlMs});return s?(this.hold={holdId:s.holdId,expiresAt:s.expiresAt,seats:s.seats,items:s.items},this.handedOff=!1,this.bookedShown=!1,this.gaQty.clear(),this.startHoldTimer(s.expiresAt),this.flashHeldSeats(this.hold),this.syncTray(),this.emitHoldChange(),n.preferPremium&&s.seats.length&&!s.seats.every(o=>o.commercial?.premium)&&this.toast(B("picker.premiumFallbackNote",{count:e}),"neutral"),this.hold):null}finally{this.bestAvailableBusy=!1,this.syncTray()}}async release(){let e=this.hold,t=this.controller.currentHold(),n=!0;if(t)n=await this.controller.release();else if(e){let r=[...new Set([...(e.items??[]).map(s=>s.label),...(e.seats??[]).map(s=>s.label)])];if(r.length)try{await this.api.release(this.opts.event,r,e.holdId)}catch(s){this.opts.onError?.(s),n=!1}}if(!n){this.toast(this.tf("picker.couldNotReleaseTickets","Couldn't release your tickets. Your hold is unchanged."),"error");return}this.hold=null,this.forgetHold(),this.handedOff=!1,this.bookedShown=!1,this.ctaPhase="idle",this.stopHoldTimer(),this.gaQty.clear(),this.syncTray(),this.emitHoldChange()}startRealtime(){if(!this.access?.configured||!this.pubApi||this.realtime)return;let e=this.opts.event;this.realtime=new ve({url:this.pubApi.subscribeUrl(e),mintTicket:()=>this.pubApi.subscribeTicket(e),onAccessUnavailable:t=>{this.opts.onAccessUnavailable?.(t),this.showAccessPanel(t)},sink:mt(this.controller,{flashOnLiveChange:!0,ownLabels:()=>this.holdingLabels,onStatusChange:()=>{this.syncPrices(),this.scheduleOfferRefresh(!0),this.detectBooked(),this.minimap?.refreshMinimap(),this.pushAvailabilityTo3d()},onSelectedObjectUnavailable:(t,n)=>{this.opts.onSelectedObjectUnavailable?.({labels:t,reason:n}),this.syncTray(),this.toast(n==="ineligible"?this.tf("picker.seatNoLongerYours","Some seats are no longer available to you. They have been removed from your order."):this.tf("picker.seatTaken","Someone else took a seat you had picked. It has been removed from your order."),"warning")}})}),this.realtime.start()}async refreshAccess(){return!this.access?.configured||!await this.access.refresh("manual")?!1:(this.dismissAccessPanel(),await this.controller.refresh(),this.realtime?this.realtime.restart():this.startRealtime(),!0)}clearDecisionSurfaces(){this.dismissConfirm(),this.dismissTableDialog(!1),pe(this,!1)}showAccessPanel(e){if(this.destroyed||!this.root)return;this.dismissAccessPanel(),this.clearDecisionSurfaces();let t=as(e.reason,()=>this.recoverAccess());(this.root.querySelector(".sl-body")??this.root).appendChild(t),this.accessEl=t}async recoverAccess(){return await this.refreshAccess()?!0:(this.opts.onAccessUnavailable||typeof window>"u"||window.location.reload(),!1)}dismissAccessPanel(){this.accessEl?.remove(),this.accessEl=null}showHoldExpired(){if(this.destroyed||!this.root||this.holdExpiredEl)return;this.clearDecisionSurfaces();let e=da({restart:()=>this.restartAfterHoldExpiry()},this.holdExpiredUnits);this.root.appendChild(e),this.holdExpiredEl=e,requestAnimationFrame(()=>e.querySelector(".sl-interrupt-act")?.focus());let t=this.holdExpiredUnits;this.holdExpiredFresh=!1,this.refreshAvailability().then(()=>{if(this.destroyed||this.holdExpiredEl!==e)return;this.holdExpiredFresh=!0;let n=t.filter(o=>o.objectType!=="ga"),r=[],s=[];for(let o of n){let a=this.controller.seatByLabel(o.label);(a&&this.controller.getStatus(a.id)==="free"?r:s).push(o.label)}ca(e,{recoverable:r,taken:s,onRecover:o=>this.recoverAfterHoldExpiry(o)})}).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||la({reducedMotion:this.reducedMotion(),accent:this.cssVar("--sl-accent")||"#f4b740",seatByLabel:n=>this.controller.seatByLabel(n),statusOf:n=>this.controller.getStatus(n),flash:(n,r)=>this.controller.flashSeat(n,r)},e)}).catch(()=>{})}destroy(){this.destroyed=!0,mn(this),this.colorSchemeStop?.(),this.colorSchemeStop=null,this.realtime?.stop(),this.realtime=null,this.dismissAccessPanel(),this.dismissHoldExpired(),this.access?.clear(),this.hold&&!this.handedOff&&this.controller.release(),this.closeConfirm(),this.dismissTableDialog(!1),pe(this,!1),this.closeSeatView(),this.closeCheckoutPanel(),this.exit3d(),this.buyerAssetUrls.dispose(),this.stopHoldTimer(),this.detachAttention?.(),this.toastTimer&&clearTimeout(this.toastTimer),this.offerRefreshTimer&&clearTimeout(this.offerRefreshTimer),this.offerBoundaryTimer&&clearTimeout(this.offerBoundaryTimer),this.offerRefreshTimer=null,this.offerBoundaryTimer=null,this.offerVisibilityHandler&&(document.removeEventListener("visibilitychange",this.offerVisibilityHandler),this.offerVisibilityHandler=null);for(let e of this.motionTimers)clearTimeout(e);this.motionTimers.clear(),this.ro?.disconnect(),this.ro=null,this.framedFs&&this.setFramedFs(!1),this.escHandler&&document.removeEventListener("keydown",this.escHandler),this.fsChangeHandler&&document.removeEventListener("fullscreenchange",this.fsChangeHandler),this.fsEscHandler&&window.removeEventListener("keydown",this.fsEscHandler),this.controller.destroy(),this.projectionEl=null,this.root?.remove(),this.root=null,this.modalScrim&&(this.modalScrim.remove(),this.modalScrim=null,this.prevFocus?.isConnected&&this.prevFocus.focus({preventScroll:!0}),this.prevFocus=null)}};import{formatMoney as yp,loadLocale as wp,setStringOverrides as xp,t as Sp}from"@seatlayer/core";var Pa="seatlayer-performance-group-picker-style";function La(){if(document.getElementById(Pa))return;let i=document.createElement("style");i.id=Pa,i.textContent=`
2795
2810
  .sl-pg-root{display:grid;gap:12px;min-width:0;color:var(--sl-text,#18202b);font-family:var(--sl-font,Inter,system-ui,sans-serif)}
2796
2811
  .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)}
2797
2812
  .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}
@@ -2851,7 +2866,7 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default}
2851
2866
  @media(min-width:900px){.sl-pg-legend-list{justify-content:flex-start}}
2852
2867
  .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}
2853
2868
  @media(max-width:640px){.sl-pg-head{padding:13px 14px}.sl-pg-head h2{font-size:18px}.sl-pg-inner{min-height:590px}}
2854
- `,document.head.appendChild(i)}var ap="https://api.seatlayer.io",lp=6e4,cp=2e3,dp=1e3,pp=36e5,hp=5e3,up=5e3,mp=15e3,fp=12e4,gp=new Set(["preparing","commit_pending","abort_pending","expire_pending"]),K=class extends Error{constructor(){super("performance_group_destroyed"),this.name="PerformanceGroupDestroyedError"}};function bp(i){return new Promise(e=>setTimeout(e,i))}function En(i){let e=Number(i.headers.get("Retry-After")??"1");return Number.isFinite(e)?Math.max(50,Math.min(hp,e*1e3)):1e3}function ot(i,e){return`/pub/performance-groups/${encodeURIComponent(i)}/operations/${encodeURIComponent(e)}`}function Ht(i){return i.replace(/^pghop_/,"").replace(/-/g,"").slice(-8).toUpperCase()}var Cn=class{constructor(e,t,n){this.api=e;this.sink=t;this.intervalMs=n;this.stopped=!0;this.timer=null;this.prior=new Map}start(){this.stopped&&(this.stopped=!1,this.tick())}stop(){this.stopped=!0,this.timer&&clearTimeout(this.timer),this.timer=null}async tick(){try{let e=await this.api.objects(this.api.groupKey);if(this.stopped)return;let t=new Map(Object.entries(e.seats)),r=[...new Set([...this.prior.keys(),...t.keys()])].filter(s=>this.prior.get(s)!==t.get(s)).map(s=>({label:s,status:t.get(s)??"blocked"}));this.prior=t,r.length&&this.sink.applyStatuses(r),this.sink.onSections?.(e.hidden??[],e.closed??[])}catch(e){if(e instanceof K){this.stop();return}this.stopped||await this.sink.resync()}finally{this.stopped||(this.timer=setTimeout(()=>{this.tick()},this.intervalMs))}}},Mi=class{constructor(e,t){this.descriptorCache=null;this.chartRequest=null;this.objectsCache=null;this.activePerformanceKey=null;this.includedEventKeys=new Set;this.reuseObjectsCacheOnce=!1;this.selectionsByEvent=new Map;this.allocationsByHold=new Map;this.pendingOperationId=null;this.operationByHold=new Map;this.knownRevision=null;this.destroyed=!1;this.aborter=new AbortController;this.adoptFailure=null;this.settleTimer=null;this.settleOperationId=null;this.settleStartedAt=0;this.settleState=null;this.settleVisibility=null;this.lastRecovery={kind:"idle"};if(!e)throw new Error("seatlayer: `performanceGroup` key is required");this.groupKey=e,this.base=(t.apiBase??ap).replace(/\/+$/,""),this.access=t.access,this.fetcher=t.fetch??globalThis.fetch.bind(globalThis),this.recoveryTimeoutMs=t.recoveryTimeoutMs??lp,this.realtimePollMs=Math.max(500,t.realtimePollMs??cp),this.selectionMode=t.selectionMode??"same_seat",this.partySize=t.partySize??null,this.onOperationState=t.onOperationState,this.onRecoveryState=t.onRecoveryState,this.onAvailability=t.onAvailability,this.access.onRenewed(r=>this.adoptSession(r));let n=this.readOperationRecord();n&&this.storedIsUndecided(n)&&(this.pendingOperationId=n.operationId)}get pendingOperation(){return this.pendingOperationId}get holdBlocked(){return!!this.adoptFailure||!!this.pendingOperationId&&this.lastRecovery.kind!=="idle"}async descriptor(){let e=await this.json(`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/descriptor`);return this.descriptorCache=e.performanceGroup,this.includedEventKeys.size||(this.includedEventKeys=new Set(e.performanceGroup.performances.map(t=>t.eventKey))),e.performanceGroup.revision&&(this.knownRevision=e.performanceGroup.revision),this.activePerformanceKey??=e.performanceGroup.performances[0]?.eventKey??null,e.performanceGroup}async chart(e){this.chartRequest??=this.json(`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/chart`).catch(r=>{throw this.chartRequest=null,r});let[t,n]=await Promise.all([this.descriptorCache?Promise.resolve(this.descriptorCache):this.descriptor(),this.chartRequest]);return{doc:n,event:{key:t.key,name:t.name,salesClosed:t.state!=="active",venue:t.venue,startsAt:t.performances[0]?.startsAt??null,timezone:t.timezone,currency:t.currency,mode:t.mode,inventoryModelVersion:2}}}asset(e,t){return/^[a-zA-Z0-9._-]+$/.test(t)?this.blob(`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/assets/${encodeURIComponent(t)}`):Promise.reject(new V(404,"not_found","not_found"))}async objects(e){let t=this.descriptorCache?.inclusionMode==="flexible_dates",n=`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/objects`+(this.selectionMode==="per_performance"||t?"?view=per-performance":"");if(this.reuseObjectsCacheOnce&&this.objectsCache)this.reuseObjectsCacheOnce=!1;else{let o=await this.authorized(n,this.objectsCache?.revision?{headers:{"If-None-Match":`"${this.objectsCache.revision}"`}}:{});if(o.status!==304){if(!o.ok)return this.throwResponse(o);this.objectsCache=await this.responseJson(o)}}if(!this.objectsCache)throw new V(502,"group_projection_unavailable","group_projection_unavailable");if(this.selectionMode==="same_seat"&&!t){let o=this.objectsCache;return this.noteAvailability(o,o.salesClosed,o),o}let r=this.objectsCache;if(this.selectionMode==="same_seat"){let o=r.performances.filter(d=>this.includedEventKeys.has(d.eventKey));if(!o.length)throw new V(409,"group_selection_incomplete","group_selection_incomplete");let a=Object.keys(o[0]?.seats??{}),l=Object.fromEntries(a.map(d=>[d,o.every(u=>u.seats[d]==="free")?"free":"blocked"])),c=Object.fromEntries(a.flatMap(d=>{let u=o.filter(h=>h.seats[d]!=="free").map(h=>h.eventKey);return u.length>0&&u.length<o.length?[[d,u]]:[]})),p={seats:l,partial:c,hidden:[...new Set(o.flatMap(d=>d.hidden??[]))],closed:[...new Set(o.flatMap(d=>d.closed??[]))],revision:r.revision,state:r.state,salesClosed:o.some(d=>d.salesClosed)};return this.noteAvailability(r,p.salesClosed,p),p}let s=r.performances.find(o=>o.eventKey===this.activePerformanceKey);if(!s)throw new V(409,"group_performance_unavailable","group_performance_unavailable");return this.noteAvailability(r,r.salesClosed||r.performances.some(o=>o.salesClosed),s),s}setSelectionMode(e,t){if(this.pendingOperationId||this.holdBlocked)throw new V(409,"group_operation_pending","group_operation_pending");e!==this.selectionMode&&(this.selectionMode=e,t!=null&&(this.partySize=t),this.objectsCache=null,this.selectionsByEvent.clear(),this.activePerformanceKey=this.descriptorCache?.performances[0]?.eventKey??this.activePerformanceKey)}setActivePerformance(e){if(this.descriptorCache&&!this.descriptorCache.performances.some(t=>t.eventKey===e))throw new V(404,"group_performance_not_found","group_performance_not_found");this.activePerformanceKey=e}setIncludedEventKeys(e){let t=new Set(this.descriptorCache?.performances.map(n=>n.eventKey)??[]);if(!e.length||new Set(e).size!==e.length||e.some(n=>!t.has(n)))throw new V(422,"invalid_event_keys","invalid_event_keys");this.includedEventKeys=new Set(e),this.reuseObjectsCacheOnce=!!this.objectsCache}includedPerformanceKeys(){return(this.descriptorCache?.performances??[]).map(e=>e.eventKey).filter(e=>this.includedEventKeys.has(e))}setPerformanceSelections(e,t){this.selectionsByEvent.set(e,t.map(n=>({...n})))}allocationsForHold(e){return(this.allocationsByHold.get(e)??[]).map(t=>({eventKey:t.eventKey,items:t.items.map(n=>({...n}))}))}async hold(e,t,n,r){if(this.assertUsable(),r)throw new V(409,"group_hold_replace_unsupported","group_hold_replace_unsupported");let s=t.map(c=>c.label),o={labels:s};if(this.descriptorCache?.inclusionMode==="flexible_dates"&&(o.eventKeys=this.includedPerformanceKeys()),this.selectionMode==="per_performance"){if(!this.activePerformanceKey||!this.descriptorCache||!this.partySize)throw new V(409,"group_selection_incomplete","group_selection_incomplete");this.setPerformanceSelections(this.activePerformanceKey,t);let c=this.descriptorCache.performances.filter(p=>this.includedEventKeys.has(p.eventKey)).map(p=>({eventKey:p.eventKey,selections:this.selectionsByEvent.get(p.eventKey)??[]}));if(c.some(p=>p.selections.length!==this.partySize))throw new V(409,"group_selection_incomplete","group_selection_incomplete");o={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,...o,...n?{ttlMs:n}:{}})})}catch(c){if(c instanceof K)throw c;if(c instanceof ae)throw this.failOperation(a),c;return this.recover(a,s,Date.now()+this.recoveryTimeoutMs)}if(l.status===201||l.status===202||l.status===504){let c=await this.responseJson(l);return this.emit(c.operation),l.status===201?this.complete(c.operation):this.recover(a,s,Date.now()+this.recoveryTimeoutMs,En(l))}if(l.status===503){let c=await l.clone().json().catch(()=>null);if((c?.code??c?.error)==="performance_group_abort_pending"){let p=c?.operation?.operationId??a;return this.beginOperation(p),c?.operation&&this.emit(c.operation),this.recover(p,s,Date.now()+this.recoveryTimeoutMs,En(l))}}try{return await this.throwResponse(l,s)}catch(c){throw this.failOperation(a),c}}async release(e,t,n){this.assertUsable();let r=this.operationForHold(n),s=await this.json(`${ot(this.groupKey,r)}/release`,{method:"POST",body:"{}"});return this.operationByHold.delete(n),this.allocationsByHold.delete(n),this.clearOperationRecord(),s}async resume(e,t){this.assertUsable();let n=this.operationForHold(t),r=await this.json(ot(this.groupKey,n));return this.complete(r.operation)}async extend(e,t,n=12e4){this.assertUsable();let r=this.operationForHold(t),s=Math.max(dp,Math.min(pp,Math.round(n))),o=await this.json(`${ot(this.groupKey,r)}/extend`,{method:"POST",body:JSON.stringify({ttlMs:s})}),a=this.complete(o.operation);return{holdId:a.holdId,expiresAt:a.expiresAt}}bestAvailable(){return Promise.reject(new V(400,"group_best_available_unsupported","group_best_available_unsupported"))}socketUrl(){return""}createRealtime(e,t){return new Cn(this,t,this.realtimePollMs)}operationIdForHold(e){return this.operationByHold.get(e)??this.readMapping(e)}rememberOperation(e,t){!e||!t||(this.operationByHold.set(e,t),this.writeMapping(e,t))}async restoreOperation(){let e=this.readOperationRecord();if(!e)return null;if(!this.storedIsUndecided(e)&&e.state!=="committed"&&e.state!=="booked")return this.clearOperationRecord(),null;this.pendingOperationId=e.operationId,this.emitRecovery({kind:"pending",operationId:e.operationId,phase:e.state==="undecided"?"unknown":e.state,longRunning:!1,reference:Ht(e.operationId)});let t;try{t=await this.authorized(ot(this.groupKey,e.operationId))}catch(s){return s instanceof K||this.recoveryFailed(e.operationId,"request_failed"),null}if(t.status===404)return this.failOperation(e.operationId),null;if(!t.ok)return this.recoveryFailed(e.operationId,"request_failed"),null;let n=await this.responseJson(t);this.emit(n.operation);let r=n.operation.state;return r==="committed"||r==="booked"?(this.emitRecovery({kind:"idle"}),this.complete(n.operation)):r==="aborted"||r==="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>=fp?mp:up;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 r=await this.authorized(ot(this.groupKey,e));if(!r.ok)return this.scheduleSettlementPoll();t=(await this.responseJson(r)).operation}catch(r){return r instanceof K?this.stopSettlementWatch():this.scheduleSettlementPoll()}if(this.destroyed||this.settleOperationId!==e)return;let n=t.state!==this.settleState;if(this.settleState=t.state,n&&this.noteOperationState(e,t.state),this.settled(t.state)){this.stopSettlementWatch(),t.state!=="booked"&&this.clearOperationRecord(),this.emit(t);return}n&&this.emit(t),this.scheduleSettlementPoll()}destroy(){if(!this.destroyed){this.destroyed=!0,this.stopSettlementWatch(),this.access.onRenewed(void 0);try{this.aborter.abort()}catch{}}}operationRecordKey(){return`@seatlayer/performance-group-operation/v1/${encodeURIComponent(this.base)}/${encodeURIComponent(this.groupKey)}`}readOperationRecord(){try{let e=window.sessionStorage.getItem(this.operationRecordKey());if(!e)return null;let t=JSON.parse(e);return!t?.operationId||t.groupKey!==this.groupKey?null:t}catch{return null}}storedIsUndecided(e){return e.state==="undecided"||gp.has(e.state)}writeOperationRecord(e){try{window.sessionStorage.setItem(this.operationRecordKey(),JSON.stringify(e))}catch{}}clearOperationRecord(){try{window.sessionStorage.removeItem(this.operationRecordKey())}catch{}}beginOperation(e){this.pendingOperationId=e;let t=this.readOperationRecord();this.writeOperationRecord({operationId:e,groupKey:this.groupKey,state:"undecided",createdAt:t?.operationId===e?t.createdAt:Date.now()})}noteOperationState(e,t){let n=this.readOperationRecord();!n||n.operationId!==e||this.writeOperationRecord({...n,state:t})}failOperation(e){this.pendingOperationId=null,this.clearOperationRecord(),this.emitRecovery({kind:"idle"}),this.onOperationState?.({operationId:e,state:"aborted",decision:"abort"})}async adoptSession(e){if(this.destroyed)return;let t=`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/session/adopt`;for(let r=0;r<2;r++){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 V(409,"performance_group_session_adopt_failed","performance_group_session_adopt_failed");let n=this.pendingOperationId??"";throw this.emitRecovery({kind:"failed",operationId:n,reference:n?Ht(n):"",reason:"session_adopt_failed",retryable:!1}),this.adoptFailure}async recover(e,t,n,r=100){let s=r,o=Date.now()+Math.min(8e3,Math.max(500,this.recoveryTimeoutMs/2)),a="unknown";for(;Date.now()<=n;){if(this.destroyed)throw new K;if(this.emitRecovery({kind:"pending",operationId:e,phase:a,longRunning:Date.now()>=o,reference:Ht(e)}),await bp(s),this.destroyed)throw new K;let l;try{l=await this.authorized(ot(this.groupKey,e))}catch(d){if(d instanceof K)throw d;if(d instanceof ae)throw this.recoveryFailed(e,"request_failed"),d;s=Math.min(2e3,Math.max(100,s*2));continue}if(l.status===404){s=Math.min(1e3,Math.max(100,s*2));continue}if(!l.ok){this.recoveryFailed(e,"request_failed");try{return await this.throwResponse(l,t)}finally{this.pendingOperationId=null,this.clearOperationRecord()}}let p=(await this.responseJson(l)).operation;if(a=p.state,this.noteOperationState(e,p.state),this.emit(p),p.state==="committed"||p.state==="booked")return this.emitRecovery({kind:"idle"}),this.complete(p);if(p.state==="aborted"||p.state==="expired")throw this.failOperation(e),new V(409,"conflict","conflict",t.map(d=>({label:d,status:"held"})));s=En(l)}throw this.recoveryFailed(e,"deadline"),new V(504,"performance_group_outcome_unknown","performance_group_outcome_unknown")}recoveryFailed(e,t){this.emitRecovery({kind:"failed",operationId:e,reference:Ht(e),reason:t,retryable:!0})}emitRecovery(e){if(this.destroyed)return;let t=this.lastRecovery.kind===e.kind&&JSON.stringify(this.lastRecovery)===JSON.stringify(e);this.lastRecovery=e,t||this.onRecoveryState?.(e)}noteAvailability(e,t,n){if(this.destroyed||!this.onAvailability)return;let r=e.state??this.descriptorCache?.state??"active",s=e.revision??null,o=!!s&&!!this.knownRevision&&s!==this.knownRevision;s&&!this.knownRevision&&(this.knownRevision=s);let a=n?.partial??{},l=Object.values(n?.seats??{});this.onAvailability({partial:a,freeCount:l.filter(c=>c==="free").length,blockedCount:Object.keys(n?.seats??{}).filter(c=>n.seats[c]!=="free"&&!(c in a)).length,state:r,salesClosed:!!t||r!=="active",revision:s,revisionChanged:o})}acceptRevision(e){this.knownRevision=e}complete(e){if(!e.hold||e.hold.expiresAt==null)throw new V(409,"group_hold_not_active","group_hold_not_active");this.pendingOperationId=null,this.noteOperationState(e.operationId,e.state),this.operationByHold.set(e.hold.id,e.operationId),this.writeMapping(e.hold.id,e.operationId);let t=e.hold.allocations??[];this.allocationsByHold.set(e.hold.id,t);let n=t.find(r=>r.eventKey===this.activePerformanceKey)?.items;return{holdId:e.hold.id,expiresAt:e.hold.expiresAt,items:n??e.hold.items??[]}}emit(e){this.destroyed||this.onOperationState?.({operationId:e.operationId,state:e.state,decision:e.decision})}operationForHold(e){let t=this.operationIdForHold(e);if(!t)throw new V(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 K;if(this.adoptFailure)throw this.adoptFailure}async authorized(e,t={},n=!1){if(this.destroyed)throw new K;if(this.adoptFailure)throw this.adoptFailure;let r={...t.headers};t.body!==void 0&&(r["Content-Type"]="application/json");let s=await this.access.authorization(n?"unauthorized":"initial");if(this.destroyed)throw new K;if(this.adoptFailure)throw this.adoptFailure;if(!s)throw new Error("performance_group_buyer_access_required");r.Authorization=s;let o=await this.fetcher(`${this.base}${e}`,{method:t.method??"GET",headers:r,body:t.body,credentials:"omit",signal:this.aborter.signal});if(!n&&(o.status===401||o.status===403||o.status===422)){let a=await o.clone().json().catch(()=>null);if(await this.access.handleFailure(o.status,a?.code??a?.error))return this.authorized(e,t,!0)}return o}async json(e,t={}){let n=await this.authorized(e,t);return n.ok?this.responseJson(n):this.throwResponse(n)}async blob(e){let t=await this.authorized(e);return t.ok?t.blob():this.throwResponse(t)}async responseJson(e){return e.json()}async throwResponse(e,t=[]){let r=await e.json().catch(()=>null)??{},s=r.code??r.error??`request_failed_${e.status}`;throw e.status===409&&!r.conflicts?.length&&t.length&&(r.conflicts=t.map(o=>({label:o,status:"held"}))),new V(e.status,r.error??s,s,r.conflicts)}};var Sp="https://api.seatlayer.io";function Aa(i){let e=typeof i=="string"?document.querySelector(i):i;if(!e)throw new Error("seatlayer: Performance Group picker container was not found");return e}var An=class{constructor(e){this.descriptorValue=null;this.picker=null;this.root=null;this.innerHost=null;this.tabsHost=null;this.prevButton=null;this.nextButton=null;this.heldSummary=null;this.live=null;this.statusHost=null;this.statusCopy=null;this.statusAction=null;this.rendered=!1;this.destroyed=!1;this.continued=!1;this.switchingPerformance=!1;this.operationPending=!1;this.recovery={kind:"idle"};this.availability=null;this.activePerformanceKey=null;this.selectionsByEvent=new Map;this.validByEvent=new Map;this.refreshingComposition=!1;this.activeHandoff=null;this.selectionModeValue="same_seat";this.progressHost=null;this.legendHost=null;this.paneHost=null;this.datesSummaryHost=null;this.datesCardsHost=null;this.resettingFlexibleSelection=!1;this.selectingPartialSeat=!1;this.partialSeatDates=new Map;this.markedLabels=new Set;this.holdTicker=null;this.switchingMode=!1;this.booked=!1;if(!e||typeof e!="object")throw new Error("seatlayer: options object is required");if(!e.performanceGroup)throw new Error("seatlayer: `performanceGroup` key is required");if(!e.container)throw new Error("seatlayer: `container` is required");if(!e.buyerAccessToken&&!e.buyerAccessTokenProvider)throw new Error("seatlayer: Performance Group buyer access is required");if(!!e.initialHoldId!=!!e.initialOperationId)throw new Error("seatlayer: `initialHoldId` and `initialOperationId` must be supplied together");if((e.selectionMode==="per_performance"||e.allowSelectionModeSwitch)&&(!Number.isSafeInteger(e.numberOfPlacesToSelect)||(e.numberOfPlacesToSelect??0)<1))throw new Error("seatlayer: `numberOfPlacesToSelect` is required for per-performance selection");this.selectionModeValue=e.selectionMode??"same_seat",this.options=e,this.panelId=`sl-pg-panel-${e.performanceGroup}`,this.access=new de({provider:e.buyerAccessTokenProvider,token:e.buyerAccessToken,onExpired:e.onAccessExpired,onUnavailable:e.onAccessUnavailable}),this.api=new Mi(e.performanceGroup,{apiBase:e.apiBase,access:this.access,selectionMode:e.selectionMode,partySize:e.selectionMode==="per_performance"?e.numberOfPlacesToSelect:void 0,onOperationState:t=>this.operationChanged(t),onRecoveryState:t=>this.recoveryChanged(t),onAvailability:t=>this.availabilityChanged(t)}),e.initialHoldId&&e.initialOperationId&&this.api.rememberOperation(e.initialHoldId,e.initialOperationId)}get mode(){return this.selectionModeValue}get selectionMode(){return this.selectionModeValue}get descriptor(){return this.descriptorValue}get currentHold(){return this.activeHandoff}async render(){if(this.rendered)return this;let e=performance.now();if(this.rendered=!0,Ca(),await yp(this.options.locale),this.options.messages&&wp(this.options.messages),this.destroyed)return this;let t;try{t=await this.api.descriptor()}catch(n){throw xe({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:Me(this.options.performanceGroup),transport:"pubapi"}),n}return this.destroyed?this:(this.descriptorValue=t,this.activePerformanceKey=t.performances[0]?.eventKey??null,this.buildChrome(Aa(this.options.container),t),this.announce(this.copy("picker.group.checkingAvailability")),await this.mountPicker(t),this.destroyed?this:(await this.restoreOperation(),this))}buildChrome(e,t){e.replaceChildren();let n=document.createElement("div");n.className="sl-pg-root",n.dataset.performanceGroup=t.key,n.dataset.selectionMode=this.mode;let r=document.createElement("div");r.className="sl-pg-progress";let s=document.createElement("section");s.className="sl-pg-head",s.setAttribute("aria-labelledby",`sl-pg-title-${t.key}`);let o=document.createElement("h2");o.id=`sl-pg-title-${t.key}`,o.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 p=document.createElement("summary");p.textContent=this.copy(t.inclusionMode==="flexible_dates"?"picker.group.flexibleDatesInView":"picker.group.allDates",{count:t.performanceCount});let d=document.createElement("div");d.innerHTML=cn(this.performanceCards(t),this.copy(t.inclusionMode==="flexible_dates"?"picker.group.flexibleDatesNote":"picker.group.includedNote",{count:t.performanceCount})),c.append(p,d);let u=document.createElement("div");u.className="sl-pg-held-summary",u.hidden=!0,s.append(o,a,l,c,u);let h=document.createElement("div");h.className="sl-pg-legend";let g=document.createElement("div");g.className="sl-pg-pane",g.setAttribute("role","group"),g.setAttribute("aria-label",this.copy("picker.group.yourSelection")),g.hidden=!0;let b=this.mode==="per_performance"?this.performanceTabs(t):null,w=document.createElement("div");w.className="sl-pg-inner",w.id=this.panelId,w.setAttribute("aria-busy","false"),w.dataset.locked="false",this.mode==="per_performance"&&(w.setAttribute("role","tabpanel"),w.tabIndex=-1);let x=document.createElement("div");x.className="sl-pg-status",x.setAttribute("role","status"),x.setAttribute("aria-live","polite"),x.hidden=!0;let y=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()}),x.append(y,m),w.appendChild(x);let A=document.createElement("div");A.className="sl-pg-live",A.setAttribute("role","status"),A.setAttribute("aria-live","polite"),n.append(r,s),b&&n.append(b),n.append(h,w,g,A),e.appendChild(n),this.root=n,this.progressHost=r,this.legendHost=h,this.paneHost=g,this.datesSummaryHost=p,this.datesCardsHost=d,this.innerHost=w,this.heldSummary=u,this.live=A,this.statusHost=x,this.statusCopy=y,this.statusAction=m,this.syncProgress(),this.syncLegend(),this.syncPane()}async mountPicker(e){let t=new $e(Pi({container:this.innerHost,event:e.key,apiBase:this.options.apiBase,transport:this.api,hideEventDetails:!0,maxSelection:this.options.maxSelection,selectedObjects:this.options.selectedObjects,selectableObjects:this.options.selectableObjects,numberOfPlacesToSelect:this.options.numberOfPlacesToSelect,selectionValidators:this.options.selectionValidators,locale:this.options.locale,messages:this.options.messages,languages:this.options.languages,colorblindSafe:this.options.colorblindSafe,initialView:this.options.initialView,enable3D:this.options.enable3D,max3DSeats:this.options.max3DSeats,onBuyerViewChange:this.options.onBuyerViewChange,onAnalytics:(n,r)=>{try{this.options.onAnalytics?.(n,{...r,metricScope:"performance_group",performanceGroupKey:e.key,performanceCount:e.performanceCount,selectionMode:this.mode})}catch{}},hideBadge:this.options.hideBadge,theme:this.options.theme,holdTtlMs:this.options.holdTtlMs,initialHoldId:this.options.initialHoldId,restoreHold:this.options.restoreHold,confirmSelection:this.options.confirmSelection,seatView:this.options.seatView,onSelectionChange:n=>this.selectionChanged(n),onSelectionValidityChange:n=>this.selectionValidityChanged(n),onSelectionValid:this.options.onSelectionValid,onSelectionInvalid:this.options.onSelectionInvalid,onSelectionLimit:this.options.onSelectionLimit,onHoldChange:(n,r)=>this.holdChanged(n,r),onCheckout:(n,r)=>this.checkout(n,r),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"?hs(this.includedPerformances(),e.performanceCount,this.options.locale,this.copy("picker.group.flexibleSelectedNote",{count:this.includedPerformances().length})):null,selectNight:n=>{this.switchPerformance(n)},selectionModeSwitch:this.options.allowSelectionModeSwitch&&this.mode==="same_seat"?{label:this.copy("picker.group.chooseNightByNight"),activate:()=>{this.switchSelectionMode("per_performance")}}:null,partialSeatSelection:e.inclusionMode==="flexible_dates"&&this.mode==="same_seat"?{label:n=>this.copy("picker.group.selectAvailableDates",{count:n}),activate:(n,r)=>{this.selectPartialSeat(n,r)}}:null,confirmDateSelection:e.inclusionMode==="flexible_dates"&&this.mode==="same_seat"?{includedEventKeys:()=>this.api.includedPerformanceKeys(),availableEventKeys:n=>this.partialSeatDates.get(n)??this.nights().map(r=>r.eventKey),label:n=>this.copy("picker.group.selectAvailableDates",{count:n}),apply:(n,r)=>this.applySeatDates(n,r,!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:hi(t,this.options.locale),time:ui(t,this.options.locale)}))}nights(){return(this.descriptorValue?.performances??[]).map(e=>({eventKey:e.eventKey,name:e.name,shortDate:mi(e,this.options.locale)}))}seatMarks(){let e=this.descriptorValue?.performanceCount??0,t=this.availability,n=!!t?.salesClosed||!!t&&t.state!=="active",r=this.mode==="same_seat"&&!n?t?.partial??{}:{},s={};for(let o of this.markedLabels)s[o]=null;if(this.markedLabels.clear(),e>0)for(let[o,a]of Object.entries(r))!a.length||a.length>=e||(s[o]={kind:"partial",fraction:(e-a.length)/e,data:{blockedEventKeys:[...a]}},this.markedLabels.add(o));return s}activePerformanceLabel(){if(this.mode!=="per_performance")return null;let e=this.descriptorValue?.performances.find(r=>r.eventKey===this.activePerformanceKey);if(!e)return null;let t=mi(e,this.options.locale),n=e.name?.trim();return n&&n!==t?`${n} \xB7 ${t}`:t}nightSummary(){return this.mode!=="per_performance"?[]:(this.descriptorValue?.performances??[]).map(e=>({eventKey:e.eventKey,name:mi(e,this.options.locale),labels:(this.selectionsByEvent.get(e.eventKey)??[]).map(t=>t.label),active:e.eventKey===this.activePerformanceKey}))}groupSelectionSummary(){let e=this.includedPerformances();if(!e.length)return null;if(this.mode==="same_seat"){let s=this.activeHandoff?.seatLabels.length??this.picker?.getSelection().length??0;return{seats:s*e.length,performances:e.length,totalPerformances:this.descriptorValue?.performanceCount??e.length,performancesChosen:s?e.length:0,perPerformance:s}}let t=e.map(s=>this.selectionsByEvent.get(s.eventKey)?.length??0),n=t.filter(s=>s>0),r=n.length===t.length&&n.every(s=>s===n[0]);return{seats:t.reduce((s,o)=>s+o,0),performances:e.length,totalPerformances:this.descriptorValue?.performanceCount??e.length,performancesChosen:n.length,perPerformance:r&&n.length?n[0]:null}}syncProgress(){if(!this.progressHost)return;let e=!!this.activeHandoff,t=[{id:"performances",label:this.copy("picker.group.stepPerformances"),state:"done"},{id:"seats",label:this.copy("picker.group.stepSeats"),state:e?"done":"current"},{id:"review",label:this.copy("picker.group.stepReview"),state:this.booked?"done":e?"current":"upcoming"}];this.progressHost.innerHTML=Ss(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=ms({available:e.freeCount>0,selected:(this.picker?.getSelection().length??0)>0,partial:Object.keys(e.partial).length>0,unavailable:e.blockedCount>0},{title:this.copy("picker.group.legendTitle"),available:this.copy("picker.group.legendAvailable"),selected:this.copy("picker.group.legendSelected"),partial:this.copy("picker.group.legendNotEveryDate"),unavailable:this.copy("picker.group.legendUnavailable")},this.categoryColor())}categoryColor(){return this.picker?.categoryLegendColor()??"#2563eb"}syncPane(){let e=this.paneHost;if(!e)return;let t=this.includedPerformances();if(this.mode!=="same_seat"||!t.length){e.hidden=!0,e.replaceChildren();return}let n=this.activeHandoff?.seatLabels??this.picker?.getSelection().map(s=>s.label)??[],r=this.heldTotal();e.hidden=!1,e.innerHTML=ks({title:this.copy("picker.group.yourSelection"),rows:t.map(s=>({eventKey:s.eventKey,name:`${hi(s,this.options.locale)} ${ui(s,this.options.locale)}`,labels:n})),empty:this.copy("picker.group.noSeatsChosenYet"),note:r?null:this.copy("picker.group.pricesPerPerformance"),total:r?{label:this.copy("picker.group.total"),amount:r}:null,holdStatus:this.booked?this.copy("picker.group.bookedAll",{count:t.length}):this.activeHandoff?this.copy("picker.group.heldTogether",{count:t.length,time:Ts(this.activeHandoff.expiresAt-Date.now())}):null})}heldTotal(){let e=this.activeHandoff,t=this.descriptorValue;if(!e||!t)return null;let r=this.api.allocationsForHold(e.holdId).flatMap(a=>a.items);if(!r.length)return null;let s=r.reduce((a,l)=>a+l.unitPrice*(l.quantity??1),0),o=r[0]?.currency??t.currency;try{return vp(s,o,void 0,this.options.locale)}catch{return`${o} ${s.toFixed(2)}`}}includedPerformances(){let e=this.descriptorValue?.performances??[];if(this.descriptorValue?.inclusionMode!=="flexible_dates")return e;let t=new Set(this.api.includedPerformanceKeys());return e.filter(n=>t.has(n.eventKey))}syncIncludedDates(){let e=this.descriptorValue;if(!e||!this.datesSummaryHost||!this.datesCardsHost)return;let t=this.includedPerformances(),n=e.inclusionMode==="flexible_dates";this.datesSummaryHost.textContent=n&&t.length<e.performanceCount?this.copy("picker.group.flexibleDatesSelected",{selected:t.length,total:e.performanceCount}):this.copy(n?"picker.group.flexibleDatesInView":"picker.group.allDates",{count:e.performanceCount}),this.datesCardsHost.innerHTML=cn(this.performanceCards({...e,performances:t}),this.copy(n&&t.length<e.performanceCount?"picker.group.flexibleSelectedNote":n?"picker.group.flexibleDatesNote":"picker.group.includedNote",{count:t.length}))}async selectPartialSeat(e,t){if(!(this.destroyed||this.holdBlocked()||this.activeHandoff||!t.length)){if((this.picker?.getSelection().length??0)>0){this.announce(this.copy("picker.group.clearBeforePartial"));return}this.partialSeatDates.set(e,[...t]),await this.applySeatDates(e,t,!1)}}async applySeatDates(e,t,n){if(this.destroyed||this.holdBlocked()||this.activeHandoff||!t.length)return!1;let r=this.api.includedPerformanceKeys();if(r.length===t.length&&r.every(s=>t.includes(s)))return!0;this.selectingPartialSeat=!0;try{if(this.api.setIncludedEventKeys(t),this.syncIncludedDates(),await this.picker?.refreshAvailability(),!(n?this.picker?.selectObjectsWithoutConfirmation([e])??[]:this.picker?.selectObjects([e])??[]).length)throw new Error("performance_group_partial_seat_unavailable");return this.announce(this.copy("picker.group.selectedAvailableDates",{count:t.length})),this.syncPane(),this.syncLegend(),!0}catch(s){return r.length&&(this.api.setIncludedEventKeys(r),this.syncIncludedDates(),await this.picker?.refreshAvailability().catch(()=>{})),this.options.onError?.(s),!1}finally{this.selectingPartialSeat=!1}}syncHoldTicker(){this.booked||(this.activeHandoff&&!this.holdTicker?this.holdTicker=setInterval(()=>this.syncPane(),1e3):!this.activeHandoff&&this.holdTicker&&(clearInterval(this.holdTicker),this.holdTicker=null))}async switchSelectionMode(e){if(!(this.destroyed||this.switchingMode||e===this.mode)&&!(this.activeHandoff||this.holdBlocked())){this.switchingMode=!0;try{this.api.setSelectionMode(e,this.options.numberOfPlacesToSelect),this.selectionModeValue=e,this.picker?.destroy(),this.picker=null,this.selectionsByEvent.clear(),this.validByEvent.clear(),this.markedLabels.clear(),this.availability=null;let t=this.descriptorValue;if(this.activePerformanceKey=t.performances[0]?.eventKey??null,this.buildChrome(Aa(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 K)return;this.options.onError?.(t)}finally{this.switchingMode=!1}}}async release(){await this.picker?.release()}close(){this.destroy()}destroy(){if(this.destroyed)return;this.destroyed=!0,this.api.destroy(),this.holdTicker&&clearInterval(this.holdTicker),this.holdTicker=null;let e=this.picker;this.root?.setAttribute("hidden","");let t=()=>{e?.destroy(),this.access.clear(),this.root?.remove(),this.root=null,this.picker=null,this.innerHost=null,this.tabsHost=null,this.statusHost=null,this.statusCopy=null,this.statusAction=null,this.live=null};e?.getCurrentHold()&&!this.continued?e.release().catch(()=>{}).finally(t):t()}copy(e,t){let n=this.options.messages?.[e];return n!==void 0?t?n.replace(/\{(\w+)\}/g,(r,s)=>String(t[s]??`{${s}}`)):n:xp(e,t)}performanceTabs(e){let t=document.createElement("div");t.className="sl-pg-tabsbar";let n=document.createElement("button");n.type="button",n.className="sl-pg-step",n.dataset.step="previous",n.setAttribute("aria-label",this.copy("picker.group.previousPerformance")),n.textContent="\u2039",n.addEventListener("click",()=>{this.stepPerformance(-1)});let r=document.createElement("button");r.type="button",r.className="sl-pg-step",r.dataset.step="next",r.setAttribute("aria-label",this.copy("picker.group.nextPerformance")),r.textContent="\u203A",r.addEventListener("click",()=>{this.stepPerformance(1)});let s=document.createElement("div");return s.className="sl-pg-tabs",s.setAttribute("role","tablist"),s.setAttribute("aria-label",this.copy("picker.group.performances")),e.performances.forEach((o,a)=>{let l=document.createElement("button");l.type="button",l.className="sl-pg-tab",l.id=`sl-pg-tab-${e.key}-${o.eventKey}`,l.dataset.eventKey=o.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=o.name;let p=document.createElement("span");p.className="sl-pg-tab-state",p.textContent=this.copy("picker.group.stillNeedsSeat");let d=document.createElement("span");d.className="sl-pg-tab-badge",d.textContent=this.copy("picker.group.chosenOfTotal",{chosen:0,total:this.options.numberOfPlacesToSelect??1}),l.append(c,d,p),l.addEventListener("click",()=>{this.switchPerformance(o.eventKey)}),l.addEventListener("keydown",u=>this.tabKeydown(u)),s.appendChild(l)}),t.append(n,s,r),this.tabsHost=s,this.prevButton=n,this.nextButton=r,t}tabButtons(){return[...this.tabsHost?.querySelectorAll(".sl-pg-tab")??[]]}tabKeydown(e){let t=this.tabButtons(),n=t.findIndex(a=>a===e.target);if(n<0)return;let r=getComputedStyle(this.tabsHost??document.body).direction==="rtl",s=-1;switch(e.key){case"ArrowRight":s=n+(r?-1:1);break;case"ArrowLeft":s=n+(r?1:-1);break;case"ArrowDown":s=n+1;break;case"ArrowUp":s=n-1;break;case"Home":s=0;break;case"End":s=t.length-1;break;default:return}if(s<0||s>=t.length)return;e.preventDefault();let o=t[s];o.focus({preventScroll:!0}),o.disabled||this.switchPerformance(o.dataset.eventKey)}stepPerformance(e){let t=this.tabButtons(),n=t.findIndex(s=>s.dataset.eventKey===this.activePerformanceKey),r=t[n+e];!r||r.disabled||(r.focus({preventScroll:!0}),this.switchPerformance(r.dataset.eventKey))}submissionState(){let e=this.descriptorValue?.performances??[];if(this.mode!=="per_performance"){let r=!this.holdBlocked();return{complete:e.length,total:e.length,ready:r}}let t=this.options.numberOfPlacesToSelect,n=e.filter(r=>this.selectionsByEvent.get(r.eventKey)?.length===t&&this.validByEvent.get(r.eventKey)!==!1).length;return{complete:n,total:e.length,ready:n===e.length&&!this.holdBlocked()}}holdBlocked(){return this.operationPending||this.recovery.kind!=="idle"||!!this.availability?.salesClosed}selectionChanged(e){if(this.mode!=="per_performance"){this.options.onSelectionChange?.(e),this.syncPane(),this.syncLegend(),!e.length&&!this.activeHandoff&&!this.resettingFlexibleSelection&&!this.selectingPartialSeat&&this.descriptorValue?.inclusionMode==="flexible_dates"&&this.api.includedPerformanceKeys().length<this.descriptorValue.performanceCount&&(this.resettingFlexibleSelection=!0,this.api.setIncludedEventKeys(this.descriptorValue.performances.map(n=>n.eventKey)),this.syncIncludedDates(),this.picker?.refreshAvailability().catch(n=>this.options.onError?.(n)).finally(()=>{this.resettingFlexibleSelection=!1}));return}if(this.refreshingComposition||this.switchingPerformance||!this.activePerformanceKey)return;let t=e.map(n=>({...n}));this.selectionsByEvent.set(this.activePerformanceKey,t),this.api.setPerformanceSelections(this.activePerformanceKey,t.map(n=>({label:n.label}))),t.length!==this.options.numberOfPlacesToSelect?this.validByEvent.set(this.activePerformanceKey,!1):this.validByEvent.has(this.activePerformanceKey)||this.validByEvent.set(this.activePerformanceKey,!0),this.updateTabs(),this.options.onSelectionChange?.(e),this.refreshComposition(),this.syncLegend()}selectionValidityChanged(e){if(this.mode==="per_performance"&&!this.switchingPerformance&&this.activePerformanceKey){let t=this.validByEvent.get(this.activePerformanceKey);this.validByEvent.set(this.activePerformanceKey,e.isValid),this.updateTabs(),!this.refreshingComposition&&t!==e.isValid&&this.refreshComposition()}this.options.onSelectionValidityChange?.(e)}refreshComposition(){if(this.refreshingComposition||!this.picker)return;let e=this.submissionState();this.refreshingComposition=!0;try{this.picker.refreshPerformanceGroupComposition();let t=this.submissionState();(e.complete!==t.complete||e.ready!==t.ready)&&this.picker.refreshPerformanceGroupComposition()}finally{this.refreshingComposition=!1}}tabState(e){let t=this.options.numberOfPlacesToSelect??1,n=(this.selectionsByEvent.get(e)??[]).map(s=>s.label),r=this.copy("picker.group.chosenOfTotal",{chosen:n.length,total:t});return n.length===0?{key:"not-started",label:this.copy("picker.group.stillNeedsSeat"),badge:r}:n.length===t&&this.validByEvent.get(e)!==!1?{key:"complete",label:this.copy("picker.group.completeWithSeats",{seats:n.join(", ")}),badge:r}:n.length===t?{key:"needs-attention",label:this.copy("picker.group.needsAttention"),badge:r}:{key:"in-progress",label:this.copy("picker.group.needsMoreSeats",{count:t-n.length}),badge:r}}updateTabs(){let e=this.tabButtons(),t=this.switchingPerformance||this.operationPending||this.recovery.kind!=="idle"||!!this.activeHandoff;e.forEach(r=>{let s=r.dataset.eventKey,o=this.tabState(s),a=s===this.activePerformanceKey;r.dataset.state=o.key,r.disabled=t,r.setAttribute("aria-selected",String(a)),r.tabIndex=a?0:-1;let l=r.querySelector(".sl-pg-tab-state");l&&(l.textContent=o.label);let c=r.querySelector(".sl-pg-tab-badge");c&&(c.textContent=o.badge);let p=r.querySelector(".sl-pg-tab-name")?.textContent??s;r.setAttribute("aria-label",`${p}: ${o.badge} \xB7 ${o.label}`),a&&this.innerHost?.setAttribute("aria-labelledby",r.id)});let n=e.findIndex(r=>r.dataset.eventKey===this.activePerformanceKey);this.prevButton&&(this.prevButton.disabled=t||n<=0),this.nextButton&&(this.nextButton.disabled=t||n<0||n>=e.length-1)}async switchPerformance(e){if(this.mode!=="per_performance"||this.switchingPerformance||this.holdBlocked()||this.activeHandoff||e===this.activePerformanceKey||!this.picker)return;this.activePerformanceKey&&this.selectionChanged(this.picker.getSelection());let t=this.selectionsByEvent.get(e)?.map(n=>n.label)??[];this.switchingPerformance=!0,this.activePerformanceKey=e,this.updateTabs(),this.setInteractionLocked(!0);try{this.picker.clearSelection(),this.api.setActivePerformance(e),await this.picker.refreshAvailability();let n=this.picker.selectObjects(t);this.switchingPerformance=!1,this.selectionChanged(n),n.length!==t.length&&this.validByEvent.set(e,!1),this.options.onSelectionChange?.(n);let r=this.descriptorValue?.performances.find(s=>s.eventKey===e);r&&this.announce(this.copy("picker.group.performanceOpened",{performance:r.name}))}catch(n){this.options.onError?.(n)}finally{this.switchingPerformance=!1,!this.operationPending&&this.recovery.kind==="idle"&&this.setInteractionLocked(!1),this.updateTabs(),this.picker.refreshPerformanceGroupComposition()}}setInteractionLocked(e){let t=this.innerHost;t&&(t.dataset.locked=String(e),t.setAttribute("aria-busy",String(e)),t.setAttribute("aria-disabled",String(e)))}announce(e){this.live&&(this.live.textContent=e)}showStatus(e,t,n={}){this.statusHost&&this.statusCopy&&this.statusAction&&(this.statusCopy.textContent=t,this.statusHost.hidden=!t,this.statusAction.hidden=!n.retry),this.announce(t),this.options.onStatusChange?.({kind:e,message:t,...n.reference?{reference:n.reference}:{}})}clearStatus(){this.statusHost&&(this.statusHost.hidden=!0),this.statusAction&&(this.statusAction.hidden=!0),this.options.onStatusChange?.({kind:"idle",message:""})}operationChanged(e){if(this.destroyed)return;let t=e.state==="preparing"||e.state==="commit_pending"||e.state==="abort_pending"||e.state==="expire_pending";if(this.operationPending=t,this.setInteractionLocked(t||this.recovery.kind!=="idle"),this.updateTabs(),t){this.showStatus("pending",this.copy(e.state==="commit_pending"?"picker.group.commitPending":e.state==="abort_pending"||e.state==="expire_pending"?"picker.group.abortPending":"picker.group.securing"));return}if(e.state==="booked"){this.bookingSettled();return}if(e.state==="expired"||e.state==="aborted"){this.activeHandoff&&this.holdLost();return}if(e.state==="committed"){this.clearStatus(),this.announce(this.copy("picker.group.secured")),queueMicrotask(()=>this.innerHost?.querySelector('[data-ref="cta"]')?.focus({preventScroll:!0}));return}e.decision==="abort"&&this.recovery.kind==="idle"&&(this.clearStatus(),this.announce(this.copy("picker.group.notSecured")))}bookingSettled(){if(this.booked)return;this.booked=!0,this.root&&(this.root.dataset.booking="booked"),this.clearStatus(),this.holdTicker&&clearInterval(this.holdTicker),this.holdTicker=null;let e=this.activeHandoff?{...this.activeHandoff,bookingState:"booked"}:null;e&&(this.activeHandoff=e),this.syncProgress(),this.syncPane(),this.updateTabs(),this.picker?.notifyGroupSettled("booked"),this.announce(this.copy("picker.group.bookedAll",{count:this.descriptorValue?.performanceCount??0})),e&&this.options.onBooked?.(e)}holdLost(){this.activeHandoff=null,this.api.stopSettlementWatch(),this.resetPerPerformanceSelection(),this.syncProgress(),this.syncPane(),this.syncHoldTicker(),this.picker?.notifyGroupSettled("lost"),this.announce(this.copy("picker.group.notSecured")),this.options.onHoldChange?.(null),this.options.onHoldExpired?.()}recoveryChanged(e){if(!this.destroyed){if(this.recovery=e,this.setInteractionLocked(this.operationPending||e.kind!=="idle"),this.updateTabs(),this.refreshComposition(),e.kind==="idle"){this.operationPending||this.clearStatus();return}if(e.kind==="pending"){this.showStatus("pending",e.longRunning?this.copy("picker.group.longRunning",{reference:e.reference}):this.copy("picker.group.outcomeUnknown"),{reference:e.reference});return}this.showStatus("recovery_failed",this.copy("picker.group.longRunning",{reference:e.reference}),{retry:e.retryable,reference:e.reference}),this.setInteractionLocked(!1)}}async retryRecovery(){if(!(this.destroyed||this.recovery.kind!=="failed"||!this.recovery.retryable))try{await this.api.retryRecovery()}catch(e){if(e instanceof K)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 K)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 K)return;this.options.onError?.(t)}}handoff(e,t){let n=this.descriptorValue,r=this.api.operationIdForHold(e.holdId);if(!n||!r)throw new Error("seatlayer: Performance Group hold identity is unavailable");let s=this.api.allocationsForHold(e.holdId);return{operationId:r,holdId:e.holdId,expiresAt:e.expiresAt,performanceGroup:n,selectionMode:this.mode,performanceKeys:s.map(o=>o.eventKey),bookingState:this.booked?"booked":"held",seatLabels:t.map(o=>o.label),...this.mode==="per_performance"?{allocations:s.map(o=>({eventKey:o.eventKey,seatLabels:o.items.map(a=>a.label)}))}:{}}}renderHeldAllocations(e){if(!(!this.heldSummary||this.mode!=="per_performance")){this.heldSummary.replaceChildren();for(let t of e){let n=this.descriptorValue?.performances.find(o=>o.eventKey===t.eventKey),r=document.createElement("p"),s=document.createElement("strong");s.textContent=n?.name??t.eventKey,r.append(s,document.createTextNode(t.items.map(o=>o.label).join(", "))),this.heldSummary.appendChild(r)}this.heldSummary.hidden=e.length===0}}resetPerPerformanceSelection(){this.mode==="per_performance"&&(this.selectionsByEvent.clear(),this.validByEvent.clear(),this.heldSummary?.replaceChildren(),this.heldSummary&&(this.heldSummary.hidden=!0),this.updateTabs(),this.picker?.refreshPerformanceGroupComposition())}holdChanged(e,t){if(!e){this.activeHandoff=null,this.api.stopSettlementWatch(),this.resetPerPerformanceSelection(),this.syncProgress(),this.syncPane(),this.syncHoldTicker(),this.options.onHoldChange?.(null);return}let n=this.handoff(e,t),r=this.activeHandoff?.holdId!==n.holdId;this.activeHandoff=n,this.renderHeldAllocations(this.api.allocationsForHold(e.holdId)),this.updateTabs(),this.api.watchSettlement(e.holdId),this.syncProgress(),this.syncPane(),this.syncHoldTicker(),r&&this.options.onHold?.(n),this.options.onHoldChange?.(n)}checkout(e,t){let n=this.handoff(e,t);this.continued=!0,this.activeHandoff=n,this.options.onCheckout?.(n)}};var Pa="seatlayer-season-picker-style";function La(){if(document.getElementById(Pa))return;let i=document.createElement("style");i.id=Pa,i.textContent=`
2869
+ `,document.head.appendChild(i)}var lp="https://api.seatlayer.io",cp=6e4,dp=2e3,pp=1e3,hp=36e5,up=5e3,mp=5e3,fp=15e3,gp=12e4,bp=new Set(["preparing","commit_pending","abort_pending","expire_pending"]),K=class extends Error{constructor(){super("performance_group_destroyed"),this.name="PerformanceGroupDestroyedError"}};function vp(i){return new Promise(e=>setTimeout(e,i))}function En(i){let e=Number(i.headers.get("Retry-After")??"1");return Number.isFinite(e)?Math.max(50,Math.min(up,e*1e3)):1e3}function ot(i,e){return`/pub/performance-groups/${encodeURIComponent(i)}/operations/${encodeURIComponent(e)}`}function Ht(i){return i.replace(/^pghop_/,"").replace(/-/g,"").slice(-8).toUpperCase()}var Cn=class{constructor(e,t,n){this.api=e;this.sink=t;this.intervalMs=n;this.stopped=!0;this.timer=null;this.prior=new Map}start(){this.stopped&&(this.stopped=!1,this.tick())}stop(){this.stopped=!0,this.timer&&clearTimeout(this.timer),this.timer=null}async tick(){try{let e=await this.api.objects(this.api.groupKey);if(this.stopped)return;let t=new Map(Object.entries(e.seats)),r=[...new Set([...this.prior.keys(),...t.keys()])].filter(s=>this.prior.get(s)!==t.get(s)).map(s=>({label:s,status:t.get(s)??"blocked"}));this.prior=t,r.length&&this.sink.applyStatuses(r),this.sink.onSections?.(e.hidden??[],e.closed??[])}catch(e){if(e instanceof K){this.stop();return}this.stopped||await this.sink.resync()}finally{this.stopped||(this.timer=setTimeout(()=>{this.tick()},this.intervalMs))}}},Mi=class{constructor(e,t){this.descriptorCache=null;this.chartRequest=null;this.objectsCache=null;this.activePerformanceKey=null;this.includedEventKeys=new Set;this.reuseObjectsCacheOnce=!1;this.selectionsByEvent=new Map;this.allocationsByHold=new Map;this.pendingOperationId=null;this.operationByHold=new Map;this.knownRevision=null;this.destroyed=!1;this.aborter=new AbortController;this.adoptFailure=null;this.settleTimer=null;this.settleOperationId=null;this.settleStartedAt=0;this.settleState=null;this.settleVisibility=null;this.lastRecovery={kind:"idle"};if(!e)throw new Error("seatlayer: `performanceGroup` key is required");this.groupKey=e,this.base=(t.apiBase??lp).replace(/\/+$/,""),this.access=t.access,this.fetcher=t.fetch??globalThis.fetch.bind(globalThis),this.recoveryTimeoutMs=t.recoveryTimeoutMs??cp,this.realtimePollMs=Math.max(500,t.realtimePollMs??dp),this.selectionMode=t.selectionMode??"same_seat",this.partySize=t.partySize??null,this.onOperationState=t.onOperationState,this.onRecoveryState=t.onRecoveryState,this.onAvailability=t.onAvailability,this.access.onRenewed(r=>this.adoptSession(r));let n=this.readOperationRecord();n&&this.storedIsUndecided(n)&&(this.pendingOperationId=n.operationId)}get pendingOperation(){return this.pendingOperationId}get holdBlocked(){return!!this.adoptFailure||!!this.pendingOperationId&&this.lastRecovery.kind!=="idle"}async descriptor(){let e=await this.json(`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/descriptor`);return this.descriptorCache=e.performanceGroup,this.includedEventKeys.size||(this.includedEventKeys=new Set(e.performanceGroup.performances.map(t=>t.eventKey))),e.performanceGroup.revision&&(this.knownRevision=e.performanceGroup.revision),this.activePerformanceKey??=e.performanceGroup.performances[0]?.eventKey??null,e.performanceGroup}async chart(e){this.chartRequest??=this.json(`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/chart`).catch(r=>{throw this.chartRequest=null,r});let[t,n]=await Promise.all([this.descriptorCache?Promise.resolve(this.descriptorCache):this.descriptor(),this.chartRequest]);return{doc:n,event:{key:t.key,name:t.name,salesClosed:t.state!=="active",venue:t.venue,startsAt:t.performances[0]?.startsAt??null,timezone:t.timezone,currency:t.currency,mode:t.mode,inventoryModelVersion:2}}}asset(e,t){return/^[a-zA-Z0-9._-]+$/.test(t)?this.blob(`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/assets/${encodeURIComponent(t)}`):Promise.reject(new V(404,"not_found","not_found"))}async objects(e){let t=this.descriptorCache?.inclusionMode==="flexible_dates",n=`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/objects`+(this.selectionMode==="per_performance"||t?"?view=per-performance":"");if(this.reuseObjectsCacheOnce&&this.objectsCache)this.reuseObjectsCacheOnce=!1;else{let o=await this.authorized(n,this.objectsCache?.revision?{headers:{"If-None-Match":`"${this.objectsCache.revision}"`}}:{});if(o.status!==304){if(!o.ok)return this.throwResponse(o);this.objectsCache=await this.responseJson(o)}}if(!this.objectsCache)throw new V(502,"group_projection_unavailable","group_projection_unavailable");if(this.selectionMode==="same_seat"&&!t){let o=this.objectsCache;return this.noteAvailability(o,o.salesClosed,o),o}let r=this.objectsCache;if(this.selectionMode==="same_seat"){let o=r.performances.filter(d=>this.includedEventKeys.has(d.eventKey));if(!o.length)throw new V(409,"group_selection_incomplete","group_selection_incomplete");let a=Object.keys(o[0]?.seats??{}),l=Object.fromEntries(a.map(d=>[d,o.every(u=>u.seats[d]==="free")?"free":"blocked"])),c=Object.fromEntries(a.flatMap(d=>{let u=o.filter(h=>h.seats[d]!=="free").map(h=>h.eventKey);return u.length>0&&u.length<o.length?[[d,u]]:[]})),p={seats:l,partial:c,hidden:[...new Set(o.flatMap(d=>d.hidden??[]))],closed:[...new Set(o.flatMap(d=>d.closed??[]))],revision:r.revision,state:r.state,salesClosed:o.some(d=>d.salesClosed)};return this.noteAvailability(r,p.salesClosed,p),p}let s=r.performances.find(o=>o.eventKey===this.activePerformanceKey);if(!s)throw new V(409,"group_performance_unavailable","group_performance_unavailable");return this.noteAvailability(r,r.salesClosed||r.performances.some(o=>o.salesClosed),s),s}setSelectionMode(e,t){if(this.pendingOperationId||this.holdBlocked)throw new V(409,"group_operation_pending","group_operation_pending");e!==this.selectionMode&&(this.selectionMode=e,t!=null&&(this.partySize=t),this.objectsCache=null,this.selectionsByEvent.clear(),this.activePerformanceKey=this.descriptorCache?.performances[0]?.eventKey??this.activePerformanceKey)}setActivePerformance(e){if(this.descriptorCache&&!this.descriptorCache.performances.some(t=>t.eventKey===e))throw new V(404,"group_performance_not_found","group_performance_not_found");this.activePerformanceKey=e}setIncludedEventKeys(e){let t=new Set(this.descriptorCache?.performances.map(n=>n.eventKey)??[]);if(!e.length||new Set(e).size!==e.length||e.some(n=>!t.has(n)))throw new V(422,"invalid_event_keys","invalid_event_keys");this.includedEventKeys=new Set(e),this.reuseObjectsCacheOnce=!!this.objectsCache}includedPerformanceKeys(){return(this.descriptorCache?.performances??[]).map(e=>e.eventKey).filter(e=>this.includedEventKeys.has(e))}setPerformanceSelections(e,t){this.selectionsByEvent.set(e,t.map(n=>({...n})))}allocationsForHold(e){return(this.allocationsByHold.get(e)??[]).map(t=>({eventKey:t.eventKey,items:t.items.map(n=>({...n}))}))}async hold(e,t,n,r){if(this.assertUsable(),r)throw new V(409,"group_hold_replace_unsupported","group_hold_replace_unsupported");let s=t.map(c=>c.label),o={labels:s};if(this.descriptorCache?.inclusionMode==="flexible_dates"&&(o.eventKeys=this.includedPerformanceKeys()),this.selectionMode==="per_performance"){if(!this.activePerformanceKey||!this.descriptorCache||!this.partySize)throw new V(409,"group_selection_incomplete","group_selection_incomplete");this.setPerformanceSelections(this.activePerformanceKey,t);let c=this.descriptorCache.performances.filter(p=>this.includedEventKeys.has(p.eventKey)).map(p=>({eventKey:p.eventKey,selections:this.selectionsByEvent.get(p.eventKey)??[]}));if(c.some(p=>p.selections.length!==this.partySize))throw new V(409,"group_selection_incomplete","group_selection_incomplete");o={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,...o,...n?{ttlMs:n}:{}})})}catch(c){if(c instanceof K)throw c;if(c instanceof ae)throw this.failOperation(a),c;return this.recover(a,s,Date.now()+this.recoveryTimeoutMs)}if(l.status===201||l.status===202||l.status===504){let c=await this.responseJson(l);return this.emit(c.operation),l.status===201?this.complete(c.operation):this.recover(a,s,Date.now()+this.recoveryTimeoutMs,En(l))}if(l.status===503){let c=await l.clone().json().catch(()=>null);if((c?.code??c?.error)==="performance_group_abort_pending"){let p=c?.operation?.operationId??a;return this.beginOperation(p),c?.operation&&this.emit(c.operation),this.recover(p,s,Date.now()+this.recoveryTimeoutMs,En(l))}}try{return await this.throwResponse(l,s)}catch(c){throw this.failOperation(a),c}}async release(e,t,n){this.assertUsable();let r=this.operationForHold(n),s=await this.json(`${ot(this.groupKey,r)}/release`,{method:"POST",body:"{}"});return this.operationByHold.delete(n),this.allocationsByHold.delete(n),this.clearOperationRecord(),s}async resume(e,t){this.assertUsable();let n=this.operationForHold(t),r=await this.json(ot(this.groupKey,n));return this.complete(r.operation)}async extend(e,t,n=12e4){this.assertUsable();let r=this.operationForHold(t),s=Math.max(pp,Math.min(hp,Math.round(n))),o=await this.json(`${ot(this.groupKey,r)}/extend`,{method:"POST",body:JSON.stringify({ttlMs:s})}),a=this.complete(o.operation);return{holdId:a.holdId,expiresAt:a.expiresAt}}bestAvailable(){return Promise.reject(new V(400,"group_best_available_unsupported","group_best_available_unsupported"))}socketUrl(){return""}createRealtime(e,t){return new Cn(this,t,this.realtimePollMs)}operationIdForHold(e){return this.operationByHold.get(e)??this.readMapping(e)}rememberOperation(e,t){!e||!t||(this.operationByHold.set(e,t),this.writeMapping(e,t))}async restoreOperation(){let e=this.readOperationRecord();if(!e)return null;if(!this.storedIsUndecided(e)&&e.state!=="committed"&&e.state!=="booked")return this.clearOperationRecord(),null;this.pendingOperationId=e.operationId,this.emitRecovery({kind:"pending",operationId:e.operationId,phase:e.state==="undecided"?"unknown":e.state,longRunning:!1,reference:Ht(e.operationId)});let t;try{t=await this.authorized(ot(this.groupKey,e.operationId))}catch(s){return s instanceof K||this.recoveryFailed(e.operationId,"request_failed"),null}if(t.status===404)return this.failOperation(e.operationId),null;if(!t.ok)return this.recoveryFailed(e.operationId,"request_failed"),null;let n=await this.responseJson(t);this.emit(n.operation);let r=n.operation.state;return r==="committed"||r==="booked"?(this.emitRecovery({kind:"idle"}),this.complete(n.operation)):r==="aborted"||r==="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>=gp?fp:mp;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 r=await this.authorized(ot(this.groupKey,e));if(!r.ok)return this.scheduleSettlementPoll();t=(await this.responseJson(r)).operation}catch(r){return r instanceof K?this.stopSettlementWatch():this.scheduleSettlementPoll()}if(this.destroyed||this.settleOperationId!==e)return;let n=t.state!==this.settleState;if(this.settleState=t.state,n&&this.noteOperationState(e,t.state),this.settled(t.state)){this.stopSettlementWatch(),t.state!=="booked"&&this.clearOperationRecord(),this.emit(t);return}n&&this.emit(t),this.scheduleSettlementPoll()}destroy(){if(!this.destroyed){this.destroyed=!0,this.stopSettlementWatch(),this.access.onRenewed(void 0);try{this.aborter.abort()}catch{}}}operationRecordKey(){return`@seatlayer/performance-group-operation/v1/${encodeURIComponent(this.base)}/${encodeURIComponent(this.groupKey)}`}readOperationRecord(){try{let e=window.sessionStorage.getItem(this.operationRecordKey());if(!e)return null;let t=JSON.parse(e);return!t?.operationId||t.groupKey!==this.groupKey?null:t}catch{return null}}storedIsUndecided(e){return e.state==="undecided"||bp.has(e.state)}writeOperationRecord(e){try{window.sessionStorage.setItem(this.operationRecordKey(),JSON.stringify(e))}catch{}}clearOperationRecord(){try{window.sessionStorage.removeItem(this.operationRecordKey())}catch{}}beginOperation(e){this.pendingOperationId=e;let t=this.readOperationRecord();this.writeOperationRecord({operationId:e,groupKey:this.groupKey,state:"undecided",createdAt:t?.operationId===e?t.createdAt:Date.now()})}noteOperationState(e,t){let n=this.readOperationRecord();!n||n.operationId!==e||this.writeOperationRecord({...n,state:t})}failOperation(e){this.pendingOperationId=null,this.clearOperationRecord(),this.emitRecovery({kind:"idle"}),this.onOperationState?.({operationId:e,state:"aborted",decision:"abort"})}async adoptSession(e){if(this.destroyed)return;let t=`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/session/adopt`;for(let r=0;r<2;r++){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 V(409,"performance_group_session_adopt_failed","performance_group_session_adopt_failed");let n=this.pendingOperationId??"";throw this.emitRecovery({kind:"failed",operationId:n,reference:n?Ht(n):"",reason:"session_adopt_failed",retryable:!1}),this.adoptFailure}async recover(e,t,n,r=100){let s=r,o=Date.now()+Math.min(8e3,Math.max(500,this.recoveryTimeoutMs/2)),a="unknown";for(;Date.now()<=n;){if(this.destroyed)throw new K;if(this.emitRecovery({kind:"pending",operationId:e,phase:a,longRunning:Date.now()>=o,reference:Ht(e)}),await vp(s),this.destroyed)throw new K;let l;try{l=await this.authorized(ot(this.groupKey,e))}catch(d){if(d instanceof K)throw d;if(d instanceof ae)throw this.recoveryFailed(e,"request_failed"),d;s=Math.min(2e3,Math.max(100,s*2));continue}if(l.status===404){s=Math.min(1e3,Math.max(100,s*2));continue}if(!l.ok){this.recoveryFailed(e,"request_failed");try{return await this.throwResponse(l,t)}finally{this.pendingOperationId=null,this.clearOperationRecord()}}let p=(await this.responseJson(l)).operation;if(a=p.state,this.noteOperationState(e,p.state),this.emit(p),p.state==="committed"||p.state==="booked")return this.emitRecovery({kind:"idle"}),this.complete(p);if(p.state==="aborted"||p.state==="expired")throw this.failOperation(e),new V(409,"conflict","conflict",t.map(d=>({label:d,status:"held"})));s=En(l)}throw this.recoveryFailed(e,"deadline"),new V(504,"performance_group_outcome_unknown","performance_group_outcome_unknown")}recoveryFailed(e,t){this.emitRecovery({kind:"failed",operationId:e,reference:Ht(e),reason:t,retryable:!0})}emitRecovery(e){if(this.destroyed)return;let t=this.lastRecovery.kind===e.kind&&JSON.stringify(this.lastRecovery)===JSON.stringify(e);this.lastRecovery=e,t||this.onRecoveryState?.(e)}noteAvailability(e,t,n){if(this.destroyed||!this.onAvailability)return;let r=e.state??this.descriptorCache?.state??"active",s=e.revision??null,o=!!s&&!!this.knownRevision&&s!==this.knownRevision;s&&!this.knownRevision&&(this.knownRevision=s);let a=n?.partial??{},l=Object.values(n?.seats??{});this.onAvailability({partial:a,freeCount:l.filter(c=>c==="free").length,blockedCount:Object.keys(n?.seats??{}).filter(c=>n.seats[c]!=="free"&&!(c in a)).length,state:r,salesClosed:!!t||r!=="active",revision:s,revisionChanged:o})}acceptRevision(e){this.knownRevision=e}complete(e){if(!e.hold||e.hold.expiresAt==null)throw new V(409,"group_hold_not_active","group_hold_not_active");this.pendingOperationId=null,this.noteOperationState(e.operationId,e.state),this.operationByHold.set(e.hold.id,e.operationId),this.writeMapping(e.hold.id,e.operationId);let t=e.hold.allocations??[];this.allocationsByHold.set(e.hold.id,t);let n=t.find(r=>r.eventKey===this.activePerformanceKey)?.items;return{holdId:e.hold.id,expiresAt:e.hold.expiresAt,items:n??e.hold.items??[]}}emit(e){this.destroyed||this.onOperationState?.({operationId:e.operationId,state:e.state,decision:e.decision})}operationForHold(e){let t=this.operationIdForHold(e);if(!t)throw new V(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 K;if(this.adoptFailure)throw this.adoptFailure}async authorized(e,t={},n=!1){if(this.destroyed)throw new K;if(this.adoptFailure)throw this.adoptFailure;let r={...t.headers};t.body!==void 0&&(r["Content-Type"]="application/json");let s=await this.access.authorization(n?"unauthorized":"initial");if(this.destroyed)throw new K;if(this.adoptFailure)throw this.adoptFailure;if(!s)throw new Error("performance_group_buyer_access_required");r.Authorization=s;let o=await this.fetcher(`${this.base}${e}`,{method:t.method??"GET",headers:r,body:t.body,credentials:"omit",signal:this.aborter.signal});if(!n&&(o.status===401||o.status===403||o.status===422)){let a=await o.clone().json().catch(()=>null);if(await this.access.handleFailure(o.status,a?.code??a?.error))return this.authorized(e,t,!0)}return o}async json(e,t={}){let n=await this.authorized(e,t);return n.ok?this.responseJson(n):this.throwResponse(n)}async blob(e){let t=await this.authorized(e);return t.ok?t.blob():this.throwResponse(t)}async responseJson(e){return e.json()}async throwResponse(e,t=[]){let r=await e.json().catch(()=>null)??{},s=r.code??r.error??`request_failed_${e.status}`;throw e.status===409&&!r.conflicts?.length&&t.length&&(r.conflicts=t.map(o=>({label:o,status:"held"}))),new V(e.status,r.error??s,s,r.conflicts)}};var kp="https://api.seatlayer.io";function Ma(i){let e=typeof i=="string"?document.querySelector(i):i;if(!e)throw new Error("seatlayer: Performance Group picker container was not found");return e}var An=class{constructor(e){this.descriptorValue=null;this.picker=null;this.root=null;this.innerHost=null;this.tabsHost=null;this.prevButton=null;this.nextButton=null;this.heldSummary=null;this.live=null;this.statusHost=null;this.statusCopy=null;this.statusAction=null;this.rendered=!1;this.destroyed=!1;this.continued=!1;this.switchingPerformance=!1;this.operationPending=!1;this.recovery={kind:"idle"};this.availability=null;this.activePerformanceKey=null;this.selectionsByEvent=new Map;this.validByEvent=new Map;this.refreshingComposition=!1;this.activeHandoff=null;this.selectionModeValue="same_seat";this.progressHost=null;this.legendHost=null;this.paneHost=null;this.datesSummaryHost=null;this.datesCardsHost=null;this.resettingFlexibleSelection=!1;this.selectingPartialSeat=!1;this.partialSeatDates=new Map;this.markedLabels=new Set;this.holdTicker=null;this.switchingMode=!1;this.booked=!1;if(!e||typeof e!="object")throw new Error("seatlayer: options object is required");if(!e.performanceGroup)throw new Error("seatlayer: `performanceGroup` key is required");if(!e.container)throw new Error("seatlayer: `container` is required");if(!e.buyerAccessToken&&!e.buyerAccessTokenProvider)throw new Error("seatlayer: Performance Group buyer access is required");if(!!e.initialHoldId!=!!e.initialOperationId)throw new Error("seatlayer: `initialHoldId` and `initialOperationId` must be supplied together");if((e.selectionMode==="per_performance"||e.allowSelectionModeSwitch)&&(!Number.isSafeInteger(e.numberOfPlacesToSelect)||(e.numberOfPlacesToSelect??0)<1))throw new Error("seatlayer: `numberOfPlacesToSelect` is required for per-performance selection");this.selectionModeValue=e.selectionMode??"same_seat",this.options=e,this.panelId=`sl-pg-panel-${e.performanceGroup}`,this.access=new de({provider:e.buyerAccessTokenProvider,token:e.buyerAccessToken,onExpired:e.onAccessExpired,onUnavailable:e.onAccessUnavailable}),this.api=new Mi(e.performanceGroup,{apiBase:e.apiBase,access:this.access,selectionMode:e.selectionMode,partySize:e.selectionMode==="per_performance"?e.numberOfPlacesToSelect:void 0,onOperationState:t=>this.operationChanged(t),onRecoveryState:t=>this.recoveryChanged(t),onAvailability:t=>this.availabilityChanged(t)}),e.initialHoldId&&e.initialOperationId&&this.api.rememberOperation(e.initialHoldId,e.initialOperationId)}get mode(){return this.selectionModeValue}get selectionMode(){return this.selectionModeValue}get descriptor(){return this.descriptorValue}get currentHold(){return this.activeHandoff}async render(){if(this.rendered)return this;let e=performance.now();if(this.rendered=!0,La(),await wp(this.options.locale),this.options.messages&&xp(this.options.messages),this.destroyed)return this;let t;try{t=await this.api.descriptor()}catch(n){throw xe({apiBase:this.options.apiBase??kp,event:this.options.performanceGroup,scope:"performance_group",surface:"performance_group_picker",outcome:"failure",stage:"group_descriptor",ms:performance.now()-e,load:Me(this.options.performanceGroup),transport:"pubapi"}),n}return this.destroyed?this:(this.descriptorValue=t,this.activePerformanceKey=t.performances[0]?.eventKey??null,this.buildChrome(Ma(this.options.container),t),this.announce(this.copy("picker.group.checkingAvailability")),await this.mountPicker(t),this.destroyed?this:(await this.restoreOperation(),this))}buildChrome(e,t){e.replaceChildren();let n=document.createElement("div");n.className="sl-pg-root",n.dataset.performanceGroup=t.key,n.dataset.selectionMode=this.mode;let r=document.createElement("div");r.className="sl-pg-progress";let s=document.createElement("section");s.className="sl-pg-head",s.setAttribute("aria-labelledby",`sl-pg-title-${t.key}`);let o=document.createElement("h2");o.id=`sl-pg-title-${t.key}`,o.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 p=document.createElement("summary");p.textContent=this.copy(t.inclusionMode==="flexible_dates"?"picker.group.flexibleDatesInView":"picker.group.allDates",{count:t.performanceCount});let d=document.createElement("div");d.innerHTML=cn(this.performanceCards(t),this.copy(t.inclusionMode==="flexible_dates"?"picker.group.flexibleDatesNote":"picker.group.includedNote",{count:t.performanceCount})),c.append(p,d);let u=document.createElement("div");u.className="sl-pg-held-summary",u.hidden=!0,s.append(o,a,l,c,u);let h=document.createElement("div");h.className="sl-pg-legend";let g=document.createElement("div");g.className="sl-pg-pane",g.setAttribute("role","group"),g.setAttribute("aria-label",this.copy("picker.group.yourSelection")),g.hidden=!0;let b=this.mode==="per_performance"?this.performanceTabs(t):null,w=document.createElement("div");w.className="sl-pg-inner",w.id=this.panelId,w.setAttribute("aria-busy","false"),w.dataset.locked="false",this.mode==="per_performance"&&(w.setAttribute("role","tabpanel"),w.tabIndex=-1);let x=document.createElement("div");x.className="sl-pg-status",x.setAttribute("role","status"),x.setAttribute("aria-live","polite"),x.hidden=!0;let y=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()}),x.append(y,m),w.appendChild(x);let A=document.createElement("div");A.className="sl-pg-live",A.setAttribute("role","status"),A.setAttribute("aria-live","polite"),n.append(r,s),b&&n.append(b),n.append(h,w,g,A),e.appendChild(n),this.root=n,this.progressHost=r,this.legendHost=h,this.paneHost=g,this.datesSummaryHost=p,this.datesCardsHost=d,this.innerHost=w,this.heldSummary=u,this.live=A,this.statusHost=x,this.statusCopy=y,this.statusAction=m,this.syncProgress(),this.syncLegend(),this.syncPane()}async mountPicker(e){let t=new $e(Pi({container:this.innerHost,event:e.key,apiBase:this.options.apiBase,transport:this.api,hideEventDetails:!0,maxSelection:this.options.maxSelection,selectedObjects:this.options.selectedObjects,selectableObjects:this.options.selectableObjects,numberOfPlacesToSelect:this.options.numberOfPlacesToSelect,selectionValidators:this.options.selectionValidators,locale:this.options.locale,messages:this.options.messages,languages:this.options.languages,colorblindSafe:this.options.colorblindSafe,initialView:this.options.initialView,enable3D:this.options.enable3D,max3DSeats:this.options.max3DSeats,onBuyerViewChange:this.options.onBuyerViewChange,onAnalytics:(n,r)=>{try{this.options.onAnalytics?.(n,{...r,metricScope:"performance_group",performanceGroupKey:e.key,performanceCount:e.performanceCount,selectionMode:this.mode})}catch{}},hideBadge:this.options.hideBadge,theme:this.options.theme,holdTtlMs:this.options.holdTtlMs,initialHoldId:this.options.initialHoldId,restoreHold:this.options.restoreHold,confirmSelection:this.options.confirmSelection,seatView:this.options.seatView,onSelectionChange:n=>this.selectionChanged(n),onSelectionValidityChange:n=>this.selectionValidityChanged(n),onSelectionValid:this.options.onSelectionValid,onSelectionInvalid:this.options.onSelectionInvalid,onSelectionLimit:this.options.onSelectionLimit,onHoldChange:(n,r)=>this.holdChanged(n,r),onCheckout:(n,r)=>this.checkout(n,r),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"?hs(this.includedPerformances(),e.performanceCount,this.options.locale,this.copy("picker.group.flexibleSelectedNote",{count:this.includedPerformances().length})):null,selectNight:n=>{this.switchPerformance(n)},selectionModeSwitch:this.options.allowSelectionModeSwitch&&this.mode==="same_seat"?{label:this.copy("picker.group.chooseNightByNight"),activate:()=>{this.switchSelectionMode("per_performance")}}:null,partialSeatSelection:e.inclusionMode==="flexible_dates"&&this.mode==="same_seat"?{label:n=>this.copy("picker.group.selectAvailableDates",{count:n}),activate:(n,r)=>{this.selectPartialSeat(n,r)}}:null,confirmDateSelection:e.inclusionMode==="flexible_dates"&&this.mode==="same_seat"?{includedEventKeys:()=>this.api.includedPerformanceKeys(),availableEventKeys:n=>this.partialSeatDates.get(n)??this.nights().map(r=>r.eventKey),label:n=>this.copy("picker.group.selectAvailableDates",{count:n}),apply:(n,r)=>this.applySeatDates(n,r,!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:hi(t,this.options.locale),time:ui(t,this.options.locale)}))}nights(){return(this.descriptorValue?.performances??[]).map(e=>({eventKey:e.eventKey,name:e.name,shortDate:mi(e,this.options.locale)}))}seatMarks(){let e=this.descriptorValue?.performanceCount??0,t=this.availability,n=!!t?.salesClosed||!!t&&t.state!=="active",r=this.mode==="same_seat"&&!n?t?.partial??{}:{},s={};for(let o of this.markedLabels)s[o]=null;if(this.markedLabels.clear(),e>0)for(let[o,a]of Object.entries(r))!a.length||a.length>=e||(s[o]={kind:"partial",fraction:(e-a.length)/e,data:{blockedEventKeys:[...a]}},this.markedLabels.add(o));return s}activePerformanceLabel(){if(this.mode!=="per_performance")return null;let e=this.descriptorValue?.performances.find(r=>r.eventKey===this.activePerformanceKey);if(!e)return null;let t=mi(e,this.options.locale),n=e.name?.trim();return n&&n!==t?`${n} \xB7 ${t}`:t}nightSummary(){return this.mode!=="per_performance"?[]:(this.descriptorValue?.performances??[]).map(e=>({eventKey:e.eventKey,name:mi(e,this.options.locale),labels:(this.selectionsByEvent.get(e.eventKey)??[]).map(t=>t.label),active:e.eventKey===this.activePerformanceKey}))}groupSelectionSummary(){let e=this.includedPerformances();if(!e.length)return null;if(this.mode==="same_seat"){let s=this.activeHandoff?.seatLabels.length??this.picker?.getSelection().length??0;return{seats:s*e.length,performances:e.length,totalPerformances:this.descriptorValue?.performanceCount??e.length,performancesChosen:s?e.length:0,perPerformance:s}}let t=e.map(s=>this.selectionsByEvent.get(s.eventKey)?.length??0),n=t.filter(s=>s>0),r=n.length===t.length&&n.every(s=>s===n[0]);return{seats:t.reduce((s,o)=>s+o,0),performances:e.length,totalPerformances:this.descriptorValue?.performanceCount??e.length,performancesChosen:n.length,perPerformance:r&&n.length?n[0]:null}}syncProgress(){if(!this.progressHost)return;let e=!!this.activeHandoff,t=[{id:"performances",label:this.copy("picker.group.stepPerformances"),state:"done"},{id:"seats",label:this.copy("picker.group.stepSeats"),state:e?"done":"current"},{id:"review",label:this.copy("picker.group.stepReview"),state:this.booked?"done":e?"current":"upcoming"}];this.progressHost.innerHTML=Ss(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=ms({available:e.freeCount>0,selected:(this.picker?.getSelection().length??0)>0,partial:Object.keys(e.partial).length>0,unavailable:e.blockedCount>0},{title:this.copy("picker.group.legendTitle"),available:this.copy("picker.group.legendAvailable"),selected:this.copy("picker.group.legendSelected"),partial:this.copy("picker.group.legendNotEveryDate"),unavailable:this.copy("picker.group.legendUnavailable")},this.categoryColor())}categoryColor(){return this.picker?.categoryLegendColor()??"#2563eb"}syncPane(){let e=this.paneHost;if(!e)return;let t=this.includedPerformances();if(this.mode!=="same_seat"||!t.length){e.hidden=!0,e.replaceChildren();return}let n=this.activeHandoff?.seatLabels??this.picker?.getSelection().map(s=>s.label)??[],r=this.heldTotal();e.hidden=!1,e.innerHTML=ks({title:this.copy("picker.group.yourSelection"),rows:t.map(s=>({eventKey:s.eventKey,name:`${hi(s,this.options.locale)} ${ui(s,this.options.locale)}`,labels:n})),empty:this.copy("picker.group.noSeatsChosenYet"),note:r?null:this.copy("picker.group.pricesPerPerformance"),total:r?{label:this.copy("picker.group.total"),amount:r}:null,holdStatus:this.booked?this.copy("picker.group.bookedAll",{count:t.length}):this.activeHandoff?this.copy("picker.group.heldTogether",{count:t.length,time:Ts(this.activeHandoff.expiresAt-Date.now())}):null})}heldTotal(){let e=this.activeHandoff,t=this.descriptorValue;if(!e||!t)return null;let r=this.api.allocationsForHold(e.holdId).flatMap(a=>a.items);if(!r.length)return null;let s=r.reduce((a,l)=>a+l.unitPrice*(l.quantity??1),0),o=r[0]?.currency??t.currency;try{return yp(s,o,void 0,this.options.locale)}catch{return`${o} ${s.toFixed(2)}`}}includedPerformances(){let e=this.descriptorValue?.performances??[];if(this.descriptorValue?.inclusionMode!=="flexible_dates")return e;let t=new Set(this.api.includedPerformanceKeys());return e.filter(n=>t.has(n.eventKey))}syncIncludedDates(){let e=this.descriptorValue;if(!e||!this.datesSummaryHost||!this.datesCardsHost)return;let t=this.includedPerformances(),n=e.inclusionMode==="flexible_dates";this.datesSummaryHost.textContent=n&&t.length<e.performanceCount?this.copy("picker.group.flexibleDatesSelected",{selected:t.length,total:e.performanceCount}):this.copy(n?"picker.group.flexibleDatesInView":"picker.group.allDates",{count:e.performanceCount}),this.datesCardsHost.innerHTML=cn(this.performanceCards({...e,performances:t}),this.copy(n&&t.length<e.performanceCount?"picker.group.flexibleSelectedNote":n?"picker.group.flexibleDatesNote":"picker.group.includedNote",{count:t.length}))}async selectPartialSeat(e,t){if(!(this.destroyed||this.holdBlocked()||this.activeHandoff||!t.length)){if((this.picker?.getSelection().length??0)>0){this.announce(this.copy("picker.group.clearBeforePartial"));return}this.partialSeatDates.set(e,[...t]),await this.applySeatDates(e,t,!1)}}async applySeatDates(e,t,n){if(this.destroyed||this.holdBlocked()||this.activeHandoff||!t.length)return!1;let r=this.api.includedPerformanceKeys();if(r.length===t.length&&r.every(s=>t.includes(s)))return!0;this.selectingPartialSeat=!0;try{if(this.api.setIncludedEventKeys(t),this.syncIncludedDates(),await this.picker?.refreshAvailability(),!(n?this.picker?.selectObjectsWithoutConfirmation([e])??[]:this.picker?.selectObjects([e])??[]).length)throw new Error("performance_group_partial_seat_unavailable");return this.announce(this.copy("picker.group.selectedAvailableDates",{count:t.length})),this.syncPane(),this.syncLegend(),!0}catch(s){return r.length&&(this.api.setIncludedEventKeys(r),this.syncIncludedDates(),await this.picker?.refreshAvailability().catch(()=>{})),this.options.onError?.(s),!1}finally{this.selectingPartialSeat=!1}}syncHoldTicker(){this.booked||(this.activeHandoff&&!this.holdTicker?this.holdTicker=setInterval(()=>this.syncPane(),1e3):!this.activeHandoff&&this.holdTicker&&(clearInterval(this.holdTicker),this.holdTicker=null))}async switchSelectionMode(e){if(!(this.destroyed||this.switchingMode||e===this.mode)&&!(this.activeHandoff||this.holdBlocked())){this.switchingMode=!0;try{this.api.setSelectionMode(e,this.options.numberOfPlacesToSelect),this.selectionModeValue=e,this.picker?.destroy(),this.picker=null,this.selectionsByEvent.clear(),this.validByEvent.clear(),this.markedLabels.clear(),this.availability=null;let t=this.descriptorValue;if(this.activePerformanceKey=t.performances[0]?.eventKey??null,this.buildChrome(Ma(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 K)return;this.options.onError?.(t)}finally{this.switchingMode=!1}}}async release(){await this.picker?.release()}close(){this.destroy()}destroy(){if(this.destroyed)return;this.destroyed=!0,this.api.destroy(),this.holdTicker&&clearInterval(this.holdTicker),this.holdTicker=null;let e=this.picker;this.root?.setAttribute("hidden","");let t=()=>{e?.destroy(),this.access.clear(),this.root?.remove(),this.root=null,this.picker=null,this.innerHost=null,this.tabsHost=null,this.statusHost=null,this.statusCopy=null,this.statusAction=null,this.live=null};e?.getCurrentHold()&&!this.continued?e.release().catch(()=>{}).finally(t):t()}copy(e,t){let n=this.options.messages?.[e];return n!==void 0?t?n.replace(/\{(\w+)\}/g,(r,s)=>String(t[s]??`{${s}}`)):n:Sp(e,t)}performanceTabs(e){let t=document.createElement("div");t.className="sl-pg-tabsbar";let n=document.createElement("button");n.type="button",n.className="sl-pg-step",n.dataset.step="previous",n.setAttribute("aria-label",this.copy("picker.group.previousPerformance")),n.textContent="\u2039",n.addEventListener("click",()=>{this.stepPerformance(-1)});let r=document.createElement("button");r.type="button",r.className="sl-pg-step",r.dataset.step="next",r.setAttribute("aria-label",this.copy("picker.group.nextPerformance")),r.textContent="\u203A",r.addEventListener("click",()=>{this.stepPerformance(1)});let s=document.createElement("div");return s.className="sl-pg-tabs",s.setAttribute("role","tablist"),s.setAttribute("aria-label",this.copy("picker.group.performances")),e.performances.forEach((o,a)=>{let l=document.createElement("button");l.type="button",l.className="sl-pg-tab",l.id=`sl-pg-tab-${e.key}-${o.eventKey}`,l.dataset.eventKey=o.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=o.name;let p=document.createElement("span");p.className="sl-pg-tab-state",p.textContent=this.copy("picker.group.stillNeedsSeat");let d=document.createElement("span");d.className="sl-pg-tab-badge",d.textContent=this.copy("picker.group.chosenOfTotal",{chosen:0,total:this.options.numberOfPlacesToSelect??1}),l.append(c,d,p),l.addEventListener("click",()=>{this.switchPerformance(o.eventKey)}),l.addEventListener("keydown",u=>this.tabKeydown(u)),s.appendChild(l)}),t.append(n,s,r),this.tabsHost=s,this.prevButton=n,this.nextButton=r,t}tabButtons(){return[...this.tabsHost?.querySelectorAll(".sl-pg-tab")??[]]}tabKeydown(e){let t=this.tabButtons(),n=t.findIndex(a=>a===e.target);if(n<0)return;let r=getComputedStyle(this.tabsHost??document.body).direction==="rtl",s=-1;switch(e.key){case"ArrowRight":s=n+(r?-1:1);break;case"ArrowLeft":s=n+(r?1:-1);break;case"ArrowDown":s=n+1;break;case"ArrowUp":s=n-1;break;case"Home":s=0;break;case"End":s=t.length-1;break;default:return}if(s<0||s>=t.length)return;e.preventDefault();let o=t[s];o.focus({preventScroll:!0}),o.disabled||this.switchPerformance(o.dataset.eventKey)}stepPerformance(e){let t=this.tabButtons(),n=t.findIndex(s=>s.dataset.eventKey===this.activePerformanceKey),r=t[n+e];!r||r.disabled||(r.focus({preventScroll:!0}),this.switchPerformance(r.dataset.eventKey))}submissionState(){let e=this.descriptorValue?.performances??[];if(this.mode!=="per_performance"){let r=!this.holdBlocked();return{complete:e.length,total:e.length,ready:r}}let t=this.options.numberOfPlacesToSelect,n=e.filter(r=>this.selectionsByEvent.get(r.eventKey)?.length===t&&this.validByEvent.get(r.eventKey)!==!1).length;return{complete:n,total:e.length,ready:n===e.length&&!this.holdBlocked()}}holdBlocked(){return this.operationPending||this.recovery.kind!=="idle"||!!this.availability?.salesClosed}selectionChanged(e){if(this.mode!=="per_performance"){this.options.onSelectionChange?.(e),this.syncPane(),this.syncLegend(),!e.length&&!this.activeHandoff&&!this.resettingFlexibleSelection&&!this.selectingPartialSeat&&this.descriptorValue?.inclusionMode==="flexible_dates"&&this.api.includedPerformanceKeys().length<this.descriptorValue.performanceCount&&(this.resettingFlexibleSelection=!0,this.api.setIncludedEventKeys(this.descriptorValue.performances.map(n=>n.eventKey)),this.syncIncludedDates(),this.picker?.refreshAvailability().catch(n=>this.options.onError?.(n)).finally(()=>{this.resettingFlexibleSelection=!1}));return}if(this.refreshingComposition||this.switchingPerformance||!this.activePerformanceKey)return;let t=e.map(n=>({...n}));this.selectionsByEvent.set(this.activePerformanceKey,t),this.api.setPerformanceSelections(this.activePerformanceKey,t.map(n=>({label:n.label}))),t.length!==this.options.numberOfPlacesToSelect?this.validByEvent.set(this.activePerformanceKey,!1):this.validByEvent.has(this.activePerformanceKey)||this.validByEvent.set(this.activePerformanceKey,!0),this.updateTabs(),this.options.onSelectionChange?.(e),this.refreshComposition(),this.syncLegend()}selectionValidityChanged(e){if(this.mode==="per_performance"&&!this.switchingPerformance&&this.activePerformanceKey){let t=this.validByEvent.get(this.activePerformanceKey);this.validByEvent.set(this.activePerformanceKey,e.isValid),this.updateTabs(),!this.refreshingComposition&&t!==e.isValid&&this.refreshComposition()}this.options.onSelectionValidityChange?.(e)}refreshComposition(){if(this.refreshingComposition||!this.picker)return;let e=this.submissionState();this.refreshingComposition=!0;try{this.picker.refreshPerformanceGroupComposition();let t=this.submissionState();(e.complete!==t.complete||e.ready!==t.ready)&&this.picker.refreshPerformanceGroupComposition()}finally{this.refreshingComposition=!1}}tabState(e){let t=this.options.numberOfPlacesToSelect??1,n=(this.selectionsByEvent.get(e)??[]).map(s=>s.label),r=this.copy("picker.group.chosenOfTotal",{chosen:n.length,total:t});return n.length===0?{key:"not-started",label:this.copy("picker.group.stillNeedsSeat"),badge:r}:n.length===t&&this.validByEvent.get(e)!==!1?{key:"complete",label:this.copy("picker.group.completeWithSeats",{seats:n.join(", ")}),badge:r}:n.length===t?{key:"needs-attention",label:this.copy("picker.group.needsAttention"),badge:r}:{key:"in-progress",label:this.copy("picker.group.needsMoreSeats",{count:t-n.length}),badge:r}}updateTabs(){let e=this.tabButtons(),t=this.switchingPerformance||this.operationPending||this.recovery.kind!=="idle"||!!this.activeHandoff;e.forEach(r=>{let s=r.dataset.eventKey,o=this.tabState(s),a=s===this.activePerformanceKey;r.dataset.state=o.key,r.disabled=t,r.setAttribute("aria-selected",String(a)),r.tabIndex=a?0:-1;let l=r.querySelector(".sl-pg-tab-state");l&&(l.textContent=o.label);let c=r.querySelector(".sl-pg-tab-badge");c&&(c.textContent=o.badge);let p=r.querySelector(".sl-pg-tab-name")?.textContent??s;r.setAttribute("aria-label",`${p}: ${o.badge} \xB7 ${o.label}`),a&&this.innerHost?.setAttribute("aria-labelledby",r.id)});let n=e.findIndex(r=>r.dataset.eventKey===this.activePerformanceKey);this.prevButton&&(this.prevButton.disabled=t||n<=0),this.nextButton&&(this.nextButton.disabled=t||n<0||n>=e.length-1)}async switchPerformance(e){if(this.mode!=="per_performance"||this.switchingPerformance||this.holdBlocked()||this.activeHandoff||e===this.activePerformanceKey||!this.picker)return;this.activePerformanceKey&&this.selectionChanged(this.picker.getSelection());let t=this.selectionsByEvent.get(e)?.map(n=>n.label)??[];this.switchingPerformance=!0,this.activePerformanceKey=e,this.updateTabs(),this.setInteractionLocked(!0);try{this.picker.clearSelection(),this.api.setActivePerformance(e),await this.picker.refreshAvailability();let n=this.picker.selectObjects(t);this.switchingPerformance=!1,this.selectionChanged(n),n.length!==t.length&&this.validByEvent.set(e,!1),this.options.onSelectionChange?.(n);let r=this.descriptorValue?.performances.find(s=>s.eventKey===e);r&&this.announce(this.copy("picker.group.performanceOpened",{performance:r.name}))}catch(n){this.options.onError?.(n)}finally{this.switchingPerformance=!1,!this.operationPending&&this.recovery.kind==="idle"&&this.setInteractionLocked(!1),this.updateTabs(),this.picker.refreshPerformanceGroupComposition()}}setInteractionLocked(e){let t=this.innerHost;t&&(t.dataset.locked=String(e),t.setAttribute("aria-busy",String(e)),t.setAttribute("aria-disabled",String(e)))}announce(e){this.live&&(this.live.textContent=e)}showStatus(e,t,n={}){this.statusHost&&this.statusCopy&&this.statusAction&&(this.statusCopy.textContent=t,this.statusHost.hidden=!t,this.statusAction.hidden=!n.retry),this.announce(t),this.options.onStatusChange?.({kind:e,message:t,...n.reference?{reference:n.reference}:{}})}clearStatus(){this.statusHost&&(this.statusHost.hidden=!0),this.statusAction&&(this.statusAction.hidden=!0),this.options.onStatusChange?.({kind:"idle",message:""})}operationChanged(e){if(this.destroyed)return;let t=e.state==="preparing"||e.state==="commit_pending"||e.state==="abort_pending"||e.state==="expire_pending";if(this.operationPending=t,this.setInteractionLocked(t||this.recovery.kind!=="idle"),this.updateTabs(),t){this.showStatus("pending",this.copy(e.state==="commit_pending"?"picker.group.commitPending":e.state==="abort_pending"||e.state==="expire_pending"?"picker.group.abortPending":"picker.group.securing"));return}if(e.state==="booked"){this.bookingSettled();return}if(e.state==="expired"||e.state==="aborted"){this.activeHandoff&&this.holdLost();return}if(e.state==="committed"){this.clearStatus(),this.announce(this.copy("picker.group.secured")),queueMicrotask(()=>this.innerHost?.querySelector('[data-ref="cta"]')?.focus({preventScroll:!0}));return}e.decision==="abort"&&this.recovery.kind==="idle"&&(this.clearStatus(),this.announce(this.copy("picker.group.notSecured")))}bookingSettled(){if(this.booked)return;this.booked=!0,this.root&&(this.root.dataset.booking="booked"),this.clearStatus(),this.holdTicker&&clearInterval(this.holdTicker),this.holdTicker=null;let e=this.activeHandoff?{...this.activeHandoff,bookingState:"booked"}:null;e&&(this.activeHandoff=e),this.syncProgress(),this.syncPane(),this.updateTabs(),this.picker?.notifyGroupSettled("booked"),this.announce(this.copy("picker.group.bookedAll",{count:this.descriptorValue?.performanceCount??0})),e&&this.options.onBooked?.(e)}holdLost(){this.activeHandoff=null,this.api.stopSettlementWatch(),this.resetPerPerformanceSelection(),this.syncProgress(),this.syncPane(),this.syncHoldTicker(),this.picker?.notifyGroupSettled("lost"),this.announce(this.copy("picker.group.notSecured")),this.options.onHoldChange?.(null),this.options.onHoldExpired?.()}recoveryChanged(e){if(!this.destroyed){if(this.recovery=e,this.setInteractionLocked(this.operationPending||e.kind!=="idle"),this.updateTabs(),this.refreshComposition(),e.kind==="idle"){this.operationPending||this.clearStatus();return}if(e.kind==="pending"){this.showStatus("pending",e.longRunning?this.copy("picker.group.longRunning",{reference:e.reference}):this.copy("picker.group.outcomeUnknown"),{reference:e.reference});return}this.showStatus("recovery_failed",this.copy("picker.group.longRunning",{reference:e.reference}),{retry:e.retryable,reference:e.reference}),this.setInteractionLocked(!1)}}async retryRecovery(){if(!(this.destroyed||this.recovery.kind!=="failed"||!this.recovery.retryable))try{await this.api.retryRecovery()}catch(e){if(e instanceof K)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 K)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 K)return;this.options.onError?.(t)}}handoff(e,t){let n=this.descriptorValue,r=this.api.operationIdForHold(e.holdId);if(!n||!r)throw new Error("seatlayer: Performance Group hold identity is unavailable");let s=this.api.allocationsForHold(e.holdId);return{operationId:r,holdId:e.holdId,expiresAt:e.expiresAt,performanceGroup:n,selectionMode:this.mode,performanceKeys:s.map(o=>o.eventKey),bookingState:this.booked?"booked":"held",seatLabels:t.map(o=>o.label),...this.mode==="per_performance"?{allocations:s.map(o=>({eventKey:o.eventKey,seatLabels:o.items.map(a=>a.label)}))}:{}}}renderHeldAllocations(e){if(!(!this.heldSummary||this.mode!=="per_performance")){this.heldSummary.replaceChildren();for(let t of e){let n=this.descriptorValue?.performances.find(o=>o.eventKey===t.eventKey),r=document.createElement("p"),s=document.createElement("strong");s.textContent=n?.name??t.eventKey,r.append(s,document.createTextNode(t.items.map(o=>o.label).join(", "))),this.heldSummary.appendChild(r)}this.heldSummary.hidden=e.length===0}}resetPerPerformanceSelection(){this.mode==="per_performance"&&(this.selectionsByEvent.clear(),this.validByEvent.clear(),this.heldSummary?.replaceChildren(),this.heldSummary&&(this.heldSummary.hidden=!0),this.updateTabs(),this.picker?.refreshPerformanceGroupComposition())}holdChanged(e,t){if(!e){this.activeHandoff=null,this.api.stopSettlementWatch(),this.resetPerPerformanceSelection(),this.syncProgress(),this.syncPane(),this.syncHoldTicker(),this.options.onHoldChange?.(null);return}let n=this.handoff(e,t),r=this.activeHandoff?.holdId!==n.holdId;this.activeHandoff=n,this.renderHeldAllocations(this.api.allocationsForHold(e.holdId)),this.updateTabs(),this.api.watchSettlement(e.holdId),this.syncProgress(),this.syncPane(),this.syncHoldTicker(),r&&this.options.onHold?.(n),this.options.onHoldChange?.(n)}checkout(e,t){let n=this.handoff(e,t);this.continued=!0,this.activeHandoff=n,this.options.onCheckout?.(n)}};var Ha="seatlayer-season-picker-style";function Ra(){if(document.getElementById(Ha))return;let i=document.createElement("style");i.id=Ha,i.textContent=`
2855
2870
  .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)}
2856
2871
  .sl-season-root *{box-sizing:border-box}.sl-season-root button,.sl-season-root summary{font:inherit}
2857
2872
  .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}
@@ -2865,4 +2880,4 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default}
2865
2880
  .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}
2866
2881
  @media(max-width:820px){.sl-season-stage{grid-template-columns:1fr}.sl-season-summary-card{position:static;order:-1}.sl-season-map{min-height:590px}}
2867
2882
  @media(max-width:560px){.sl-season-root{gap:9px}.sl-season-hero{grid-template-columns:1fr;padding:15px;border-radius:14px}.sl-season-offer{min-width:0}.sl-season-progress{grid-template-columns:1fr}.sl-season-progress li+li{border-inline-start:0;border-top:1px solid var(--sl-line,#dde3ea)}.sl-season-progress li[data-state=upcoming]{display:none}.sl-season-date-list{grid-template-columns:1fr}.sl-season-map{min-height:560px}.sl-season-summary-card{padding:13px}.sl-season-benefits{display:grid;grid-template-columns:1fr}}
2868
- `,document.head.appendChild(i)}var kp="https://api.seatlayer.io",Tp=6e4,Ep=5e3,z=class extends Error{constructor(t,n){super(`season_request_failed:${t}`);this.code=t;this.status=n;this.name="SeasonApiError"}},Hi=class extends Error{constructor(t){super(`season_operation_timeout:${t}`);this.operationId=t;this.name="SeasonRecoveryTimeoutError"}};function Cp(i,e){let t=Number(i.headers.get("Retry-After")),n=Number.isFinite(t)&&t>=0?t:e.retryAfterSeconds;return Math.max(0,Math.min(Ep,n*1e3))}function Ap(i,e){return e?.aborted?Promise.reject(e.reason??new DOMException("Aborted","AbortError")):new Promise((t,n)=>{let r=setTimeout(t,i);e?.addEventListener("abort",()=>{clearTimeout(r),n(e.reason??new DOMException("Aborted","AbortError"))},{once:!0})})}function Pp(i){if(!i||typeof i!="object")return"unknown";let e=i;return typeof e.code=="string"?e.code:typeof e.error=="string"?e.error:"unknown"}var Lp=/^shc_[a-f0-9]{40}$/,Mp=/^shh_[a-f0-9]{40}$/,Hp=new Set(["preparing","commit_pending","committed","expire_pending","booking_pending","abort_pending","aborted","partial_terminal","expired","booked"]),Rp=new Set(["pending","prepared","refused","applied","expired","booked","aborted"]);function Pn(i){return Array.isArray(i)?i.some(Pn):!i||typeof i!="object"?!1:Object.entries(i).some(([e,t])=>e==="childHoldId"||e==="child_hold_id"||e==="holdId"&&typeof t=="string"&&Lp.test(t)||Pn(t))}function Rt(i,e,t="invalid_operation_response"){if(!i||typeof i!="object"||Array.isArray(i))throw new z(t,502);if(Pn(i))throw new z("unsafe_operation_response",502);let n=i,r=n.allocations,s=new Set,o=Array.isArray(r)&&r.length>0&&r.every(d=>{if(!d||typeof d!="object")return!1;let u=d.eventId,h=d.state;return typeof u!="string"||!u||typeof h!="string"||!Rp.has(h)||s.has(u)?!1:(s.add(u),!0)}),a=n.bookingRef===null||typeof n.bookingRef=="string"&&n.bookingRef.length>0,l=n.state!=="booked"||typeof n.bookingRef=="string"&&o&&r.every(d=>d.state==="booked"),c=n.state!=="booking_pending"||typeof n.bookingRef=="string"&&o&&r.some(d=>d.state!=="booked"),p=n.state!=="committed"||n.bookingRef===null;if(n.operationId!==e.operationId||n.seasonId!==e.seasonId||n.kind!=="HOLD"||typeof n.holdId!="string"||!Mp.test(n.holdId)||n.policy!=="fixed_inclusion_same_seat"||typeof n.state!="string"||!Hp.has(n.state)||typeof n.expiresAt!="number"||!Number.isFinite(n.expiresAt)||n.expiresAt<0||!a||typeof n.location!="string"||!n.location||typeof n.retryAfterSeconds!="number"||!Number.isFinite(n.retryAfterSeconds)||n.retryAfterSeconds<0||!o||!l||!c||!p||n.pricingAuthority!==void 0&&n.pricingAuthority!=="host"||n.authoritativeAmountIncluded!==void 0&&n.authoritativeAmountIncluded!==!1)throw new z(t,502);return{operationId:n.operationId,seasonId:n.seasonId,kind:n.kind,holdId:n.holdId,expiresAt:n.expiresAt,policy:n.policy,pricingAuthority:"host",authoritativeAmountIncluded:!1,state:n.state,bookingRef:n.bookingRef,location:n.location,retryAfterSeconds:n.retryAfterSeconds,allocations:r.map(d=>({eventId:d.eventId,state:d.state}))}}function Op(i,e,t){if(!Array.isArray(i)||i.length!==t||i.some(o=>typeof o!="string"||!o)||new Set(i).size!==i.length||!Array.isArray(e)||e.length!==i.length)throw new z("invalid_best_available_response",502);let n=i,r=new Set(n),s=new Map;for(let o of e){if(!o||typeof o!="object")throw new z("invalid_best_available_response",502);let a=o;if(typeof a.label!="string"||!r.has(a.label)||s.has(a.label)||typeof a.objectId!="string"||!a.objectId||a.objectType!=="seat"||typeof a.categoryKey!="string"||!a.categoryKey||a.tierId!==null&&(typeof a.tierId!="string"||!a.tierId)||a.quantity!==void 0&&a.quantity!==1)throw new z("invalid_best_available_response",502);s.set(a.label,{label:a.label,objectId:a.objectId,objectType:"seat",categoryKey:a.categoryKey,tierId:a.tierId,...a.quantity===void 0?{}:{quantity:a.quantity}})}return{labels:n,items:n.map(o=>s.get(o))}}function Ma(i,e){return{seasonKey:i.key,planActivationId:i.planActivationId,operationId:e.operationId,holdId:e.holdId,expiresAt:e.expiresAt,policy:e.policy,pricingAuthority:"host",authoritativeAmountIncluded:!1,state:e.state,allocations:e.allocations.map(({eventId:t,state:n})=>({eventKey:t,state:n}))}}var ce,at,me,lt,Ot,fe,ge,ie,ue,Ha,Ri=class{constructor(e,t){O(this,ie);O(this,ce);O(this,at);O(this,me);O(this,lt);O(this,Ot);O(this,fe,!1);O(this,ge,null);T(this,ce,e),T(this,at,(t.apiBase??kp).replace(/\/$/,"")),T(this,me,t.access),T(this,lt,t.fetch??globalThis.fetch.bind(globalThis)),T(this,Ot,t.recoveryTimeoutMs??Tp),f(this,me).onRenewed(n=>E(this,ie,Ha).call(this,n))}async descriptor(){let{body:e}=await E(this,ie,ue).call(this,"GET","");return e.season}async chart(){let{body:e}=await E(this,ie,ue).call(this,"GET","/chart");return e}async availability(){let{body:e}=await E(this,ie,ue).call(this,"GET","/availability"),t=Object.values(e.seats??{});return{...e,freeCount:t.filter(n=>n==="free").length,blockedCount:t.filter(n=>n!=="free").length}}async hold(e,t){let{body:n,response:r}=await E(this,ie,ue).call(this,"POST","/holds",{operationId:t,labels:[...e]});return{operation:Rt(n.operation,{seasonId:f(this,ce),operationId:t}),response:r}}async bestAvailable(e){let{body:t,response:n}=await E(this,ie,ue).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}:{}}),r=Rt(t.operation,{seasonId:f(this,ce),operationId:e.operationId},"invalid_best_available_response"),{labels:s,items:o}=Op(t.labels,t.items,e.qty);return{operation:r,labels:s,items:o,response:n}}async operation(e){let{body:t,response:n}=await E(this,ie,ue).call(this,"GET",`/operations/${encodeURIComponent(e)}`);return{operation:Rt(t.operation,{seasonId:f(this,ce),operationId:e}),response:n}}async release(e,t){let{body:n,response:r}=await E(this,ie,ue).call(this,"POST",`/holds/${encodeURIComponent(e)}/release`,{releaseActionId:t});return{operation:Rt(n.operation,{seasonId:f(this,ce),operationId:e}),response:r}}async renewalIntent(e){let{body:t}=await E(this,ie,ue).call(this,"POST","/renewal-intents",{offerId:e}),n=t.intent;if(!n||n.offerId!==e||n.state!=="intent_received"||!n.intentId||!Number.isFinite(n.receivedAt))throw new z("invalid_renewal_intent_response",502);return n}async waitForTerminal(e,t,n){let r=Date.now(),s=t?{operation:Rt(t.operation,{seasonId:f(this,ce),operationId:e}),response:t.response}:await this.operation(e);for(;s.operation.state==="preparing"||s.operation.state==="commit_pending"||s.operation.state==="expire_pending"||s.operation.state==="booking_pending"||s.operation.state==="abort_pending";){if(Date.now()-r>=f(this,Ot))throw new Hi(e);await Ap(Cp(s.response,s.operation),n),s=await this.operation(e)}return s.operation}destroy(){f(this,fe)||(T(this,fe,!0),f(this,me).onRenewed(void 0),f(this,me).clear())}};ce=new WeakMap,at=new WeakMap,me=new WeakMap,lt=new WeakMap,Ot=new WeakMap,fe=new WeakMap,ge=new WeakMap,ie=new WeakSet,ue=async function(e,t,n,r=!0){if(f(this,fe))throw new z("season_api_destroyed",409);if(f(this,ge))throw f(this,ge);let s=await f(this,me).authorization();if(f(this,fe))throw new z("season_api_destroyed",409);if(f(this,ge))throw f(this,ge);if(!s)throw new ae({reason:"no_token",retryable:!1});let o=await f(this,lt).call(this,`${f(this,at)}/pub/seasons/${encodeURIComponent(f(this,ce))}${t}`,{method:e,headers:{Authorization:s,...n===void 0?{}:{"Content-Type":"application/json"}},body:n===void 0?void 0:JSON.stringify(n)}),a=await o.json().catch(()=>null);if(!o.ok){let l=Pp(a);if(r&&await f(this,me).handleFailure(o.status,l))return E(this,ie,ue).call(this,e,t,n,!1);let c=f(this,me).unavailable;throw c?new ae(c):new z(l,o.status)}if(a===null)throw new z("invalid_json_response",502);return{body:a,response:o}},Ha=async function(e){if(f(this,fe))return;let t=`/pub/seasons/${encodeURIComponent(f(this,ce))}/session/adopt`;for(let n=0;n<2;n++){if(f(this,fe))return;try{if((await f(this,lt).call(this,`${f(this,at)}${t}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e.token}`},body:JSON.stringify({previousToken:e.previousToken}),credentials:"omit"})).ok){T(this,ge,null);return}}catch{}}if(!f(this,fe))throw T(this,ge,new z("season_session_adopt_failed",409)),f(this,ge)};var Ip=2500;function _p(i){let e=typeof i=="string"?document.querySelector(i):i;if(!e)throw new Error("seatlayer: Season picker container was not found");return e}function Dp(i,e,t){if(i.startsAt==null)return{date:"Date to be announced",time:null};try{let n=new Date(i.startsAt),r=e?{timeZone:e}:{};return{date:new Intl.DateTimeFormat(t,{dateStyle:"medium",...r}).format(n),time:new Intl.DateTimeFormat(t,{timeStyle:"short",...r}).format(n)}}catch{return{date:"Date to be announced",time:null}}}function Ra(i){return i.state==="committed"||i.state==="booked"}var Ln=class{constructor(e,t,n){this.transport=e;this.sink=t;this.intervalMs=n;this.timer=null;this.stopped=!0;this.prior={}}start(){this.stopped&&(this.stopped=!1,this.timer=setTimeout(()=>{this.tick()},this.intervalMs))}stop(){this.stopped=!0,this.timer&&clearTimeout(this.timer),this.timer=null}async tick(){if(!this.stopped)try{let e=await this.transport.objects(""),t=Object.entries(e.seats).filter(([n,r])=>this.prior[n]!==r).map(([n,r])=>({label:n,status:r}));this.prior={...e.seats},t.length&&this.sink.applyStatuses(t)}catch{this.stopped||await this.sink.resync()}finally{this.stopped||(this.timer=setTimeout(()=>{this.tick()},this.intervalMs))}}},Mn=class{constructor(e,t){this.api=e;this.realtimePollMs=t;this.descriptorValue=null;this.availabilityValue=null;this.reuseAvailabilityOnce=!1;this.nextOperationId=null;this.nextBestAvailable=null;this.nextReleaseActionId=null;this.operationByHold=new Map}prime(e,t){this.descriptorValue=e,this.availabilityValue=t,this.reuseAvailabilityOnce=!0}queueOperation(e){this.nextOperationId=e}queueBestAvailable(e,t){if(this.nextBestAvailable)throw new z("season_best_available_in_progress",409);let n={operationId:e,...t.accessibility?.length?{accessibility:[...t.accessibility]}:{},...t.requireContiguous===!0?{requireContiguous:!0}:{}};return this.nextBestAvailable=n,n}clearBestAvailable(e){this.nextBestAvailable===e&&(this.nextBestAvailable=null)}queueRelease(e){this.nextReleaseActionId=e}operationForHold(e){return this.operationByHold.get(e)??null}remember(e){this.operationByHold.set(e.holdId,e)}forget(e){this.operationByHold.delete(e)}async chart(e){let[t,n]=await Promise.all([this.descriptorValue?Promise.resolve(this.descriptorValue):this.api.descriptor(),this.api.chart()]);return this.descriptorValue=t,{doc:n,event:{key:t.key,name:t.name,venue:t.venue,startsAt:t.occurrences[0]?.startsAt??null,timezone:t.timezone,currency:t.currency,mode:t.mode,inventoryModelVersion:2}}}async objects(e){let t;return this.reuseAvailabilityOnce&&this.availabilityValue?(this.reuseAvailabilityOnce=!1,t=this.availabilityValue):(t=await this.api.availability(),this.availabilityValue=t),{seats:{...t.seats}}}async hold(e,t,n,r){if(r)throw new z("season_hold_replace_unsupported",409);let s=this.nextOperationId??`sop_${crypto.randomUUID()}`;this.nextOperationId=null;let o=await this.api.hold(t.map(l=>l.label),s),a=await this.api.waitForTerminal(s,o);if(!Ra(a))throw new z(`season_operation_${a.state}`,409);return this.remember(a),{holdId:a.holdId,expiresAt:a.expiresAt,items:t.map(l=>({label:l.label,objectId:l.label,objectType:"seat",categoryKey:"",tierId:l.tierId??null,unitPrice:0,currency:this.descriptorValue?.currency??"USD",...l.quantity==null?{}:{quantity:l.quantity}}))}}async release(e,t,n){let r=this.operationForHold(n);if(!r)throw new z("season_hold_not_found",404);let s=this.nextReleaseActionId??`sra_${crypto.randomUUID()}`;this.nextReleaseActionId=null;let o=await this.api.release(r.operationId,s),a=await this.api.waitForTerminal(r.operationId,o);if(a.state==="partial_terminal")throw this.remember(a),new z("season_operation_partial_terminal",409);this.forget(n)}async bestAvailable(e,t,n,r){let s=this.nextBestAvailable;this.nextBestAvailable=null;let o=s?.operationId??`sop_${crypto.randomUUID()}`,a=await this.api.bestAvailable({operationId:o,qty:t,...n?{categoryKey:n}:{},...r?{zoneId:r}:{},...s?.accessibility?.length?{accessibility:s.accessibility}:{},...s?.requireContiguous===!0?{requireContiguous:!0}:{}}),l=await this.api.waitForTerminal(o,a);if(!Ra(l))throw new z(`season_operation_${l.state}`,409);this.remember(l);let c=new Map(a.items.map(p=>[p.label,p]));return{holdId:l.holdId,expiresAt:l.expiresAt,labels:[...a.labels],items:a.labels.map(p=>{let d=c.get(p);return{label:p,objectId:d?.objectId??p,objectType:"seat",categoryKey:d?.categoryKey??n??"",tierId:d?.tierId??null,unitPrice:0,currency:this.descriptorValue?.currency??"USD",...d?.quantity==null?{}:{quantity:d.quantity}}})}}socketUrl(){return""}createRealtime(e,t){return new Ln(this,t,this.realtimePollMs)}},I,je,It,be,X,_t,oe,ke,G,ee,Te,ht,He,Ee,Ge,Ce,Re,ut,P,Oa,Ia,_a,Rn,Oi,ct,dt,W,ze,On,pt,Hn=class{constructor(e){O(this,P);O(this,I);O(this,je);O(this,It);O(this,be);O(this,X);O(this,_t,new AbortController);O(this,oe,null);O(this,ke,null);O(this,G,null);O(this,ee,null);O(this,Te,null);O(this,ht,null);O(this,He,null);O(this,Ee,null);O(this,Ge,null);O(this,Ce,[]);O(this,Re,!1);O(this,ut,!1);if(!e?.season)throw new Error("seatlayer: `season` key is required");if(!e.container)throw new Error("seatlayer: `container` is required");if(!e.buyerAccessToken&&!e.buyerAccessTokenProvider)throw new Error("seatlayer: Season buyer access is required");if("event"in e||"performanceGroup"in e)throw new Error("seatlayer: SeasonPicker is not SeatPicker or PerformanceGroupPicker");T(this,I,e),T(this,je,_p(e.container)),T(this,It,new de({token:e.buyerAccessToken,provider:e.buyerAccessTokenProvider,onExpired:e.onAccessExpired,onUnavailable:e.onAccessUnavailable})),T(this,be,new Ri(e.season,{apiBase:e.apiBase,access:f(this,It),fetch:e.fetch,recoveryTimeoutMs:e.recoveryTimeoutMs})),T(this,X,new Mn(f(this,be),Math.max(750,e.realtimePollMs??Ip)))}async render(){E(this,P,On).call(this),La(),E(this,P,Ia).call(this),E(this,P,W).call(this,{kind:"loading",message:"Loading Season seats available for every performance."},!0);try{let[e,t]=await Promise.all([f(this,be).descriptor(),f(this,be).availability()]);return f(this,Re)?this:(T(this,oe,e),T(this,ke,t),f(this,X).prime(e,t),E(this,P,_a).call(this),await E(this,P,Oa).call(this,e),E(this,P,W).call(this,{kind:"ready",message:`${t.freeCount} seat${t.freeCount===1?"":"s"} available for every included performance.`}),f(this,I).initialOperationId&&await this.restoreOperation(f(this,I).initialOperationId),this)}catch(e){if(f(this,Re))return this;throw E(this,P,ze).call(this,e),e}}async holdSameSeat(e,t){if(E(this,P,pt).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(f(this,X).queueOperation(t),f(this,ee).selectObjectsWithoutConfirmation([...e]),E(this,P,W).call(this,{kind:"pending",message:"Holding the same seats for every performance.",operationId:t},!0),await f(this,ee).handleCta(),!f(this,G))throw new z("season_hold_not_created",409);return f(this,G)}async holdBestAvailable(e,t,n={}){if(E(this,P,pt).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 r=f(this,ee).maxTickets;if(e>r)throw new Error(`seatlayer: Best Available quantity cannot exceed the configured maximum (${r})`);if(f(this,ut))throw new z("season_best_available_in_progress",409);T(this,ut,!0);let s=null;try{if(s=f(this,X).queueBestAvailable(t,n),E(this,P,W).call(this,{kind:"pending",message:`Finding ${e} Season seat${e===1?"":"s"} available for every performance.`,operationId:t},!0),!await f(this,ee).bestAvailableOrThrow(e,n.categoryKey,{zoneId:n.zoneId})||!f(this,G))throw new z("season_hold_not_created",409);return f(this,G)}catch(o){throw E(this,P,ze).call(this,o,t),o}finally{s&&f(this,X).clearBestAvailable(s),T(this,ut,!1)}}async restoreOperation(e){E(this,P,pt).call(this),E(this,P,W).call(this,{kind:"pending",message:"Restoring your Season selection.",operationId:e},!0);try{let t=await f(this,be).waitForTerminal(e,void 0,f(this,_t).signal);return t.state==="aborted"||t.state==="expired"?(T(this,G,null),f(this,I).onHoldChange?.(null),E(this,P,W).call(this,{kind:"released",message:"The previous Season selection is no longer held.",operationId:e}),null):(f(this,X).remember(t),E(this,P,Rn).call(this,t,!1))}catch(t){throw E(this,P,ze).call(this,t,e),t}}async release(e){E(this,P,pt).call(this);let t=f(this,G);if(t){if(!e)throw new Error("seatlayer: caller-stable release action id is required");f(this,X).queueRelease(e),E(this,P,W).call(this,{kind:"pending",message:"Releasing the Season seats.",operationId:t.operationId},!0);try{f(this,ee)?.getCurrentHold()?.holdId===t.holdId?await f(this,ee).release():(await f(this,X).release("",[],t.holdId),E(this,P,Oi).call(this)),E(this,P,W).call(this,{kind:"released",message:"The Season seats were released.",operationId:t.operationId})}catch(n){throw E(this,P,ze).call(this,n,t.operationId),n}}}async createRenewalIntent(e){if(E(this,P,pt).call(this),!e.startsWith("sro_"))throw new Error("seatlayer: Season renewal offer id is required");E(this,P,W).call(this,{kind:"pending",message:"Recording renewal intent. No purchase is made in the browser."},!0);try{let t=await f(this,be).renewalIntent(e);return E(this,P,W).call(this,{kind:"renewal_intent",message:"Renewal intent recorded. Your ticketing platform will confirm price, payment, and renewal."}),f(this,I).onRenewalIntent?.(t),t}catch(t){throw E(this,P,ze).call(this,t),t}}getDescriptor(){return f(this,oe)}getAvailability(){return f(this,ke)}getHandoff(){return f(this,G)}destroy(){f(this,Re)||(T(this,Re,!0),f(this,_t).abort(),f(this,ee)?.destroy(),f(this,be).destroy(),f(this,je).replaceChildren(),T(this,Te,null),T(this,ht,null),T(this,He,null),T(this,Ee,null),T(this,Ge,null),T(this,oe,null),T(this,ke,null),T(this,G,null))}};I=new WeakMap,je=new WeakMap,It=new WeakMap,be=new WeakMap,X=new WeakMap,_t=new WeakMap,oe=new WeakMap,ke=new WeakMap,G=new WeakMap,ee=new WeakMap,Te=new WeakMap,ht=new WeakMap,He=new WeakMap,Ee=new WeakMap,Ge=new WeakMap,Ce=new WeakMap,Re=new WeakMap,ut=new WeakMap,P=new WeakSet,Oa=async function(e){let t=new $e(Pi({container:f(this,ht),event:e.key,apiBase:f(this,I).apiBase,transport:f(this,X),hideEventDetails:!0,maxSelection:f(this,I).maxSelection,selectedObjects:f(this,I).selectedObjects,selectableObjects:f(this,I).selectableObjects,numberOfPlacesToSelect:f(this,I).numberOfPlacesToSelect,selectionValidators:f(this,I).selectionValidators,locale:f(this,I).locale,messages:f(this,I).messages,languages:f(this,I).languages,colorblindSafe:f(this,I).colorblindSafe,initialView:f(this,I).initialView,enable3D:f(this,I).enable3D,max3DSeats:f(this,I).max3DSeats,hideBadge:f(this,I).hideBadge,theme:f(this,I).theme,confirmSelection:f(this,I).confirmSelection,seatView:f(this,I).seatView,onBuyerViewChange:f(this,I).onBuyerViewChange,onAnalytics:(n,r)=>{try{f(this,I).onAnalytics?.(n,{...r,metricScope:"season",seasonKey:e.key,planActivationId:e.planActivationId,performanceCount:e.occurrenceCount})}catch{}},onSelectionChange:n=>{T(this,Ce,n.map(r=>r.label)),E(this,P,ct).call(this),f(this,I).onSelectionChange?.(n)},onSelectionValidityChange:f(this,I).onSelectionValidityChange,onHoldChange:n=>{if(!n){E(this,P,Oi).call(this);return}let r=f(this,X).operationForHold(n.holdId);r&&E(this,P,Rn).call(this,r,!0)},onCheckout:()=>{f(this,G)&&(E(this,P,dt).call(this,"checkout"),f(this,I).onContinue?.(f(this,G)))},onHoldExpired:()=>{E(this,P,Oi).call(this),E(this,P,W).call(this,{kind:"released",message:"The Season hold expired. Choose seats again."}),f(this,I).onHoldExpired?.()},onError:n=>E(this,P,ze).call(this,n)},{surface:"season",performanceCount:e.occurrenceCount,selectionMode:"same_seat",suppressPricing:!0,groupSelectionSummary:()=>{let n=f(this,Ce).length;return n?{seats:n,performances:e.occurrenceCount,performancesChosen:e.occurrenceCount,perPerformance:n}:null}}));T(this,ee,t),await t.render()},Ia=function(){f(this,je).replaceChildren();let e=document.createElement("section");e.className="sl-season-root",e.setAttribute("aria-label","Season ticket selection");let t=document.createElement("header");t.className="sl-season-hero";let n=document.createElement("ol");n.className="sl-season-progress",n.setAttribute("aria-label","Season checkout progress");for(let[b,w]of["Choose seats","Review package","Checkout"].entries()){let x=document.createElement("li");x.dataset.state=b===0?"current":"upcoming";let y=document.createElement("span");y.textContent=String(b+1),x.append(y,w),n.append(x)}let r=document.createElement("div");r.className="sl-season-stage";let s=document.createElement("div");s.className="sl-season-map";let o=document.createElement("aside");o.className="sl-season-summary-card",o.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 p=document.createElement("i");p.textContent="1\xD7";let d=document.createElement("span");d.textContent="Each seat you choose is reserved for every included performance.",c.append(p,d);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.",o.append(a,l,c,u,h),r.append(s,o);let g=document.createElement("p");g.className="sl-season-status",g.setAttribute("role","status"),g.setAttribute("aria-live","polite"),e.append(t,n,r,g),f(this,je).append(e),T(this,Te,e),T(this,ht,s),T(this,He,g),T(this,Ee,l),T(this,Ge,u)},_a=function(){let e=f(this,oe),t=f(this,I).offer,n=f(this,Te).querySelector(".sl-season-hero");n.replaceChildren();let r=document.createElement("div");r.className="sl-season-copy";let s=document.createElement("p");s.className="sl-season-eyebrow",s.textContent=t?.eyebrow??"Season ticket";let o=document.createElement("h2");o.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 b of[`${e.occurrenceCount} performances`,e.venue,t?.renewalLabel??"Same-seat package"].filter(Boolean)){let w=document.createElement("span");w.className="sl-season-fact",w.textContent=b,l.append(w)}r.append(s,o,a,l),n.append(r);let c=document.createElement("div");c.className="sl-season-offer";let p=document.createElement("span");p.className="sl-season-offer-label",p.textContent=t?.priceLabel?"Season package":"Package price";let d=document.createElement(t?.priceLabel?"strong":"span");if(d.className=t?.priceLabel?"sl-season-price":"sl-season-price-note",d.textContent=t?.priceLabel??"Confirmed by your ticketing platform at checkout",c.append(p,d),t?.compareAtPriceLabel){let b=document.createElement("span");b.className="sl-season-was",b.textContent=t.compareAtPriceLabel,c.append(b)}if(t?.savingsLabel){let b=document.createElement("span");b.className="sl-season-saving",b.textContent=t.savingsLabel,c.append(b)}if(t?.priceNote){let b=document.createElement("span");b.className="sl-season-price-note",b.textContent=t.priceNote,c.append(b)}if(n.append(c),t?.benefits?.length){let b=document.createElement("ul");b.className="sl-season-benefits";for(let w of t.benefits.slice(0,6)){let x=document.createElement("li");x.textContent=w,b.append(x)}n.append(b)}let u=document.createElement("details");u.className="sl-season-dates";let h=document.createElement("summary");h.textContent=`All ${e.occurrenceCount} performances included`;let g=document.createElement("ol");g.className="sl-season-date-list";for(let b of e.occurrences){let w=document.createElement("li");w.className="sl-season-date";let x=document.createElement("b");x.textContent=b.name;let y=Dp(b,e.timezone,f(this,I).locale),m=document.createElement("time");b.startsAt!=null&&(m.dateTime=new Date(b.startsAt).toISOString()),m.textContent=y.time?`${y.date} \xB7 ${y.time}`:y.date,w.append(x,m),g.append(w)}u.append(h,g),n.append(u),E(this,P,ct).call(this)},Rn=function(e,t){if(e.state==="booked")return T(this,G,null),f(this,X).forget(e.holdId),f(this,ee)?.notifyGroupSettled("booked"),E(this,P,dt).call(this,"complete"),E(this,P,W).call(this,{kind:"booked",message:`Your Season booking is complete for all ${f(this,oe).occurrenceCount} performances. No further checkout action is needed.`,operationId:e.operationId}),f(this,I).onHoldChange?.(null),null;if(e.state==="partial_terminal")return T(this,G,null),T(this,Ce,[]),f(this,X).forget(e.holdId),f(this,ee)?.notifyGroupSettled("lost"),E(this,P,ct).call(this),E(this,P,dt).call(this,"review"),E(this,P,W).call(this,{kind:"partial_terminal",message:"This Season selection needs organizer review. Do not try another selection.",operationId:e.operationId}),f(this,I).onHoldChange?.(null),null;if(e.state!=="committed")return T(this,G,null),f(this,X).forget(e.holdId),f(this,ee)?.notifyGroupSettled("lost"),E(this,P,W).call(this,{kind:"failed",message:"The Season selection could not be completed.",operationId:e.operationId}),f(this,I).onHoldChange?.(null),null;let n=Ma(f(this,oe),e),r=f(this,G)?.holdId!==n.holdId;return T(this,G,n),E(this,P,ct).call(this),E(this,P,dt).call(this,"review"),f(this,I).onHoldChange?.(n),E(this,P,W).call(this,{kind:"held",message:`Your seats are held for all ${f(this,oe).occurrenceCount} performances. Review and continue to checkout.`,operationId:e.operationId}),r&&t&&f(this,I).onHold?.(n),n},Oi=function(){T(this,G,null),T(this,Ce,[]),E(this,P,ct).call(this),E(this,P,dt).call(this,"choose"),f(this,I).onHoldChange?.(null)},ct=function(){if(!f(this,Ee))return;let e=f(this,Ce).length;if(!e)f(this,Ee).textContent="Choose a seat on the map. Unavailable seats are already booked on at least one included performance.";else{f(this,Ee).replaceChildren();let t=document.createElement("strong");t.textContent=f(this,Ce).join(", "),f(this,Ee).append(t,` \xB7 ${e} Season seat${e===1?"":"s"} across all ${f(this,oe)?.occurrenceCount??0} performances`)}f(this,Ge)&&f(this,ke)&&(f(this,Ge).textContent=`${f(this,ke).freeCount} seat${f(this,ke).freeCount===1?"":"s"} currently available for the complete Season`)},dt=function(e){let t=e==="choose"?0:e==="review"?1:e==="checkout"?2:3;f(this,Te)?.querySelectorAll(".sl-season-progress li").forEach((n,r)=>{n.dataset.state=r<t?"done":r===t?"current":"upcoming";let s=n.querySelector("span");s&&(s.textContent=r<t?"\u2713":String(r+1))})},W=function(e,t=!1){f(this,He)&&(f(this,He).textContent=e.message,f(this,He).dataset.kind=e.kind),f(this,Te)&&(f(this,Te).dataset.busy=String(t)),f(this,I).onStatusChange?.(e)},ze=function(e,t){let n=e instanceof z?`Season selection unavailable (${e.code}).`:"Season selection could not be completed.";E(this,P,W).call(this,{kind:"failed",message:n,operationId:t}),f(this,I).onError?.(e)},On=function(){if(f(this,Re))throw new Error("seatlayer: SeasonPicker was destroyed")},pt=function(){if(E(this,P,On).call(this),!f(this,oe)||!f(this,ee))throw new Error("seatlayer: render SeasonPicker before using it")};function Bp(i,e={}){let t=e.origin??"";if(!t)try{t=new URL(i.src,window.location.href).origin}catch{t=""}let n=!1,r=null,s=null,o=null,a="",l=null,c="",p=()=>{if(n)return;n=!0,r=i.getAttribute("style"),Object.assign(i.style,{position:"fixed",inset:"0",margin:"0",border:"0",zIndex:"2147483000",background:c||"transparent"}),i.style.width="100vw",i.style.height="100vh",i.style.width="100dvw",i.style.height="100dvh";let h=document.documentElement;s=h.style.overflow,h.style.overflow="hidden",document.body&&(o=document.body.style.overflow,document.body.style.overflow="hidden"),l=g=>{g.key==="Escape"&&d()},window.addEventListener("keydown",l)},d=()=>{n&&(n=!1,r===null?i.removeAttribute("style"):i.setAttribute("style",r),r=null,a&&(i.style.height=a),s!==null&&(document.documentElement.style.overflow=s,s=null),o!==null&&document.body&&(document.body.style.overflow=o,o=null),l&&(window.removeEventListener("keydown",l),l=null))},u=h=>{if(h.source!==i.contentWindow||t&&h.origin!==t||!h.data||typeof h.data!="object")return;let g=h.data;if(g.type==="seatlayer:height"){typeof g.px=="number"&&Number.isFinite(g.px)&&g.px>0&&(a=`${Math.round(g.px)}px`,n||(i.style.height=a));return}g.type==="seatlayer:fullscreen"&&(typeof g.background=="string"&&/^[#a-zA-Z0-9(),.%\s-]{1,64}$/.test(g.background)&&(c=g.background,n&&(i.style.background=c)),g.on===!0?p():g.on===!1&&d())};return window.addEventListener("message",u),()=>{window.removeEventListener("message",u),d()}}export{V as ApiError,de as BuyerAccessContext,ae as BuyerAccessUnavailableError,ve as BuyerRealtimeClient,Qi as EmbeddedDesigner,K as PerformanceGroupDestroyedError,An as PerformanceGroupPicker,_r as SEATING_CHART_CALLBACK_PROPS,Rr as SEATING_CHART_HANDLE_METHODS,Or as SEATING_CHART_IDENTITY_PROPS,Ir as SEATING_CHART_VALUE_PROPS,z as SeasonApiError,Hn as SeasonPicker,Hi as SeasonRecoveryTimeoutError,$e as SeatPicker,Yi as SeatingChart,Bp as attachPickerFrame,ic as bindSeatingChartHandle,nc as buildSeatingChartOptions,yt as createBuyerAccessContext,mt as createControllerSink,en as parseTicketOfferAvailability,Ht as shortOperationReference,tn as ticketOfferPrices};
2883
+ `,document.head.appendChild(i)}var Tp="https://api.seatlayer.io",Ep=6e4,Cp=5e3,z=class extends Error{constructor(t,n){super(`season_request_failed:${t}`);this.code=t;this.status=n;this.name="SeasonApiError"}},Hi=class extends Error{constructor(t){super(`season_operation_timeout:${t}`);this.operationId=t;this.name="SeasonRecoveryTimeoutError"}};function Ap(i,e){let t=Number(i.headers.get("Retry-After")),n=Number.isFinite(t)&&t>=0?t:e.retryAfterSeconds;return Math.max(0,Math.min(Cp,n*1e3))}function Pp(i,e){return e?.aborted?Promise.reject(e.reason??new DOMException("Aborted","AbortError")):new Promise((t,n)=>{let r=setTimeout(t,i);e?.addEventListener("abort",()=>{clearTimeout(r),n(e.reason??new DOMException("Aborted","AbortError"))},{once:!0})})}function Lp(i){if(!i||typeof i!="object")return"unknown";let e=i;return typeof e.code=="string"?e.code:typeof e.error=="string"?e.error:"unknown"}var Mp=/^shc_[a-f0-9]{40}$/,Hp=/^shh_[a-f0-9]{40}$/,Rp=new Set(["preparing","commit_pending","committed","expire_pending","booking_pending","abort_pending","aborted","partial_terminal","expired","booked"]),Op=new Set(["pending","prepared","refused","applied","expired","booked","aborted"]);function Pn(i){return Array.isArray(i)?i.some(Pn):!i||typeof i!="object"?!1:Object.entries(i).some(([e,t])=>e==="childHoldId"||e==="child_hold_id"||e==="holdId"&&typeof t=="string"&&Mp.test(t)||Pn(t))}function Rt(i,e,t="invalid_operation_response"){if(!i||typeof i!="object"||Array.isArray(i))throw new z(t,502);if(Pn(i))throw new z("unsafe_operation_response",502);let n=i,r=n.allocations,s=new Set,o=Array.isArray(r)&&r.length>0&&r.every(d=>{if(!d||typeof d!="object")return!1;let u=d.eventId,h=d.state;return typeof u!="string"||!u||typeof h!="string"||!Op.has(h)||s.has(u)?!1:(s.add(u),!0)}),a=n.bookingRef===null||typeof n.bookingRef=="string"&&n.bookingRef.length>0,l=n.state!=="booked"||typeof n.bookingRef=="string"&&o&&r.every(d=>d.state==="booked"),c=n.state!=="booking_pending"||typeof n.bookingRef=="string"&&o&&r.some(d=>d.state!=="booked"),p=n.state!=="committed"||n.bookingRef===null;if(n.operationId!==e.operationId||n.seasonId!==e.seasonId||n.kind!=="HOLD"||typeof n.holdId!="string"||!Hp.test(n.holdId)||n.policy!=="fixed_inclusion_same_seat"||typeof n.state!="string"||!Rp.has(n.state)||typeof n.expiresAt!="number"||!Number.isFinite(n.expiresAt)||n.expiresAt<0||!a||typeof n.location!="string"||!n.location||typeof n.retryAfterSeconds!="number"||!Number.isFinite(n.retryAfterSeconds)||n.retryAfterSeconds<0||!o||!l||!c||!p||n.pricingAuthority!==void 0&&n.pricingAuthority!=="host"||n.authoritativeAmountIncluded!==void 0&&n.authoritativeAmountIncluded!==!1)throw new z(t,502);return{operationId:n.operationId,seasonId:n.seasonId,kind:n.kind,holdId:n.holdId,expiresAt:n.expiresAt,policy:n.policy,pricingAuthority:"host",authoritativeAmountIncluded:!1,state:n.state,bookingRef:n.bookingRef,location:n.location,retryAfterSeconds:n.retryAfterSeconds,allocations:r.map(d=>({eventId:d.eventId,state:d.state}))}}function Ip(i,e,t){if(!Array.isArray(i)||i.length!==t||i.some(o=>typeof o!="string"||!o)||new Set(i).size!==i.length||!Array.isArray(e)||e.length!==i.length)throw new z("invalid_best_available_response",502);let n=i,r=new Set(n),s=new Map;for(let o of e){if(!o||typeof o!="object")throw new z("invalid_best_available_response",502);let a=o;if(typeof a.label!="string"||!r.has(a.label)||s.has(a.label)||typeof a.objectId!="string"||!a.objectId||a.objectType!=="seat"||typeof a.categoryKey!="string"||!a.categoryKey||a.tierId!==null&&(typeof a.tierId!="string"||!a.tierId)||a.quantity!==void 0&&a.quantity!==1)throw new z("invalid_best_available_response",502);s.set(a.label,{label:a.label,objectId:a.objectId,objectType:"seat",categoryKey:a.categoryKey,tierId:a.tierId,...a.quantity===void 0?{}:{quantity:a.quantity}})}return{labels:n,items:n.map(o=>s.get(o))}}function Oa(i,e){return{seasonKey:i.key,planActivationId:i.planActivationId,operationId:e.operationId,holdId:e.holdId,expiresAt:e.expiresAt,policy:e.policy,pricingAuthority:"host",authoritativeAmountIncluded:!1,state:e.state,allocations:e.allocations.map(({eventId:t,state:n})=>({eventKey:t,state:n}))}}var ce,at,me,lt,Ot,fe,ge,ie,ue,Ia,Ri=class{constructor(e,t){O(this,ie);O(this,ce);O(this,at);O(this,me);O(this,lt);O(this,Ot);O(this,fe,!1);O(this,ge,null);T(this,ce,e),T(this,at,(t.apiBase??Tp).replace(/\/$/,"")),T(this,me,t.access),T(this,lt,t.fetch??globalThis.fetch.bind(globalThis)),T(this,Ot,t.recoveryTimeoutMs??Ep),f(this,me).onRenewed(n=>E(this,ie,Ia).call(this,n))}async descriptor(){let{body:e}=await E(this,ie,ue).call(this,"GET","");return e.season}async chart(){let{body:e}=await E(this,ie,ue).call(this,"GET","/chart");return e}async availability(){let{body:e}=await E(this,ie,ue).call(this,"GET","/availability"),t=Object.values(e.seats??{});return{...e,freeCount:t.filter(n=>n==="free").length,blockedCount:t.filter(n=>n!=="free").length}}async hold(e,t){let{body:n,response:r}=await E(this,ie,ue).call(this,"POST","/holds",{operationId:t,labels:[...e]});return{operation:Rt(n.operation,{seasonId:f(this,ce),operationId:t}),response:r}}async bestAvailable(e){let{body:t,response:n}=await E(this,ie,ue).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}:{}}),r=Rt(t.operation,{seasonId:f(this,ce),operationId:e.operationId},"invalid_best_available_response"),{labels:s,items:o}=Ip(t.labels,t.items,e.qty);return{operation:r,labels:s,items:o,response:n}}async operation(e){let{body:t,response:n}=await E(this,ie,ue).call(this,"GET",`/operations/${encodeURIComponent(e)}`);return{operation:Rt(t.operation,{seasonId:f(this,ce),operationId:e}),response:n}}async release(e,t){let{body:n,response:r}=await E(this,ie,ue).call(this,"POST",`/holds/${encodeURIComponent(e)}/release`,{releaseActionId:t});return{operation:Rt(n.operation,{seasonId:f(this,ce),operationId:e}),response:r}}async renewalIntent(e){let{body:t}=await E(this,ie,ue).call(this,"POST","/renewal-intents",{offerId:e}),n=t.intent;if(!n||n.offerId!==e||n.state!=="intent_received"||!n.intentId||!Number.isFinite(n.receivedAt))throw new z("invalid_renewal_intent_response",502);return n}async waitForTerminal(e,t,n){let r=Date.now(),s=t?{operation:Rt(t.operation,{seasonId:f(this,ce),operationId:e}),response:t.response}:await this.operation(e);for(;s.operation.state==="preparing"||s.operation.state==="commit_pending"||s.operation.state==="expire_pending"||s.operation.state==="booking_pending"||s.operation.state==="abort_pending";){if(Date.now()-r>=f(this,Ot))throw new Hi(e);await Pp(Ap(s.response,s.operation),n),s=await this.operation(e)}return s.operation}destroy(){f(this,fe)||(T(this,fe,!0),f(this,me).onRenewed(void 0),f(this,me).clear())}};ce=new WeakMap,at=new WeakMap,me=new WeakMap,lt=new WeakMap,Ot=new WeakMap,fe=new WeakMap,ge=new WeakMap,ie=new WeakSet,ue=async function(e,t,n,r=!0){if(f(this,fe))throw new z("season_api_destroyed",409);if(f(this,ge))throw f(this,ge);let s=await f(this,me).authorization();if(f(this,fe))throw new z("season_api_destroyed",409);if(f(this,ge))throw f(this,ge);if(!s)throw new ae({reason:"no_token",retryable:!1});let o=await f(this,lt).call(this,`${f(this,at)}/pub/seasons/${encodeURIComponent(f(this,ce))}${t}`,{method:e,headers:{Authorization:s,...n===void 0?{}:{"Content-Type":"application/json"}},body:n===void 0?void 0:JSON.stringify(n)}),a=await o.json().catch(()=>null);if(!o.ok){let l=Lp(a);if(r&&await f(this,me).handleFailure(o.status,l))return E(this,ie,ue).call(this,e,t,n,!1);let c=f(this,me).unavailable;throw c?new ae(c):new z(l,o.status)}if(a===null)throw new z("invalid_json_response",502);return{body:a,response:o}},Ia=async function(e){if(f(this,fe))return;let t=`/pub/seasons/${encodeURIComponent(f(this,ce))}/session/adopt`;for(let n=0;n<2;n++){if(f(this,fe))return;try{if((await f(this,lt).call(this,`${f(this,at)}${t}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e.token}`},body:JSON.stringify({previousToken:e.previousToken}),credentials:"omit"})).ok){T(this,ge,null);return}}catch{}}if(!f(this,fe))throw T(this,ge,new z("season_session_adopt_failed",409)),f(this,ge)};var _p=2500;function Dp(i){let e=typeof i=="string"?document.querySelector(i):i;if(!e)throw new Error("seatlayer: Season picker container was not found");return e}function Bp(i,e,t){if(i.startsAt==null)return{date:"Date to be announced",time:null};try{let n=new Date(i.startsAt),r=e?{timeZone:e}:{};return{date:new Intl.DateTimeFormat(t,{dateStyle:"medium",...r}).format(n),time:new Intl.DateTimeFormat(t,{timeStyle:"short",...r}).format(n)}}catch{return{date:"Date to be announced",time:null}}}function _a(i){return i.state==="committed"||i.state==="booked"}var Ln=class{constructor(e,t,n){this.transport=e;this.sink=t;this.intervalMs=n;this.timer=null;this.stopped=!0;this.prior={}}start(){this.stopped&&(this.stopped=!1,this.timer=setTimeout(()=>{this.tick()},this.intervalMs))}stop(){this.stopped=!0,this.timer&&clearTimeout(this.timer),this.timer=null}async tick(){if(!this.stopped)try{let e=await this.transport.objects(""),t=Object.entries(e.seats).filter(([n,r])=>this.prior[n]!==r).map(([n,r])=>({label:n,status:r}));this.prior={...e.seats},t.length&&this.sink.applyStatuses(t)}catch{this.stopped||await this.sink.resync()}finally{this.stopped||(this.timer=setTimeout(()=>{this.tick()},this.intervalMs))}}},Mn=class{constructor(e,t){this.api=e;this.realtimePollMs=t;this.descriptorValue=null;this.availabilityValue=null;this.reuseAvailabilityOnce=!1;this.nextOperationId=null;this.nextBestAvailable=null;this.nextReleaseActionId=null;this.operationByHold=new Map}prime(e,t){this.descriptorValue=e,this.availabilityValue=t,this.reuseAvailabilityOnce=!0}queueOperation(e){this.nextOperationId=e}queueBestAvailable(e,t){if(this.nextBestAvailable)throw new z("season_best_available_in_progress",409);let n={operationId:e,...t.accessibility?.length?{accessibility:[...t.accessibility]}:{},...t.requireContiguous===!0?{requireContiguous:!0}:{}};return this.nextBestAvailable=n,n}clearBestAvailable(e){this.nextBestAvailable===e&&(this.nextBestAvailable=null)}queueRelease(e){this.nextReleaseActionId=e}operationForHold(e){return this.operationByHold.get(e)??null}remember(e){this.operationByHold.set(e.holdId,e)}forget(e){this.operationByHold.delete(e)}async chart(e){let[t,n]=await Promise.all([this.descriptorValue?Promise.resolve(this.descriptorValue):this.api.descriptor(),this.api.chart()]);return this.descriptorValue=t,{doc:n,event:{key:t.key,name:t.name,venue:t.venue,startsAt:t.occurrences[0]?.startsAt??null,timezone:t.timezone,currency:t.currency,mode:t.mode,inventoryModelVersion:2}}}async objects(e){let t;return this.reuseAvailabilityOnce&&this.availabilityValue?(this.reuseAvailabilityOnce=!1,t=this.availabilityValue):(t=await this.api.availability(),this.availabilityValue=t),{seats:{...t.seats}}}async hold(e,t,n,r){if(r)throw new z("season_hold_replace_unsupported",409);let s=this.nextOperationId??`sop_${crypto.randomUUID()}`;this.nextOperationId=null;let o=await this.api.hold(t.map(l=>l.label),s),a=await this.api.waitForTerminal(s,o);if(!_a(a))throw new z(`season_operation_${a.state}`,409);return this.remember(a),{holdId:a.holdId,expiresAt:a.expiresAt,items:t.map(l=>({label:l.label,objectId:l.label,objectType:"seat",categoryKey:"",tierId:l.tierId??null,unitPrice:0,currency:this.descriptorValue?.currency??"USD",...l.quantity==null?{}:{quantity:l.quantity}}))}}async release(e,t,n){let r=this.operationForHold(n);if(!r)throw new z("season_hold_not_found",404);let s=this.nextReleaseActionId??`sra_${crypto.randomUUID()}`;this.nextReleaseActionId=null;let o=await this.api.release(r.operationId,s),a=await this.api.waitForTerminal(r.operationId,o);if(a.state==="partial_terminal")throw this.remember(a),new z("season_operation_partial_terminal",409);this.forget(n)}async bestAvailable(e,t,n,r){let s=this.nextBestAvailable;this.nextBestAvailable=null;let o=s?.operationId??`sop_${crypto.randomUUID()}`,a=await this.api.bestAvailable({operationId:o,qty:t,...n?{categoryKey:n}:{},...r?{zoneId:r}:{},...s?.accessibility?.length?{accessibility:s.accessibility}:{},...s?.requireContiguous===!0?{requireContiguous:!0}:{}}),l=await this.api.waitForTerminal(o,a);if(!_a(l))throw new z(`season_operation_${l.state}`,409);this.remember(l);let c=new Map(a.items.map(p=>[p.label,p]));return{holdId:l.holdId,expiresAt:l.expiresAt,labels:[...a.labels],items:a.labels.map(p=>{let d=c.get(p);return{label:p,objectId:d?.objectId??p,objectType:"seat",categoryKey:d?.categoryKey??n??"",tierId:d?.tierId??null,unitPrice:0,currency:this.descriptorValue?.currency??"USD",...d?.quantity==null?{}:{quantity:d.quantity}}})}}socketUrl(){return""}createRealtime(e,t){return new Ln(this,t,this.realtimePollMs)}},I,je,It,be,X,_t,oe,ke,q,ee,Te,ht,He,Ee,Ge,Ce,Re,ut,P,Da,Ba,Na,Rn,Oi,ct,dt,W,ze,On,pt,Hn=class{constructor(e){O(this,P);O(this,I);O(this,je);O(this,It);O(this,be);O(this,X);O(this,_t,new AbortController);O(this,oe,null);O(this,ke,null);O(this,q,null);O(this,ee,null);O(this,Te,null);O(this,ht,null);O(this,He,null);O(this,Ee,null);O(this,Ge,null);O(this,Ce,[]);O(this,Re,!1);O(this,ut,!1);if(!e?.season)throw new Error("seatlayer: `season` key is required");if(!e.container)throw new Error("seatlayer: `container` is required");if(!e.buyerAccessToken&&!e.buyerAccessTokenProvider)throw new Error("seatlayer: Season buyer access is required");if("event"in e||"performanceGroup"in e)throw new Error("seatlayer: SeasonPicker is not SeatPicker or PerformanceGroupPicker");T(this,I,e),T(this,je,Dp(e.container)),T(this,It,new de({token:e.buyerAccessToken,provider:e.buyerAccessTokenProvider,onExpired:e.onAccessExpired,onUnavailable:e.onAccessUnavailable})),T(this,be,new Ri(e.season,{apiBase:e.apiBase,access:f(this,It),fetch:e.fetch,recoveryTimeoutMs:e.recoveryTimeoutMs})),T(this,X,new Mn(f(this,be),Math.max(750,e.realtimePollMs??_p)))}async render(){E(this,P,On).call(this),Ra(),E(this,P,Ba).call(this),E(this,P,W).call(this,{kind:"loading",message:"Loading Season seats available for every performance."},!0);try{let[e,t]=await Promise.all([f(this,be).descriptor(),f(this,be).availability()]);return f(this,Re)?this:(T(this,oe,e),T(this,ke,t),f(this,X).prime(e,t),E(this,P,Na).call(this),await E(this,P,Da).call(this,e),E(this,P,W).call(this,{kind:"ready",message:`${t.freeCount} seat${t.freeCount===1?"":"s"} available for every included performance.`}),f(this,I).initialOperationId&&await this.restoreOperation(f(this,I).initialOperationId),this)}catch(e){if(f(this,Re))return this;throw E(this,P,ze).call(this,e),e}}async holdSameSeat(e,t){if(E(this,P,pt).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(f(this,X).queueOperation(t),f(this,ee).selectObjectsWithoutConfirmation([...e]),E(this,P,W).call(this,{kind:"pending",message:"Holding the same seats for every performance.",operationId:t},!0),await f(this,ee).handleCta(),!f(this,q))throw new z("season_hold_not_created",409);return f(this,q)}async holdBestAvailable(e,t,n={}){if(E(this,P,pt).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 r=f(this,ee).maxTickets;if(e>r)throw new Error(`seatlayer: Best Available quantity cannot exceed the configured maximum (${r})`);if(f(this,ut))throw new z("season_best_available_in_progress",409);T(this,ut,!0);let s=null;try{if(s=f(this,X).queueBestAvailable(t,n),E(this,P,W).call(this,{kind:"pending",message:`Finding ${e} Season seat${e===1?"":"s"} available for every performance.`,operationId:t},!0),!await f(this,ee).bestAvailableOrThrow(e,n.categoryKey,{zoneId:n.zoneId})||!f(this,q))throw new z("season_hold_not_created",409);return f(this,q)}catch(o){throw E(this,P,ze).call(this,o,t),o}finally{s&&f(this,X).clearBestAvailable(s),T(this,ut,!1)}}async restoreOperation(e){E(this,P,pt).call(this),E(this,P,W).call(this,{kind:"pending",message:"Restoring your Season selection.",operationId:e},!0);try{let t=await f(this,be).waitForTerminal(e,void 0,f(this,_t).signal);return t.state==="aborted"||t.state==="expired"?(T(this,q,null),f(this,I).onHoldChange?.(null),E(this,P,W).call(this,{kind:"released",message:"The previous Season selection is no longer held.",operationId:e}),null):(f(this,X).remember(t),E(this,P,Rn).call(this,t,!1))}catch(t){throw E(this,P,ze).call(this,t,e),t}}async release(e){E(this,P,pt).call(this);let t=f(this,q);if(t){if(!e)throw new Error("seatlayer: caller-stable release action id is required");f(this,X).queueRelease(e),E(this,P,W).call(this,{kind:"pending",message:"Releasing the Season seats.",operationId:t.operationId},!0);try{f(this,ee)?.getCurrentHold()?.holdId===t.holdId?await f(this,ee).release():(await f(this,X).release("",[],t.holdId),E(this,P,Oi).call(this)),E(this,P,W).call(this,{kind:"released",message:"The Season seats were released.",operationId:t.operationId})}catch(n){throw E(this,P,ze).call(this,n,t.operationId),n}}}async createRenewalIntent(e){if(E(this,P,pt).call(this),!e.startsWith("sro_"))throw new Error("seatlayer: Season renewal offer id is required");E(this,P,W).call(this,{kind:"pending",message:"Recording renewal intent. No purchase is made in the browser."},!0);try{let t=await f(this,be).renewalIntent(e);return E(this,P,W).call(this,{kind:"renewal_intent",message:"Renewal intent recorded. Your ticketing platform will confirm price, payment, and renewal."}),f(this,I).onRenewalIntent?.(t),t}catch(t){throw E(this,P,ze).call(this,t),t}}getDescriptor(){return f(this,oe)}getAvailability(){return f(this,ke)}getHandoff(){return f(this,q)}destroy(){f(this,Re)||(T(this,Re,!0),f(this,_t).abort(),f(this,ee)?.destroy(),f(this,be).destroy(),f(this,je).replaceChildren(),T(this,Te,null),T(this,ht,null),T(this,He,null),T(this,Ee,null),T(this,Ge,null),T(this,oe,null),T(this,ke,null),T(this,q,null))}};I=new WeakMap,je=new WeakMap,It=new WeakMap,be=new WeakMap,X=new WeakMap,_t=new WeakMap,oe=new WeakMap,ke=new WeakMap,q=new WeakMap,ee=new WeakMap,Te=new WeakMap,ht=new WeakMap,He=new WeakMap,Ee=new WeakMap,Ge=new WeakMap,Ce=new WeakMap,Re=new WeakMap,ut=new WeakMap,P=new WeakSet,Da=async function(e){let t=new $e(Pi({container:f(this,ht),event:e.key,apiBase:f(this,I).apiBase,transport:f(this,X),hideEventDetails:!0,maxSelection:f(this,I).maxSelection,selectedObjects:f(this,I).selectedObjects,selectableObjects:f(this,I).selectableObjects,numberOfPlacesToSelect:f(this,I).numberOfPlacesToSelect,selectionValidators:f(this,I).selectionValidators,locale:f(this,I).locale,messages:f(this,I).messages,languages:f(this,I).languages,colorblindSafe:f(this,I).colorblindSafe,initialView:f(this,I).initialView,enable3D:f(this,I).enable3D,max3DSeats:f(this,I).max3DSeats,hideBadge:f(this,I).hideBadge,theme:f(this,I).theme,confirmSelection:f(this,I).confirmSelection,seatView:f(this,I).seatView,onBuyerViewChange:f(this,I).onBuyerViewChange,onAnalytics:(n,r)=>{try{f(this,I).onAnalytics?.(n,{...r,metricScope:"season",seasonKey:e.key,planActivationId:e.planActivationId,performanceCount:e.occurrenceCount})}catch{}},onSelectionChange:n=>{T(this,Ce,n.map(r=>r.label)),E(this,P,ct).call(this),f(this,I).onSelectionChange?.(n)},onSelectionValidityChange:f(this,I).onSelectionValidityChange,onHoldChange:n=>{if(!n){E(this,P,Oi).call(this);return}let r=f(this,X).operationForHold(n.holdId);r&&E(this,P,Rn).call(this,r,!0)},onCheckout:()=>{f(this,q)&&(E(this,P,dt).call(this,"checkout"),f(this,I).onContinue?.(f(this,q)))},onHoldExpired:()=>{E(this,P,Oi).call(this),E(this,P,W).call(this,{kind:"released",message:"The Season hold expired. Choose seats again."}),f(this,I).onHoldExpired?.()},onError:n=>E(this,P,ze).call(this,n)},{surface:"season",performanceCount:e.occurrenceCount,selectionMode:"same_seat",suppressPricing:!0,groupSelectionSummary:()=>{let n=f(this,Ce).length;return n?{seats:n,performances:e.occurrenceCount,performancesChosen:e.occurrenceCount,perPerformance:n}:null}}));T(this,ee,t),await t.render()},Ba=function(){f(this,je).replaceChildren();let e=document.createElement("section");e.className="sl-season-root",e.setAttribute("aria-label","Season ticket selection");let t=document.createElement("header");t.className="sl-season-hero";let n=document.createElement("ol");n.className="sl-season-progress",n.setAttribute("aria-label","Season checkout progress");for(let[b,w]of["Choose seats","Review package","Checkout"].entries()){let x=document.createElement("li");x.dataset.state=b===0?"current":"upcoming";let y=document.createElement("span");y.textContent=String(b+1),x.append(y,w),n.append(x)}let r=document.createElement("div");r.className="sl-season-stage";let s=document.createElement("div");s.className="sl-season-map";let o=document.createElement("aside");o.className="sl-season-summary-card",o.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 p=document.createElement("i");p.textContent="1\xD7";let d=document.createElement("span");d.textContent="Each seat you choose is reserved for every included performance.",c.append(p,d);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.",o.append(a,l,c,u,h),r.append(s,o);let g=document.createElement("p");g.className="sl-season-status",g.setAttribute("role","status"),g.setAttribute("aria-live","polite"),e.append(t,n,r,g),f(this,je).append(e),T(this,Te,e),T(this,ht,s),T(this,He,g),T(this,Ee,l),T(this,Ge,u)},Na=function(){let e=f(this,oe),t=f(this,I).offer,n=f(this,Te).querySelector(".sl-season-hero");n.replaceChildren();let r=document.createElement("div");r.className="sl-season-copy";let s=document.createElement("p");s.className="sl-season-eyebrow",s.textContent=t?.eyebrow??"Season ticket";let o=document.createElement("h2");o.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 b of[`${e.occurrenceCount} performances`,e.venue,t?.renewalLabel??"Same-seat package"].filter(Boolean)){let w=document.createElement("span");w.className="sl-season-fact",w.textContent=b,l.append(w)}r.append(s,o,a,l),n.append(r);let c=document.createElement("div");c.className="sl-season-offer";let p=document.createElement("span");p.className="sl-season-offer-label",p.textContent=t?.priceLabel?"Season package":"Package price";let d=document.createElement(t?.priceLabel?"strong":"span");if(d.className=t?.priceLabel?"sl-season-price":"sl-season-price-note",d.textContent=t?.priceLabel??"Confirmed by your ticketing platform at checkout",c.append(p,d),t?.compareAtPriceLabel){let b=document.createElement("span");b.className="sl-season-was",b.textContent=t.compareAtPriceLabel,c.append(b)}if(t?.savingsLabel){let b=document.createElement("span");b.className="sl-season-saving",b.textContent=t.savingsLabel,c.append(b)}if(t?.priceNote){let b=document.createElement("span");b.className="sl-season-price-note",b.textContent=t.priceNote,c.append(b)}if(n.append(c),t?.benefits?.length){let b=document.createElement("ul");b.className="sl-season-benefits";for(let w of t.benefits.slice(0,6)){let x=document.createElement("li");x.textContent=w,b.append(x)}n.append(b)}let u=document.createElement("details");u.className="sl-season-dates";let h=document.createElement("summary");h.textContent=`All ${e.occurrenceCount} performances included`;let g=document.createElement("ol");g.className="sl-season-date-list";for(let b of e.occurrences){let w=document.createElement("li");w.className="sl-season-date";let x=document.createElement("b");x.textContent=b.name;let y=Bp(b,e.timezone,f(this,I).locale),m=document.createElement("time");b.startsAt!=null&&(m.dateTime=new Date(b.startsAt).toISOString()),m.textContent=y.time?`${y.date} \xB7 ${y.time}`:y.date,w.append(x,m),g.append(w)}u.append(h,g),n.append(u),E(this,P,ct).call(this)},Rn=function(e,t){if(e.state==="booked")return T(this,q,null),f(this,X).forget(e.holdId),f(this,ee)?.notifyGroupSettled("booked"),E(this,P,dt).call(this,"complete"),E(this,P,W).call(this,{kind:"booked",message:`Your Season booking is complete for all ${f(this,oe).occurrenceCount} performances. No further checkout action is needed.`,operationId:e.operationId}),f(this,I).onHoldChange?.(null),null;if(e.state==="partial_terminal")return T(this,q,null),T(this,Ce,[]),f(this,X).forget(e.holdId),f(this,ee)?.notifyGroupSettled("lost"),E(this,P,ct).call(this),E(this,P,dt).call(this,"review"),E(this,P,W).call(this,{kind:"partial_terminal",message:"This Season selection needs organizer review. Do not try another selection.",operationId:e.operationId}),f(this,I).onHoldChange?.(null),null;if(e.state!=="committed")return T(this,q,null),f(this,X).forget(e.holdId),f(this,ee)?.notifyGroupSettled("lost"),E(this,P,W).call(this,{kind:"failed",message:"The Season selection could not be completed.",operationId:e.operationId}),f(this,I).onHoldChange?.(null),null;let n=Oa(f(this,oe),e),r=f(this,q)?.holdId!==n.holdId;return T(this,q,n),E(this,P,ct).call(this),E(this,P,dt).call(this,"review"),f(this,I).onHoldChange?.(n),E(this,P,W).call(this,{kind:"held",message:`Your seats are held for all ${f(this,oe).occurrenceCount} performances. Review and continue to checkout.`,operationId:e.operationId}),r&&t&&f(this,I).onHold?.(n),n},Oi=function(){T(this,q,null),T(this,Ce,[]),E(this,P,ct).call(this),E(this,P,dt).call(this,"choose"),f(this,I).onHoldChange?.(null)},ct=function(){if(!f(this,Ee))return;let e=f(this,Ce).length;if(!e)f(this,Ee).textContent="Choose a seat on the map. Unavailable seats are already booked on at least one included performance.";else{f(this,Ee).replaceChildren();let t=document.createElement("strong");t.textContent=f(this,Ce).join(", "),f(this,Ee).append(t,` \xB7 ${e} Season seat${e===1?"":"s"} across all ${f(this,oe)?.occurrenceCount??0} performances`)}f(this,Ge)&&f(this,ke)&&(f(this,Ge).textContent=`${f(this,ke).freeCount} seat${f(this,ke).freeCount===1?"":"s"} currently available for the complete Season`)},dt=function(e){let t=e==="choose"?0:e==="review"?1:e==="checkout"?2:3;f(this,Te)?.querySelectorAll(".sl-season-progress li").forEach((n,r)=>{n.dataset.state=r<t?"done":r===t?"current":"upcoming";let s=n.querySelector("span");s&&(s.textContent=r<t?"\u2713":String(r+1))})},W=function(e,t=!1){f(this,He)&&(f(this,He).textContent=e.message,f(this,He).dataset.kind=e.kind),f(this,Te)&&(f(this,Te).dataset.busy=String(t)),f(this,I).onStatusChange?.(e)},ze=function(e,t){let n=e instanceof z?`Season selection unavailable (${e.code}).`:"Season selection could not be completed.";E(this,P,W).call(this,{kind:"failed",message:n,operationId:t}),f(this,I).onError?.(e)},On=function(){if(f(this,Re))throw new Error("seatlayer: SeasonPicker was destroyed")},pt=function(){if(E(this,P,On).call(this),!f(this,oe)||!f(this,ee))throw new Error("seatlayer: render SeasonPicker before using it")};function Np(i,e={}){let t=e.origin??"";if(!t)try{t=new URL(i.src,window.location.href).origin}catch{t=""}let n=!1,r=null,s=null,o=null,a="",l=null,c="",p=()=>{if(n)return;n=!0,r=i.getAttribute("style"),Object.assign(i.style,{position:"fixed",inset:"0",margin:"0",border:"0",zIndex:"2147483000",background:c||"transparent"}),i.style.width="100vw",i.style.height="100vh",i.style.width="100dvw",i.style.height="100dvh";let h=document.documentElement;s=h.style.overflow,h.style.overflow="hidden",document.body&&(o=document.body.style.overflow,document.body.style.overflow="hidden"),l=g=>{g.key==="Escape"&&d()},window.addEventListener("keydown",l)},d=()=>{n&&(n=!1,r===null?i.removeAttribute("style"):i.setAttribute("style",r),r=null,a&&(i.style.height=a),s!==null&&(document.documentElement.style.overflow=s,s=null),o!==null&&document.body&&(document.body.style.overflow=o,o=null),l&&(window.removeEventListener("keydown",l),l=null))},u=h=>{if(h.source!==i.contentWindow||t&&h.origin!==t||!h.data||typeof h.data!="object")return;let g=h.data;if(g.type==="seatlayer:height"){typeof g.px=="number"&&Number.isFinite(g.px)&&g.px>0&&(a=`${Math.round(g.px)}px`,n||(i.style.height=a));return}g.type==="seatlayer:fullscreen"&&(typeof g.background=="string"&&/^[#a-zA-Z0-9(),.%\s-]{1,64}$/.test(g.background)&&(c=g.background,n&&(i.style.background=c)),g.on===!0?p():g.on===!1&&d())};return window.addEventListener("message",u),()=>{window.removeEventListener("message",u),d()}}export{V as ApiError,de as BuyerAccessContext,ae as BuyerAccessUnavailableError,ve as BuyerRealtimeClient,Qi as EmbeddedDesigner,K as PerformanceGroupDestroyedError,An as PerformanceGroupPicker,_r as SEATING_CHART_CALLBACK_PROPS,Rr as SEATING_CHART_HANDLE_METHODS,Or as SEATING_CHART_IDENTITY_PROPS,Ir as SEATING_CHART_VALUE_PROPS,z as SeasonApiError,Hn as SeasonPicker,Hi as SeasonRecoveryTimeoutError,$e as SeatPicker,Yi as SeatingChart,Np as attachPickerFrame,sc as bindSeatingChartHandle,oc as buildSeatingChartOptions,yt as createBuyerAccessContext,mt as createControllerSink,en as parseTicketOfferAvailability,Ht as shortOperationReference,tn as ticketOfferPrices};