@seatlayer/js 0.77.2 → 0.79.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-XGKKO65I.js +1 -0
- package/dist/index.cjs +171 -136
- package/dist/index.d.cts +648 -170
- package/dist/index.d.ts +648 -170
- package/dist/index.js +170 -135
- package/dist/manager.js +1 -1
- package/package.json +2 -2
- package/dist/chunk-ZE36NABM.js +0 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as Nn,c as $t,d as Ue,e as Ft,f as ft}from"./chunk-ZE36NABM.js";import{a as f,b as _,c as C,d as E}from"./chunk-OSZ7DOEH.js";import{PickerController as Ga,formatMoney as qa,getLocale as Ki,loadLocale as Ua,localeDirection as Ka,LOCALE_NAMES as Wa,resolveLocale as Ya,setStringOverrides as Qa,t as le}from"@seatlayer/core";var Ie="seatlayer.v1";function Bo(n){let e=typeof n.default=="string"?n.default:"free",t={};if(n.seats&&typeof n.seats=="object")for(let[i,s]of Object.entries(n.seats))typeof s=="string"&&s!==e&&(t[i]=s);return{default:e,exceptions:t}}function No(n,e){if(!n||n.default!==e.default)return null;let t=[];for(let[i,s]of Object.entries(e.exceptions))n.exceptions[i]!==s&&t.push({label:i,status:s});for(let i of Object.keys(n.exceptions))i in e.exceptions||t.push({label:i,status:e.default});return t}function $o(n,e){for(let t of e)t.status===n.default?delete n.exceptions[t.label]:n.exceptions[t.label]=t.status}function $n(n){if(/(?:^|[?&#])(?:token|access_token|bearer|authorization|ticket|tkt|bse)=/i.test(n))throw new Error("seatlayer: refusing to open a socket with a credential in the URL");if(/\bbse_[A-Za-z0-9._-]+/.test(n))throw new Error("seatlayer: refusing to open a socket with a credential in the URL")}var 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=[Ie];if(this.opts.mintTicket){let r;try{r=await this.opts.mintTicket()}catch(o){this.reportIfAccessError(o),this.scheduleReconnect();return}if(this.stopped)return;r?.protocols?.length?(e=[...r.protocols],e.includes(Ie)||e.unshift(Ie)):r?.ticket&&(e=[Ie,`tkt.${r.ticket}`])}let t=this.version!==null;t&&e.push(`sv.${this.version}`);let i=this.useQueryMarker?`${this.opts.url}${this.opts.url.includes("?")?"&":"?"}pv=1`:this.opts.url;$n(i);let s;try{s=(this.opts.socketFactory??((o,a)=>new WebSocket(o,a)))(i,e)}catch{this.scheduleReconnect();return}this.ws=s,s.onopen=()=>{this.ws===s&&(this.attempt=0,this.v1=s.protocol===Ie,this.v1||(this.useQueryMarker=!0),this.startKeepalive(s),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))},s.onmessage=r=>{if(this.ws!==s)return;let o;try{o=JSON.parse(typeof r.data=="string"?r.data:"")}catch{return}!o||typeof o!="object"||this.handleFrame(o)},s.onclose=r=>{if(this.ws===s){if(this.ws=null,this.clearTimers(),r?.code===4401){if(r.reason==="access_expired"){this.scheduleReconnect();return}this.stopped=!0,this.opts.onAccessUnavailable?.({reason:"revoked",code:"access_revoked",retryable:!1});return}this.scheduleReconnect()}},s.onerror=()=>{try{s.close()}catch{}}}handleFrame(e){let t=typeof e.type=="string"?e.type:"";if(e.protocol===1&&(this.v1=!0),typeof e.snapshotVersion=="number"&&(this.version=e.snapshotVersion),t==="pong"){this.clearPongTimer();return}if(Array.isArray(e.hidden)||Array.isArray(e.closed)){let i=Array.isArray(e.hidden)?e.hidden:[],s=Array.isArray(e.closed)?e.closed:[],r=i.join("\0"),o=s.join("\0");(r!==this.hidden||o!==this.closedSections)&&(this.hidden=r,this.closedSections=o,this.opts.sink.onSections?.(i,s))}if(t!=="hidden"){if(t==="presence"){this.opts.sink.onPresence?.({shoppingSessions:Number(e.shoppingSessions)||0,activeHolds:Number(e.activeHolds)||0});return}if(t!=="allocation"){if(t==="snapshot"||!t&&e.seats){this.answered();let i=Bo(e),s=No(this.projection,i);this.projection=i,s===null?this.opts.sink.applyProjection?this.opts.sink.applyProjection(i):this.opts.sink.resync():s.length&&this.opts.sink.applyStatuses(s);return}if(t==="delta"&&Array.isArray(e.changes)){this.answered();let i=e.changes.filter(s=>typeof s?.label=="string"&&typeof s?.status=="string").map(s=>({label:s.label,status:s.status}));if(!i.length)return;this.projection&&$o(this.projection,i),this.opts.sink.applyStatuses(i)}}}}answered(){this.resumeTimer&&(clearTimeout(this.resumeTimer),this.resumeTimer=null)}reportIfAccessError(e){let t=e?.reason;e?.name==="BuyerAccessUnavailableError"&&(this.stopped=!0,this.opts.onAccessUnavailable?.({reason:t??"invalid",code:e.code,status:e.status,retryable:t==="paused"}))}startKeepalive(e){this.pingTimer=setInterval(()=>{if(this.ws===e){try{e.send(JSON.stringify({type:"ping"}))}catch{return}this.clearPongTimer(),this.pongTimer=setTimeout(()=>{this.pongTimer=null;try{e.close()}catch{}},1e4)}},25e3)}scheduleReconnect(){if(this.stopped||this.reconnectTimer)return;let e=Math.min(this.attempt++,5),t=Math.min(1e3*2**e,15e3),i=Math.random()*t;this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},i)}clearPongTimer(){this.pongTimer&&(clearTimeout(this.pongTimer),this.pongTimer=null)}clearTimers(){this.pingTimer&&clearInterval(this.pingTimer),this.pingTimer=null,this.clearPongTimer(),this.reconnectTimer&&clearTimeout(this.reconnectTimer),this.reconnectTimer=null,this.resumeTimer&&clearTimeout(this.resumeTimer),this.resumeTimer=null}};function Fo(n){return n==="blocked"?"not_for_sale":n==="held"||n==="booked"||n==="free"||n==="not_for_sale"?n:"free"}function gt(n,e={}){let t=i=>{let s=n.tableSelection(i);if(s)return s.physicalSeatIds;let r=n.idForLabel(i);return r?[r]:[]};return{applyStatuses(i){let s=n.currentHold()?.labels??[],r={free:[],held:[],booked:[],not_for_sale:[]},o=[],a=[],l=new Map(n.getSelection().map(c=>[c.label,c.id]));for(let c of i){let d=t(c.label);if(!d.length)continue;let p=Fo(c.status);if(r[p].push(...d),e.flashOnLiveChange&&p!=="free"&&!s.includes(c.label)&&d.some(u=>n.getStatus(u)==="free")){let u=p==="held"?"#f4b740":"#f43f5e";for(let h of d)o.push({id:h,color:u})}p!=="free"&&!s.includes(c.label)&&l.has(c.label)&&a.push(c.label)}for(let c of["free","held","booked","not_for_sale"])r[c].length&&n.setStatus(r[c],c);for(let c of o)n.flashSeat(c.id,c.color);if(a.length){let c=a.flatMap(p=>t(p));c.length&&n.deselect(c);let d=i.some(p=>p.status==="blocked"&&a.includes(p.label));e.onSelectedObjectUnavailable?.(a,d?"ineligible":"taken")}e.onStatusChange?.()},async resync(){await n.refresh()},onSections(i,s){n.refresh(),e.onSections?.(i,s)}}}var $=class extends Error{constructor(e,t,i,s,r,o){super(t),this.name="ApiError",this.status=e,this.code=i,this.conflicts=s,this.reason=r,this.retryAfterS=o}},Fn=10,Vn=1;function Vt(n,e){let t=(n??"").trim();if(t){let i=Number(t);if(Number.isFinite(i)&&i>=0)return Math.ceil(i);let s=Date.parse(t);if(Number.isFinite(s))return Math.max(0,Math.ceil((s-Date.now())/1e3))}if(typeof e=="number"&&Number.isFinite(e)&&e>=0)return Math.ceil(e)}var Vo={seat_conflict:"taken",conflict:"taken",channel_assignment_conflict:"ineligible",allocation_exhausted:"exhausted"},Pe=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 i=t.referral?.trim();this.referral=i?i.slice(0,120):void 0}get accessScoped(){return!!this.access?.configured}async request(e,t={},i={}){let s=t.method??"GET",r={},o;t.body!==void 0&&(r["Content-Type"]="application/json",o=JSON.stringify(t.body));let a=await this.access?.authorization(i.auth?"unauthorized":"initial");a&&(r.Authorization=a);let l=await fetch(`${this.base}${e}`,{method:s,headers:r,body:o,credentials:"omit"}),d=(l.headers.get("content-type")??"").includes("application/json")?await l.json().catch(()=>null):null;if(!l.ok){let p=d,u=p?.code??p?.error;if(this.access?.configured&&(l.status===401||l.status===403||l.status===422)&&await this.access.handleFailure(l.status,u)&&!i.auth)return this.request(e,t,{...i,auth:!0});if(l.status===409){let g=u?Vo[u]:void 0,m=p?.conflicts?.map(y=>y.label)??t.labels??[];g&&this.onObjectUnavailable?.({labels:m,reason:g,code:u})}let h;if(l.status===429&&(h=Vt(l.headers.get("Retry-After"),p?.retryAfterSeconds)??Vn,s==="GET"&&!i.rateLimit&&h<=Fn))return await new Promise(g=>setTimeout(g,h*1e3)),this.request(e,t,{...i,rateLimit:!0});throw new $(l.status,p?.error??`request_failed_${l.status}`,u,p?.conflicts,p?.reason,h)}return d}async requestBlob(e,t={}){let i={},s=await this.access?.authorization(t.auth?"unauthorized":"initial");s&&(i.Authorization=s);let r=await fetch(`${this.base}${e}`,{method:"GET",headers:i,credentials:"omit"});if(r.ok)return r.blob();let a=(r.headers.get("content-type")??"").includes("application/json")?await r.json().catch(()=>null):null,l=a?.code??a?.error;if(this.access?.configured&&(r.status===401||r.status===403||r.status===422)&&await this.access.handleFailure(r.status,l)&&!t.auth)return this.requestBlob(e,{...t,auth:!0});let c;if(r.status===429&&(c=Vt(r.headers.get("Retry-After"),a?.retryAfterSeconds)??Vn,!t.rateLimit&&c<=Fn))return await new Promise(d=>setTimeout(d,c*1e3)),this.requestBlob(e,{...t,rateLimit:!0});throw new $(r.status,a?.error??`request_failed_${r.status}`,l,void 0,void 0,c)}chart(e){return this.request(`/pub/events/${encodeURIComponent(e)}/chart`)}eventConfiguration(e){return this.request(`/pub/events/${encodeURIComponent(e)}/event-configuration`)}reportViewEvidence(e,t){return this.request(`/pub/events/${encodeURIComponent(e)}/view-evidence-reports`,{method:"POST",body:{seatId:t.seatId,...t.evidenceId?{evidenceId:t.evidenceId}:{},...t.message?{message:t.message}:{}}})}asset(e,t){return/^[a-zA-Z0-9._-]+$/.test(t)?this.requestBlob(`/pub/events/${encodeURIComponent(e)}/assets/${encodeURIComponent(t)}`):Promise.reject(new $(404,"not_found","not_found"))}objects(e){return this.request(`/pub/events/${encodeURIComponent(e)}/objects?compact=1`)}hold(e,t,i,s){return this.request(`/pub/events/${encodeURIComponent(e)}/hold`,{method:"POST",body:{selections:t,...i?{ttlMs:i}:{},...s?{replaceHoldId:s}:{},...this.referral?{referral:this.referral}:{}},labels:t.map(r=>r.label)})}bestAvailable(e,t,i,s,r){return this.request(`/pub/events/${encodeURIComponent(e)}/best-available`,{method:"POST",body:{qty:t,...i?{categoryKey:i}:{},...s?{zoneId:s}:{},...r?{ttlMs:r}:{},...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,i){return this.request(`/pub/events/${encodeURIComponent(e)}/release`,{method:"POST",body:{labels:t,holdId:i}})}extend(e,t,i){return this.request(`/pub/events/${encodeURIComponent(e)}/extend`,{method:"POST",body:{holdId:t,...i?{ttlMs:i}:{}}})}paymentOptions(e){return this.request(`/pub/events/${encodeURIComponent(e)}/payment-options`)}availability(e,t=!1){return this.request(`/pub/events/${encodeURIComponent(e)}/availability${t?"?live=1":""}`)}startCheckout(e,t){return this.request(`/pub/events/${encodeURIComponent(e)}/checkout`,{method:"POST",body:t})}orderStatus(e){return this.request(`/pub/orders/${encodeURIComponent(e)}/status`)}subscribeTicket(e){return this.request(`/pub/events/${encodeURIComponent(e)}/subscribe-tickets`,{method:"POST",body:{}})}subscribeUrl(e){let t=this.base.replace(/^http/,"ws"),i=new URLSearchParams({surface:"picker",viewerId:this.viewerId});return`${t}/pub/events/${encodeURIComponent(e)}/subscribe?${i}`}socketUrl(e){return this.accessScoped?"":this.subscribeUrl(e)}socketProtocols(e){return this.accessScoped?[]:[Ie]}createRealtime(e,t){return this.accessScoped?null:new ve({url:this.subscribeUrl(e),sink:t})}};import{getLocale as Uo,loadLocale as Ko,LOCALE_NAMES as Wo,localeDirection as Gn,resolveLocale as qn,setStringOverrides as Yo,TRANSLATED_LOCALES as Qo}from"@seatlayer/core";import{getLocale as zo,localeDirection as jo,t as Go}from"@seatlayer/core";function qo(){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 zn(n,e,t){let i=document.createElement("div");i.className="sl-picker",i.tabIndex=-1,i.lang=zo(),i.dir=jo(),n.appendChild(i),Object.entries(ft(void 0,t)).forEach(([r,o])=>i.style.setProperty(r,o)),i.innerHTML=`
|
|
1
|
+
import{a as Nn,c as Vt,d as Ke,e as Ft,f as We}from"./chunk-XGKKO65I.js";import{a as m,b as _,c as E,d as A}from"./chunk-OSZ7DOEH.js";import{PickerController as Fl,formatMoney as $l,getLocale as Wi,loadLocale as zl,localeDirection as jl,LOCALE_NAMES as Gl,resolveLocale as ql,setStringOverrides as Ul,t as ce}from"@seatlayer/core";var Oe="seatlayer.v1";function Ia(i){let e=typeof i.default=="string"?i.default:"free",t={};if(i.seats&&typeof i.seats=="object")for(let[n,s]of Object.entries(i.seats))typeof s=="string"&&s!==e&&(t[n]=s);return{default:e,exceptions:t}}function Oa(i,e){if(!i||i.default!==e.default)return null;let t=[];for(let[n,s]of Object.entries(e.exceptions))i.exceptions[n]!==s&&t.push({label:n,status:s});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 Vn(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 ye=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,Vn(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 r;try{r=await this.opts.mintTicket()}catch(o){this.reportIfAccessError(o),this.scheduleReconnect();return}if(this.stopped)return;r?.protocols?.length?(e=[...r.protocols],e.includes(Oe)||e.unshift(Oe)):r?.ticket&&(e=[Oe,`tkt.${r.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;Vn(n);let s;try{s=(this.opts.socketFactory??((o,a)=>new WebSocket(o,a)))(n,e)}catch{this.scheduleReconnect();return}this.ws=s,s.onopen=()=>{this.ws===s&&(this.attempt=0,this.v1=s.protocol===Oe,this.v1||(this.useQueryMarker=!0),this.startKeepalive(s),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))},s.onmessage=r=>{if(this.ws!==s)return;let o;try{o=JSON.parse(typeof r.data=="string"?r.data:"")}catch{return}!o||typeof o!="object"||this.handleFrame(o)},s.onclose=r=>{if(this.ws===s){if(this.ws=null,this.clearTimers(),r?.code===4401){if(r.reason==="access_expired"){this.scheduleReconnect();return}this.stopped=!0,this.opts.onAccessUnavailable?.({reason:"revoked",code:"access_revoked",retryable:!1});return}this.scheduleReconnect()}},s.onerror=()=>{try{s.close()}catch{}}}handleFrame(e){let t=typeof e.type=="string"?e.type:"";if(e.protocol===1&&(this.v1=!0),typeof e.snapshotVersion=="number"&&(this.version=e.snapshotVersion),t==="pong"){this.clearPongTimer();return}if(Array.isArray(e.hidden)||Array.isArray(e.closed)){let n=Array.isArray(e.hidden)?e.hidden:[],s=Array.isArray(e.closed)?e.closed:[],r=n.join("\0"),o=s.join("\0");(r!==this.hidden||o!==this.closedSections)&&(this.hidden=r,this.closedSections=o,this.opts.sink.onSections?.(n,s,{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=Ia(e),s=Oa(this.projection,n);this.projection=n,s===null?this.opts.sink.applyProjection?this.opts.sink.applyProjection(n):this.opts.sink.resync():s.length&&this.opts.sink.applyStatuses(s);return}if(t==="delta"&&Array.isArray(e.changes)){this.answered();let n=e.changes.filter(s=>typeof s?.label=="string"&&typeof s?.status=="string").map(s=>({label:s.label,status:s.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 Da(i){return i==="blocked"?"not_for_sale":i==="held"||i==="booked"||i==="free"||i==="not_for_sale"?i:"free"}function bt(i,e={}){let t=n=>{let s=i.tableSelection(n);if(s)return s.physicalSeatIds;let r=i.idForLabel(n);return r?[r]:[]};return{applyStatuses(n){let s=new Set([...i.currentHold()?.labels??[],...e.ownLabels?.()??[]]),r={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=Da(c.status);if(r[d].push(...p),e.flashOnLiveChange&&d!=="free"&&!s.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"&&!s.has(c.label)&&l.has(c.label)&&a.push(c.label)}for(let c of["free","held","booked","not_for_sale"])r[c].length&&i.setStatus(r[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,s,r){r?.withInventory||(i.resync?i.resync({reason:"frame"}):i.refresh()),e.onSections?.(n,s,r)}}}var F=class extends Error{constructor(e,t,n,s,r,o){super(t),this.name="ApiError",this.status=e,this.code=n,this.conflicts=s,this.reason=r,this.retryAfterS=o}},Fn=10,$n=1;function $t(i,e){let t=(i??"").trim();if(t){let n=Number(t);if(Number.isFinite(n)&&n>=0)return Math.ceil(n);let s=Date.parse(t);if(Number.isFinite(s))return Math.max(0,Math.ceil((s-Date.now())/1e3))}if(typeof e=="number"&&Number.isFinite(e)&&e>=0)return Math.ceil(e)}var Ba={seat_conflict:"taken",conflict:"taken",channel_assignment_conflict:"ineligible",allocation_exhausted:"exhausted"},Pe=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 s=t.method??"GET",r={},o;t.body!==void 0&&(r["Content-Type"]="application/json",o=JSON.stringify(t.body));let a=await this.access?.authorization(n.auth?"unauthorized":"initial");a&&(r.Authorization=a);let l=await fetch(`${this.base}${e}`,{method:s,headers:r,body:o,credentials:"omit"}),p=(l.headers.get("content-type")??"").includes("application/json")?await l.json().catch(()=>null):null;if(!l.ok){let d=p,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 f=u?Ba[u]:void 0,g=d?.conflicts?.map(x=>x.label)??t.labels??[];f&&this.onObjectUnavailable?.({labels:g,reason:f,code:u})}let h;if(l.status===429&&(h=$t(l.headers.get("Retry-After"),d?.retryAfterSeconds)??$n,s==="GET"&&!n.rateLimit&&h<=Fn))return await new Promise(f=>setTimeout(f,h*1e3)),this.request(e,t,{...n,rateLimit:!0});throw new F(l.status,d?.error??`request_failed_${l.status}`,u,d?.conflicts,d?.reason,h)}return p}async requestBlob(e,t={}){let n={},s=await this.access?.authorization(t.auth?"unauthorized":"initial");s&&(n.Authorization=s);let r=await fetch(`${this.base}${e}`,{method:"GET",headers:n,credentials:"omit"});if(r.ok)return r.blob();let a=(r.headers.get("content-type")??"").includes("application/json")?await r.json().catch(()=>null):null,l=a?.code??a?.error;if(this.access?.configured&&(r.status===401||r.status===403||r.status===422)&&await this.access.handleFailure(r.status,l)&&!t.auth)return this.requestBlob(e,{...t,auth:!0});let c;if(r.status===429&&(c=$t(r.headers.get("Retry-After"),a?.retryAfterSeconds)??$n,!t.rateLimit&&c<=Fn))return await new Promise(p=>setTimeout(p,c*1e3)),this.requestBlob(e,{...t,rateLimit:!0});throw new F(r.status,a?.error??`request_failed_${r.status}`,l,void 0,void 0,c)}chart(e){return this.request(`/pub/events/${encodeURIComponent(e)}/chart`)}eventConfiguration(e){return this.request(`/pub/events/${encodeURIComponent(e)}/event-configuration`)}reportViewEvidence(e,t){return this.request(`/pub/events/${encodeURIComponent(e)}/view-evidence-reports`,{method:"POST",body:{seatId:t.seatId,...t.evidenceId?{evidenceId:t.evidenceId}:{},...t.message?{message:t.message}:{}}})}asset(e,t){return/^[a-zA-Z0-9._-]+$/.test(t)?this.requestBlob(`/pub/events/${encodeURIComponent(e)}/assets/${encodeURIComponent(t)}`):Promise.reject(new F(404,"not_found","not_found"))}objects(e){return this.request(`/pub/events/${encodeURIComponent(e)}/objects?compact=1`)}hold(e,t,n,s){return this.request(`/pub/events/${encodeURIComponent(e)}/hold`,{method:"POST",body:{selections:t,...n?{ttlMs:n}:{},...s?{replaceHoldId:s}:{},...this.referral?{referral:this.referral}:{}},labels:t.map(r=>r.label)})}bestAvailable(e,t,n,s,r){return this.request(`/pub/events/${encodeURIComponent(e)}/best-available`,{method:"POST",body:{qty:t,...n?{categoryKey:n}:{},...s?{zoneId:s}:{},...r?{ttlMs:r}:{},...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 ye({url:this.subscribeUrl(e),sink:t})}};import{getLocale as za,loadLocale as ja,LOCALE_NAMES as Ga,localeDirection as Gn,resolveLocale as qn,setStringOverrides as qa,TRANSLATED_LOCALES as Ua}from"@seatlayer/core";import{getLocale as Na,localeDirection as Va,t as Fa}from"@seatlayer/core";function $a(){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 zn(i,e,t){let n=document.createElement("div");n.className="sl-picker",n.tabIndex=-1,n.lang=Na(),n.dir=Va(),i.appendChild(n),Object.entries(We(void 0,t)).forEach(([r,o])=>n.style.setProperty(r,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">
|
|
@@ -33,7 +33,7 @@ import{a as Nn,c as $t,d as Ue,e as Ft,f as ft}from"./chunk-ZE36NABM.js";import{
|
|
|
33
33
|
</div>
|
|
34
34
|
<div class="sl-boot" data-ref="boot">
|
|
35
35
|
<div class="sl-boot-bar" aria-hidden="true"></div>
|
|
36
|
-
${
|
|
36
|
+
${$a()}
|
|
37
37
|
<span class="sl-boot-say" role="status" aria-live="polite" data-sl-t="picker.loadingSeatMap">${e("picker.loadingSeatMap","Loading seat map\u2026")}</span>
|
|
38
38
|
</div>
|
|
39
39
|
<div class="sl-toast" data-ref="toast" role="status" aria-live="polite"></div>
|
|
@@ -76,7 +76,7 @@ import{a as Nn,c as $t,d as Ue,e as Ft,f as ft}from"./chunk-ZE36NABM.js";import{
|
|
|
76
76
|
<button type="button" class="sl-cta" data-ref="cta" disabled></button>
|
|
77
77
|
</div>
|
|
78
78
|
</div>
|
|
79
|
-
</div>`;let s={};return
|
|
79
|
+
</div>`;let s={};return n.querySelectorAll("[data-ref]").forEach(r=>{s[r.dataset.ref]=r}),{root:n,mapHost:s.map,els:s}}function jn(i){let e=(t,n)=>{for(let s of i.querySelectorAll(`[${t}]`)){let r=s.getAttribute(t);if(!r)continue;let o=Fa(r);o!==r&&n(s,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 zt(i,e){let t=qn(i),n=Ua.includes(t)?t:"en";return e&&qa(e),{locale:n,direction:Gn(n),ready:ja(i)}}function jt(i,e,t){i.lang=e.locale,i.dir=e.direction,e.ready.then(t)}function Un(i,e){if(!i)return null;let t=(e.languages??[]).map(s=>qn(s)).filter((s,r,o)=>o.indexOf(s)===r);if(t.length<2)return null;let n=document.createElement("select");n.className="sl-langsel",n.setAttribute("aria-label",e.label);for(let s of t){let r=document.createElement("option");r.value=s,r.textContent=Ga[s]??s,r.selected=s===za(),n.appendChild(r)}return n.addEventListener("change",()=>e.onChange(n.value)),i.appendChild(n),n}function Kn(i,e){e.root.lang=i,e.root.dir=Gn(i),jn(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 le=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}},Ka=new Set(["buyer_access_expired"]),Wa=new Set(["paused","provider_failed","channel_denied"]);function Ya(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 Qa(i,e){return i===401&&!!e&&Ka.has(e)}var Xa=3e4,X,Z,Qe,Xe,vt,Le,we,Ze,yt,wt,xt,_e,J,Di,Gt,Ye,pe=class{constructor(e){_(this,J);_(this,X,null);_(this,Z,0);_(this,Qe,null);_(this,Xe);_(this,vt);_(this,Le,null);_(this,we,null);_(this,Ze,null);_(this,yt);_(this,wt);_(this,xt,!1);_(this,_e);if(E(this,Xe,e.provider),E(this,vt,e.skewMs??Xa),E(this,yt,e.onExpired),E(this,wt,e.onUnavailable),e.token){let t=typeof e.token=="string"?{token:e.token}:e.token;A(this,J,Di).call(this,t)}E(this,xt,!!m(this,Xe)||!!m(this,X))}get configured(){return m(this,xt)}onRenewed(e){E(this,_e,e)}get unavailable(){return m(this,we)}get hasToken(){return!!m(this,X)&&(m(this,Z)===0||m(this,Z)>Date.now())}get expiresAt(){return m(this,Z)}async authorization(e="initial"){if(!this.configured)return null;if(m(this,we))throw new le(m(this,we));let t=Date.now();if(!m(this,X)||m(this,Z)>0&&m(this,Z)-m(this,vt)<=t){let s=!!m(this,X)&&m(this,Z)>0&&m(this,Z)<=t,r=m(this,X)?s?"expired":"expiring":e,o=await A(this,J,Gt).call(this,r);if(!o)throw new le(m(this,we)??m(this,Ze)??A(this,J,Ye).call(this,"provider_failed"));return`Bearer ${o}`}return`Bearer ${m(this,X)}`}async handleFailure(e,t){var s;if(!this.configured)return!1;if(Qa(e,t)){E(this,X,null),E(this,Z,0);let r=await A(this,J,Gt).call(this,"unauthorized",t);return(s=m(this,yt))==null||s.call(this,{reason:"unauthorized",code:t,refreshed:!!r}),!!r}let n=Ya(e,t);return n&&A(this,J,Ye).call(this,n,t,e),!1}async refresh(e="manual"){return E(this,we,null),E(this,Ze,null),E(this,X,null),E(this,Z,0),!!await A(this,J,Gt).call(this,e)}clear(){E(this,X,null),E(this,Qe,null),E(this,Z,0),E(this,Le,null),E(this,_e,void 0)}toJSON(){return{configured:this.configured,hasToken:this.hasToken}}toString(){return"[BuyerAccessContext redacted]"}};X=new WeakMap,Z=new WeakMap,Qe=new WeakMap,Xe=new WeakMap,vt=new WeakMap,Le=new WeakMap,we=new WeakMap,Ze=new WeakMap,yt=new WeakMap,wt=new WeakMap,xt=new WeakMap,_e=new WeakMap,J=new WeakSet,Di=function(e){return!e||typeof e.token!="string"||!e.token?null:(E(this,Qe,e.token),E(this,X,e.token),E(this,Z,typeof e.expiresAt=="number"?e.expiresAt:0),m(this,X))},Gt=function(e,t){if(m(this,Le))return m(this,Le);let n=m(this,Xe);if(!n)return A(this,J,Ye).call(this,"no_token",t),Promise.resolve(null);let s=m(this,Qe),r=(async()=>{try{let o=await n({reason:e}),a=A(this,J,Di).call(this,o);if(!a)return A(this,J,Ye).call(this,"provider_failed",t),null;if(s&&s!==a&&m(this,_e))try{await m(this,_e).call(this,{previousToken:s,token:a,reason:e})}catch{}return a}catch{return A(this,J,Ye).call(this,"provider_failed",t),null}finally{E(this,Le,null)}})();return E(this,Le,r),r},Ye=function(e,t,n){var r;let s={reason:e,code:t,status:n,retryable:e==="paused"||e==="channel_denied"};return E(this,Ze,s),Wa.has(e)||(E(this,we,s),E(this,X,null),E(this,Z,0)),(r=m(this,wt))==null||r.call(this,s),s};function St(i,e={}){return!i.buyerAccessTokenProvider&&!i.buyerAccessToken?null:new pe({provider:i.buyerAccessTokenProvider,token:i.buyerAccessToken,...e})}var Za=3e4;function Ja(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-Za>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"}),s=await n.json().catch(()=>null);if(!n.ok){let r=n.status===429?$t(n.headers.get("Retry-After"),s?.retryAfterSeconds):void 0;throw new F(n.status,s?.error??`request_failed_${n.status}`,s?.code??s?.error,void 0,void 0,r)}if(!Ja(s))throw new F(502,"invalid_bootstrap_response","invalid_bootstrap_response");return this.value=s,s})();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 Pe{constructor(t,n,s,r,o){super(t,{...o,access:r});this.event=n;this.loader=s;this.bootstrapAccess=r;this.initialChartDelivered=!1;this.initialObjectsDelivered=!1}assertEvent(t){if(t!==this.event)throw new F(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 qt(i){let e=new Bi(i.base,i.event,i.publicKey),t=new pe({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 xe,tCount as De}from"@seatlayer/core";var G={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 el=`.sl-picker,.sl-modal-scrim,.sl-mo-host{--sl-dur-enter:${G.enter}ms;--sl-dur-exit:${G.exit}ms;--sl-dur-spring:${G.spring}ms;--sl-dur-flight:${G.flight}ms;--sl-dur-stagger:${G.stagger}ms;--sl-dur-xfade:${G.crossfade}ms;--sl-dur-collapse:${G.collapse}ms;--sl-dur-rung:${G.rung}ms;--sl-ease-enter:${G.easeEnter};--sl-ease-exit:${G.easeExit};--sl-ease-spring:${G.easeSpring};--sl-mo-ox:50%;--sl-mo-oy:50%}`,tl=`@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:${G.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:${G.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}}`,Wn=el+`
|
|
80
80
|
/* Anchored open/close. The translate is 8px TOWARD the anchor, which is what
|
|
81
81
|
makes the card look attached to the seat rather than dropped on the map. */
|
|
82
82
|
.sl-mo-in{transform-origin:var(--sl-mo-ox) var(--sl-mo-oy);
|
|
@@ -143,7 +143,7 @@ import{a as Nn,c as $t,d as Ue,e as Ft,f as ft}from"./chunk-ZE36NABM.js";import{
|
|
|
143
143
|
@keyframes slMoZoom{from{opacity:0;transform:scale(1.02)}to{opacity:1;transform:none}}
|
|
144
144
|
.sl-mo-rotate-in{animation:slMoSpin var(--sl-dur-spring) var(--sl-ease-spring) 1 both}
|
|
145
145
|
@keyframes slMoSpin{from{opacity:0;transform:rotate(-140deg) scale(.8)}to{opacity:1;transform:none}}
|
|
146
|
-
`+ra;function Ut(){try{return window.matchMedia?.("(prefers-reduced-motion: reduce)").matches===!0}catch{return!1}}function Bi(n,e){if(!e){n.style.removeProperty("--sl-mo-ox"),n.style.removeProperty("--sl-mo-oy");return}Kt(n,e,n.getBoundingClientRect())}function Kt(n,e,t){let i=t.width||1,s=t.height||1,r=o=>Math.max(0,Math.min(100,o));n.style.setProperty("--sl-mo-ox",`${r((e.x-t.left)/i*100).toFixed(1)}%`),n.style.setProperty("--sl-mo-oy",`${r((e.y-t.top)/s*100).toFixed(1)}%`)}function Yn(n,e,t){let i=n.getBoundingClientRect(),s=t.getBoundingClientRect();Kt(n,e,{left:i.left-s.left,top:i.top-s.top,width:i.width,height:i.height})}function Wt(n,e){n.classList.remove("sl-mo-out"),e!==void 0&&Bi(n,e),n.classList.remove("sl-mo-in"),n.offsetWidth,n.classList.add("sl-mo-in")}function Qn(n){n.classList.add("sl-mo-stagger");let e=0;for(let t of Array.from(n.children))t.style.setProperty("--sl-mo-i",String(e)),e+=1}function Me(n,e,t={className:"sl-mo-out",duration:G.exit}){let i=()=>{s||(s=!0,!(typeof window>"u")&&(clearTimeout(r),n.removeEventListener("animationend",i),e?e():n.remove()))},s=!1;n.classList.remove("sl-mo-in","sl-mo-slide-up","sl-mo-spring","sl-mo-zoom","sl-mo-rise"),n.classList.add(t.className),n.addEventListener("animationend",i);let r=setTimeout(i,Ut()?0:t.duration+60)}var Xn={className:"sl-mo-slide-down",duration:G.exit};function Ni(n,e){n.textContent!==e&&(n.textContent=e,n.classList.remove("sl-mo-xfade"),n.offsetWidth,n.classList.add("sl-mo-xfade"))}function Zn(n){if(Ut())return n.onArrive?.(),null;let e=document.createElement("div");e.className="sl-mo-fly sl-mo-host",e.setAttribute("aria-hidden","true"),e.textContent=n.label??"",e.style.left=`${n.from.x}px`,e.style.top=`${n.from.y}px`,e.style.background=n.color??"var(--sl-accent,#6e7bff)",e.style.color=n.ink??"#fff",e.style.setProperty("--sl-fly-dx",`${Math.round(n.to.x-n.from.x)}px`),e.style.setProperty("--sl-fly-dy",`${Math.round(n.to.y-n.from.y)}px`),document.body.appendChild(e);let t=!1,i=()=>{t||(t=!0,window.clearTimeout(s),e.remove(),n.onArrive?.())};e.addEventListener("animationend",i);let s=window.setTimeout(i,G.flight+80);return e}var V=n=>String(n??"").replace(/[&<>"']/g,e=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[e]);function Xe(n,e){let t=0;for(let i of n.get(e)?.values()??[])t+=i;return t}function Jn(n){let e=[];for(let[t,i]of n)for(let[s,r]of i)r>0&&e.push({areaId:t,tierId:s,qty:r});return e}function es(n){let e=new Map;for(let t of n.keys())e.set(t,Xe(n,t));return e}function kt(n,e,t,i){let s=n.get(e)??new Map;i>0?s.set(t,i):s.delete(t),s.size?n.set(e,s):n.delete(e)}function ts(n){let e=new Map;for(let t of n)t.objectType!=="ga"||!t.objectId||e.set(t.objectId,(e.get(t.objectId)??0)+(t.quantity??1));return e}function Be(n,e){let t=ts(e),i=0;for(let s of n.keys())i+=Math.max(0,Xe(n,s)-(t.get(s)??0));return i}function is(n,e,t){let i=ts(t),s=0;for(let r of e){let o=n.gaQty.get(r.id);if(!o)continue;let a=i.get(r.id)??0;for(let[l,c]of o){let d=Math.max(0,c-a);a=Math.max(0,a-c),s+=d*n.paidPrice(r.categoryKey,l,oa(r,l),r.id)}}return s}function oa(n,e){return e?n.tiers?.find(t=>t.id===e)?.price??n.price:n.price}function ns(n){let e=[],t=new Map;for(let i of n){if(i.objectType!=="ga"||!i.objectId){e.push({...i,labels:[i.label]});continue}let s=`${i.objectId}\0${i.tierId??""}`,r=t.get(s);if(r){r.quantity=(r.quantity??0)+(i.quantity??1),r.labels.push(i.label);continue}let o={...i,quantity:i.quantity??1,labels:[i.label]};t.set(s,o),e.push(o)}return e}function ss(n,e,t){let i=new Set(t);for(let s of e)s.objectType==="ga"&&s.objectId&&i.has(s.label)&&kt(n,s.objectId,s.tierId??null,0)}function Fi(n,e){if(n.objectType!=="ga")return n.label;let t=e.find(i=>i.id===n.objectId);return t?.displayLabel??t?.label??n.label}function aa(n){let e=new Map;for(let t of n){if(t.objectType!=="ga"||!t.objectId)continue;let i=`${t.objectId}\0${t.tierId??""}`;e.set(i,(e.get(i)??0)+(t.quantity??1))}return e}function Yt(n){let e=n.tiers??[];return e.length>1?e.map(t=>({id:t.id,label:t.name||t.id,price:t.price})):[{id:null,label:n.displayType??xe("picker.generalAdmission"),price:n.price}]}function rs(n,e){let t=n.totalTicketCount()-Xe(n.gaQty,e.id);return Math.max(0,Math.min(e.available,n.maxTickets-t))}function Vi(n,e,t,i){if(we(n,!1),n.salesClosed){n.toast(n.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}let s=Yt(e),r=n.gaQty.get(e.id),o=Xe(n.gaQty,e.id)>0,a=rs(n,e);if(a<=0&&!o){n.toast(e.available>0?xe("picker.maxTicketsForOrder",{count:n.maxTickets}):n.tf("picker.soldOutTitle","Sold out"),"warning");return}if(n.onGAPromptHook){let u={};for(let[g,m]of r??[])u[g??""]=m;if(n.onGAPromptHook({area:e,selected:u,min:0,max:a,tiers:s,confirm:g=>{pa(n,e,s,g,a)},cancel:()=>we(n)})===!0)return}let l=new Map;for(let u of s)l.set(u.id,r?.get(u.id)??0);!o&&a>0&&l.set(s[0].id,1);let c={area:e,tiers:s,draft:l,max:a,reopened:o},d=n.root?.dataset.layout==="narrow",p=document.createElement("div");p.className=d?"sl-ga-scrim sl-mo-scrim":"sl-ga-pop-layer",p.innerHTML=la(n,c,d),n.root?.appendChild(p),n.gaPromptEl=p,n.gaPromptReturnFocus=i??document.activeElement,d||ha(n,p,t),n.reducedMotion()&&(p.dataset.motion="reduced"),as(n,c),ca(n,p,c),requestAnimationFrame(()=>p.querySelector('[data-ga-step="1"]')?.focus())}function la(n,e,t){let{area:i,tiers:s}=e,r=s.length>1,o=i.displayLabel??i.label,a=s.map(l=>`<div class="sl-ga-prompt-row" data-ga-tier="${V(l.id??"")}"><div class="sl-ga-prompt-label"><span>${V(r?l.label:n.tf("picker.gaChooseTickets","How many tickets?"))}</span>`+(r?`<small>${V(n.money(n.paidPrice(i.categoryKey,l.id,l.price,i.id)))}</small>`:"")+`</div><div class="sl-ga-stepper" role="group" aria-label="${V(r?l.label:o)}"><button type="button" data-ga-step="-1" aria-label="${V(n.tf("picker.fewer","Fewer"))}">\u2212</button><output data-ga-qty aria-live="polite">0</output><button type="button" data-ga-step="1" aria-label="${V(n.tf("picker.more","More"))}">+</button></div></div>`).join("");return`<section class="${t?"sl-ga-sheet":"sl-ga-pop"}" role="dialog" aria-modal="true" aria-label="${V(xe("picker.gaChooseForArea",{area:o}))}"><div class="sl-ga-prompt-head"><div class="sl-ga-prompt-eyebrow">${V(i.displayType??n.tf("picker.generalAdmission","General admission"))}</div><h2 class="sl-ga-prompt-title">${V(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="${V(xe("common.close"))}">\xD7</button></div><div class="sl-ga-prompt-body">${a}`+(s.length>1?`<div class="sl-ga-prompt-total"><span>${V(n.tf("picker.total","Total"))}</span><b data-ga-total></b></div>`:"")+'<p class="sl-ga-prompt-hint" data-ga-hint></p></div><div class="sl-ga-prompt-actions">'+(e.reopened?`<button type="button" class="sl-ga-prompt-remove" data-ga-remove>${V(n.tf("picker.gaRemove","Remove"))}</button>`:`<button type="button" class="sl-ga-prompt-remove" data-ga-cancel>${V(xe("common.cancel"))}</button>`)+'<button type="button" class="sl-ga-prompt-confirm" data-ga-confirm></button></div></section>'}function zi(n){let e=0;for(let t of n.draft.values())e+=t;return e}function os(n,e){let t=0;for(let i of e.tiers)t+=(e.draft.get(i.id)??0)*n.paidPrice(e.area.categoryKey,i.id,i.price,e.area.id);return t}function as(n,e){let t=n.gaPromptEl;if(!t)return;let i=zi(e),s=os(n,e);t.querySelectorAll("[data-ga-tier]").forEach(c=>{let d=c.dataset.gaTier?c.dataset.gaTier:null,p=e.draft.get(d)??0,u=c.querySelector("[data-ga-qty]");u&&(u.value=String(p)),c.querySelectorAll("[data-ga-step]").forEach(h=>{h.disabled=Number(h.dataset.gaStep)<0?p<=0:i>=e.max})});let r=t.querySelector("[data-ga-sub]");r&&(r.textContent=`${n.money(n.paidPrice(e.area.categoryKey,e.tiers[0].id,e.tiers[0].price,e.area.id))} \xB7 ${De("picker.leftCount",e.area.available)}`);let o=t.querySelector("[data-ga-total]");o&&(o.textContent=n.money(s));let a=t.querySelector("[data-ga-hint]");a&&(a.textContent=i>=e.max&&e.max>0?e.area.available<=e.max?De("picker.leftCount",e.area.available):xe("picker.maxTicketsForOrder",{count:n.maxTickets}):"");let l=t.querySelector("[data-ga-confirm]");l&&(l.textContent=e.reopened?De("picker.gaUpdate",i,{count:i}):De("picker.gaAdd",i,{count:i,price:n.money(s)}),l.disabled=i<=0&&!e.reopened)}function ca(n,e,t){e.querySelectorAll("[data-ga-step]").forEach(i=>{i.addEventListener("click",()=>{let s=i.closest("[data-ga-tier]");if(!s)return;let r=s.dataset.gaTier?s.dataset.gaTier:null,o=Number(i.dataset.gaStep),a=t.draft.get(r)??0,l=t.max-zi(t);t.draft.set(r,Math.max(0,a+(o>0?Math.min(1,l):-1))),as(n,t)})}),e.querySelectorAll("[data-ga-cancel]").forEach(i=>i.addEventListener("click",()=>we(n))),e.querySelector("[data-ga-remove]")?.addEventListener("click",()=>{n.gaQty.delete(t.area.id),we(n),n.syncTray(),$i(n,xe("picker.gaRemoved",{area:t.area.displayLabel??t.area.label}))}),e.querySelector("[data-ga-confirm]")?.addEventListener("click",()=>{da(n,t)}),e.addEventListener("mousedown",i=>{i.target===e&&we(n)}),e.addEventListener("keydown",i=>{if(i.key==="Escape"){i.stopPropagation(),we(n);return}if(i.key!=="Tab")return;let s=[...e.querySelectorAll('button:not(:disabled),[tabindex]:not([tabindex="-1"])')];if(!s.length)return;let r=s[0],o=s[s.length-1];i.shiftKey&&document.activeElement===r?(i.preventDefault(),o.focus()):!i.shiftKey&&document.activeElement===o&&(i.preventDefault(),r.focus())})}function da(n,e){let t=zi(e),i=os(n,e);for(let r of e.tiers)kt(n.gaQty,e.area.id,r.id,e.draft.get(r.id)??0);we(n),n.syncTray();let s=e.area.displayLabel??e.area.label;t>0?$i(n,De("picker.gaAdded",t,{count:t,area:s,price:n.money(i)})):$i(n,xe("picker.gaRemoved",{area:s}))}function pa(n,e,t,i,s){if(typeof i=="number")kt(n.gaQty,e.id,t[0].id,Math.max(0,Math.min(s,Math.floor(i))));else{n.gaQty.delete(e.id);let r=s;for(let o of t){let a=Math.max(0,Math.floor(i[o.id??""]??0)),l=Math.min(a,r);r-=l,kt(n.gaQty,e.id,o.id,l)}}n.syncTray()}function we(n,e=!0){let t=n.gaPromptReturnFocus;n.gaPromptEl&&Me(n.gaPromptEl),n.gaPromptEl=null,n.gaPromptReturnFocus=null,e&&t&&requestAnimationFrame(()=>(t.isConnected?t:n.root)?.focus())}function ha(n,e,t){let i=n.root,s=e.querySelector(".sl-ga-pop");if(!i||!s||!t)return;let r=i.getBoundingClientRect(),o=t.x-r.left,a=t.y-r.top;e.style.setProperty("--sl-ga-anchor-x",`${o}px`),e.style.setProperty("--sl-ga-anchor-y",`${a}px`),requestAnimationFrame(()=>{let l=s.offsetWidth||260,c=s.offsetHeight||220,d=Math.max(8,Math.min(r.width-l-8,o-l/2)),p=a-c-14,u=p>=8?p:Math.min(r.height-c-8,a+14);s.style.left=`${d}px`,s.style.top=`${Math.max(8,u)}px`,s.dataset.side=p>=8?"above":"below",s.style.setProperty("--sl-ga-arrow-x",`${Math.max(12,Math.min(l-12,o-d))}px`)})}function $i(n,e){n.srEl&&(n.srEl.textContent=e)}function ls(n,e,t=[]){let i=[],s=aa(t);for(let o of e){let a=n.gaQty.get(o.id);if(!a)continue;let l=Yt(o);for(let c of l){let d=(a.get(c.id)??0)-(s.get(`${o.id}\0${c.id??""}`)??0);if(d<=0)continue;let p=n.paidPrice(o.categoryKey,c.id,c.price,o.id);i.push(`<div class="sl-ga" data-ga="${V(o.id)}" data-ga-row-tier="${V(c.id??"")}"><div class="sl-ga-info"><div class="sl-ga-name">${V(o.displayLabel??o.label)}</div><div class="sl-ga-sub">${V(l.length>1?c.label:o.displayType??n.tf("picker.generalAdmission","General admission"))} \xB7 ${V(n.money(p))} \xB7 ${V(De("picker.leftCount",o.available))}</div></div><div class="sl-ga-qty"><button type="button" data-d="-1" aria-label="${V(n.tf("picker.fewer","Fewer"))}">\u2212</button><span>${d}</span><button type="button" data-d="1" aria-label="${V(n.tf("picker.more","More"))}">+</button></div></div>`)}}let r=e.filter(o=>Xe(n.gaQty,o.id)<=0&&!t.some(a=>a.objectId===o.id));return r.length&&i.push(`<div class="sl-ga-areas" data-ga-areas><button type="button" class="sl-ga-areas-toggle" data-ga-areas-toggle aria-expanded="${n.gaAreasExpanded}"><span>${V(n.tf("picker.gaAreasHeading","Areas"))}</span><small>${r.length}</small></button>`+(n.gaAreasExpanded?`<div class="sl-ga-areas-list">${r.map(o=>`<button type="button" class="sl-ga-area-open" data-ga-open="${V(o.id)}"${o.available<=0?" disabled":""}><span class="name">${V(o.displayLabel??o.label)}<small>${V(o.displayType??n.tf("picker.generalAdmission","General admission"))}</small></span><span class="meta">${V(n.money(n.paidPrice(o.categoryKey,null,o.price,o.id)))} \xB7 ${V(o.available>0?De("picker.leftCount",o.available):n.tf("picker.soldOutTitle","Sold out"))}</span></button>`).join("")}</div>`:"")+"</div>"),i.join("")}function cs(n,e,t){e.querySelectorAll(".sl-ga .sl-ga-qty button").forEach(i=>{i.addEventListener("click",()=>{let s=i.closest(".sl-ga");if(!s?.dataset.ga)return;let r=t.find(c=>c.id===s.dataset.ga);if(!r)return;let o=s.dataset.gaRowTier?s.dataset.gaRowTier:null,a=Number(i.dataset.d),l=n.gaQty.get(r.id)?.get(o)??0;if(a>0&&rs(n,r)-Xe(n.gaQty,r.id)<=0){n.toast(xe("picker.maxTicketsForOrder",{count:n.maxTickets}),"warning");return}kt(n.gaQty,r.id,o,Math.max(0,l+a)),n.syncTray()})}),e.querySelector("[data-ga-areas-toggle]")?.addEventListener("click",()=>{n.gaAreasExpanded=!n.gaAreasExpanded,n.syncTray()}),e.querySelectorAll("[data-ga-open]").forEach(i=>{i.addEventListener("click",()=>{let s=t.find(r=>r.id===i.dataset.gaOpen);s&&Vi(n,s,null,i)})})}var Qt='<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 ua=/^data:image\/(?:png|jpe?g|webp|gif|avif);base64,[a-z0-9+/]+={0,2}$/i,ma=/[\s"'<>`\\]/;function fa(n){return n.startsWith("//")?!1:n.startsWith("/")||n.startsWith("./")||n.startsWith("../")}function ga(){try{let n=typeof location>"u"?"":location.origin;return n&&n!=="null"?n:null}catch{return null}}function Ze(n){if(typeof n!="string"||!n||n.length>2e6||n!==n.trim())return!1;if(n.startsWith("data:"))return ua.test(n);if(ma.test(n))return!1;let e=ga();if(fa(n)){if(!e)return!1;try{let t=new URL(n,e);return t.origin===e&&!t.username&&!t.password}catch{return!1}}try{let t=new URL(n);return t.username||t.password?!1:t.protocol==="https:"||e!=null&&t.origin===e}catch{return!1}}var ba=/^[a-zA-Z0-9._-]+$/;function ji(n){let e;try{e=new URL(n,"https://seatlayer.invalid")}catch{return null}if(e.search||e.hash)return null;let t=/^\/pub\/events\/([^/]+)\/assets\/([^/]+)$/.exec(e.pathname);if(!t)return null;try{let i=decodeURIComponent(t[1]),s=decodeURIComponent(t[2]);return!i||!ba.test(s)?null:{eventKey:i,asset:s}}catch{return null}}function va(n){try{return/^\/pub\/events\/[^/]+\/assets(?:\/|$)/.test(new URL(n,"https://seatlayer.invalid").pathname)}catch{return!1}}var Je=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=ji(e);if(!t)return Promise.resolve(va(e)||!Ze(e)?null:e);if(t.eventKey!==this.eventKey||!this.load||this.disposed)return Promise.resolve(null);let i=this.pending.get(e);if(i)return i;let s=this.load(this.eventKey,t.asset).then(r=>{let o=URL.createObjectURL(r);return this.disposed?(URL.revokeObjectURL(o),null):(this.created.add(o),o)}).catch(r=>{throw this.pending.delete(e),r});return this.pending.set(e,s),s}dispose(){if(!this.disposed){this.disposed=!0;for(let e of this.created)URL.revokeObjectURL(e);this.created.clear(),this.pending.clear()}}};import{t as nt}from"@seatlayer/core";import{isAuthoredSeatView as Ea,seatViewDisclosure as Aa}from"@seatlayer/core/view3d/crossfade/panorama";var ds=`
|
|
146
|
+
`+tl;function Ut(){try{return window.matchMedia?.("(prefers-reduced-motion: reduce)").matches===!0}catch{return!1}}function Vi(i,e){if(!e){i.style.removeProperty("--sl-mo-ox"),i.style.removeProperty("--sl-mo-oy");return}Kt(i,e,i.getBoundingClientRect())}function Kt(i,e,t){let n=t.width||1,s=t.height||1,r=o=>Math.max(0,Math.min(100,o));i.style.setProperty("--sl-mo-ox",`${r((e.x-t.left)/n*100).toFixed(1)}%`),i.style.setProperty("--sl-mo-oy",`${r((e.y-t.top)/s*100).toFixed(1)}%`)}function Yn(i,e,t){let n=i.getBoundingClientRect(),s=t.getBoundingClientRect();Kt(i,e,{left:n.left-s.left,top:n.top-s.top,width:n.width,height:n.height})}function Wt(i,e){i.classList.remove("sl-mo-out"),e!==void 0&&Vi(i,e),i.classList.remove("sl-mo-in"),i.offsetWidth,i.classList.add("sl-mo-in")}function Qn(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 Je(i,e,t={className:"sl-mo-out",duration:G.exit}){let n=()=>{s||(s=!0,!(typeof window>"u")&&(clearTimeout(r),i.removeEventListener("animationend",n),e?e():i.remove()))},s=!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 r=setTimeout(n,Ut()?0:t.duration+60)}var $p={className:"sl-mo-slide-down",duration:G.exit};function Xn(i){if(Ut())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(s),e.remove(),i.onArrive?.())};e.addEventListener("animationend",n);let s=window.setTimeout(n,G.flight+80);return e}var $=i=>String(i??"").replace(/[&<>"']/g,e=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[e]);function et(i,e){let t=0;for(let n of i.get(e)?.values()??[])t+=n;return t}function Zn(i){let e=[];for(let[t,n]of i)for(let[s,r]of n)r>0&&e.push({areaId:t,tierId:s,qty:r});return e}function Jn(i){let e=new Map;for(let t of i.keys())e.set(t,et(i,t));return e}function kt(i,e,t,n){let s=i.get(e)??new Map;n>0?s.set(t,n):s.delete(t),s.size?i.set(e,s):i.delete(e)}function es(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 Me(i,e){let t=es(e),n=0;for(let s of i.keys())n+=Math.max(0,et(i,s)-(t.get(s)??0));return n}function ts(i,e,t){let n=es(t),s=0;for(let r of e){let o=i.gaQty.get(r.id);if(!o)continue;let a=n.get(r.id)??0;for(let[l,c]of o){let p=Math.max(0,c-a);a=Math.max(0,a-c),s+=p*i.paidPrice(r.categoryKey,l,il(r,l),r.id)}}return s}function il(i,e){return e?i.tiers?.find(t=>t.id===e)?.price??i.price:i.price}function is(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 s=`${n.objectId}\0${n.tierId??""}`,r=t.get(s);if(r){r.quantity=(r.quantity??0)+(n.quantity??1),r.labels.push(n.label);continue}let o={...n,quantity:n.quantity??1,labels:[n.label]};t.set(s,o),e.push(o)}return e}function ns(i,e,t){let n=new Set(t);for(let s of e)s.objectType==="ga"&&s.objectId&&n.has(s.label)&&kt(i,s.objectId,s.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 nl(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 Yt(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??xe("picker.generalAdmission"),price:i.price}]}function ss(i,e){let t=i.totalTicketCount()-et(i.gaQty,e.id);return Math.max(0,Math.min(e.available,i.maxTickets-t))}function zi(i,e,t,n){if(he(i,!1),i.salesClosed){i.toast(i.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}let s=Yt(e),r=i.gaQty.get(e.id),o=et(i.gaQty,e.id)>0,a=ss(i,e);if(a<=0&&!o){i.toast(e.available>0?xe("picker.maxTicketsForOrder",{count:i.maxTickets}):i.tf("picker.soldOutTitle","Sold out"),"warning");return}if(i.onGAPromptHook){let u={};for(let[f,g]of r??[])u[f??""]=g;if(i.onGAPromptHook({area:e,selected:u,min:0,max:a,tiers:s,confirm:f=>{al(i,e,s,f,a)},cancel:()=>he(i)})===!0)return}let l=new Map;for(let u of s)l.set(u.id,r?.get(u.id)??0);!o&&a>0&&l.set(s[0].id,1);let c={area:e,tiers:s,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=sl(i,c,p),i.root?.appendChild(d),i.gaPromptEl=d,i.gaPromptReturnFocus=n??document.activeElement,p||ll(i,d,t),i.reducedMotion()&&(d.dataset.motion="reduced"),os(i,c),rl(i,d,c),requestAnimationFrame(()=>d.querySelector('[data-ga-step="1"]')?.focus())}function sl(i,e,t){let{area:n,tiers:s}=e,r=s.length>1,o=n.displayLabel??n.label,a=s.map(l=>`<div class="sl-ga-prompt-row" data-ga-tier="${$(l.id??"")}"><div class="sl-ga-prompt-label"><span>${$(r?l.label:i.tf("picker.gaChooseTickets","How many tickets?"))}</span>`+(r?`<small>${$(i.money(i.paidPrice(n.categoryKey,l.id,l.price,n.id)))}</small>`:"")+`</div><div class="sl-ga-stepper" role="group" aria-label="${$(r?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="${$(xe("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="${$(xe("common.close"))}">\xD7</button></div><div class="sl-ga-prompt-body">${a}`+(s.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>${$(xe("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 rs(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 os(i,e){let t=i.gaPromptEl;if(!t)return;let n=ji(e),s=rs(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 r=t.querySelector("[data-ga-sub]");r&&(r.textContent=`${i.money(i.paidPrice(e.area.categoryKey,e.tiers[0].id,e.tiers[0].price,e.area.id))} \xB7 ${De("picker.leftCount",e.area.available)}`);let o=t.querySelector("[data-ga-total]");o&&(o.textContent=i.money(s));let a=t.querySelector("[data-ga-hint]");a&&(a.textContent=n>=e.max&&e.max>0?e.area.available<=e.max?De("picker.leftCount",e.area.available):xe("picker.maxTicketsForOrder",{count:i.maxTickets}):"");let l=t.querySelector("[data-ga-confirm]");l&&(l.textContent=e.reopened?De("picker.gaUpdate",n,{count:n}):De("picker.gaAdd",n,{count:n,price:i.money(s)}),l.disabled=n<=0&&!e.reopened)}function rl(i,e,t){e.querySelectorAll("[data-ga-step]").forEach(n=>{n.addEventListener("click",()=>{let s=n.closest("[data-ga-tier]");if(!s)return;let r=s.dataset.gaTier?s.dataset.gaTier:null,o=Number(n.dataset.gaStep),a=t.draft.get(r)??0,l=t.max-ji(t);t.draft.set(r,Math.max(0,a+(o>0?Math.min(1,l):-1))),os(i,t)})}),e.querySelectorAll("[data-ga-cancel]").forEach(n=>n.addEventListener("click",()=>he(i))),e.querySelector("[data-ga-remove]")?.addEventListener("click",()=>{i.gaQty.delete(t.area.id),he(i),i.syncTray(),Fi(i,xe("picker.gaRemoved",{area:t.area.displayLabel??t.area.label}))}),e.querySelector("[data-ga-confirm]")?.addEventListener("click",()=>{ol(i,t)}),e.addEventListener("mousedown",n=>{n.target===e&&he(i)}),e.addEventListener("keydown",n=>{if(n.key==="Escape"){n.stopPropagation(),he(i);return}if(n.key!=="Tab")return;let s=[...e.querySelectorAll('button:not(:disabled),[tabindex]:not([tabindex="-1"])')];if(!s.length)return;let r=s[0],o=s[s.length-1];n.shiftKey&&document.activeElement===r?(n.preventDefault(),o.focus()):!n.shiftKey&&document.activeElement===o&&(n.preventDefault(),r.focus())})}function ol(i,e){let t=ji(e),n=rs(i,e);for(let r of e.tiers)kt(i.gaQty,e.area.id,r.id,e.draft.get(r.id)??0);he(i),i.syncTray();let s=e.area.displayLabel??e.area.label;t>0?Fi(i,De("picker.gaAdded",t,{count:t,area:s,price:i.money(n)})):Fi(i,xe("picker.gaRemoved",{area:s}))}function al(i,e,t,n,s){if(typeof n=="number")kt(i.gaQty,e.id,t[0].id,Math.max(0,Math.min(s,Math.floor(n))));else{i.gaQty.delete(e.id);let r=s;for(let o of t){let a=Math.max(0,Math.floor(n[o.id??""]??0)),l=Math.min(a,r);r-=l,kt(i.gaQty,e.id,o.id,l)}}i.syncTray()}function he(i,e=!0){let t=i.gaPromptReturnFocus;i.gaPromptEl&&Je(i.gaPromptEl),i.gaPromptEl=null,i.gaPromptReturnFocus=null,e&&t&&requestAnimationFrame(()=>(t.isConnected?t:i.root)?.focus())}function ll(i,e,t){let n=i.root,s=e.querySelector(".sl-ga-pop");if(!n||!s||!t)return;let r=n.getBoundingClientRect(),o=t.x-r.left,a=t.y-r.top;e.style.setProperty("--sl-ga-anchor-x",`${o}px`),e.style.setProperty("--sl-ga-anchor-y",`${a}px`),requestAnimationFrame(()=>{let l=s.offsetWidth||260,c=s.offsetHeight||220,p=Math.max(8,Math.min(r.width-l-8,o-l/2)),d=a-c-14,u=d>=8?d:Math.min(r.height-c-8,a+14);s.style.left=`${p}px`,s.style.top=`${Math.max(8,u)}px`,s.dataset.side=d>=8?"above":"below",s.style.setProperty("--sl-ga-arrow-x",`${Math.max(12,Math.min(l-12,o-p))}px`)})}function Fi(i,e){i.srEl&&(i.srEl.textContent=e)}function as(i,e,t=[]){let n=[],s=nl(t);for(let o of e){let a=i.gaQty.get(o.id);if(!a)continue;let l=Yt(o);for(let c of l){let p=(a.get(c.id)??0)-(s.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 ${$(De("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 r=e.filter(o=>et(i.gaQty,o.id)<=0&&!t.some(a=>a.objectId===o.id));return r.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>${r.length}</small></button>`+(i.gaAreasExpanded?`<div class="sl-ga-areas-list">${r.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?De("picker.leftCount",o.available):i.tf("picker.soldOutTitle","Sold out"))}</span></button>`).join("")}</div>`:"")+"</div>"),n.join("")}function ls(i,e,t){e.querySelectorAll(".sl-ga .sl-ga-qty button").forEach(n=>{n.addEventListener("click",()=>{let s=n.closest(".sl-ga");if(!s?.dataset.ga)return;let r=t.find(c=>c.id===s.dataset.ga);if(!r)return;let o=s.dataset.gaRowTier?s.dataset.gaRowTier:null,a=Number(n.dataset.d),l=i.gaQty.get(r.id)?.get(o)??0;if(a>0&&ss(i,r)-et(i.gaQty,r.id)<=0){i.toast(xe("picker.maxTicketsForOrder",{count:i.maxTickets}),"warning");return}kt(i.gaQty,r.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 s=t.find(r=>r.id===n.dataset.gaOpen);s&&zi(i,s,null,n)})})}var Qt='<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 cl=/^data:image\/(?:png|jpe?g|webp|gif|avif);base64,[a-z0-9+/]+={0,2}$/i,dl=/[\s"'<>`\\]/;function pl(i){return i.startsWith("//")?!1:i.startsWith("/")||i.startsWith("./")||i.startsWith("../")}function hl(){try{let i=typeof location>"u"?"":location.origin;return i&&i!=="null"?i:null}catch{return null}}function tt(i){if(typeof i!="string"||!i||i.length>2e6||i!==i.trim())return!1;if(i.startsWith("data:"))return cl.test(i);if(dl.test(i))return!1;let e=hl();if(pl(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 ul=/^[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]),s=decodeURIComponent(t[2]);return!n||!ul.test(s)?null:{eventKey:n,asset:s}}catch{return null}}function ml(i){try{return/^\/pub\/events\/[^/]+\/assets(?:\/|$)/.test(new URL(i,"https://seatlayer.invalid").pathname)}catch{return!1}}var it=class{constructor(e,t){this.eventKey=e;this.load=t;this.pending=new Map;this.created=new Set;this.disposed=!1}resolve(e){let t=Gi(e);if(!t)return Promise.resolve(ml(e)||!tt(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 s=this.load(this.eventKey,t.asset).then(r=>{let o=URL.createObjectURL(r);return this.disposed?(URL.revokeObjectURL(o),null):(this.created.add(o),o)}).catch(r=>{throw this.pending.delete(e),r});return this.pending.set(e,s),s}dispose(){if(!this.disposed){this.disposed=!0;for(let e of this.created)URL.revokeObjectURL(e);this.created.clear(),this.pending.clear()}}};import{t as rt}from"@seatlayer/core";import{isAuthoredSeatView as Sl,seatViewDisclosure as kl}from"@seatlayer/core/view3d/crossfade/panorama";var cs=`
|
|
147
147
|
/* confirm card: a candidate is not in the tray until Select. Map gestures and
|
|
148
148
|
floating chrome pause while the card owns focus, keeping the camera stable. */
|
|
149
149
|
.sl-picker[data-confirming="true"] .sl-map-host>:not(.sl-confirm){pointer-events:none}
|
|
@@ -267,6 +267,19 @@ import{a as Nn,c as $t,d as Ue,e as Ft,f as ft}from"./chunk-ZE36NABM.js";import{
|
|
|
267
267
|
.sl-confirm-add-t{min-width:0}
|
|
268
268
|
.sl-confirm-add::before{content:'';position:absolute;inset:0;z-index:0;transform:scaleX(0);transform-origin:left center;
|
|
269
269
|
background:color-mix(in srgb,var(--sl-accent-ink) 20%,transparent)}
|
|
270
|
+
/* THE SAME CARD, ASKING THE OPPOSITE QUESTION. A second tap on a seat already
|
|
271
|
+
in the cart raises this card in its remove state, so the primary button has
|
|
272
|
+
to read as destructive without turning the card into a different object \u2014
|
|
273
|
+
the identity, the band, the price and the thumbnail are unchanged.
|
|
274
|
+
|
|
275
|
+
The red is DARKENED against the token: --sl-danger on white measures ~3.6:1,
|
|
276
|
+
and this is 13px bold, which is below the large-text threshold that ratio
|
|
277
|
+
would satisfy. Mixing 12% black takes it past 4.5:1 while still reading as
|
|
278
|
+
the same danger hue everywhere else in the widget uses it. The sweep overlay
|
|
279
|
+
is re-tinted to match, because it is defined against the accent ink. */
|
|
280
|
+
.sl-confirm-removing .sl-confirm-add{
|
|
281
|
+
background:color-mix(in srgb,var(--sl-danger) 88%,#000)!important;color:#fff!important}
|
|
282
|
+
.sl-confirm-removing .sl-confirm-add::before{background:color-mix(in srgb,#fff 20%,transparent)}
|
|
270
283
|
.sl-confirm-add.is-adding{pointer-events:none}
|
|
271
284
|
.sl-confirm-add.is-adding::before{animation:slAddSweep 360ms var(--slm-mo-out) both}
|
|
272
285
|
.sl-confirm-add.is-adding svg{stroke-dasharray:24;animation:slAddCheck 360ms var(--slm-mo-out) both}
|
|
@@ -332,21 +345,46 @@ import{a as Nn,c as $t,d as Ue,e as Ft,f as ft}from"./chunk-ZE36NABM.js";import{
|
|
|
332
345
|
.sl-confirm-row.sl-fit-icon .sl-confirm-cancel{flex:0 0 44px;width:44px;padding:9px 0;font-size:0;
|
|
333
346
|
display:flex;align-items:center;justify-content:center;overflow:hidden}
|
|
334
347
|
.sl-confirm-row.sl-fit-icon .sl-confirm-cancel::before{content:'\u2715';font-size:15px;line-height:1;font-weight:700}
|
|
335
|
-
.sl-picker[data-layout="narrow"] .sl-confirm{left:50%!important;top:auto!important;bottom:14px;width:min(310px,calc(100% - 24px));
|
|
348
|
+
.sl-picker[data-layout="narrow"] .sl-confirm{left:50%!important;top:auto!important;bottom:14px!important;width:min(310px,calc(100% - 24px));
|
|
336
349
|
transform:translateX(-50%);animation:slConfirmMobileIn .24s cubic-bezier(.2,.8,.2,1) both}
|
|
337
|
-
/* THE CARD MUST NEVER COVER THE SEAT IT IS ASKING ABOUT, AND MUST NOT
|
|
338
|
-
|
|
339
|
-
put a 213px card straight over the seat at y=700 \u2014 the buyer was asked
|
|
340
|
-
confirm a seat the confirmation had just hidden. Pinning it to the top of
|
|
350
|
+
/* THE CARD MUST NEVER COVER THE SEAT IT IS ASKING ABOUT, AND MUST NOT MOVE
|
|
351
|
+
AROUND EITHER. The phone card rests on the bottom edge, so a tap low on the
|
|
352
|
+
map put a 213px card straight over the seat at y=700 \u2014 the buyer was asked
|
|
353
|
+
to confirm a seat the confirmation had just hidden. Pinning it to the top of
|
|
341
354
|
the map instead only traded that for a card at the opposite end of the
|
|
342
|
-
screen from the seat it
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
355
|
+
screen from the seat. Letting it HUG the seat fixed both and cost the card
|
|
356
|
+
its resting place: the same tap landed the card at 502px on a top-row seat
|
|
357
|
+
and 383px on a bottom-row one.
|
|
358
|
+
|
|
359
|
+
So the card is ALWAYS this sheet \u2014 the !important on bottom is the point,
|
|
360
|
+
not a workaround: nothing may write an inline offset over it any more \u2014 and
|
|
361
|
+
the MAP moves instead, once, when the card is shown. See
|
|
362
|
+
narrowConfirmPlacement and ConfirmCard.liftSeatClearOfSheet. */
|
|
363
|
+
/* AND THE MAP GOES BEHIND GLASS WHILE IT ASKS. The phone card sits over a map
|
|
364
|
+
that is still fully legible, so the moment of decision competed with every
|
|
365
|
+
other seat on screen. The scrim blurs and darkens the map with a radial
|
|
366
|
+
mask cutting the tapped seat back out \u2014 a spotlight, not a curtain, because
|
|
367
|
+
the buyer is being asked about a seat they must still be able to see.
|
|
368
|
+
|
|
369
|
+
It NEVER takes a pointer event: the card's outside-tap listener reads a
|
|
370
|
+
press over the map underneath, and a scrim that swallowed it would have
|
|
371
|
+
sealed the buyer in. The mask centre is re-cut on every pan and zoom, so it
|
|
372
|
+
is inline (as one custom property, spent on both spellings here). Wide
|
|
373
|
+
layouts never mount it. */
|
|
374
|
+
.sl-picker[data-layout="narrow"] .sl-confirm-scrim{position:absolute;inset:0;z-index:9;pointer-events:none;
|
|
375
|
+
background:rgba(0,0,0,.38);-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);
|
|
376
|
+
-webkit-mask-image:var(--sl-scrim-mask);mask-image:var(--sl-scrim-mask);
|
|
377
|
+
animation:slConfirmScrimIn .2s ease-out both}
|
|
378
|
+
@keyframes slConfirmScrimIn{from{opacity:0}to{opacity:1}}
|
|
379
|
+
/* Reduced TRANSPARENCY is a legibility setting, not a taste: drop the blur and
|
|
380
|
+
keep the dark fill, so the map still recedes without being smeared. */
|
|
381
|
+
@media (prefers-reduced-transparency: reduce){
|
|
382
|
+
.sl-picker[data-layout="narrow"] .sl-confirm-scrim{-webkit-backdrop-filter:none;backdrop-filter:none;
|
|
383
|
+
background:rgba(0,0,0,.5)}
|
|
384
|
+
}
|
|
385
|
+
@media (prefers-reduced-motion: reduce){
|
|
386
|
+
.sl-picker[data-layout="narrow"] .sl-confirm-scrim{animation:none}
|
|
387
|
+
}
|
|
350
388
|
/* THE PHONE CONFIRMATION MUST BE CHECKABLE (owner review 2026-09-01). Packing
|
|
351
389
|
category, section, row and seat into one sentence made every fact compete
|
|
352
390
|
for the same ellipsis \u2014 exactly when the buyer is verifying the tap. Normal
|
|
@@ -483,7 +521,7 @@ import{a as Nn,c as $t,d as Ue,e as Ft,f as ft}from"./chunk-ZE36NABM.js";import{
|
|
|
483
521
|
color:var(--sl-text);font-weight:700;font-size:12px;display:flex;align-items:center;justify-content:center;gap:7px}
|
|
484
522
|
.sl-confirm-view:hover{border-color:var(--sl-muted)}
|
|
485
523
|
.sl-confirm-view svg{width:14px;height:14px;stroke:currentColor;stroke-width:2;fill:none;stroke-linecap:round;stroke-linejoin:round}
|
|
486
|
-
`;var
|
|
524
|
+
`;var ds=`
|
|
487
525
|
/* Test mode is environment context, not an action. The chip flows in the
|
|
488
526
|
top-left anchor region: the old rotated corner ribbon sat at a negative
|
|
489
527
|
offset and was clipped by the widget root's rounded overflow:hidden (its
|
|
@@ -491,15 +529,22 @@ import{a as Nn,c as $t,d as Ue,e as Ft,f as ft}from"./chunk-ZE36NABM.js";import{
|
|
|
491
529
|
same gold as "buy". Amber warning tone, never the accent; the a11y chips
|
|
492
530
|
wrap beside it in the same region, so no displacement hack is needed. */
|
|
493
531
|
.sl-testbadge{display:inline-flex;align-items:center;gap:7px;height:26px;padding:0 10px 0 8px;border-radius:999px;
|
|
494
|
-
font-size:
|
|
495
|
-
color:var(--sl-warn-text);background:color-mix(in srgb,var(--sl-warn)
|
|
496
|
-
border:1px solid color-mix(in srgb,var(--sl-warn)
|
|
532
|
+
font-size:12px;font-weight:700;letter-spacing:.01em;line-height:1;text-transform:none;white-space:nowrap;
|
|
533
|
+
color:var(--sl-warn-text);background:color-mix(in srgb,var(--sl-warn) 18%,var(--sl-surface));
|
|
534
|
+
border:1px solid color-mix(in srgb,var(--sl-warn) 40%,transparent)}
|
|
497
535
|
/* A SOLID PILL, NOT A SHOUT. Tracked-out capitals in a broken outline read as
|
|
498
536
|
a warning sticker slapped over the venue; this is an environment flag, and
|
|
499
537
|
the tone it wants is the one a status dot has. Every colour is mixed from
|
|
500
538
|
--sl-warn, so a host that retones its warning colour retones this with it \u2014
|
|
501
539
|
which is also why the amber survives both themes without a second rule.
|
|
502
|
-
The label's case is decided in TypeScript, not here: see sentenceCaseShout.
|
|
540
|
+
The label's case is decided in TypeScript, not here: see sentenceCaseShout.
|
|
541
|
+
|
|
542
|
+
THE INK IS MEASURED, NOT MIXED. --sl-warn-text used to be a flat 48% of
|
|
543
|
+
the warning hue into the ground ink, written once in the stylesheet; on a
|
|
544
|
+
near-black map that landed around 2.5:1 and read as a dim gold smudge. It is
|
|
545
|
+
now resolved per theme against the real ground and surface, the same way the
|
|
546
|
+
accent's text role is \u2014 see PICKER_WARN in pickerTheme.ts. The stylesheet
|
|
547
|
+
keeps the old mix as the value before any tokens are applied. */
|
|
503
548
|
.sl-testbadge::before{content:'';flex:none;width:7px;height:7px;border-radius:50%;
|
|
504
549
|
background:var(--sl-warn);box-shadow:0 0 0 3px color-mix(in srgb,var(--sl-warn) 22%,transparent)}
|
|
505
550
|
|
|
@@ -715,7 +760,7 @@ import{a as Nn,c as $t,d as Ue,e as Ft,f as ft}from"./chunk-ZE36NABM.js";import{
|
|
|
715
760
|
.sl-pg-switch:hover{border-style:solid;color:var(--sl-text);border-color:var(--sl-accent)}
|
|
716
761
|
@media(prefers-reduced-motion:reduce){.sl-tip{animation:none!important}.sl-tip,.sl-tip-switch,.sl-pg-switch{transition:none!important}}
|
|
717
762
|
@media(max-width:639px){.sl-confirm-group-dates{width:min(340px,calc(100% - 20px))}.sl-confirm-date{min-height:32px}}
|
|
718
|
-
`;var
|
|
763
|
+
`;var ps=`
|
|
719
764
|
/* 3D venue overlay \u2014 mounts over the (paused) Konva stage inside the map host.
|
|
720
765
|
Carries its own gradient so it paints instantly before the scene builds, and
|
|
721
766
|
cross-fades on enter/exit via a compositor-only opacity transition. Sits below
|
|
@@ -1060,7 +1105,7 @@ import{a as Nn,c as $t,d as Ue,e as Ft,f as ft}from"./chunk-ZE36NABM.js";import{
|
|
|
1060
1105
|
.sl-view3d-passport-shell{padding:max(10px,env(safe-area-inset-top)) 10px max(10px,env(safe-area-inset-bottom))}
|
|
1061
1106
|
.sl-view3d-passport{width:100%;max-height:100%;padding:14px 14px max(24px,calc(14px + env(safe-area-inset-bottom)));border-radius:15px}
|
|
1062
1107
|
}
|
|
1063
|
-
`;var
|
|
1108
|
+
`;var hs=`
|
|
1064
1109
|
/* THE PHONE TICKET LIST (owner 2026-08-27: "on mobile the cards take lots of
|
|
1065
1110
|
space, lots of white space on each card"). The desktop card spends ~72px per
|
|
1066
1111
|
ticket on SECTION/ROW/SEAT eyebrows, a category line and a 34px icon rail \u2014
|
|
@@ -1311,9 +1356,16 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default}
|
|
|
1311
1356
|
.sl-picker .sl-fitpill.sl-fit-p2,.sl-picker .sl-fitpill.sl-fit-p3{font-size:11.5px}
|
|
1312
1357
|
.sl-picker .sl-fitpill.sl-fit-p3{white-space:normal;text-align:center;
|
|
1313
1358
|
padding-top:6px;padding-bottom:6px;line-height:1.2}
|
|
1314
|
-
`;var
|
|
1359
|
+
`;var us="seatlayer-picker-style",fl=`
|
|
1315
1360
|
.sl-picker{position:relative;display:flex;flex-direction:column;width:100%;height:100%;min-height:420px;overflow:hidden;
|
|
1316
1361
|
background:var(--sl-bg);color:var(--sl-text);font-family:var(--sl-font);border-radius:var(--sl-radius);
|
|
1362
|
+
/* iOS INFLATES FIXED-PX TYPE IN A HOST LAYOUT IT DECIDES IS TOO NARROW, and
|
|
1363
|
+
the decision is made per page, not per element \u2014 so the same widget in the
|
|
1364
|
+
same build measured different apparent font sizes on two of the client's
|
|
1365
|
+
iPhones. Every size in this sheet is authored in px against a fixed
|
|
1366
|
+
44px-target scale; there is nothing here for the boost to improve, and
|
|
1367
|
+
plenty for it to break. */
|
|
1368
|
+
-webkit-text-size-adjust:100%;text-size-adjust:100%;
|
|
1317
1369
|
--sl-r-sm:calc(var(--sl-radius) * .55);
|
|
1318
1370
|
/* Motion tokens, defined ON the widget root so an embed is self-contained and
|
|
1319
1371
|
never inherits (or fights) the host page's own timing. Values mirror
|
|
@@ -2075,6 +2127,15 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default}
|
|
|
2075
2127
|
.sl-zoom{display:flex;flex-direction:column;gap:6px}
|
|
2076
2128
|
/* CSS-fallback full screen (iOS Safari has no element fullscreen API) */
|
|
2077
2129
|
.sl-picker.sl-fs{position:fixed;inset:0;z-index:2147483000;width:auto;height:auto;max-height:none;border-radius:0}
|
|
2130
|
+
/* A WIDGET THAT IS THE WHOLE VIEWPORT HAS NO CORNERS TO ROUND. The .sl-fs rule above
|
|
2131
|
+
has always squared itself; the other two ways into full screen did not, and
|
|
2132
|
+
the gap the radius cut showed whatever was painted behind the root \u2014 the
|
|
2133
|
+
host page's pinned iframe backdrop, or the UA's black behind a native
|
|
2134
|
+
fullscreen element. On a light theme that read as a black wedge at each
|
|
2135
|
+
bottom corner (owner screenshot; also in the client's phone capture).
|
|
2136
|
+
data-fs is set for all three routes - see syncFullscreenButtons. */
|
|
2137
|
+
.sl-picker[data-fs="true"]{border-radius:0}
|
|
2138
|
+
.sl-picker:fullscreen{border-radius:0}
|
|
2078
2139
|
/* Glass, not solid: these float over the canvas, and an opaque disc parked on
|
|
2079
2140
|
a section name hides inventory. The blur keeps the glyph readable without
|
|
2080
2141
|
taking the label underneath away. */
|
|
@@ -2094,6 +2155,12 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default}
|
|
|
2094
2155
|
padding:0 13px;gap:6px;border-radius:999px;font-size:11px;font-weight:800;
|
|
2095
2156
|
background:var(--sl-surface);border:1px solid var(--sl-line);color:var(--sl-text);transition:border-color .15s}
|
|
2096
2157
|
.sl-fs-pill.sl-fs-pill:hover{border-color:var(--sl-muted)}
|
|
2158
|
+
/* A pill the widget has taken off the map (the picker already fills the phone's
|
|
2159
|
+
viewport, so full screen has nothing to give) must actually go. The rule
|
|
2160
|
+
above is written at doubled specificity to survive host resets, which also
|
|
2161
|
+
beats the UA [hidden] rule \u2014 so the retraction has to be written at least
|
|
2162
|
+
as loudly as the thing it retracts. */
|
|
2163
|
+
[hidden].sl-fs-pill.sl-fs-pill{display:none}
|
|
2097
2164
|
.sl-fs-pill svg{width:14px;height:14px;stroke:currentColor;stroke-width:2;fill:none;stroke-linecap:round;stroke-linejoin:round}
|
|
2098
2165
|
.sl-fs-pill .sl-zfs-lbl{display:inline;letter-spacing:.02em;white-space:nowrap}
|
|
2099
2166
|
/* In the header, icons carry it (owner call): square Full screen glyph. The
|
|
@@ -2481,32 +2548,6 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default}
|
|
|
2481
2548
|
.sl-seccard.mini.on{display:inline-flex;align-items:center;gap:7px}
|
|
2482
2549
|
.sl-seccard.mini .sl-seccard-name{font-size:12px;flex:none;max-width:120px}
|
|
2483
2550
|
.sl-seccard.mini .sl-seccard-left{font-size:11px}
|
|
2484
|
-
/* narrow: the LOCATOR \u2014 pinned to the map's own bottom edge.
|
|
2485
|
-
It used to dock into the sheet head, which put it on the same edge as the
|
|
2486
|
-
cart; the fix for that collision was to delete it once the cart filled, which
|
|
2487
|
-
took the answer away from the buyer most likely to want it. On the map it
|
|
2488
|
-
competes with nothing and never has to be suppressed. */
|
|
2489
|
-
.sl-seccard.strip{position:absolute;left:50%;transform:translateX(-50%);bottom:12px;z-index:6;
|
|
2490
|
-
width:auto;max-width:calc(100% - 24px);padding:6px 8px 6px 12px;border-radius:999px;
|
|
2491
|
-
border:1px solid var(--sl-line);background:var(--sl-surface);color:var(--sl-text);
|
|
2492
|
-
box-shadow:0 12px 30px -12px rgba(0,0,0,.55);cursor:default}
|
|
2493
|
-
.sl-seccard.strip.on{display:flex;align-items:center;gap:7px;font-size:12.5px}
|
|
2494
|
-
.sl-seccard.strip .sl-seccard-name{font-size:12.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1 1 auto;min-width:0}
|
|
2495
|
-
/* The name is the answer ("where am I"); the count is the detail. A plain
|
|
2496
|
-
"flex:0 1" on the count was not enough - the two shrank in PROPORTION, so at 360px the
|
|
2497
|
-
name sat on its floor while the count still held 55px of a row that had none
|
|
2498
|
-
to spare. A dominant shrink factor makes the count collapse first, and the
|
|
2499
|
-
measured fit pass below then swaps or drops it before it can clip. */
|
|
2500
|
-
.sl-seccard.strip .sl-seccard-left{flex:0 200 auto;min-width:0;white-space:nowrap;overflow:hidden}
|
|
2501
|
-
/* The count is measured after it mounts and swapped for a short form, or
|
|
2502
|
-
dropped, before it is allowed to clip \u2014 so it never needs an ellipsis, and
|
|
2503
|
-
must never be laid out (or announced) while hidden. */
|
|
2504
|
-
.sl-seccard.strip .sl-seccard-left[hidden]{display:none}
|
|
2505
|
-
/* The confirm card is bottom-anchored on narrow and owns this edge while it is
|
|
2506
|
-
open; 3D has no 2D section context to report. */
|
|
2507
|
-
.sl-picker[data-layout="narrow"][data-confirming="true"] .sl-seccard.strip,
|
|
2508
|
-
.sl-picker[data-view3d="on"] .sl-seccard.strip{display:none}
|
|
2509
|
-
.sl-seccard.strip .sl-seccard-price{margin-left:auto}
|
|
2510
2551
|
.sl-seccard-head{display:flex;align-items:center;gap:8px}
|
|
2511
2552
|
.sl-seccard-dot{width:10px;height:10px;border-radius:50%;flex:none}
|
|
2512
2553
|
.sl-seccard-name{font-weight:800;font-size:14px;flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
|
@@ -2527,48 +2568,8 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default}
|
|
|
2527
2568
|
.sl-seccard-nav button{width:28px;height:28px;border:1px solid var(--sl-line);border-radius:999px;color:var(--sl-text);
|
|
2528
2569
|
background:color-mix(in srgb,var(--sl-surface) 88%,var(--sl-bg));font-size:14px;font-weight:850;line-height:1}
|
|
2529
2570
|
.sl-seccard-nav button:hover,.sl-seccard-nav button:focus-visible{border-color:var(--sl-accent);color:var(--sl-accent-text)}
|
|
2530
|
-
.sl-seccard.mini .sl-seccard-nav
|
|
2571
|
+
.sl-seccard.mini .sl-seccard-nav{margin-left:2px}
|
|
2531
2572
|
.sl-seccard.mini .sl-seccard-nav button{width:24px;height:24px;font-size:12px}
|
|
2532
|
-
/* Phone strip: every control is a finger target (\u226540px box, 44px row) and the
|
|
2533
|
-
exit is a labelled "\u2039 Venue" chip \u2014 one tap in, one tap out. */
|
|
2534
|
-
.sl-seccard.strip{padding:4px 4px 4px 12px;min-height:44px}
|
|
2535
|
-
/* ...and on a phone it is a DOCK BAR, not a floating pill. The pill's rounded
|
|
2536
|
-
ends and centred max-width spent ~40px of a 390px row on nothing, so the
|
|
2537
|
-
name truncated to "Grand C\u2026" while the pill itself sat on top of the map's
|
|
2538
|
-
own corner controls \u2014 a second rounded edge showing through behind it. A bar
|
|
2539
|
-
that owns the bottom edge outright spends every pixel on the answer, and the
|
|
2540
|
-
corner controls lift above it rather than fighting it. */
|
|
2541
|
-
.sl-picker[data-layout="narrow"] .sl-seccard.strip{
|
|
2542
|
-
left:0;right:0;bottom:0;transform:none;width:auto;max-width:none;
|
|
2543
|
-
border-radius:0;border-width:1px 0 0 0;min-height:52px;
|
|
2544
|
-
padding:0 8px 0 14px;padding-bottom:var(--sl-safe-b);
|
|
2545
|
-
/* Opaque: seats scrolling under a translucent dock read as a rendering bug. */
|
|
2546
|
-
background:var(--sl-surface);box-shadow:0 -10px 26px -20px rgba(0,0,0,.7)}
|
|
2547
|
-
/* Total height of the dock, including the home-indicator inset it absorbs. */
|
|
2548
|
-
.sl-picker[data-layout="narrow"]{--sl-locator-h:calc(52px + var(--sl-safe-b))}
|
|
2549
|
-
/* Every absolutely-positioned bottom control on the map moves as one \u2014 the
|
|
2550
|
-
regions are the only lever that reaches all of them, which is what they are
|
|
2551
|
-
for. Skipped while the confirm card or 3D has taken the strip away. */
|
|
2552
|
-
.sl-picker[data-layout="narrow"][data-locator="true"]:not([data-confirming="true"]):not([data-view3d="on"])
|
|
2553
|
-
.sl-anchor[data-region="bottom-left"],
|
|
2554
|
-
.sl-picker[data-layout="narrow"][data-locator="true"]:not([data-confirming="true"]):not([data-view3d="on"])
|
|
2555
|
-
.sl-anchor[data-region="bottom-right"]{bottom:calc(12px + var(--sl-locator-h))}
|
|
2556
|
-
.sl-picker[data-layout="narrow"][data-locator="true"]:not([data-confirming="true"]):not([data-view3d="on"])
|
|
2557
|
-
.sl-anchor[data-region="bottom-center"]{bottom:calc(14px + var(--sl-locator-h))}
|
|
2558
|
-
.sl-seccard.strip .sl-seccard-nav{gap:2px}
|
|
2559
|
-
.sl-seccard.strip .sl-seccard-nav button{width:34px;height:36px;font-size:15px}
|
|
2560
|
-
/* The accent ink is computed to clear 4.5:1 against the SURFACE (see
|
|
2561
|
-
readableAccentText). Tinting the chip's ground 12% toward the accent moved it
|
|
2562
|
-
off that guarantee and measured 4.2:1 on a light map theme. The ground is the
|
|
2563
|
-
plain surface again and the accent identity lives in the ink and the border,
|
|
2564
|
-
which is where a chip's identity belongs anyway. */
|
|
2565
|
-
.sl-seccard-back{width:auto;height:36px;padding:0 10px 0 6px;flex:none;margin-left:2px;border-radius:999px;
|
|
2566
|
-
display:inline-flex;align-items:center;gap:2px;font-size:12.5px;font-weight:800;color:var(--sl-accent-text);
|
|
2567
|
-
background:var(--sl-surface);border:1px solid color-mix(in srgb,var(--sl-accent) 55%,var(--sl-line))}
|
|
2568
|
-
.sl-seccard-back:active{transform:scale(.96)}
|
|
2569
|
-
.sl-seccard-back-chev{font-size:18px;line-height:1;margin-top:-2px}
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
2573
|
/* commercial seat flags \u2014 limited-view caution + premium tag. Amber tone,
|
|
2573
2574
|
deliberately distinct from the red taken/held state; shown on the confirm
|
|
2574
2575
|
card, echoed as a small \u25D0 marker on cart chips and the hover tip. */
|
|
@@ -2664,36 +2665,74 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default}
|
|
|
2664
2665
|
@keyframes slCopyRise{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}
|
|
2665
2666
|
@keyframes slConfirmMobileIn{from{opacity:0;transform:translate(-50%,10px) scale(.97)}to{opacity:1;transform:translate(-50%,0) scale(1)}}
|
|
2666
2667
|
|
|
2667
|
-
/*
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
the
|
|
2671
|
-
.
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
.
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
.
|
|
2683
|
-
.
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2668
|
+
/* ONE SHAPE FOR BOTH INTERRUPTIONS.
|
|
2669
|
+
The picker has exactly two moments where it has to stop the buyer and say
|
|
2670
|
+
something before they can go on: the hold ran out, and the seat session
|
|
2671
|
+
ended. They are the same shape of moment \u2014 something ended, here is the one
|
|
2672
|
+
way on \u2014 so they are one style block. Two blocks drifted apart once already
|
|
2673
|
+
and read as two different products.
|
|
2674
|
+
|
|
2675
|
+
THE MAP STAYS VISIBLE. This used to be a near-opaque veil with a 6px blur:
|
|
2676
|
+
the venue behind it went to mush, which made a recoverable pause look like a
|
|
2677
|
+
crashed widget. A buyer needs to see that their seat map is still there and
|
|
2678
|
+
still theirs to come back to, so the veil is a plain 35% neutral over a map
|
|
2679
|
+
that keeps loading and painting underneath, and there is no backdrop filter
|
|
2680
|
+
at all (owner reference, 2026-09-04).
|
|
2681
|
+
|
|
2682
|
+
The veil fades in 160ms \u2014 quick enough not to be a transition the buyer
|
|
2683
|
+
waits through, slow enough not to read as a flash. Reduced motion caps it
|
|
2684
|
+
from the motion sheet, which is appended after this one.
|
|
2685
|
+
|
|
2686
|
+
SYMMETRY IS ARITHMETIC HERE, NOT A NUDGE. The veil pads its host by exactly
|
|
2687
|
+
16px on all four sides; the card is min(420px, 100%) of the resulting
|
|
2688
|
+
content box with border-box sizing, so its side insets are 16px on any width
|
|
2689
|
+
under 452px and evenly split above it. A padding that grows with the
|
|
2690
|
+
viewport cannot also be a fixed 16px, and this contract is the fixed one. */
|
|
2691
|
+
.sl-interrupt{position:absolute;inset:0;z-index:20;display:grid;place-items:center;box-sizing:border-box;
|
|
2692
|
+
padding:16px;background:color-mix(in srgb,var(--sl-scrim-ink) 35%,transparent);
|
|
2693
|
+
animation:slAccessVeilIn 160ms ease-out both}
|
|
2694
|
+
/* Left-aligned, not centred: these cards carry a sentence and a fact, and
|
|
2695
|
+
centred body copy makes both harder to scan. It can never be taller than the
|
|
2696
|
+
surface it covers \u2014 a 320x568 phone with a long section name scrolls the
|
|
2697
|
+
card rather than clipping its button. */
|
|
2698
|
+
.sl-interrupt-card{box-sizing:border-box;width:min(420px,100%);justify-self:center;padding:24px;
|
|
2699
|
+
text-align:left;border-radius:15px;background:var(--sl-surface);color:var(--sl-text);
|
|
2700
|
+
border:1px solid var(--sl-line);box-shadow:0 24px 64px -18px rgba(0,0,0,.72);
|
|
2701
|
+
max-height:100%;overflow-y:auto;animation:slAccessCardIn .42s var(--slm-mo-out) both}
|
|
2702
|
+
.sl-interrupt-title{font-size:20px;font-weight:700;line-height:1.25;letter-spacing:-.015em;
|
|
2703
|
+
display:flex;align-items:baseline;gap:8px}
|
|
2704
|
+
/* A stopped clock, not a warning triangle: nothing went wrong, time ran out.
|
|
2705
|
+
Inline at text size \u2014 the 52px accent disc it replaces gave a recoverable
|
|
2706
|
+
pause the weight of an error state. */
|
|
2707
|
+
.sl-interrupt-glyph{font-size:20px;line-height:1;flex:none}
|
|
2708
|
+
.sl-interrupt-body{font-size:14px;line-height:1.55;color:var(--sl-muted);margin-top:8px}
|
|
2709
|
+
/* The one line that is FACT rather than explanation \u2014 what was actually
|
|
2710
|
+
released \u2014 carries the body's size in the text colour, so the buyer's eye
|
|
2711
|
+
lands on it without it shouting. */
|
|
2712
|
+
.sl-interrupt-fact{color:var(--sl-text);font-weight:700}
|
|
2713
|
+
.sl-interrupt-actions{display:flex;justify-content:flex-end;margin-top:20px}
|
|
2714
|
+
.sl-picker .sl-interrupt-act{min-height:44px;padding:11px 20px;border-radius:999px;font-size:14px;
|
|
2715
|
+
font-weight:700;display:inline-flex;align-items:center;justify-content:center;gap:8px;
|
|
2687
2716
|
background:var(--sl-accent);color:var(--sl-accent-ink);box-shadow:0 10px 28px -14px var(--sl-accent);
|
|
2688
2717
|
transition:transform .15s ease,filter .15s ease,box-shadow .2s ease}
|
|
2689
|
-
.sl-picker .sl-
|
|
2690
|
-
.sl-picker .sl-
|
|
2691
|
-
.sl-picker .sl-
|
|
2692
|
-
.sl-
|
|
2693
|
-
.sl-
|
|
2718
|
+
.sl-picker .sl-interrupt-act:hover{filter:brightness(1.06);box-shadow:0 14px 32px -14px var(--sl-accent)}
|
|
2719
|
+
.sl-picker .sl-interrupt-act:active{transform:translateY(1px) scale(.985)}
|
|
2720
|
+
.sl-picker .sl-interrupt-act:disabled{cursor:wait;opacity:.78}
|
|
2721
|
+
.sl-picker .sl-interrupt-act:focus-visible{outline:2px solid var(--sl-accent-text);outline-offset:2px}
|
|
2722
|
+
.sl-interrupt-act-icon{display:inline-block;font-size:16px;line-height:1}
|
|
2723
|
+
.sl-interrupt.is-reloading .sl-interrupt-act-icon{animation:slAccessSpin .72s linear infinite}
|
|
2724
|
+
/* A phone gives the action the whole card: it is the only thing to do here,
|
|
2725
|
+
and a right-aligned pill on a 320px card wastes the one row that matters. */
|
|
2726
|
+
.sl-picker[data-layout="narrow"] .sl-interrupt-card{padding:20px}
|
|
2727
|
+
.sl-picker[data-layout="narrow"] .sl-interrupt-title{font-size:18px}
|
|
2728
|
+
.sl-picker[data-layout="narrow"] .sl-interrupt-glyph{font-size:18px}
|
|
2729
|
+
.sl-picker[data-layout="narrow"] .sl-interrupt-actions{display:block}
|
|
2730
|
+
.sl-picker[data-layout="narrow"] .sl-interrupt-act{width:100%}
|
|
2731
|
+
/* The hold dialog sits above the access one: a hold can lapse while the access
|
|
2732
|
+
screen is up, and the hold is the more specific thing to say. */
|
|
2733
|
+
.sl-hold-expired{z-index:21}
|
|
2694
2734
|
@keyframes slAccessVeilIn{from{opacity:0}to{opacity:1}}
|
|
2695
2735
|
@keyframes slAccessCardIn{from{opacity:0;transform:translateY(14px) scale(.96)}to{opacity:1;transform:none}}
|
|
2696
|
-
@keyframes slAccessIconIn{from{opacity:0;transform:rotate(-100deg) scale(.72)}to{opacity:1;transform:none}}
|
|
2697
2736
|
@keyframes slAccessSpin{to{transform:rotate(360deg)}}
|
|
2698
2737
|
/* The collapsed sheet's one-liner reacting to a seat landing in the cart. The
|
|
2699
2738
|
global reduced-motion block above already neutralises it. */
|
|
@@ -2705,7 +2744,7 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default}
|
|
|
2705
2744
|
.sl-picker *,.sl-modal-scrim *{animation-duration:.001ms!important;animation-iteration-count:1!important;
|
|
2706
2745
|
transition-duration:.001ms!important;scroll-behavior:auto!important}
|
|
2707
2746
|
.sl-view,.sl-view3d{animation:none!important;transition:none!important}
|
|
2708
|
-
.sl-
|
|
2747
|
+
.sl-interrupt,.sl-interrupt-card,.sl-interrupt-act-icon{animation:none!important;opacity:1;transform:none}
|
|
2709
2748
|
}
|
|
2710
2749
|
.sl-ba [data-ba-zone]{grid-column:1/-1;width:100%}
|
|
2711
2750
|
|
|
@@ -2734,25 +2773,21 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default}
|
|
|
2734
2773
|
.sl-picker[data-theme="light"] .sl-rc[aria-pressed="true"] .sl-rc-dot{
|
|
2735
2774
|
box-shadow:0 0 0 1.5px var(--sl-accent-ink)}
|
|
2736
2775
|
|
|
2737
|
-
/* The phone's dock bar sits ON the map. Against a dark canvas its own surface
|
|
2738
|
-
is the contrast, and a downward shadow is all it needs. Against a WHITE map
|
|
2739
|
-
a white bar with a hairline top border has nothing separating it from the
|
|
2740
|
-
venue behind it \u2014 the strip stops reading as a plate and starts reading as
|
|
2741
|
-
the bottom of the page. It gets a real shadow and a visible line. */
|
|
2742
|
-
.sl-picker[data-theme="light"][data-layout="narrow"] .sl-seccard.strip{
|
|
2743
|
-
box-shadow:0 6px 20px -12px rgba(0,0,0,.35),0 -6px 20px -12px rgba(0,0,0,.35);
|
|
2744
|
-
border-top-color:color-mix(in srgb,var(--sl-text) 12%,transparent)}
|
|
2745
|
-
|
|
2746
2776
|
/* modal host */
|
|
2747
2777
|
.sl-modal-scrim{position:fixed;inset:0;z-index:2147483000;background:rgba(5,7,12,.66);display:flex;align-items:center;justify-content:center;padding:18px}
|
|
2748
|
-
|
|
2778
|
+
/* The frame clips to its own radius and the picker inside is squared against
|
|
2779
|
+
it, so nothing of the scrim shows at the corners. It still carries a ground
|
|
2780
|
+
of its own for the moment before the picker has painted \u2014 the picker's, via
|
|
2781
|
+
the boot tokens on the root, never a fixed dark hex. */
|
|
2782
|
+
.sl-modal-frame{width:min(1200px,100%);height:min(820px,100%);border-radius:16px;overflow:hidden;
|
|
2783
|
+
background:var(--sl-bg,transparent);box-shadow:0 40px 120px -30px rgba(0,0,0,.8)}
|
|
2749
2784
|
/* The frame already clips to 16px. A picker rounding itself to --sl-radius
|
|
2750
2785
|
(14px) inside it leaves a sliver of scrim showing at each corner, which
|
|
2751
2786
|
reads as a rendering fault rather than as a rounded card. One owner of the
|
|
2752
2787
|
corners, and it is the frame. */
|
|
2753
2788
|
.sl-modal-frame > .sl-picker{border-radius:0}
|
|
2754
2789
|
@media(max-width:640px){.sl-modal-scrim{padding:0}.sl-modal-frame{width:100%;height:100%;border-radius:0}}
|
|
2755
|
-
`;function et(){if(document.getElementById(ms))return;let n=document.createElement("style");n.id=ms,n.textContent=ya+ds+us+hs+ps+Wn,document.head.appendChild(n)}import{t as wa}from"@seatlayer/core";import{cdnAssetUrl as xa}from"@seatlayer/core/core/cdnAsset";import{SEATLAYER_MODULE_URL as Zd}from"@seatlayer/core/core/cdnAsset";function v(n,e){let t=wa(n);return t===n?e:t}function it(){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 fs(n,e){let t=e?n.toLocaleUpperCase(e):n.toLocaleUpperCase(),i=e?n.toLocaleLowerCase(e):n.toLocaleLowerCase();if(n!==t||t===i)return n;let s=[...i][0]??"";return(e?s.toLocaleUpperCase(e):s.toLocaleUpperCase())+i.slice(s.length)}function gs(n){if(typeof n=="string"){let e=document.querySelector(n);if(!e)throw new Error(`seatmap: container "${n}" not found`);return e}if(!(n instanceof HTMLElement))throw new Error("seatmap: container must be a CSS selector or an HTMLElement");return n}function R(n){return String(n??"").replace(/[&<>"']/g,e=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[e])}function bs(n,e,t){let i=e.find(r=>Ze(r))??null;if(n.replaceChildren(),!i)return n.textContent=t.slice(0,1).toUpperCase(),null;let s=document.createElement("img");return s.alt="",s.referrerPolicy="no-referrer",s.src=i,n.appendChild(s),i}var tt=null;function Xt(){if(tt!==null)return tt;try{if(typeof document>"u")return tt=!1;tt=!!document.createElement("canvas").getContext("webgl2")}catch{tt=!1}return tt}function Gi(n){return xa(n)}var St=null;function Tt(){return St||(St=(typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?import(Gi("seatlayer-view3d.mjs")):import("@seatlayer/core/view3d")).catch(e=>{throw St=null,e}),St)}function Zt(){(typeof navigator>"u"?void 0:navigator.connection)?.saveData||Tt().catch(()=>{})}async function Jt(){return typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?import(Gi("seatlayer-panorama.mjs")):import("@seatlayer/core")}async function vs(){return typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?import(Gi("seatlayer-checkout.mjs")):import("./hostedCheckout-W7QZWSOQ.js")}function ys(n){return n==="unavailable_for_event"||n==="payments_off_for_event"?n:"not_configured"}function ei(n,e,t){let i={month:"short",day:"numeric",hour:"numeric",minute:"2-digit"},s=new Date(n);if(e)try{return s.toLocaleString(t,{...i,timeZone:e})}catch{}return s.toLocaleString(t,i)}async function ti(n,e){let t=n.overlay.productionElements;if(!t?.some(s=>s.contentImageUrl))return n;let i=await Promise.all(t.map(async s=>{if(!s.contentImageUrl)return s;try{let r=await e(s.contentImageUrl);if(!r){let{contentImageUrl:o,...a}=s;return a}return{...s,runtimeContentImageUrl:r}}catch{let{contentImageUrl:r,...o}=s;return o}}));return{...n,overlay:{...n.overlay,productionElements:i}}}async function ii(n,e){if(n)try{let t=await e(n);return t?await(await fetch(t)).arrayBuffer():void 0}catch{return}}import{browserPanoramaConstraints as ka,loadPanoramaImage as Sa,planPanoramaDelivery as Ta,schedulePanoramaUpgrade as Ca}from"@seatlayer/core/view/panoramaDelivery";function ni(n){let{root:e,source:t,caption:i,real:s,closeLabel:r,dragHint:o,viewFromSeatLabel:a,real360Label:l,previewLabel:c,resolveAsset:d,onClose:p}=n,u=n.chrome??{},h=document.createElement("div");h.className="sl-view sl-mo-zoom",h.setAttribute("role","dialog"),h.setAttribute("aria-label",a),h.innerHTML='<div class="sl-view-head"><span class="sl-view-title"></span><span class="sl-view-cap"></span><button type="button" class="sl-view-x"><svg viewBox="0 0 24 24"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg></button></div><div class="sl-view-pano"><span class="sl-view-badge"></span><span class="sl-view-hint"></span></div>';let g=N=>h.querySelector(N)?.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=i,h.querySelector(".sl-view-x").setAttribute("aria-label",r),u.badge===!1?g(".sl-view-badge"):h.querySelector(".sl-view-badge").textContent=s?l:c,h.querySelector(".sl-view-hint").textContent=o,e.appendChild(h);let m=h.querySelector(".sl-view-pano"),y=Ta(t,ka()),k=new AbortController;m.style.backgroundImage=`url(${JSON.stringify(y.initialUrl)})`;let w=()=>{};y.upgradeUrl&&(w=Ca(()=>{d(y.upgradeUrl).then(N=>!N||k.signal.aborted?null:Sa(N,k.signal).then(()=>N)).then(N=>{!N||!h.isConnected||k.signal.aborted||(m.style.backgroundImage=`url(${JSON.stringify(N)})`)}).catch(()=>{})}));let T=70,b=35,A=1,S=m.clientHeight||1,L=m.clientWidth||1,I=-(S*(180/T)*2/2-L/2),P=0,H=()=>{let N=m.clientHeight||1,Ri=N*(180/T)*A,Dn=Math.max(0,Ri-N),Bn=Math.min(Dn/2,b/180*Ri);P=Math.min(Bn,Math.max(-Bn,P)),m.style.backgroundSize=`auto ${Ri}px`,m.style.backgroundPosition=`${I}px ${P-Dn/2}px`};H();let B=!1,F=0,te=0,ne=N=>{B=!0,F=N.clientX,te=N.clientY,m.classList.add("drag"),m.setPointerCapture?.(N.pointerId)},W=N=>{B&&(I+=N.clientX-F,P+=N.clientY-te,F=N.clientX,te=N.clientY,H())},Nt=N=>{B=!1,m.classList.remove("drag"),m.releasePointerCapture?.(N.pointerId)},In=N=>{N.preventDefault(),A=Math.min(2.4,Math.max(1,A+(N.deltaY<0?.12:-.12))),H()};m.addEventListener("pointerdown",ne),m.addEventListener("pointermove",W),m.addEventListener("pointerup",Nt),m.addEventListener("pointercancel",Nt),m.addEventListener("wheel",In,{passive:!1});let Oi=h.querySelector(".sl-view-x");Oi.addEventListener("click",p);let _n=N=>{N.key==="Escape"&&(N.stopPropagation(),p())};return h.addEventListener("keydown",_n),Oi.focus(),{element:h,dispose(){w(),k.abort(),m.removeEventListener("pointerdown",ne),m.removeEventListener("pointermove",W),m.removeEventListener("pointerup",Nt),m.removeEventListener("pointercancel",Nt),m.removeEventListener("wheel",In),h.removeEventListener("keydown",_n),Oi.removeEventListener("click",p)}}}function Pa(n,e){if(!e)return{targetSeatId:null,previousSeatId:null,nextSeatId:null};let t=n.find(r=>r.id===e);if(!t?.rowId)return{targetSeatId:e,previousSeatId:null,nextSeatId:null};let i=n.filter(r=>r.rowId===t.rowId),s=i.findIndex(r=>r.id===e);return{targetSeatId:e,previousSeatId:s>0?i[s-1].id:null,nextSeatId:s>=0&&s+1<i.length?i[s+1].id:null}}var ws=6e4,si=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 Pa(this.options.seats(),this.targetSeatId_)}get navigationMode(){return this.navigationMode_}canOffer3D(){return this.options.enable3D?this.handle&&this.overlay?!0:!this.options.doc()||!Xt()?!1:this.options.seats().length<=this.max3DSeats():!1}canOfferSeatView(){return this.options.enableSeatView?this.options.seats().some(e=>!!e.viewUrl)?!0:this.hasStage():!1}async setBuyerView(e,t={}){if(e==="map"){this.exit3D();return}if(!this.canOffer3D())throw new Error("venue_3d_unavailable");if(this.buyerView_==="venue3d"&&this.handle){t.flyToSeatId?(this.targetSeatId_=t.flyToSeatId,this.focusedSectionId_=this.findSeat(t.flyToSeatId)?.sectionId??null,this.options.onViewChange(this.buyerView_,this.targetSeatId_),await this.handle.flyToSeat(t.flyToSeatId)):t.resetView&&this.handle.focusOverview();return}if(this.handle&&this.overlay){await this.restore3D(t);return}await this.enter3D(t.flyToSeatId)}async openSeatView(e){if(!this.canOfferSeatView())throw new Error("seat_view_unavailable");let t=this.findSeat(e),i=this.options.host(),s=this.options.doc();if(!t||!i||!s)throw new Error("seat_view_unavailable");let r=++this.seatViewGeneration,o,a,l=!1;if(t.viewUrl){let g=t.viewMeta?.previewUrl,m=!!g&&g!==t.viewUrl,y=m?await this.options.resolveAsset(g):null,k=m?t.viewUrl:await this.options.resolveAsset(t.viewUrl);if(r!==this.seatViewGeneration||!k||m&&!y)return;o={url:k,...y?{previewUrl:y}:{},...m?{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=Aa(o),l=Ea(o)}else{if(!this.hasStage())throw new Error("seat_view_unavailable");let{generateSeatPanorama:g}=await Jt();if(r!==this.seatViewGeneration)return;let m=s.floors?.find(w=>w.objects.some(T=>T.type==="row"&&T.id===t.rowId)),y=t.focalPoint??m?.focalPoint??s.focalPoint,k=g(t,y,[...this.options.seats()]);o={url:k.url,generated:!0},a=nt("picker.illustrationCaption",{m:k.distanceM})}if(r!==this.seatViewGeneration)return;this.closeSeatView(!1),this.prepareHostTheme(i,s),et();let c=this.options.chrome??{},d=it(),p=nt("picker.viewFromSeat",{label:t.displayLabel||t.label}),u=l?nt("picker.real360"):nt("picker.preview"),h=ni({root:i,source:o,caption:a,real:l,closeLabel:v("picker.close","Close"),dragHint:d,viewFromSeatLabel:p,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:p,caption:a,badge:u,real:l,generated:!!o.generated,dragHint:d})}pushLiveState(){this.handle&&(this.handle.setAvailability(this.options.seats().map(e=>({seatId:e.id,state:this.seatState(e)}))),this.handle.setSelection(this.options.selection().map(e=>e.id)))}focusOverview(){return this.buyerView_!=="venue3d"||!this.handle?!1:(this.handle.focusOverview(),!0)}focusSection(e){return this.buyerView_==="venue3d"?this.handle?.focusSection(e)??!1:!1}focusFloor(e){let t=this.options.doc();if(this.buyerView_!=="venue3d"||!this.handle||!t?.floors?.length)return!1;let i=t.floors.findIndex(s=>s.id===e);return i>=0&&this.handle.focusFloor(i)}zoomIn(){return this.buyerView_!=="venue3d"||!this.handle?!1:(this.handle.zoomIn(),!0)}zoomOut(){return this.buyerView_!=="venue3d"||!this.handle?!1:(this.handle.zoomOut(),!0)}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)?ws/2:ws}async enter3D(e){let t=this.options.host(),i=this.options.doc();if(!t||!i||this.overlay)throw new Error("venue_3d_unavailable");et(),this.prepareHostTheme(t,i);let s=document.createElement("div");s.className="sl-view3d",s.setAttribute("role","group"),s.setAttribute("aria-label",v("picker.interactive3dVenueView","Interactive 3D venue view")),Object.assign(s.style,{position:"absolute",inset:"0",zIndex:"4",opacity:"0",touchAction:"none",transition:this.reducedMotion()?"none":"opacity 260ms cubic-bezier(.2,.8,.2,1)",background:"radial-gradient(120% 120% at 50% 0%,#191f28 0%,#0d1014 70%)"});let r=document.createElement("div");r.className="sl-view3d-loading",r.setAttribute("role","status"),r.setAttribute("aria-live","polite"),r.textContent=v("picker.loading3d","Building the 3D venue\u2026"),s.appendChild(r),t.appendChild(s),this.overlay=s;let o=++this.generation;if(this.reducedMotion()?s.style.opacity="1":requestAnimationFrame(()=>{s.style.opacity="1"}),await this.nextPaint(),!(o!==this.generation||this.overlay!==s))try{let[a,l]=await Promise.all([Tt(),this.options.loadEventConfiguration()]),c=l?await ti(l,this.options.resolveAsset):null,d=await ii(i.theme?.venue3d?.shellAssetUrl,this.options.resolveAsset);if(o!==this.generation||this.overlay!==s)return;let p={doc:i,seats:[...this.options.seats()],...c?{eventConfigurationId:c.id,eventConfiguration:c}:{},...d?{registeredShellGlb:d}:{}};r.textContent=v("picker.building3d","Building venue geometry\u2026");let u=await a.prepareVenue3D(p);if(o!==this.generation||this.overlay!==s)return;let h=this.options.chrome??{},g=a.mountVenue3D(s,{...p,prepared:u},{portraitOverviewCrop:!0,arriveAtSeatEye:!0,lookAroundHint:it(),...h.view3dCaption===!1||h.view3dSeatStepper===!1||h.view3dControlDock===!1?{chrome:{caption:h.view3dCaption!==!1,seatStepper:h.view3dSeatStepper!==!1,controlDock:h.view3dControlDock!==!1}}:{},seatViewActionLabel:m=>this.findSeat(m)?.viewUrl?v("picker.openAuthored360","Open venue 360\xB0"):v("picker.lookAroundLive3d","Look around in live 3D"),onSeatPick:m=>this.toggleSeat(m),onSeatInspect:m=>this.toggleSeat(m),onViewTargetChange:m=>{this.targetSeatId_=m,m&&(this.focusedSectionId_=this.findSeat(m)?.sectionId??null),this.options.onViewChange("venue3d",m)},onSectionFocusChange:m=>{this.focusedSectionId_=m,this.options.onViewChange("venue3d",this.targetSeatId_)},...this.options.enableSeatView?{getSeatView:m=>this.seatViewFor3D(m)}:{}});if(o!==this.generation||this.overlay!==s){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(()=>r.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 i=this.handle,s=this.overlay;if(this.options.restoreMap(),t&&i&&s){s.style.pointerEvents="none";let r=()=>{this.buyerView_!=="map"||this.overlay!==s||(s.style.visibility="hidden",this.options.restoreMap())};!e||this.reducedMotion()?(s.style.opacity="0",r()):(requestAnimationFrame(()=>{s.style.opacity="0"}),setTimeout(r,280));return}if(this.handle=null,this.overlay=null,!s){try{i?.dispose()}catch{}this.options.restoreMap();return}if(!e||this.reducedMotion()){try{i?.dispose()}catch{}s.remove(),this.options.restoreMap();return}s.style.pointerEvents="none",requestAnimationFrame(()=>{s.style.opacity="0"}),setTimeout(()=>{try{i?.dispose()}catch{}s.remove(),this.options.restoreMap()},280)}async restore3D(e){let t=this.overlay,i=this.handle;if(!t||!i)throw new Error("venue_3d_unavailable");this.buyerView_="venue3d",this.targetSeatId_=e.flyToSeatId??null,this.focusedSectionId_=e.flyToSeatId?this.findSeat(e.flyToSeatId)?.sectionId??null:null,t.style.visibility="visible",t.style.pointerEvents="auto",this.reducedMotion()?t.style.opacity="1":requestAnimationFrame(()=>{t.style.opacity="1"}),i.resize(),i.setNavigationMode(this.navigationMode_),this.pushLiveState(),this.options.onViewChange("venue3d",this.targetSeatId_),e.flyToSeatId?await i.flyToSeat(e.flyToSeatId):e.resetView&&i.focusOverview()}nextPaint(){return this.reducedMotion()||typeof requestAnimationFrame!="function"?Promise.resolve():new Promise(e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))})}toggleSeat(e){if(!this.findSeat(e))return;this.options.selection().some(s=>s.id===e)?this.options.deselect(e):this.options.status(e)==="free"&&this.options.select(e),this.pushLiveState()}seatState(e){switch(this.options.status(e.id)){case"held":return"held";case"booked":return"sold";case"not_for_sale":return"dimmed";default:return"available"}}async seatViewFor3D(e){let t=this.findSeat(e);if(!t)throw new Error("seat_view_unavailable");if(t.viewUrl){let i=t.viewMeta?.previewUrl,s=!!i&&i!==t.viewUrl,r=s?await this.options.resolveAsset(i):null,o=s?t.viewUrl:await this.options.resolveAsset(t.viewUrl);if(!o||s&&!r)throw new Error("seat_view_unavailable");return{url:o,...r?{previewUrl:r}:{},...s?{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 i=this.seatViewElement;if(this.seatViewDispose?.(),this.seatViewDispose=null,this.seatViewElement=null,!!i){if(this.options.onSeatViewChange?.(null),!t||this.reducedMotion()){i.remove();return}i.classList.add("is-leaving"),setTimeout(()=>i.remove(),190)}}findSeat(e){return this.options.seats().find(t=>t.id===e||t.label===e)}hasStage(){let e=this.options.doc();return e?(e.floors?.flatMap(i=>i.objects)??e.objects).some(i=>i.type==="shape"&&(i.role==="stage"||!!i.stageKind)):!1}prepareHostTheme(e,t){getComputedStyle(e).position==="static"&&(e.style.position="relative");let i=t.theme;e.style.setProperty("--sl-bg",i?.background??"#f6f7fb"),e.style.setProperty("--sl-surface","#ffffff"),e.style.setProperty("--sl-text",i?.textColor??"#10162a"),e.style.setProperty("--sl-muted","#697386"),e.style.setProperty("--sl-line","#d9deea"),e.style.setProperty("--sl-accent",i?.accent??"#ef4056"),e.style.setProperty("--sl-accent-ink",i?.accentInk??"#ffffff")}reducedMotion(){return globalThis.matchMedia?.("(prefers-reduced-motion: reduce)").matches??!1}};var La={host:"web",platform:"web",bundle:"",protocol:0,chromeOwner:"web"},Ma={...La},ri=null,xs=null;function Ha(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():0}function Oa(){let n=e=>Math.max(0,Math.round(e*100)/100);return{bootMs:n(Ha()),documentMs:ri==null?0:n(ri),handshakeMs:ri==null||xs==null?0:n(xs-ri)}}function ks(){let{host:n,platform:e,bundle:t,protocol:i,chromeOwner:s}=Ma,r=Oa();return{host:n,platform:e,...t?{bundle:t}:{},...i?{protocol:i}:{},chromeOwner:s,bootMs:r.bootMs,documentMs:r.documentMs,handshakeMs:r.handshakeMs}}var Ss=new Set;function He(n){return Ss.has(n)?"repeat":"cold"}function oi(n){let e=He(n);return Ss.add(n),e}function se(n){return typeof n=="number"&&Number.isFinite(n)&&n>=0?Math.round(n):0}function Ra(){return typeof location>"u"?!1:/^(localhost|127\.0\.0\.1|\[::1\])$/i.test(location.hostname)}function Ia(n){if(!/^[A-Za-z0-9_-]{1,80}$/.test(n.event))return null;let e=n.performanceProfile??{};return{event:n.event,scope:n.scope,surface:n.surface,outcome:n.outcome,stage:n.stage?.slice(0,32)??"",ms:se(n.ms),api:se(e.loadChartAndStatuses)||se(e.loadChart),scene:se(e.buildScene),panel:se(e.buildBuyerControls),paint:se(e.firstPaint),normalize:se(e.normalizeBuyerModel),renderer:se(e.createRenderer),seats:se(n.seats),floors:se(n.floors),view:n.view??"map",load:n.load??He(n.event),transport:n.transport??"pubapi",chartBytes:se(n.chartDelivery?.bytes),chartCache:n.chartDelivery?.cache??"",...ks(),availabilityMs:se(e.loadStatuses)}}var _a=new Set;function ke(n){let e=Ia(n);if(e){for(let t of _a)try{t(e)}catch{}typeof fetch>"u"||Ra()||fetch(`${n.apiBase.replace(/\/+$/,"")}/pub/telemetry/chart-load`,{method:"POST",headers:{"Content-Type":"application/json","X-SeatLayer-Client":"1"},body:JSON.stringify(e),credentials:"omit",keepalive:!0}).catch(()=>{})}}function Ct(n){if(!n)return null;let e=n.getBoundingClientRect();return e.width>0&&e.height>0?e:null}function Da(n){return Ct(n.peek?.querySelector(".sl-peek-sum"))??Ct(n.foot?.querySelector(".sl-total"))??Ct(n.tray)??Ct(n.sheetHead)}function Ui(n,e,t,i){let s=n,r=s.map;if(!r||!e)return;let o=r.getBoundingClientRect(),a={x:o.left+e.x,y:o.top+e.y},l=t.displayLabel??t.label,c=i?.find(p=>p.key===t.categoryKey)?.color,d=()=>{let p=Da(s);p&&Zn({from:a,to:{x:p.left+p.width/2,y:p.top+p.height/2},label:l,color:c})};Ct(s.peek)?requestAnimationFrame(d):d()}var qi=60,Ba=650;function Ts(n,e){if(!e.length||n.focusSeats?.(e.map(s=>s.id)))return;let t=e.find(s=>s.sectionId)?.sectionId;if(!t)return;let i=e.filter(s=>s.sectionId===t);n.focus(t,{x:i.reduce((s,r)=>s+r.x,0)/i.length,y:i.reduce((s,r)=>s+r.y,0)/i.length})}function Cs(n,e){let t=!Ut();Ts({focusSeats:i=>n.focusSeats?.(i,{animate:t})===!0,focus:(i,s)=>n.focusSection(i,s)},(e?.items??[]).filter(i=>i.objectType!=="ga").slice(0,10).map(i=>n.seatByLabel(i.label)).filter(i=>!!i))}function Es(n,e){if(!e.length)return;let t=n.reducedMotion===!0;t||e.forEach((o,a)=>{n.schedule(()=>n.pop(o.id),a*qi)});let i=t?0:e.length*qi,s=e.find(o=>o.sectionId)?.sectionId;if(n.schedule(()=>Ts(n,e),i),t)return;let r=i+(n.focusSeats||s?Ba:0);e.forEach((o,a)=>{n.schedule(()=>Ui(n.regions,n.screenPoint(o),o,n.categories),r+a*qi)})}var Et=class n{constructor(e,t=null){this.seams=e;this.watch=null;this.mode=t,this.watchMode()}themeMode(){return this.mode}setThemeMode(e,t){let i=t!==void 0&&"mapTheme"in t;e===this.mode&&!i||(i&&this.seams.setHostMapTheme(t.mapTheme??void 0),this.mode=e,this.watchMode(),this.applyThemeMode())}static groundFor(e){return Ue(null,e)}applyThemeMode(){let e=this.seams.mapTheme()??n.groundFor(this.mode);this.seams.applyMapTheme(e??null)&&this.seams.changed()}watchMode(){this.watch?.(),this.watch=null,this.mode==="auto"&&(this.watch=Ft(()=>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 Fa}from"@seatlayer/core";import{seatConfidenceDisclosure as Va}from"@seatlayer/core/core/seatConfidence";import{generateSeatThumb as Na}from"@seatlayer/core";function st(n){let e=n.viewMeta?.previewUrl??n.viewUrl;return e&&(ji(e)||Ze(e))?e:null}function li(n){if(!n)return!1;let e=n.floors?.length?n.floors.map(t=>t.objects??[]):[n.objects??[]];for(let t of e)for(let i of t)if(i.type==="shape"&&(i.role==="stage"||i.stageKind))return!0;return!1}var $a=512,ai=new Map;function ci(n,e){if(!e)return null;let t=`${n.id}|${Math.round(e.x)},${Math.round(e.y)}`,i=ai.get(t);if(i!==void 0)return i;let s=null;try{s=Na(n,e).distanceM??null}catch{s=null}return ai.size>=$a&&ai.clear(),ai.set(t,s),s}function At(n){return n.getFocusedSection()!==null||n.seatsRevealed()}function za(n,e){return{accessibilityFilter:n.length>0,limitedViewFilter:e.some(t=>t.commercial?.restrictedView||t.commercial?.obstructedView)}}function ja(n,e,t,i){for(let s of e){if(s.count<=0)continue;let r=n.accessibilitySpread?.([s.key]);for(let o of r?.sections??[]){let a=t.get(o.id)??i.get(o.id);if(!a||o.free<=0)continue;let l=a.accessibleFree??(a.accessibleFree={});l[s.key]=o.free}}}function As(n,e,t){let i=n.doc,s=i?.theme??{},r=n.categoryAvailability(),o=n.getGAAreas(),a=n.getFloors(),l=n.getExpandedSeats(),c=n.getAccessNeeds(),d=za(c,l),p=e.seatPosition,u=p.targetSeatId?n.seatDetails(p.targetSeatId):null,h=new Map(l.map(w=>[w.id,w])),g=li(i),m=i?.floors?.flatMap(w=>w.objects)??i?.objects??[],y=new Map,k=new Map;for(let w of m){if(w.type!=="section")continue;let T={id:w.id,label:w.label,...w.displayLabel?{displayLabel:w.displayLabel}:{},...w.zone?{zoneId:w.zone}:{}};y.set(w.id,T);let b=w.logicalSectionId??w.id;k.has(b)||k.set(b,T)}return ja(n,c,y,k),{event:{key:t.event,name:t.eventInfo?.name??i?.name??t.event,venue:t.eventInfo?.venue??null,startsAt:t.eventInfo?.startsAt??null,timezone:t.eventInfo?.timezone??null,currency:t.eventInfo?.currency??t.currency??"USD",locale:Fa()||t.eventLocale,posterUrl:t.eventInfo?.posterUrl??null,mode:t.mode_??"live",salesClosed:t.eventInfo?.salesClosed??!1},branding:{...s.accent?{accent:s.accent}:{},...s.accentInk?{accentInk:s.accentInk}:{},...s.background?{background:s.background}:{},...s.textColor?{textColor:s.textColor}:{},...s.brandName?{brandName:s.brandName}:{},...s.logoUrl?{logoUrl:s.logoUrl}:{},attributionRequired:!s.hideBadge},features:{ga:o.length>0,tiers:!!i?.categories.some(w=>w.tiers?.length),floors:a.length>1,zones:!!i?.zones?.length,sections:y.size>0,bestAvailable:!0,...d,venue3d:e.canOffer3D(),seatView:e.canOfferSeatView()},catalog:{categories:(i?.categories??[]).filter(w=>!w.notForSale).map(w=>({key:w.key,label:w.label,color:w.color,price:w.price??w.tiers?.[0]?.price??0,available:r[w.key]??0,...Object.prototype.hasOwnProperty.call(r,w.key)?{free:r[w.key]}:{},tiers:(w.tiers??[]).map(T=>({id:T.id,name:T.name,price:T.price,...T.currency?{currency:T.currency}:{}}))})),zones:(i?.zones??[]).map(w=>({id:w.id,label:w.label,...w.color?{color:w.color}:{}})),sections:[...y.values()],gaAreas:o,bestAvailableZones:n.getBestAvailableZones()},map:{floors:a,activeFloorId:n.getActiveFloorId()||a[0]?.id||null,floorMode:n.isFloorOverview()?"all":"single",floorLabelStyle:n.getRenderer()?.getFloorLabelStyle?.()??"number",rung:n.getRung(),canZoomOut:At(n)||t.focusedSection_!==null,focusedSectionId:n.getFocusedSection(),focusedSection:t.focusedSection_,viewMode:n.getViewMode(),buyerView:e.buyerView,view3dTargetSeatId:p.targetSeatId,view3dTargetSeat:u,view3dPreviousSeatId:p.previousSeatId,view3dNextSeatId:p.nextSeatId,view3dFocusedSectionId:e.focusedSectionId,view3dNavigationMode:e.navigationMode,colorblindSafe:t.colorblindSafe_,viewportInsets:n.getViewportInsets(),categoryFilter:t.categoryFilter_?[...t.categoryFilter_]:null,accessibilityFilter:t.accessibilityFilter_?[...t.accessibilityFilter_]:null,hideLimitedView:t.hideLimitedView_,accessNeeds:c},selection:{seats:n.getSelection().map(w=>{let T=h.get(w.id);if(!T)return w;let b=n.worldToScreen({x:T.x,y:T.y}),A=st(T),S=g?ci(T,T.focalPoint??i?.focalPoint):null;return{...w,screenPoint:{x:b.x,y:b.y},...A?{seatViewThumb:{reference:A,kind:"real"}}:{},...S!=null?{sightlineMetres:S}:{},...T.confidenceEvidence?{seatViewConfidence:Va(T.confidenceEvidence)}:{}}}),validity:n.getSelectionValidity(),maxSelection:t.maxSelection_},access:{...t.accessState_}}}var Xa="https://api.seatlayer.io",Ps=10;function Za(n){if(typeof n=="string"){let e=document.querySelector(n);if(!e)throw new Error(`seatmap: container "${n}" not found`);return e}if(!(n instanceof HTMLElement))throw new Error("seatmap: container must be a CSS selector or an HTMLElement");return n}var Wi=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.realtime=null;if(!e||typeof e!="object")throw new Error("seatmap: options object is required");if(!e.container)throw new Error("seatmap: `container` is required");if(!e.event||typeof e.event!="string")throw new Error("seatmap: `event` key is required");this.opts=e,this.maxSelection_=e.maxSelection??Ps,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 i={onExpired:a=>{this.accessState_={configured:!0,status:a.refreshed?"ready":"expired"},this.opts.onAccessExpired?.(a),this.notifyMapStateChange()},onUnavailable:a=>{this.accessState_={configured:!0,status:"unavailable",reason:a.reason},this.opts.onAccessUnavailable?.(a),this.notifyMapStateChange()}},s=(e.apiBase??Xa).replace(/\/+$/,"");this.apiBase=s;let r=e.publicKey&&!e.buyerAccessTokenProvider&&!e.buyerAccessToken?qt({base:s,event:e.event,publicKey:e.publicKey,accessHooks:i,apiOptions:{onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)}}):null;this.access=r?.access??xt(e,i);let o=r?.api??new Pe(s,{access:this.access??void 0,onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)});this.api=o,this.controller=new Ga({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])},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??Ps)-this.controller.getSelection().length)),tiers:Yt(l),confirm:c=>{let d=typeof c=="number"?c:Object.values(c).reduce((p,u)=>p+u,0);this.holdGA(l.id,d)},cancel:()=>{}}))},onError:a=>this.opts.onError?.(a),onDeckTap:a=>{this.opts.onDeckTap?.(a),this.notifyMapStateChange()},onHint:a=>this.opts.onHint?.(a),onSectionFocus:a=>{this.focusedSection_=a,this.opts.onSectionFocus?.(a),this.notifyMapStateChange()},onViewChange:()=>this.handleViewChange(),onStatusChange:()=>{this.immersive?.pushLiveState(),this.opts.onStatusChange?.()},onSalesClosed:()=>{this.eventInfo&&(this.eventInfo.salesClosed=!0),this.opts.onSalesClosed?.()},flashOnLiveChange:!0,onSeatHover:a=>{this.opts.onSeatHover?.(a),this.opts.seatTooltip!==!1&&this.updateTooltip(a)},colorblindSafe:e.colorblindSafe,mapTheme:e.mapTheme??Et.groundFor(e.theme?.mode)??null}),this.hostSurface=new Et({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 Je(e.event,(a,l)=>o.asset(a,l)),this.immersive=new si({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_=At(this.controller)}handleViewChange(){this.opts.onViewChange?.();let e=this.controller.getRung(),t=At(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_=At(this.controller),this.opts.onMapStateChange?.()}async render(){if(this.rendered)return this;let e=performance.now();this.rendered=!0;let t=zt(this.opts.locale,this.opts.messages),i=this.localeGeneration+=1,s=Ki();this.mount=Za(this.opts.container);let r=document.createElement("div");r.style.width="100%",r.style.height="100%",r.style.position="relative",this.mount.appendChild(r),this.hostEl=r,jt(r,t,a=>{a!==s&&this.applyActiveLocale(a,i)}),this.applyInteractionState();let o=await this.controller.render(r);if(!o)return ke({apiBase:this.apiBase,event:this.opts.event,scope:"event",surface:"seating_chart",outcome:"failure",stage:"load_chart",ms:performance.now()-e,load:He(this.opts.event),transport:"pubapi"}),this.rendered=!1,this.opts.errorDisplay!=="none"&&this.showLoadFailure(r),this;if(this.eventLocale=o.locale??null,!this.opts.locale&&this.eventLocale&&this.setLocale(this.eventLocale),this.buildLanguageSwitcher(r),this.controller.setViewMode(this.opts.initialView??"flat"),this.opts.floorLabelStyle&&this.setFloorLabelStyle(this.opts.floorLabelStyle),this.startRealtime(),this.mode_=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);',r.appendChild(a),this.tipEl=a,this.onTipMove=l=>{let c=r.getBoundingClientRect();this.tipPos={x:l.clientX-c.left,y:l.clientY-c.top},this.tipEl&&this.tipEl.style.display!=="none"&&this.placeTooltip()},r.addEventListener("mousemove",this.onTipMove)}if(o.mode==="test"&&this.opts.showTestModeIndicator!==!1){r.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;",r.appendChild(a)}return this.opts.showAttribution!==!1&&this.buildBadge(r),ke({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:oi(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 i=document.createElement("span");i.setAttribute("aria-hidden","true"),i.style.cssText="width:16px;height:16px;border-radius:4px;flex:none;display:flex;align-items:center;justify-content:center;background:#0c1220;color:#fcf7ee",i.innerHTML=Qt;let s=document.createElement("span");s.textContent=le("picker.poweredBy"),t.append(i,s),e.appendChild(t)}placeTooltip(){if(!this.tipEl||!this.hostEl)return;let e=this.hostEl.clientWidth,t=this.tipEl.offsetWidth,i=this.tipEl.offsetHeight,s=this.tipPos.x+14,r=this.tipPos.y-i-12;s+t>e-8&&(s=this.tipPos.x-t-14),r<8&&(r=this.tipPos.y+18),this.tipEl.style.left=`${Math.max(8,s)}px`,this.tipEl.style.top=`${Math.max(8,r)}px`}updateTooltip(e){if(!this.tipEl)return;if(!e){this.tipEl.style.display="none";return}let t=qa(e.price,e.currency,{...Number.isInteger(e.price)?{minimumFractionDigits:0,maximumFractionDigits:0}:{},locale:this.opts.locale,fallback:(l,c)=>`${l} ${c}`}),i=document.createElement("div");i.style.cssText="font-weight:700;font-size:13px",i.textContent=e.label;let s=document.createElement("div");s.style.cssText="display:flex;align-items:center;gap:6px;margin-top:4px;color:#c7cddc";let r=document.createElement("span");r.style.cssText="width:9px;height:9px;border-radius:50%;flex:none",r.style.background=e.categoryColor;let 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,s.append(r,o,a),this.tipEl.replaceChildren(i,s),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(s=>Ya(s)).filter((s,r,o)=>o.indexOf(s)===r);if(t.length<2)return;let i=document.createElement("select");i.setAttribute("aria-label",le("picker.preferredTicketType")),i.style.cssText='position:absolute;bottom:10px;left:12px;z-index:5;appearance:none;padding:5px 9px;border-radius:999px;border:0;cursor:pointer;background:rgba(255,255,255,.92);color:#4a5163;font:600 11px/1 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;box-shadow:0 2px 8px rgba(0,0,0,.12);';for(let s of t){let r=document.createElement("option");r.value=s,r.textContent=Wa[s]??s,r.selected=s===Ki(),i.appendChild(r)}i.addEventListener("change",()=>{this.setLocale(i.value)}),e.appendChild(i),this.languageSelect=i}async setLocale(e){let t=Ki(),i=this.localeGeneration+=1,s=await Ua(e);return this.opts.messages&&Qa(this.opts.messages),s===t||this.applyActiveLocale(s,i),s}applyActiveLocale(e,t){if(t!==this.localeGeneration)return;let i=this.hostEl;if(i){i.lang=e,i.dir=Ka(e);for(let s of i.querySelectorAll("[data-sl-i18n]"))if(s.dataset.slI18n==="testMode")s.textContent=le("picker.testMode"),s.setAttribute("aria-label",le("picker.testMode"));else if(s.dataset.slI18n==="badge"){s.setAttribute("aria-label",le("picker.poweredBy"));let r=s.querySelector("span:last-child");r&&(r.textContent=le("picker.poweredBy"))}this.languageSelect&&this.languageSelect.value!==e&&(this.languageSelect.value=e),this.controller.refreshMapCopy()}}getMode(){return this.mode_}getPickerState(){return As(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 s=t.violations.includes("numberOfPlacesToSelect");throw Object.assign(new Error(s?`seatmap: select exactly ${t.required} places before holding`:"seatmap: adjust the ticket selection before holding"),{code:s?"selection_count_mismatch":"selection_invalid",selection:t})}let i=await this.controller.hold(void 0,e.ttlMs);return i?{holdId:i.holdId,expiresAt:i.expiresAt,seats:i.seats,items:i.items}:null}async resumeHold(e){try{return await this.resumeHoldOrThrow(e)}catch(t){return this.opts.onError?.(t),null}}async resumeHoldOrThrow(e){let t=await this.controller.resumeHold(e);return t?{holdId:t.holdId,expiresAt:t.expiresAt,seats:t.seats,items:t.items}:null}async extendHold(e){try{let t=await this.controller.extendHold(e);return t?{holdId:t.holdId,expiresAt:t.expiresAt,seats:t.seats,items:t.items}:null}catch(t){return this.opts.onError?.(t),null}}getCurrentHold(){let e=this.controller.currentHold();return e?{holdId:e.holdId,expiresAt:e.expiresAt,seats:e.seats,items:e.items}:null}getGAAreas(){return this.controller.getGAAreas()}async holdGA(e,t,i={}){try{return await this.holdGAOrThrow(e,t,i)}catch(s){return this.opts.onError?.(s),null}}async holdGAOrThrow(e,t,i={}){let s=await this.controller.holdGA(e,t,i);return s?{holdId:s.holdId,expiresAt:s.expiresAt,seats:s.seats,items:s.items}:null}async bestAvailable(e,t,i={}){try{return await this.bestAvailableOrThrow(e,t,i)}catch(s){return this.opts.onError?.(s),null}}async bestAvailableOrThrow(e,t,i={}){let s=await this.controller.bestAvailable(e,t,i);return Cs(this.controller,s),s?{holdId:s.holdId,expiresAt:s.expiresAt,labels:s.labels,seats:s.seats,items:s.items,...i.zoneId?{zoneId:i.zoneId}:{}}:null}setSeatTier(e,t){this.controller.setSeatTier(e,t)}setTableQuantity(e,t){return this.controller.setTableQuantity(e,t)}async replaceTableQuantity(e,t,i){try{return await this.replaceTableQuantityOrThrow(e,t,i)}catch(s){return this.opts.onError?.(s),null}}async replaceTableQuantityOrThrow(e,t,i){let s=await this.controller.replaceTableQuantity(e,t,i);return s?{holdId:s.holdId,expiresAt:s.expiresAt,seats:s.seats,items:s.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()}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:gt(this.controller,{flashOnLiveChange:!0,onStatusChange:()=>{this.immersive.pushLiveState(),this.opts.onStatusChange?.()},onSelectedObjectUnavailable:(e,t)=>this.opts.onSelectedObjectUnavailable?.({labels:e,reason:t})})}),this.realtime.start())}async refreshAvailability(){let e=await this.controller.refreshAvailability();return this.immersive.pushLiveState(),this.opts.onStatusChange?.(),e.lost.length&&this.opts.onSelectedObjectUnavailable?.({labels:e.lost,reason:"taken"}),this.notifyMapStateChange(),e}async refreshAccess(){if(!this.access?.configured)return!1;let e=await this.access.refresh("manual");return e&&(this.accessState_={configured:!0,status:"ready"},await this.controller.refresh(),this.realtime?.restart(),this.realtime||this.startRealtime()),this.notifyMapStateChange(),e}showLoadFailure(e){let t=document.createElement("div");t.setAttribute("role","status"),t.style.cssText='display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;width:100%;height:100%;min-height:180px;box-sizing:border-box;padding:24px;text-align:center;font:500 14px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#3b4256;';let i=document.createElement("div");i.textContent="The seat map didn\u2019t load.",t.appendChild(i);let s=document.createElement("button");s.type="button",s.textContent="Try again",s.style.cssText="appearance:none;border:1px solid #c9cede;background:#fff;color:#10162a;border-radius:8px;padding:8px 16px;font:600 13px/1 inherit;cursor:pointer;",s.addEventListener("click",()=>{this.destroy(),this.render().catch(r=>this.opts.onError?.(r))}),t.appendChild(s),e.appendChild(t)}destroy(){this.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 Ls=["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"],Ja={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 el(n){let e={};for(let t of Ls)e[t]=(...i)=>{let s=n();return s?s[t](...i):Ja[t]()};return e}var Ms=["event","apiBase","maxSelection","numberOfPlacesToSelect","selectionValidators","publicKey","locale","currency","colorblindSafe","initialView","errorDisplay"],Hs=[...Ms,"selectedObjects","selectableObjects","messages","seatTooltip","buyerAccessTokenProvider","buyerAccessToken"],Os=["onSelectionChange","onSelectionValidityChange","onSelectionValid","onSelectionInvalid","onSelectionLimit","onHold","onHoldRestored","onHoldExpired","onGAClick","onGAPrompt","onError","onDeckTap","onHint","onSeatHover","onAccessExpired","onAccessUnavailable","onSelectedObjectUnavailable"];function tl(n,e,t){let i={container:n};for(let s of Hs)i[s]=e[s];for(let s of Os)i[s]=t[s];return i}var il=new Set(["seatlayer.designer.ready","seatlayer.designer.saved","seatlayer.designer.published","seatlayer.designer.close","seatlayer.designer.error"]),nl=2e4,sl=480,rl=180*1e3,ol=900*1e3,al=.8,ll=30*1e3,cl=1e5,dl=4,pl=50;function Yi(n){if(typeof n!="string")return n;let e=document.querySelector(n);if(!e)throw new Error(`EmbeddedDesigner container not found: ${n}`);return e}function hl(n){let e=(n??"").toLowerCase();return e.includes("expire")||e.includes("revoke")||e==="401"?"expired":e.includes("mismatch")?"mismatch":e.includes("timeout")?"timeout":"load"}var ul={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"||!il.has(t.type))return;let i={type:t.type,chartId:typeof t.chartId=="string"?t.chartId:void 0,workspaceId:typeof t.workspaceId=="string"?t.workspaceId:void 0,expiresAt:typeof t.expiresAt=="number"?t.expiresAt:void 0,code:typeof t.code=="string"?t.code:void 0,message:typeof t.message=="string"?t.message:void 0,meta:t.meta,fatal:typeof t.fatal=="boolean"?t.fatal:void 0,action:typeof t.action=="string"?t.action:void 0},s=this.identityEstablished||i.type==="seatlayer.designer.ready"||i.type==="seatlayer.designer.saved"||i.type==="seatlayer.designer.published"||i.type==="seatlayer.designer.close",r=this.options.expectedChartId!==void 0&&i.chartId!==this.options.expectedChartId&&(s||i.chartId!==void 0),o=this.options.expectedWorkspaceId!==void 0&&i.workspaceId!==this.options.expectedWorkspaceId&&(s||i.workspaceId!==void 0);if(r||o){this.showError("mismatch");return}switch(i.type){case"seatlayer.designer.ready":this.identityEstablished=!0,this.sessionExpiresAt=i.expiresAt,this.phase="ready",this.clearTimeoutTimer(),this.removeOverlay(),this.autoRecoverUsed=!1,this.scheduleRenewal(i.expiresAt),this.options.onReady?.(i);break;case"seatlayer.designer.saved":this.options.onSaved?.(i);break;case"seatlayer.designer.published":this.options.onPublished?.(i);break;case"seatlayer.designer.close":this.options.onClose?.(i);break;case"seatlayer.designer.error":{let a=hl(i.code);if(a==="expired"&&this.autoRenewEnabled()&&!this.autoRecoverUsed){this.autoRecoverUsed=!0,this.clearRenewTimer(),this.options.onRequestRelaunch();return}(typeof i.fatal=="boolean"?i.fatal:a!=="load"||this.phase!=="ready")&&this.showError(a),this.options.onError?.(i);break}}};this.options=e}mount(){this.destroy();let e=new URL(this.options.designerUrl,window.location.href);if(e.protocol!=="https:"&&e.hostname!=="localhost"&&e.hostname!=="127.0.0.1")throw new Error("EmbeddedDesigner requires an HTTPS designerUrl outside local development.");this.designerOrigin=e.origin;let t=document.createElement("iframe");t.title=this.options.title??"Venue chart Designer",t.allow=this.options.allow??"fullscreen; clipboard-write",t.referrerPolicy=this.options.referrerPolicy??"origin",t.src=e.toString(),t.style.setProperty("width","100%","important"),t.style.setProperty("height",typeof this.options.height=="number"?`${this.options.height}px`:"100%","important"),t.style.border="0",Object.assign(t.style,this.options.style),this.options.className&&(t.className=this.options.className);let i=Yi(this.options.container);if(this.containerEl=i,window.addEventListener("message",this.handleMessage),i.append(t),this.frame=t,this.fillEnabled()&&this.startFill(),this.phase="loading",this.loadingStateEnabled()){this.ensureContainerPositioned(i),this.renderOverlay(i,"loading");let s=this.options.loadingTimeoutMs??nl;s>0&&Number.isFinite(s)&&(this.timeoutTimer=setTimeout(()=>{this.phase==="loading"&&this.showError("timeout")},s))}return t}setDesignerUrl(e){return this.options={...this.options,designerUrl:e},this.mount()}getIframe(){return this.frame}setSizing(e,t){this.options={...this.options,height:e,minHeight:t},this.frame&&(this.stopFill(),this.lastAutoHeight="",this.fillEnabled()?(this.pinned||this.setFrameHeight("100%"),this.startFill()):this.pinned||this.setFrameHeight(`${e}px`))}setRelaunchPolicy(e,t){this.options={...this.options,onRequestRelaunch:e,autoRenewSession:t},this.clearRenewTimer(),this.phase==="ready"&&this.scheduleRenewal(this.sessionExpiresAt)}destroy(){window.removeEventListener("message",this.handleMessage),this.stopFill(),this.unpinFullscreen(),this.clearTimeoutTimer(),this.clearRenewTimer(),this.removeOverlay(),this.restoreContainerStyle(),this.frame?.remove(),this.frame=null,this.containerEl=null,this.fillMode=null,this.designerOrigin="",this.phase="loading",this.identityEstablished=!1,this.sessionExpiresAt=void 0,this.lastAutoHeight=""}loadingStateEnabled(){return this.options.showLoadingState!==!1}autoResizeEnabled(){return this.options.autoResize!==!1}fillEnabled(){return typeof this.options.height!="number"}setFrameHeight(e){this.frame?.style.setProperty("height",e,"important")}detectFillMode(){let e=this.containerEl,t=this.frame;if(this.pinned||!e||!t)return this.fillMode??"viewport";let i=()=>e.getBoundingClientRect().height,s=t.style.getPropertyValue("height"),r=t.style.getPropertyPriority("height");t.style.setProperty("height","0px","important");let o=i();t.style.setProperty("height",`${cl}px`,"important");let a=i();return s?t.style.setProperty("height",s,r):t.style.removeProperty("height"),!(a-o>dl)&&o>=pl?"container":"viewport"}applyFill(){if(!this.frame||this.pinned)return;let e=this.options.minHeight??sl;if(this.fillMode==="container"&&this.containerEl){let s=Math.max(e,Math.round(this.containerEl.getBoundingClientRect().height));this.setFrameHeight(`${s}px`);return}let t=this.frame.getBoundingClientRect().top,i=Math.max(e,Math.round(window.innerHeight-t));this.setFrameHeight(`${i}px`)}syncContainerObserver(){let e=this.fillMode==="container"&&!!this.containerEl&&typeof ResizeObserver<"u";e&&!this.resizeObs?(this.resizeObs=new ResizeObserver(()=>this.scheduleFill()),this.resizeObs.observe(this.containerEl)):!e&&this.resizeObs&&(this.resizeObs.disconnect(),this.resizeObs=null)}startFill(){this.fillMode=this.detectFillMode(),this.syncContainerObserver(),this.applyFill(),!this.fillListening&&(this.fillListening=!0,window.addEventListener("resize",this.scheduleReprobe),window.addEventListener("orientationchange",this.scheduleReprobe),window.addEventListener("scroll",this.scheduleFill,{passive:!0}))}stopFill(){this.fillRaf!==null&&(cancelAnimationFrame(this.fillRaf),this.fillRaf=null),this.reprobeRaf!==null&&(cancelAnimationFrame(this.reprobeRaf),this.reprobeRaf=null),this.resizeObs&&(this.resizeObs.disconnect(),this.resizeObs=null),this.fillListening&&(this.fillListening=!1,window.removeEventListener("resize",this.scheduleReprobe),window.removeEventListener("orientationchange",this.scheduleReprobe),window.removeEventListener("scroll",this.scheduleFill))}pinFullscreen(){if(this.pinned||!this.frame)return;this.pinned=!0,this.frameStyleBeforeFs=this.frame.getAttribute("style");let e={position:"fixed",top:"0",right:"0",bottom:"0",left:"0",width:"100vw",height:"100vh",margin:"0",border:"0","z-index":"2147483000",background:"#101625"};for(let[i,s]of Object.entries(e))this.frame.style.setProperty(i,s,"important");let t=document.documentElement;this.docOverflowBeforeFs=t.style.overflow,t.style.overflow="hidden",document.body&&(this.bodyOverflowBeforeFs=document.body.style.overflow,document.body.style.overflow="hidden"),this.fsKeyHandler=i=>{i.key==="Escape"&&this.unpinFullscreen()},window.addEventListener("keydown",this.fsKeyHandler)}unpinFullscreen(){this.pinned&&(this.pinned=!1,this.frame&&(this.frameStyleBeforeFs===null?this.frame.removeAttribute("style"):this.frame.setAttribute("style",this.frameStyleBeforeFs),this.fillEnabled()?this.applyFill():this.autoResizeEnabled()&&this.lastAutoHeight?this.setFrameHeight(this.lastAutoHeight):typeof this.options.height=="number"&&this.setFrameHeight(`${this.options.height}px`)),this.frameStyleBeforeFs=null,this.docOverflowBeforeFs!==null&&(document.documentElement.style.overflow=this.docOverflowBeforeFs,this.docOverflowBeforeFs=null),this.bodyOverflowBeforeFs!==null&&document.body&&(document.body.style.overflow=this.bodyOverflowBeforeFs,this.bodyOverflowBeforeFs=null),this.fsKeyHandler&&(window.removeEventListener("keydown",this.fsKeyHandler),this.fsKeyHandler=null))}clearTimeoutTimer(){this.timeoutTimer!==null&&(clearTimeout(this.timeoutTimer),this.timeoutTimer=null)}autoRenewEnabled(){return!!this.options.onRequestRelaunch&&this.options.autoRenewSession!==!1}clearRenewTimer(){this.renewTimer!==null&&(clearTimeout(this.renewTimer),this.renewTimer=null)}scheduleRenewal(e){if(this.clearRenewTimer(),!this.autoRenewEnabled()||typeof e!="number"||!Number.isFinite(e))return;let t=e-Date.now();if(t<=0)return;let i=t<ol?t*al:t-rl,s=Math.max(ll,i);this.renewTimer=setTimeout(()=>{this.renewTimer=null,this.autoRenewEnabled()&&this.options.onRequestRelaunch()},s)}ensureContainerPositioned(e){getComputedStyle(e).position==="static"&&(this.restoreContainerPosition=e.style.position,e.style.position="relative")}restoreContainerStyle(){if(this.restoreContainerPosition!==null){try{Yi(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=Yi(this.options.container)}catch{return}this.renderOverlay(t,"error",e)}handleTryAgain(){if(this.options.onRequestRelaunch){this.options.onRequestRelaunch();return}this.mount()}renderOverlay(e,t,i){this.removeOverlay();let s=document.createElement("div");s.setAttribute("data-seatlayer-designer-overlay",t),s.setAttribute("role",t==="error"?"alert":"status"),s.setAttribute("aria-live","polite"),Object.assign(s.style,{position:"absolute",inset:"0",display:"flex",alignItems:"center",justifyContent:"center",background:"#101625",color:"#e6ebf5",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif',zIndex:"2",overflow:"hidden"}),t==="loading"?this.buildSkeleton(s):this.buildErrorCard(s,i??"load"),e.append(s),this.overlay=s}buildSkeleton(e){let t=document.createElement("style");t.textContent=`
|
|
2790
|
+
`;function nt(){if(document.getElementById(us))return;let i=document.createElement("style");i.id=us,i.textContent=fl+cs+hs+ps+ds+Wn,document.head.appendChild(i)}import{t as gl}from"@seatlayer/core";import{cdnAssetUrl as bl}from"@seatlayer/core/core/cdnAsset";import{SEATLAYER_MODULE_URL as ph}from"@seatlayer/core/core/cdnAsset";function v(i,e){let t=gl(i);return t===i?e:t}function Be(){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 ms(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 s=[...n][0]??"";return(e?s.toLocaleUpperCase(e):s.toLocaleUpperCase())+n.slice(s.length)}function fs(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 O(i){return String(i??"").replace(/[&<>"']/g,e=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[e])}function gs(i,e,t){let n=e.find(r=>tt(r))??null;if(i.replaceChildren(),!n)return i.textContent=t.slice(0,1).toUpperCase(),null;let s=document.createElement("img");return s.alt="",s.referrerPolicy="no-referrer",s.src=n,i.appendChild(s),n}var st=null;function Xt(){if(st!==null)return st;try{if(typeof document>"u")return st=!1;st=!!document.createElement("canvas").getContext("webgl2")}catch{st=!1}return st}function qi(i){return bl(i)}var Tt=null;function Ct(){return Tt||(Tt=(typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?import(qi("seatlayer-view3d.mjs")):import("@seatlayer/core/view3d")).catch(e=>{throw Tt=null,e}),Tt)}function Zt(){(typeof navigator>"u"?void 0:navigator.connection)?.saveData||Ct().catch(()=>{})}async function Jt(){return typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?import(qi("seatlayer-panorama.mjs")):import("@seatlayer/core")}async function bs(){return typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?import(qi("seatlayer-checkout.mjs")):import("./hostedCheckout-W7QZWSOQ.js")}function vs(i){return i==="unavailable_for_event"||i==="payments_off_for_event"?i:"not_configured"}function ei(i,e,t){let n={month:"short",day:"numeric",hour:"numeric",minute:"2-digit"},s=new Date(i);if(e)try{return s.toLocaleString(t,{...n,timeZone:e})}catch{}return s.toLocaleString(t,n)}async function ti(i,e){let t=i.overlay.productionElements;if(!t?.some(s=>s.contentImageUrl))return i;let n=await Promise.all(t.map(async s=>{if(!s.contentImageUrl)return s;try{let r=await e(s.contentImageUrl);if(!r){let{contentImageUrl:o,...a}=s;return a}return{...s,runtimeContentImageUrl:r}}catch{let{contentImageUrl:r,...o}=s;return o}}));return{...i,overlay:{...i.overlay,productionElements:n}}}async function ii(i,e){if(i)try{let t=await e(i);return t?await(await fetch(t)).arrayBuffer():void 0}catch{return}}import{browserPanoramaConstraints as vl,loadPanoramaImage as yl,planPanoramaDelivery as wl,schedulePanoramaUpgrade as xl}from"@seatlayer/core/view/panoramaDelivery";function ni(i){let{root:e,source:t,caption:n,real:s,closeLabel:r,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 f=V=>h.querySelector(V)?.remove();u.title===!1?f(".sl-view-title"):h.querySelector(".sl-view-title").textContent=a,u.caption===!1?f(".sl-view-cap"):h.querySelector(".sl-view-cap").textContent=n,h.querySelector(".sl-view-x").setAttribute("aria-label",r),u.badge===!1?f(".sl-view-badge"):h.querySelector(".sl-view-badge").textContent=s?l:c,h.querySelector(".sl-view-hint").textContent=o,e.appendChild(h);let g=h.querySelector(".sl-view-pano"),x=wl(t,vl()),w=new AbortController;g.style.backgroundImage=`url(${JSON.stringify(x.initialUrl)})`;let y=()=>{};x.upgradeUrl&&(y=xl(()=>{p(x.upgradeUrl).then(V=>!V||w.signal.aborted?null:yl(V,w.signal).then(()=>V)).then(V=>{!V||!h.isConnected||w.signal.aborted||(g.style.backgroundImage=`url(${JSON.stringify(V)})`)}).catch(()=>{})}));let T=70,b=35,M=1,k=g.clientHeight||1,R=g.clientWidth||1,P=-(k*(180/T)*2/2-R/2),C=0,H=()=>{let V=g.clientHeight||1,_i=V*(180/T)*M,Dn=Math.max(0,_i-V),Bn=Math.min(Dn/2,b/180*_i);C=Math.min(Bn,Math.max(-Bn,C)),g.style.backgroundSize=`auto ${_i}px`,g.style.backgroundPosition=`${P}px ${C-Dn/2}px`};H();let I=!1,N=0,te=0,ne=V=>{I=!0,N=V.clientX,te=V.clientY,g.classList.add("drag"),g.setPointerCapture?.(V.pointerId)},W=V=>{I&&(P+=V.clientX-N,C+=V.clientY-te,N=V.clientX,te=V.clientY,H())},Nt=V=>{I=!1,g.classList.remove("drag"),g.releasePointerCapture?.(V.pointerId)},On=V=>{V.preventDefault(),M=Math.min(2.4,Math.max(1,M+(V.deltaY<0?.12:-.12))),H()};g.addEventListener("pointerdown",ne),g.addEventListener("pointermove",W),g.addEventListener("pointerup",Nt),g.addEventListener("pointercancel",Nt),g.addEventListener("wheel",On,{passive:!1});let Oi=h.querySelector(".sl-view-x");Oi.addEventListener("click",d);let _n=V=>{V.key==="Escape"&&(V.stopPropagation(),d())};return h.addEventListener("keydown",_n),Oi.focus(),{element:h,dispose(){y(),w.abort(),g.removeEventListener("pointerdown",ne),g.removeEventListener("pointermove",W),g.removeEventListener("pointerup",Nt),g.removeEventListener("pointercancel",Nt),g.removeEventListener("wheel",On),h.removeEventListener("keydown",_n),Oi.removeEventListener("click",d)}}}function Tl(i,e){if(!e)return{targetSeatId:null,previousSeatId:null,nextSeatId:null};let t=i.find(r=>r.id===e);if(!t?.rowId)return{targetSeatId:e,previousSeatId:null,nextSeatId:null};let n=i.filter(r=>r.rowId===t.rowId),s=n.findIndex(r=>r.id===e);return{targetSeatId:e,previousSeatId:s>0?n[s-1].id:null,nextSeatId:s>=0&&s+1<n.length?n[s+1].id:null}}var ys=6e4,si=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 Tl(this.options.seats(),this.targetSeatId_)}get navigationMode(){return this.navigationMode_}canOffer3D(){return this.options.enable3D?this.handle&&this.overlay?!0:!this.options.doc()||!Xt()?!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(),s=this.options.doc();if(!t||!n||!s)throw new Error("seat_view_unavailable");let r=++this.seatViewGeneration,o,a,l=!1;if(t.viewUrl){let f=t.viewMeta?.previewUrl,g=!!f&&f!==t.viewUrl,x=g?await this.options.resolveAsset(f):null,w=g?t.viewUrl:await this.options.resolveAsset(t.viewUrl);if(r!==this.seatViewGeneration||!w||g&&!x)return;o={url:w,...x?{previewUrl:x}:{},...g?{resolveUrl:this.options.resolveAsset}:{},...t.viewMeta?.sourceWidth!==void 0?{sourceWidth:t.viewMeta.sourceWidth}:{},...t.viewMeta?.sourceHeight!==void 0?{sourceHeight:t.viewMeta.sourceHeight}:{},...t.viewMeta?.previewWidth!==void 0?{previewWidth:t.viewMeta.previewWidth}:{},...t.viewMeta?.previewHeight!==void 0?{previewHeight:t.viewMeta.previewHeight}:{},...t.viewMeta?.variants?.length?{variants:t.viewMeta.variants}:{},...t.viewMeta?.coverage?{coverage:t.viewMeta.coverage}:{},...t.viewMeta?.capturedAt?{capturedAt:t.viewMeta.capturedAt}:{},...t.viewMeta?.sourceLabel?{sourceLabel:t.viewMeta.sourceLabel}:{}},a=kl(o),l=Sl(o)}else{if(!this.hasStage())throw new Error("seat_view_unavailable");let{generateSeatPanorama:f}=await Jt();if(r!==this.seatViewGeneration)return;let g=s.floors?.find(y=>y.objects.some(T=>T.type==="row"&&T.id===t.rowId)),x=t.focalPoint??g?.focalPoint??s.focalPoint,w=f(t,x,[...this.options.seats()]);o={url:w.url,generated:!0},a=rt("picker.illustrationCaption",{m:w.distanceM})}if(r!==this.seatViewGeneration)return;this.closeSeatView(!1),this.prepareHostTheme(n,s),nt();let c=this.options.chrome??{},p=Be(),d=rt("picker.viewFromSeat",{label:t.displayLabel||t.label}),u=l?rt("picker.real360"):rt("picker.preview"),h=ni({root:n,source:o,caption:a,real:l,closeLabel:v("picker.close","Close"),dragHint:p,viewFromSeatLabel:d,real360Label:rt("picker.real360"),previewLabel:rt("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(s=>s.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)?ys/2:ys}async enter3D(e){let t=this.options.host(),n=this.options.doc();if(!t||!n||this.overlay)throw new Error("venue_3d_unavailable");nt(),this.prepareHostTheme(t,n);let s=document.createElement("div");s.className="sl-view3d",s.setAttribute("role","group"),s.setAttribute("aria-label",v("picker.interactive3dVenueView","Interactive 3D venue view")),Object.assign(s.style,{position:"absolute",inset:"0",zIndex:"4",opacity:"0",touchAction:"none",transition:this.reducedMotion()?"none":"opacity 260ms cubic-bezier(.2,.8,.2,1)",background:"radial-gradient(120% 120% at 50% 0%,#191f28 0%,#0d1014 70%)"});let r=document.createElement("div");r.className="sl-view3d-loading",r.setAttribute("role","status"),r.setAttribute("aria-live","polite"),r.textContent=v("picker.loading3d","Building the 3D venue\u2026"),s.appendChild(r),t.appendChild(s),this.overlay=s;let o=++this.generation;if(this.reducedMotion()?s.style.opacity="1":requestAnimationFrame(()=>{s.style.opacity="1"}),await this.nextPaint(),!(o!==this.generation||this.overlay!==s))try{let[a,l]=await Promise.all([Ct(),this.options.loadEventConfiguration()]),c=l?await ti(l,this.options.resolveAsset):null,p=await ii(n.theme?.venue3d?.shellAssetUrl,this.options.resolveAsset);if(o!==this.generation||this.overlay!==s)return;let d={doc:n,seats:[...this.options.seats()],...c?{eventConfigurationId:c.id,eventConfiguration:c}:{},...p?{registeredShellGlb:p}:{}};r.textContent=v("picker.building3d","Building venue geometry\u2026");let u=await a.prepareVenue3D(d);if(o!==this.generation||this.overlay!==s)return;let h=this.options.chrome??{},f=a.mountVenue3D(s,{...d,prepared:u},{portraitOverviewCrop:!0,arriveAtSeatEye:!0,lookAroundHint:Be(),...h.view3dCaption===!1||h.view3dSeatStepper===!1||h.view3dControlDock===!1?{chrome:{caption:h.view3dCaption!==!1,seatStepper:h.view3dSeatStepper!==!1,controlDock:h.view3dControlDock!==!1}}:{},seatViewActionLabel:g=>this.findSeat(g)?.viewUrl?v("picker.openAuthored360","Open venue 360\xB0"):v("picker.lookAroundLive3d","Look around in live 3D"),onSeatPick:g=>this.toggleSeat(g),onSeatInspect:g=>this.toggleSeat(g),onViewTargetChange:g=>{this.targetSeatId_=g,g&&(this.focusedSectionId_=this.findSeat(g)?.sectionId??null),this.options.onViewChange("venue3d",g)},onSectionFocusChange:g=>{this.focusedSectionId_=g,this.options.onViewChange("venue3d",this.targetSeatId_)},...this.options.enableSeatView?{getSeatView:g=>this.seatViewFor3D(g)}:{}});if(o!==this.generation||this.overlay!==s){f.dispose();return}this.handle=f,this.buyerView_="venue3d",this.targetSeatId_=e??null,this.focusedSectionId_=e?this.findSeat(e)?.sectionId??null:null,f.setNavigationMode(this.navigationMode_),requestAnimationFrame(()=>r.remove()),this.pushLiveState(),this.options.onViewChange("venue3d",this.targetSeatId_),e&&await f.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,s=this.overlay;if(this.options.restoreMap(),t&&n&&s){s.style.pointerEvents="none";let r=()=>{this.buyerView_!=="map"||this.overlay!==s||(s.style.visibility="hidden",this.options.restoreMap())};!e||this.reducedMotion()?(s.style.opacity="0",r()):(requestAnimationFrame(()=>{s.style.opacity="0"}),setTimeout(r,280));return}if(this.handle=null,this.overlay=null,!s){try{n?.dispose()}catch{}this.options.restoreMap();return}if(!e||this.reducedMotion()){try{n?.dispose()}catch{}s.remove(),this.options.restoreMap();return}s.style.pointerEvents="none",requestAnimationFrame(()=>{s.style.opacity="0"}),setTimeout(()=>{try{n?.dispose()}catch{}s.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(s=>s.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,s=!!n&&n!==t.viewUrl,r=s?await this.options.resolveAsset(n):null,o=s?t.viewUrl:await this.options.resolveAsset(t.viewUrl);if(!o||s&&!r)throw new Error("seat_view_unavailable");return{url:o,...r?{previewUrl:r}:{},...s?{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 Cl={host:"web",platform:"web",bundle:"",protocol:0,chromeOwner:"web"},El={...Cl},ri=null,ws=null;function Al(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():0}function Pl(){let i=e=>Math.max(0,Math.round(e*100)/100);return{bootMs:i(Al()),documentMs:ri==null?0:i(ri),handshakeMs:ri==null||ws==null?0:i(ws-ri)}}function xs(){let{host:i,platform:e,bundle:t,protocol:n,chromeOwner:s}=El,r=Pl();return{host:i,platform:e,...t?{bundle:t}:{},...n?{protocol:n}:{},chromeOwner:s,bootMs:r.bootMs,documentMs:r.documentMs,handshakeMs:r.handshakeMs}}var Ss=new Set;function He(i){return Ss.has(i)?"repeat":"cold"}function oi(i){let e=He(i);return Ss.add(i),e}function se(i){return typeof i=="number"&&Number.isFinite(i)&&i>=0?Math.round(i):0}function Ll(){return typeof location>"u"?!1:/^(localhost|127\.0\.0\.1|\[::1\])$/i.test(location.hostname)}function Ml(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:se(i.ms),api:se(e.loadChartAndStatuses)||se(e.loadChart),scene:se(e.buildScene),panel:se(e.buildBuyerControls),paint:se(e.firstPaint),normalize:se(e.normalizeBuyerModel),renderer:se(e.createRenderer),seats:se(i.seats),floors:se(i.floors),view:i.view??"map",load:i.load??He(i.event),transport:i.transport??"pubapi",chartBytes:se(i.chartDelivery?.bytes),chartCache:i.chartDelivery?.cache??"",...xs(),availabilityMs:se(e.loadStatuses)}}var Hl=new Set;function Se(i){let e=Ml(i);if(e){for(let t of Hl)try{t(e)}catch{}typeof fetch>"u"||Ll()||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 Et(i){if(!i)return null;let e=i.getBoundingClientRect();return e.width>0&&e.height>0?e:null}function Rl(i){return Et(i.peek?.querySelector(".sl-peek-sum"))??Et(i.foot?.querySelector(".sl-total"))??Et(i.tray)??Et(i.sheetHead)}function Ki(i,e,t,n){let s=i,r=s.map;if(!r||!e)return;let o=r.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=Rl(s);d&&Xn({from:a,to:{x:d.left+d.width/2,y:d.top+d.height/2},label:l,color:c})};Et(s.peek)?requestAnimationFrame(p):p()}var Ui=60,Il=650;function ks(i,e){if(!e.length||i.focusSeats?.(e.map(s=>s.id)))return;let t=e.find(s=>s.sectionId)?.sectionId;if(!t)return;let n=e.filter(s=>s.sectionId===t);i.focus(t,{x:n.reduce((s,r)=>s+r.x,0)/n.length,y:n.reduce((s,r)=>s+r.y,0)/n.length})}function Ts(i,e){let t=!Ut();ks({focusSeats:n=>i.focusSeats?.(n,{animate:t})===!0,focus:(n,s)=>i.focusSection(n,s)},(e?.items??[]).filter(n=>n.objectType!=="ga").slice(0,10).map(n=>i.seatByLabel(n.label)).filter(n=>!!n))}function Cs(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,s=e.find(o=>o.sectionId)?.sectionId;if(i.schedule(()=>ks(i,e),n),t)return;let r=n+(i.focusSeats||s?Il:0);e.forEach((o,a)=>{i.schedule(()=>Ki(i.regions,i.screenPoint(o),o,i.categories),r+a*Ui)})}var At=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 Ke(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=Ft(()=>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 Dl}from"@seatlayer/core";import{seatConfidenceDisclosure as Bl}from"@seatlayer/core/core/seatConfidence";import{generateSeatThumb as Ol}from"@seatlayer/core";function ot(i){let e=i.viewMeta?.previewUrl??i.viewUrl;return e&&(Gi(e)||tt(e))?e:null}function li(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,ai=new Map;function ci(i,e){if(!e)return null;let t=`${i.id}|${Math.round(e.x)},${Math.round(e.y)}`,n=ai.get(t);if(n!==void 0)return n;let s=null;try{s=Ol(i,e).distanceM??null}catch{s=null}return ai.size>=_l&&ai.clear(),ai.set(t,s),s}function Pt(i){return i.getFocusedSection()!==null||i.seatsRevealed()}function Nl(i,e){return{accessibilityFilter:i.length>0,limitedViewFilter:e.some(t=>t.commercial?.restrictedView||t.commercial?.obstructedView)}}function Vl(i,e,t,n){for(let s of e){if(s.count<=0)continue;let r=i.accessibilitySpread?.([s.key]);for(let o of r?.sections??[]){let a=t.get(o.id)??n.get(o.id);if(!a||o.free<=0)continue;let l=a.accessibleFree??(a.accessibleFree={});l[s.key]=o.free}}}function Es(i,e,t){let n=i.doc,s=n?.theme??{},r=i.categoryAvailability(),o=i.getGAAreas(),a=i.getFloors(),l=i.getExpandedSeats(),c=i.getAccessNeeds(),p=Nl(c,l),d=e.seatPosition,u=d.targetSeatId?i.seatDetails(d.targetSeatId):null,h=new Map(l.map(y=>[y.id,y])),f=li(n),g=n?.floors?.flatMap(y=>y.objects)??n?.objects??[],x=new Map,w=new Map;for(let y of g){if(y.type!=="section")continue;let T={id:y.id,label:y.label,...y.displayLabel?{displayLabel:y.displayLabel}:{},...y.zone?{zoneId:y.zone}:{}};x.set(y.id,T);let b=y.logicalSectionId??y.id;w.has(b)||w.set(b,T)}return Vl(i,c,x,w),{event:{key:t.event,name:t.eventInfo?.name??n?.name??t.event,venue:t.eventInfo?.venue??null,startsAt:t.eventInfo?.startsAt??null,timezone:t.eventInfo?.timezone??null,currency:t.eventInfo?.currency??t.currency??"USD",locale:Dl()||t.eventLocale,posterUrl:t.eventInfo?.posterUrl??null,mode:t.mode_??"live",salesClosed:t.eventInfo?.salesClosed??!1},branding:{...s.accent?{accent:s.accent}:{},...s.accentInk?{accentInk:s.accentInk}:{},...s.background?{background:s.background}:{},...s.textColor?{textColor:s.textColor}:{},...s.brandName?{brandName:s.brandName}:{},...s.logoUrl?{logoUrl:s.logoUrl}:{},attributionRequired:!s.hideBadge},features:{ga:o.length>0,tiers:!!n?.categories.some(y=>y.tiers?.length),floors:a.length>1,zones:!!n?.zones?.length,sections:x.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:r[y.key]??0,...Object.prototype.hasOwnProperty.call(r,y.key)?{free:r[y.key]}:{},tiers:(y.tiers??[]).map(T=>({id:T.id,name:T.name,price:T.price,...T.currency?{currency:T.currency}:{}}))})),zones:(n?.zones??[]).map(y=>({id:y.id,label:y.label,...y.color?{color:y.color}:{}})),sections:[...x.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:Pt(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 T=h.get(y.id);if(!T)return y;let b=i.worldToScreen({x:T.x,y:T.y}),M=ot(T),k=f?ci(T,T.focalPoint??n?.focalPoint):null;return{...y,screenPoint:{x:b.x,y:b.y},...M?{seatViewThumb:{reference:M,kind:"real"}}:{},...k!=null?{sightlineMetres:k}:{},...T.confidenceEvidence?{seatViewConfidence:Bl(T.confidenceEvidence)}:{}}}),validity:i.getSelectionValidity(),maxSelection:t.maxSelection_},access:{...t.accessState_}}}var Kl="https://api.seatlayer.io",As=10;function Wl(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.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??As,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()}},s=(e.apiBase??Kl).replace(/\/+$/,"");this.apiBase=s;let r=e.publicKey&&!e.buyerAccessTokenProvider&&!e.buyerAccessToken?qt({base:s,event:e.event,publicKey:e.publicKey,accessHooks:n,apiOptions:{onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)}}):null;this.access=r?.access??St(e,n);let o=r?.api??new Pe(s,{access:this.access??void 0,onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)});this.api=o,this.controller=new Fl({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])},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??As)-this.controller.getSelection().length)),tiers:Yt(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??At.groundFor(e.theme?.mode)??null}),this.hostSurface=new At({mapTheme:()=>this.opts.mapTheme,setHostMapTheme:a=>{this.opts.mapTheme=a},applyMapTheme:a=>this.controller.setMapTheme(a),applyViewportInsets:a=>this.controller.setViewportInsets(a),readViewportInsets:()=>this.controller.getViewportInsets(),changed:()=>this.notifyMapStateChange()},e.theme?.mode??null),this.buyerAssetUrls=new it(e.event,(a,l)=>o.asset(a,l)),this.immersive=new si({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_=Pt(this.controller)}handleViewChange(){this.opts.onViewChange?.();let e=this.controller.getRung(),t=Pt(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_=Pt(this.controller),this.opts.onMapStateChange?.()}async render(){if(this.rendered)return this;let e=performance.now();this.rendered=!0;let t=zt(this.opts.locale,this.opts.messages),n=this.localeGeneration+=1,s=Wi();this.mount=Wl(this.opts.container);let r=document.createElement("div");r.style.width="100%",r.style.height="100%",r.style.position="relative",this.mount.appendChild(r),this.hostEl=r,jt(r,t,a=>{a!==s&&this.applyActiveLocale(a,n)}),this.applyInteractionState();let o=await this.controller.render(r);if(!o)return Se({apiBase:this.apiBase,event:this.opts.event,scope:"event",surface:"seating_chart",outcome:"failure",stage:"load_chart",ms:performance.now()-e,load:He(this.opts.event),transport:"pubapi"}),this.rendered=!1,this.opts.errorDisplay!=="none"&&this.showLoadFailure(r),this;if(this.eventLocale=o.locale??null,!this.opts.locale&&this.eventLocale&&this.setLocale(this.eventLocale),this.buildLanguageSwitcher(r),this.controller.setViewMode(this.opts.initialView??"flat"),this.opts.floorLabelStyle&&this.setFloorLabelStyle(this.opts.floorLabelStyle),this.startRealtime(),this.mode_=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);',r.appendChild(a),this.tipEl=a,this.onTipMove=l=>{let c=r.getBoundingClientRect();this.tipPos={x:l.clientX-c.left,y:l.clientY-c.top},this.tipEl&&this.tipEl.style.display!=="none"&&this.placeTooltip()},r.addEventListener("mousemove",this.onTipMove)}if(o.mode==="test"&&this.opts.showTestModeIndicator!==!1){r.style.overflow="hidden";let a=document.createElement("div");a.dataset.slI18n="testMode",a.textContent=ce("picker.testMode"),a.setAttribute("aria-label",ce("picker.testMode")),a.style.cssText="position:absolute;top:18px;right:-34px;z-index:6;transform:rotate(45deg);width:140px;text-align:center;padding:4px 0;background:#f4b740;color:#1a1200;font:800 10.5px/1.4 -apple-system,BlinkMacSystemFont,sans-serif;letter-spacing:.12em;box-shadow:0 2px 8px rgba(0,0,0,.25);pointer-events:none;",r.appendChild(a)}return this.opts.showAttribution!==!1&&this.buildBadge(r),Se({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:oi(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",ce("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=Qt;let s=document.createElement("span");s.textContent=ce("picker.poweredBy"),t.append(n,s),e.appendChild(t)}placeTooltip(){if(!this.tipEl||!this.hostEl)return;let e=this.hostEl.clientWidth,t=this.tipEl.offsetWidth,n=this.tipEl.offsetHeight,s=this.tipPos.x+14,r=this.tipPos.y-n-12;s+t>e-8&&(s=this.tipPos.x-t-14),r<8&&(r=this.tipPos.y+18),this.tipEl.style.left=`${Math.max(8,s)}px`,this.tipEl.style.top=`${Math.max(8,r)}px`}updateTooltip(e){if(!this.tipEl)return;if(!e){this.tipEl.style.display="none";return}let t=$l(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 s=document.createElement("div");s.style.cssText="display:flex;align-items:center;gap:6px;margin-top:4px;color:#c7cddc";let r=document.createElement("span");r.style.cssText="width:9px;height:9px;border-radius:50%;flex:none",r.style.background=e.categoryColor;let 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,s.append(r,o,a),this.tipEl.replaceChildren(n,s),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"?ce("map.statusHeld"):ce("map.statusTaken"),this.tipEl.appendChild(l)}this.tipEl.style.display="block",this.placeTooltip()}buildLanguageSwitcher(e){let t=(this.opts.languages??[]).map(s=>ql(s)).filter((s,r,o)=>o.indexOf(s)===r);if(t.length<2)return;let n=document.createElement("select");n.setAttribute("aria-label",ce("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 s of t){let r=document.createElement("option");r.value=s,r.textContent=Gl[s]??s,r.selected=s===Wi(),n.appendChild(r)}n.addEventListener("change",()=>{this.setLocale(n.value)}),e.appendChild(n),this.languageSelect=n}async setLocale(e){let t=Wi(),n=this.localeGeneration+=1,s=await zl(e);return this.opts.messages&&Ul(this.opts.messages),s===t||this.applyActiveLocale(s,n),s}applyActiveLocale(e,t){if(t!==this.localeGeneration)return;let n=this.hostEl;if(n){n.lang=e,n.dir=jl(e);for(let s of n.querySelectorAll("[data-sl-i18n]"))if(s.dataset.slI18n==="testMode")s.textContent=ce("picker.testMode"),s.setAttribute("aria-label",ce("picker.testMode"));else if(s.dataset.slI18n==="badge"){s.setAttribute("aria-label",ce("picker.poweredBy"));let r=s.querySelector("span:last-child");r&&(r.textContent=ce("picker.poweredBy"))}this.languageSelect&&this.languageSelect.value!==e&&(this.languageSelect.value=e),this.controller.refreshMapCopy()}}getMode(){return this.mode_}getPickerState(){return Es(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(s){return this.opts.onError?.(s),null}}async holdGAOrThrow(e,t,n={}){let s=await this.controller.holdGA(e,t,n);return s?{holdId:s.holdId,expiresAt:s.expiresAt,seats:s.seats,items:s.items}:null}async bestAvailable(e,t,n={}){try{return await this.bestAvailableOrThrow(e,t,n)}catch(s){return this.opts.onError?.(s),null}}async bestAvailableOrThrow(e,t,n={}){let s=await this.controller.bestAvailable(e,t,n);return Ts(this.controller,s),s?{holdId:s.holdId,expiresAt:s.expiresAt,labels:s.labels,seats:s.seats,items:s.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(s){return this.opts.onError?.(s),null}}async replaceTableQuantityOrThrow(e,t,n){let s=await this.controller.replaceTableQuantity(e,t,n);return s?{holdId:s.holdId,expiresAt:s.expiresAt,seats:s.seats,items:s.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()}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 ye({url:this.api.subscribeUrl(this.opts.event),mintTicket:()=>this.api.subscribeTicket(this.opts.event),onAccessUnavailable:e=>this.opts.onAccessUnavailable?.(e),sink:bt(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 s=document.createElement("button");s.type="button",s.textContent="Try again",s.style.cssText="appearance:none;border:1px solid #c9cede;background:#fff;color:#10162a;border-radius:8px;padding:8px 16px;font:600 13px/1 inherit;cursor:pointer;",s.addEventListener("click",()=>{this.destroy(),this.render().catch(r=>this.opts.onError?.(r))}),t.appendChild(s),e.appendChild(t)}destroy(){this.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 Ps=["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"],Yl={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 Ql(i){let e={};for(let t of Ps)e[t]=(...n)=>{let s=i();return s?s[t](...n):Yl[t]()};return e}var Ls=["event","apiBase","maxSelection","numberOfPlacesToSelect","selectionValidators","publicKey","locale","currency","colorblindSafe","initialView","errorDisplay"],Ms=[...Ls,"selectedObjects","selectableObjects","messages","seatTooltip","buyerAccessTokenProvider","buyerAccessToken"],Hs=["onSelectionChange","onSelectionValidityChange","onSelectionValid","onSelectionInvalid","onSelectionLimit","onHold","onHoldRestored","onHoldExpired","onGAClick","onGAPrompt","onError","onDeckTap","onHint","onSeatHover","onAccessExpired","onAccessUnavailable","onSelectedObjectUnavailable"];function Xl(i,e,t){let n={container:i};for(let s of Ms)n[s]=e[s];for(let s of Hs)n[s]=t[s];return n}var Zl=new Set(["seatlayer.designer.ready","seatlayer.designer.saved","seatlayer.designer.published","seatlayer.designer.close","seatlayer.designer.error"]),Jl=2e4,ec=480,tc=180*1e3,ic=900*1e3,nc=.8,sc=30*1e3,rc=1e5,oc=4,ac=50;function Qi(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 lc(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 cc={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."}},Xi=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"||!Zl.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},s=this.identityEstablished||n.type==="seatlayer.designer.ready"||n.type==="seatlayer.designer.saved"||n.type==="seatlayer.designer.published"||n.type==="seatlayer.designer.close",r=this.options.expectedChartId!==void 0&&n.chartId!==this.options.expectedChartId&&(s||n.chartId!==void 0),o=this.options.expectedWorkspaceId!==void 0&&n.workspaceId!==this.options.expectedWorkspaceId&&(s||n.workspaceId!==void 0);if(r||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=lc(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=Qi(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 s=this.options.loadingTimeoutMs??Jl;s>0&&Number.isFinite(s)&&(this.timeoutTimer=setTimeout(()=>{this.phase==="loading"&&this.showError("timeout")},s))}return t}setDesignerUrl(e){return this.options={...this.options,designerUrl:e},this.mount()}getIframe(){return this.frame}setSizing(e,t){this.options={...this.options,height:e,minHeight:t},this.frame&&(this.stopFill(),this.lastAutoHeight="",this.fillEnabled()?(this.pinned||this.setFrameHeight("100%"),this.startFill()):this.pinned||this.setFrameHeight(`${e}px`))}setRelaunchPolicy(e,t){this.options={...this.options,onRequestRelaunch:e,autoRenewSession:t},this.clearRenewTimer(),this.phase==="ready"&&this.scheduleRenewal(this.sessionExpiresAt)}destroy(){window.removeEventListener("message",this.handleMessage),this.stopFill(),this.unpinFullscreen(),this.clearTimeoutTimer(),this.clearRenewTimer(),this.removeOverlay(),this.restoreContainerStyle(),this.frame?.remove(),this.frame=null,this.containerEl=null,this.fillMode=null,this.designerOrigin="",this.phase="loading",this.identityEstablished=!1,this.sessionExpiresAt=void 0,this.lastAutoHeight=""}loadingStateEnabled(){return this.options.showLoadingState!==!1}autoResizeEnabled(){return this.options.autoResize!==!1}fillEnabled(){return typeof this.options.height!="number"}setFrameHeight(e){this.frame?.style.setProperty("height",e,"important")}detectFillMode(){let e=this.containerEl,t=this.frame;if(this.pinned||!e||!t)return this.fillMode??"viewport";let n=()=>e.getBoundingClientRect().height,s=t.style.getPropertyValue("height"),r=t.style.getPropertyPriority("height");t.style.setProperty("height","0px","important");let o=n();t.style.setProperty("height",`${rc}px`,"important");let a=n();return s?t.style.setProperty("height",s,r):t.style.removeProperty("height"),!(a-o>oc)&&o>=ac?"container":"viewport"}applyFill(){if(!this.frame||this.pinned)return;let e=this.options.minHeight??ec;if(this.fillMode==="container"&&this.containerEl){let s=Math.max(e,Math.round(this.containerEl.getBoundingClientRect().height));this.setFrameHeight(`${s}px`);return}let t=this.frame.getBoundingClientRect().top,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,s]of Object.entries(e))this.frame.style.setProperty(n,s,"important");let t=document.documentElement;this.docOverflowBeforeFs=t.style.overflow,t.style.overflow="hidden",document.body&&(this.bodyOverflowBeforeFs=document.body.style.overflow,document.body.style.overflow="hidden"),this.fsKeyHandler=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<ic?t*nc:t-tc,s=Math.max(sc,n);this.renewTimer=setTimeout(()=>{this.renewTimer=null,this.autoRenewEnabled()&&this.options.onRequestRelaunch()},s)}ensureContainerPositioned(e){getComputedStyle(e).position==="static"&&(this.restoreContainerPosition=e.style.position,e.style.position="relative")}restoreContainerStyle(){if(this.restoreContainerPosition!==null){try{Qi(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=Qi(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 s=document.createElement("div");s.setAttribute("data-seatlayer-designer-overlay",t),s.setAttribute("role",t==="error"?"alert":"status"),s.setAttribute("aria-live","polite"),Object.assign(s.style,{position:"absolute",inset:"0",display:"flex",alignItems:"center",justifyContent:"center",background:"#101625",color:"#e6ebf5",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif',zIndex:"2",overflow:"hidden"}),t==="loading"?this.buildSkeleton(s):this.buildErrorCard(s,n??"load"),e.append(s),this.overlay=s}buildSkeleton(e){let t=document.createElement("style");t.textContent=`
|
|
2756
2791
|
@media (prefers-reduced-motion: no-preference) {
|
|
2757
2792
|
@keyframes seatlayer-designer-shimmer {
|
|
2758
2793
|
0% { background-position: -320px 0; }
|
|
@@ -2762,9 +2797,9 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default}
|
|
|
2762
2797
|
animation: seatlayer-designer-shimmer 1.25s ease-in-out infinite;
|
|
2763
2798
|
background-size: 640px 100%;
|
|
2764
2799
|
}
|
|
2765
|
-
}`,e.append(t);let i="linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.10) 37%, rgba(255,255,255,0.04) 63%)",s=document.createElement("div");Object.assign(s.style,{position:"absolute",inset:"0",display:"flex",flexDirection:"column",padding:"16px",gap:"14px",opacity:"0.9"});let r=c=>{let d=document.createElement("div");return d.className="sl-shimmer",Object.assign(d.style,{background:i,borderRadius:"8px"}),Object.assign(d.style,c),d};s.append(r({height:"40px",width:"100%",flex:"0 0 auto"}));let o=document.createElement("div");Object.assign(o.style,{display:"flex",gap:"14px",flex:"1 1 auto",minHeight:"0"}),o.append(r({width:"220px",height:"100%",flex:"0 0 auto"})),o.append(r({flex:"1 1 auto",height:"100%"})),s.append(o),e.append(s);let a=document.createElement("div");Object.assign(a.style,{position:"relative",zIndex:"1",display:"flex",alignItems:"center",gap:"10px",padding:"10px 16px",borderRadius:"999px",background:"rgba(16, 22, 37, 0.72)",fontSize:"13px",fontWeight:"500",letterSpacing:"0.01em"});let l=document.createElement("span");l.className="sl-shimmer",Object.assign(l.style,{width:"9px",height:"9px",borderRadius:"50%",background:i,flex:"0 0 auto"}),a.append(l),a.append(document.createTextNode("Loading designer\u2026")),e.append(a)}buildErrorCard(e,t){let i=ul[t],s=document.createElement("div");Object.assign(s.style,{maxWidth:"420px",margin:"0 24px",padding:"28px",textAlign:"center",background:"rgba(255, 255, 255, 0.03)",border:"1px solid rgba(255, 255, 255, 0.08)",borderRadius:"16px",boxShadow:"0 12px 40px rgba(0, 0, 0, 0.35)"});let r=document.createElement("h2");r.textContent=i.title,Object.assign(r.style,{margin:"0 0 8px",fontSize:"17px",fontWeight:"600",color:"#f4f7ff"});let o=document.createElement("p");o.textContent=i.body,Object.assign(o.style,{margin:"0 0 20px",fontSize:"13.5px",lineHeight:"1.5",color:"#aab4c8"});let a=document.createElement("button");a.type="button",a.textContent="Try again",Object.assign(a.style,{appearance:"none",cursor:"pointer",border:"0",borderRadius:"10px",padding:"10px 22px",fontSize:"14px",fontWeight:"600",color:"#101625",background:"#7aa2ff"}),a.addEventListener("click",()=>this.handleTryAgain()),s.append(r,o,a),e.append(s)}};import{PickerController as Cc,formatMoney as Ec,getLocale as xo,loadLocale as Ac,setStringOverrides as Pc,t as O,tCount as ot}from"@seatlayer/core";import{isAuthoredSeatView as Lc,seatViewDisclosure as ko}from"@seatlayer/core/view3d/crossfade/panorama";import{seatConfidenceDisclosure as Mc}from"@seatlayer/core/core/seatConfidence";function Rs(n){return n?.previousPrice!=null&&n.previousPrice>n.price?n.previousPrice:null}function Is(n){return ml(n)+(n.moreLabel?`<button type="button" class="sl-price-more" aria-expanded="${!n.collapsed}">${n.esc(n.moreLabel)}</button>`:"")+fl(n.status)}function ml(n){let{esc:e,money:t}=n;return n.categories.map(i=>{let s=n.priceOf(i),r=n.rangeOf(i),o=n.offerOf(i.key),a=Rs(o),l=n.activeKey===i.key;return`<div class="sl-price-row${n.bandKeys!=null&&!n.bandKeys.has(i.key)?" sl-dim":""}${l?" sl-active":""}" data-cat="${e(i.key)}" role="button" tabindex="0" aria-pressed="${l}" title="${e(n.titleFor(i,l))}"><span class="sl-dot" style="--sl-cat-dot:${e(n.colorOf(i))}"></span><span class="sl-price-label">${e(i.label)}`+(o?.offerName?`<small class="sl-price-offer">${e(o.offerName)}</small>`:"")+`</span><span class="sl-price-left">${e(n.leftCount(n.left[i.key]??0))}</span>`+(a!=null?`<span class="sl-price-was">${e(t(a))}</span>`:"")+(r!=null?`<span class="sl-price-amt">${r.min===r.max?e(t(r.min)):`${e(t(r.min))}\u2013${e(t(r.max))}`}</span>`:s!=null?`<span class="sl-price-amt">${e(t(s))}</span>`:"")+"</div>"}).join("")}function fl(n){let e=t=>t.replace(/[&<>"']/g,i=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[i]);return`<div class="sl-status-key" aria-label="${e(n.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(n.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(n.sold)}</span></div>`}function Xi(n){let e=Math.abs(n.scrollLeft),t=e>2,i=e+n.clientWidth<n.scrollWidth-2;return n.dataset.fadeStart=String(t),n.dataset.fadeEnd=String(i),{start:t,end:i}}function _s(n){let{esc:e,money:t}=n;return`<button type="button" class="sl-rc sl-rc-all" data-rail-all aria-pressed="${n.allActive}" title="${e(n.allWord)}"><span class="sl-rc-t">${e(n.allWord)}</span></button>`+n.categories.map(s=>{let r=n.rangeOf(s),o=n.priceOf(s),a=r?r.min===r.max?t(r.min):`${t(r.min)}+`:o!=null?t(o):null,l=Object.prototype.hasOwnProperty.call(n.left,s.key)&&n.left[s.key]<=0,c=Rs(n.offerOf(s.key)),d=a?`${s.label} \u2014 ${a}${l?` (${n.soldOutWord})`:""}`:s.label;return`<button type="button" class="sl-rc" data-cat="${e(s.key)}" aria-pressed="${n.activeKey===s.key}" aria-label="${e(d)}" title="${e(d)}"${l?" disabled":""}><i class="sl-rc-dot" style="--sl-cat-dot:${e(n.colorOf(s))}"></i>`+(c!=null?`<span class="sl-rc-was">${e(t(c))}</span>`:"")+`<span class="sl-rc-t">${e(a??s.label)}</span></button>`}).join("")}function Ds(n,e){let t=n.map(a=>({key:a.key,range:e.rangeOf(a)})).filter(a=>a.range!=null);if(!t.length)return[];let i=[...new Map(t.map(a=>[`${a.range.min}:${a.range.max}`,a.range])).values()].sort((a,l)=>a.min-l.min||a.max-l.max);if(i.length<=5)return i.map(a=>({id:`p${a.min}-${a.max}`,label:a.min===a.max?e.money(a.min):`${e.money(a.min)}\u2013${e.money(a.max)}`,keys:t.filter(l=>l.range.min===a.min&&l.range.max===a.max).map(l=>l.key),min:a.min,max:a.max}));let s=[...t].sort((a,l)=>a.range.min-l.range.min||a.range.max-l.range.max),r=Math.ceil(s.length/4),o=[];for(let a=0;a<s.length;a+=r){let l=s.slice(a,a+r),c=Math.min(...l.map(p=>p.range.min)),d=Math.max(...l.map(p=>p.range.max));o.push({id:`b${a}`,label:c===d?e.money(c):`${e.money(c)}\u2013${e.money(d)}`,keys:l.map(p=>p.key),min:c,max:d})}return o}function Bs(n){return!!n&&n.clientWidth>0&&n.scrollWidth>n.clientWidth+1}function gl(n){return n.some(e=>Bs(e))}var di="data-fit-gone",bl=12;function Zi(n,e,t=Bs){if(!n)return 0;for(let i of e)n.classList.remove(i.cls);if(n.querySelectorAll(`[${di}]`).forEach(i=>{i.removeAttribute(di),i.hidden=!1}),n.dataset.fit="0",n.clientWidth<=0||!t(n))return 0;for(let i=0;i<e.length;i+=1){let s=e[i];i>0&&n.classList.remove(e[i-1].cls),n.classList.add(s.cls),n.dataset.fit=String(i+1);let r=s.give?s.give(n):!0;if(!t(n))return i+1;if(s.repeat&&s.give){for(let o=1;r&&o<bl;o+=1)if(r=s.give(n),!t(n))return i+1}}return e.length}function vl(n,e="[data-fit-seg]"){let t=[...n.querySelectorAll(e)].filter(i=>!i.hidden);return t.length<2?!1:Ns(t[t.length-1])}function yl(n,e){let t=n.querySelector(e);return t&&!t.hidden?Ns(t):!1}function Ns(n){let e=n.previousElementSibling;return e instanceof HTMLElement&&e.tagName==="I"&&(e.setAttribute(di,""),e.hidden=!0),n.setAttribute(di,""),n.hidden=!0,!0}function wl(n){if(!n)return!1;let e=(n.getAttribute("aria-label")||n.textContent||"").trim();return e?(n.setAttribute("aria-label",e),n.setAttribute("title",e),!0):!1}function $s(n){if(!n)return 0;let e=n.querySelector(".sl-confirm-cancel"),t=n.querySelector(".sl-confirm-add-t");return Zi(n,[{cls:"sl-fit-track"},{cls:"sl-fit-type"},{cls:"sl-fit-icon",give:()=>wl(e)}],()=>gl([e,t]))}function Fs(n){return Zi(n,[{cls:"sl-fit-notype",give:e=>yl(e,"[data-fit-type]")},{cls:"sl-fit-short",give:e=>vl(e),repeat:!0}])}function Ji(n){return n?(n.classList.add("sl-fitpill"),Zi(n,[{cls:"sl-fit-p1"},{cls:"sl-fit-p2"},{cls:"sl-fit-p3"}])):0}var xl=["on-sale","low","sold-out","presale","closed"];function Pt(n){return n==null?null:typeof n=="number"&&Number.isFinite(n)&&n>=0?n:void 0}function zs(n){return n==null?null:typeof n=="number"&&Number.isFinite(n)&&n>=0?n:void 0}function Vs(n){if(n==null)return null;if(typeof n!="object"||Array.isArray(n))return;let e=n,t=e.count,i=e.index;if(typeof i!="number"||!Number.isInteger(i)||i<1||typeof t!="number"||!Number.isInteger(t)||t<i)return;let s=e.remaining;if(s!=null&&(typeof s!="number"||!Number.isInteger(s)||s<0))return;let r={index:i,count:t,remaining:s??null};if(e.id!==void 0){if(typeof e.id!="string"||!e.id.trim())return;r.id=e.id.trim()}if(e.name!==void 0){if(typeof e.name!="string"||!e.name.trim())return;r.name=e.name.trim()}if(e.categoryKey!==void 0){if(e.categoryKey!==null&&(typeof e.categoryKey!="string"||!e.categoryKey.trim()))return;r.categoryKey=e.categoryKey==null?null:e.categoryKey.trim()}for(let o of["startsAt","endsAt"]){if(e[o]===void 0)continue;let a=zs(e[o]);if(a===void 0)return;r[o]=a}return r}function kl(n){if(n==null)return null;if(typeof n!="object"||Array.isArray(n))return;let e=n;if(!Number.isInteger(e.assignmentVersion)||e.assignmentVersion<0||!Array.isArray(e.channels)||!Array.isArray(e.objects))return;let t=[],i=new Set;for(let 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||i.has(l)||!Number.isInteger(a.pricingVersion)||a.pricingVersion<0||!Array.isArray(a.priceOverrides))return;let c=[],d=new Set;for(let p of a.priceOverrides){if(!p||typeof p!="object"||Array.isArray(p))return;let u=p,h=typeof u.categoryKey=="string"?u.categoryKey.trim():"",g=u.tierId===null?null:typeof u.tierId=="string"&&u.tierId.trim()?u.tierId.trim():void 0,m=Pt(u.price);if(!h||g===void 0||m===void 0||m===null)return;let y=`${h}\0${g??""}`;if(d.has(y))return;d.add(y),c.push({categoryKey:h,tierId:g,price:m})}i.add(l),t.push({channelId:l,pricingVersion:a.pricingVersion,priceOverrides:c})}let s=[],r=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||r.has(l)||!i.has(c))return;r.add(l),s.push({label:l,channelId:c})}return{assignmentVersion:e.assignmentVersion,channels:t,objects:s}}function en(n){if(!n||typeof n!="object"||Array.isArray(n))return null;let e=n,t=xl.find(d=>d===e.state);if(!t)return null;let i=Pt(e.fromPrice),s=Pt(e.previousPrice);if(i===void 0||s===void 0)return null;let r=e.currency==null?null:typeof e.currency=="string"&&e.currency.trim()?e.currency.trim():void 0;if(r===void 0)return null;let o=Vs(e.release);if(o===void 0)return null;let a=e.upcoming===void 0?null:Vs(e.upcoming);if(a===void 0)return null;let l=[];if(e.prices!=null){if(!Array.isArray(e.prices))return null;let d=[];for(let p of e.prices){if(!p||typeof p!="object"||Array.isArray(p))return null;let u=p,h=typeof u.categoryKey=="string"?u.categoryKey.trim():"";if(!h)return null;let g=Pt(u.price),m=Pt(u.previousPrice);if(g==null||m===void 0)return null;let y={categoryKey:h,price:g,previousPrice:m};if(u.offerId!==void 0){if(typeof u.offerId!="string"||!u.offerId.trim())return null;y.offerId=u.offerId.trim()}if(u.offerName!==void 0){if(typeof u.offerName!="string"||!u.offerName.trim())return null;y.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;y.remaining=u.remaining==null?null:u.remaining}for(let k of["startsAt","endsAt"]){if(u[k]===void 0)continue;let w=zs(u[k]);if(w===void 0)return null;y[k]=w}d.push(y)}l=d}let c=kl(e.channelPricing);return c===void 0?null:{state:t,fromPrice:i,previousPrice:s,currency:r,release:o,upcoming:a,prices:l,channelPricing:c}}function js(n){return n?.changed!==!1}function Gs(n,e){if(!n)return null;let t=null,i=s=>{s!=null&&s>e&&(t===null||s<t)&&(t=s)};for(let s of[n.release,n.upcoming])i(s?.startsAt),i(s?.endsAt);for(let s of n.prices)i(s.startsAt),i(s.endsAt);return t}function tn(n){let e={};for(let t of n?.prices??[])e[t.categoryKey]=t.price;return e}import{compactRowLabel as Sl,t as Ne}from"@seatlayer/core";import{seatConfidenceDisclosure as Tl}from"@seatlayer/core/core/seatConfidence";function nn(n){return String(n??"\u2014").replace(/[&<>"]/g,e=>({"&":"&","<":"<",">":">",'"':"""})[e])}function x(n){return String(n??"").replace(/[&<>"]/g,e=>({"&":"&","<":"<",">":">",'"':"""})[e])}function Se(n){return n?.restrictedView?v("picker.restrictedView","Restricted view"):n?.obstructedView?v("picker.obstructedView","Obstructed view"):""}function Us(n){if(!n)return"";let e=[];n.premium&&e.push(`<div class="sl-cx-premium"><span class="sl-cx-star" aria-hidden="true">\u2605</span>${v("picker.premiumSeat","Premium seat")}</div>`);let t=Se(n);return t?e.push(`<div class="sl-cx-warn"><span class="sl-cx-glyph" aria-hidden="true">\u25D0</span><span class="sl-cx-txt"><b>${t}</b>${n.note?`<span class="sl-cx-note">${x(n.note)}</span>`:""}</span></div>`):n.note&&e.push(`<div class="sl-cx-warn"><span class="sl-cx-glyph" aria-hidden="true">\u2139</span><span class="sl-cx-txt"><span class="sl-cx-note">${x(n.note)}</span></span></div>`),e.length?`<div class="sl-cx">${e.join("")}</div>`:""}function sn(n){if(!n)return"";let e=[];if(n.premium){let i=x(v("picker.premiumSeat","Premium seat"));e.push(`<span class="sl-cx-mark sl-cx-mark-premium" role="img" aria-label="${i}" title="${i}">\u2605</span>`)}let t=Se(n);if(t){let i=x(n.note?`${t}: ${n.note}`:t);e.push(`<span class="sl-cx-mark sl-cx-mark-limited" role="img" aria-label="${i}" title="${i}">\u25D0</span>`)}else if(n.note){let i=x(n.note);e.push(`<span class="sl-cx-mark sl-cx-mark-info" role="img" aria-label="${i}" title="${i}">\u2139</span>`)}return e.join("")}function rn(n){if(!n)return"";let e=[];n.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(n);return t&&e.push(`<span class="sl-chip-cx-tag limited"><span aria-hidden="true">\u25D0</span>${x(t)}</span>`),!e.length&&!n.note?"":'<div class="sl-chip-cx">'+(e.length?`<div class="sl-chip-cx-tags">${e.join("")}</div>`:"")+(n.note?`<div class="sl-chip-cx-note">${x(n.note)}</div>`:"")+"</div>"}function rt(n){return n==="no-seat"?v("picker.emptyWheelchairSpace","Empty wheelchair space"):n==="seat-present"?v("picker.accessiblePhysicalSeat","Accessible physical seat"):""}function Ks(n){let e=rt(n);return e?`<div class="sl-cx"><div class="sl-cx-warn"><span class="sl-cx-glyph" aria-hidden="true">\u267F</span><span class="sl-cx-txt"><b>${e}</b></span></div></div>`:""}function Lt(n){let e=rt(n);return e?`<span class="sl-cx-mark" role="img" aria-label="${e}" title="${e}">\u267F</span>`:""}function on(n,e){if(!n)return"";let t=e?v("picker.viewFromThisSeat","View from this seat"):v("picker.seeItIn3d","See it in 3D"),i=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>${i}</span></button>`}function Ws(n){if(!n)return"";let e=n.previous.label||n.previous.id,t=n.next.label||n.next.id;return`<span class="sl-seccard-nav" aria-label="${v("picker.browseSections","Browse sections")}"><button type="button" data-section-nav="${R(n.previous.id)}" aria-label="${v("picker.previousSection","Previous section")}: ${R(e)}" title="${R(e)}">\u2190</button><button type="button" data-section-nav="${R(n.next.id)}" aria-label="${v("picker.nextSection","Next section")}: ${R(t)}" title="${R(t)}">\u2192</button></span>`}function Ys(n,e){if(!e)return"";let t=e,i=t.includes(n.id),s=i?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"${i&&t.length===1?" disabled":""}><span aria-hidden="true">\u21C4</span><span>${x(s)}</span></button>`}function Qs(n,e,t){if(!t)return"";let i=Tl(n.confidenceEvidence),s=i.modeledTarget??i.reality;return`<button type="button" class="sl-confirm-confidence" aria-label="Open seat confidence passport for ${x(n.displayLabel??n.label)}"><span><em>${x(e)}</em><strong>${x(i.headline)}</strong><small>${x(s)}</small></span><b>Passport</b></button>`}function U(n){let e=n?.rowLabel,t=n?.sectionLabel;if(!e||!t)return e;for(let i of["-"," ","\xB7","/","_"]){let s=`${t}${i}`;if(e.startsWith(s)&&e.length>s.length)return e.slice(s.length)}return Sl(e,t)}function Cl(n){switch(n){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.")};case"no_token":case"provider_failed":return{title:v("picker.accessExpiredTitle","Your seat session has expired"),body:v("picker.accessExpiredBody","Reload the seat map to continue. Seats already in your cart stay held until the timer ends."),action:v("picker.accessRetry","Reload seat map")};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.")}}}var El=6;function Xs(n,e,t){let i=nn;return[n?.sectionLabel?`<div class="sl-confirm-field sl-confirm-sec${n.sectionLabel.length>El?" sl-confirm-sec-long":""}"><span class="sl-confirm-key">${v("picker.section","Section")}</span><span class="sl-confirm-value">${i(n.sectionLabel)}</span></div>`:"",n?.rowLabel||n?.objectType==="booth"?`<div class="sl-confirm-field"><span class="sl-confirm-key">${i(t)}</span><span class="sl-confirm-value">${i(U(n)??n?.displayLabel??e)}</span></div>`:"",n?.objectType!=="booth"?`<div class="sl-confirm-field"><span class="sl-confirm-key">${v("picker.seat","Seat")}</span><span class="sl-confirm-value">${i(n?.seatNumber??n?.displayLabel??e)}</span></div>`:""].filter(Boolean).join("")}function Zs(n,e,t){let i=nn,s=n?.objectType==="booth",r=n?.objectType==="table"&&!!n?.bookingMode,o=s||r||!n?.seatNumber,a=n?.sectionLabel??(o?void 0:n?.displayLabel),l=r?`${v("picker.guests","Guests")} ${n?.bookingMode==="variable"?`${n?.minOccupancy}\u2013${n?.maxOccupancy}`:n?.capacity}`:void 0,d=(o?[l,a?n?.rowLabel??n?.displayLabel:void 0]:[n?.rowLabel?`${t} ${U(n)??""}`.trim():void 0,`${v("picker.seat","Seat")} ${n?.seatNumber??e}`]).filter(Boolean).join(" \xB7 ");return(a?`<span class="sl-confirm-place">${i(a)}</span>`:"")+(d?`<span class="sl-confirm-pos">${a?" \xB7 ":""}${i(d)}</span>`:"")+(a||d?"":`<span class="sl-confirm-pos">${i(e)}</span>`)}function Js(n,e){if(!n)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 er(n,e){if(!n||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 qs(n){return n.buyerMessage?.trim()||(n.restriction==="companion"?v("picker.companionRequiresWheelchair","Requires the adjacent wheelchair place"):void 0)}function tr(n,e,t){let i=nn;if(n.length>1)return`<fieldset class="sl-confirm-tiers"><legend>${v("picker.ticketType","Ticket type")}</legend>`+n.map(o=>{let a=qs(o);return`<button type="button" class="sl-confirm-tier" data-confirm-tier="${i(o.id)}" aria-pressed="${o.id===e}"><span class="sl-confirm-tier-copy"><span class="sl-confirm-tier-name">${i(o.name)}</span>`+(a?`<small class="sl-confirm-tier-note">${i(a)}</small>`:"")+`</span><span class="sl-confirm-tier-price">${i(t(o))}</span></button>`}).join("")+"</fieldset>";let s=n[0],r=s?qs(s):void 0;return r?`<p class="sl-confirm-tier-note">${i(r)}</p>`:""}function an(n){return`<span class="sl-seccard-dot" style="background:${x(n.color)}"></span><span class="sl-seccard-name">${x(n.label)}</span><span class="sl-seccard-left" data-full="${x(n.leftLabel)}" data-short="${x(n.leftShortLabel??n.leftLabel)}">${x(n.leftLabel)}</span>`+n.nav+n.close}function ir(n){return`<div class="sl-seccard-head"><span class="sl-seccard-dot" style="background:${x(n.color)}"></span><span class="sl-seccard-name">${x(n.label)}</span>`+(n.showPrice?`<span class="sl-seccard-price">${x(n.priceLabel)}</span>`:"")+n.close+`</div><div class="sl-seccard-zone">${n.zoneLabel?`${x(n.zoneLabel)} \xB7 `:""}<span class="sl-seccard-left">${x(n.leftLabel)}</span></div>`+(n.entrance?`<div class="sl-seccard-entrance">${x(n.entrance)}</div>`:"")+(n.mix?`<div class="sl-seccard-mix">${n.mix}</div>`:"")+`<div class="sl-seccard-foot"><button type="button" class="sl-seccard-overview">\u2190 ${x(n.overviewLabel)}</button>`+n.nav+`<span class="sl-seccard-hint">${x(n.hint)}</span></div>`}function nr(n){return`<span class="sl-seccard-mix-item${n.dim?" sl-dim":""}"><span class="sl-seccard-mix-dot" style="background:${x(n.color)}"></span>${x(n.label)} <span class="sl-seccard-mix-price">${x(n.rangeLabel)}</span></span>`}function sr(n){return'<div class="sl-confirm-grid">'+n.identityFields+`</div><div class="sl-confirm-cat"><span class="sl-confirm-cat-name">${x(n.categoryLabel)}</span>`+(n.priceLabel?`<span class="sl-confirm-price">${x(n.priceLabel)}</span>`:"")+'</div><div class="sl-confirm-id">'+n.marker+`<span class="sl-confirm-dot" style="background:${x(n.categoryColor)}" aria-hidden="true"></span><span class="sl-sr">${x(n.categoryLabel)}</span><span class="sl-confirm-who">`+n.identity+"</span>"+(n.priceLabel?`<span class="sl-confirm-idprice">${x(n.priceLabel)}</span>`:"")+'</div><div class="sl-confirm-body">'+n.tierChoices+n.groupDates+n.wheelchair+n.commercial+(n.thumb||n.see3dPill?`<div class="sl-confirm-strip">${n.thumb}<span class="sl-confirm-pills">${n.see3dPill}</span></div>`:"")+n.inspect+'<div class="sl-confirm-row">'+(n.see3dRow??"")+`<button type="button" class="sl-confirm-cancel">${x(n.cancelLabel)}</button><button type="button" class="sl-confirm-add"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M5 12.5l4 4L19 7"/></svg><span class="sl-confirm-add-t">${x(n.selectLabel)}</span></button></div></div>`}function rr(n,e){let t=R,{variable:i}=e;return`<section class="sl-table-dialog" role="dialog" aria-modal="true" aria-labelledby="sl-table-title" aria-describedby="sl-table-copy"><div class="sl-table-head"><div class="sl-table-eyebrow">${t(i?Ne("picker.flexiblePartyTypeWord",{typeWord:e.typeWord}):Ne("picker.wholeTypeWord",{typeWord:e.typeWord}))}</div><h2 class="sl-table-title" id="sl-table-title">${t(n.displayLabel??n.label)}</h2><p class="sl-table-copy" id="sl-table-copy">${t(i?v("picker.chooseGuestsCopy","Choose how many guests will sit together. This table is held exclusively for your party."):Ne("picker.allPlacesBookedTogether",{count:n.capacity}))}</p></div><div class="sl-table-body"><div class="sl-table-summary"><span>${t(e.categoryLabel)}</span>`+(e.suppressPricing?"":`<b data-table-unit>${t(Ne("picker.perGuestPrice",{price:e.unitPrice}))}</b>`)+`<span class="muted">${t(v("picker.tableCapacity","Table capacity"))}</span><span>${t(Ne("picker.guestsCount",{count:n.capacity}))}</span>`+(e.suppressPricing?"":`<span class="muted">${t(v("picker.total","Total"))}</span><b data-table-total></b>`)+"</div>"+(i?`<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>${n.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(Ne("picker.chooseMinMaxGuests",{min:n.minOccupancy,max:n.maxOccupancy}))}</div>`:`<input type="hidden" data-table-qty value="${n.capacity}">`)+`<div class="sl-table-actions"><button type="button" class="sl-table-cancel">${t(Ne("common.cancel"))}</button><button type="button" class="sl-table-confirm">${t(e.held?v("picker.updateTable","Update table"):i?v("picker.selectTable","Select table"):v("picker.selectWholeTable","Select whole table"))}</button></div></div></section>`}function or(n,e){let t=Cl(n),i=document.createElement("div");i.className="sl-access",i.setAttribute("role","status"),i.setAttribute("aria-live","polite");let s=document.createElement("div");s.className="sl-access-card";let r=document.createElement("span");r.className="sl-access-icon",r.setAttribute("aria-hidden","true"),r.textContent="\u21BB";let o=document.createElement("div");o.className="sl-access-copy";let a=document.createElement("div");a.className="sl-access-title",a.textContent=t.title;let l=document.createElement("div");if(l.className="sl-access-body",l.textContent=t.body,o.append(a,l),t.action){let c=document.createElement("button");c.type="button",c.className="sl-access-act";let d=document.createElement("span");d.className="sl-access-act-icon",d.setAttribute("aria-hidden","true"),d.textContent="\u21BB";let p=document.createElement("span");p.textContent=t.action,c.append(d,p),c.addEventListener("click",async()=>{i.classList.add("is-reloading"),c.disabled=!0;try{await e()}catch{}finally{i.isConnected&&(i.classList.remove("is-reloading"),c.disabled=!1)}}),o.appendChild(c)}return s.append(r,o),i.appendChild(s),i}function ar(n){return n.map(e=>`<button type="button" role="switch" class="sl-a11yrow${e.className?` ${e.className}`:""}${e.on?" on":""}" data-a11y-row="${x(e.key)}" aria-checked="${e.on}" aria-pressed="${e.on}"`+(e.disabled?' disabled aria-disabled="true"':"")+`><span class="sl-a11yrow-i" aria-hidden="true">${x(e.icon)}</span><span class="sl-a11yrow-t"><span class="sl-a11yrow-l">${x(e.label)}</span>`+(e.note?`<span class="sl-a11yrow-n">${x(e.note)}</span>`:"")+"</span>"+(e.count?`<span class="sl-a11yrow-c">${x(e.count)}</span>`:"")+'<span class="sl-a11yrow-s" aria-hidden="true"></span></button>').join("")}function lr(n){let e=document.createElement("div");e.className="sl-floors on",e.setAttribute("role","group"),e.setAttribute("aria-label",n.tf("picker.chooseLevel","Choose level"));let t=[{id:"",name:n.tf("picker.allFloors","All floors")},...n.floors.map(r=>({id:r.id,name:r.name}))];for(let r of t){let o=document.createElement("button");o.type="button",o.dataset.floor=r.id,o.textContent=r.name,o.setAttribute("aria-pressed","false"),o.addEventListener("click",()=>n.onChoose(r.id)),e.appendChild(o)}let i=document.createElement("button");i.type="button",i.className="sl-floor-info",i.textContent="i";let s=n.tf("picker.floorHelp","All floors shows the complete venue. Choose one level to inspect and select its seats.");return i.setAttribute("aria-label",s),i.title=s,e.appendChild(i),e}function cr(n,e,t){if(!n)return;let i=t?"":e;n.querySelectorAll("button[data-floor]").forEach(s=>{s.setAttribute("aria-pressed",String(s.dataset.floor===i))})}import{t as ce,tCount as Al}from"@seatlayer/core";var pi=class{constructor(e){this.el=null;this.stripObserver=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?.classList.contains("strip")?Me(this.el,void 0,Xn):this.el?.remove(),this.el=null,this.syncLocatorDock(),this.host.refreshMinimap();return}this.collapsed=this.host.controller.getRung()==="seats",this.shownAt=Date.now(),this.render(e),this.host.refreshMinimap()}updateDockInPlace(e,t){let i=this.el;if(!i)return;let s=i.querySelector(".sl-seccard-dot");s&&(s.style.background=e.color);let r=i.querySelector(".sl-seccard-name");r&&Ni(r,e.label);let o=i.querySelector(".sl-seccard-left");o&&(o.dataset.full=t.leftLabel,o.dataset.short=t.leftShortLabel,Ni(o,t.leftLabel));let a=i.querySelector(".sl-seccard-nav");t.nav?(a?a.outerHTML=t.nav:i.querySelector(".sl-seccard-x")?.insertAdjacentHTML("beforebegin",t.nav),this.wireNavigation(i)):a&&a.remove(),i.setAttribute("aria-label",`${ce("picker.sectionSummaryAria",{label:e.label})}, ${t.leftLabel}`),this.fitStripCount()}wireNavigation(e){e.querySelectorAll("[data-section-nav]").forEach(t=>{t.addEventListener("click",i=>{i.preventDefault(),i.stopPropagation();let s=t.dataset.sectionNav;s&&this.host.controller.focusSection(s)})})}render(e){let t=this.host.map();if(!t)return;let i=this.el?.classList.contains("strip")===!0&&this.el.isConnected,s=e.categories.length?e.categories.map(y=>{let k=this.host.controller.doc?.categories.find(w=>w.key===y.key);return k?this.host.catPriceRange(k):{min:y.priceMin,max:y.priceMax}}).filter(y=>y!=null):[{min:e.priceMin,max:e.priceMax}],r=Math.min(...s.map(y=>y.min)),o=Math.max(...s.map(y=>y.max)),a=r===o?this.host.money(r):`${this.host.money(r)}\u2013${this.host.money(o)}`,l=Al("picker.seatsLeftInSection",e.seatsLeft),c=ce("picker.seatsLeftShort",{count:e.seatsLeft}),d=`<button type="button" class="sl-seccard-x" aria-label="${ce("picker.closeSectionSummary")}">\u2715</button>`,p=`<button type="button" class="sl-seccard-x sl-seccard-back" aria-label="${ce("picker.closeSectionSummary")}"><span class="sl-seccard-back-chev" aria-hidden="true">\u2039</span>${R(ce("picker.overview"))}</button>`,u=Ws(this.host.sectionNeighbours(e.id)),h=this.host.root()?.dataset.layout==="narrow",g={label:e.label,color:e.color,leftLabel:l,leftShortLabel:c,nav:u,close:d};if(h&&i&&this.el){this.updateDockInPlace(e,{leftLabel:l,leftShortLabel:c,nav:u});return}this.el?.remove();let m=document.createElement("div");if(h){if(m.className=i?"sl-seccard strip on":"sl-seccard strip on sl-mo-slide-up",m.setAttribute("role","group"),m.setAttribute("aria-label",`${ce("picker.sectionSummaryAria",{label:e.label})}, ${l}`),m.innerHTML=an({...g,close:p}),i)for(let y of m.querySelectorAll(".sl-seccard-name,.sl-seccard-left"))y.classList.add("sl-mo-xfade");this.wireNavigation(m),m.querySelector(".sl-seccard-x").addEventListener("click",()=>this.host.controller.overview()),t.appendChild(m),this.fitStripCount()}else if(this.collapsed)m.className="sl-seccard mini on",m.setAttribute("role","button"),m.setAttribute("aria-label",ce("picker.sectionSummaryAria",{label:e.label})),m.innerHTML=an(g),this.wireNavigation(m),m.addEventListener("click",y=>{y.target.closest(".sl-seccard-x")||(this.collapsed=!1,this.shownAt=Date.now(),this.render(e))}),m.querySelector(".sl-seccard-x").addEventListener("click",()=>this.host.controller.overview()),(this.host.region("top-center")??t).appendChild(m);else{m.className="sl-seccard on",m.setAttribute("role","dialog"),m.setAttribute("aria-label",ce("picker.sectionSummaryAria",{label:e.label}));let y=this.host.priceBandKeys(),k=this.host.suppressPricing(),w=e.categories.map(T=>{let b=this.host.controller.doc?.categories.find(S=>S.key===T.key),A=b?this.host.catPriceRange(b):{min:T.priceMin,max:T.priceMax};return nr({label:T.label,color:T.color,dim:y!=null&&!y.has(T.key),rangeLabel:k?"":A&&A.min!==A.max?`${this.host.money(A.min)}\u2013${this.host.money(A.max)}`:this.host.money(A?.min??T.price)})}).join("");m.innerHTML=ir({...g,priceLabel:a,showPrice:!k&&e.categories.length>0,zoneLabel:e.zoneLabel,entrance:e.entrance?`${ce("picker.entrance")} ${e.entrance}`:void 0,mix:w,overviewLabel:ce("picker.overview"),hint:ce("picker.tapSeatHint")}),this.wireNavigation(m),m.querySelector(".sl-seccard-x").addEventListener("click",()=>this.host.controller.overview()),m.querySelector(".sl-seccard-overview").addEventListener("click",()=>this.host.controller.overview()),(this.host.region("top-center")??t).appendChild(m)}this.el=m,h&&this.watchStrip(m),this.syncLocatorDock()}syncLocatorDock(){let e=this.host.root();e&&(this.el?.classList.contains("strip")?e.dataset.locator="true":delete e.dataset.locator)}fitStripCount(){let e=this.el;if(!e||!e.classList.contains("strip"))return;let t=e.querySelector(".sl-seccard-left");if(!t)return;let i=e.querySelector(".sl-seccard-name"),s=c=>c!=null&&c.clientWidth>0&&c.scrollWidth>c.clientWidth+1,r=()=>{let c=e.clientWidth;if(c<=0)return!0;let d=typeof getComputedStyle=="function"?getComputedStyle(e):null,p=m=>{let y=Number.parseFloat(m??"");return Number.isFinite(y)?y:0},u=[...e.children].filter(m=>m instanceof HTMLElement&&!m.hidden),h=p(d?.columnGap)||p(d?.gap);return u.reduce((m,y)=>m+Math.max(y.scrollWidth,y.getBoundingClientRect().width),0)+h*Math.max(0,u.length-1)+p(d?.paddingLeft)+p(d?.paddingRight)<=c+1},o=()=>t.hidden||!s(t)&&r(),a=c=>{if(t.hidden=c==="hidden",c==="hidden")return;let d=t.dataset.full??"";t.textContent=c==="full"?d:t.dataset.short??d},l=["full","short","hidden"];for(let c of l)if(a(c),o()&&!s(i))return;for(let c of l)if(a(c),o())return;a("hidden")}watchStrip(e){this.stripObserver?.disconnect(),this.stripObserver=null,typeof requestAnimationFrame=="function"&&requestAnimationFrame(()=>{this.el===e&&this.fitStripCount()}),typeof ResizeObserver=="function"&&(this.stripObserver=new ResizeObserver(()=>{this.el===e&&this.fitStripCount()}),this.stripObserver.observe(e))}collapse(){!this.el||this.collapsed||!this.current||this.host.root()?.dataset.layout!=="narrow"&&(this.collapsed=!0,this.render(this.current))}onView(){if(!(!this.el||this.collapsed||!this.current)&&this.host.root()?.dataset.layout!=="narrow"){if(this.host.controller.getRung()==="seats"){this.collapse();return}if(Date.now()-this.shownAt<1400){this.coverage()>.25&&this.collapse();return}this.collapse()}}coverage(){let e=this.el,t=this.current,i=this.host.map();if(!e||!t||!i)return 0;let s=this.host.activeFloorObjects().find(w=>w.type==="section"&&w.id===t.id)?.outline;if(!s||s.length<3)return 0;let r=s.map(w=>this.host.controller.worldToScreen(w)),o=r.map(w=>w.x),a=r.map(w=>w.y),l=Math.min(...o),c=Math.min(...a),d=Math.max(...o)-l,p=Math.max(...a)-c;if(d<=0||p<=0)return 0;let u=i.getBoundingClientRect(),h=e.getBoundingClientRect(),g=h.left-u.left,m=h.top-u.top,y=Math.max(0,Math.min(g+h.width,l+d)-Math.max(g,l)),k=Math.max(0,Math.min(m+h.height,c+p)-Math.max(m,c));return y*k/(d*p)}};import{t as gi,tCount as Nl}from"@seatlayer/core";import{contrastRatio as $l}from"@seatlayer/core/core/color";import{t as dr,tCount as hi}from"@seatlayer/core";function ln(n,e,t){try{return new Intl.DateTimeFormat(e,{...t,...n.timezone?{timeZone:n.timezone}:{}}).format(new Date(n.startsAt))}catch{return new Date(n.startsAt).toLocaleString(e)}}var ui=(n,e)=>ln(n,e,{dateStyle:"medium"}),mi=(n,e)=>ln(n,e,{timeStyle:"short"}),fi=(n,e)=>ln(n,e,{weekday:"short",day:"numeric",month:"short"});function pr(n,e,t,i){return!n.length||n.length>=e?null:{summary:i,labels:n.map(s=>`${ui(s,t)} \xB7 ${mi(s,t)}`)}}function Pl(n,e){let t=new Set(e);return n.map(i=>({...i,free:!t.has(i.eventKey)}))}function hr(n,e){let t=[...n];if(t.length<=1)return t[0]??"";try{return new Intl.ListFormat(e,{style:"long",type:"conjunction"}).format(t)}catch{return t.join(", ")}}function Ll(n,e,t="",i=!1){if(!n.length)return"";let s=n.map(r=>{let o=r.free?e.free:e.blocked,a=i&&r.free?`<input class="sl-night-choice" type="checkbox" data-pg-event-key="${x(r.eventKey)}" aria-label="${x(`${r.shortDate}: ${o}`)}" checked>`:"";return`<li class="sl-night${r.free?" ok":" no"}" aria-label="${x(`${r.shortDate}: ${o}`)}">`+a+`<i class="sl-night-dot" aria-hidden="true"></i><span class="d">${x(r.shortDate)}</span><span class="st">${x(o)}</span></li>`}).join("");return`<div class="sl-tip-nights"><div class="sl-tip-nights-title">${x(e.title)}</div><ul class="sl-nightstrip">${s}</ul><p class="sl-tip-nights-note">${x(e.notAvailableOn)}</p>`+t+"</div>"}function Ml(n){return n.selectPartialLabel&&n.pinned?`<button type="button" class="sl-tip-switch" data-pg-select-partial>${x(n.selectPartialLabel)}</button>`:n.switchLabel&&n.pinned?`<button type="button" class="sl-tip-switch" data-pg-switch-mode>${x(n.switchLabel)}</button>`:n.switchLabel||n.selectPartialLabel?"":`<p class="sl-tip-advice">${x(n.advice)}</p>`}function Hl(n){return Number(n.available)+Number(n.selected)+Number(n.partial)+Number(n.unavailable)}function ur(n,e,t){if(Hl(n)<2)return"";let i=(r,o,a="")=>`<li class="sl-pg-legend-item"><i class="sl-pg-sw ${r}"${a}></i>${x(o)}</li>`,s=[];return n.available&&s.push(i("sl-pg-sw-free",e.available,` style="background:${x(t)}"`)),n.selected&&s.push(i("sl-pg-sw-sel",e.selected)),n.partial&&s.push(i("sl-pg-sw-split",e.partial,` style="--sl-pg-sw-cat:${x(t)}"`)),n.unavailable&&s.push(i("sl-pg-sw-off",e.unavailable)),`<ul class="sl-pg-legend-list" aria-label="${x(e.title)}">${s.join("")}</ul>`}function mr(n,e){if(!n.length)return"";let t=n.map(i=>{let s=i.labels.length?i.labels.join(", "):e.empty;return`<li class="sl-pg-night-row${i.labels.length?"":" empty"}${i.active?" active":""}" role="button" tabindex="0"${i.active?' aria-current="true"':""} data-event-key="${x(i.eventKey)}"><span class="n">${x(i.name)}</span><span class="s">${x(s)}</span></li>`}).join("");return`<div class="sl-pg-nights" role="group" aria-label="${x(e.title)}"><div class="sl-pg-nights-title">${x(e.title)}</div><ul class="sl-pg-nights-list">${t}</ul></div>`}function cn(n,e){if(n?.kind!=="partial"||!e?.length)return null;let t=n.data?.blockedEventKeys??[],i=Pl(e,t);return{states:i,missing:i.filter(s=>!s.free).map(s=>s.shortDate)}}function fr(n,e){return n?Ll(n.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:dr("picker.group.notAvailableOn",{dates:hr(n.missing,e.locale)})},Ml({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 Ol(n,e,t,i){if(!n.length)return"";let s=new Set(e),r=new Set(t),o=n.map(a=>{let l=s.has(a.eventKey);return`<li class="sl-confirm-date${l?"":" blocked"}"><label><input type="checkbox" data-pg-confirm-event-key="${x(a.eventKey)}" aria-label="${x(`${a.shortDate}: ${l?i.available:i.unavailable}`)}"${l&&r.has(a.eventKey)?" checked":""}${l?"":" disabled"}><span class="sl-confirm-date-label">${x(a.shortDate)}</span><span class="sl-confirm-date-state">${x(l?i.available:i.unavailable)}</span></label></li>`}).join("");return`<fieldset class="sl-confirm-dates" data-pg-confirm-dates><legend>${x(i.title)}</legend><p class="sl-confirm-dates-copy">${x(i.copy)}</p><label class="sl-confirm-date-all"><input type="checkbox" data-pg-confirm-all><span>${x(i.selectAll)}</span></label><ul>${o}</ul><p class="sl-confirm-dates-summary" data-pg-confirm-summary aria-live="polite"></p></fieldset>`}function gr(n,e,t,i){let s=e.availableEventKeys(t);return Ol(n,s,e.includedEventKeys(),{title:i("picker.group.confirmDatesTitle","Choose performance dates"),copy:s.length===n.length?i("picker.group.confirmAllDatesCopy","This seat is available for all {count} dates. Keep all selected, or remove dates you do not want.").replace("{count}",String(n.length)):i("picker.group.confirmPartialDatesCopy","This seat is available for {available} of {total} dates. Choose one date or keep every available date.").replace("{available}",String(s.length)).replace("{total}",String(n.length)),selectAll:i("picker.group.confirmSelectAll","Select all available dates"),available:i("picker.group.nightFree","Available"),unavailable:i("picker.group.nightBlocked","Unavailable")})}function br(n){return[...n.querySelectorAll("[data-pg-confirm-event-key]")].filter(e=>e.checked&&!e.disabled).map(e=>e.dataset.pgConfirmEventKey).filter(Boolean)}function vr(n,e,t,i){let s=[...n.querySelectorAll("[data-pg-confirm-event-key]")];if(!e||!s.length)return;let r=n.querySelector(".sl-confirm-add"),o=n.querySelector("[data-pg-confirm-all]"),a=()=>{let l=s.filter(p=>!p.disabled),c=br(n).length;o&&(o.checked=c===l.length,o.indeterminate=c>0&&c<l.length);let d=n.querySelector("[data-pg-confirm-summary]");d&&(d.textContent=c===l.length?t("picker.group.confirmAllSelected","All {count} available dates are selected.").replace("{count}",String(c)):t("picker.group.confirmSelectedOfAvailable","{selected} of {available} available dates selected.").replace("{selected}",String(c)).replace("{available}",String(l.length))),r.disabled=c===0,r.textContent=c?e.label(c):t("picker.group.confirmChooseOne","Choose at least 1 date"),i()};s.forEach(l=>l.addEventListener("change",a)),o?.addEventListener("change",()=>{s.filter(l=>!l.disabled).forEach(l=>{l.checked=o.checked}),a()}),a()}async function yr(n,e,t){if(!n||!t||!n.querySelector("[data-pg-confirm-event-key]"))return!0;let i=br(n);if(!i.length)return!1;let s=n.querySelector(".sl-confirm-add");return s?.setAttribute("aria-busy","true"),s&&(s.disabled=!0),await t.apply(e,i)?!0:(s?.removeAttribute("aria-busy"),s?.isConnected&&(s.disabled=!1),!1)}function wr(n,e,t){return n?dr("picker.group.seatPartlyAvailable",{label:e,free:n.states.length-n.missing.length,total:n.states.length,dates:hr(n.missing,t)}):""}function xr(n,e){let t=n.map((i,s)=>{let r=i.state==="done"?e.done:i.state==="current"?e.current:e.upcoming;return`<li class="sl-pg-step-item" data-step="${x(i.id)}" data-state="${x(i.state)}"${i.state==="current"?' aria-current="step"':""}><span class="i" aria-hidden="true">${i.state==="done"?"\u2713":String(s+1)}</span><span class="l">${x(i.label)}</span><span class="sl-pg-sr">${x(r)}</span></li>`}).join("");return`<ol class="sl-pg-steps" aria-label="${x(e.label)}">${t}</ol>`}function dn(n,e){return`<ul class="sl-pg-cards">${n.map(i=>`<li class="sl-pg-card" data-event-key="${x(i.eventKey)}"><span class="n">${x(i.name)}</span><time datetime="${x(i.iso)}"><span class="d">${x(i.date)}</span><span class="t">${x(i.time)}</span></time></li>`).join("")}</ul><p class="sl-pg-included">${x(e)}</p>`}function kr(n){let e=n.rows.map(t=>`<li class="sl-pg-pane-row${t.labels.length?"":" empty"}" data-event-key="${x(t.eventKey)}"><span class="n">${x(t.name)}</span><span class="s">${x(t.labels.length?t.labels.join(", "):n.empty)}</span></li>`).join("");return`<div class="sl-pg-pane-title">${x(n.title)}</div><ul class="sl-pg-pane-list">${e}</ul>`+(n.note?`<p class="sl-pg-pane-note">${x(n.note)}</p>`:"")+(n.total?`<div class="sl-pg-pane-total"><span>${x(n.total.label)}</span><b>${x(n.total.amount)}</b></div>`:"")+(n.holdStatus?`<p class="sl-pg-hold-status" role="status">${x(n.holdStatus)}</p>`:"")}function Sr(n){let e=Math.max(0,n);return`${Math.floor(e/6e4)}:${String(Math.floor(e/1e3)%60).padStart(2,"0")}`}function Tr(n,e){if(!n||n.seats<=0)return"";if(e==="same_seat"){let t=n.perPerformance??n.seats;return n.totalPerformances&&n.performances<n.totalPerformances?hi("picker.group.performancesChosenOf",t,{chosen:n.performances,total:n.totalPerformances}):hi("picker.group.seatsEveryPerformance",t)}return n.perPerformance!=null&&n.performancesChosen===n.performances?hi("picker.group.seatsPerPerformance",n.seats,{per:n.perPerformance}):hi("picker.group.performancesChosenOf",n.seats,{chosen:n.performancesChosen,total:n.performances})}function Cr(n,e){n.querySelectorAll(".sl-pg-night-row[data-event-key]").forEach(t=>{let i=()=>e(t.dataset.eventKey);t.addEventListener("click",i),t.addEventListener("keydown",s=>{s.key!=="Enter"&&s.key!==" "||(s.preventDefault(),i())})})}import{t as Rl}from"@seatlayer/core";function he(n){return String(n??"\u2014").replace(/[&<>"]/g,e=>({"&":"&","<":"<",">":">",'"':"""})[e])}function Il(n,e){let t=n.objectType==="table"&&!!n.bookingMode,i=n.objectType==="booth",s=t||i||!n.seatNumber,r=s?n.rowLabel??n.displayLabel??n.label:n.seatNumber,o=t?`${v("picker.guests","Guests")} ${n.bookingMode==="variable"?`${n.minOccupancy}\u2013${n.maxOccupancy}`:n.capacity}`:!i&&n.rowLabel?`${e} ${U(n)??""}`.trim():"";return`<div class="sl-tip-head"><div class="sl-tip-id"><span class="sl-tip-seat${s?" name":""}">${he(r)}</span>`+(o?`<span class="sl-tip-row">${he(o)}</span>`:"")+"</div>"+(n.sectionLabel?`<div class="sl-tip-sec"><span class="sl-tip-eyebrow">${v("picker.section","Section")}</span><span class="sl-tip-secname">${he(n.sectionLabel)}</span></div>`:"")+"</div>"}function Er(n,e){let t=n.status==="not_for_sale",i=n.mark?.kind==="partial",s=n.status==="free"||i?"":`<span class="sl-tip-tag">${t?v("picker.notAvailable","Not available"):n.status==="held"?Rl("map.statusHeld"):v("picker.sold","Sold")}</span>`,r=t?"":e.price,o=r?`<span class="sl-tip-amt">${he(r)}</span>`:"",a=!r&&e.priceNote?`<div class="sl-tip-note">${he(e.priceNote)}</div>`:"",l=Se(n.commercial),c=l?`<div class="sl-tip-cx"><span class="g" aria-hidden="true">\u25D0</span>${he(l)}</div>`:"",d=rt(n.wheelchairSpaceType),p=d?`<div class="sl-tip-cx"><span class="g" aria-hidden="true">\u267F</span>${he(d)}</div>`:"",u=e.reason?`<div class="sl-tip-reason">${he(e.reason)}</div>`:"";return'<i class="sl-tip-rail" aria-hidden="true"></i>'+Il(n,e.rowTypeWord)+`<div class="sl-tip-cat"><span class="sl-tip-dot" style="background:${he(n.categoryColor)}"></span><span class="sl-tip-name">${he(n.categoryLabel)}</span>`+s+o+"</div>"+a+u+p+c+(e.extra??"")}function Ar(n,e,t,i){let s=n.x+14,r=n.y-i.height-12,o=n.y+18,a=r;s+i.width>e-8&&(s=n.x-i.width-14),r<8&&o+i.height<=t-8&&(a=o);let l=Math.max(8,t-i.height-8);return{left:Math.max(8,Math.min(s,Math.max(8,e-i.width-8))),top:Math.max(8,Math.min(a,l))}}function Pr(n,e,t,i=22){let s=Math.max(8,Math.min(n.x-t.width/2,Math.max(8,e.width-t.width-8))),r=n.y-i-t.height,o=n.y+i;return r>=8?{left:s,top:r,placement:"above"}:o+t.height<=e.height-8?{left:s,top:o,placement:"below"}:{left:s,top:Math.max(8,Math.min(r<8?o:r,Math.max(8,e.height-t.height-8))),placement:r<8?"below":"above"}}var pn=14,_l=12,Dl=12,Bl=18;function Lr(n,e,t,i=_l){let s=pn;if(!(n>=e.height-s-t.height-Bl))return{placement:"sheet",bottom:s};let o=e.height-n+i,a=e.height-Dl-t.height;return{placement:"above",bottom:Math.max(0,Math.min(o,a))}}function Mr(n,e,t,i){let s=t.width/2+12,r=Math.max(s,Math.min(e.width-s,n.x)),o=n.y+t.height+24<=e.height,a=n.y<t.height+24&&o?"below":"above",l=i&&a==="above"?Math.max(t.height+24,n.y):n.y;return{left:r,top:Math.max(8,Math.min(e.height-8,l)),placement:a}}function Hr(n,e,t){let i=n.querySelector("[data-pg-select-partial]"),s=[...n.querySelectorAll("[data-pg-event-key]")],r=()=>s.filter(a=>a.checked).map(a=>a.dataset.pgEventKey).filter(Boolean),o=()=>{if(!i)return;let a=r().length;i.disabled=a===0,i.textContent=e?.(a)??i.textContent};s.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())})}),i?.addEventListener("click",()=>{let a=r();a.length&&t?.(a)})}function $e(n){let e=n?.displayType?.trim()||n?.rowType?.trim();return e||(n?.objectType==="table"?v("picker.table","Table"):n?.objectType==="booth"?v("picker.booth","Booth"):v("picker.row","Row"))}var Fl=360,Vl=160;function zl(n){return $l("#ffffff",n)>=3?"#ffffff":"#0b0f19"}var bi=class{constructor(e){this.el=null;this.seat=null;this.host=e}get element(){return this.el}set element(e){this.el=e}get candidate(){return this.seat}set candidate(e){this.seat=e}thumbHtml(e){let t=this.host.controller.doc;if(!t)return"";let i=st(e)?e.viewUrl??"":"",s=li(t);if(!i&&!s)return"";let r=i?null:ci(e,e.focalPoint??t.focalPoint);if(!i&&r==null)return"";let o=s&&r!=null?`<div class="sl-confirm-sight">${R(gi("picker.sightline",{m:r}))}</div>`:"";if(!i)return o;let a=R(gi("picker.viewFromSeat",{label:e.label})),l=R(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){let t=this.host,i=this.seat?.id;this.el?.remove(),this.el=null,this.seat=e,t.root()?.setAttribute("data-confirming","true"),t.els().side?.toggleAttribute("inert",!0),Object.values(t.regions()).forEach(L=>L.toggleAttribute("inert",!0)),t.controller.setSelectionFocus(e.id),i&&i!==e.id&&t.controller.deselect([i]),t.hideTooltip();let s=t.controller.seatDetails(e.id),r=t.controller.doc?.categories.find(L=>L.key===e.categoryKey),o=s?.price??(r?.tiers?.length?r.tiers[0].price:r?.price),a=o!=null?t.paidPrice(e.categoryKey,s?.tierId??r?.tiers?.[0]?.id??null,o,e.label):void 0,l=Xs(s,e.displayLabel??e.label,$e(s)),c=s?.tiers??r?.tiers??[],d=s?.tierId??c[0]?.id,p=t.suppressPricing()?"":tr(c,d,L=>t.money(t.paidPrice(e.categoryKey,L.id,L.price,e.label))),u=t.buyerView()==="venue3d",h=t.performanceGroup()?.confirmDateSelection??void 0,g=h?t.performanceGroup()?.nights?.()??[]:[],m=h?gr(g,h,e.id,(L,I)=>t.tf(L,I)):"",y=document.createElement("div");y.className="sl-confirm sl-mo-in",m&&y.classList.add("sl-confirm-group-dates"),y.setAttribute("role","dialog"),y.setAttribute("aria-label",gi("picker.confirmSeatLabel",{label:e.label}));let k=r?.color??"#6e7bff";y.style.setProperty("--sl-cat",k),y.style.setProperty("--sl-cat-ink",zl(k));let w=String(s?.categoryLabel??r?.label??e.categoryKey),T=t.controller.categoryAvailability()[e.categoryKey],b=typeof T=="number"&&T>0?Nl("picker.leftCount",T):"";y.innerHTML=sr({identityFields:l,identity:Zs(s,e.displayLabel??e.label,$e(s)),marker:Lt(s?.wheelchairSpaceType),see3dPill:Js(t.canOffer3d(),u),categoryColor:r?.color??"#6e7bff",categoryLabel:w,priceLabel:!t.suppressPricing()&&a!=null?t.money(a):"",categoryLeftLabel:b,tierChoices:p,groupDates:m,wheelchair:Ks(s?.wheelchairSpaceType),commercial:Us(e.commercial),thumb:t.seatViewEnabled()&&t.buyerView()!=="venue3d"?this.thumbHtml(e):"",inspect:u?`<div class="sl-confirm-inspect-row">${Qs(e,t.suppressPricing()?`${s?.displayLabel??e.displayLabel??e.label}`:`${s?.displayLabel??e.displayLabel??e.label} \xB7 ${a==null?t.tf("picker.priceNotSupplied","Price not supplied"):t.money(a)}`,u)}${Ys(e,u?t.view3dCompareSeatIds():null)}${on(t.canOffer3d(),u)}</div>`:on(t.canOffer3d(),u),see3dRow:er(t.canOffer3d(),u),cancelLabel:gi("common.cancel"),selectLabel:t.addSeatLabel(s?.objectType)}),t.els().map.appendChild(y),this.el=y;let A=y.querySelector(".sl-confirm-thumb"),S=A?.closest(".sl-confirm-thumbwrap")??null;if(A&&S){let L=!1,I=()=>{if(L||!S.isConnected)return;L=!0;let H=()=>{S.remove(),this.el===y&&t.reanchor()};if(t.reducedMotion()||typeof requestAnimationFrame!="function"){H();return}S.style.height=`${S.offsetHeight}px`,S.classList.add("sl-confirm-thumb-out"),requestAnimationFrame(()=>{S.style.height="0px",S.style.opacity="0"}),setTimeout(H,Vl)};A.addEventListener("error",I),A.addEventListener("load",()=>{A.naturalWidth||I()});let P=e.viewMeta?.previewUrl??e.viewUrl;P?t.resolveAssetUrl(P).then(H=>{if(!(!y.isConnected||this.el!==y)){if(!H){I();return}A.src=H}}).catch(H=>{I(),t.onError(H)}):I()}t.reanchor(),y.querySelector(".sl-confirm-view")?.addEventListener("click",()=>{t.openSeatView(e)}),y.querySelector(".sl-confirm-confidence")?.addEventListener("click",L=>{t.openSeatConfidencePassport(e,L.currentTarget instanceof HTMLElement?L.currentTarget:null)}),y.querySelector(".sl-confirm-compare")?.addEventListener("click",()=>t.saveView3dComparisonSeat(e)),y.querySelectorAll("[data-confirm-tier]").forEach(L=>{L.addEventListener("click",()=>{let I=L.dataset.confirmTier,P=c.find(B=>B.id===I);if(!P)return;t.controller.setSeatTier(e.id,P.id),y.querySelectorAll("[data-confirm-tier]").forEach(B=>{B.setAttribute("aria-pressed",String(B===L))});let H=y.querySelector(".sl-confirm-price");H&&(H.textContent=t.money(t.paidPrice(e.categoryKey,P.id,P.price,e.label))),t.reanchor()})}),y.querySelectorAll(".sl-confirm-3d,.sl-confirm-3dpill,.sl-confirm-3drow").forEach(L=>{L.addEventListener("pointerdown",Zt,{once:!0}),L.addEventListener("click",()=>{t.buyerView()==="venue3d"?(t.dismiss(),t.view3dHandle()?.flyToSeat(e.id)):(t.rememberView3dReturnSeat(e),t.dismiss(),t.enter3d(e.id))})}),vr(y,h,(L,I)=>t.tf(L,I),()=>t.reanchor()),y.querySelector(".sl-confirm-add").addEventListener("click",()=>{this.commit()}),y.querySelector(".sl-confirm-cancel").addEventListener("click",()=>this.cancel()),requestAnimationFrame(()=>{let L=y.querySelector(".sl-confirm-add");L?.focus(),t.liftToastOverConfirm(),t.fitTranslatedRows(),t.inviteCommit(y,L)})}reanchor(){let e=this.host;if(!this.el||!this.seat||e.root()?.dataset.view3d==="on")return;let t=e.controller.worldToScreen({x:this.seat.x,y:this.seat.y}),i=e.els().map;if(e.root()?.dataset.layout==="narrow"){let d=Lr(t.y,{height:i.clientHeight},{height:this.el.offsetHeight||230});d.placement==="above"?(this.el.dataset.placement="above",this.el.style.bottom=`${d.bottom}px`):(this.el.removeAttribute("data-placement"),this.el.style.removeProperty("bottom")),Yn(this.el,t,i),e.liftToastOverConfirm();return}let s=i.clientWidth,r=i.clientHeight,o=this.el.offsetWidth||276,a=this.el.offsetHeight||230,l=this.el.classList.contains("sl-confirm-group-dates"),c=Mr(t,{width:s,height:r},{width:o,height:a},l);this.el.dataset.placement=c.placement,this.el.style.left=`${c.left}px`,this.el.style.top=`${c.top}px`,Kt(this.el,t,{left:c.left,top:c.top,width:o,height:a})}dismiss(){let e=this.host;this.el&&Me(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 s=this.el?.querySelector(".sl-confirm-add")??null;if(s?.classList.contains("is-adding")||!await yr(this.el,t.id,e.performanceGroup()?.confirmDateSelection??void 0))return;e.collapseSectionCard(),this.seat=null,e.syncTray(),e.syncSelectionTo3d();let r=()=>{e.dismiss(),Ui(e.els(),e.controller.worldToScreen(t),t,e.controller.doc?.categories)};if(!s||e.reducedMotion()){r();return}s.classList.remove("sl-confirm-add-invite"),s.classList.add("is-adding"),s.setAttribute("aria-disabled","true");let o=s.querySelector(".sl-confirm-add-t");o&&(o.textContent=e.tf("picker.added","Added")),e.scheduleMotion(r,Fl)}cancel(){let e=this.host,t=this.seat;t&&(e.controller.deselect([t.id]),this.seat&&e.dismiss(),e.syncSelectionTo3d(),e.root()?.focus({preventScroll:!0}))}};function Or(n,e,t){if(!e||t)return;e.classList.add("sl-confirm-add-invite");let i=()=>e.classList.remove("sl-confirm-add-invite");n.addEventListener("pointerdown",i,{once:!0}),n.addEventListener("keydown",i,{once:!0}),e.addEventListener("focus",i,{once:!0})}function Rr(n,e){return n&&n!=="seat"?e("picker.select","Select"):e("picker.addSeat","Add seat")}import{pointInPolygon as jl}from"@seatlayer/core";import{createMinimapTransform as Gl,minimapPointToWorld as ql,minimapViewportPlan as Ul}from"@seatlayer/core/picker/minimapGeometry";function Ir(n,e){let t=new hn(n);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 i=document.createElement("button");i.type="button",i.className="sl-minimap-toggle",i.setAttribute("aria-label",v("picker.openVenueMap","Open venue overview map")),i.setAttribute("aria-expanded","false"),i.innerHTML='<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M3 6l5-2 8 3 5-2v13l-5 2-8-3-5 2zM8 4v13M16 7v13"/></svg>',e.appendChild(i),this.miniToggle=i;let s=document.createElement("div");s.className="sl-minimap",s.setAttribute("role","group");let r=document.createElement("div");r.className="sl-minimap-bar";let o=document.createElement("span");o.className="sl-minimap-label";let a=document.createElement("span");a.className="sl-minimap-key",a.setAttribute("aria-label",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",r.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.")),s.append(r,c),e.appendChild(s),this.miniWrap=s,this.miniLabel=o,this.miniCanvas=c;let d=document.createElement("canvas");this.miniBase=d,i.addEventListener("click",()=>{let p=this.host.root()?.dataset.minimapOpen==="true";this.userClosed=p,this.setMinimapOpen(!p)}),l.addEventListener("click",()=>{this.userClosed=!0,this.setMinimapOpen(!1)}),c.addEventListener("click",p=>{if(this.miniSuppressClick){this.miniSuppressClick=!1;return}this.minimapJump(p)}),c.addEventListener("pointerdown",p=>this.minimapPointerDown(p)),c.addEventListener("pointermove",p=>this.minimapPointerMove(p)),c.addEventListener("pointerup",p=>this.minimapPointerUp(p)),c.addEventListener("pointercancel",p=>this.minimapPointerUp(p)),c.addEventListener("keydown",p=>this.minimapKeydown(p)),this.layoutMinimap(),this.syncMinimapLabel(),this.drawMinimapStatic(),this.drawMinimapRect()}setAutoOpen(e){if(this.miniWrap){if(!e){this.userClosed=!1,this.host.root()?.dataset.minimapOpen==="true"&&this.setMinimapOpen(!1,!1);return}this.userClosed||this.host.root()?.dataset.minimapOpen==="true"||this.setMinimapOpen(!0,!1)}}setMinimapOpen(e,t=!0){this.host.root()?.setAttribute("data-minimap-open",String(e)),this.miniToggle?.setAttribute("aria-expanded",String(e)),t&&(e?this.miniCanvas?.focus():this.miniToggle?.focus())}layoutMinimap(){let e=this.miniCanvas,t=this.miniBase,i=this.host.controller.getViewport()?.bounds;if(!e||!t||!i||!(i.width>0&&i.height>0))return;let s=196,r=146,o=6,a=i.width/Math.max(1,i.height),l=s,c=Math.round(s/a);c>r&&(c=r,l=Math.round(r*a)),l=Math.max(64,l),c=Math.max(48,c);let d=Math.min(2,window.devicePixelRatio||1);e.width=Math.round(l*d),e.height=Math.round(c*d),e.style.width=`${l}px`,e.style.height=`${c}px`,t.width=e.width,t.height=e.height,this.miniTf=Gl(i,e.width,e.height,d,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(d=>d.id===this.host.controller.getActiveFloorId())?.name??v("picker.venueOverview","Venue overview"),i=this.host.controller.getMinimapSnapshot().sections,r=i.find(d=>d.active)?.label??this.host.focusedSectionLabel(),o=r?`${t} \xB7 ${r}`:t;this.miniLabel.textContent=o;let a=i.filter(d=>d.state==="selected").length,l=i.filter(d=>d.state==="available").length,c=i.filter(d=>d.state==="inactive").length;this.miniWrap.setAttribute("aria-label",i.length?`${o}. ${a} selected, ${l} available, ${c} inactive sections.`:o),this.miniCanvas?.setAttribute("aria-label",i.length?`${o}. ${a} selected, ${l} available, ${c} inactive sections. ${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 i=e.getContext("2d");if(!i)return;i.clearRect(0,0,e.width,e.height);let s=p=>p*t.scale+t.offX,r=p=>p*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",d=this.host.controller.getMinimapSnapshot();for(let p of d.sections){if(p.outline.length<3)continue;i.beginPath(),p.outline.forEach((h,g)=>g===0?i.moveTo(s(h.x),r(h.y)):i.lineTo(s(h.x),r(h.y))),i.closePath();let u=p.paint;if(i.globalAlpha=p.state==="inactive"?.5:.92,u?i.fillStyle=u.fill:(i.globalAlpha=p.state==="inactive"?.18:p.state==="selected"?.72:.34,i.fillStyle=p.state==="inactive"?a:p.state==="selected"?l:c),i.fill(),i.globalAlpha=.82,i.lineWidth=Math.max(1,t.dpr),i.strokeStyle=u?.stroke||o,i.stroke(),p.owned){i.globalAlpha=1,i.lineWidth=Math.max(2,t.dpr*1.5),i.strokeStyle=l,i.stroke();let h=p.outline.reduce((g,m)=>({x:g.x+m.x,y:g.y+m.y}),{x:0,y:0});i.beginPath(),i.arc(s(h.x/p.outline.length),r(h.y/p.outline.length),Math.max(1.5,t.dpr*1.6),0,Math.PI*2),i.fillStyle=l,i.fill(),i.beginPath(),p.outline.forEach((g,m)=>m===0?i.moveTo(s(g.x),r(g.y)):i.lineTo(s(g.x),r(g.y))),i.closePath()}p.active&&(i.globalAlpha=1,i.lineJoin="round",i.lineWidth=Math.max(4,t.dpr*3.5),i.strokeStyle=this.host.cssVar("--sl-surface")||"#fff",i.stroke(),i.lineWidth=Math.max(2,t.dpr*1.75),i.strokeStyle=l,i.stroke())}if(i.globalAlpha=1,!d.sections.length){let p=Math.max(1,t.dpr),u=this.host.controller.getRenderer?.(),h=new Map,g=m=>{let y=h.get(m);if(y)return y;let k=u?.categoryDisplayColor?.(m)||c;return h.set(m,k),k};for(let m of d.seats)i.globalAlpha=m.state==="inactive"?.22:.78,i.fillStyle=m.state==="inactive"?a:m.state==="selected"?l:g(m.categoryKey),i.beginPath(),i.arc(s(m.x),r(m.y),p,0,Math.PI*2),i.fill();i.globalAlpha=1}}drawMinimapRect(){let e=this.miniCanvas,t=this.miniBase,i=this.miniTf;if(!e||!t||!i)return;let s=e.getContext("2d");if(!s)return;s.clearRect(0,0,e.width,e.height),s.drawImage(t,0,0);let r=this.host.controller.getViewport();if(!r)return;let o=Ul(r.visible,i,e.width,e.height,Math.max(2,i.dpr*2)),a=this.host.cssVar("--sl-text")||"#12151c",l=this.host.cssVar("--sl-surface")||"#fff";s.save(),s.globalAlpha=.1,s.fillStyle=a,s.fillRect(o.raw.x,o.raw.y,o.raw.width,o.raw.height),s.globalAlpha=.9,s.lineJoin="round",s.lineWidth=Math.max(4,i.dpr*3.25),s.strokeStyle=l,s.strokeRect(o.raw.x,o.raw.y,o.raw.width,o.raw.height),s.globalAlpha=1,s.lineWidth=Math.max(2,i.dpr*1.75),s.strokeStyle=a,s.strokeRect(o.raw.x,o.raw.y,o.raw.width,o.raw.height),o.clipped&&Object.values(o.clippedEdges).some(Boolean)&&(s.setLineDash([Math.max(3,i.dpr*3),Math.max(2,i.dpr*2)]),s.strokeRect(o.clipped.x,o.clipped.y,o.clipped.width,o.clipped.height)),s.restore()}minimapWorldPoint(e){let t=this.miniCanvas,i=this.miniTf;if(!t||!i)return null;let s=t.getBoundingClientRect(),r=(e.clientX-s.left)*(t.width/Math.max(1,s.width)),o=(e.clientY-s.top)*(t.height/Math.max(1,s.height));return{...ql({x:r,y:o},i),px:r,py:o}}minimapPointerDown(e){let t=this.minimapWorldPoint(e),i=this.host.controller.getViewport()?.visible;!t||!i||!(t.x>=i.x&&t.x<=i.x+i.width&&t.y>=i.y&&t.y<=i.y+i.height)||(this.miniDrag={pointerId:e.pointerId,offsetX:t.x-(i.x+i.width/2),offsetY:t.y-(i.y+i.height/2),startX:e.clientX,startY:e.clientY,moved:!1},this.miniCanvas?.setPointerCapture(e.pointerId),this.miniCanvas?.classList.add("sl-dragging"),e.preventDefault())}minimapPointerMove(e){let t=this.miniDrag;if(!t||t.pointerId!==e.pointerId)return;let i=this.minimapWorldPoint(e);i&&(!t.moved&&Math.hypot(e.clientX-t.startX,e.clientY-t.startY)>2&&(t.moved=!0,this.host.controller.clearSectionFocus()),this.host.controller.panToWorld({x:i.x-t.offsetX,y:i.y-t.offsetY}),e.preventDefault())}minimapPointerUp(e){let t=this.miniDrag;!t||t.pointerId!==e.pointerId||(this.miniSuppressClick=t.moved,this.miniDrag=null,this.miniCanvas?.classList.remove("sl-dragging"),this.miniCanvas?.hasPointerCapture(e.pointerId)&&this.miniCanvas.releasePointerCapture(e.pointerId))}minimapKeydown(e){let t=this.host.controller.getViewport()?.visible;if(!t)return;if(e.key==="Home"){this.host.controller.overview(),e.preventDefault();return}let i=e.key==="ArrowLeft"?-t.width*.2:e.key==="ArrowRight"?t.width*.2:0,s=e.key==="ArrowUp"?-t.height*.2:e.key==="ArrowDown"?t.height*.2:0;!i&&!s||(this.host.controller.clearSectionFocus(),this.host.controller.panToWorld({x:t.x+t.width/2+i,y:t.y+t.height/2+s}),e.preventDefault())}minimapJump(e){let t=this.minimapWorldPoint(e);if(t){for(let i of this.host.controller.getMinimapSnapshot().sections)if(!(i.state==="inactive"||i.outline.length<3)&&jl(t,i.outline)){this.host.controller.focusSection(i.id);return}this.host.controller.clearSectionFocus(),this.host.controller.panToWorld(t)}}};import{t as un}from"@seatlayer/core";var Kl=12;function _r(n,e){let t=e.floors(),i=new Set(t.map(S=>S.label.trim().toLocaleLowerCase())),s=e.zones().filter(S=>S.seatCount>0&&!i.has(S.label.trim().toLocaleLowerCase())),r=e.sections().filter(S=>S.seatCount>0&&!i.has(S.label.trim().toLocaleLowerCase())),o=s.length>1?[]:r,a=t.length>1,l=s.length>1,c=o.length>1;if(!a&&!l&&!c)return null;let d=document.createElement("div");d.className="sl-view3d-nav";let p=null,u=document.createElement("button");u.type="button",u.className="sl-view3d-nav-toggle",u.setAttribute("aria-expanded","false");let h='<svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="12" r="9"/><path d="M15.5 8.5l-2 5-5 2 2-5z"/></svg>',g=document.createElement("span");u.innerHTML=h,u.appendChild(g);let m=()=>{for(let S of d.querySelectorAll(":scope > div")){let L=S.querySelector('[aria-pressed="true"]');!L||S.scrollWidth<=S.clientWidth||L.scrollIntoView({block:"nearest",inline:"nearest"})}},y=()=>{if(p)return p;for(let S of d.querySelectorAll(":scope > div")){let L=S.querySelector('button[aria-pressed="true"]'),I=L?.textContent?.trim();if(I&&L?.dataset.floor!=="")return I}return a&&(l||c)?v("picker.levelsAndAreas","Levels & areas"):a?v("picker.levels","Levels"):v("picker.areas","Areas")},k=S=>{d.classList.toggle("is-open",S),u.setAttribute("aria-expanded",String(S)),S&&typeof requestAnimationFrame=="function"&&requestAnimationFrame(m),g.textContent=y()};u.addEventListener("click",()=>k(!d.classList.contains("is-open"))),d.addEventListener("keydown",S=>{S.key!=="Escape"||!d.classList.contains("is-open")||(S.preventDefault(),S.stopPropagation(),k(!1),u.focus())});let w=document.createElement("button");w.type="button",w.className="sl-view3d-nav-close",w.innerHTML='<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M18 6L6 18M6 6l12 12"/></svg>';let T=v("picker.closeVenueNavigation","Close venue navigation");w.setAttribute("aria-label",T),w.title=T,w.addEventListener("click",()=>{k(!1),u.focus()}),k(!1),d.appendChild(u);let b=S=>{},A=S=>{};if(a){let S=document.createElement("div");S.setAttribute("role","group"),S.setAttribute("aria-label",v("picker.levels","Levels"));let L=[];A=H=>{L.forEach(B=>{B.setAttribute("aria-pressed",String((B.dataset.floor===""?null:Number(B.dataset.floor))===H))})};let I=H=>{e.focusFloor(H)&&(A(H),b(H))},P=(H,B)=>{let F=document.createElement("button");F.type="button",F.textContent=H,F.dataset.floor=B===null?"":String(B),F.setAttribute("aria-pressed",String(B===null)),F.addEventListener("click",()=>{I(B),k(!1)}),L.push(F),S.appendChild(F)};P(v("picker.allLevels","All levels"),null);for(let H of t)P(H.label||un("picker.levelNumber",{number:H.index+1}),H.index);d.appendChild(S)}if(l||c){let S=document.createElement("div");S.setAttribute("role","group"),S.setAttribute("aria-label",v("picker.areas","Areas"));let L=l?s.map(P=>({id:P.id,label:P.label||P.id,go:()=>{e.focusZone(P.id)}})):o.map(P=>({id:P.id,label:P.label||P.id,floorIndex:P.floorIndex,go:()=>{e.focusSection(P.id),Number.isFinite(P.floorIndex)&&A(P.floorIndex)}})),I=P=>{let H=l||P===null?L:L.filter(B=>B.floorIndex===void 0||B.floorIndex===P);if(S.replaceChildren(),!H.length){S.remove();return}if(S.isConnected||d.insertBefore(S,w.isConnected?w:null),!l&&H.length>Kl){let B=document.createElement("select");B.setAttribute("aria-label",v("picker.jumpToSection","Jump to section"));let F=document.createElement("option");F.value="",F.textContent=v("picker.jumpToSection","Jump to section"),B.appendChild(F);for(let te of H){let ne=document.createElement("option");ne.value=te.id,ne.textContent=te.label,B.appendChild(ne)}B.addEventListener("change",()=>{H.find(te=>te.id===B.value)?.go()}),S.appendChild(B);return}for(let B of H){let F=document.createElement("button");F.type="button",F.textContent=B.label,F.dataset.area=B.id,F.addEventListener("click",()=>{p=B.label,B.go(),k(!1)}),S.appendChild(F)}};b=I,I(null)}return d.appendChild(w),n.appendChild(d),d}var vi=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 r=document.createElement("button");r.type="button",r.className="main",r.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(r,o),e.appendChild(t),this.chip=t}let i=this.host.savedSeatIds().length,s=t.querySelector(".main");s&&(s.textContent=i>1?un("picker.compareCount",{count:i}):v("picker.oneSeatSaved","1 seat saved"),s.setAttribute("aria-label",i>1?un("picker.openComparisonOfSeats",{count:i}):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 Dr(n){return!n?.querySelector('[data-ref="zfs"]')}import{t as Br}from"@seatlayer/core";var Wl=900,Yl=450;function Ql(n){switch(n){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 Nr(n,e){let t=document.createElement("button");t.type="button",t.className="sl-view3d-recentre sl-mo-rotate-in",t.textContent="\u25CE";let i=v("picker.recentreOnStage","Recentre on the stage");t.setAttribute("aria-label",i),t.title=i,t.addEventListener("click",()=>{e.handle()?.recentreSeatView()});let s=document.createElement("div");s.className="sl-view3d-stop",s.setAttribute("role","status"),s.setAttribute("aria-live","polite"),n.append(t,s);let r=null,o=null;return{onStopChange(a){if(r&&(clearTimeout(r),r=null),o&&(clearTimeout(o),o=null),!a){s.classList.remove("is-shown"),s.textContent="",o=setTimeout(()=>{o=null,n.classList.remove("is-seat-view")},Yl);return}n.classList.add("is-seat-view"),s.textContent=Ql(a),s.classList.add("is-shown"),r=setTimeout(()=>{r=null,s.classList.remove("is-shown")},Wl)},dispose(){r&&(clearTimeout(r),r=null),o&&(clearTimeout(o),o=null),t.remove(),s.remove(),n.classList.remove("is-seat-view")}}}var Xl=44,Zl=92;function $r(n,e,t,i={}){let s=n?.sectionLabel,r=U(n),o=Jl(n,e),a=[s,r?Br("picker.rowLabel",{label:r}):null,o?Br("picker.seatLabel",{label:o}):null].filter(Boolean).join(" \xB7 "),l=i.maxChars??(i.narrow?Xl:Zl);for(let c of[t,i.shortTail??t,null]){let d=[a,c].filter(Boolean).join(" \xB7 ");if(d.length<=l||c==null)return d}return a}function Jl(n,e){if(n?.seatNumber)return n.seatNumber;let t=n?.displayLabel??e,i=s=>{!s||!t.startsWith(s)||t.length<=s.length||(t=t.slice(s.length).replace(/^[\s·\-\/_]+/,""))};return i(n?.sectionLabel),i(U(n)),t}var Fr="sl:sheet-hint";function Vr(n){let e=n.boot;if(!e?.isConnected)return;if(n.reducedMotion){e.remove();return}e.classList.add("is-going"),setTimeout(()=>e.remove(),200);let t=document.createElement("div");t.className="sl-shells-in",t.setAttribute("aria-hidden","true"),n.map?.appendChild(t),setTimeout(()=>t.remove(),650),n.rail?.classList.add("is-in"),n.root?.classList.add("is-arriving"),setTimeout(()=>{n.rail?.classList.remove("is-in"),n.root?.classList.remove("is-arriving"),ec(n.root)},900)}function ec(n){if(!n||n.dataset.layout!=="narrow")return;try{if(window.sessionStorage.getItem(Fr))return;window.sessionStorage.setItem(Fr,"1")}catch{}let e=n.querySelector(".sl-sheet-grab");e&&(e.classList.add("sl-mo-hint"),e.addEventListener("animationend",()=>e.classList.remove("sl-mo-hint"),{once:!0}))}function zr(n,e){n.addEventListener("keydown",t=>{if(t.key==="Escape"){for(let i of e())if(i.open()){t.preventDefault(),t.stopPropagation(),i.close();return}}})}function yi(n){let e=n.committedSelection(),t=n.controller.getGAAreas(),i=n.hold?.items??[],s=new Set(i.map(u=>u.label)),r=is(n,t,i),o=Be(n.gaQty,i),a=i.reduce((u,h)=>u+n.paidPrice(h.categoryKey,h.tierId,h.unitPrice,h.label)*(h.quantity??1),0),l=i.reduce((u,h)=>u+(h.quantity??1),0),c=e.filter(u=>!s.has(u.label)),d=c.reduce((u,h)=>u+n.paidPrice(h.categoryKey,h.tierId??null,h.price,h.label)*(h.quantity??1),0)+r+a,p=c.reduce((u,h)=>u+(h.quantity??1),0)+o+l;return{seats:e,freshSeats:c,gaAreas:t,heldItems:i,heldLabels:s,heldCount:l,total:d,count:p}}function wi(n,e){let t=e.tiers?.length?e.tiers[0].price:e.price;return t===void 0||!e.key?t:n.paidPrice(e.key,e.tiers?.[0]?.id??null,t)}function xi(n,e){let t=e.tiers?.length?e.tiers.map(i=>n.paidPrice(e.key,i.id??null,i.price)):e.price==null?[]:[n.paidPrice(e.key,null,e.price)];if(e.key)for(let i of n.pricesByChannel.values())for(let s of i)s.categoryKey===e.key&&t.push(s.price);return t.length?{min:Math.min(...t),max:Math.max(...t)}:void 0}var Mt="seatlayer_";function tc(){let n=globalThis;return n.document?.modelContext??n.navigator?.modelContext??null}function re(n,e){return e?{ok:!1,reason:n,message:e}:{ok:!1,reason:n}}function ic(n){return Array.isArray(n)?n.filter(e=>typeof e=="string"&&!!e):[]}function nc(n,e){let t=n.event();if(!t)return re("not_loaded","The seat map has not finished loading.");let i=n.selectionLimits();return{ok:!0,event:t,selection:{max:i.max,...i.required!=null?{required:i.required}:{}},categories:n.categories(),zones:n.zones(),hasPremiumSeats:n.hasPremiumSeats(),holdsAllowed:e}}function jr(n,e){let t=s=>!!s&&s.toLowerCase()===e.toLowerCase(),i=n.find(s=>t(s.key??s.id))??n.find(s=>t(s.label));return i?.key??i?.id??null}function Gr(n,e){let t=e.map(i=>n.describeSeat(i.id));return{seatIds:e.map(i=>i.id),labels:e.map(i=>i.label),section:t[0]?.section??"",row:t[0]?.row??"",seats:e.map((i,s)=>t[s]?.seat||i.label),category:t[0]?.category??e[0].categoryKey,unitPrice:e[0].price,total:e.reduce((i,s)=>i+s.price,0)}}function sc(n,e,t){let i=new Map;for(let r of e){let o=i.get(r.rowKey);o?o.push(r):i.set(r.rowKey,[r])}let s=[];for(let r of i.values()){let o=[...r].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 d=a;d+t<=l;d+=t)s.push(Gr(n,o.slice(d,d+t)));a=l}}return s}function rc(n,e,t){let i=new Map;for(let r of e){let o=i.get(r.sectionKey);o?o.push(r):i.set(r.sectionKey,[r])}let s=[];for(let r of i.values()){if(r.length<t)continue;let o=[...r].sort((a,l)=>a.price!==l.price?l.price-a.price:a.rowKey.localeCompare(l.rowKey)||a.index-l.index);s.push(Gr(n,o.slice(0,t)))}return s}function oc(n,e){if(!n.event())return re("not_loaded","The seat map has not finished loading.");let i=n.selectionLimits(),s=Math.floor(Number(e.count));if(!Number.isInteger(s)||s<1||s>i.max)return re("bad_count",`count must be a whole number between 1 and ${i.max}.`);let r=Number.isInteger(Number(e.limit))?Math.max(1,Math.min(20,Number(e.limit))):5,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,d=l?jr(n.categories(),l):null;if(l&&!d)return re("no_match",`No ticket type called "${l}".`);let p=c?jr(n.zones(),c):null;if(c&&!p)return re("no_match",`No zone called "${c}".`);let u=n.seats().filter(m=>m.available);if(!u.length)return re("sold_out");let h=u.filter(m=>(!d||m.categoryKey===d)&&(!p||m.zoneId===p)&&(a==null||m.price<=a));if(!h.length)return re("no_match");let g=o?sc(n,h,s):rc(n,h,s);return g.length?(g.sort((m,y)=>y.unitPrice!==m.unitPrice?y.unitPrice-m.unitPrice:m.row.localeCompare(y.row)||m.labels[0].localeCompare(y.labels[0])),{ok:!0,groups:g.slice(0,r),searched:{count:s,filters:{...a!=null?{max_price:a}:{},...d?{category:d}:{},...p?{zone:p}:{},together:o}}}):re(o?"not_enough_together":"no_match")}function qr(n){return{ok:!0,...n.selection()}}function ac(n,e){let t=n.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 i=ic(e.seat_ids);return i.length?(n.clearSelection(),n.selectObjects(i),qr(n)):re("nothing_requested","Pass one or more seat ids or labels in seat_ids.")}function lc(n,e){let t=async s=>{try{return await s()}catch(r){return re("error",r instanceof Error?r.message:String(r))}},i=[{name:`${Mt}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(()=>nc(n,e))},{name:`${Mt}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:s=>t(()=>oc(n,s))},{name:`${Mt}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:s=>t(()=>ac(n,s))},{name:`${Mt}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(()=>qr(n))}];return e&&i.push({name:`${Mt}hold_selection`,title:"Reserve the selected seats",description:"Reserve the currently selected seats for this buyer for a limited time, exactly as pressing the checkout button would. Confirm with the buyer before calling this.",inputSchema:{type:"object",properties:{},additionalProperties:!1},annotations:{readOnlyHint:!1,untrustedContentHint:!0},execute:()=>t(()=>n.hold())}),i}async function Ur(n,e={}){let t=tc();if(!t||typeof t.registerTool!="function")return null;let i=new AbortController,s=lc(n,!!e.holds),r=[],o=e.exposedTo?.length?[...new Set(e.exposedTo)]:void 0;try{for(let a of s)await t.registerTool(a,{signal:i.signal,...o?{exposedTo:o}:{}}),r.push(a.name)}catch(a){console.warn("seatmap: WebMCP tools could not be registered",a)}return r.length?{names:r,dispose:()=>{if(i.abort(),typeof t.unregisterTool=="function")for(let a of r)try{t.unregisterTool(a)}catch{}}}:null}async function Kr(n){let e=n.opts.webMcp;if(!e||n.destroyed)return;let t=typeof e=="object"&&!!e.holds,i=typeof e=="object"?e.exposedTo:void 0;try{n.webMcp=await Ur(fn(n,t),{holds:t,exposedTo:i}),n.destroyed&&mn(n)}catch(s){console.warn("seatmap: WebMCP registration failed",s)}}function mn(n){n.webMcp?.dispose(),n.webMcp=null}function fn(n,e){let t=(i,s)=>{if(Number.isInteger(i.logicalSeatIndex))return i.logicalSeatIndex;let r=i.id.lastIndexOf(":"),o=r<0?NaN:Number(i.id.slice(r+1));return Number.isFinite(o)?o:s};return{event:()=>{let i=n.renderInfo;return i?{name:i.eventName??"",venue:i.venue??null,startsAt:i.startsAt??null,timezone:i.timezone??null,currency:n.currency,salesClosed:n.salesClosed}:null},selectionLimits:()=>({max:n.maxTickets,required:n.exactTickets}),categories:()=>{let i=n.controller.categoryAvailability();return(n.controller.doc?.categories??[]).filter(s=>!s.notForSale).map(s=>{let r=xi(n,s),o=wi(n,s);return{key:s.key,label:s.label??s.key,...o===void 0?{}:{price:o},...r&&r.min!==r.max?{priceRange:r}:{},available:i[s.key]??0}})},zones:()=>n.controller.getBestAvailableZones(),hasPremiumSeats:()=>n.controller.hasPremiumSeats(),seats:()=>{let i=n.controller.getActiveFloorId(),s=[];return n.allSeats().forEach((r,o)=>{if(r.floorId&&i&&r.floorId!==i)return;let a=n.controller.getStatus(r.id)??"free",l=n.controller.doc?.categories.find(d=>d.key===r.categoryKey),c=l?.tiers?.length?l.tiers[0].price:l?.price??0;s.push({id:r.id,label:r.label,rowKey:r.logicalRowId??r.rowId,sectionKey:r.sectionId??r.rowId,index:t(r,o),categoryKey:r.categoryKey,price:n.paidPrice(r.categoryKey,l?.tiers?.[0]?.id??null,c,r.label),...r.zoneId?{zoneId:r.zoneId}:{},available:a==="free"&&!l?.notForSale})}),s},describeSeat:i=>{let s=n.controller.seatDetails(i);return s?{section:s.sectionLabel??"",row:U(s)??"",seat:s.seatNumber??s.label,category:s.categoryLabel??s.categoryKey}:null},selection:()=>{let{freshSeats:i,total:s,count:r}=yi(n);return{seats:i.map(o=>({id:o.id,label:o.label,section:o.sectionLabel??"",row:U(o)??"",seat:o.seatNumber??o.label,category:o.categoryKey,price:n.paidPrice(o.categoryKey,o.tierId??null,o.price,o.label)})),count:r,total:s,currency:n.currency,hold:n.hold?{id:n.hold.holdId,expiresAt:n.hold.expiresAt}:null,validity:n.getSelectionValidity()}},clearSelection:()=>n.clearSelection(),selectObjects:i=>{n.selectObjects(i)},hold:()=>e?cc(n):Promise.resolve({ok:!1,reason:"not_allowed"})}}async function cc(n){if(n.salesClosed)return{ok:!1,reason:"event_closed"};if(!n.totalTicketCount())return{ok:!1,reason:"nothing_selected"};let e=n.controller.getSelectionValidity(n.totalTicketCount());return e&&!e.isValid?{ok:!1,reason:"invalid_selection"}:(await n.handleCta(),n.hold?{ok:!0,hold:{id:n.hold.holdId,expiresAt:n.hold.expiresAt}}:{ok:!1,reason:"hold_failed"})}function gn(n){return{renderingTimeMillis:n.ms,performanceProfile:n.performanceProfile,seatCount:n.seatCount,objectCount:n.objectCount,sectionCount:n.sectionCount,view:n.view,eventKey:n.eventKey,chartName:n.chartName,floorCount:n.floorCount,transport:n.transport,load:n.load,metricScope:n.metricScope,operationalTelemetryReporter:"sdk"}}function Wr(n,e){ke({apiBase:n.apiBase,event:n.eventKey,scope:n.metricScope,surface:n.surface,outcome:"success",ms:n.ms,performanceProfile:n.performanceProfile,chartDelivery:n.chartDelivery,seats:n.seatCount,floors:n.floorCount,view:n.view,load:n.load,transport:n.transport}),e("chart_rendered",gn(n))}import{seatConfidenceDisclosure as dc}from"@seatlayer/core/core/seatConfidence";function Y(n){return String(n??"").replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}function Yr(n){let e=dc(n.seat.confidenceEvidence),t=n.seat.confidenceEvidence,i=e.limitations.length?`<h4>Known limits</h4><ul>${e.limitations.map(c=>`<li>${Y(c)}</li>`).join("")}</ul>`:"",s=e.modeledTarget?`<div><dt>Modeled target</dt><dd>${Y(e.modeledTarget)}</dd></div>`:"",r=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(n.seat.commercial)||n.restrictionFallback,a=`<div><dt>View restriction</dt><dd>${Y(o)}</dd></div>`+(n.seat.commercial?.note?`<div><dt>Organizer note</dt><dd>${Y(n.seat.commercial.note)}</dd></div>`:""),l=n.canReport?'<button type="button" data-report>Report this view</button><p data-report-status role="status" aria-live="polite"></p>':"";return`<div class="sl-view3d-passport-scrim" aria-hidden="true"></div><section class="sl-view3d-passport" role="dialog" aria-modal="true" aria-labelledby="sl-view3d-passport-title"><header><div><span>Seat confidence passport</span><strong id="sl-view3d-passport-title">${Y(n.title)}</strong></div><button type="button" data-close aria-label="Close seat confidence passport">\xD7</button></header><div class="sl-view3d-passport-summary"><strong>${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+s+r+`</dl>${i}<p class="sl-view3d-passport-note">This passport describes supplied evidence and known limits. It does not guarantee that every temporary obstruction or real-world condition is knowable before the event build.</p>`+l+"</section>"}function Qr(n){return n?n.closest("[data-report]")?"report":n.closest("[data-close]")||n.classList.contains("sl-view3d-passport-scrim")?"close":null:null}function ki(n,e,t){let i=n?.querySelector("[data-report]"),s=n?.querySelector("[data-report-status]");i&&(i.disabled=e!=="failed",i.textContent=e==="received"?"Report received":"Report this view"),s&&(s.setAttribute("role",e==="failed"?"alert":"status"),s.textContent=e==="sending"?"Sending report\u2026":e==="received"?`Report received. Reference ${t??""}.`:"The report could not be sent. Please try again.")}function bn(n,e,t=null){let i=n.view3dEl;if(!i)return;Ht(n,!1);let s=e.confidenceEvidence,r=n.controller.seatDetails(e.id),o=document.createElement("div");o.className="sl-view3d-passport-shell",o.innerHTML=Yr({seat:e,title:r?.displayLabel??e.displayLabel??e.label,restrictionFallback:n.tf("picker.noAuthoredRestriction","No organizer-authored restriction"),canReport:typeof n.api.reportViewEvidence=="function"});let a=[...new Set([...i.children,...[...n.els.map.children].filter(u=>u!==i)])].filter(u=>u instanceof HTMLElement),l=a.map(u=>({element:u,inert:u.inert,ariaHidden:u.getAttribute("aria-hidden")}));for(let u of a)u.inert=!0,u.setAttribute("aria-hidden","true");i.appendChild(o),i.classList.add("has-passport"),n.view3dPassportEl=o;let c=o.querySelector(".sl-view3d-passport"),d=()=>[...c.querySelectorAll('button:not(:disabled),[href],[tabindex]:not([tabindex="-1"])')],p=u=>{if(u.key==="Escape"){u.preventDefault(),u.stopPropagation(),u.stopImmediatePropagation(),Ht(n);return}if(u.key!=="Tab")return;let h=d();if(!h.length)return;let g=h[0],m=h[h.length-1];u.shiftKey&&document.activeElement===g?(u.preventDefault(),m.focus()):!u.shiftKey&&document.activeElement===m&&(u.preventDefault(),g.focus())};window.addEventListener("keydown",p,!0),n.view3dPassportCleanup=()=>{window.removeEventListener("keydown",p,!0);for(let m of l)m.element.inert=m.inert,m.ariaHidden===null?m.element.removeAttribute("aria-hidden"):m.element.setAttribute("aria-hidden",m.ariaHidden);let u=t?.isConnected?t:n.confirmEl?.querySelector(".sl-confirm-confidence")??n.view3dCompareEl?.querySelector("[data-passport-seat]")??null,h=u?.closest(".sl-confirm,.sl-view3d-compare");h?.isConnected&&(h.inert=!1,h.removeAttribute("aria-hidden")),o.remove(),i.classList.remove("has-passport"),n.view3dPassportEl===o&&(n.view3dPassportEl=null);let g=u??n.view3dCompareEl?.querySelector("[data-passport-seat]")??n.confirmEl?.querySelector(".sl-confirm-confidence")??n.view3dCompareChip.mainButton();(t?.isConnected?t:g)?.focus()},o.addEventListener("click",u=>{let h=Qr(u.target instanceof HTMLElement?u.target:null);h==="close"&&Ht(n),h==="report"&&pc(n,e)}),requestAnimationFrame(()=>d()[0]?.focus()),n.emit3dAnalytics("3d_confidence_passport_opened",{seatId:e.id,evidenceId:s?.evidenceId??null,eventConfigurationId:s?.eventConfigurationId??null,modelLevel:s?.modelLevel??"unverified",realityLevel:s?.realityLevel??"none"})}async function pc(n,e){if(n.api.reportViewEvidence){ki(n.view3dPassportEl,"sending");try{let t=await n.api.reportViewEvidence(n.opts.event,{seatId:e.id,evidenceId:e.confidenceEvidence?.evidenceId});n.emit3dAnalytics("3d_confidence_view_reported",{seatId:e.id,evidenceId:e.confidenceEvidence?.evidenceId??null}),ki(n.view3dPassportEl,"received",t.report.id)}catch{ki(n.view3dPassportEl,"failed")}}}function Ht(n,e=!0){let t=n.view3dPassportCleanup;if(n.view3dPassportCleanup=null,!t){n.view3dPassportEl?.remove(),n.view3dPassportEl=null,n.view3dEl?.classList.remove("has-passport");return}e||(document.activeElement instanceof HTMLElement?document.activeElement:null)?.blur(),t(),e||n.root?.focus({preventScroll:!0})}function Xr(n){let e=n.view3dEl;if(!e||n.view3dCompareSeatIds.length<2)return;Fe(n,!1);let t=n.view3dCompareSeatIds.map(h=>n.view3dComparisonSnapshot(h)).filter(h=>!!h);if(t.length<2){n.clearView3dComparison();return}let i=h=>x(h),s=t.some(h=>!!h.price),r=document.createElement("div");r.className="sl-view3d-compare-shell";let o=t.map((h,g)=>`<article><span>Seat ${g===0?"A":"B"}</span><strong>${i(h.label)}</strong><small>Section ${i(h.section)} \xB7 Row ${i(h.row)}</small><dl>`+(s?`<div><dt>Current price</dt><dd>${i(h.price)}</dd></div>`:"")+`<div><dt>Ticket type</dt><dd>${i(h.category)}</dd></div><div><dt>Availability</dt><dd>${i(h.availability)}</dd></div><div><dt>View source</dt><dd>${i(h.viewSource)}</dd></div><div><dt>View restriction</dt><dd>${i(h.limited)}</dd></div><div><dt>Seat confidence</dt><dd>${i(h.confidence.headline)}</dd></div><div><dt>Reality check</dt><dd>${i(h.confidence.reality)}</dd></div><div><dt>Accessibility</dt><dd>${i(h.accessibility)}</dd></div></dl><div class="sl-view3d-compare-actions"><button type="button" data-passport-seat="${i(h.seat.id)}">Passport</button><button type="button" data-view-seat="${i(h.seat.id)}">View seat</button><button type="button" class="select" data-select-seat="${i(h.seat.id)}"${h.selectable?"":" disabled"}>Select seat</button></div></article>`).join("");r.innerHTML=`<div class="sl-view3d-compare-scrim" aria-hidden="true"></div><section class="sl-view3d-compare" role="dialog" aria-modal="true" aria-labelledby="sl-view3d-compare-title"><header><div><span>Seat inspection</span><strong id="sl-view3d-compare-title">Compare disclosed attributes</strong></div><button type="button" data-close aria-label="Close seat comparison">\xD7</button></header><p class="sl-view3d-compare-note">${s?"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(r),e.classList.add("has-comparison"),n.view3dCompareEl=r;let d=r.querySelector(".sl-view3d-compare"),p=()=>[...d.querySelectorAll('button:not(:disabled),[href],[tabindex]:not([tabindex="-1"])')],u=h=>{if(h.key==="Escape"){h.preventDefault(),Fe(n);return}if(h.key!=="Tab")return;let g=p();if(!g.length)return;let m=g[0],y=g[g.length-1];h.shiftKey&&document.activeElement===m?(h.preventDefault(),y.focus()):!h.shiftKey&&document.activeElement===y&&(h.preventDefault(),m.focus())};window.addEventListener("keydown",u),n.view3dCompareCleanup=()=>{window.removeEventListener("keydown",u);for(let h of c)h.element.inert=h.inert,h.ariaHidden===null?h.element.removeAttribute("aria-hidden"):h.element.setAttribute("aria-hidden",h.ariaHidden);r.remove(),e.classList.remove("has-comparison"),n.view3dCompareEl===r&&(n.view3dCompareEl=null),a?.isConnected?a.focus():n.view3dCompareChip.mainButton()?.focus()},r.querySelector("[data-close]")?.addEventListener("click",()=>Fe(n)),r.querySelectorAll("[data-passport-seat]").forEach(h=>h.addEventListener("click",()=>{let g=h.dataset.passportSeat,m=g?n.allSeats().find(y=>y.id===g):void 0;m&&bn(n,m,h)})),r.querySelectorAll("[data-view-seat]").forEach(h=>h.addEventListener("click",()=>{let g=h.dataset.viewSeat;Fe(n,!1),g&&n.view3dHandle?.flyToSeat(g)})),r.querySelectorAll("[data-select-seat]").forEach(h=>h.addEventListener("click",()=>{let g=h.dataset.selectSeat;g&&hc(n,g)})),requestAnimationFrame(()=>p()[0]?.focus()),n.emit3dAnalytics("3d_comparison_opened",{seatIds:n.view3dCompareSeatIds.slice()})}function Fe(n,e=!0){let t=n.view3dCompareCleanup;if(n.view3dCompareCleanup=null,!t){n.view3dCompareEl?.remove(),n.view3dCompareEl=null,n.view3dEl?.classList.remove("has-comparison");return}e||(document.activeElement instanceof HTMLElement?document.activeElement:null)?.blur(),t(),e||n.root?.focus({preventScroll:!0})}function hc(n,e){if(n.salesClosed){n.toast(n.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}let t=n.allSeats().find(s=>s.id===e);if(!t)return;if(Fe(n,!1),!n.controller.select([e]).length){n.syncSelectionTo3d(),n.toast(n.tf("picker.seatNoLongerAvailable","That seat is no longer available."),"warning");return}n.syncSelectionTo3d(),n.showConfirm(t),n.emit3dAnalytics("3d_comparison_selected",{seatId:e})}function Zr(n,e){n.querySelector(".sl-view3d-unavailable")?.remove();let{tf:t}=e,i=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.")},s=document.createElement("div");s.className="sl-view3d-unavailable",s.dataset.state=e.visualState,s.setAttribute("role","status"),s.setAttribute("aria-live","polite");let r=document.createElement("span");r.className="sl-view3d-unavailable-eyebrow",r.textContent=e.location;let o=document.createElement("strong");o.textContent=i.title;let a=document.createElement("div");a.className="sl-view3d-unavailable-copy",a.append(r,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=i.message,s.append(a,l,c),l.addEventListener("click",()=>vn(n)),n.appendChild(s),Wt(s,e.anchor??null)}function vn(n){let e=n?.querySelector(".sl-view3d-unavailable:not([data-leaving])");e&&(e.dataset.leaving="true",Me(e))}import{t as Si}from"@seatlayer/core";function Jr(n){return Array.isArray(n)?n.reduce((e,t)=>t.type==="minimumSelectedPlaces"?Math.max(e,t.minimum):e,0):0}function yn(n,e,t=!1){let i=n.violations[0];return i==="numberOfPlacesToSelect"?n.remaining>0?Si("picker.selectExactMore",{count:n.remaining}):Si("picker.selectExactCount",{count:n.required}):i==="minimumSelectedPlaces"?Si("picker.selectMinimumMore",{count:n.remaining}):t?e("picker.adjustSeatSelection","Adjust seat selection"):i==="consecutiveSeats"?e("picker.selectSeatsTogether","Choose seats together in the same row and ticket category."):Si("picker.orphanHint")}import{t as Ve,tCount as eo}from"@seatlayer/core";function Ot(n){let e=Math.max(0,n),t=Math.floor(e/6e4),i=String(Math.floor(e%6e4/1e3)).padStart(2,"0");return`${t}:${i}`}function to(n){let e=n.performanceLabel?`<div class="sl-chip-when">${R(n.performanceLabel)}</div>`:"",t=n.performanceDates?.labels.length?`<div class="sl-chip-dates"><span class="sl-chip-dates-summary">${R(n.performanceDates.summary)}</span><span class="sl-chip-date-list">${n.performanceDates.labels.map(i=>`<span class="sl-chip-date">${R(i)}</span>`).join("")}</span></div>`:"";return e+uc(n)+t}function uc(n){let{d:e,area:t,label:i,objectType:s,quantity:r=1,identity:o}=n,a=T=>String(T??"\u2014").replace(/[&<>"]/g,b=>({"&":"&","<":"<",">":">",'"':"""})[b]),l=s==="ga"?"ga":e?.objectType??s,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")),d=o?.rowLabel??o?.displayLabel??e?.rowLabel??e?.displayLabel??t?.label??i,p=n.categoryLabel?.trim()??"",u="",h=[];l==="table"&&o?.bookingMode?(u=`${c} ${d}`,h.push([v("picker.guests","Guests"),String(r)])):l==="ga"?(u=String(t?.displayLabel??d),r>1&&h.push([v("picker.tickets","Tickets"),String(r)])):l==="booth"?(u=e?.sectionLabel??`${c} ${d}`,e?.sectionLabel&&h.push([c,String(d)])):!e?.sectionLabel&&!e?.rowLabel&&!e?.seatNumber?u=String(d):(u=e.sectionLabel??"",e.rowLabel&&h.push([c,String(U(e)??e.rowLabel)]),e.seatNumber&&h.push([v("picker.seat","Seat"),String(e.seatNumber)]));let g=!u&&!!p,m=u||p||String(d),y=!!p&&!g&&p!==m,k=h.map(([T,b])=>`<span class="sl-chip-seg" data-fit-seg><span class="w">${a(T)}</span> <b>${a(b)}</b></span>`);y&&k.push(`<span class="sl-chip-seg" data-fit-seg data-fit-type><span class="w">${a(p)}</span></span>`);let w=[m,...h.map(([T,b])=>`${T} ${b}`),y?p:""].filter(Boolean).join(" \xB7 ");return`<div class="sl-chip-id"><span class="sl-sr">${a(w)}</span><span class="sl-chip-name" aria-hidden="true">${a(m)}</span>`+(k.length?`<span class="sl-chip-pos" aria-hidden="true">${k.join("<i>\xB7</i>")}</span>`:"")+"</div>"}function wn(n,e){let t=R(n),i=e?R(e):"";return'<div class="sl-chip-rail">'+(e?`<button type="button" class="view" data-view-label="${i}" aria-label="${R(Ve("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 io(n){return n.salesClosed||n.hasHold||n.ctaPhase!=="idle"||n.formOpen||n.room<=0?null:Math.max(1,Math.min(n.wanted,n.room))}function no({count:n,total:e,pendingCount:t,ctaPhase:i,hasHold:s,salesClosed:r,suppressPricing:o=!1,fromPrice:a,addMore:l,offerFind:c=!1,holdTime:d,money:p}){if(n&&i==="holding")return`<span>${v("picker.securingSeats","Securing your seats\u2026")}</span>`;if(n&&i==="checkout")return o?`<span>${v("picker.seatsSecuredOpeningCheckout","Seats secured. Opening checkout\u2026")}</span>`:`<span>${Ve("picker.peekSecured",{count:n,total:p(e)})}</span>`;if(n)return`<span class="sl-peek-sum">${eo("picker.ticketsCount",n)}</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">${s&&t?v("picker.secureMore","Secure more"):v("picker.continue","Continue")}`+(o?"":`<span class="sl-peek-total">${p(e)}</span>`)+(s&&d?`<span class="sl-peek-time" aria-hidden="true">${d}</span>`:"")+"</button>";if(r)return`<span>${v("picker.salesClosedPill","Sales are closed")}</span>`;let u=!o&&a!=null?p(a):null;return`<span class="sl-peek-sum">${u!=null?Ve("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 xn(n,e=Date.now()){return Ve("picker.holdReassurance",{time:Ot(n-e)})}function so(n){return n.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>${Ve("picker.willFindSeatsTogether",{count:n.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>`+(n.offerPremium?`<button type="button" class="sl-ba-premium${n.premium?" on":""}" data-ba-premium aria-pressed="${n.premium?"true":"false"}"><span class="star" aria-hidden="true">\u2605</span>${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>${n.quantity}</span><button type="button" data-ba="1" aria-label="${v("picker.moreSeats","More seats")}">+</button></div>`+(n.categories.length>1?`<select class="sl-ba-cat" aria-label="${R(v("picker.preferredTicketType","Preferred ticket type"))}" data-ba-cat><option value="">${R(v("picker.anyTicketType","Any ticket type"))}</option>`+n.categories.map(e=>`<option value="${R(e.key)}"${n.selectedCategory===e.key?" selected":""}>${R(e.label)}</option>`).join("")+"</select>":'<span class="sl-ba-cat" aria-hidden="true"></span>')+(n.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>`+n.zones.map(e=>`<option value="${R(e.id)}"${n.selectedZone===e.id?" selected":""}>${R(e.label)}</option>`).join("")+"</select>":"")+`<button type="button" class="sl-ba-go${n.busy?" sl-busy":""}"${n.busy?" disabled":""}>`+(n.busy?`<span class="sl-ba-spin" aria-hidden="true"></span>${v("picker.findingBestSeats","Finding the best seats\u2026")}`:eo("picker.findBestSeatsCount",n.quantity))+"</button>"+(n.reopened?`<button type="button" class="sl-ba-back" data-ba-close>${v("picker.keepMyPicks","Keep my picks")}</button>`:"")+"</div>"}function ro(n){if(n.salesClosed&&!n.hasPicks){let e=n.whenText?`<span class="when">${R(n.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 n.hasPicks?"":n.hasGaAreas?`<div class="sl-tray-hint">${n.seated?n.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."):n.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">${n.groupMode==="per_performance"?v("picker.groupPerPerformanceTrayHint","Choose seats for this performance, then complete every date above."):n.groupMode?v("picker.groupTrayHint","Choose seats once \u2014 the same seats will be held for every performance."):n.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>`}function oo(n){return{title:Ve("picker.securedCount",{count:n.secured}),copy:n.pendingCount?Ve("picker.moreSelectedCount",{count:n.pendingCount}):xn(n.expiresAt),change:n.releasing?v("picker.releasingEllipsis","Releasing\u2026"):v("picker.change","Change")}}import{t as Sn,tCount as mc}from"@seatlayer/core";var kn=4,fc=6;function gc(n){let e=n.trim();return/^[0-9]{1,4}$/.test(e)?Number(e):null}function ao(n){return[n.held?"h":"s",n.section,n.rowLabel,n.categoryLabel,n.amountText].join(" ")}function bc(n){if(n.length===1)return n[0];let e=n.map(gc);if(e.every(i=>i!==null)){let i=[...e].sort((o,a)=>o-a);if(i.every((o,a)=>a===0||o===i[a-1]+1))return`${i[0]}\u2013${i[i.length-1]}`;let r=i.slice(0,3).join(", ");return i.length>3?`${r} +${i.length-3}`:r}let t=n.slice(0,3).join(", ");return n.length>3?`${t} +${n.length-3}`:t}function vc(n){let e=[];for(let t of n){let i=e[e.length-1];!!i&&t.groupable&&i.members[0].groupable&&ao(i.members[0])===ao(t)?i.members.push(t):e.push({members:[t],seatsLabel:""})}for(let t of e)t.seatsLabel=bc(t.members.map(i=>i.seatLabel));return e}function co(n,e,t,i){let s=R;return` data-key="${s(n)}"`+(t.length?` data-held="${s(encodeURIComponent(t.join(`
|
|
2766
|
-
`)))}"`:"")+(e.length?` data-seat="${s(e.join(" "))}"`:"")+(i?` data-locate="${s(i)}"`:"")}function po(n){let e=R;return`<div class="sl-chip${n.held?" sl-held":""}${n.fresh?" sl-enter":""}"`+co(n.key,n.seatIds,n.heldLabels,n.locateId)+">"+(n.held?n.stateHtml:`<span class="sl-chip-dot" style="background:${x(n.categoryColor)}" aria-hidden="true"></span>`)+`<div class="sl-chip-main">${n.identityHtml}`+(n.extrasHtml?`<div class="sl-chip-sub">${n.extrasHtml}</div>`:"")+`${n.noteHtml}</div>`+(n.amountText?`<span class="amt">${e(n.amountText)}</span>`:"")+n.railHtml+"</div>"}function lo(n,e,t,i,s){let r=R,o=e?.members.length??1,a=o>1,l=e?e.seatsLabel:n.seatLabel,c=e?e.members.reduce((u,h)=>u+h.amount,0):n.amount,d=e?e.members.flatMap(u=>u.seatIds):n.seatIds,p=e?e.members.flatMap(u=>u.heldLabels):n.heldLabels;return`<div class="sl-chip sl-tline${n.held?" sl-held":""}${n.fresh?" sl-enter":""}${e?"":" sl-tsub"}"${i?' data-overflow="true"':""}`+(e?` data-run="${t}"`:` data-run-of="${t}"`)+co(n.key,d,p,n.locateId)+">"+(a?`<button type="button" class="sl-trun-toggle" aria-expanded="false" aria-label="${r(mc("picker.seatsSelectedCount",o))}"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M9 6l6 6-6 6"/></svg></button>`:n.held?n.stateHtml:`<span class="sl-tline-dot" style="background:${x(n.categoryColor)}" aria-hidden="true"></span>`)+`<span class="sl-sr">${r(n.categoryLabel)}</span><span class="sl-tline-id"><b>${r(n.section||n.seatLabel)}</b>`+(n.rowLabel?`<i>\xB7</i><span>${r(n.rowLabel)}</span>`:"")+(n.section&&l?`<i>\xB7</i><span>${r(l)}</span>`:"")+"</span>"+n.extrasHtml+(s.suppressPricing||!n.amountText?"":(a?`<span class="sl-tline-mult">${o}\xD7</span>`:"")+`<span class="amt">${r(s.money(c))}</span>`)+(n.railHtml?`<button type="button" class="rm" aria-label="${r(a?Sn("picker.removeSeatLabel",{label:[n.section,n.rowLabel,l].filter(Boolean).join(" \xB7 ")}):n.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 ho(n,e){if(!n.length)return"";let t=vc(n),i=[v("picker.section","Section"),v("picker.row","Row"),v("picker.seat","Seat")].join(" \xB7 "),s=t.length>=fc,r=t.map((a,l)=>{let c=s&&l>=kn;return lo(a.members[0],a,l,c,e)+(a.members.length>1?a.members.map(d=>lo(d,null,l,c,e)).join(""):"")}).join(""),o=s?`<button type="button" class="sl-tmore" data-tmore aria-expanded="false" data-more="${R(Sn("picker.moreCount",{count:t.length-kn}))}" data-less="${R(v("picker.showLess","Show less"))}"><span>${R(Sn("picker.moreCount",{count:t.length-kn}))}</span><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M6 9l6 6 6-6"/></svg></button>`:"";return`<div class="sl-tlist"${s?' data-collapsed="true"':""}><div class="sl-tlist-head sl-sr">${R(i)}</div>${r}${o}</div>`}function uo(n){n.dataset.denseWired!=="true"&&(n.dataset.denseWired="true",n.addEventListener("click",e=>{let t=e.target,i=t.closest("[data-tmore]");if(i){let l=i.closest(".sl-tlist"),c=l?.getAttribute("data-collapsed")==="true";l?.setAttribute("data-collapsed",c?"false":"true"),i.setAttribute("aria-expanded",c?"true":"false");let d=i.querySelector("span");d&&(d.textContent=(c?i.dataset.less:i.dataset.more)??d.textContent);return}let s=t.closest(".sl-trun-toggle");if(!s)return;e.stopPropagation();let r=s.closest(".sl-tline"),o=r?.dataset.run;if(!r||o===void 0)return;let a=s.getAttribute("aria-expanded")!=="true";s.setAttribute("aria-expanded",a?"true":"false"),r.setAttribute("data-open",a?"true":"false"),r.parentElement?.querySelectorAll(`.sl-tsub[data-run-of="${o}"]`).forEach(l=>l.setAttribute("data-open",a?"true":"false"))}))}import{ACCESSIBILITY_TYPES as Tn,t as mo}from"@seatlayer/core";var yc='<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>',wc='<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>',Ti=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 i=this.offered().length>0;this.button.setAttribute("aria-label",i?t.tf("picker.accessibilityOptions","Accessibility and colour options"):t.tf("picker.displayOptions","Display options")),this.button.innerHTML=i?yc:wc,this.menu=document.createElement("div"),this.menu.className="sl-a11ymenu",this.menu.hidden=!0;for(let s of this.stored())this.offeredFree().has(s)&&this.active.add(s);if(this.menu.innerHTML=ar(this.rows()),this.root.append(this.menu,this.button),e.appendChild(this.root),this.button.addEventListener("click",s=>{s.stopPropagation(),this.open(this.menu.hidden)}),this.menu.addEventListener("pointerdown",s=>s.stopPropagation()),this.menu.addEventListener("click",s=>s.stopPropagation()),this.dismiss=()=>this.open(!1),this.escape=s=>{s.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 s=()=>this.deps.focusSeatsForFilter();typeof requestAnimationFrame=="function"?requestAnimationFrame(s):s()}}colorblindRow(){return this.menu.querySelector(".sl-cbbtn")}syncCounts(){let e=new Map(this.offered().map(({key:i,count:s})=>[i,s])),t=!1;for(let i of this.menu.querySelectorAll("[data-a11y-row]")){let s=i.dataset.a11yRow??"";if(!s.startsWith("a11y:"))continue;let r=s.slice(5),o=e.get(r);if(o===void 0)continue;let a=this.countNode(i),l=o==null?"":o>0?mo("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(r,l))),i.disabled=c,c?i.setAttribute("aria-disabled","true"):i.removeAttribute("aria-disabled"),c&&this.active.delete(r)&&(this.paint(i,!1),t=!0)}t&&this.applyFilter()}syncAccessibilityFilter(e){this.active.clear();for(let t of e??[])this.active.add(t);this.remember(e&&e.length?e:null);for(let t of this.menu.querySelectorAll("[data-a11y-row]")){let i=t.dataset.a11yRow??"";i.startsWith("a11y:")&&this.paint(t,this.active.has(i.slice(5)))}}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();Bi(this.menu,{x:t.left+t.width/2,y:t.top}),Qn(this.menu),Wt(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:i,count:s})=>({key:i,count:s}));let t=this.deps.present;return t?Tn.filter(({key:i})=>t.has(i)).map(({key:i})=>({key:i,count:null})):[]}offeredKeys(){return new Set(this.offered().map(({key:e})=>e))}offeredFree(){return new Set(this.offered().filter(({count:e})=>e!==0).map(({key:e})=>e))}filterRows(){let e=this.offeredKeys(),t=new Map(Tn.map(i=>[i.key,i]));return this.offered().flatMap(({key:i,count:s})=>{let r=t.get(i);return r?[{key:`a11y:${i}`,icon:r.icon,label:r.label,...i==="wheelchair"&&e.has("companion")?{note:this.deps.tf("picker.companionSeatsNote","Companion places beside them stay selectable")}:{},...s==null?{}:{count:s>0?mo("picker.accessFreeCount",{count:s}):this.deps.tf("picker.accessNoneLeft","None left"),disabled:s===0},on:this.active.has(i)}]:[]})}wire(){for(let e of this.menu.querySelectorAll("[data-a11y-row]"))e.addEventListener("click",()=>{let t=e.dataset.a11yRow??"";if(t==="colorblind"){let r=!this.deps.isColorblindSafe();this.deps.setColorblindSafe(r),this.paint(e,r);return}if(t==="limited"){let r=!this.deps.isLimitedViewHidden();this.deps.setLimitedViewHidden(r),r&&this.deps.focusSeatsForFilter(),this.paint(e,r);return}let i=t.slice(5),s=!this.active.has(i);s?this.active.add(i):this.active.delete(i),this.paint(e,s),this.applyFilter()})}promoteCounts(){if(this.deps.stepToAccessibleSection)for(let e of this.menu.querySelectorAll('[data-a11y-row^="a11y:"]')){let t=e.querySelector(".sl-a11yrow-c");if(!t)continue;let i=(e.dataset.a11yRow??"").slice(5),s=document.createElement("div");s.className="sl-a11yrow-w",e.replaceWith(s);let r=document.createElement("button");r.type="button",r.className="sl-a11yrow-c sl-a11yjump",r.dataset.a11yJump=i,r.textContent=t.textContent,r.disabled=e.disabled,r.setAttribute("aria-label",this.jumpLabel(i,t.textContent??"")),t.remove(),e.setAttribute("aria-label",this.rowLabel(i,r.textContent??"")),s.append(e,r),r.addEventListener("click",o=>{o.stopPropagation(),this.active.has(i)||(this.active.add(i),this.paint(e,!0),this.applyFilter({focus:!1}));let a=this.deps.stepToAccessibleSection?.(i);a&&r.setAttribute("aria-label",this.jumpLabel(i,r.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,i){return[this.deps.tf("picker.jumpToSection","Jump to section"),this.typeLabel(e),t,...i?[`${this.deps.tf("picker.section","Section")} ${i}`]:[]].filter(Boolean).join(" \xB7 ")}rowLabel(e,t){return[this.typeLabel(e),t].filter(Boolean).join(" \xB7 ")}paint(e,t){e.classList.toggle("on",t),e.setAttribute("aria-checked",String(t)),e.setAttribute("aria-pressed",String(t))}applyFilter(e={}){let t=this.active.size?[...this.active]:null;this.deps.applyAccessibilityFilter(t),this.remember(t),t&&e.focus!==!1&&this.deps.focusSeatsForFilter()}key(){let e=this.deps.chart?.();return`seatmap.a11y.filter.${this.deps.event}${e?`.${e}`:""}`}stored(){try{let e=window.sessionStorage.getItem(this.key()),t=e?JSON.parse(e):null;return Array.isArray(t)?t:[]}catch{return[]}}remember(e){try{e&&e.length?window.sessionStorage.setItem(this.key(),JSON.stringify(e)):window.sessionStorage.removeItem(this.key())}catch{}}};import{attachVisibilityCatchUp as xc}from"@seatlayer/core";var kc=250;function fo(n,e=kc){let t=null,i=()=>{t===null&&(t=setTimeout(()=>{t=null,n()},e))},s=xc(i),r=typeof window<"u"&&typeof window.addEventListener=="function";return r&&window.addEventListener("focus",i),()=>{t!==null&&(clearTimeout(t),t=null),s(),r&&window.removeEventListener("focus",i)}}import{holdRecoveryShape as Sc,tCount as Ci}from"@seatlayer/core";var Ei=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=Sc(e),i=e.lapsedLabels.length,s=i-e.recoverable.length,r=t==="all"?Ci("picker.holdLapsedStillFree",i):t==="partial"?Ci("picker.holdLapsedSomeTaken",s):Ci("picker.holdLapsedAllTaken",i);this.note={message:r,recoverable:t==="none"?[]:[...e.recoverable]},this.deps.toast(r,t==="none"?"error":"warning",t==="none"?void 0:{label:this.actionLabel(),onClick:()=>this.recover()}),this.deps.syncTray()}noteHtml(){if(!this.note)return"";let e=this.note.recoverable.length?`<button type="button" data-lapse-again>${R(this.actionLabel())}</button>`:"";return`<div class="sl-lapse-note" role="status"><span>${R(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 go=Symbol("seatlayer.performance-group-picker");function Ai(n,e){return Object.defineProperty(n,go,{configurable:!1,enumerable:!1,value:Object.freeze({...e})}),n}function bo(n){return n[go]??null}var vo="@seatlayer/pending-checkout/v1";function Tc(n){return typeof n=="string"&&n.length<=160&&/^ord_[A-Za-z0-9_-]+$/.test(n)}function yo(n){if(typeof location>"u")return null;let e=new URLSearchParams(location.search),t=e.get("seatlayer_checkout");if(t!=="success"&&t!=="cancelled")return null;let i=null;try{let s=window.sessionStorage.getItem(vo);if(s){let r=null;try{r=JSON.parse(s)}catch{}if(r&&Tc(r.orderId)){let o=Date.now()-Number(r.storedAt);if(o>=0&&o<=144e5){if(r.eventKey&&r.eventKey!==n)return null;i=r.orderId}}}window.sessionStorage.removeItem(vo)}catch{}e.delete("seatlayer_checkout");try{let s=e.toString();history.replaceState(history.state,"",`${location.pathname}${s?`?${s}`:""}${location.hash}`)}catch{}return{outcome:t,orderId:i}}function wo(n){if(!n.framed)return null;let e=n.ancestorOrigins?.length?n.ancestorOrigins[0]:null;for(let t of[e,n.referrer])if(t)try{return new URL(t).origin}catch{}return null}var Hc="https://api.seatlayer.io",Oc=10,So=6e4,To=6e4,Rc=10,Ic=40,_c=220,Co="seatmap.a11y.cb";function Dc(){try{if(typeof window>"u")return null;let n=window.localStorage.getItem(Co);return n==null?null:n==="1"}catch{return null}}function Bc(n){try{window.localStorage.setItem(Co,n?"1":"0")}catch{}}var ze=class n{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.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.bookedEl=null;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.releasingHold=!1;this.salesClosed=!1;this.soldOut=!1;this.soldoutEl=null;this.cbSafe=!1;this.rungsEl=null;this.projectionEl=null;this.buyerView="map";this.view3dEl=null;this.view3dHandle=null;this.view3dGen=0;this.view3dReturnSeat=null;this.view3dTargetSeatId=null;this.view3dCompareSeatIds=[];this.view3dCompareChip=new vi({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 Ei({toast:(e,t,i)=>this.toast(e,t,i),reselect:e=>{this.controller.select(e),this.handleCta()},syncTray:()=>this.syncTray()});this.railEdgesBound=!1;this.fsFallback=!1;this.fsChangeHandler=null;this.fsEscHandler=null;this.eventDetailsHidden=!1;this.holdCopyPending=!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.lastCatAvail=null;this.lastAvailFloorId="";this.availQuietUntil=0;this.liveTimer=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=bo(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??Hc).replace(/\/+$/,"");let t={onExpired:a=>{this.opts.onAccessExpired?.(a),a.refreshed||this.showAccessPanel({reason:"no_token",retryable:!1})},onUnavailable:a=>{this.opts.onAccessUnavailable?.(a),this.showAccessPanel(a)}},i=!e.transport&&e.publicKey&&!e.buyerAccessTokenProvider&&!e.buyerAccessToken?qt({base:this.apiBase,event:e.event,publicKey:e.publicKey,accessHooks:t,apiOptions:{referral:e.referral,onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)}}):null;this.access=e.transport?null:i?.access??xt(e,t),this.pubApi=e.transport?null:i?.api??new Pe(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 Je(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 s=e.numberOfPlacesToSelect;if(s!=null&&(!Number.isInteger(s)||s<1))throw new Error("seatmap: `numberOfPlacesToSelect` must be a positive integer");this.exactTickets=s??null;let r=Jr(e.selectionValidators);if(this.exactTickets!=null&&r>this.exactTickets)throw new Error("seatmap: `minimumSelectedPlaces.minimum` cannot exceed `numberOfPlacesToSelect`");let o=Math.max(1,Math.floor(e.maxSelection??this.exactTickets??Math.max(Oc,r)));if(this.exactTickets!=null&&o<this.exactTickets)throw new Error("seatmap: `maxSelection` cannot be lower than `numberOfPlacesToSelect`");if(e.maxSelection!=null&&o<r)throw new Error("seatmap: `maxSelection` cannot be lower than `minimumSelectedPlaces.minimum`");this.maxTickets=this.exactTickets??o,this.cbSafe=Dc()??!!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 st(e)}isFramed(){return typeof window<"u"&&window.parent!==window}postToHost(e){if(!this.isFramed())return;let t=wo({framed:!0,ancestorOrigins:window.location.ancestorOrigins,referrer:document.referrer});if(t)try{window.parent.postMessage(e,t)}catch{}}measureFramedHeight(){let e=this.root;if(!e)return 0;let t=e.clientWidth||(typeof window<"u"?window.innerWidth:0)||0;if(t<=0)return 0;let i=t<640?1.2:.62;return Math.max(420,Math.round(t*i))}reportFramedHeight(){if(!this.isFramed())return;let e=this.measureFramedHeight();e<=0||e===this.lastPostedHeight||(this.lastPostedHeight=e,this.postToHost({type:"seatlayer:height",px:e}))}toggleFullscreen(){let e=this.root;if(!e)return;!!document.fullscreenElement||this.fsFallback||this.framedFs?document.fullscreenElement?document.exitFullscreen().catch(()=>{}):this.framedFs?this.setFramedFs(!1):this.setFsFallback(!1):e.requestFullscreen?e.requestFullscreen().catch(()=>this.enterFsFallback()):this.enterFsFallback()}syncFullscreenButtons(){let e=!!document.fullscreenElement||this.fsFallback||this.framedFs,t=this.eventDetailsHidden&&!e;this.root?.setAttribute("data-event-details-hidden",String(t)),this.els.zfs?.setAttribute("aria-pressed",String(e)),this.els.zfs?.setAttribute("title",e?this.tf("picker.exitFullScreen","Exit full screen"):this.tf("picker.fullScreen","Full screen"));let i=this.els.zfs?.querySelector(".sl-zfs-lbl");i&&(i.textContent=e?this.tf("picker.exitFullScreen","Exit full screen"):this.tf("picker.fullScreen","Full screen")),this.view3dEl?.querySelector(".sl-view3d-fs")?.setAttribute("aria-pressed",String(e))}enterFsFallback(){this.isFramed()?this.setFramedFs(!0):this.setFsFallback(!0)}setFramedFs(e){this.framedFs!==e&&(this.framedFs=e,this.syncFullscreenButtons(),this.postToHost({type:"seatlayer:fullscreen",on:e}),e&&!this.fsEscHandler?(this.fsEscHandler=t=>{t.key==="Escape"&&!document.fullscreenElement&&this.setFramedFs(!1)},window.addEventListener("keydown",this.fsEscHandler)):!e&&this.fsEscHandler&&(window.removeEventListener("keydown",this.fsEscHandler),this.fsEscHandler=null),requestAnimationFrame(()=>this.controller.refitCurrentView()))}setFsFallback(e){this.fsFallback!==e&&(this.fsFallback=e,this.root?.classList.toggle("sl-fs",e),this.syncFullscreenButtons(),e&&!this.fsEscHandler?(this.fsEscHandler=t=>{t.key==="Escape"&&!document.fullscreenElement&&this.setFsFallback(!1)},window.addEventListener("keydown",this.fsEscHandler)):!e&&this.fsEscHandler&&(window.removeEventListener("keydown",this.fsEscHandler),this.fsEscHandler=null),requestAnimationFrame(()=>this.controller.refitCurrentView()))}close(){this.closeModal?this.closeModal():this.destroy()}static async open(e){et();let t=document.activeElement instanceof HTMLElement?document.activeElement:null,i=document.createElement("div");i.className="sl-modal-scrim";let s=document.createElement("div");s.className="sl-modal-frame",s.setAttribute("role","dialog"),s.setAttribute("aria-modal","true"),s.setAttribute("aria-label",v("picker.seatSelection","Seat selection")),s.tabIndex=-1,i.appendChild(s),document.body.appendChild(i);let r=document.body.style.overflow;document.body.style.overflow="hidden";let o=new n({...e,container:s});o.modalScrim=i,o.prevFocus=t;let a=["a[href]","area[href]","button","input","select","textarea","iframe","object","embed","summary","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"[tabindex]"].join(","),l=()=>{let g=[...s.querySelectorAll('[role="dialog"][aria-modal="true"]')].filter(m=>m.isConnected&&!m.closest('[hidden], [aria-hidden="true"], [inert]'));return g[g.length-1]??s},c=(g,m)=>{let y=g;for(;y;){let k=window.getComputedStyle(y);if(y.hidden||y.getAttribute("aria-hidden")==="true"||y.hasAttribute("inert")||k.display==="none"||k.visibility==="hidden"||k.visibility==="collapse")return!0;if(y===m)return!1;y=y.parentElement}return!0},d=g=>[...g.querySelectorAll(a)].filter(m=>m.tabIndex>=0&&!m.matches(":disabled")&&!c(m,g)),p=(g,m)=>{let y=d(g),k=m?y[y.length-1]:y[0];k?k.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=r,o.escHandler&&document.removeEventListener("keydown",o.escHandler),i.remove(),o.modalScrim=null;let g=o.prevFocus;o.prevFocus=null,g?.isConnected&&g.focus({preventScroll:!0});let m=()=>{o.destroy(),e.onClose?.()};o.hold&&!o.handedOff?o.release().finally(m):m()};return o.closeModal=h,i.addEventListener("mousedown",g=>{g.target===i&&h()}),o.escHandler=g=>{if(g.key==="Tab"){if(g.defaultPrevented)return;let m=l(),y=d(m),k=y[0],w=y[y.length-1],T=document.activeElement;!k||!w?(g.preventDefault(),p(m,g.shiftKey)):T===m||!T||!m.contains(T)?(g.preventDefault(),(g.shiftKey?w:k).focus({preventScroll:!0})):g.shiftKey&&T===k?(g.preventDefault(),w.focus({preventScroll:!0})):!g.shiftKey&&T===w&&(g.preventDefault(),k.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),p(l(),!1),o}wireController(e){return new Cc({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:Ue(e.theme),onSeatsRevealed:()=>{this.seatsRevealed=!0,e.onSeatsRevealed?.(),this.seatsRevealedReport?.()},onGAClick:t=>{let i=this.controller.getGAAreas().find(s=>s.id===t);i&&(this.collapseSheet(),Vi(this,i,this.lastMapPoint))},onSelectionChange:()=>{this.syncTray(),this.minimap?.refreshMinimap(),this.committedSelection().length&&this.collapseSectionCard(),this.syncSelectionTo3d()},onStatusChange:(t=>{this.syncSeatMarks(),this.syncPrices(),this.a11yMenu?.syncCounts(),js(t)&&this.scheduleOfferRefresh(!0),this.evictTakenSelections(),this.detectBooked(),this.minimap?.refreshMinimap(),this.pushAvailabilityTo3d()}),onHoldExpired:()=>{this.hold=null,this.forgetHold(),this.handedOff=!1,this.bookedShown=!1,this.holdConflicted=!1,this.ctaPhase="idle",this.stopHoldTimer(),this.gaQty.clear(),this.lapse.deferExpiryToast(()=>this.toast(O("picker.holdExpired",void 0)||"Your hold expired \u2014 seats released. Pick again.","warning")),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}this.confirmSeat?.id===t.id&&this.dismissConfirm(),this.tableDialog?.physicalSeatIds.includes(t.id)&&this.dismissTableDialog()},onSelectionLimit:()=>{this.toast(O("picker.maxTicketsForOrder",{count:this.maxTickets}),"warning"),this.opts.onSelectionLimit?.(this.maxTickets)},onViewChange:()=>{this.reanchorConfirm(),this.syncRung(),this.syncProjection(),this.minimap?.drawMinimapRect(),this.sectionCardOnView()},onSectionFocus:t=>this.showSectionCard(t),onDeckTap:()=>{this.showSectionCard(null),this.syncFloors(),this.syncRung(),this.minimap?.refreshMinimap()},onFocusSeat:t=>this.announceSeat(t),onSeatHover:t=>this.updateTooltip(t),onHint:t=>{t&&this.toast(t)},onSalesClosed:()=>this.setSalesClosed(!0),onError:t=>this.opts.onError?.(t)})}async render(){if(this.rendered)return this;let e=performance.now(),t={},i=P=>Math.round((performance.now()-P)*100)/100;this.rendered=!0,et();let s=performance.now(),r=zt(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=gs(this.opts.container),{root:c,els:d,mapHost:p}=zn(l,(P,H)=>this.tf(P,H),this.opts.theme);this.root=c,this.els=d,this.mapHost=p,jt(c,r,P=>{t.loadLocale=i(s),this.destroyed||this.applyActiveLocale(P,o)}),zr(c,()=>[{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=i(a),t.skeletonPaint=i(e);let h=await this.loadChart(u,t,i);if(!h)return this;t.shellsPaint=i(e);let g=performance.now();if(this.startRealtime(),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 P=document.createElement("div");P.className="sl-testbadge",P.textContent=fs(O("picker.testMode"),xo()),P.setAttribute("aria-label",O("picker.testMode")),P.title=this.tf("picker.testModeExplained","Bookings here are not real and no card is charged"),this.regions["top-left"].appendChild(P)}let m=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,bs(this.els.logo,[this.opts.theme?.logoUrl,m?.logoUrl,h.posterUrl],this.opts.theme?.brandName??m?.brandName??h.eventName??"?"),this.els.name.textContent=h.eventName??"";let y=h.startsAt?ei(h.startsAt,h.timezone??null,this.opts.locale):"";this.eventWhenText=y||null,this.els.meta.textContent=[h.venue,y].filter(Boolean).join(" \xB7 "),this.syncProjection(),this.buildBadge(m);let k=!!this.controller.doc&&this.controller.getExpandedSeats().some(P=>P.commercial?.restrictedView||P.commercial?.obstructedView);this.buildAccessibilityMenu(k),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=i(g);let w=performance.now();if(await this.restoreRememberedHold(),t.restoreHold=i(w),this.destroyed)return this;this.dismissSkeleton(),this.salesClosed&&this.applySalesClosed(),this.syncPrices(),this.syncTray(),this.resumeHostedOrder();let T=this.controller.doc,b=oi(this.opts.event),A=this.performanceGroup?.surface??(this.performanceGroup?"performance_group":null),S=A??"event",L={apiBase:this.apiBase,eventKey:this.opts.event,metricScope:S,surface:A==="season"?"season_picker":A==="performance_group"?"performance_group_picker":"seat_picker",ms:i(e),performanceProfile:t,chartDelivery:h.chartDelivery,seatCount:this.allSeats().length,objectCount:T?.objects.length??0,sectionCount:T?.objects.filter(P=>P.type==="section").length??0,floorCount:this.controller.getFloors().length,chartName:T?.name,view:this.buyerView,load:b,transport:this.opts.transport?"custom":"pubapi"};Wr(L,(P,H)=>this.emitAnalytics(P,H));let I=h.performanceProfile;return this.seatsRevealedReport=()=>this.emitAnalytics("chart_seats_revealed",gn({...L,performanceProfile:{...L.performanceProfile,...I}})),this.seatsRevealed&&this.seatsRevealedReport(),this.renderInfo=h,await this.registerAgentTools(),this}registerAgentTools(){return Kr(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=fo(()=>{this.destroyed||this.controller.refreshAvailability()}),this.observeLayout(e),this.els.zin.addEventListener("click",()=>this.controller.zoomIn()),this.els.zout.addEventListener("click",()=>this.controller.zoomOut()),this.els.zfit.addEventListener("click",()=>this.controller.zoomToFit()),this.els.zfs.addEventListener("click",()=>this.toggleFullscreen()),this.fsChangeHandler=()=>{document.fullscreenElement||this.setFsFallback(!1),this.syncFullscreenButtons(),requestAnimationFrame(()=>this.controller.refitCurrentView())},document.addEventListener("fullscreenchange",this.fsChangeHandler);let t=this.els.sheetHead;if(t){let s=this.els.sheetToggle,r=c=>{e.dataset.sheet=c?"open":"peek",s?.setAttribute("aria-expanded",String(c)),s?.setAttribute("aria-label",c?this.tf("picker.collapseTicketPanel","Collapse ticket panel"):this.tf("picker.openTicketPanel","Open ticket panel"))};r(e.dataset.sheet==="open"),s?.addEventListener("click",c=>{c.stopPropagation(),r(e.dataset.sheet!=="open")}),this.els.peek?.addEventListener("click",c=>{let d=c.target.closest(".sl-sheet-go");d&&(c.stopPropagation(),d.dataset.act==="checkout"?this.handleCta():d.dataset.act==="best"||d.dataset.act==="find"?(d.dataset.act==="best"&&(this.baReopen=!0,this.baQty=Math.max(1,Math.min(this.baQty,this.maxTickets-this.totalTicketCount())),this.syncTray()),r(!0),this.els.tray?.querySelector(".sl-ba")?.scrollIntoView({block:"nearest",behavior:this.reducedMotion()?"auto":"smooth"}),this.els.tray?.querySelector(".sl-ba-go")?.focus()):r(!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 d=c.clientY-o;d<-18?(r(!0),a=!0):d>18&&(r(!1),a=!0)}),t.addEventListener("pointerup",c=>{l&&!a&&Math.abs(c.clientY-o)<6&&r(e.dataset.sheet!=="open"),l=!1,t.releasePointerCapture?.(c.pointerId)})}let i=()=>{if(this.root?.dataset.layout!=="narrow")return;let s=this.root.getAttribute("data-prices-open")==="true";if(this.root.setAttribute("data-prices-open",String(!s)),this.els.pricesSec?.setAttribute("aria-expanded",String(!s)),!s&&this.root.dataset.sheet!=="open"){this.root.dataset.sheet="open";let r=this.els.sheetToggle;r?.setAttribute("aria-expanded","true"),r?.setAttribute("aria-label","Collapse ticket panel")}};this.els.pricesSec?.addEventListener("click",s=>{s.target.closest("select,button")||i()}),this.els.pricesSec?.addEventListener("keydown",s=>{s.key!=="Enter"&&s.key!==" "||s.target.closest("select,button")||(s.preventDefault(),i())}),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",s=>{this.handleMapPointerDown(s)},!0),this.els.map.addEventListener("mousemove",s=>{if(this.tipPinned)return;let r=this.els.map.getBoundingClientRect();this.tipPos={x:s.clientX-r.left,y:s.clientY-r.top},this.tipEl&&this.tipEl.style.display!=="none"&&this.placeTooltip()}),this.els.cta.addEventListener("click",()=>{this.handleCta()}),this.els.holdChange?.addEventListener("click",()=>{this.handleChangeSeats()})}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 i=e.clientWidth;if(i<=0)return;let s=e.clientHeight,r=i!==this.pickerLayoutSize.width||s!==this.pickerLayoutSize.height;this.pickerLayoutSize={width:i,height:s},this.reportFramedHeight();let o=i<640?"narrow":"wide",a=s<560?"compact":"comfortable";(e.dataset.layout!==o||e.dataset.density!==a)&&(e.dataset.layout=o,e.dataset.density=a,o==="narrow"&&!e.dataset.sheet&&(e.dataset.sheet="peek"),this.dockLayoutChrome(),this.syncMinimapForLayout(),this.lastTrayKeys.size&&this.syncTray()),r&&(this.minimap?.refreshMinimap(),this.fitSectionStripCount(),this.scheduleFit())};this.ro=new ResizeObserver(t),this.ro.observe(e),t(),requestAnimationFrame(t)}async loadChart(e,t,i){let s=performance.now(),r=await this.controller.render(e);return t.loadChartAndStatuses=i(s),this.destroyed?null:r?(Object.assign(t,r.performanceProfile),r):(ke({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:He(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 n({...a,container:o}).render()}),null)}resumeHostedOrder(){if(this.checkoutMode!=="hosted")return;let e=yo(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 Ti(t,{event:String(this.opts.event),chart:()=>this.controller.doc?.name??null,needs:()=>this.controller.getAccessNeeds(),hasLimitedView:e,tf:(i,s)=>this.tf(i,s),isColorblindSafe:()=>this.cbSafe,setColorblindSafe:i=>this.setColorblindSafe(i),isLimitedViewHidden:()=>this.limitedViewFilter,setLimitedViewHidden:i=>{this.limitedViewFilter=i,this.controller.setCommercialLimitedFilter(i),this.pushAvailabilityTo3d()},applyAccessibilityFilter:i=>this.applyAccessibilityFilter(i),focusSeatsForFilter:()=>this.focusSeatsForFilter(),stepToAccessibleSection:i=>this.controller.focusNextAccessibleSection?.([i])??null}),this.cbEl=this.a11yMenu.colorblindRow())}focusSeatsForFilter(){if(this.controller.focusAccessibilityFilter?.()){this.explainAccessibilitySpread();return}this.rungsEl&&this.controller.getRung()!=="seats"&&(this.controller.setRung("seats"),this.collapseSectionCard(),this.syncRung())}explainAccessibilitySpread(){let e=this.controller.accessibilitySpread?.();!e?.wholeVenue||e.sections.length<2||this.toast(O("picker.accessSpreadHint",{count:e.spaces,sections:e.sections.length}),"neutral")}applyAccessibilityFilter(e){this.controller.setAccessibilityFilter(e),this.syncPrices(),this.minimap?.refreshMinimap(),this.pushAvailabilityTo3d()}setAccessibilityFilter(e){this.applyAccessibilityFilter(e),this.a11yMenu?.syncAccessibilityFilter(e),e?.length&&this.focusSeatsForFilter()}focusAccessibilityFilter(){this.focusSeatsForFilter()}dockLayoutChrome(){let e=this.root?.dataset.layout==="narrow";this.applyPanelCollapsed();let t=this.els.zfs,i=this.els.headInfo?.parentElement;t&&i&&t.parentElement!==i&&(t.classList.add("sl-fs-pill"),i.insertBefore(t,this.els.hold??null));let 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(){let e=document.createElement("div");e.className="sl-extend",e.setAttribute("role","status"),e.innerHTML='<span class="sl-extend-txt" data-ref="extendTxt"></span><button type="button" class="sl-extend-btn" data-ref="extendBtn"></button>',(this.regions["bottom-center"]??this.els.map).appendChild(e),this.extendEl=e,this.els.extendTxt=e.querySelector('[data-ref="extendTxt"]'),this.els.extendBtn=e.querySelector('[data-ref="extendBtn"]'),this.els.extendBtn.textContent=this.tf("picker.addTime","Add time"),this.els.extendBtn.addEventListener("click",()=>{this.handleExtend()})}buildBookedOverlay(){let e=document.createElement("div");e.className="sl-booked",e.setAttribute("role","status"),e.setAttribute("aria-live","polite"),e.innerHTML=`<div class="sl-booked-badge"><svg viewBox="0 0 24 24"><path d="M20 6L9 17l-5-5"/></svg></div><div class="sl-booked-title">${this.tf("picker.allSetTitle","You're all set")}</div><div class="sl-booked-sub" data-ref="bookedSub"></div><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>${R(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(),i=document.createElement("div");i.className="sl-soldout-eyebrow",i.textContent=t;let s=document.createElement("div");s.className="sl-soldout-title",s.textContent=this.tf("picker.soldOutTitle","Sold out");let r=document.createElement("p");r.className="sl-soldout-copy",r.textContent=this.tf("picker.soldOutCopy","No reserved seats are currently available for this event."),e.append(i,s,r),this.els.map.appendChild(e),this.soldoutEl=e}syncSoldout(e,t){let i=this.controller.getGAAreas().length>0,s=this.isSoldOut(e,t,i);s!==this.soldOut&&(this.soldOut=s,this.soldoutEl?.classList.toggle("on",s))}isSoldOut(e,t,i){return!i&&e.length>0&&e.every(s=>(t[s.key]??0)===0)}setSalesClosed(e){let t=e||!!this.opts.readOnly;this.salesClosed!==t&&(this.salesClosed=t,this.applySalesClosed())}applySalesClosed(){this.salesClosed&&this.tableDialog&&!this.tableDialogHeld&&this.cancelTableDialog();let e=this.els.closedPill;if(e){e.classList.toggle("on",this.salesClosed);let t=this.els.closedPillText??e;t.textContent=this.tf("picker.salesClosedPill","Sales are closed")}this.root?.setAttribute("data-sales-closed",String(this.salesClosed)),this.salesClosed&&this.srEl&&(this.srEl.textContent=this.tf("picker.salesClosedToast","Sales are closed for this event.")),this.syncCta(),this.syncTray()}badgeHidden(e){return!!(this.opts.hideBadge||e?.hideBadge)}buildBadge(e){if(this.badgeHidden(e))return;let t=this.els.foot;if(!t)return;let i=document.createElement("a");i.className="sl-powered",i.href="https://seatlayer.io/?ref=picker",i.target="_blank",i.rel="noopener noreferrer",i.setAttribute("aria-label",this.tf("picker.poweredBy","Powered by SeatLayer"));let s=document.createElement("span");s.className="sl-powered-mark",s.setAttribute("aria-hidden","true"),s.innerHTML=Qt;let r=document.createElement("span");r.textContent=this.tf("picker.poweredBy","Powered by SeatLayer"),i.append(s,r),t.appendChild(i)}buildRegions(){if(!this.els.map)return;let e=["top-left","top-center","top-right","left-rail","bottom-left","bottom-center","bottom-right"];for(let t of e){let i=document.createElement("div");i.className="sl-anchor",i.dataset.region=t,this.els.map.appendChild(i),this.regions[t]=i}}cssVar(e){return this.root?getComputedStyle(this.root).getPropertyValue(e).trim():""}reducedMotion(){return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}scheduleMotion(e,t){let i=setTimeout(()=>{this.motionTimers.delete(i),this.destroyed||e()},t);this.motionTimers.add(i)}animateOnce(e,t,i=600){!e||this.reducedMotion()||(e.classList.remove(t),e.offsetWidth,e.classList.add(t),this.scheduleMotion(()=>e.classList.remove(t),i))}flashPickedSeat(e){this.reducedMotion()||this.controller.flashSeat(e,this.cssVar("--sl-accent")||"#f4b740")}flashHeldSeats(e){let t=this.reducedMotion(),i=(e.items??[]).filter(s=>s.objectType!=="ga").slice(0,10).map(s=>this.controller.seatByLabel(s.label)).filter(s=>!!s);Es({regions:this.els,categories:this.controller.doc?.categories,pop:s=>this.controller.flashSeat(s,this.cssVar("--sl-accent")||"#f4b740"),focus:(s,r)=>this.controller.focusSection(s,r),focusSeats:s=>this.controller.focusSeats?.(s,{animate:!t})===!0,reducedMotion:t,screenPoint:s=>this.controller.worldToScreen(s),schedule:(s,r)=>this.scheduleMotion(s,r)},i)}committedSelection(){let e=this.confirmSeat?.id,t=this.tableDialog&&!this.tableDialogHeld?this.tableDialog.id:null;return this.controller.getSelection().filter(i=>i.id!==e&&i.id!==t)}pendingSelectionCount(){let e=this.hold?.items??[],t=new Set(e.map(s=>s.label));return this.committedSelection().filter(s=>!t.has(s.label)).reduce((s,r)=>s+(r.quantity??1),0)+Be(this.gaQty,this.hold?.items??[])}heldTicketCount(){return(this.hold?.items??[]).reduce((e,t)=>e+(t.quantity??1),0)}totalTicketCount(){let e=new Set((this.hold?.items??[]).map(i=>i.label)),t=this.committedSelection().filter(i=>!e.has(i.label)).reduce((i,s)=>i+(s.quantity??1),0);return this.heldTicketCount()+t+Be(this.gaQty,this.hold?.items??[])}updateSelectionCapacity(){let e=new Set((this.hold?.items??[]).map(s=>s.label)),t=this.committedSelection().filter(s=>e.has(s.label)).reduce((s,r)=>s+(r.quantity??1),0),i=Math.max(0,this.maxTickets-this.heldTicketCount()-Be(this.gaQty,this.hold?.items??[]));this.controller.setMaxSelection(t+i)}syncCta(e=this.lastTrayCount,t=this.pendingSelectionCount()){let i=this.els.cta;if(!i)return;if(this.salesClosed){i.disabled=!0,i.textContent=this.tf("picker.salesClosedCta","Sales closed");return}if(this.confirmSeat||this.tableDialog&&!this.tableDialogHeld){i.disabled=!0,i.textContent=this.tableDialog?this.tf("picker.confirmYourTable","Confirm your table"):this.tf("picker.confirmOrCancelSeat","Confirm or cancel this seat");return}if(this.ctaPhase==="holding"){i.disabled=!0,i.innerHTML=`<span class="sl-cta-spin" aria-hidden="true"></span>${this.tf("picker.securingSeats","Securing your seats\u2026")}`;return}if(this.ctaPhase==="checkout"){i.disabled=!0,i.innerHTML=`<span class="sl-cta-spin" aria-hidden="true"></span>${this.tf("picker.openingCheckout","Opening secure checkout\u2026")}`;return}let s=!this.hold&&this.performanceGroup?.selectionMode==="per_performance"?this.performanceGroup.submissionState?.():null;if(s&&!s.ready){i.disabled=!0,i.textContent=this.tf("picker.completeAllPerformances","Complete all performances ({complete}/{total})").replace("{complete}",String(s.complete)).replace("{total}",String(s.total));return}let r=this.controller.getSelectionValidity(e);if(r&&!r.isValid){i.disabled=!0,i.textContent=yn(r,(o,a)=>this.tf(o,a),!0);return}i.disabled=e===0,i.textContent=this.hold?t?O("picker.secureMoreAndCheckout",{count:t}):this.tf("picker.continueToCheckout","Continue to checkout"):e?this.performanceGroup?this.tf("picker.holdSeatsForAllPerformances","Hold seats for all {count} performances").replace("{count}",String(this.performanceGroup.performanceCount)):this.tf("picker.holdSeatsAndCheckout","Hold seats & checkout"):this.tf("picker.selectSeats","Select seats")}setCtaPhase(e){this.ctaPhase=e,this.syncCta(),this.renderPeek(this.lastTrayCount,this.lastTrayTotal,this.pendingSelectionCount())}async runCheckoutHandoff(e,t){this.setCtaPhase("checkout");try{await this.checkoutHandoff(e,t)}finally{this.ctaPhase==="checkout"&&!this.bookedShown&&this.setCtaPhase("idle")}}holdStorageKey(){return`@seatlayer/hold/v1/${encodeURIComponent(this.apiBase)}/${encodeURIComponent(this.opts.event)}`}rememberedHoldId(){if(this.opts.initialHoldId)return this.opts.initialHoldId;if(this.opts.restoreHold===!1||typeof window>"u")return null;try{return window.sessionStorage.getItem(this.holdStorageKey())}catch{return null}}rememberHold(e){if(!(this.opts.restoreHold===!1||typeof window>"u"))try{window.sessionStorage.setItem(this.holdStorageKey(),e.holdId)}catch{}}forgetHold(){if(!(typeof window>"u"))try{window.sessionStorage.removeItem(this.holdStorageKey())}catch{}}async resumeHoldFromServer(e,t){try{let i=await this.controller.resumeHold(e);if(!i||this.destroyed)return null;let s={holdId:i.holdId,expiresAt:i.expiresAt,seats:i.seats,items:i.items};return this.hold=s,this.handedOff=!0,this.bookedShown=!1,this.ctaPhase="idle",this.startHoldTimer(s.expiresAt),this.rememberHold(s),this.syncTray(),this.emitHoldChange(),this.opts.onHoldRestored?.(s,s.seats??[],this.buildHandoff(s)),t&&this.toast(this.tf("picker.heldTicketsRestored","Your held tickets have been restored."),"success"),s}catch(i){let s=i?.status;return s===404||s===409?this.forgetHold():this.opts.onError?.(i),null}}async restoreRememberedHold(){let e=this.rememberedHoldId();e&&await this.resumeHoldFromServer(e,!0)}activeFloorObjects(){let e=this.controller.doc;if(!e)return[];let t=e.floors;if(t?.length){let i=this.controller.getActiveFloorId();return(t.find(s=>s.id===i)??t[0]).objects??[]}return e.objects??[]}buildMinimap(){!this.els.map||this.root?.dataset.layout==="narrow"||(this.minimap=Ir({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 wi(this,e)}catPriceRange(e){return xi(this,e)}buildPriceFilter(){if(this.suppressPricing||!this.els.prices||!this.els.pricesSec)return;let e=Ds(this.controller.doc?.categories??[],this.legendDeps());if(e.length<2)return;let t=document.createElement("select");t.className="sl-price-select",t.setAttribute("aria-label",this.tf("picker.filterAndFocusByPrice","Filter and focus seats by price"));let i=document.createElement("option");i.value="all",i.textContent=this.tf("picker.allPrices","All prices"),t.appendChild(i);for(let s of e){let r=document.createElement("option");r.value=s.id,r.textContent=s.label,t.appendChild(r)}this.els.pricesSec.appendChild(t),this.priceSelect=t,t.addEventListener("change",()=>{this.applyPriceBand(e.find(s=>s.id===t.value)?.keys??null)})}applyPriceBand(e){if(this.focusedCatKey=null,this.priceBandKeys=e?new Set(e):null,this.priceSelect){let t=e?this.priceSelect.value:"all";this.priceSelect.value!==t&&(this.priceSelect.value=t)}this.controller.setCategoryFilter(e),this.controller.focusCategoryFilter(e),this.pushAvailabilityTo3d(),this.syncFloors(),this.syncRung(),this.minimap?.refreshMinimap(),this.syncPrices(),this.lastSection&&this.showSectionCard(this.lastSection)}buildArenaChrome(){let e=this.controller.doc;if(!e||!this.els.map)return;let t=e.objects.some(i=>i.type==="section")||(e.floors??[]).some(i=>i.objects.some(s=>s.type==="section"));if(this.canOffer3d()){let i=document.createElement("div");i.className="sl-projection",i.setAttribute("role","group"),i.setAttribute("aria-label",this.tf("picker.venueView","Venue view")),i.innerHTML=`<button type="button" data-view="map" aria-pressed="true" title="${this.tf("picker.flat2dMap","Flat 2D map")}">${this.tf("picker.map","Map")}</button><button type="button" data-view="venue3d" aria-pressed="false" title="${this.tf("picker.interactive3dVenueView","Interactive 3D venue view")}">3D</button>`,i.querySelectorAll("button").forEach(s=>{if(s.dataset.view==="venue3d")for(let r of["pointerenter","focus","pointerdown"])s.addEventListener(r,Zt,{once:!0});s.addEventListener("click",()=>{this.setBuyerView(s.dataset.view)})}),this.regions["top-right"].appendChild(i),this.projectionEl=i,this.syncProjection()}if(t){let i=[...e.objects,...(e.floors??[]).flatMap(d=>d.objects)],s=new Set((e.zones??[]).map(d=>d.id)),o=i.some(d=>d.type==="section"&&typeof d.zone=="string"&&s.has(d.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",O("picker.zoomLevel"));let l={zones:O("picker.rungLabel.zones"),sections:O("picker.rungLabel.sections"),seats:O("picker.rungLabel.seats")},c={zones:O("picker.rungTip.zones"),sections:O("picker.rungTip.sections"),seats:O("picker.rungTip.seats")};a.innerHTML=o.map(d=>`<button type="button" data-rung="${d}" title="${c[d]}" aria-pressed="false">${l[d]}</button>`).join(""),a.querySelectorAll("button").forEach(d=>{d.addEventListener("click",()=>{let p=d.dataset.rung;this.controller.setRung(p),p==="seats"&&this.collapseSectionCard()})}),this.regions["top-center"].appendChild(a),this.rungsEl=a,this.syncRung()}if(this.controller.isMultiFloor()){let i=lr({floors:this.controller.getFloors(),tf:(s,r)=>this.tf(s,r),onChoose:s=>{s===""?this.controller.setFloorOverview(!0):this.controller.setFloor(s),this.showSectionCard(null),this.syncFloors(),this.syncRung(),this.minimap?.refreshMinimap()}});this.regions["left-rail"].appendChild(i),this.floorsEl=i,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.minimap?.setAutoOpen(!1),this.rungsEl&&this.rungsEl.querySelectorAll("button").forEach(i=>{let s=i.dataset.rung===e;i.classList.toggle("on",s),i.setAttribute("aria-pressed",String(s))})}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||!Xt()?!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)?To/2:To}syncFloors(){cr(this.floorsEl,this.controller.getActiveFloorId(),this.controller.isFloorOverview())}get sectionCard(){return this.sectionCardCache||(this.sectionCardCache=new pi({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()}fitSectionStripCount(){this.sectionCard.fitStripCount()}sectionNeighbours(e){let t=this.activeFloorObjects().filter(s=>s.type==="section"&&!this.controller.isSectionClosed(s.id)&&this.controller.getSectionSeatCount(s.id)>0);if(t.length<2)return null;let i=t.findIndex(s=>s.id===e);return i<0?null:{previous:t[(i-1+t.length)%t.length],next:t[(i+1)%t.length]}}markedSeatAnnouncement(e){let t=cn(this.controller.getRenderer()?.getSeatMark?.(e.id),this.performanceGroup?.nights?.());return wr(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 i=this.controller.doc?.categories.find(h=>h.key===e.categoryKey),s=this.controller.getStatus(e.id)??"free",r=s==="free"?this.tf("picker.statusAvailable","available"):s==="held"?this.tf("picker.statusOnHold","on hold"):this.tf("picker.statusTaken2","taken"),o=i?this.catPriceRange(i):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),d=$e(c),p=c?.rowLabel??c?.displayLabel??e.displayLabel??e.label,u=l?`${d} ${p}, ${l.bookingMode==="variable"?O("picker.minToMaxGuests",{min:l.minOccupancy,max:l.maxOccupancy}):O("picker.capacityGuests",{count:l.capacity})}`:c?.objectType==="booth"?`${d} ${p}`:c?.objectType==="table"?`${d} ${p}, ${O("picker.seatNumberLower",{label:c.seatNumber??e.label})}`:O("picker.seatLabel",{label:c?.displayLabel??e.displayLabel??e.label});this.srEl.textContent=`${u}, ${i?.label??e.categoryKey}${a?`, ${a}`:""}, ${r}`}showTableDialog(e,t,i){this.dismissTableDialog(!1),this.tableDialog={...e},this.tableDialogHeld=t,this.tableDialogReturnFocus=i??document.activeElement;let s=this.controller.doc?.categories.find(a=>a.key===e.categoryKey),r=e.bookingMode==="variable",o=document.createElement("div");o.className="sl-table-scrim",o.innerHTML=rr(e,{variable:r,held:t,typeWord:$e(e),categoryLabel:s?.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],d=l[l.length-1];a.shiftKey&&document.activeElement===c?(a.preventDefault(),d.focus()):!a.shiftKey&&document.activeElement===d&&(a.preventDefault(),c.focus())}),requestAnimationFrame(()=>o.querySelector(r?'[data-table-step="-1"]':".sl-table-confirm")?.focus())}renderTableDialogState(){let e=this.tableDialog,t=this.tableDialogEl;if(!e||!t)return;let i=t.querySelector("output[data-table-qty]");i&&(i.value=String(e.quantity));let s=t.querySelector("input[data-table-qty]");s&&(s.value=String(e.quantity)),t.querySelectorAll("[data-table-step]").forEach(a=>{let l=Number(a.dataset.tableStep);a.disabled=l<0?e.quantity<=e.minOccupancy:e.quantity>=e.maxOccupancy});let r=this.paidPrice(e.categoryKey,e.tierId??null,e.price,e.label),o=t.querySelector("[data-table-total]");o&&(o.textContent=this.money(r*e.quantity))}async confirmTableDialog(){let e=this.tableDialog,t=this.tableDialogHeld;if(!e)return;let i=this.tableDialogEl?.querySelector(".sl-table-confirm");if(i&&(i.disabled=!0,i.textContent=t?this.tf("picker.updatingEllipsis","Updating\u2026"):this.tf("picker.selectingEllipsis","Selecting\u2026")),t){try{let s=await this.controller.replaceTableQuantity(e.label,e.quantity,this.opts.holdTtlMs);if(!s){this.toast(this.tf("picker.guestCountCouldNotBeSecured","That guest count could not be secured. Your current table hold is unchanged."),"warning"),this.renderTableDialogState(),i&&(i.disabled=!1,i.textContent=this.tf("picker.updateTable","Update table"));return}this.hold={holdId:s.holdId,expiresAt:s.expiresAt,seats:s.seats,items:s.items},this.startHoldTimer(s.expiresAt),this.dismissTableDialog(),this.syncTray(),this.emitHoldChange(),this.toast(O("picker.tableUpdatedForGuests",{label:e.label,count:e.quantity}),"success")}catch(s){this.opts.onError?.(s),this.toast(this.tf("picker.guestCountNoLongerAvailable","That guest count is no longer available. Your current hold is unchanged."),"error"),i&&(i.disabled=!1,i.textContent=this.tf("picker.updateTable","Update table"))}return}if(!this.controller.setTableQuantity(e.label,e.quantity)){i&&(i.disabled=!1,i.textContent=e.bookingMode==="variable"?this.tf("picker.selectTable","Select table"):this.tf("picker.selectWholeTable","Select whole table"));return}this.dismissTableDialog(),this.collapseSectionCard(),this.syncTray()}cancelTableDialog(){let e=this.tableDialog,t=this.tableDialogHeld;this.dismissTableDialog(),e&&!t&&this.controller.deselect(e.physicalSeatIds)}dismissTableDialog(e=!0){let t=this.tableDialogReturnFocus;this.tableDialogEl?.remove(),this.tableDialogEl=null,this.tableDialog=null,this.tableDialogHeld=!1,this.tableDialogReturnFocus=null,e&&requestAnimationFrame(()=>(t?.isConnected?t:this.root)?.focus())}get confirmCard(){return this.confirmCardCache||(this.confirmCardCache=new bi({controller:this.controller,root:()=>this.root,els:()=>this.els,regions:()=>this.regions,hideTooltip:()=>{this.tipEl&&(this.tipEl.style.display="none")},tf:(e,t)=>this.tf(e,t),money:e=>this.money(e),paidPrice:(e,t,i,s)=>this.paidPrice(e,t,i,s),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){this.confirmCard.show(e)}reanchorConfirm(){this.confirmCard.reanchor()}dismissConfirm(){this.confirmCard.dismiss()}async commitConfirm(){await this.confirmCard.commit()}cancelConfirm(){this.confirmCard.cancel()}closeConfirm(){this.dismissConfirm()}inviteCommit(e,t){Or(e,t,this.reducedMotion())}addSeatLabel(e){return Rr(e,(t,i)=>this.tf(t,i))}seatViewEnabled(){return this.opts.seatView!==!1}allSeats(){return this.allSeatsCache||(this.allSeatsCache=[...this.controller.getExpandedSeats()]),this.allSeatsCache}async openSeatView(e){if(!this.root||!this.seatViewEnabled())return;let t=++this.seatViewGen,i=this.controller.doc,s=this.controller.getActiveFloorId(),r=e.focalPoint??i?.floors?.find(p=>p.id===s)?.focalPoint??i?.focalPoint??{x:0,y:0},o,a,l=!1;if(e.viewUrl){let p,u=null;try{let g=e.viewMeta?.previewUrl;g&&g!==e.viewUrl?(u=await this.buyerAssetUrls.resolve(g),p=e.viewUrl):p=await this.buyerAssetUrls.resolve(e.viewUrl)}catch(g){t===this.seatViewGen&&this.opts.onError?.(g);return}if(t!==this.seatViewGen||!p||e.viewMeta?.previewUrl&&e.viewMeta.previewUrl!==e.viewUrl&&!u||!this.root||!this.seatViewEnabled())return;let h={url:p,...u?{previewUrl:u}:{},...e.viewMeta?.sourceWidth!==void 0?{sourceWidth:e.viewMeta.sourceWidth}:{},...e.viewMeta?.sourceHeight!==void 0?{sourceHeight:e.viewMeta.sourceHeight}:{},...e.viewMeta?.previewWidth!==void 0?{previewWidth:e.viewMeta.previewWidth}:{},...e.viewMeta?.previewHeight!==void 0?{previewHeight:e.viewMeta.previewHeight}:{},...e.viewMeta?.variants?.length?{variants:e.viewMeta.variants}:{},...e.viewMeta?.coverage?{coverage:e.viewMeta.coverage}:{},...e.viewMeta?.capturedAt?{capturedAt:e.viewMeta.capturedAt}:{},...e.viewMeta?.sourceLabel?{sourceLabel:e.viewMeta.sourceLabel}:{}};o=h,a=ko(h),l=Lc(h)}else{let p;try{let{generateSeatPanorama:u}=await Jt();p=u(e,r,this.allSeats())}catch(u){t===this.seatViewGen&&this.opts.onError?.(u);return}if(t!==this.seatViewGen||!this.root||!this.seatViewEnabled())return;o={url:p.url,generated:!0},a=O("picker.illustrationCaption",{m:p.distanceM})}this.closeSeatView(!1);let c=O("picker.viewFromSeat",{label:e.label}),d=ni({root:this.root,source:o,caption:a,real:l,closeLabel:this.tf("picker.close","Close"),dragHint:it(),viewFromSeatLabel:c,real360Label:O("picker.real360"),previewLabel:O("picker.preview"),resolveAsset:p=>this.buyerAssetUrls.resolve(p),onClose:()=>this.closeSeatView()});this.viewEl=d.element,this.viewCleanup=()=>d.dispose()}closeSeatView(e=!0){e&&(this.seatViewGen+=1),this.viewCleanup?.(),this.viewCleanup=null,this.viewEl?.remove(),this.viewEl=null}money(e){let t=this.opts.pricing?.formatter;if(t)return t(e,this.currency);let i=Number.isInteger(e);return Ec(e,this.currency,{locale:this.opts.locale,fallback:(s,r)=>`${s} ${r}`,...i?{minimumFractionDigits:0,maximumFractionDigits:0}:{}})}scheduleOfferBoundary(e){if(this.offerBoundaryTimer&&clearTimeout(this.offerBoundaryTimer),this.offerBoundaryTimer=null,!this.api.availability||this.destroyed)return;let t=Date.now(),i=Gs(e,t);if(i==null)return;let s=6*36e5,r=Math.min(Math.max(i-t+1e3,1e3),s);this.offerBoundaryTimer=setTimeout(()=>{this.offerBoundaryTimer=null,!document.hidden&&this.refreshOfferAvailability(!1)},r)}scheduleOfferRefresh(e){!this.api.availability||this.destroyed||(this.offerRefreshTimer&&clearTimeout(this.offerRefreshTimer),this.offerRefreshTimer=setTimeout(()=>{this.offerRefreshTimer=null,this.refreshOfferAvailability(e)},e?180:0))}async refreshOfferAvailability(e){if(!(!this.api.availability||this.destroyed))try{let t=await this.api.availability(this.opts.event,e);if(this.destroyed)return;let i=en(t);if(!i)return;this.offerAvailability=i,this.applyChannelPricing(i.channelPricing),this.scheduleOfferBoundary(i);let s=tn(i),r={...this.hostPricing?.prices??{},...s},o=Object.keys(r).length>0||this.hostPricing?.formatter?{prices:r,...this.hostPricing?.formatter?{formatter:this.hostPricing.formatter}:{}}:void 0;this.setPricing(o),this.syncOffer(),this.opts.onOfferAvailabilityChange?.(i)}catch{!this.destroyed&&!this.offerBoundaryTimer&&!document.hidden&&(this.offerBoundaryTimer=setTimeout(()=>{this.offerBoundaryTimer=null,!document.hidden&&this.refreshOfferAvailability(!1)},3e4))}}offerPrice(e){return e?this.offerAvailability?.prices.find(t=>t.categoryKey===e)??null:null}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,i=t?.release??null,s=i?null:t?.upcoming??null;if(!t||t.state==="closed"||t.state==="sold-out"||!i&&!s){e.classList.remove("has"),e.replaceChildren();return}let r=i??s,o=document.createElement("div");o.className="sl-offer-main";let a=document.createElement("div");a.className="sl-offer-copy";let l=document.createElement("span");l.className="sl-offer-kicker",l.textContent=i?this.tf("picker.currentTicketOffer","Current ticket offer"):this.tf("picker.upcomingTicketOffer","Upcoming ticket offer");let c=document.createElement("strong");c.className="sl-offer-name",c.textContent=r.name||(i?this.tf("picker.currentOffer","Current offer"):this.tf("picker.scheduledOffer","Scheduled offer"));let d=document.createElement("span");d.className="sl-offer-line";let p=[];i&&t.fromPrice!=null&&p.push(this.money(t.fromPrice/100)),i&&r.remaining!=null&&p.push(O("picker.offerRemainingAvailable",{count:r.remaining})),i&&r.endsAt!=null&&p.push(O("picker.offerUntil",{time:ei(r.endsAt,this.eventTimezone,this.opts.locale)})),s?.startsAt!=null&&p.push(O("picker.offerStarts",{time:ei(s.startsAt,this.eventTimezone,this.opts.locale)})),d.textContent=p.join(" \xB7 "),a.append(l,c,d);let u=document.createElement("details");u.className="sl-offer-info";let h=document.createElement("summary");h.setAttribute("aria-label",O("picker.howOfferWorks",{name:c.textContent??""})),h.textContent="i";let g=document.createElement("div");g.className="sl-offer-detail",g.textContent=i?this.tf("picker.offerDetailActive","This price applies automatically to eligible seats. Tickets in active carts temporarily reduce the available quantity; released or expired holds return it. When the offer ends, the next matching offer or normal ticket price takes over."):this.tf("picker.offerDetailUpcoming","Tickets are available at their normal price now. This scheduled offer will apply automatically to eligible seats when it starts."),u.append(h,g),o.append(a,u),e.replaceChildren(o),e.classList.add("has")}paidPrice(e,t,i,s){let r=s?this.channelByObject.get(s):void 0;if(r&&e){let a=this.pricesByChannel.get(r)?.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?i:typeof o=="number"?o:t&&o.tiers?.[t]!==void 0?o.tiers[t]:o.base??i}legendDeps(){return{colorOf:e=>this.controller.getRenderer()?.categoryDisplayColor?.(e.key)??e.color,rangeOf:e=>this.catPriceRange(e),priceOf:e=>this.catPrice(e),offerOf:e=>this.offerPrice(e),money:e=>this.money(e),esc:R}}syncPriceRail(e,t,i=this.legendDeps()){let s=this.els.railScroll,r=e.length>1;if(this.els.rail?.classList.toggle("has",r),!s)return;s.innerHTML=r?_s({...i,categories:e,left:t,activeKey:this.focusedCatKey,soldOutWord:this.tf("picker.soldOut","Sold out"),allWord:this.tf("picker.allPrices","All prices"),allActive:!this.focusedCatKey&&!this.priceBandKeys}):"";let o=e.map(a=>a.key).join("|");this.lastRailSignature!==o&&(this.lastRailSignature=o,s.scrollLeft=0),s.querySelectorAll(".sl-rc").forEach(a=>{a.addEventListener("click",()=>{if(a.hasAttribute("data-rail-all")){this.applyPriceBand(null);return}this.focusCategory(a.dataset.cat??"")})}),this.railEdgesBound||(this.railEdgesBound=!0,s.addEventListener("scroll",()=>Xi(s),{passive:!0})),requestAnimationFrame(()=>Xi(s))}syncPrices(){let e=this.controller.doc;if(!e||!this.els.prices)return;let t=this.controller.categoryAvailability(),i=e.categories.filter(p=>!p.notForSale);this.narrateAvailability(i,t),this.syncSoldout(i,t);let s=this.legendDeps(),r=this.suppressPricing,o=r?{...s,priceOf:()=>{},rangeOf:()=>{},offerOf:()=>null}:s;r&&(this.els.pricesSec?.querySelector("span")?.replaceChildren(this.tf("picker.seatCategories","Seat categories")),this.els.pricesHint?.remove()),this.syncPriceRail(i,t,o);let a=5,l=i.length-a,c=l>1&&!this.pricesExpanded,d=c?i.slice(0,a):i;this.els.prices.classList.toggle("sl-expanded",l>1&&this.pricesExpanded),this.els.prices.innerHTML=Is({...o,categories:d,left:t,collapsed:c,activeKey:this.focusedCatKey,bandKeys:this.priceBandKeys,leftCount:p=>ot("picker.leftCount",p),titleFor:(p,u)=>u?this.tf("picker.showAllSeats","Show all seats"):O("picker.showLabelSeatsOnMap",{label:p.label}),moreLabel:l>1?c?r?this.tf("picker.showAllCategories","Show all categories"):O("picker.showAllTicketTypes",{count:i.length}):this.tf("picker.showFewer","Show fewer"):null,status:{legend:this.tf("picker.seatStatusLegend","Seat status legend"),held:this.tf("picker.temporarilyHeld","Temporarily held"),sold:this.tf("picker.sold","Sold")}}),this.els.prices.querySelectorAll(".sl-price-row").forEach(p=>{p.addEventListener("mouseenter",()=>this.controller.getRenderer()?.setCategoryHighlight?.(p.dataset.cat??null)),p.addEventListener("mouseleave",()=>this.controller.getRenderer()?.setCategoryHighlight?.(null));let u=()=>this.focusCategory(p.dataset.cat??"");p.addEventListener("click",u),p.addEventListener("keydown",h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),u())})}),this.els.prices.querySelector(".sl-price-more")?.addEventListener("click",()=>{this.pricesExpanded=!this.pricesExpanded,this.syncPrices()})}focusCategory(e){if(!e)return;let t=this.focusedCatKey===e?null:e;this.focusedCatKey=t,this.priceBandKeys=t?new Set([t]):null;let i=this.els.pricesSec?.querySelector(".sl-price-select");i&&(i.value="all"),this.controller.setCategoryFilter(t?[t]:null),this.controller.focusCategoryFilter(t?[t]:null),this.pushAvailabilityTo3d(),this.syncFloors(),this.syncRung(),this.minimap?.refreshMinimap(),this.syncPrices(),this.lastSection&&this.showSectionCard(this.lastSection)}narrateAvailability(e,t){let i=this.els.liveText,s=this.lastCatAvail;this.lastCatAvail={...t};let r=this.controller.getActiveFloorId();if(r!==this.lastAvailFloorId&&(this.lastAvailFloorId=r,this.availQuietUntil=performance.now()+2e3),!(!i||!s||performance.now()<this.availQuietUntil))for(let o of e){let a=s[o.key],l=t[o.key]??0;if(a===void 0||l>=a)continue;let c=a-l;i.textContent=ot("picker.seatsJustTakenInCategory",c,{label:o.label,left:l}),this.els.live?.classList.remove("on"),this.els.live?.offsetWidth,this.els.live?.classList.add("on"),this.liveTimer&&clearTimeout(this.liveTimer),this.liveTimer=setTimeout(()=>this.els.live?.classList.remove("on"),8e3);return}}evictTakenSelections(){let e=new Set([...this.controller.currentHold()?.labels??[],...this.holdingLabels]),t=this.controller.getSelection().filter(i=>!e.has(i.label)&&(this.controller.getStatus(i.id)??"free")!=="free");t.length&&(this.controller.deselect(t.map(i=>i.id)),this.toast(O("picker.seatJustTakenByAnother",{label:t[0].label}),"error"))}syncTray(){if(!this.els.tray)return;this.updateSelectionCapacity();let{seats:e,gaAreas:t,heldItems:i,heldLabels:s,heldCount:r,total:o,count:a}=yi(this),l=[],c=new Set;if(!this.salesClosed){let b=this.performanceGroup?.nightSummary?.()??[];b.length&&l.push(mr(b,{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&&l.push(`<button type="button" class="sl-pg-switch" data-pg-switch-mode>${R(A.label)}</button>`)}l.push(ro({salesClosed:this.salesClosed,hasPicks:e.length>0||i.length>0,hasGaAreas:t.length>0,groupMode:this.performanceGroup?this.performanceGroup.selectionMode??"same_seat":null,seated:!!this.controller.doc?.objects?.some(b=>b.type!=="gaArea"),venue3d:this.buyerView==="venue3d",whenText:this.eventWhenText?String(this.eventWhenText):void 0}));let d=!e.length&&!i.length&&!Be(this.gaQty,this.hold?.items??[]);if((d||this.root?.dataset.layout==="narrow")&&(this.baReopen=!1),!this.performanceGroup&&!this.salesClosed&&!this.hold&&(d||this.baReopen||this.bestAvailableBusy||this.bestAvailableConfirm)){let b=(this.controller.doc?.categories??[]).filter(S=>!S.notForSale),A=this.controller.getBestAvailableZones();this.baZone&&!A.some(S=>S.id===this.baZone)&&(this.baZone=""),l.push(so({confirming:this.bestAvailableConfirm,busy:this.bestAvailableBusy,reopened:this.baReopen,quantity:this.baQty,premium:this.baPremium,offerPremium:this.controller.hasPremiumSeats(),categories:b,zones:A,selectedCategory:this.baCat,selectedZone:this.baZone}))}let p=(b,A,S,L=1,I,P,H)=>to({categoryLabel:H,d:b?this.controller.seatDetails(b):null,area:S==="ga"?t.find(B=>B.id===I):void 0,label:A,objectType:S,quantity:L,identity:P,performanceLabel:this.performanceGroup?.activePerformanceLabel?.(),performanceDates:this.performanceGroup?.selectedPerformanceDates?.()}),u=R,h=[];for(let b of ns(i)){let A=b.objectType==="ga"?`held:ga:${b.objectId}:${b.tierId??""}`:`held:${b.label}`;c.add(A);let S=this.controller.doc?.categories.find(W=>W.key===b.categoryKey),L=b.tierId?S?.tiers?.find(W=>W.id===b.tierId)?.name:void 0,I=b.objectType!=="ga"?this.controller.seatByLabel(b.label):null,P=b.objectType==="table"?this.controller.tableSelection(b.label):null,H=I?this.controller.seatDetails(I.id):null,B=this.seatViewEnabled()&&!!I&&b.objectType!=="table"&&!!this.deliverableViewReference(I),F=u(this.tf("picker.heldForYou","Held for you")),te=(P?.bookingMode==="variable"?`<button type="button" class="sl-table-edit" data-table-edit="${u(encodeURIComponent(b.label))}">${u(O("picker.guestsCountEdit",{count:b.quantity??1}))}</button>`:"")+Lt(I?.wheelchairSpaceType)+sn(I?.commercial),ne=this.paidPrice(b.categoryKey,b.tierId,b.unitPrice,b.label)*(b.quantity??1);h.push({key:A,fresh:!this.lastTrayKeys.has(A),held:!0,seatIds:[],heldLabels:b.labels,removeAria:O("picker.removeHeldTicketLabel",{label:Fi(b,t)}),locateId:I?.id??null,section:H?.sectionLabel??"",rowLabel:H&&U(H)||"",seatLabel:H?.seatNumber??b.label,categoryLabel:`${S?.label??b.categoryKey}${L?` \xB7 ${L}`:""}`,categoryColor:this.controller.getRenderer?.()?.categoryDisplayColor?.(b.categoryKey)??S?.color??"",identityHtml:p(I?.id??null,b.label,b.objectType,b.quantity??1,b.objectId,P??void 0,`${S?.label??b.categoryKey}${L?` \xB7 ${L}`:""}`),stateHtml:`<span class="sl-ticket-state held" aria-label="${F}" title="${F}"><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:te,amount:ne,amountText:this.suppressPricing?"":this.money(ne),noteHtml:rn(I?.commercial),railHtml:this.performanceGroup?"":wn(O("picker.removeHeldTicketLabel",{label:Fi(b,t)}),B?b.label:null),groupable:!te&&!!H?.sectionLabel&&!this.performanceGroup})}let g=this.seatViewEnabled();for(let b of e.filter(A=>!s.has(A.label))){let A=`seat:${b.id}`;c.add(A);let S=this.controller.doc?.categories.find(W=>W.key===b.categoryKey),L=b.tiers&&b.tiers.length&&!this.suppressPricing?`<select class="tier" data-tier="${u(b.id)}" aria-label="${u(O("picker.ticketTierFor",{label:b.label}))}">`+b.tiers.map(W=>`<option value="${u(W.id)}"${W.id===b.tierId?" selected":""}>${u(W.name)} \xB7 ${u(this.money(this.paidPrice(b.categoryKey,W.id,W.price,b.label)))}</option>`).join("")+"</select>":"",I=b.tiers?.find(W=>W.id===b.tierId)??b.tiers?.[0],P=I?.buyerMessage?.trim()||(I?.restriction==="companion"?this.tf("picker.companionRequiresWheelchair","Requires the adjacent wheelchair place"):""),H=this.controller.seatDetails(b.id),B=u(this.tf("picker.selected","Selected")),F=O("picker.removeSeatLabel",{label:b.label}),te=(b.objectType==="table"&&b.bookingMode==="variable"?`<button type="button" class="sl-table-edit" data-table-edit="${u(encodeURIComponent(b.label))}">${u(O("picker.guestsCountEdit",{count:b.quantity??1}))}</button>`:"")+Lt(b.wheelchairSpaceType)+sn(b.commercial)+L,ne=this.paidPrice(b.categoryKey,b.tierId??null,b.price,b.label)*(b.quantity??1);h.push({key:A,fresh:!this.lastTrayKeys.has(A),held:!1,seatIds:[b.id],heldLabels:[],locateId:b.id,section:H?.sectionLabel??"",rowLabel:H&&U(H)||"",seatLabel:H?.seatNumber??b.label,categoryLabel:S?.label??b.categoryKey,identityHtml:p(b.id,b.label,b.objectType,b.quantity??1,b.objectId,b,S?.label??b.categoryKey),categoryColor:this.controller.getRenderer?.()?.categoryDisplayColor?.(b.categoryKey)??S?.color??"",stateHtml:`<span class="sl-ticket-state" aria-label="${B}" title="${B}"><svg viewBox="0 0 24 24"><path d="M5 12l4 4L19 6"/></svg></span>`,extrasHtml:te,amount:ne,amountText:this.suppressPricing?"":this.money(ne),removeAria:F,noteHtml:rn(b.commercial)+(P?`<small class="sl-tier-note">${u(P)}</small>`:""),railHtml:wn(F,g&&b.objectType!=="table"&&this.deliverableViewReference(this.controller.seatByLabel(b.label)??{})?b.label:null),groupable:!te&&!P&&!!H?.sectionLabel&&!this.performanceGroup})}h.length&&l.push(this.root?.dataset.layout==="narrow"?ho(h,{money:b=>this.money(b),suppressPricing:this.suppressPricing}):h.map(po).join("")),t.length&&l.push(ls(this,t,i)),!this.performanceGroup&&!this.salesClosed&&!this.hold&&!d&&!this.baReopen&&!this.bestAvailableBusy&&!this.bestAvailableConfirm&&l.push(`<button type="button" class="sl-ba-reopen" data-ba-reopen><span aria-hidden="true">\u2726</span>${u(this.tf("picker.findTogetherInstead","Find seats together instead"))}</button>`),this.els.tray.innerHTML=l.join("")+(this.salesClosed?"":this.lapse.noteHtml()),this.lastTrayKeys=c,uo(this.els.tray),this.lapse.wire(this.els.tray),this.els.tray.querySelector("[data-pg-switch-mode]")?.addEventListener("click",()=>this.performanceGroup?.selectionModeSwitch?.activate());let m=this.performanceGroup?.selectNight;m&&Cr(this.els.tray,b=>m(b)),this.els.tray.querySelectorAll("[data-ba]").forEach(b=>{b.addEventListener("click",()=>{this.baQty=Math.max(1,Math.min(this.maxTickets,this.baQty+Number(b.dataset.ba))),this.syncTray()})}),this.els.tray.querySelector("[data-ba-cat]")?.addEventListener("change",b=>{this.baCat=b.target.value}),this.els.tray.querySelector("[data-ba-zone]")?.addEventListener("change",b=>{this.baZone=b.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(b=>{b.addEventListener("click",()=>{let A=b.closest(".sl-chip");if(A.dataset.held){this.removeHeldLabels(decodeURIComponent(A.dataset.held).split(`
|
|
2767
|
-
`),A);return}let S=A.dataset.seat.split(" "),L=this.controller.getSelection().find(P=>P.id===S[0])?.label??this.tf("picker.seat","Seat"),I=()=>{this.controller.deselect(S),this.toast(O("picker.labelRemoved",{label:L}),"neutral",{label:this.tf("picker.undo","Undo"),onClick:()=>{let P=this.controller.select(S);this.toast(P.length?O("picker.labelRestored",{label:L}):O("picker.labelNoLongerAvailable",{label:L}),P.length?"success":"warning")}})};if(this.reducedMotion()){I();return}A.classList.remove("sl-enter"),A.classList.add("sl-leave","sl-mo-collapse"),this.scheduleMotion(I,G.collapse)})}),this.els.tray.querySelectorAll("[data-table-edit]").forEach(b=>{b.addEventListener("click",A=>{A.stopPropagation();let S=decodeURIComponent(b.dataset.tableEdit??""),L=this.controller.tableSelection(S);if(!L)return;let I=i.find(P=>P.label===S&&P.objectType==="table");this.showTableDialog({...L,quantity:I?.quantity??L.quantity},!!I,b)})}),this.els.tray.querySelectorAll(".sl-chip .tier").forEach(b=>{b.addEventListener("change",()=>this.controller.setSeatTier(b.dataset.tier,b.value||null))}),this.els.tray.querySelectorAll(".sl-chip .view[data-view-label]").forEach(b=>{b.addEventListener("click",()=>{let A=this.controller.seatByLabel(b.dataset.viewLabel);A&&this.openSeatView(A)})}),this.els.tray.querySelectorAll(".sl-chip[data-locate]").forEach(b=>{let A=()=>this.controller.flashSeat(b.dataset.locate,this.cssVar("--sl-accent")||"#f4b740");b.addEventListener("mouseenter",A),b.addEventListener("focusin",A)}),cs(this,this.els.tray,t),this.controller.setGASelection(es(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(b=>{b.disabled=!0});let y=this.pendingSelectionCount(),k=this.lastTrayCount,w=this.lastTrayTotal,T=Tr(this.performanceGroup?.groupSelectionSummary?.(),this.performanceGroup?.selectionMode??"same_seat");if(this.els.count.textContent=T||(a?ot("picker.ticketsCount",a):this.tf("picker.noSeatsSelected","No seats selected")),this.els.total.textContent=a&&!this.suppressPricing?this.money(o):"",this.root?.setAttribute("data-has-selection",String(a>0)),this.root?.setAttribute("data-ba-active",String(this.bestAvailableConfirm||this.bestAvailableBusy||this.baReopen)),this.els.foot?.classList.toggle("empty",a===0),this.els.seatSummary&&(this.els.seatSummary.textContent=T||(a?ot("picker.seatsSelectedCount",a):"")),this.syncCta(a,y),this.hold){this.holdCopyPending=y>0;let b=oo({secured:r||this.hold.seats?.length||0,pendingCount:y,expiresAt:this.holdExpiresAt,releasing:this.releasingHold});this.els.holdTitle&&(this.els.holdTitle.textContent=b.title),this.els.holdCopy&&(this.els.holdCopy.textContent=b.copy);let A=this.els.holdChange;A&&(A.disabled=this.releasingHold,A.textContent=b.change)}a!==k&&this.animateOnce(this.els.count,"sl-value-pop",380),o!==w&&this.animateOnce(this.els.total,"sl-value-pop",380),k===0&&a>0&&(this.animateOnce(this.els.cta,"sl-ready",520),this.sideCollapsed&&this.root?.dataset.layout!=="narrow"&&this.setPanelCollapsed(!1)),this.renderPeek(a,o,y,a>k),this.lastTrayCount=a,this.lastTrayTotal=o,this.opts.onSelectionChange?.(e),this.emitSelectionValidity(a,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(){$s(this.confirmEl?.querySelector(".sl-confirm-row")),this.els.tray?.querySelectorAll(".sl-chip-pos").forEach(Fs),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 i=this.controller.getSelectionValidity(e);i&&(i.seats=t,this.opts.onSelectionValidityChange?.(i),i.isValid?this.lastSelectionValidity!==!0&&this.opts.onSelectionValid?.(t):this.lastSelectionValidity!==!1&&this.opts.onSelectionInvalid?.(i),this.lastSelectionValidity=i.isValid)}renderPeek(e,t,i,s=!1){if(!this.els.peek)return;let r=(this.controller.doc?.categories??[]).map(o=>this.catPrice(o)).filter(o=>o!=null);this.els.peek.innerHTML=no({count:e,total:t,pendingCount:i,ctaPhase:this.ctaPhase,hasHold:!!this.hold,salesClosed:this.salesClosed,suppressPricing:this.suppressPricing,fromPrice:r.length?Math.min(...r):null,addMore:this.root?.dataset.layout==="narrow"?null:io({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?Ot(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"))),s&&this.animateOnce(this.els.peek.querySelector(".sl-peek-sum")??void 0,"sl-peek-bump",240),this.scheduleFit()}async removeHeldLabels(e,t){let i=e.filter(o=>o&&!this.releasingLabels.has(o));if(!i.length)return!1;let s=i[0];i.forEach(o=>this.releasingLabels.add(o)),t?.setAttribute("aria-busy","true");let r=t?.querySelector(".rm");r&&(r.disabled=!0);try{let o=this.handedOff;if(!await this.controller.releaseLabels(i))return this.toast(O("picker.couldNotRemoveLabel",{label:s}),"error"),!1;ss(this.gaQty,this.hold?.items??[],i);let l=this.controller.currentHold();return this.hold=l?{holdId:l.holdId,expiresAt:l.expiresAt,seats:l.seats,items:l.items}:null,this.handedOff=!!this.hold&&o,this.bookedShown=!1,this.ctaPhase="idle",this.hold?this.startHoldTimer(this.hold.expiresAt):(this.stopHoldTimer(),this.forgetHold()),this.syncTray(),this.emitHoldChange(),this.toast(O("picker.labelRemovedFromHold",{label:s}),"success"),!0}finally{i.forEach(o=>this.releasingLabels.delete(o)),t?.removeAttribute("aria-busy"),r?.isConnected&&(r.disabled=!1)}}async handleChangeSeats(){if(!this.hold||this.releasingHold)return;this.releasingHold=!0;let e=this.els.holdChange;e&&(e.disabled=!0,e.textContent=this.tf("picker.releasingEllipsis","Releasing\u2026"));try{await this.release(),this.hold||this.toast(this.tf("picker.heldTicketsReleased","Held tickets released. Choose your new seats."),"success")}finally{this.releasingHold=!1,e?.isConnected&&(e.disabled=!1,e.textContent=this.tf("picker.change","Change"))}}async handleCta(){if(this.salesClosed)return;let e=this.controller.getSelectionValidity(this.totalTicketCount());if(e&&!e.isValid){this.toast(yn(e,(i,s)=>this.tf(i,s)),"warning");return}if(this.totalTicketCount()>this.maxTickets){this.toast(O("picker.removeTicketsUntilOrFewer",{count:this.maxTickets}),"warning");return}let t=this.committedSelection();if(this.hold&&!t.some(i=>!(this.hold.items??[]).some(s=>s.label===i.label))){let i=this.hold.seats??t;this.handedOff=!0,this.holdConflicted=!1,await this.runCheckoutHandoff(this.hold,i);return}this.holdingLabels=new Set(t.map(i=>i.label)),this.setCtaPhase("holding");try{let i=null,s=Jn(this.gaQty),r=this.committedSelection();if(r.length){let o=await this.controller.hold(void 0,this.opts.holdTtlMs);i=o?{holdId:o.holdId,expiresAt:o.expiresAt,seats:o.seats,items:o.items}:null}for(let{areaId:o,tierId:a,qty:l}of s){let c=await this.controller.holdGA(o,l,{tierId:a,ttlMs:this.opts.holdTtlMs});i=c?{holdId:c.holdId,expiresAt:c.expiresAt,seats:c.seats,items:c.items}:i}if(!i){this.raiseHoldConflict(this.tf("picker.seatsJustTaken","One or more seats were just taken. Please pick again.")),this.setCtaPhase("idle"),this.syncTray();return}this.hold=i,this.holdConflicted=!1,this.handedOff=!this.performanceGroup,this.startHoldTimer(i.expiresAt),this.flashHeldSeats(i),this.emitHoldChange(),this.performanceGroup?this.setCtaPhase("idle"):await this.runCheckoutHandoff(i,i.seats??r)}catch(i){this.opts.onError?.(i);let s=i,r=(s.conflicts??[]).map(a=>a.label).filter(Boolean).slice(0,3);s.reason==="event_closed"&&this.setSalesClosed(!0);let o=s.reason==="event_closed"?this.tf("picker.seatSalesClosedForEvent","Seat sales have closed for this event."):s.reason==="companion_pair_required"?this.tf("picker.companionPairRequired","Select the adjacent wheelchair place with each companion ticket."):s.reason==="ticket_option_not_applicable"?this.tf("picker.ticketOptionNotApplicable","That ticket choice is not available for the selected seat."):r.length?r.length===1?O("picker.labelsNoLongerAvailable.one",{labels:r.join(", ")}):O("picker.labelsNoLongerAvailable.other",{labels:r.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){this.stopHoldTimer(),this.holdExpiresAt=e,this.hold&&this.rememberHold(this.hold);let t=this.els.hold;t.innerHTML=`<span class="sl-hold-dot" aria-hidden="true"></span><span>${this.tf("picker.held","Held")}</span><span class="sl-hold-time" data-ref="holdTime"></span>`;let i=t.querySelector('[data-ref="holdTime"]');this.els.holdNote?.classList.add("on");let s=()=>{let r=Math.max(0,this.holdExpiresAt-Date.now());i&&(i.textContent=Ot(r));let o=this.els.peek?.querySelector(".sl-peek-time");o&&(o.textContent=Ot(r)),!this.holdCopyPending&&this.els.holdCopy&&this.root?.dataset.layout!=="narrow"&&(this.els.holdCopy.textContent=xn(this.holdExpiresAt)),t.classList.add("on"),t.classList.toggle("is-expiring",r>0&&r<=So),this.setExtendPrompt(r>0&&r<=So,r),(r<=0||!this.controller.currentHold())&&this.stopHoldTimer()};this.holdTimer=setInterval(s,500),s()}stopHoldTimer(){this.holdTimer&&clearInterval(this.holdTimer),this.holdTimer=null,this.els.hold?.classList.remove("on","is-expiring"),this.els.holdNote?.classList.remove("on"),this.root&&delete this.root.dataset.peekClock,this.setExtendPrompt(!1,0)}setExtendPrompt(e,t){if(this.extendEl)if(e&&this.controller.currentHold()&&!this.bookedShown){let i=Math.ceil(t/1e3),s=Math.floor(i/60),r=String(i%60).padStart(2,"0");this.els.extendTxt.innerHTML=O("picker.seatsHeldForNeedMoreTime",{time:`${s}:${r}`}),this.extendEl.classList.add("on")}else this.extendEl.classList.remove("on")}async handleExtend(){let e=this.els.extendBtn;e.disabled=!0;let t=e.textContent;e.textContent=this.tf("picker.addingEllipsis","Adding\u2026");try{let i=await this.controller.extendHold(this.opts.holdTtlMs);i?(this.hold={holdId:i.holdId,expiresAt:i.expiresAt,seats:i.seats,items:i.items},this.holdExpiresAt=i.expiresAt,this.extendEl?.classList.remove("on"),this.rememberHold(this.hold),this.emitHoldChange(),this.toast(this.tf("picker.moreTimeAdded","More time added \u2014 your seats are still held."),"success")):this.toast(this.tf("picker.couldNotAddMoreTime","Couldn't add more time \u2014 please head to checkout now."),"warning")}catch(i){this.opts.onError?.(i),this.toast(this.tf("picker.couldNotAddMoreTime","Couldn't add more time \u2014 please head to checkout now."),"warning")}finally{e.disabled=!1,e.textContent=t}}detectBooked(){this.bookedShown||!this.handedOff||!this.hold||this.controller.currentHold()===null&&(this.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((s,r)=>s+r.quantity,0),i=this.performanceGroup?.groupSelectionSummary?.();this.els.bookedSub&&(this.els.bookedSub.innerHTML=i?.seats?`<span class="sl-booked-seats">${ot("picker.group.ticketsConfirmedAcross",i.seats,{performances:i.performances})}</span>`:`<span class="sl-booked-seats">${ot("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(s=>{let o=[s.sectionLabel,s.rowLabel&&`${this.tf("picker.row","Row")} ${s.rowLabel}`,s.seatNumber&&`${this.tf("picker.seat","Seat")} ${s.seatNumber}`].filter(Boolean).join(" \xB7 ")||s.displayLabel||s.label,a=s.quantity>1?` <span class="sl-booked-qty">\xD7${s.quantity}</span>`:"";return`<li>${R(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 i=this.buildHandoff(e),s=null;try{s=await(this.paymentOptions??=this.pubApi.paymentOptions(this.opts.event))}catch(o){this.opts.onError?.(o)}if(this.destroyed)return;let r=s?.providers?.[0];if(!r){let o=ys(s?.reason),a=!!this.opts.onCheckoutUnavailable||!!this.opts.onCheckout;this.opts.onCheckoutUnavailable?.({reason:o,handoff:i}),this.opts.onCheckout?.(e,t,i),a||this.openCheckoutPanel({kind:"unavailable",reason:o,seatCount:i.lineItems.reduce((l,c)=>l+c.quantity,0)});return}await this.openCheckoutPanel({kind:"pay",provider:r,order:{holdId:i.holdId,expiresAt:i.expiresAt,currency:i.currency,total:i.total,labels:i.lineItems.map(o=>o.displayLabel??o.label)}})}async openCheckoutPanel(e){let t;try{({mountCheckout:t}=await vs())}catch(i){this.opts.onError?.(i),this.toast(this.tf("picker.checkoutCouldNotBeOpened","Checkout could not be opened. Your seats are still held \u2014 please try again."),"error"),this.setCtaPhase("idle");return}this.destroyed||!this.root||(this.closeCheckoutPanel(),this.checkoutPanel=t({root:this.root,state:e,eventKey:this.opts.event,formatMoney:i=>this.money(i),startSession:i=>this.pubApi.startCheckout(this.opts.event,{...i,...this.opts.returnUrl?{returnUrl:this.opts.returnUrl}:{}}),orderStatus:i=>this.pubApi.orderStatus(i),onCancel:()=>{this.checkoutPanel=null,this.hold||this.setCtaPhase("idle")},onConfirmed:i=>{this.opts.onOrderConfirmed?.(i),this.controller.refresh()},onError:i=>this.opts.onError?.(i)}))}closeCheckoutPanel(){this.checkoutPanel?.destroy(),this.checkoutPanel=null}buildHandoff(e){let i=(e.items??[]).map(o=>{let a=this.controller.lineItemDisplay(o);return{label:o.label,...a.displayLabel?{displayLabel:a.displayLabel}:{},...a.displayType?{displayType:a.displayType}:{},objectId:o.objectId,objectType:o.objectType,categoryKey:o.categoryKey,tierId:o.tierId,unitPrice:this.paidPrice(o.categoryKey,o.tierId,o.unitPrice,o.label),currency:o.currency??this.currency,quantity:o.quantity??1}}),s=i[0]?.currency??this.currency,r=i.reduce((o,a)=>o+a.unitPrice*a.quantity,0);return{holdId:e.holdId,expiresAt:e.expiresAt,currency:s,lineItems:i,total:r}}emitHoldChange(){let e=this.hold;this.scheduleOfferRefresh(!0),this.opts.onHoldChange?.(e,e?.seats??[],e?this.buildHandoff(e):null)}toast(e,t="neutral",i){let s=this.els.toast;if(!s)return;s.replaceChildren();let r=document.createElement("span");if(r.textContent=e,s.appendChild(r),s.classList.toggle("has-action",!!i),i){let o=document.createElement("button");o.type="button",o.className="sl-toast-action",o.textContent=i.label,o.addEventListener("click",i.onClick,{once:!0}),s.appendChild(o)}s.dataset.tone=t,s.classList.add("on","sl-mo-rise"),this.liftToastOverConfirmSoon(),this.toastTimer&&clearTimeout(this.toastTimer),this.toastTimer=setTimeout(()=>{s.classList.remove("on","sl-mo-rise"),s.classList.remove("has-action"),s.dataset.tone="neutral",this.liftToastOverConfirm()},4200)}liftToastOverConfirm(){let e=this.regions["bottom-center"];if(!e)return;let t=this.els.toast?.classList.contains("on")||this.extendEl?.classList.contains("on"),i=this.confirmEl;if(!t||!i?.isConnected){e.style.removeProperty("bottom");return}let s=this.els.map.clientHeight;if(s<=0)return;let r=i.getBoundingClientRect(),o=r.height||i.offsetHeight||_c,a=r.height?r.top-this.els.map.getBoundingClientRect().top:s-pn-o,l=Math.round(s-a+Rc);if(l+Ic>s){e.style.removeProperty("bottom");return}e.style.bottom=`${l}px`}liftToastOverConfirmSoon(){this.liftToastOverConfirm(),typeof requestAnimationFrame=="function"&&requestAnimationFrame(()=>{this.destroyed||this.liftToastOverConfirm()})}dismissSkeleton(){Vr({boot:this.els.boot,map:this.els.map,rail:this.els.rail,root:this.root,reducedMotion:this.reducedMotion()})}placeTooltip(){if(!this.tipEl)return;let e={width:this.els.map.clientWidth,height:this.els.map.clientHeight},t={width:this.tipEl.offsetWidth,height:this.tipEl.offsetHeight},i=this.tipPinned?Pr(this.tipPos,e,t):null,s=i??Ar(this.tipPos,e.width,e.height,t);this.tipEl.style.left=`${s.left}px`,this.tipEl.style.top=`${s.top}px`,i?this.tipEl.dataset.placement=i.placement:delete this.tipEl.dataset.placement}nightStripFor(e,t){let i=this.performanceGroup,s=cn(e.mark,i?.nights?.()),r=s?.states.filter(o=>o.free).length??0;return fr(s,{locale:this.opts.locale,switchLabel:i?.selectionModeSwitch?.label??null,selectPartialLabel:i?.partialSeatSelection?.label(r)??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.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 i=this.unavailableReason(e),s=e.mark?.kind==="partial"&&(e.interaction==="press"||this.lastPointerType!=="mouse"||t)||!!i&&e.interaction==="press";this.tipMarkedHoverLabel=e.mark?.kind==="partial"?e.label:null;let r=this.nightStripFor(e,s);this.tipEl.style.setProperty("--sl-cat",e.categoryColor),this.tipEl.innerHTML=Er(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:$e(e),reason:i,extra:r+(s?`<button type="button" class="sl-tip-close" data-pg-tip-close aria-label="${R(this.tf("picker.group.closeSeatDetails","Close seat details"))}">\xD7</button>`:"")}),this.tipPinned=s,this.tipEl.classList.toggle("sl-tip-pinned",s),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()}),Hr(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 i={};for(let[s,r]of Object.entries(e())){let o=this.controller.idForLabel(s);o&&(i[o]=r)}Object.keys(i).length&&t.setSeatMarks(i)}getSelection(){return this.committedSelection()}selectObjects(e){return this.controller.select(e)}selectObjectsWithoutConfirmation(e){let t=new Set(e),i=this.controller.getSelection().filter(s=>t.has(s.id)||t.has(s.label));if(i.length===t.size)return i;this.suppressConfirmationSeatId=e[0]??null;try{return this.controller.select(e)}finally{this.suppressConfirmationSeatId=null}}deselectObjects(e){this.controller.deselect(e)}clearSelection(){this.dismissConfirm(),this.dismissTableDialog(),this.controller.clearSelection()}categoryLegendColor(){let e=(this.controller.doc?.categories??[]).find(t=>!t.notForSale);return(e?this.controller.getRenderer()?.categoryDisplayColor?.(e.key):null)||e?.color||"#2563eb"}async refreshAvailability(){await this.controller.refresh(),this.syncSeatMarks(),this.syncTray()}refreshPerformanceGroupComposition(){this.syncTray()}async adoptRestoredHold(e){!e||this.hold||await this.resumeHoldFromServer(e,!1)}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=$t(this.themeMode),i=ft(this.controller.doc?.theme,this.opts.theme,t);for(let[s,r]of Object.entries(i))e.style.setProperty(s,r);t?e.dataset.theme=t:delete e.dataset.theme,this.applyMapChromeTokens()}watchThemeMode(){this.colorSchemeStop?.(),this.colorSchemeStop=null,this.themeMode==="auto"&&(this.colorSchemeStop=Ft(()=>{this.destroyed||this.repaintForThemeMode()}))}repaintForThemeMode(){this.root&&(this.applyThemeTokens(this.root),this.controller.setMapTheme(Ue(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:$t(e)??null}))}getThemeMode(){return this.themeMode}applyMapChromeTokens(){let e=this.els.map?.parentElement;if(!e||!this.root)return;let t=$t(this.themeMode),i=ft(this.controller.doc?.theme,this.opts.theme,t),s=Ue(this.opts.theme,this.themeMode)?.background??this.controller.doc?.theme?.background??void 0,r=Nn(i,s);for(let o of["--sl-bg","--sl-surface","--sl-text","--sl-muted","--sl-line","--sl-accent-text"])r?e.style.setProperty(o,r[o]):e.style.removeProperty(o)}setEventDetailsHidden(e){this.eventDetailsHidden=e,this.syncFullscreenButtons()}setPricing(e){let t=JSON.stringify(this.opts.pricing??null),i=JSON.stringify(e??null);t!==i&&(this.opts.pricing=e,!(this.destroyed||!this.els.prices)&&(this.els.pricesSec?.querySelector(".sl-price-select")?.remove(),this.buildPriceFilter(),this.syncPrices(),this.syncTray(),this.lastSection&&this.showSectionCard(this.lastSection)))}buildLanguageSwitcher(e){this.langSel=Un(e,{languages:this.opts.languages,label:this.tf("picker.preferredTicketType","Language"),onChange:t=>{this.setLocale(t)}})}async setLocale(e){let t=xo(),i=this.localeGeneration+=1,s=await Ac(e);return this.opts.messages&&Pc(this.opts.messages),s===t||this.applyActiveLocale(s,i),s}applyActiveLocale(e,t){t===this.localeGeneration&&this.root&&(Kn(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(),Bc(e))}setViewMode(e){this.controller.setViewMode(this.normalizeInitialView(e)),this.syncProjection(),this.dismissConfirm()}getViewMode(){return this.controller.getViewMode()}normalizeInitialView(e){return e==="perspective"?(this.perspectiveWarned||(this.perspectiveWarned=!0,console.warn("[seatlayer] initialView:'perspective' (2.5D) is deprecated for the buyer picker and was coerced to 'flat'. Use the Map | 3D control for the immersive view.")),"flat"):e??"flat"}getBuyerView(){return this.buyerView}setBuyerView(e,t){if(e==="map"){this.exit3d();return}let i=t?.flyToSeatId;if(this.buyerView==="venue3d"){i?(this.opts.onBuyerViewChange?.({view:"venue3d",seatId:i}),this.view3dHandle?.flyToSeat(i)):t?.resetView&&this.view3dHandle?.focusOverview();return}this.enter3d(i)}seatState3dFor(e){switch(this.controller.getStatus(e.id)){case"held":return"held";case"booked":return"sold";case"not_for_sale":return"dimmed";default:break}return this.priceBandKeys!=null&&!this.priceBandKeys.has(e.categoryKey)||this.controller.accessibilityFilterDims?.(e)||this.limitedViewFilter&&(e.commercial?.restrictedView||e.commercial?.obstructedView)?"dimmed":"available"}pushAvailabilityTo3d(){if(!this.view3dHandle)return;let e=this.allSeats().map(t=>({seatId:t.id,state:this.seatState3dFor(t)}));this.view3dHandle.setAvailability(e)}syncSelectionTo3d(){this.view3dHandle&&this.view3dHandle.setSelection(this.controller.getSelection().map(e=>e.id))}async seatViewFor3d(e){let t=this.allSeats().find(i=>i.id===e);if(!t)return null;if(t.viewUrl)try{let i=t.viewMeta?.previewUrl,s=!!i&&i!==t.viewUrl,r=s?await this.buyerAssetUrls.resolve(i):null,o=s?t.viewUrl:await this.buyerAssetUrls.resolve(t.viewUrl);return!o||s&&!r?null:{url:o,...r?{previewUrl:r}:{},...s?{resolveUrl:a=>this.buyerAssetUrls.resolve(a)}:{},...t.viewMeta?.sourceWidth!==void 0?{sourceWidth:t.viewMeta.sourceWidth}:{},...t.viewMeta?.sourceHeight!==void 0?{sourceHeight:t.viewMeta.sourceHeight}:{},...t.viewMeta?.previewWidth!==void 0?{previewWidth:t.viewMeta.previewWidth}:{},...t.viewMeta?.previewHeight!==void 0?{previewHeight:t.viewMeta.previewHeight}:{},...t.viewMeta?.variants?.length?{variants:t.viewMeta.variants}:{},...t.viewMeta?.initialBearingDeg!==void 0?{initialBearingDeg:t.viewMeta.initialBearingDeg}:{},...t.viewMeta?.initialPitchDeg!==void 0?{initialPitchDeg:t.viewMeta.initialPitchDeg}:{},...t.viewMeta?.coverage?{coverage:t.viewMeta.coverage}:{},...t.viewMeta?.capturedAt?{capturedAt:t.viewMeta.capturedAt}:{},...t.viewMeta?.sourceLabel?{sourceLabel:t.viewMeta.sourceLabel}:{}}}catch(i){return this.opts.onError?.(i),null}return{url:"",generated:!0,mediaKind:"model",coverage:"exact-seat",sourceLabel:this.tf("picker.chartDerivedModel","Chart-derived model")}}emitAnalytics(e,t){try{this.opts.onAnalytics?.(e,{...t,surface:"buyer"})}catch{}}emit3dAnalytics(e,t){this.emitAnalytics(e,t)}onView3dSeatPick(e){if(this.salesClosed){this.toast(this.tf("picker.salesClosedToast","Sales are closed for this event."),"warning"),this.syncSelectionTo3d();return}let t=this.allSeats().find(a=>a.id===e);if(!t)return;let i=this.controller.tableSelection(e);if(this.committedSelection().some(a=>i?a.label===i.label:a.id===e)){this.controller.deselect([e]),this.dismissConfirm(),this.syncSelectionTo3d();return}let r=this.controller.getStatus(t.id);if(r==="held"||r==="booked"||r==="not_for_sale"){this.showUnavailable3dSeat(t,this.seatState3dFor(t),r),this.syncSelectionTo3d();return}if(this.dismissUnavailable3dSeat(),!this.controller.select([e]).length){this.syncSelectionTo3d(),this.dismissConfirm();return}if(this.opts.onBuyerViewChange?.({view:"venue3d",seatId:e}),this.flashPickedSeat(e),i){this.showTableDialog(i,!1),this.syncSelectionTo3d();return}this.opts.confirmSelection!==!1?this.showConfirm(t):this.syncTray(),this.syncSelectionTo3d()}seatViewCaption(e){let t=this.allSeats().find(i=>i.id===e);return $r(this.controller.seatDetails(e),t?.displayLabel??t?.label??e,this.tf("picker.viewFromYourSeat","view from your seat"),{narrow:this.root?.dataset.layout==="narrow",shortTail:this.tf("picker.fromYourSeat","from your seat")})}showUnavailable3dSeat(e,t,i){let s=this.view3dEl;if(!s)return;let r=this.controller.seatDetails(e.id),o=r?.displayLabel??e.displayLabel??e.label,a=U(r);Zr(s,{status:i,visualState:t,location:[r?.sectionLabel,a?O("picker.rowLabel",{label:a}):null,o].filter(Boolean).join(" \xB7 ")||o,tf:(l,c)=>this.tf(l,c)}),this.announceSeat(e)}dismissUnavailable3dSeat(){vn(this.view3dEl)}saveView3dComparisonSeat(e){if(this.buyerView!=="venue3d")return;let t=this.view3dCompareSeatIds;t.includes(e.id)||(this.view3dCompareSeatIds=t.length===0?[e.id]:[t[0],e.id]),this.confirmSeat?.id===e.id&&(this.controller.deselect([e.id]),this.dismissConfirm(),this.syncSelectionTo3d(),this.syncTray()),this.view3dCompareChip.sync(),this.emit3dAnalytics("3d_comparison_saved",{seatId:e.id,count:this.view3dCompareSeatIds.length}),this.view3dCompareSeatIds.length>1?this.openView3dComparison():this.toast(this.tf("picker.chooseAnotherToCompare","Seat saved. Choose another seat to compare."),"success")}clearView3dComparison(){this.closeView3dComparison(!1),this.view3dCompareSeatIds=[],this.view3dCompareChip.remove(),this.emit3dAnalytics("3d_comparison_cleared")}view3dComparisonSnapshot(e){let t=this.allSeats().find(h=>h.id===e);if(!t)return null;let i=this.controller.seatDetails(t.id),s=this.controller.doc?.categories.find(h=>h.key===t.categoryKey),r=i?.price??(s?.tiers?.length?s.tiers[0].price:s?.price),o=r!=null?this.paidPrice(t.categoryKey,i?.tierId??s?.tiers?.[0]?.id??null,r,t.label):void 0,a=this.controller.getStatus(t.id),l=a==="held"?this.tf("picker.temporarilyHeld","Temporarily held"):a==="booked"?this.tf("picker.sold","Sold"):a==="not_for_sale"?this.tf("picker.notForSale","Not for sale"):this.tf("picker.available","Available"),c=t.viewUrl?ko({url:t.viewUrl,...t.viewMeta?.coverage?{coverage:t.viewMeta.coverage}:{},...t.viewMeta?.capturedAt?{capturedAt:t.viewMeta.capturedAt}:{},...t.viewMeta?.sourceLabel?{sourceLabel:t.viewMeta.sourceLabel}:{}}):this.tf("picker.chartDerivedSeatEye","Live 3D \xB7 chart-derived seat-eye \xB7 not surveyed"),d=Se(t.commercial)||this.tf("picker.noAuthoredRestriction","No organizer-authored restriction"),p=i?.wheelchairSpaceType?`${rt(i.wheelchairSpaceType)} \xB7 metadata, not access certification`:this.tf("picker.noAccessibilityMetadata","No accessibility metadata supplied"),u=Mc(t.confidenceEvidence);return{seat:t,label:i?.displayLabel??t.displayLabel??t.label,section:i?.sectionLabel??t.sectionId??"\u2014",row:U(i)??i?.rowLabel??"\u2014",category:i?.categoryLabel??s?.label??t.categoryKey,price:this.suppressPricing||o==null?"":this.money(o),availability:l,selectable:a==null||a==="free",viewSource:c,limited:d,accessibility:p,confidence:u}}openSeatConfidencePassport(e,t=null){bn(this,e,t)}closeSeatConfidencePassport(e=!0){Ht(this,e)}openView3dComparison(){Xr(this)}closeView3dComparison(e=!0){Fe(this,e)}async enter3d(e){if(this.view3dEl||!this.canOffer3d()||!this.els.map)return;let t=this.controller.doc;if(!t)return;this.buyerView="venue3d",this.view3dTargetSeatId=null,this.opts.onBuyerViewChange?.({view:"venue3d",...e?{seatId:e}:{}}),this.root?.setAttribute("data-view3d","on"),this.dismissConfirm(),this.syncProjection(),this.syncTray();let i=document.createElement("div");i.className="sl-view3d sl-mo-zoom",i.setAttribute("role","group"),i.setAttribute("aria-label",this.tf("picker.interactive3dVenueView","Interactive 3D venue view"));let s=document.createElement("button");s.type="button",s.className="sl-view3d-back",s.innerHTML=`<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M15 18l-6-6 6-6"/></svg><span>${this.tf("picker.backToMap","Back to map")}</span>`;let r=s.querySelector("span"),o=c=>{this.view3dTargetSeatId=c;let d=!!c;i.classList.toggle("is-seat-focused",d),this.root&&(this.root.dataset.view3dSeat=d?"on":"off");let p=d?this.tf("picker.backToVenue","Back to venue"):this.tf("picker.backToMap","Back to map");r&&(r.textContent=p),s.setAttribute("aria-label",p)};if(s.addEventListener("click",()=>{if(this.view3dTargetSeatId&&this.view3dHandle){this.view3dHandle.focusOverview();return}this.exit3d()}),this.regions["top-left"]?.prepend(s),this.view3dBack=s,this.publish3dTopInset(),Dr(this.root)){let c=document.createElement("button");c.type="button",c.className="sl-view3d-fs",c.textContent="\u26F6",c.setAttribute("aria-label",this.tf("picker.fullScreen","Full screen")),c.setAttribute("aria-pressed",String(!!document.fullscreenElement||this.fsFallback||this.framedFs)),c.addEventListener("click",()=>this.toggleFullscreen()),i.appendChild(c)}let a=document.createElement("div");a.className="sl-view3d-loading",a.setAttribute("role","status"),a.setAttribute("aria-live","polite"),a.textContent=this.tf("picker.loading3d","Building the 3D venue\u2026"),i.appendChild(a),this.els.map.appendChild(i),this.view3dEl=i,this.view3dCompareChip.sync(),requestAnimationFrame(()=>{i.style.opacity="1"});let l=++this.view3dGen;try{let c=this.allSeats(),[d,p]=await Promise.all([Tt(),this.controller.loadEventConfiguration()]),u=p?await ti(p,w=>this.buyerAssetUrls.resolve(w)):null,h=t.theme?.venue3d?.shellAssetUrl,g=await ii(h,w=>this.buyerAssetUrls.resolve(w));if(l!==this.view3dGen||this.buyerView!=="venue3d"||this.view3dEl!==i)return;let m={doc:t,seats:c,...u?{eventConfigurationId:u.id,eventConfiguration:u}:{},...g?{registeredShellGlb:g}:{}};a.textContent=this.tf("picker.building3d","Building venue geometry\u2026");let y=await d.prepareVenue3D(m);if(l!==this.view3dGen||this.buyerView!=="venue3d"||this.view3dEl!==i)return;let k=d.mountVenue3D(i,{...m,prepared:y},{portraitOverviewCrop:!0,arriveAtSeatEye:!0,lookAroundHint:it(),seatViewActionLabel:w=>this.allSeats().find(T=>T.id===w)?.viewUrl?this.tf("picker.openAuthored360","Open venue 360\xB0"):this.tf("picker.lookAroundLive3d","Look around in live 3D"),seatViewCaption:w=>this.seatViewCaption(w),onSeatViewStopChange:w=>this.view3dSeatViewChrome?.onStopChange(w),onSeatPick:w=>this.onView3dSeatPick(w),onSeatInspect:w=>this.onView3dSeatPick(w),onSectionFocusChange:w=>{let T=i.querySelector('select[data-locator="section"]'),b=w??"";!T||T.value===b||(T.value=b,T.dispatchEvent(new Event("change")))},onViewTargetChange:w=>{i.querySelector(".sl-view3d-nav")?.classList.toggle("is-seat-focused",!!w),o(w),this.opts.onBuyerViewChange?.({view:"venue3d",...w?{seatId:w}:{}})},...this.seatViewEnabled()?{getSeatView:w=>new Promise((T,b)=>{let A=()=>{this.seatViewFor3d(w).then(L=>{L?T(L):b(new Error("seat_view_unavailable"))})},S=globalThis.requestIdleCallback;typeof S=="function"?S(A,{timeout:1500}):setTimeout(A,50)})}:{},onAnalytics:(w,T)=>this.emit3dAnalytics(w,T)});this.view3dHandle=k,this.view3dSeatViewChrome=Nr(i,{handle:()=>this.view3dHandle}),requestAnimationFrame(()=>a.remove()),this.pushAvailabilityTo3d(),this.syncSelectionTo3d(),this.view3dNav=_r(this.regions["bottom-left"]??i,k),e&&k.flyToSeat(e)}catch(c){if(l!==this.view3dGen||this.buyerView!=="venue3d"||this.view3dEl!==i)return;this.opts.onError?.(c),this.toast(this.tf("picker.unavailable3d","3D could not start. The seat map is still available."),"warning"),this.exit3d()}}publish3dTopInset(){let e=this.regions["top-left"];if(!this.root||!e)return;let t=()=>{!this.root||this.root.dataset.view3d!=="on"||this.root.style.setProperty("--sl-3d-top-inset",`${Math.max(44,Math.ceil(e.offsetHeight))}px`)};t(),typeof requestAnimationFrame=="function"&&requestAnimationFrame(t)}exit3d(){if(this.buyerView!=="venue3d"&&!this.view3dEl)return;this.view3dGen++,this.buyerView="map",this.view3dTargetSeatId=null,this.opts.onBuyerViewChange?.({view:"map"}),this.root?.removeAttribute("data-view3d"),this.closeSeatConfidencePassport(!1),this.closeView3dComparison(!1),this.view3dCompareChip.remove(),this.view3dSeatViewChrome?.dispose(),this.view3dSeatViewChrome=null,this.view3dBack?.remove(),this.view3dBack=null,this.view3dNav?.remove(),this.view3dNav=null,this.root?.removeAttribute("data-view3d-seat"),this.root?.style.removeProperty("--sl-3d-top-inset");try{this.view3dHandle?.dispose()}catch{}this.view3dHandle=null;let e=this.view3dEl;this.view3dEl=null,e&&(e.style.opacity="0",setTimeout(()=>e.remove(),320)),this.syncProjection(),this.syncTray();let t=this.view3dReturnSeat;this.view3dReturnSeat=null,t&&this.committedSelection().some(i=>i.id===t.id)&&this.opts.confirmSelection!==!1&&this.showConfirm(t)}getCurrentHold(){return this.hold}async resumeHold(e){return this.resumeHoldFromServer(e,!1)}async removeHeldTicket(e){return this.removeHeldLabels([e])}async bestAvailable(e,t,i={}){if(this.salesClosed||this.bestAvailableBusy)return null;e=Math.max(1,Math.min(this.maxTickets,Math.floor(e)));try{return await this.bestAvailableOrThrow(e,t,i)}catch(s){this.opts.onError?.(s);let r=s?.reason,o=r==="not_enough_together"?O("picker.couldNotFindSeatsTogether",{count:e}):r==="companion_pair_required"?this.tf("picker.companionPairRequired","Select the adjacent wheelchair place with each companion ticket."):r==="ticket_option_not_applicable"?this.tf("picker.ticketOptionNotApplicable","That ticket choice is not available for the selected seat."):r==="sold_out"?this.tf("picker.ticketTypeSoldOut","That ticket type is sold out. Try another ticket type."):r==="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,i={}){if(this.salesClosed)throw new Error("seatlayer: seat sales are closed");if(this.bestAvailableBusy)throw new Error("seatlayer: Best Available is already in progress");if(!Number.isInteger(e)||e<1)throw new Error("seatlayer: Best Available quantity must be a positive integer");this.confirmSeat&&this.cancelConfirm(),this.bestAvailableConfirm=!1,this.bestAvailableBusy=!0;let s=this.els.tray?.querySelector(".sl-ba-go");s&&(s.disabled=!0,s.classList.add("sl-busy"),s.innerHTML=`<span class="sl-ba-spin" aria-hidden="true"></span>${this.tf("picker.findingEllipsis","Finding\u2026")}`);try{let r=await this.controller.bestAvailable(e,t,{...i,ttlMs:this.opts.holdTtlMs});return r?(this.hold={holdId:r.holdId,expiresAt:r.expiresAt,seats:r.seats,items:r.items},this.handedOff=!1,this.bookedShown=!1,this.gaQty.clear(),this.startHoldTimer(r.expiresAt),this.flashHeldSeats(this.hold),this.syncTray(),this.emitHoldChange(),i.preferPremium&&r.seats.length&&!r.seats.every(o=>o.commercial?.premium)&&this.toast(O("picker.premiumFallbackNote",{count:e}),"neutral"),this.hold):null}finally{this.bestAvailableBusy=!1,this.syncTray()}}async release(){let e=this.hold,t=this.controller.currentHold(),i=!0;if(t)i=await this.controller.release();else if(e){let s=[...new Set([...(e.items??[]).map(r=>r.label),...(e.seats??[]).map(r=>r.label)])];if(s.length)try{await this.api.release(this.opts.event,s,e.holdId)}catch(r){this.opts.onError?.(r),i=!1}}if(!i){this.toast(this.tf("picker.couldNotReleaseTickets","Couldn't release your tickets. Your hold is unchanged."),"error");return}this.hold=null,this.forgetHold(),this.handedOff=!1,this.bookedShown=!1,this.ctaPhase="idle",this.stopHoldTimer(),this.gaQty.clear(),this.syncTray(),this.emitHoldChange()}startRealtime(){if(!this.access?.configured||!this.pubApi||this.realtime)return;let e=this.opts.event;this.realtime=new ve({url:this.pubApi.subscribeUrl(e),mintTicket:()=>this.pubApi.subscribeTicket(e),onAccessUnavailable:t=>{this.opts.onAccessUnavailable?.(t),this.showAccessPanel(t)},sink:gt(this.controller,{flashOnLiveChange:!0,onStatusChange:()=>{this.syncPrices(),this.scheduleOfferRefresh(!0),this.detectBooked(),this.minimap?.refreshMinimap(),this.pushAvailabilityTo3d()},onSelectedObjectUnavailable:(t,i)=>{this.opts.onSelectedObjectUnavailable?.({labels:t,reason:i}),this.syncTray(),this.toast(i==="ineligible"?this.tf("picker.seatNoLongerYours","Some seats are no longer available to you. They have been removed from your order."):this.tf("picker.seatTaken","Someone else took a seat you had picked. It has been removed from your order."),"warning")}})}),this.realtime.start()}async refreshAccess(){return!this.access?.configured||!await this.access.refresh("manual")?!1:(this.dismissAccessPanel(),await this.controller.refresh(),this.realtime?this.realtime.restart():this.startRealtime(),!0)}showAccessPanel(e){if(this.destroyed||!this.root)return;this.dismissAccessPanel();let t=or(e.reason,()=>this.refreshAccess());(this.root.querySelector(".sl-body")??this.root).appendChild(t),this.accessEl=t}dismissAccessPanel(){this.accessEl?.remove(),this.accessEl=null}destroy(){this.destroyed=!0,mn(this),this.colorSchemeStop?.(),this.colorSchemeStop=null,this.realtime?.stop(),this.realtime=null,this.dismissAccessPanel(),this.access?.clear(),this.hold&&!this.handedOff&&this.controller.release(),this.closeConfirm(),this.dismissTableDialog(!1),we(this,!1),this.closeSeatView(),this.closeCheckoutPanel(),this.exit3d(),this.buyerAssetUrls.dispose(),this.stopHoldTimer(),this.detachAttention?.(),this.toastTimer&&clearTimeout(this.toastTimer),this.liveTimer&&clearTimeout(this.liveTimer),this.offerRefreshTimer&&clearTimeout(this.offerRefreshTimer),this.offerBoundaryTimer&&clearTimeout(this.offerBoundaryTimer),this.offerRefreshTimer=null,this.offerBoundaryTimer=null,this.offerVisibilityHandler&&(document.removeEventListener("visibilitychange",this.offerVisibilityHandler),this.offerVisibilityHandler=null);for(let e of this.motionTimers)clearTimeout(e);this.motionTimers.clear(),this.ro?.disconnect(),this.ro=null,this.framedFs&&this.setFramedFs(!1),this.escHandler&&document.removeEventListener("keydown",this.escHandler),this.fsChangeHandler&&document.removeEventListener("fullscreenchange",this.fsChangeHandler),this.fsEscHandler&&window.removeEventListener("keydown",this.fsEscHandler),this.controller.destroy(),this.projectionEl=null,this.root?.remove(),this.root=null,this.modalScrim&&(this.modalScrim.remove(),this.modalScrim=null,this.prevFocus?.isConnected&&this.prevFocus.focus({preventScroll:!0}),this.prevFocus=null)}};import{formatMoney as Yc,loadLocale as Qc,setStringOverrides as Xc,t as Zc}from"@seatlayer/core";var Eo="seatlayer-performance-group-picker-style";function Ao(){if(document.getElementById(Eo))return;let n=document.createElement("style");n.id=Eo,n.textContent=`
|
|
2800
|
+
}`,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%)",s=document.createElement("div");Object.assign(s.style,{position:"absolute",inset:"0",display:"flex",flexDirection:"column",padding:"16px",gap:"14px",opacity:"0.9"});let r=c=>{let p=document.createElement("div");return p.className="sl-shimmer",Object.assign(p.style,{background:n,borderRadius:"8px"}),Object.assign(p.style,c),p};s.append(r({height:"40px",width:"100%",flex:"0 0 auto"}));let o=document.createElement("div");Object.assign(o.style,{display:"flex",gap:"14px",flex:"1 1 auto",minHeight:"0"}),o.append(r({width:"220px",height:"100%",flex:"0 0 auto"})),o.append(r({flex:"1 1 auto",height:"100%"})),s.append(o),e.append(s);let a=document.createElement("div");Object.assign(a.style,{position:"relative",zIndex:"1",display:"flex",alignItems:"center",gap:"10px",padding:"10px 16px",borderRadius:"999px",background:"rgba(16, 22, 37, 0.72)",fontSize:"13px",fontWeight:"500",letterSpacing:"0.01em"});let l=document.createElement("span");l.className="sl-shimmer",Object.assign(l.style,{width:"9px",height:"9px",borderRadius:"50%",background:n,flex:"0 0 auto"}),a.append(l),a.append(document.createTextNode("Loading designer\u2026")),e.append(a)}buildErrorCard(e,t){let n=cc[t],s=document.createElement("div");Object.assign(s.style,{maxWidth:"420px",margin:"0 24px",padding:"28px",textAlign:"center",background:"rgba(255, 255, 255, 0.03)",border:"1px solid rgba(255, 255, 255, 0.08)",borderRadius:"16px",boxShadow:"0 12px 40px rgba(0, 0, 0, 0.35)"});let r=document.createElement("h2");r.textContent=n.title,Object.assign(r.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()),s.append(r,o,a),e.append(s)}};import{PickerController as Dd,formatMoney as Bd,getLocale as va,loadLocale as Nd,setStringOverrides as Vd,t as D,tCount as Li}from"@seatlayer/core";import{isAuthoredSeatView as Fd,seatViewDisclosure as $d}from"@seatlayer/core/view3d/crossfade/panorama";function Rs(i){return!!i&&i.clientWidth>0&&i.scrollWidth>i.clientWidth+1}function dc(i){return i.some(e=>Rs(e))}var di="data-fit-gone",pc=12;function Zi(i,e,t=Rs){if(!i)return 0;for(let n of e)i.classList.remove(n.cls);if(i.querySelectorAll(`[${di}]`).forEach(n=>{n.removeAttribute(di),n.hidden=!1}),i.dataset.fit="0",i.clientWidth<=0||!t(i))return 0;for(let n=0;n<e.length;n+=1){let s=e[n];n>0&&i.classList.remove(e[n-1].cls),i.classList.add(s.cls),i.dataset.fit=String(n+1);let r=s.give?s.give(i):!0;if(!t(i))return n+1;if(s.repeat&&s.give){for(let o=1;r&&o<pc;o+=1)if(r=s.give(i),!t(i))return n+1}}return e.length}function hc(i,e="[data-fit-seg]"){let t=[...i.querySelectorAll(e)].filter(n=>!n.hidden);return t.length<2?!1:Is(t[t.length-1])}function uc(i,e){let t=i.querySelector(e);return t&&!t.hidden?Is(t):!1}function Is(i){let e=i.previousElementSibling;return e instanceof HTMLElement&&e.tagName==="I"&&(e.setAttribute(di,""),e.hidden=!0),i.setAttribute(di,""),i.hidden=!0,!0}function mc(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 Os(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:()=>mc(e)}],()=>dc([e,t]))}function _s(i){return Zi(i,[{cls:"sl-fit-notype",give:e=>uc(e,"[data-fit-type]")},{cls:"sl-fit-short",give:e=>hc(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 fc=["on-sale","low","sold-out","presale","closed"];function Lt(i){return i==null?null:typeof i=="number"&&Number.isFinite(i)&&i>=0?i:void 0}function Bs(i){return i==null?null:typeof i=="number"&&Number.isFinite(i)&&i>=0?i:void 0}function Ds(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 s=e.remaining;if(s!=null&&(typeof s!="number"||!Number.isInteger(s)||s<0))return;let r={index:n,count:t,remaining:s??null};if(e.id!==void 0){if(typeof e.id!="string"||!e.id.trim())return;r.id=e.id.trim()}if(e.name!==void 0){if(typeof e.name!="string"||!e.name.trim())return;r.name=e.name.trim()}if(e.categoryKey!==void 0){if(e.categoryKey!==null&&(typeof e.categoryKey!="string"||!e.categoryKey.trim()))return;r.categoryKey=e.categoryKey==null?null:e.categoryKey.trim()}for(let o of["startsAt","endsAt"]){if(e[o]===void 0)continue;let a=Bs(e[o]);if(a===void 0)return;r[o]=a}return r}function gc(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():"",f=u.tierId===null?null:typeof u.tierId=="string"&&u.tierId.trim()?u.tierId.trim():void 0,g=Lt(u.price);if(!h||f===void 0||g===void 0||g===null)return;let x=`${h}\0${f??""}`;if(p.has(x))return;p.add(x),c.push({categoryKey:h,tierId:f,price:g})}n.add(l),t.push({channelId:l,pricingVersion:a.pricingVersion,priceOverrides:c})}let s=[],r=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||r.has(l)||!n.has(c))return;r.add(l),s.push({label:l,channelId:c})}return{assignmentVersion:e.assignmentVersion,channels:t,objects:s}}function en(i){if(!i||typeof i!="object"||Array.isArray(i))return null;let e=i,t=fc.find(p=>p===e.state);if(!t)return null;let n=Lt(e.fromPrice),s=Lt(e.previousPrice);if(n===void 0||s===void 0)return null;let r=e.currency==null?null:typeof e.currency=="string"&&e.currency.trim()?e.currency.trim():void 0;if(r===void 0)return null;let o=Ds(e.release);if(o===void 0)return null;let a=e.upcoming===void 0?null:Ds(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 f=Lt(u.price),g=Lt(u.previousPrice);if(f==null||g===void 0)return null;let x={categoryKey:h,price:f,previousPrice:g};if(u.offerId!==void 0){if(typeof u.offerId!="string"||!u.offerId.trim())return null;x.offerId=u.offerId.trim()}if(u.offerName!==void 0){if(typeof u.offerName!="string"||!u.offerName.trim())return null;x.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;x.remaining=u.remaining==null?null:u.remaining}for(let w of["startsAt","endsAt"]){if(u[w]===void 0)continue;let y=Bs(u[w]);if(y===void 0)return null;x[w]=y}p.push(x)}l=p}let c=gc(e.channelPricing);return c===void 0?null:{state:t,fromPrice:n,previousPrice:s,currency:r,release:o,upcoming:a,prices:l,channelPricing:c}}function Ns(i){return i?.changed!==!1}function Vs(i,e){if(!i)return null;let t=null,n=s=>{s!=null&&s>e&&(t===null||s<t)&&(t=s)};for(let s of[i.release,i.upcoming])n(s?.startsAt),n(s?.endsAt);for(let s of i.prices)n(s.startsAt),n(s.endsAt);return t}function tn(i){let e={};for(let t of i?.prices??[])e[t.categoryKey]=t.price;return e}import{compactRowLabel as bc,t as Ne}from"@seatlayer/core";import{seatConfidenceDisclosure as vc}from"@seatlayer/core/core/seatConfidence";function nn(i){return String(i??"\u2014").replace(/[&<>"]/g,e=>({"&":"&","<":"<",">":">",'"':"""})[e])}function S(i){return String(i??"").replace(/[&<>"]/g,e=>({"&":"&","<":"<",">":">",'"':"""})[e])}function ke(i){return i?.restrictedView?v("picker.restrictedView","Restricted view"):i?.obstructedView?v("picker.obstructedView","Obstructed view"):""}function $s(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=ke(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 sn(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=ke(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 rn(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=ke(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 at(i){return i==="no-seat"?v("picker.emptyWheelchairSpace","Empty wheelchair space"):i==="seat-present"?v("picker.accessiblePhysicalSeat","Accessible physical seat"):""}function zs(i){let e=at(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 Mt(i){let e=at(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 js(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="${O(i.previous.id)}" aria-label="${v("picker.previousSection","Previous section")}: ${O(e)}" title="${O(e)}">\u2190</button><button type="button" data-section-nav="${O(i.next.id)}" aria-label="${v("picker.nextSection","Next section")}: ${O(t)}" title="${O(t)}">\u2192</button></span>`}function Gs(i,e){if(!e)return"";let t=e,n=t.includes(i.id),s=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(s)}</span></button>`}function qs(i,e,t){if(!t)return"";let n=vc(i.confidenceEvidence),s=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(s)}</small></span><b>Passport</b></button>`}function q(i){let e=i?.rowLabel,t=i?.sectionLabel;if(!e||!t)return e;for(let n of["-"," ","\xB7","/","_"]){let s=`${t}${n}`;if(e.startsWith(s)&&e.length>s.length)return e.slice(s.length)}return bc(e,t)}function yc(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","Session expired"),body:v("picker.accessExpiredBody","To show you up-to-date seats, please refresh."),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 wc=6;function Us(i,e,t){let n=nn;return[i?.sectionLabel?`<div class="sl-confirm-field sl-confirm-sec${i.sectionLabel.length>wc?" 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(q(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 Ks(i,e,t){let n=nn,s=i?.objectType==="booth",r=i?.objectType==="table"&&!!i?.bookingMode,o=s||r||!i?.seatNumber,a=i?.sectionLabel??(o?void 0:i?.displayLabel),l=r?`${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} ${q(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 Ws(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 Ys(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 Fs(i){return i.buyerMessage?.trim()||(i.restriction==="companion"?v("picker.companionRequiresWheelchair","Requires the adjacent wheelchair place"):void 0)}function Qs(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=Fs(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 s=i[0],r=s?Fs(s):void 0;return r?`<p class="sl-confirm-tier-note">${n(r)}</p>`:""}function Xs(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 Zs(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 Js(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 er(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 tr(i,e){let t=O,{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?Ne("picker.flexiblePartyTypeWord",{typeWord:e.typeWord}):Ne("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."):Ne("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(Ne("picker.perGuestPrice",{price:e.unitPrice}))}</b>`)+`<span class="muted">${t(v("picker.tableCapacity","Table capacity"))}</span><span>${t(Ne("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(Ne("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(Ne("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 ir(i,e){let t=yc(i),n=document.createElement("div");n.className="sl-interrupt sl-access",n.setAttribute("role","status"),n.setAttribute("aria-live","polite");let s=document.createElement("div");s.className="sl-interrupt-card";let r=document.createElement("div");r.className="sl-interrupt-title",r.textContent=t.title;let o=document.createElement("div");o.className="sl-interrupt-body",o.textContent=t.body,s.append(r,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),s.appendChild(a),n.appendChild(s),n}function nr(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 sr(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(r=>({id:r.id,name:r.name}))];for(let r of t){let o=document.createElement("button");o.type="button",o.dataset.floor=r.id,o.textContent=r.name,o.setAttribute("aria-pressed","false"),o.addEventListener("click",()=>i.onChoose(r.id)),e.appendChild(o)}let n=document.createElement("button");n.type="button",n.className="sl-floor-info",n.textContent="i";let s=i.tf("picker.floorHelp","All floors shows the complete venue. Choose one level to inspect and select its seats.");return n.setAttribute("aria-label",s),n.title=s,e.appendChild(n),e}function rr(i,e,t){if(!i)return;let n=t?"":e;i.querySelectorAll("button[data-floor]").forEach(s=>{s.setAttribute("aria-pressed",String(s.dataset.floor===n))})}import{t as Ve,tCount as xc}from"@seatlayer/core";var pi=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 s=t.dataset.sectionNav;s&&this.host.controller.focusSection(s)})})}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 f=this.host.controller.doc?.categories.find(g=>g.key===h.key);return f?this.host.catPriceRange(f):{min:h.priceMin,max:h.priceMax}}).filter(h=>h!=null):[{min:e.priceMin,max:e.priceMax}],s=Math.min(...n.map(h=>h.min)),r=Math.max(...n.map(h=>h.max)),o=s===r?this.host.money(s):`${this.host.money(s)}\u2013${this.host.money(r)}`,a=xc("picker.seatsLeftInSection",e.seatsLeft),l=Ve("picker.seatsLeftShort",{count:e.seatsLeft}),c=`<button type="button" class="sl-seccard-x" aria-label="${Ve("picker.closeSectionSummary")}">\u2715</button>`,p=js(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",Ve("picker.sectionSummaryAria",{label:e.label})),u.innerHTML=Xs(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",Ve("picker.sectionSummaryAria",{label:e.label}));let h=this.host.priceBandKeys(),f=this.host.suppressPricing(),g=e.categories.map(x=>{let w=this.host.controller.doc?.categories.find(T=>T.key===x.key),y=w?this.host.catPriceRange(w):{min:x.priceMin,max:x.priceMax};return Js({label:x.label,color:x.color,dim:h!=null&&!h.has(x.key),rangeLabel:f?"":y&&y.min!==y.max?`${this.host.money(y.min)}\u2013${this.host.money(y.max)}`:this.host.money(y?.min??x.price)})}).join("");u.innerHTML=Zs({...d,priceLabel:o,showPrice:!f&&e.categories.length>0,zoneLabel:e.zoneLabel,entrance:e.entrance?`${Ve("picker.entrance")} ${e.entrance}`:void 0,mix:g,overviewLabel:Ve("picker.overview"),hint:Ve("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 s=this.host.activeFloorObjects().find(y=>y.type==="section"&&y.id===t.id)?.outline;if(!s||s.length<3)return 0;let r=s.map(y=>this.host.controller.worldToScreen(y)),o=r.map(y=>y.x),a=r.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(),f=h.left-u.left,g=h.top-u.top,x=Math.max(0,Math.min(f+h.width,l+p)-Math.max(f,l)),w=Math.max(0,Math.min(g+h.height,c+d)-Math.max(g,c));return x*w/(p*d)}};import{t as gi,tCount as _c}from"@seatlayer/core";import{contrastRatio as Dc}from"@seatlayer/core/core/color";import{t as or,tCount as hi}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 ui=(i,e)=>an(i,e,{dateStyle:"medium"}),mi=(i,e)=>an(i,e,{timeStyle:"short"}),fi=(i,e)=>an(i,e,{weekday:"short",day:"numeric",month:"short"});function ar(i,e,t,n){return!i.length||i.length>=e?null:{summary:n,labels:i.map(s=>`${ui(s,t)} \xB7 ${mi(s,t)}`)}}function Sc(i,e){let t=new Set(e);return i.map(n=>({...n,free:!t.has(n.eventKey)}))}function lr(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 kc(i,e,t="",n=!1){if(!i.length)return"";let s=i.map(r=>{let o=r.free?e.free:e.blocked,a=n&&r.free?`<input class="sl-night-choice" type="checkbox" data-pg-event-key="${S(r.eventKey)}" aria-label="${S(`${r.shortDate}: ${o}`)}" checked>`:"";return`<li class="sl-night${r.free?" ok":" no"}" aria-label="${S(`${r.shortDate}: ${o}`)}">`+a+`<i class="sl-night-dot" aria-hidden="true"></i><span class="d">${S(r.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">${s}</ul><p class="sl-tip-nights-note">${S(e.notAvailableOn)}</p>`+t+"</div>"}function Tc(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 Cc(i){return Number(i.available)+Number(i.selected)+Number(i.partial)+Number(i.unavailable)}function cr(i,e,t){if(Cc(i)<2)return"";let n=(r,o,a="")=>`<li class="sl-pg-legend-item"><i class="sl-pg-sw ${r}"${a}></i>${S(o)}</li>`,s=[];return i.available&&s.push(n("sl-pg-sw-free",e.available,` style="background:${S(t)}"`)),i.selected&&s.push(n("sl-pg-sw-sel",e.selected)),i.partial&&s.push(n("sl-pg-sw-split",e.partial,` style="--sl-pg-sw-cat:${S(t)}"`)),i.unavailable&&s.push(n("sl-pg-sw-off",e.unavailable)),`<ul class="sl-pg-legend-list" aria-label="${S(e.title)}">${s.join("")}</ul>`}function dr(i,e){if(!i.length)return"";let t=i.map(n=>{let s=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(s)}</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=Sc(e,t);return{states:n,missing:n.filter(s=>!s.free).map(s=>s.shortDate)}}function pr(i,e){return i?kc(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:or("picker.group.notAvailableOn",{dates:lr(i.missing,e.locale)})},Tc({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 Ec(i,e,t,n){if(!i.length)return"";let s=new Set(e),r=new Set(t),o=i.map(a=>{let l=s.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&&r.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 hr(i,e,t,n){let s=e.availableEventKeys(t);return Ec(i,s,e.includedEventKeys(),{title:n("picker.group.confirmDatesTitle","Choose performance dates"),copy:s.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(s.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 ur(i){return[...i.querySelectorAll("[data-pg-confirm-event-key]")].filter(e=>e.checked&&!e.disabled).map(e=>e.dataset.pgConfirmEventKey).filter(Boolean)}function mr(i,e,t,n){let s=[...i.querySelectorAll("[data-pg-confirm-event-key]")];if(!e||!s.length)return;let r=i.querySelector(".sl-confirm-add"),o=i.querySelector("[data-pg-confirm-all]"),a=()=>{let l=s.filter(d=>!d.disabled),c=ur(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))),r.disabled=c===0,r.textContent=c?e.label(c):t("picker.group.confirmChooseOne","Choose at least 1 date"),n()};s.forEach(l=>l.addEventListener("change",a)),o?.addEventListener("change",()=>{s.filter(l=>!l.disabled).forEach(l=>{l.checked=o.checked}),a()}),a()}async function fr(i,e,t){if(!i||!t||!i.querySelector("[data-pg-confirm-event-key]"))return!0;let n=ur(i);if(!n.length)return!1;let s=i.querySelector(".sl-confirm-add");return s?.setAttribute("aria-busy","true"),s&&(s.disabled=!0),await t.apply(e,n)?!0:(s?.removeAttribute("aria-busy"),s?.isConnected&&(s.disabled=!1),!1)}function gr(i,e,t){return i?or("picker.group.seatPartlyAvailable",{label:e,free:i.states.length-i.missing.length,total:i.states.length,dates:lr(i.missing,t)}):""}function br(i,e){let t=i.map((n,s)=>{let r=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(s+1)}</span><span class="l">${S(n.label)}</span><span class="sl-pg-sr">${S(r)}</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 vr(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 yr(i){let e=Math.max(0,i);return`${Math.floor(e/6e4)}:${String(Math.floor(e/1e3)%60).padStart(2,"0")}`}function wr(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?hi("picker.group.performancesChosenOf",t,{chosen:i.performances,total:i.totalPerformances}):hi("picker.group.seatsEveryPerformance",t)}return i.perPerformance!=null&&i.performancesChosen===i.performances?hi("picker.group.seatsPerPerformance",i.seats,{per:i.perPerformance}):hi("picker.group.performancesChosenOf",i.seats,{chosen:i.performancesChosen,total:i.performances})}function xr(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",s=>{s.key!=="Enter"&&s.key!==" "||(s.preventDefault(),n())})})}import{t as Ac}from"@seatlayer/core";function ue(i){return String(i??"\u2014").replace(/[&<>"]/g,e=>({"&":"&","<":"<",">":">",'"':"""})[e])}function Pc(i,e){let t=i.objectType==="table"&&!!i.bookingMode,n=i.objectType==="booth",s=t||n||!i.seatNumber,r=s?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} ${q(i)??""}`.trim():"";return`<div class="sl-tip-head"><div class="sl-tip-id"><span class="sl-tip-seat${s?" name":""}">${ue(r)}</span>`+(o?`<span class="sl-tip-row">${ue(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">${ue(i.sectionLabel)}</span></div>`:"")+"</div>"}function Sr(i,e){let t=i.status==="not_for_sale",n=i.mark?.kind==="partial",s=i.status==="free"||n?"":`<span class="sl-tip-tag">${t?v("picker.notAvailable","Not available"):i.status==="held"?Ac("map.statusHeld"):v("picker.sold","Sold")}</span>`,r=t?"":e.price,o=r?`<span class="sl-tip-amt">${ue(r)}</span>`:"",a=!r&&e.priceNote?`<div class="sl-tip-note">${ue(e.priceNote)}</div>`:"",l=ke(i.commercial),c=l?`<div class="sl-tip-cx"><span class="g" aria-hidden="true">\u25D0</span>${ue(l)}</div>`:"",p=at(i.wheelchairSpaceType),d=p?`<div class="sl-tip-cx"><span class="g" aria-hidden="true">\u267F</span>${ue(p)}</div>`:"",u=e.reason?`<div class="sl-tip-reason">${ue(e.reason)}</div>`:"";return'<i class="sl-tip-rail" aria-hidden="true"></i>'+Pc(i,e.rowTypeWord)+`<div class="sl-tip-cat"><span class="sl-tip-dot" style="background:${ue(i.categoryColor)}"></span><span class="sl-tip-name">${ue(i.categoryLabel)}</span>`+s+o+"</div>"+a+u+d+c+(e.extra??"")}function kr(i,e,t,n){let s=i.x+14,r=i.y-n.height-12,o=i.y+18,a=r;s+n.width>e-8&&(s=i.x-n.width-14),r<8&&o+n.height<=t-8&&(a=o);let l=Math.max(8,t-n.height-8);return{left:Math.max(8,Math.min(s,Math.max(8,e-n.width-8))),top:Math.max(8,Math.min(a,l))}}function Tr(i,e,t,n=22){let s=Math.max(8,Math.min(i.x-t.width/2,Math.max(8,e.width-t.width-8))),r=i.y-n-t.height,o=i.y+n;return r>=8?{left:s,top:r,placement:"above"}:o+t.height<=e.height-8?{left:s,top:o,placement:"below"}:{left:s,top:Math.max(8,Math.min(r<8?o:r,Math.max(8,e.height-t.height-8))),placement:r<8?"below":"above"}}var dn=14,Lc=12,Mc=12,Hc=18;function Cr(i,e,t,n=Lc){let s=e.height-dn-t.height;if(!(i>=s-Hc))return{placement:"sheet",nudgeY:0};let o=Mc,a=s-n;return a<=o?{placement:"sheet",nudgeY:0}:{placement:"sheet",nudgeY:Math.round((o+a)/2-i)}}function Er(i,e,t,n){let s=t.width/2+12,r=Math.max(s,Math.min(e.width-s,i.x)),o=i.y+t.height+24<=e.height,a=i.y<t.height+24&&o?"below":"above",l=n&&a==="above"?Math.max(t.height+24,i.y):i.y;return{left:r,top:Math.max(8,Math.min(e.height-8,l)),placement:a}}function Ar(i,e,t){let n=i.querySelector("[data-pg-select-partial]"),s=[...i.querySelectorAll("[data-pg-event-key]")],r=()=>s.filter(a=>a.checked).map(a=>a.dataset.pgEventKey).filter(Boolean),o=()=>{if(!n)return;let a=r().length;n.disabled=a===0,n.textContent=e?.(a)??n.textContent};s.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=r();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 Rc="sl-confirm-scrim",Ic="--sl-scrim-mask";function Oc(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 Pr(i,e,t,n){let s=i??document.createElement("div");return i||(s.className=Rc),s.style.setProperty(Ic,Oc(n)),t.parentNode===e?s.nextSibling!==t&&e.insertBefore(s,t):s.parentNode!==e&&e.appendChild(s),s}function pn(i){return i?.remove(),null}var Bc=360,Nc=160,Lr=450;function Mr(){try{return globalThis.matchMedia?.("(pointer: coarse)").matches??!1}catch{return!1}}function Vc(i){return Dc("#ffffff",i)>=3?"#ffffff":"#0b0f19"}var bi=class{constructor(e){this.el=null;this.seat=null;this.outsideTap=null;this.scrim=null;this.shownAt=0;this.lift=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=ot(e)?e.viewUrl??"":"",s=li(t);if(!n&&!s)return"";let r=n?null:ci(e,e.focalPoint??t.focalPoint);if(!n&&r==null)return"";let o=s&&r!=null?`<div class="sl-confirm-sight">${O(gi("picker.sightline",{m:r}))}</div>`:"";if(!n)return o;let a=O(gi("picker.viewFromSeat",{label:e.label})),l=O(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 s=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(P=>P.toggleAttribute("inert",!0)),n.controller.setSelectionFocus(e.id),s&&s!==e.id&&n.controller.deselect([s]),n.hideTooltip();let r=n.controller.seatDetails(e.id),o=n.controller.doc?.categories.find(P=>P.key===e.categoryKey),a=r?.price??(o?.tiers?.length?o.tiers[0].price:o?.price),l=a!=null?n.paidPrice(e.categoryKey,r?.tierId??o?.tiers?.[0]?.id??null,a,e.label):void 0,c=Us(r,e.displayLabel??e.label,Fe(r)),p=r?.tiers??o?.tiers??[],d=r?.tierId??p[0]?.id,u=n.suppressPricing()?"":Qs(p,d,P=>n.money(n.paidPrice(e.categoryKey,P.id,P.price,e.label))),h=n.buyerView()==="venue3d",f=n.performanceGroup()?.confirmDateSelection??void 0,g=f?n.performanceGroup()?.nights?.()??[]:[],x=f?hr(g,f,e.id,(P,C)=>n.tf(P,C)):"";this.shownAt=performance.now();let w=document.createElement("div");w.className="sl-confirm sl-mo-in",t==="remove"&&w.classList.add("sl-confirm-removing"),x&&w.classList.add("sl-confirm-group-dates"),w.setAttribute("role","dialog"),w.setAttribute("aria-label",gi("picker.confirmSeatLabel",{label:e.label}));let y=o?.color??"#6e7bff";w.style.setProperty("--sl-cat",y),w.style.setProperty("--sl-cat-ink",Vc(y));let T=String(r?.categoryLabel??o?.label??e.categoryKey),b=n.controller.categoryAvailability()[e.categoryKey],M=typeof b=="number"&&b>0?_c("picker.leftCount",b):"";w.innerHTML=er({identityFields:c,identity:Ks(r,e.displayLabel??e.label,Fe(r)),marker:Mt(r?.wheelchairSpaceType),see3dPill:Ws(n.canOffer3d(),h),categoryColor:o?.color??"#6e7bff",categoryLabel:T,priceLabel:!n.suppressPricing()&&l!=null?n.money(l):"",categoryLeftLabel:M,tierChoices:u,groupDates:x,wheelchair:zs(r?.wheelchairSpaceType),commercial:$s(e.commercial),thumb:n.seatViewEnabled()&&n.buyerView()!=="venue3d"?this.thumbHtml(e):"",inspect:h?`<div class="sl-confirm-inspect-row">${qs(e,n.suppressPricing()?`${r?.displayLabel??e.displayLabel??e.label}`:`${r?.displayLabel??e.displayLabel??e.label} \xB7 ${l==null?n.tf("picker.priceNotSupplied","Price not supplied"):n.money(l)}`,h)}${Gs(e,h?n.view3dCompareSeatIds():null)}${on(n.canOffer3d(),h)}</div>`:on(n.canOffer3d(),h),see3dRow:Ys(n.canOffer3d(),h),cancelLabel:gi("common.cancel"),selectLabel:t==="remove"?n.tf("picker.removeSeat","Remove seat"):n.addSeatLabel(r?.objectType)}),t==="remove"&&w.querySelector(".sl-confirm-add svg path")?.setAttribute("d","M6 6l12 12M18 6L6 18"),n.els().map.appendChild(w),this.el=w;let k=w.querySelector(".sl-confirm-thumb"),R=k?.closest(".sl-confirm-thumbwrap")??null;if(k&&R){let P=!1,C=()=>{if(P||!R.isConnected)return;P=!0;let I=()=>{R.remove(),this.el===w&&n.reanchor()};if(n.reducedMotion()||typeof requestAnimationFrame!="function"){I();return}R.style.height=`${R.offsetHeight}px`,R.classList.add("sl-confirm-thumb-out"),requestAnimationFrame(()=>{R.style.height="0px",R.style.opacity="0"}),setTimeout(I,Nc)};k.addEventListener("error",C),k.addEventListener("load",()=>{k.naturalWidth||C()});let H=e.viewMeta?.previewUrl??e.viewUrl;H?n.resolveAssetUrl(H).then(I=>{if(!(!w.isConnected||this.el!==w)){if(!I){C();return}k.src=I}}).catch(I=>{C(),n.onError(I)}):C()}n.reanchor(),this.liftSeatClearOfSheet(e),w.querySelector(".sl-confirm-view")?.addEventListener("click",()=>{n.openSeatView(e)}),w.querySelector(".sl-confirm-confidence")?.addEventListener("click",P=>{n.openSeatConfidencePassport(e,P.currentTarget instanceof HTMLElement?P.currentTarget:null)}),w.querySelector(".sl-confirm-compare")?.addEventListener("click",()=>n.saveView3dComparisonSeat(e)),w.querySelectorAll("[data-confirm-tier]").forEach(P=>{P.addEventListener("click",()=>{let C=P.dataset.confirmTier,H=p.find(N=>N.id===C);if(!H)return;n.controller.setSeatTier(e.id,H.id),w.querySelectorAll("[data-confirm-tier]").forEach(N=>{N.setAttribute("aria-pressed",String(N===P))});let I=w.querySelector(".sl-confirm-price");I&&(I.textContent=n.money(n.paidPrice(e.categoryKey,H.id,H.price,e.label))),n.reanchor()})}),w.querySelectorAll(".sl-confirm-3d,.sl-confirm-3dpill,.sl-confirm-3drow").forEach(P=>{P.addEventListener("pointerdown",Zt,{once:!0}),P.addEventListener("click",()=>{n.buyerView()==="venue3d"?(n.dismiss(),n.view3dHandle()?.flyToSeat(e.id)):(n.rememberView3dReturnSeat(e),n.dismiss(),n.enter3d(e.id))})}),mr(w,f,(P,C)=>n.tf(P,C),()=>n.reanchor()),w.querySelector(".sl-confirm-add").addEventListener("click",()=>{if(!this.ghostActivation()){if(this.mode==="remove"){this.removeCommitted();return}this.commit()}}),w.querySelector(".sl-confirm-cancel").addEventListener("click",()=>{this.ghostActivation()||this.cancel()}),this.armOutsideTap(w),requestAnimationFrame(()=>{let P=w.querySelector(".sl-confirm-add");P?.focus(),n.liftToastOverConfirm(),n.fitTranslatedRows(),n.inviteCommit(w,P)})}liftSeatClearOfSheet(e){let t=this.host,n=t.root();if(!this.el||n?.dataset.layout!=="narrow"||n?.dataset.view3d==="on")return;let s=t.els().map;if(!s)return;let r=t.controller.worldToScreen({x:e.x,y:e.y}),o=t.controller.getRenderer(),a=o?.getCameraGestureCount?.()??0,{nudgeY:l}=Cr(r.y,{height:s.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}o?.panScreenBy?.({x:0,y:l},{animate:!t.reducedMotion()}),this.lift={dy:c+l,gestures:a}}settleLift(){let e=this.lift;if(this.lift=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=Pr(this.scrim,n,this.el,t),Yn(this.el,t,n),e.liftToastOverConfirm();return}this.scrim=pn(this.scrim);let s=n.clientWidth,r=n.clientHeight,o=this.el.offsetWidth||276,a=this.el.offsetHeight||230,l=this.el.classList.contains("sl-confirm-group-dates"),c=Er(t,{width:s,height:r},{width:o,height:a},l);this.el.dataset.placement=c.placement,this.el.style.left=`${c.left}px`,this.el.style.top=`${c.top}px`,Kt(this.el,t,{left:c.left,top:c.top,width:o,height:a})}ghostActivation(){return Mr()?performance.now()-this.shownAt<Lr:!1}armOutsideTap(e){this.disarmOutsideTap();let t=this.host,n=r=>{if(this.el!==e){this.disarmOutsideTap();return}let o=r.target;!o||e.contains(o)||t.els().tray?.contains(o)||this.cancel()};this.outsideTap=n;let s=t.root();setTimeout(()=>{this.outsideTap===n&&(s??document).addEventListener("pointerdown",n,!0)},Mr()?Lr: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&&Je(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 s=this.el?.querySelector(".sl-confirm-add")??null;if(s?.classList.contains("is-adding")||!await fr(this.el,t.id,e.performanceGroup()?.confirmDateSelection??void 0))return;e.collapseSectionCard(),this.seat=null,e.syncTray(),e.syncSelectionTo3d();let r=()=>{e.dismiss(),Ki(e.els(),e.controller.worldToScreen(t),t,e.controller.doc?.categories)};if(!s||e.reducedMotion()){r();return}s.classList.remove("sl-confirm-add-invite"),s.classList.add("is-adding"),s.setAttribute("aria-disabled","true");let o=s.querySelector(".sl-confirm-add-t");o&&(o.textContent=e.tf("picker.added","Added")),e.scheduleMotion(r,Bc)}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 Hr(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 Rr(i,e){return i&&i!=="seat"?e("picker.select","Select"):e("picker.addSeat","Add seat")}import{pointInPolygon as Fc}from"@seatlayer/core";import{createMinimapTransform as $c,minimapPointToWorld as zc,minimapViewportPlan as jc}from"@seatlayer/core/picker/minimapGeometry";function Ir(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 s=document.createElement("div");s.className="sl-minimap",s.setAttribute("role","group");let r=document.createElement("div");r.className="sl-minimap-bar";let o=document.createElement("span");o.className="sl-minimap-label";let a=document.createElement("span");a.className="sl-minimap-key",a.setAttribute("aria-label",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",r.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.")),s.append(r,c),e.appendChild(s),this.miniWrap=s,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 s=196,r=146,o=6,a=n.width/Math.max(1,n.height),l=s,c=Math.round(s/a);c>r&&(c=r,l=Math.round(r*a)),l=Math.max(64,l),c=Math.max(48,c);let p=Math.min(2,window.devicePixelRatio||1);e.width=Math.round(l*p),e.height=Math.round(c*p),e.style.width=`${l}px`,e.style.height=`${c}px`,t.width=e.width,t.height=e.height,this.miniTf=$c(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,r=n.find(p=>p.active)?.label??this.host.focusedSectionLabel(),o=r?`${t} \xB7 ${r}`: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 s=d=>d*t.scale+t.offX,r=d=>d*t.scale+t.offY,o=this.host.cssVar("--sl-line")||"rgba(139,147,167,.5)",a=this.host.cssVar("--sl-muted")||"#8b93a7",l=this.host.cssVar("--sl-accent")||"#6e7bff",c=this.host.cssVar("--sl-success")||"#22a06b",p=this.host.controller.getMinimapSnapshot();for(let d of p.sections){if(d.outline.length<3)continue;n.beginPath(),d.outline.forEach((h,f)=>f===0?n.moveTo(s(h.x),r(h.y)):n.lineTo(s(h.x),r(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((f,g)=>({x:f.x+g.x,y:f.y+g.y}),{x:0,y:0});n.beginPath(),n.arc(s(h.x/d.outline.length),r(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((f,g)=>g===0?n.moveTo(s(f.x),r(f.y)):n.lineTo(s(f.x),r(f.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,f=g=>{let x=h.get(g);if(x)return x;let w=u?.categoryDisplayColor?.(g)||c;return h.set(g,w),w};for(let g of p.seats)n.globalAlpha=g.state==="inactive"?.22:.78,n.fillStyle=g.state==="inactive"?a:g.state==="selected"?l:f(g.categoryKey),n.beginPath(),n.arc(s(g.x),r(g.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 s=e.getContext("2d");if(!s)return;s.clearRect(0,0,e.width,e.height),s.drawImage(t,0,0);let r=this.host.controller.getViewport();if(!r)return;let o=jc(r.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";s.save(),s.globalAlpha=.1,s.fillStyle=a,s.fillRect(o.raw.x,o.raw.y,o.raw.width,o.raw.height),s.globalAlpha=.9,s.lineJoin="round",s.lineWidth=Math.max(4,n.dpr*3.25),s.strokeStyle=l,s.strokeRect(o.raw.x,o.raw.y,o.raw.width,o.raw.height),s.globalAlpha=1,s.lineWidth=Math.max(2,n.dpr*1.75),s.strokeStyle=a,s.strokeRect(o.raw.x,o.raw.y,o.raw.width,o.raw.height),o.clipped&&Object.values(o.clippedEdges).some(Boolean)&&(s.setLineDash([Math.max(3,n.dpr*3),Math.max(2,n.dpr*2)]),s.strokeRect(o.clipped.x,o.clipped.y,o.clipped.width,o.clipped.height)),s.restore()}minimapWorldPoint(e){let t=this.miniCanvas,n=this.miniTf;if(!t||!n)return null;let s=t.getBoundingClientRect(),r=(e.clientX-s.left)*(t.width/Math.max(1,s.width)),o=(e.clientY-s.top)*(t.height/Math.max(1,s.height));return{...zc({x:r,y:o},n),px:r,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,s=e.key==="ArrowUp"?-t.height*.2:e.key==="ArrowDown"?t.height*.2:0;!n&&!s||(this.host.controller.clearSectionFocus(),this.host.controller.panToWorld({x:t.x+t.width/2+n,y:t.y+t.height/2+s}),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)&&Fc(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 Gc=12;function Or(i,e){let t=e.floors(),n=new Set(t.map(k=>k.label.trim().toLocaleLowerCase())),s=e.zones().filter(k=>k.seatCount>0&&!n.has(k.label.trim().toLocaleLowerCase())),r=e.sections().filter(k=>k.seatCount>0&&!n.has(k.label.trim().toLocaleLowerCase())),o=s.length>1?[]:r,a=t.length>1,l=s.length>1,c=o.length>1;if(!a&&!l&&!c)return 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>',f=document.createElement("span");u.innerHTML=h,u.appendChild(f);let g=()=>{for(let k of p.querySelectorAll(":scope > div")){let R=k.querySelector('[aria-pressed="true"]');!R||k.scrollWidth<=k.clientWidth||R.scrollIntoView({block:"nearest",inline:"nearest"})}},x=()=>{if(d)return d;for(let k of p.querySelectorAll(":scope > div")){let R=k.querySelector('button[aria-pressed="true"]'),P=R?.textContent?.trim();if(P&&R?.dataset.floor!=="")return P}return a&&(l||c)?v("picker.levelsAndAreas","Levels & areas"):a?v("picker.levels","Levels"):v("picker.areas","Areas")},w=k=>{p.classList.toggle("is-open",k),u.setAttribute("aria-expanded",String(k)),k&&typeof requestAnimationFrame=="function"&&requestAnimationFrame(g),f.textContent=x()};u.addEventListener("click",()=>w(!p.classList.contains("is-open"))),p.addEventListener("keydown",k=>{k.key!=="Escape"||!p.classList.contains("is-open")||(k.preventDefault(),k.stopPropagation(),w(!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 T=v("picker.closeVenueNavigation","Close venue navigation");y.setAttribute("aria-label",T),y.title=T,y.addEventListener("click",()=>{w(!1),u.focus()}),w(!1),p.appendChild(u);let b=k=>{},M=k=>{};if(a){let k=document.createElement("div");k.setAttribute("role","group"),k.setAttribute("aria-label",v("picker.levels","Levels"));let R=[];M=H=>{R.forEach(I=>{I.setAttribute("aria-pressed",String((I.dataset.floor===""?null:Number(I.dataset.floor))===H))})};let P=H=>{e.focusFloor(H)&&(M(H),b(H))},C=(H,I)=>{let N=document.createElement("button");N.type="button",N.textContent=H,N.dataset.floor=I===null?"":String(I),N.setAttribute("aria-pressed",String(I===null)),N.addEventListener("click",()=>{P(I),w(!1)}),R.push(N),k.appendChild(N)};C(v("picker.allLevels","All levels"),null);for(let H of t)C(H.label||un("picker.levelNumber",{number:H.index+1}),H.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 R=l?s.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)&&M(C.floorIndex)}})),P=C=>{let H=l||C===null?R:R.filter(I=>I.floorIndex===void 0||I.floorIndex===C);if(k.replaceChildren(),!H.length){k.remove();return}if(k.isConnected||p.insertBefore(k,y.isConnected?y:null),!l&&H.length>Gc){let I=document.createElement("select");I.setAttribute("aria-label",v("picker.jumpToSection","Jump to section"));let N=document.createElement("option");N.value="",N.textContent=v("picker.jumpToSection","Jump to section"),I.appendChild(N);for(let te of H){let ne=document.createElement("option");ne.value=te.id,ne.textContent=te.label,I.appendChild(ne)}I.addEventListener("change",()=>{H.find(te=>te.id===I.value)?.go()}),k.appendChild(I);return}for(let I of H){let N=document.createElement("button");N.type="button",N.textContent=I.label,N.dataset.area=I.id,N.addEventListener("click",()=>{d=I.label,I.go(),w(!1)}),k.appendChild(N)}};b=P,P(null)}return p.appendChild(y),i.appendChild(p),p}var vi=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 r=document.createElement("button");r.type="button",r.className="main",r.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(r,o),e.appendChild(t),this.chip=t}let n=this.host.savedSeatIds().length,s=t.querySelector(".main");s&&(s.textContent=n>1?un("picker.compareCount",{count:n}):v("picker.oneSeatSaved","1 seat saved"),s.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 _r(i){return!i?.querySelector('[data-ref="zfs"]')}var Dr="sl:sheet-hint";function Br(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"),qc(i.root)},900)}function qc(i){if(!i||i.dataset.layout!=="narrow")return;try{if(window.sessionStorage.getItem(Dr))return;window.sessionStorage.setItem(Dr,"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 Nr(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 yi(i){let e=i.committedSelection(),t=i.controller.getGAAreas(),n=i.hold?.items??[],s=new Set(n.map(u=>u.label)),r=ts(i,t,n),o=Me(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=>!s.has(u.label)),p=c.reduce((u,h)=>u+i.paidPrice(h.categoryKey,h.tierId??null,h.price,h.label)*(h.quantity??1),0)+r+a,d=c.reduce((u,h)=>u+(h.quantity??1),0)+o+l;return{seats:e,freshSeats:c,gaAreas:t,heldItems:n,heldLabels:s,heldCount:l,total:p,count:d}}function wi(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 xi(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 s of n)s.categoryKey===e.key&&t.push(s.price);return t.length?{min:Math.min(...t),max:Math.max(...t)}:void 0}var Ht="seatlayer_";function Uc(){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 Kc(i){return Array.isArray(i)?i.filter(e=>typeof e=="string"&&!!e):[]}function Wc(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 Vr(i,e){let t=s=>!!s&&s.toLowerCase()===e.toLowerCase(),n=i.find(s=>t(s.key??s.id))??i.find(s=>t(s.label));return n?.key??n?.id??null}function Fr(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,s)=>t[s]?.seat||n.label),category:t[0]?.category??e[0].categoryKey,unitPrice:e[0].price,total:e.reduce((n,s)=>n+s.price,0)}}function Yc(i,e,t){let n=new Map;for(let r of e){let o=n.get(r.rowKey);o?o.push(r):n.set(r.rowKey,[r])}let s=[];for(let r of n.values()){let o=[...r].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)s.push(Fr(i,o.slice(p,p+t)));a=l}}return s}function Qc(i,e,t){let n=new Map;for(let r of e){let o=n.get(r.sectionKey);o?o.push(r):n.set(r.sectionKey,[r])}let s=[];for(let r of n.values()){if(r.length<t)continue;let o=[...r].sort((a,l)=>a.price!==l.price?l.price-a.price:a.rowKey.localeCompare(l.rowKey)||a.index-l.index);s.push(Fr(i,o.slice(0,t)))}return s}function Xc(i,e){if(!i.event())return re("not_loaded","The seat map has not finished loading.");let n=i.selectionLimits(),s=Math.floor(Number(e.count));if(!Number.isInteger(s)||s<1||s>n.max)return re("bad_count",`count must be a whole number between 1 and ${n.max}.`);let r=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?Vr(i.categories(),l):null;if(l&&!p)return re("no_match",`No ticket type called "${l}".`);let d=c?Vr(i.zones(),c):null;if(c&&!d)return re("no_match",`No zone called "${c}".`);let u=i.seats().filter(g=>g.available);if(!u.length)return re("sold_out");let h=u.filter(g=>(!p||g.categoryKey===p)&&(!d||g.zoneId===d)&&(a==null||g.price<=a));if(!h.length)return re("no_match");let f=o?Yc(i,h,s):Qc(i,h,s);return f.length?(f.sort((g,x)=>x.unitPrice!==g.unitPrice?x.unitPrice-g.unitPrice:g.row.localeCompare(x.row)||g.labels[0].localeCompare(x.labels[0])),{ok:!0,groups:f.slice(0,r),searched:{count:s,filters:{...a!=null?{max_price:a}:{},...p?{category:p}:{},...d?{zone:d}:{},together:o}}}):re(o?"not_enough_together":"no_match")}function $r(i){return{ok:!0,...i.selection()}}function Zc(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=Kc(e.seat_ids);return n.length?(i.clearSelection(),i.selectObjects(n),$r(i)):re("nothing_requested","Pass one or more seat ids or labels in seat_ids.")}function Jc(i,e){let t=async s=>{try{return await s()}catch(r){return re("error",r instanceof Error?r.message:String(r))}},n=[{name:`${Ht}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(()=>Wc(i,e))},{name:`${Ht}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:s=>t(()=>Xc(i,s))},{name:`${Ht}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:s=>t(()=>Zc(i,s))},{name:`${Ht}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(()=>$r(i))}];return e&&n.push({name:`${Ht}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 zr(i,e={}){let t=Uc();if(!t||typeof t.registerTool!="function")return null;let n=new AbortController,s=Jc(i,!!e.holds),r=[],o=e.exposedTo?.length?[...new Set(e.exposedTo)]:void 0;try{for(let a of s)await t.registerTool(a,{signal:n.signal,...o?{exposedTo:o}:{}}),r.push(a.name)}catch(a){console.warn("seatmap: WebMCP tools could not be registered",a)}return r.length?{names:r,dispose:()=>{if(n.abort(),typeof t.unregisterTool=="function")for(let a of r)try{t.unregisterTool(a)}catch{}}}:null}async function jr(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 zr(fn(i,t),{holds:t,exposedTo:n}),i.destroyed&&mn(i)}catch(s){console.warn("seatmap: WebMCP registration failed",s)}}function mn(i){i.webMcp?.dispose(),i.webMcp=null}function fn(i,e){let t=(n,s)=>{if(Number.isInteger(n.logicalSeatIndex))return n.logicalSeatIndex;let r=n.id.lastIndexOf(":"),o=r<0?NaN:Number(n.id.slice(r+1));return Number.isFinite(o)?o:s};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(s=>!s.notForSale).map(s=>{let r=xi(i,s),o=wi(i,s);return{key:s.key,label:s.label??s.key,...o===void 0?{}:{price:o},...r&&r.min!==r.max?{priceRange:r}:{},available:n[s.key]??0}})},zones:()=>i.controller.getBestAvailableZones(),hasPremiumSeats:()=>i.controller.hasPremiumSeats(),seats:()=>{let n=i.controller.getActiveFloorId(),s=[];return i.allSeats().forEach((r,o)=>{if(r.floorId&&n&&r.floorId!==n)return;let a=i.controller.getStatus(r.id)??"free",l=i.controller.doc?.categories.find(p=>p.key===r.categoryKey),c=l?.tiers?.length?l.tiers[0].price:l?.price??0;s.push({id:r.id,label:r.label,rowKey:r.logicalRowId??r.rowId,sectionKey:r.sectionId??r.rowId,index:t(r,o),categoryKey:r.categoryKey,price:i.paidPrice(r.categoryKey,l?.tiers?.[0]?.id??null,c,r.label),...r.zoneId?{zoneId:r.zoneId}:{},available:a==="free"&&!l?.notForSale})}),s},describeSeat:n=>{let s=i.controller.seatDetails(n);return s?{section:s.sectionLabel??"",row:q(s)??"",seat:s.seatNumber??s.label,category:s.categoryLabel??s.categoryKey}:null},selection:()=>{let{freshSeats:n,total:s,count:r}=yi(i);return{seats:n.map(o=>({id:o.id,label:o.label,section:o.sectionLabel??"",row:q(o)??"",seat:o.seatNumber??o.label,category:o.categoryKey,price:i.paidPrice(o.categoryKey,o.tierId??null,o.price,o.label)})),count:r,total:s,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?ed(i):Promise.resolve({ok:!1,reason:"not_allowed"})}}async function ed(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 Gr(i,e){Se({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 td}from"@seatlayer/core/core/seatConfidence";function Y(i){return String(i??"").replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}function qr(i){let e=td(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>`:"",s=e.modeledTarget?`<div><dt>Modeled target</dt><dd>${Y(e.modeledTarget)}</dd></div>`:"",r=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=ke(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+s+r+`</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 Ur(i){return i?i.closest("[data-report]")?"report":i.closest("[data-close]")||i.classList.contains("sl-view3d-passport-scrim")?"close":null:null}function Si(i,e,t){let n=i?.querySelector("[data-report]"),s=i?.querySelector("[data-report-status]");n&&(n.disabled=e!=="failed",n.textContent=e==="received"?"Report received":"Report this view"),s&&(s.setAttribute("role",e==="failed"?"alert":"status"),s.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;Rt(i,!1);let s=e.confidenceEvidence,r=i.controller.seatDetails(e.id),o=document.createElement("div");o.className="sl-view3d-passport-shell",o.innerHTML=qr({seat:e,title:r?.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(),Rt(i);return}if(u.key!=="Tab")return;let h=p();if(!h.length)return;let f=h[0],g=h[h.length-1];u.shiftKey&&document.activeElement===f?(u.preventDefault(),g.focus()):!u.shiftKey&&document.activeElement===g&&(u.preventDefault(),f.focus())};window.addEventListener("keydown",d,!0),i.view3dPassportCleanup=()=>{window.removeEventListener("keydown",d,!0);for(let g of l)g.element.inert=g.inert,g.ariaHidden===null?g.element.removeAttribute("aria-hidden"):g.element.setAttribute("aria-hidden",g.ariaHidden);let u=t?.isConnected?t:i.confirmEl?.querySelector(".sl-confirm-confidence")??i.view3dCompareEl?.querySelector("[data-passport-seat]")??null,h=u?.closest(".sl-confirm,.sl-view3d-compare");h?.isConnected&&(h.inert=!1,h.removeAttribute("aria-hidden")),o.remove(),n.classList.remove("has-passport"),i.view3dPassportEl===o&&(i.view3dPassportEl=null);let f=u??i.view3dCompareEl?.querySelector("[data-passport-seat]")??i.confirmEl?.querySelector(".sl-confirm-confidence")??i.view3dCompareChip.mainButton();(t?.isConnected?t:f)?.focus()},o.addEventListener("click",u=>{let h=Ur(u.target instanceof HTMLElement?u.target:null);h==="close"&&Rt(i),h==="report"&&id(i,e)}),requestAnimationFrame(()=>p()[0]?.focus()),i.emit3dAnalytics("3d_confidence_passport_opened",{seatId:e.id,evidenceId:s?.evidenceId??null,eventConfigurationId:s?.eventConfigurationId??null,modelLevel:s?.modelLevel??"unverified",realityLevel:s?.realityLevel??"none"})}async function id(i,e){if(i.api.reportViewEvidence){Si(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}),Si(i.view3dPassportEl,"received",t.report.id)}catch{Si(i.view3dPassportEl,"failed")}}}function Rt(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 Kr(i){let e=i.view3dEl;if(!e||i.view3dCompareSeatIds.length<2)return;$e(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),s=t.some(h=>!!h.price),r=document.createElement("div");r.className="sl-view3d-compare-shell";let o=t.map((h,f)=>`<article><span>Seat ${f===0?"A":"B"}</span><strong>${n(h.label)}</strong><small>Section ${n(h.section)} \xB7 Row ${n(h.row)}</small><dl>`+(s?`<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("");r.innerHTML=`<div class="sl-view3d-compare-scrim" aria-hidden="true"></div><section class="sl-view3d-compare" role="dialog" aria-modal="true" aria-labelledby="sl-view3d-compare-title"><header><div><span>Seat inspection</span><strong id="sl-view3d-compare-title">Compare disclosed attributes</strong></div><button type="button" data-close aria-label="Close seat comparison">\xD7</button></header><p class="sl-view3d-compare-note">${s?"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(r),e.classList.add("has-comparison"),i.view3dCompareEl=r;let p=r.querySelector(".sl-view3d-compare"),d=()=>[...p.querySelectorAll('button:not(:disabled),[href],[tabindex]:not([tabindex="-1"])')],u=h=>{if(h.key==="Escape"){h.preventDefault(),$e(i);return}if(h.key!=="Tab")return;let f=d();if(!f.length)return;let g=f[0],x=f[f.length-1];h.shiftKey&&document.activeElement===g?(h.preventDefault(),x.focus()):!h.shiftKey&&document.activeElement===x&&(h.preventDefault(),g.focus())};window.addEventListener("keydown",u),i.view3dCompareCleanup=()=>{window.removeEventListener("keydown",u);for(let h of c)h.element.inert=h.inert,h.ariaHidden===null?h.element.removeAttribute("aria-hidden"):h.element.setAttribute("aria-hidden",h.ariaHidden);r.remove(),e.classList.remove("has-comparison"),i.view3dCompareEl===r&&(i.view3dCompareEl=null),a?.isConnected?a.focus():i.view3dCompareChip.mainButton()?.focus()},r.querySelector("[data-close]")?.addEventListener("click",()=>$e(i)),r.querySelectorAll("[data-passport-seat]").forEach(h=>h.addEventListener("click",()=>{let f=h.dataset.passportSeat,g=f?i.allSeats().find(x=>x.id===f):void 0;g&&bn(i,g,h)})),r.querySelectorAll("[data-view-seat]").forEach(h=>h.addEventListener("click",()=>{let f=h.dataset.viewSeat;$e(i,!1),f&&i.view3dHandle?.flyToSeat(f)})),r.querySelectorAll("[data-select-seat]").forEach(h=>h.addEventListener("click",()=>{let f=h.dataset.selectSeat;f&&nd(i,f)})),requestAnimationFrame(()=>d()[0]?.focus()),i.emit3dAnalytics("3d_comparison_opened",{seatIds:i.view3dCompareSeatIds.slice()})}function $e(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 nd(i,e){if(i.salesClosed){i.toast(i.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}let t=i.allSeats().find(s=>s.id===e);if(!t)return;if($e(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 dd}from"@seatlayer/core";import{seatViewDisclosure as pd}from"@seatlayer/core/view3d/crossfade/panorama";import{t as Wr}from"@seatlayer/core";var sd=900,rd=450;function od(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 Yr(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 s=document.createElement("div");s.className="sl-view3d-stop",s.setAttribute("role","status"),s.setAttribute("aria-live","polite"),i.append(t,s);let r=null,o=null;return{onStopChange(a){if(r&&(clearTimeout(r),r=null),o&&(clearTimeout(o),o=null),!a){s.classList.remove("is-shown"),s.textContent="",o=setTimeout(()=>{o=null,i.classList.remove("is-seat-view")},rd);return}i.classList.add("is-seat-view"),s.textContent=od(a),s.classList.add("is-shown"),r=setTimeout(()=>{r=null,s.classList.remove("is-shown")},sd)},dispose(){r&&(clearTimeout(r),r=null),o&&(clearTimeout(o),o=null),t.remove(),s.remove(),i.classList.remove("is-seat-view")}}}var ad=44,ld=92;function Qr(i,e,t,n={}){let s=i?.sectionLabel,r=q(i),o=cd(i,e),a=[s,r?Wr("picker.rowLabel",{label:r}):null,o?Wr("picker.seatLabel",{label:o}):null].filter(Boolean).join(" \xB7 "),l=n.maxChars??(n.narrow?ad:ld);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 cd(i,e){if(i?.seatNumber)return i.seatNumber;let t=i?.displayLabel??e,n=s=>{!s||!t.startsWith(s)||t.length<=s.length||(t=t.slice(s.length).replace(/^[\s·\-\/_]+/,""))};return n(i?.sectionLabel),n(q(i)),t}import{seatConfidenceDisclosure as hd}from"@seatlayer/core/core/seatConfidence";function Xr(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.")},s=document.createElement("div");s.className="sl-view3d-unavailable",s.dataset.state=e.visualState,s.setAttribute("role","status"),s.setAttribute("aria-live","polite");let r=document.createElement("span");r.className="sl-view3d-unavailable-eyebrow",r.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(r,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,s.append(a,l,c),l.addEventListener("click",()=>vn(i)),i.appendChild(s),Wt(s,e.anchor??null)}function vn(i){let e=i?.querySelector(".sl-view3d-unavailable:not([data-leaving])");e&&(e.dataset.leaving="true",Je(e))}function Zr(i){return i.buyerView}function Jr(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 eo(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 to(i){if(!i.view3dHandle)return;let e=i.allSeats().map(t=>({seatId:t.id,state:i.seatState3dFor(t)}));i.view3dHandle.setAvailability(e)}function io(i){i.view3dHandle&&i.view3dHandle.setSelection(i.controller.getSelection().map(e=>e.id))}async function no(i,e){let t=i.allSeats().find(n=>n.id===e);if(!t)return null;if(t.viewUrl)try{let n=t.viewMeta?.previewUrl,s=!!n&&n!==t.viewUrl,r=s?await i.buyerAssetUrls.resolve(n):null,o=s?t.viewUrl:await i.buyerAssetUrls.resolve(t.viewUrl);return!o||s&&!r?null:{url:o,...r?{previewUrl:r}:{},...s?{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 so(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 r=i.controller.getStatus(t.id);if(r==="held"||r==="booked"||r==="not_for_sale"){i.showUnavailable3dSeat(t,i.seatState3dFor(t),r),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 ro(i,e){let t=i.allSeats().find(n=>n.id===e);return Qr(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 oo(i,e,t,n){let s=i.view3dEl;if(!s)return;let r=i.controller.seatDetails(e.id),o=r?.displayLabel??e.displayLabel??e.label,a=q(r);Xr(s,{status:n,visualState:t,location:[r?.sectionLabel,a?dd("picker.rowLabel",{label:a}):null,o].filter(Boolean).join(" \xB7 ")||o,tf:(l,c)=>i.tf(l,c)}),i.announceSeat(e)}function ao(i){vn(i.view3dEl)}function lo(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 co(i){i.closeView3dComparison(!1),i.view3dCompareSeatIds=[],i.view3dCompareChip.remove(),i.emit3dAnalytics("3d_comparison_cleared")}function po(i,e){let t=i.allSeats().find(h=>h.id===e);if(!t)return null;let n=i.controller.seatDetails(t.id),s=i.controller.doc?.categories.find(h=>h.key===t.categoryKey),r=n?.price??(s?.tiers?.length?s.tiers[0].price:s?.price),o=r!=null?i.paidPrice(t.categoryKey,n?.tierId??s?.tiers?.[0]?.id??null,r,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?pd({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=ke(t.commercial)||i.tf("picker.noAuthoredRestriction","No organizer-authored restriction"),d=n?.wheelchairSpaceType?`${at(n.wheelchairSpaceType)} \xB7 metadata, not access certification`:i.tf("picker.noAccessibilityMetadata","No accessibility metadata supplied"),u=hd(t.confidenceEvidence);return{seat:t,label:n?.displayLabel??t.displayLabel??t.label,section:n?.sectionLabel??t.sectionId??"\u2014",row:q(n)??n?.rowLabel??"\u2014",category:n?.categoryLabel??s?.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 ho(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 s=document.createElement("button");s.type="button",s.className="sl-view3d-back",s.innerHTML=`<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M15 18l-6-6 6-6"/></svg><span>${i.tf("picker.backToMap","Back to map")}</span>`;let r=s.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");r&&(r.textContent=d),s.setAttribute("aria-label",d)};if(s.addEventListener("click",()=>{if(i.view3dTargetSeatId&&i.view3dHandle){i.view3dHandle.focusOverview();return}i.exit3d()}),i.regions["top-left"]?.prepend(s),i.view3dBack=s,i.publish3dTopInset(),_r(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([Ct(),i.controller.loadEventConfiguration()]),u=d?await ti(d,y=>i.buyerAssetUrls.resolve(y)):null,h=t.theme?.venue3d?.shellAssetUrl,f=await ii(h,y=>i.buyerAssetUrls.resolve(y));if(l!==i.view3dGen||i.buyerView!=="venue3d"||i.view3dEl!==n)return;let g={doc:t,seats:c,...u?{eventConfigurationId:u.id,eventConfiguration:u}:{},...f?{registeredShellGlb:f}:{}};a.textContent=i.tf("picker.building3d","Building venue geometry\u2026");let x=await p.prepareVenue3D(g);if(l!==i.view3dGen||i.buyerView!=="venue3d"||i.view3dEl!==n)return;let w=p.mountVenue3D(n,{...g,prepared:x},{portraitOverviewCrop:!0,arriveAtSeatEye:!0,lookAroundHint:Be(),seatViewActionLabel:y=>i.allSeats().find(T=>T.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 T=n.querySelector('select[data-locator="section"]'),b=y??"";!T||T.value===b||(T.value=b,T.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((T,b)=>{let M=()=>{i.seatViewFor3d(y).then(R=>{R?T(R):b(new Error("seat_view_unavailable"))})},k=globalThis.requestIdleCallback;typeof k=="function"?k(M,{timeout:1500}):setTimeout(M,50)})}:{},onAnalytics:(y,T)=>i.emit3dAnalytics(y,T)});i.view3dHandle=w,i.view3dSeatViewChrome=Yr(n,{handle:()=>i.view3dHandle}),requestAnimationFrame(()=>a.remove()),i.pushAvailabilityTo3d(),i.syncSelectionTo3d(),i.view3dNav=Or(i.regions["bottom-left"]??n,w),e&&w.flyToSeat(e)}catch(c){if(l!==i.view3dGen||i.buyerView!=="venue3d"||i.view3dEl!==n)return;i.opts.onError?.(c),i.toast(i.tf("picker.unavailable3d","3D could not start. The seat map is still available."),"warning"),i.exit3d()}}function uo(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 mo(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 To}from"@seatlayer/core";import{t as ki}from"@seatlayer/core";function fo(i){return Array.isArray(i)?i.reduce((e,t)=>t.type==="minimumSelectedPlaces"?Math.max(e,t.minimum):e,0):0}function Ti(i,e,t=!1){let n=i.violations[0];return n==="numberOfPlacesToSelect"?i.remaining>0?ki("picker.selectExactMore",{count:i.remaining}):ki("picker.selectExactCount",{count:i.required}):n==="minimumSelectedPlaces"?ki("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."):ki("picker.orphanHint")}import{t as ze,tCount as go}from"@seatlayer/core";function lt(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 bo(i){let e=i.performanceLabel?`<div class="sl-chip-when">${O(i.performanceLabel)}</div>`:"",t=i.performanceDates?.labels.length?`<div class="sl-chip-dates"><span class="sl-chip-dates-summary">${O(i.performanceDates.summary)}</span><span class="sl-chip-date-list">${i.performanceDates.labels.map(n=>`<span class="sl-chip-date">${O(n)}</span>`).join("")}</span></div>`:"";return e+md(i)+t}function md(i){let{d:e,area:t,label:n,objectType:s,quantity:r=1,identity:o}=i,a=T=>String(T??"\u2014").replace(/[&<>"]/g,b=>({"&":"&","<":"<",">":">",'"':"""})[b]),l=s==="ga"?"ga":e?.objectType??s,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(r)])):l==="ga"?(u=String(t?.displayLabel??p),r>1&&h.push([v("picker.tickets","Tickets"),String(r)])):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(q(e)??e.rowLabel)]),e.seatNumber&&h.push([v("picker.seat","Seat"),String(e.seatNumber)]));let f=!u&&!!d,g=u||d||String(p),x=!!d&&!f&&d!==g,w=h.map(([T,b])=>`<span class="sl-chip-seg" data-fit-seg><span class="w">${a(T)}</span> <b>${a(b)}</b></span>`);x&&w.push(`<span class="sl-chip-seg" data-fit-seg data-fit-type><span class="w">${a(d)}</span></span>`);let y=[g,...h.map(([T,b])=>`${T} ${b}`),x?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(g)}</span>`+(w.length?`<span class="sl-chip-pos" aria-hidden="true">${w.join("<i>\xB7</i>")}</span>`:"")+"</div>"}function yn(i,e){let t=O(i),n=e?O(e):"";return'<div class="sl-chip-rail">'+(e?`<button type="button" class="view" data-view-label="${n}" aria-label="${O(ze("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 vo(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 yo({count:i,total:e,pendingCount:t,ctaPhase:n,hasHold:s,salesClosed:r,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>${ze("picker.peekSecured",{count:i,total:d(e)})}</span>`;if(i)return`<span class="sl-peek-sum">${go("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">${s&&t?v("picker.secureMore","Secure more"):v("picker.continue","Continue")}`+(o?"":`<span class="sl-peek-total">${d(e)}</span>`)+(s&&p?`<span class="sl-peek-time" aria-hidden="true">${p}</span>`:"")+"</button>";if(r)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?ze("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 wn(i,e=Date.now()){return ze("picker.holdReassurance",{time:lt(i-e)})}function wo(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>${ze("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="${O(v("picker.preferredTicketType","Preferred ticket type"))}" data-ba-cat><option value="">${O(v("picker.anyTicketType","Any ticket type"))}</option>`+i.categories.map(e=>`<option value="${O(e.key)}"${i.selectedCategory===e.key?" selected":""}>${O(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="${O(e.id)}"${i.selectedZone===e.id?" selected":""}>${O(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")}`:go("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 xo(i){if(i.salesClosed&&!i.hasPicks){let e=i.whenText?`<span class="when">${O(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>`}function So(i){return{title:ze("picker.securedCount",{count:i.secured}),copy:i.pendingCount?ze("picker.moreSelectedCount",{count:i.pendingCount}):wn(i.expiresAt),change:i.releasing?v("picker.releasingEllipsis","Releasing\u2026"):v("picker.change","Change")}}var ko=6e4;function Co(i){let e=document.createElement("div");e.className="sl-extend",e.setAttribute("role","status"),e.innerHTML='<span class="sl-extend-txt" data-ref="extendTxt"></span><button type="button" class="sl-extend-btn" data-ref="extendBtn"></button>',(i.regions["bottom-center"]??i.els.map).appendChild(e),i.extendEl=e,i.els.extendTxt=e.querySelector('[data-ref="extendTxt"]'),i.els.extendBtn=e.querySelector('[data-ref="extendBtn"]'),i.els.extendBtn.textContent=i.tf("picker.addTime","Add time"),i.els.extendBtn.addEventListener("click",()=>{i.handleExtend()})}function Eo(i){let e=i.hold?.items??[],t=new Set(e.map(s=>s.label));return i.committedSelection().filter(s=>!t.has(s.label)).reduce((s,r)=>s+(r.quantity??1),0)+Me(i.gaQty,i.hold?.items??[])}function Ao(i){return(i.hold?.items??[]).reduce((e,t)=>e+(t.quantity??1),0)}function Po(i){let e=new Set((i.hold?.items??[]).map(n=>n.label)),t=i.committedSelection().filter(n=>!e.has(n.label)).reduce((n,s)=>n+(s.quantity??1),0);return i.heldTicketCount()+t+Me(i.gaQty,i.hold?.items??[])}function Lo(i){let e=new Set((i.hold?.items??[]).map(s=>s.label)),t=i.committedSelection().filter(s=>e.has(s.label)).reduce((s,r)=>s+(r.quantity??1),0),n=Math.max(0,i.maxTickets-i.heldTicketCount()-Me(i.gaQty,i.hold?.items??[]));i.controller.setMaxSelection(t+n)}function Mo(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 s=!i.hold&&i.performanceGroup?.selectionMode==="per_performance"?i.performanceGroup.submissionState?.():null;if(s&&!s.ready){n.disabled=!0,n.textContent=i.tf("picker.completeAllPerformances","Complete all performances ({complete}/{total})").replace("{complete}",String(s.complete)).replace("{total}",String(s.total));return}let r=i.controller.getSelectionValidity(e);if(r&&!r.isValid){n.disabled=!0,n.textContent=Ti(r,(o,a)=>i.tf(o,a),!0);return}n.disabled=e===0,n.textContent=i.hold?t?To("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 Ho(i,e){i.ctaPhase=e,i.syncCta(),i.renderPeek(i.lastTrayCount,i.lastTrayTotal,i.pendingSelectionCount())}async function Ro(i,e,t){i.setCtaPhase("checkout");try{await i.checkoutHandoff(e,t)}finally{i.ctaPhase==="checkout"&&!i.bookedShown&&i.setCtaPhase("idle")}}function Io(i){return`@seatlayer/hold/v1/${encodeURIComponent(i.apiBase)}/${encodeURIComponent(i.opts.event)}`}function Oo(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 _o(i,e){if(!(i.opts.restoreHold===!1||typeof window>"u"))try{window.sessionStorage.setItem(i.holdStorageKey(),e.holdId)}catch{}}function Do(i){if(!(typeof window>"u"))try{window.sessionStorage.removeItem(i.holdStorageKey())}catch{}}async function Bo(i,e,t){try{let n=await i.controller.resumeHold(e);if(!n||i.destroyed)return null;let s={holdId:n.holdId,expiresAt:n.expiresAt,seats:n.seats,items:n.items};return i.hold=s,i.handedOff=!0,i.bookedShown=!1,i.ctaPhase="idle",i.startHoldTimer(s.expiresAt),i.rememberHold(s),i.syncTray(),i.emitHoldChange(),i.opts.onHoldRestored?.(s,s.seats??[],i.buildHandoff(s)),t&&i.toast(i.tf("picker.heldTicketsRestored","Your held tickets have been restored."),"success"),s}catch(n){let s=n?.status;return s===404||s===409?i.forgetHold():i.opts.onError?.(n),null}}async function No(i){let e=i.rememberedHoldId();e&&await i.resumeHoldFromServer(e,!0)}function Vo(i,e){i.stopHoldTimer(),i.holdExpiresAt=e,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"]');i.els.holdNote?.classList.add("on");let s=()=>{let r=Math.max(0,i.holdExpiresAt-Date.now());n&&(n.textContent=lt(r));let o=i.els.peek?.querySelector(".sl-peek-time");o&&(o.textContent=lt(r)),!i.holdCopyPending&&i.els.holdCopy&&i.root?.dataset.layout!=="narrow"&&(i.els.holdCopy.textContent=wn(i.holdExpiresAt)),t.classList.add("on"),t.classList.toggle("is-expiring",r>0&&r<=ko),i.setExtendPrompt(r>0&&r<=ko,r),(r<=0||!i.controller.currentHold())&&i.stopHoldTimer()};i.holdTimer=setInterval(s,500),s()}function Fo(i){i.holdTimer&&clearInterval(i.holdTimer),i.holdTimer=null,i.els.hold?.classList.remove("on","is-expiring"),i.els.holdNote?.classList.remove("on"),i.root&&delete i.root.dataset.peekClock,i.setExtendPrompt(!1,0)}function $o(i,e,t){if(i.extendEl)if(e&&i.controller.currentHold()&&!i.bookedShown){let n=Math.ceil(t/1e3),s=Math.floor(n/60),r=String(n%60).padStart(2,"0");i.els.extendTxt.innerHTML=To("picker.seatsHeldForNeedMoreTime",{time:`${s}:${r}`}),i.extendEl.classList.add("on")}else i.extendEl.classList.remove("on")}async function zo(i){let e=i.els.extendBtn;e.disabled=!0;let t=e.textContent;e.textContent=i.tf("picker.addingEllipsis","Adding\u2026");try{let n=await i.controller.extendHold(i.opts.holdTtlMs);n?(i.hold={holdId:n.holdId,expiresAt:n.expiresAt,seats:n.seats,items:n.items},i.holdExpiresAt=n.expiresAt,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")):i.toast(i.tf("picker.couldNotAddMoreTime","Couldn't add more time \u2014 please head to checkout now."),"warning")}catch(n){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=t}}import{t as Ko,tCount as Wo}from"@seatlayer/core";function jo(i){return i?.previousPrice!=null&&i.previousPrice>i.price?i.previousPrice:null}function Go(i){return gd(i)+(i.moreLabel?`<button type="button" class="sl-price-more" aria-expanded="${!i.collapsed}">${i.esc(i.moreLabel)}</button>`:"")+bd(i.status)}function gd(i){let{esc:e,money:t}=i;return i.categories.map(n=>{let s=i.priceOf(n),r=i.rangeOf(n),o=i.offerOf(n.key),a=jo(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>`:"")+(r!=null?`<span class="sl-price-amt">${r.min===r.max?e(t(r.min)):`${e(t(r.min))}\u2013${e(t(r.max))}`}</span>`:s!=null?`<span class="sl-price-amt">${e(t(s))}</span>`:"")+"</div>"}).join("")}function bd(i){let e=t=>t.replace(/[&<>"']/g,n=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[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 qo(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(s=>{let r=i.rangeOf(s),o=i.priceOf(s),a=r?r.min===r.max?t(r.min):`${t(r.min)}+`:o!=null?t(o):null,l=Object.prototype.hasOwnProperty.call(i.left,s.key)&&i.left[s.key]<=0,c=jo(i.offerOf(s.key)),p=a?`${s.label} \u2014 ${a}${l?` (${i.soldOutWord})`:""}`:s.label;return`<button type="button" class="sl-rc" data-cat="${e(s.key)}" aria-pressed="${i.activeKey===s.key}" aria-label="${e(p)}" title="${e(p)}"${l?" disabled":""}><i class="sl-rc-dot" style="--sl-cat-dot:${e(i.colorOf(s))}"></i>`+(c!=null?`<span class="sl-rc-was">${e(t(c))}</span>`:"")+`<span class="sl-rc-t">${e(a??s.label)}</span></button>`}).join("")}function Uo(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 s=[...t].sort((a,l)=>a.range.min-l.range.min||a.range.max-l.range.max),r=Math.ceil(s.length/4),o=[];for(let a=0;a<s.length;a+=r){let l=s.slice(a,a+r),c=Math.min(...l.map(d=>d.range.min)),p=Math.max(...l.map(d=>d.range.max));o.push({id:`b${a}`,label:c===p?e.money(c):`${e.money(c)}\u2013${e.money(p)}`,keys:l.map(d=>d.key),min:c,max:p})}return o}function Yo(i){if(i.suppressPricing||!i.els.prices||!i.els.pricesSec)return;let e=Uo(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 s of e){let r=document.createElement("option");r.value=s.id,r.textContent=s.label,t.appendChild(r)}i.els.pricesSec.appendChild(t),i.priceSelect=t,t.addEventListener("change",()=>{i.applyPriceBand(e.find(s=>s.id===t.value)?.keys??null)})}function Qo(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 Xo(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:O}}function Zo(i,e,t,n=i.legendDeps()){let s=i.els.railScroll,r=e.length>1;if(i.els.rail?.classList.toggle("has",r),!s)return;s.innerHTML=r?qo({...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,s.scrollLeft=0),s.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,s.addEventListener("scroll",()=>xn(s),{passive:!0})),requestAnimationFrame(()=>xn(s))}function Jo(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.narrateAvailability(n,t),i.syncSoldout(n,t);let s=i.legendDeps(),r=i.suppressPricing,o=r?{...s,priceOf:()=>{},rangeOf:()=>{},offerOf:()=>null}:s;r&&(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=Go({...o,categories:p,left:t,collapsed:c,activeKey:i.focusedCatKey,bandKeys:i.priceBandKeys,leftCount:d=>Wo("picker.leftCount",d),titleFor:(d,u)=>u?i.tf("picker.showAllSeats","Show all seats"):Ko("picker.showLabelSeatsOnMap",{label:d.label}),moreLabel:l>1?c?r?i.tf("picker.showAllCategories","Show all categories"):Ko("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 ea(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)}function ta(i,e,t){let n=i.els.liveText,s=i.lastCatAvail;i.lastCatAvail={...t};let r=i.controller.getActiveFloorId();if(r!==i.lastAvailFloorId&&(i.lastAvailFloorId=r,i.availQuietUntil=performance.now()+2e3),!(!n||!s||performance.now()<i.availQuietUntil))for(let o of e){let a=s[o.key],l=t[o.key]??0;if(a===void 0||l>=a)continue;let c=a-l;n.textContent=Wo("picker.seatsJustTakenInCategory",c,{label:o.label,left:l}),i.els.live?.classList.remove("on"),i.els.live?.offsetWidth,i.els.live?.classList.add("on"),i.liveTimer&&clearTimeout(i.liveTimer),i.liveTimer=setTimeout(()=>i.els.live?.classList.remove("on"),8e3);return}}import{t as yd,tCount as wd}from"@seatlayer/core";function oe(i,e,t){let n=yd(i,t);return n&&n!==i?n:t?e.replace(/\{(\w+)\}/g,(s,r)=>r in t?String(t[r]):s):e}function xd(i){let e=wd("picker.seatCount",i);return e.includes("picker.seatCount")?`${i} ${i===1?"seat":"seats"}`:e}function Sd(i){try{let e=Intl.ListFormat;if(e)return new e(void 0,{style:"long",type:"conjunction"}).format(i)}catch{}return i.join(", ")}function kd(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 Td(i){let e=i.filter(s=>s.objectType==="ga"),t=i.filter(s=>s.objectType!=="ga"),n=[];if(t.length){let s=xd(t.length),r=[...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(r.length===1&&o.length===1&&a.length===t.length){let l=t.length===1?oe("picker.releasedSeatPlace","Section {section}, Row {row}, Seat {seat}",{section:r[0],row:o[0],seat:String(t[0].seatNumber??"")}):kd(a)?oe("picker.releasedSeatRange","Section {section}, Row {row}, Seats {from}\u2013{to}",{section:r[0],row:o[0],from:Math.min(...a),to:Math.max(...a)}):"";n.push(l?oe("picker.releasedPair","{first} \xB7 {second}",{first:s,second:l}):oe("picker.releasedInSection","{seats} in Section {section}",{seats:s,section:r[0]}))}else r.length===1?n.push(oe("picker.releasedInSection","{seats} in Section {section}",{seats:s,section:r[0]})):r.length>1?n.push(oe("picker.releasedInSections","{seats} in Sections {sections}",{seats:s,sections:Sd(r)})):n.push(s)}for(let s of e)n.push(oe("picker.releasedGa","{quantity} \xD7 {area}",{quantity:s.quantity??1,area:s.label}));return n.length?n.reduce((s,r)=>oe("picker.releasedPair","{first} \xB7 {second}",{first:s,second:r})):""}function ia(i){if(!i)return[];let e=new Map((i.seats??[]).map(s=>[s.label,s])),t=i.items??[];return(t.length?t.map(s=>({label:s.label,objectType:s.objectType,quantity:s.quantity})):[...e.keys()].map(s=>({label:s}))).map(s=>{let r=e.get(s.label);return{label:s.label,...s.objectType?{objectType:s.objectType}:{},...s.quantity==null?{}:{quantity:s.quantity},...r?.sectionLabel?{sectionLabel:r.sectionLabel}:{},...r?.rowLabel?{rowLabel:r.rowLabel}:{},...r?.seatNumber?{seatNumber:r.seatNumber}:{}}})}function na(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 sa(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 s=document.createElement("div");s.className="sl-interrupt-title",s.id="sl-hold-expired-title";let r=document.createElement("span");r.className="sl-interrupt-glyph",r.setAttribute("aria-hidden","true"),r.textContent="\u23F1";let o=document.createElement("span");o.textContent=oe("picker.holdExpiredTitle","Your seats were released"),s.append(r,o);let a=document.createElement("div");a.className="sl-interrupt-body",a.id="sl-hold-expired-body",a.textContent=oe("picker.holdExpiredBody","Your hold time ran out and the seats went back on sale."),n.append(s,a);let l=Td(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=oe("picker.holdExpiredPickAgain","Pick your seats again to continue \u2014 they may already be taken."),n.appendChild(c),t.setAttribute("aria-labelledby",s.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=oe("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 Cd}from"@seatlayer/core";var Sn=4,Ed=6;function Ad(i){let e=i.trim();return/^[0-9]{1,4}$/.test(e)?Number(e):null}function ra(i){return[i.held?"h":"s",i.section,i.rowLabel,i.categoryLabel,i.amountText].join(" ")}function Pd(i){if(i.length===1)return i[0];let e=i.map(Ad);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 r=n.slice(0,3).join(", ");return n.length>3?`${r} +${n.length-3}`:r}let t=i.slice(0,3).join(", ");return i.length>3?`${t} +${i.length-3}`:t}function Ld(i){let e=[];for(let t of i){let n=e[e.length-1];!!n&&t.groupable&&n.members[0].groupable&&ra(n.members[0])===ra(t)?n.members.push(t):e.push({members:[t],seatsLabel:""})}for(let t of e)t.seatsLabel=Pd(t.members.map(n=>n.seatLabel));return e}function aa(i,e,t,n){let s=O;return` data-key="${s(i)}"`+(t.length?` data-held="${s(encodeURIComponent(t.join(`
|
|
2801
|
+
`)))}"`:"")+(e.length?` data-seat="${s(e.join(" "))}"`:"")+(n?` data-locate="${s(n)}"`:"")}function la(i){let e=O;return`<div class="sl-chip${i.held?" sl-held":""}${i.fresh?" sl-enter":""}"`+aa(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 oa(i,e,t,n,s){let r=O,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}"`)+aa(i.key,p,d,i.locateId)+">"+(a?`<button type="button" class="sl-trun-toggle" aria-expanded="false" aria-label="${r(Cd("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">${r(i.categoryLabel)}</span><span class="sl-tline-id"><b>${r(i.section||i.seatLabel)}</b>`+(i.rowLabel?`<i>\xB7</i><span>${r(i.rowLabel)}</span>`:"")+(i.section&&l?`<i>\xB7</i><span>${r(l)}</span>`:"")+"</span>"+i.extrasHtml+(s.suppressPricing||!i.amountText?"":(a?`<span class="sl-tline-mult">${o}\xD7</span>`:"")+`<span class="amt">${r(s.money(c))}</span>`)+(i.railHtml?`<button type="button" class="rm" aria-label="${r(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 ca(i,e){if(!i.length)return"";let t=Ld(i),n=[v("picker.section","Section"),v("picker.row","Row"),v("picker.seat","Seat")].join(" \xB7 "),s=t.length>=Ed,r=t.map((a,l)=>{let c=s&&l>=Sn;return oa(a.members[0],a,l,c,e)+(a.members.length>1?a.members.map(p=>oa(p,null,l,c,e)).join(""):"")}).join(""),o=s?`<button type="button" class="sl-tmore" data-tmore aria-expanded="false" data-more="${O(kn("picker.moreCount",{count:t.length-Sn}))}" data-less="${O(v("picker.showLess","Show less"))}"><span>${O(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"${s?' data-collapsed="true"':""}><div class="sl-tlist-head sl-sr">${O(n)}</div>${r}${o}</div>`}function da(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 s=t.closest(".sl-trun-toggle");if(!s)return;e.stopPropagation();let r=s.closest(".sl-tline"),o=r?.dataset.run;if(!r||o===void 0)return;let a=s.getAttribute("aria-expanded")!=="true";s.setAttribute("aria-expanded",a?"true":"false"),r.setAttribute("data-open",a?"true":"false"),r.parentElement?.querySelectorAll(`.sl-tsub[data-run-of="${o}"]`).forEach(l=>l.setAttribute("data-open",a?"true":"false"))}))}import{ACCESSIBILITY_TYPES as Tn,t as pa}from"@seatlayer/core";var Md='<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>',Hd='<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>',Ci=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?Md:Hd,this.menu=document.createElement("div"),this.menu.className="sl-a11ymenu",this.menu.hidden=!0;for(let s of this.stored())this.offeredFree().has(s)&&this.active.add(s);if(this.menu.innerHTML=nr(this.rows()),this.root.append(this.menu,this.button),e.appendChild(this.root),this.button.addEventListener("click",s=>{s.stopPropagation(),this.open(this.menu.hidden)}),this.menu.addEventListener("pointerdown",s=>s.stopPropagation()),this.menu.addEventListener("click",s=>s.stopPropagation()),this.dismiss=()=>this.open(!1),this.escape=s=>{s.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 s=()=>this.deps.focusSeatsForFilter();typeof requestAnimationFrame=="function"?requestAnimationFrame(s):s()}}colorblindRow(){return this.menu.querySelector(".sl-cbbtn")}syncCounts(){let e=new Map(this.offered().map(({key:n,count:s})=>[n,s])),t=!1;for(let n of this.menu.querySelectorAll("[data-a11y-row]")){let s=n.dataset.a11yRow??"";if(!s.startsWith("a11y:"))continue;let r=s.slice(5),o=e.get(r);if(o===void 0)continue;let a=this.countNode(n),l=o==null?"":o>0?pa("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(r,l))),n.disabled=c,c?n.setAttribute("aria-disabled","true"):n.removeAttribute("aria-disabled"),c&&this.active.delete(r)&&(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();Vi(this.menu,{x:t.left+t.width/2,y:t.top}),Qn(this.menu),Wt(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:s})=>({key:n,count:s}));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:s})=>{let r=t.get(n);return r?[{key:`a11y:${n}`,icon:r.icon,label:r.label,...n==="wheelchair"&&e.has("companion")?{note:this.deps.tf("picker.companionSeatsNote","Companion places beside them stay selectable")}:{},...s==null?{}:{count:s>0?pa("picker.accessFreeCount",{count:s}):this.deps.tf("picker.accessNoneLeft","None left"),disabled:s===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 r=!this.deps.isColorblindSafe();this.deps.setColorblindSafe(r),this.paint(e,r);return}if(t==="limited"){let r=!this.deps.isLimitedViewHidden();this.deps.setLimitedViewHidden(r),r&&this.deps.focusSeatsForFilter(),this.paint(e,r);return}let n=t.slice(5),s=!this.active.has(n);s?this.active.add(n):this.active.delete(n),this.paint(e,s),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),s=document.createElement("div");s.className="sl-a11yrow-w",e.replaceWith(s);let r=document.createElement("button");r.type="button",r.className="sl-a11yrow-c sl-a11yjump",r.dataset.a11yJump=n,r.textContent=t.textContent,r.disabled=e.disabled,r.setAttribute("aria-label",this.jumpLabel(n,t.textContent??"")),t.remove(),e.setAttribute("aria-label",this.rowLabel(n,r.textContent??"")),s.append(e,r),r.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&&r.setAttribute("aria-label",this.jumpLabel(n,r.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 Rd}from"@seatlayer/core";var Id=250;function ha(i,e=Id){let t=null,n=()=>{t===null&&(t=setTimeout(()=>{t=null,i()},e))},s=Rd(n),r=typeof window<"u"&&typeof window.addEventListener=="function";return r&&window.addEventListener("focus",n),()=>{t!==null&&(clearTimeout(t),t=null),s(),r&&window.removeEventListener("focus",n)}}import{holdRecoveryShape as Od,tCount as Ei}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=Od(e),n=e.lapsedLabels.length,s=n-e.recoverable.length,r=t==="all"?Ei("picker.holdLapsedStillFree",n):t==="partial"?Ei("picker.holdLapsedSomeTaken",s):Ei("picker.holdLapsedAllTaken",n);this.note={message:r,recoverable:t==="none"?[]:[...e.recoverable]},this.deps.toast(r,t==="none"?"error":"warning",t==="none"?void 0:{label:this.actionLabel(),onClick:()=>this.recover()}),this.deps.syncTray()}noteHtml(){if(!this.note)return"";let e=this.note.recoverable.length?`<button type="button" data-lapse-again>${O(this.actionLabel())}</button>`:"";return`<div class="sl-lapse-note" role="status"><span>${O(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 Ei("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 ua=Symbol("seatlayer.performance-group-picker");function Pi(i,e){return Object.defineProperty(i,ua,{configurable:!1,enumerable:!1,value:Object.freeze({...e})}),i}function ma(i){return i[ua]??null}var fa="@seatlayer/pending-checkout/v1";function _d(i){return typeof i=="string"&&i.length<=160&&/^ord_[A-Za-z0-9_-]+$/.test(i)}function ga(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 s=window.sessionStorage.getItem(fa);if(s){let r=null;try{r=JSON.parse(s)}catch{}if(r&&_d(r.orderId)){let o=Date.now()-Number(r.storedAt);if(o>=0&&o<=144e5){if(r.eventKey&&r.eventKey!==i)return null;n=r.orderId}}}window.sessionStorage.removeItem(fa)}catch{}e.delete("seatlayer_checkout");try{let s=e.toString();history.replaceState(history.state,"",`${location.pathname}${s?`?${s}`:""}${location.hash}`)}catch{}return{outcome:t,orderId:n}}function ba(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 zd="https://api.seatlayer.io",jd=10,Gd=250,ya=6e4,wa=4,qd=10,Ud=40,Kd=220,xa="seatmap.a11y.cb";function Wd(){try{if(typeof window>"u")return null;let i=window.localStorage.getItem(xa);return i==null?null:i==="1"}catch{return null}}function Yd(i){try{window.localStorage.setItem(xa,i?"1":"0")}catch{}}var je=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.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.releasingHold=!1;this.salesClosed=!1;this.soldOut=!1;this.soldoutEl=null;this.cbSafe=!1;this.rungsEl=null;this.projectionEl=null;this.buyerView="map";this.view3dEl=null;this.view3dHandle=null;this.view3dGen=0;this.view3dReturnSeat=null;this.view3dTargetSeatId=null;this.view3dCompareSeatIds=[];this.view3dCompareChip=new vi({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.holdCopyPending=!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.lastCatAvail=null;this.lastAvailFloorId="";this.availQuietUntil=0;this.liveTimer=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=ma(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??zd).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?qt({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??St(e,t),this.pubApi=e.transport?null:n?.api??new Pe(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 it(e.event,this.api.asset?(a,l)=>this.api.asset(a,l):void 0),e.checkout==="hosted"&&!this.pubApi&&console.warn('seatlayer: checkout: "hosted" needs the widget\'s own transport \u2014 a custom `transport` owns its backend, so the picker is staying on onCheckout for this mount.'),this.checkoutMode=e.checkout==="hosted"&&this.pubApi?"hosted":"handoff";let s=e.numberOfPlacesToSelect;if(s!=null&&(!Number.isInteger(s)||s<1))throw new Error("seatmap: `numberOfPlacesToSelect` must be a positive integer");this.exactTickets=s??null;let r=fo(e.selectionValidators);if(this.exactTickets!=null&&r>this.exactTickets)throw new Error("seatmap: `minimumSelectedPlaces.minimum` cannot exceed `numberOfPlacesToSelect`");let o=Math.max(1,Math.floor(e.maxSelection??this.exactTickets??Math.max(jd,r)));if(this.exactTickets!=null&&o<this.exactTickets)throw new Error("seatmap: `maxSelection` cannot be lower than `numberOfPlacesToSelect`");if(e.maxSelection!=null&&o<r)throw new Error("seatmap: `maxSelection` cannot be lower than `minimumSelectedPlaces.minimum`");this.maxTickets=this.exactTickets??o,this.cbSafe=Wd()??!!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 ot(e)}isFramed(){return typeof window<"u"&&window.parent!==window}postToHost(e){if(!this.isFramed())return;let t=ba({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-wa&&t.width>=window.innerWidth-wa}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){nt();let t=document.activeElement instanceof HTMLElement?document.activeElement:null,n=document.createElement("div");n.className="sl-modal-scrim";let s=document.createElement("div");s.className="sl-modal-frame",s.style.setProperty("--sl-bg",We(void 0,e.theme)["--sl-bg"]),s.setAttribute("role","dialog"),s.setAttribute("aria-modal","true"),s.setAttribute("aria-label",v("picker.seatSelection","Seat selection")),s.tabIndex=-1,n.appendChild(s),document.body.appendChild(n);let r=document.body.style.overflow;document.body.style.overflow="hidden";let o=new i({...e,container:s});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 f=[...s.querySelectorAll('[role="dialog"][aria-modal="true"]')].filter(g=>g.isConnected&&!g.closest('[hidden], [aria-hidden="true"], [inert]'));return f[f.length-1]??s},c=(f,g)=>{let x=f;for(;x;){let w=window.getComputedStyle(x);if(x.hidden||x.getAttribute("aria-hidden")==="true"||x.hasAttribute("inert")||w.display==="none"||w.visibility==="hidden"||w.visibility==="collapse")return!0;if(x===g)return!1;x=x.parentElement}return!0},p=f=>[...f.querySelectorAll(a)].filter(g=>g.tabIndex>=0&&!g.matches(":disabled")&&!c(g,f)),d=(f,g)=>{let x=p(f),w=g?x[x.length-1]:x[0];w?w.focus({preventScroll:!0}):(f.hasAttribute("tabindex")||(f.tabIndex=-1),f.focus({preventScroll:!0}))},u=!1,h=()=>{if(u)return;u=!0,document.body.style.overflow=r,o.escHandler&&document.removeEventListener("keydown",o.escHandler),n.remove(),o.modalScrim=null;let f=o.prevFocus;o.prevFocus=null,f?.isConnected&&f.focus({preventScroll:!0});let g=()=>{o.destroy(),e.onClose?.()};o.hold&&!o.handedOff?o.release().finally(g):g()};return o.closeModal=h,n.addEventListener("mousedown",f=>{f.target===n&&h()}),o.escHandler=f=>{if(f.key==="Tab"){if(f.defaultPrevented)return;let g=l(),x=p(g),w=x[0],y=x[x.length-1],T=document.activeElement;!w||!y?(f.preventDefault(),d(g,f.shiftKey)):T===g||!T||!g.contains(T)?(f.preventDefault(),(f.shiftKey?y:w).focus({preventScroll:!0})):f.shiftKey&&T===w?(f.preventDefault(),y.focus({preventScroll:!0})):!f.shiftKey&&T===y&&(f.preventDefault(),w.focus({preventScroll:!0}));return}f.key==="Escape"&&(o.tableDialog?(f.preventDefault(),o.cancelTableDialog()):o.confirmSeat?(f.preventDefault(),o.cancelConfirm()):o.bestAvailableConfirm?(f.preventDefault(),o.bestAvailableConfirm=!1,o.syncTray()):(f.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 Dd({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:Ke(e.theme),onSeatsRevealed:()=>{this.seatsRevealed=!0,e.onSeatsRevealed?.(),this.seatsRevealedReport?.()},onGAClick:t=>{let n=this.controller.getGAAreas().find(s=>s.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(),Ns(t)&&this.scheduleOfferRefresh(!0),this.evictTakenSelections(),this.detectBooked(),this.minimap?.refreshMinimap(),this.pushAvailabilityTo3d()}),onHoldExpired:()=>{let t=this.handedOff,n=this.holdConflicted;this.holdExpiredUnits=ia(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(D("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(D("picker.maxTicketsForOrder",{count:this.maxTickets}),"warning"),this.opts.onSelectionLimit?.(this.maxTickets)},onViewChange:()=>{this.reanchorConfirm(),this.syncRung(),this.syncProjection(),this.minimap?.drawMinimapRect(),this.sectionCardOnView()},onSectionFocus:t=>this.showSectionCard(t),onDeckTap:()=>{this.showSectionCard(null),this.syncFloors(),this.syncRung(),this.minimap?.refreshMinimap()},onFocusSeat:t=>this.announceSeat(t),onSeatHover:t=>this.updateTooltip(t),onHint:t=>{t&&this.toast(t)},onSalesClosed:()=>this.setSalesClosed(!0),onError:t=>this.opts.onError?.(t)})}async render(){if(this.rendered)return this;let e=performance.now(),t={},n=C=>Math.round((performance.now()-C)*100)/100;this.rendered=!0,nt();let s=performance.now(),r=zt(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=fs(this.opts.container),{root:c,els:p,mapHost:d}=zn(l,(C,H)=>this.tf(C,H),this.opts.theme);this.root=c,this.els=p,this.mapHost=d,jt(c,r,C=>{t.loadLocale=n(s),this.destroyed||this.applyActiveLocale(C,o)}),Nr(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 f=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=ms(D("picker.testMode"),va()),C.setAttribute("aria-label",D("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 g=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,gs(this.els.logo,[this.opts.theme?.logoUrl,g?.logoUrl,h.posterUrl],this.opts.theme?.brandName??g?.brandName??h.eventName??"?"),this.els.name.textContent=h.eventName??"";let x=h.startsAt?ei(h.startsAt,h.timezone??null,this.opts.locale):"";this.eventWhenText=x||null,this.els.meta.textContent=[h.venue,x].filter(Boolean).join(" \xB7 "),this.syncProjection(),this.buildBadge(g);let w=!!this.controller.doc&&this.controller.getExpandedSeats().some(C=>C.commercial?.restrictedView||C.commercial?.obstructedView);this.buildAccessibilityMenu(w),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(f);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 T=this.controller.doc,b=oi(this.opts.event),M=this.performanceGroup?.surface??(this.performanceGroup?"performance_group":null),k=M??"event",R={apiBase:this.apiBase,eventKey:this.opts.event,metricScope:k,surface:M==="season"?"season_picker":M==="performance_group"?"performance_group_picker":"seat_picker",ms:n(e),performanceProfile:t,chartDelivery:h.chartDelivery,seatCount:this.allSeats().length,objectCount:T?.objects.length??0,sectionCount:T?.objects.filter(C=>C.type==="section").length??0,floorCount:this.controller.getFloors().length,chartName:T?.name,view:this.buyerView,load:b,transport:this.opts.transport?"custom":"pubapi"};Gr(R,(C,H)=>this.emitAnalytics(C,H));let P=h.performanceProfile;return this.seatsRevealedReport=()=>this.emitAnalytics("chart_seats_revealed",gn({...R,performanceProfile:{...R.performanceProfile,...P}})),this.seatsRevealed&&this.seatsRevealedReport(),this.renderInfo=h,await this.registerAgentTools(),this}registerAgentTools(){return jr(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=ha(()=>{this.destroyed||this.controller.refreshAvailability()}),this.observeLayout(e),this.els.zin.addEventListener("click",()=>this.controller.zoomIn()),this.els.zout.addEventListener("click",()=>this.controller.zoomOut()),this.els.zfit.addEventListener("click",()=>this.controller.zoomToFit()),this.els.zfs.addEventListener("click",()=>this.toggleFullscreen()),this.fsChangeHandler=()=>{document.fullscreenElement||this.setFsFallback(!1),this.syncFullscreenButtons(),requestAnimationFrame(()=>this.controller.refitCurrentView())},document.addEventListener("fullscreenchange",this.fsChangeHandler);let t=this.els.sheetHead;if(t){let s=this.els.sheetToggle,r=c=>{e.dataset.sheet=c?"open":"peek",s?.setAttribute("aria-expanded",String(c)),s?.setAttribute("aria-label",c?this.tf("picker.collapseTicketPanel","Collapse ticket panel"):this.tf("picker.openTicketPanel","Open ticket panel"))};r(e.dataset.sheet==="open"),s?.addEventListener("click",c=>{c.stopPropagation(),r(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()),r(!0),this.els.tray?.querySelector(".sl-ba")?.scrollIntoView({block:"nearest",behavior:this.reducedMotion()?"auto":"smooth"}),this.els.tray?.querySelector(".sl-ba-go")?.focus()):r(!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?(r(!0),a=!0):p>18&&(r(!1),a=!0)}),t.addEventListener("pointerup",c=>{l&&!a&&Math.abs(c.clientY-o)<6&&r(e.dataset.sheet!=="open"),l=!1,t.releasePointerCapture?.(c.pointerId)})}let n=()=>{if(this.root?.dataset.layout!=="narrow")return;let s=this.root.getAttribute("data-prices-open")==="true";if(this.root.setAttribute("data-prices-open",String(!s)),this.els.pricesSec?.setAttribute("aria-expanded",String(!s)),!s&&this.root.dataset.sheet!=="open"){this.root.dataset.sheet="open";let r=this.els.sheetToggle;r?.setAttribute("aria-expanded","true"),r?.setAttribute("aria-label","Collapse ticket panel")}};this.els.pricesSec?.addEventListener("click",s=>{s.target.closest("select,button")||n()}),this.els.pricesSec?.addEventListener("keydown",s=>{s.key!=="Enter"&&s.key!==" "||s.target.closest("select,button")||(s.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",s=>{this.handleMapPointerDown(s)},!0),this.els.map.addEventListener("mousemove",s=>{if(this.tipPinned)return;let r=this.els.map.getBoundingClientRect();this.tipPos={x:s.clientX-r.left,y:s.clientY-r.top},this.tipEl&&this.tipEl.style.display!=="none"&&this.placeTooltip()}),this.els.cta.addEventListener("click",()=>{this.handleCta()}),this.els.holdChange?.addEventListener("click",()=>{this.handleChangeSeats()})}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 s=e.clientHeight,r=n!==this.pickerLayoutSize.width||s!==this.pickerLayoutSize.height;this.pickerLayoutSize={width:n,height:s},this.reportFramedHeight();let o=n<640?"narrow":"wide",a=s<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.syncFullscreenAffordance(),r&&(this.minimap?.refreshMinimap(),this.scheduleFit())};this.ro=new ResizeObserver(t),this.ro.observe(e),t(),requestAnimationFrame(t)}async loadChart(e,t,n){let s=performance.now(),r=await this.controller.render(e);return t.loadChartAndStatuses=n(s),this.destroyed?null:r?(Object.assign(t,r.performanceProfile),r):(Se({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:He(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=ga(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 Ci(t,{event:String(this.opts.event),chart:()=>this.controller.doc?.name??null,needs:()=>this.controller.getAccessNeeds(),hasLimitedView:e,tf:(n,s)=>this.tf(n,s),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(D("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 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(){Co(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>${O(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 s=document.createElement("div");s.className="sl-soldout-title",s.textContent=this.tf("picker.soldOutTitle","Sold out");let r=document.createElement("p");r.className="sl-soldout-copy",r.textContent=this.tf("picker.soldOutCopy","No reserved seats are currently available for this event."),e.append(n,s,r),this.els.map.appendChild(e),this.soldoutEl=e}syncSoldout(e,t){let n=this.controller.getGAAreas().length>0,s=this.isSoldOut(e,t,n);s!==this.soldOut&&(this.soldOut=s,this.soldoutEl?.classList.toggle("on",s))}isSoldOut(e,t,n){return!n&&e.length>0&&e.every(s=>(t[s.key]??0)===0)}setSalesClosed(e){let t=e||!!this.opts.readOnly;this.salesClosed!==t&&(this.salesClosed=t,this.applySalesClosed())}applySalesClosed(){this.salesClosed&&this.tableDialog&&!this.tableDialogHeld&&this.cancelTableDialog();let e=this.els.closedPill;if(e){e.classList.toggle("on",this.salesClosed);let t=this.els.closedPillText??e;t.textContent=this.tf("picker.salesClosedPill","Sales are closed")}this.root?.setAttribute("data-sales-closed",String(this.salesClosed)),this.salesClosed&&this.srEl&&(this.srEl.textContent=this.tf("picker.salesClosedToast","Sales are closed for this event.")),this.syncCta(),this.syncTray()}badgeHidden(e){return!!(this.opts.hideBadge||e?.hideBadge)}buildBadge(e){if(this.badgeHidden(e))return;let t=this.els.foot;if(!t)return;let 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 s=document.createElement("span");s.className="sl-powered-mark",s.setAttribute("aria-hidden","true"),s.innerHTML=Qt;let r=document.createElement("span");r.textContent=this.tf("picker.poweredBy","Powered by SeatLayer"),n.append(s,r),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(s=>s.objectType!=="ga").slice(0,10).map(s=>this.controller.seatByLabel(s.label)).filter(s=>!!s);Cs({regions:this.els,categories:this.controller.doc?.categories,pop:s=>this.controller.flashSeat(s,this.cssVar("--sl-accent")||"#f4b740"),focus:(s,r)=>this.controller.focusSection(s,r),focusSeats:s=>this.controller.focusSeats?.(s,{animate:!t})===!0,reducedMotion:t,screenPoint:s=>this.controller.worldToScreen(s),schedule:(s,r)=>this.scheduleMotion(s,r)},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 Eo(this)}heldTicketCount(){return Ao(this)}totalTicketCount(){return Po(this)}updateSelectionCapacity(){Lo(this)}syncCta(e=this.lastTrayCount,t=this.pendingSelectionCount()){Mo(this,e,t)}setCtaPhase(e){Ho(this,e)}runCheckoutHandoff(e,t){return Ro(this,e,t)}holdStorageKey(){return Io(this)}rememberedHoldId(){return Oo(this)}rememberHold(e){_o(this,e)}forgetHold(){Do(this)}resumeHoldFromServer(e,t){return Bo(this,e,t)}restoreRememberedHold(){return No(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(s=>s.id===n)??t[0]).objects??[]}return e.objects??[]}buildMinimap(){!this.els.map||this.root?.dataset.layout==="narrow"||(this.minimap=Ir({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 wi(this,e)}catPriceRange(e){return xi(this,e)}buildPriceFilter(){Yo(this)}applyPriceBand(e){Qo(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(s=>s.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(s=>{if(s.dataset.view==="venue3d")for(let r of["pointerenter","focus","pointerdown"])s.addEventListener(r,Zt,{once:!0});s.addEventListener("click",()=>{this.setBuyerView(s.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)],s=new Set((e.zones??[]).map(p=>p.id)),o=n.some(p=>p.type==="section"&&typeof p.zone=="string"&&s.has(p.zone))?["zones","sections","seats"]:["sections","seats"],a=document.createElement("div");a.className="sl-rungs on sl-mo-indicator",a.setAttribute("role","group"),a.setAttribute("aria-label",D("picker.zoomLevel"));let l={zones:D("picker.rungLabel.zones"),sections:D("picker.rungLabel.sections"),seats:D("picker.rungLabel.seats")},c={zones:D("picker.rungTip.zones"),sections:D("picker.rungTip.sections"),seats:D("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=sr({floors:this.controller.getFloors(),tf:(s,r)=>this.tf(s,r),onChoose:s=>{s===""?this.controller.setFloorOverview(!0):this.controller.setFloor(s),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.minimap?.setAutoOpen(!1),this.rungsEl&&this.rungsEl.querySelectorAll("button").forEach(n=>{let s=n.dataset.rung===e;n.classList.toggle("on",s),n.setAttribute("aria-pressed",String(s))})}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||!Xt()?!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)?ya/2:ya}syncFloors(){rr(this.floorsEl,this.controller.getActiveFloorId(),this.controller.isFloorOverview())}get sectionCard(){return this.sectionCardCache||(this.sectionCardCache=new pi({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(s=>s.type==="section"&&!this.controller.isSectionClosed(s.id)&&this.controller.getSectionSeatCount(s.id)>0);if(t.length<2)return null;let n=t.findIndex(s=>s.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 gr(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),s=this.controller.getStatus(e.id)??"free",r=s==="free"?this.tf("picker.statusAvailable","available"):s==="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"?D("picker.minToMaxGuests",{min:l.minOccupancy,max:l.maxOccupancy}):D("picker.capacityGuests",{count:l.capacity})}`:c?.objectType==="booth"?`${p} ${d}`:c?.objectType==="table"?`${p} ${d}, ${D("picker.seatNumberLower",{label:c.seatNumber??e.label})}`:D("picker.seatLabel",{label:c?.displayLabel??e.displayLabel??e.label});this.srEl.textContent=`${u}, ${n?.label??e.categoryKey}${a?`, ${a}`:""}, ${r}`}showTableDialog(e,t,n){this.dismissTableDialog(!1),this.tableDialog={...e},this.tableDialogHeld=t,this.tableDialogReturnFocus=n??document.activeElement;let s=this.controller.doc?.categories.find(a=>a.key===e.categoryKey),r=e.bookingMode==="variable",o=document.createElement("div");o.className="sl-table-scrim",o.innerHTML=tr(e,{variable:r,held:t,typeWord:Fe(e),categoryLabel:s?.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(r?'[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 s=t.querySelector("input[data-table-qty]");s&&(s.value=String(e.quantity)),t.querySelectorAll("[data-table-step]").forEach(a=>{let l=Number(a.dataset.tableStep);a.disabled=l<0?e.quantity<=e.minOccupancy:e.quantity>=e.maxOccupancy});let r=this.paidPrice(e.categoryKey,e.tierId??null,e.price,e.label),o=t.querySelector("[data-table-total]");o&&(o.textContent=this.money(r*e.quantity))}async confirmTableDialog(){let e=this.tableDialog,t=this.tableDialogHeld;if(!e)return;let 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 s=await this.controller.replaceTableQuantity(e.label,e.quantity,this.opts.holdTtlMs);if(!s){this.toast(this.tf("picker.guestCountCouldNotBeSecured","That guest count could not be secured. Your current table hold is unchanged."),"warning"),this.renderTableDialogState(),n&&(n.disabled=!1,n.textContent=this.tf("picker.updateTable","Update table"));return}this.hold={holdId:s.holdId,expiresAt:s.expiresAt,seats:s.seats,items:s.items},this.startHoldTimer(s.expiresAt),this.dismissTableDialog(),this.syncTray(),this.emitHoldChange(),this.toast(D("picker.tableUpdatedForGuests",{label:e.label,count:e.quantity}),"success")}catch(s){this.opts.onError?.(s),this.toast(this.tf("picker.guestCountNoLongerAvailable","That guest count is no longer available. Your current hold is unchanged."),"error"),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 bi({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,s)=>this.paidPrice(e,t,n,s),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){Hr(e,t,this.reducedMotion())}addSeatLabel(e){return Rr(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,s=this.controller.getActiveFloorId(),r=e.focalPoint??n?.floors?.find(d=>d.id===s)?.focalPoint??n?.focalPoint??{x:0,y:0},o,a,l=!1;if(e.viewUrl){let d,u=null;try{let f=e.viewMeta?.previewUrl;f&&f!==e.viewUrl?(u=await this.buyerAssetUrls.resolve(f),d=e.viewUrl):d=await this.buyerAssetUrls.resolve(e.viewUrl)}catch(f){t===this.seatViewGen&&this.opts.onError?.(f);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=$d(h),l=Fd(h)}else{let d;try{let{generateSeatPanorama:u}=await Jt();d=u(e,r,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=D("picker.illustrationCaption",{m:d.distanceM})}this.closeSeatView(!1);let c=D("picker.viewFromSeat",{label:e.label}),p=ni({root:this.root,source:o,caption:a,real:l,closeLabel:this.tf("picker.close","Close"),dragHint:Be(),viewFromSeatLabel:c,real360Label:D("picker.real360"),previewLabel:D("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 Bd(e,this.currency,{locale:this.opts.locale,fallback:(s,r)=>`${s} ${r}`,...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=Vs(e,t);if(n==null)return;let s=6*36e5,r=Math.min(Math.max(n-t+1e3,1e3),s);this.offerBoundaryTimer=setTimeout(()=>{this.offerBoundaryTimer=null,!document.hidden&&this.refreshOfferAvailability(!1)},r)}offerReadIsCurrent(){return!!this.offerReadInFlight||Date.now()-this.offerReadSettledAt<Gd}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 s=tn(n),r={...this.hostPricing?.prices??{},...s},o=Object.keys(r).length>0||this.hostPricing?.formatter?{prices:r,...this.hostPricing?.formatter?{formatter:this.hostPricing.formatter}:{}}:void 0;this.setPricing(o),this.syncOffer(),this.opts.onOfferAvailabilityChange?.(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,s=n?null:t?.upcoming??null;if(!t||t.state==="closed"||t.state==="sold-out"||!n&&!s){e.classList.remove("has"),e.replaceChildren();return}let r=n??s,o=document.createElement("div");o.className="sl-offer-main";let a=document.createElement("div");a.className="sl-offer-copy";let l=document.createElement("span");l.className="sl-offer-kicker",l.textContent=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=r.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&&r.remaining!=null&&d.push(D("picker.offerRemainingAvailable",{count:r.remaining})),n&&r.endsAt!=null&&d.push(D("picker.offerUntil",{time:ei(r.endsAt,this.eventTimezone,this.opts.locale)})),s?.startsAt!=null&&d.push(D("picker.offerStarts",{time:ei(s.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",D("picker.howOfferWorks",{name:c.textContent??""})),h.textContent="i";let f=document.createElement("div");f.className="sl-offer-detail",f.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,f),o.append(a,u),e.replaceChildren(o),e.classList.add("has")}paidPrice(e,t,n,s){let r=s?this.channelByObject.get(s):void 0;if(r&&e){let a=this.pricesByChannel.get(r)?.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 Xo(this)}syncPriceRail(e,t,n=this.legendDeps()){Zo(this,e,t,n)}syncPrices(){Jo(this)}focusCategory(e){ea(this,e)}narrateAvailability(e,t){ta(this,e,t)}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(D("picker.seatJustTakenByAnother",{label:t[0].label}),"error"))}syncTray(){if(!this.els.tray)return;this.updateSelectionCapacity();let{seats:e,gaAreas:t,heldItems:n,heldLabels:s,heldCount:r,total:o,count:a}=yi(this),l=[],c=new Set;if(!this.salesClosed){let b=this.performanceGroup?.nightSummary?.()??[];b.length&&l.push(dr(b,{title:this.tf("picker.group.yourSeatsByNight","Your seats by night"),empty:this.tf("picker.group.noSeatsChosenYet","No seats yet")}));let M=this.performanceGroup?.selectionModeSwitch;M&&l.push(`<button type="button" class="sl-pg-switch" data-pg-switch-mode>${O(M.label)}</button>`)}l.push(xo({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(b=>b.type!=="gaArea"),venue3d:this.buyerView==="venue3d",whenText:this.eventWhenText?String(this.eventWhenText):void 0}));let p=!e.length&&!n.length&&!Me(this.gaQty,this.hold?.items??[]);if((p||this.root?.dataset.layout==="narrow")&&(this.baReopen=!1),!this.performanceGroup&&!this.salesClosed&&!this.hold&&(p||this.baReopen||this.bestAvailableBusy||this.bestAvailableConfirm)){let b=(this.controller.doc?.categories??[]).filter(k=>!k.notForSale),M=this.controller.getBestAvailableZones();this.baZone&&!M.some(k=>k.id===this.baZone)&&(this.baZone=""),l.push(wo({confirming:this.bestAvailableConfirm,busy:this.bestAvailableBusy,reopened:this.baReopen,quantity:this.baQty,premium:this.baPremium,offerPremium:this.controller.hasPremiumSeats(),categories:b,zones:M,selectedCategory:this.baCat,selectedZone:this.baZone}))}let d=(b,M,k,R=1,P,C,H)=>bo({categoryLabel:H,d:b?this.controller.seatDetails(b):null,area:k==="ga"?t.find(I=>I.id===P):void 0,label:M,objectType:k,quantity:R,identity:C,performanceLabel:this.performanceGroup?.activePerformanceLabel?.(),performanceDates:this.performanceGroup?.selectedPerformanceDates?.()}),u=O,h=[];for(let b of is(n)){let M=b.objectType==="ga"?`held:ga:${b.objectId}:${b.tierId??""}`:`held:${b.label}`;c.add(M);let k=this.controller.doc?.categories.find(W=>W.key===b.categoryKey),R=b.tierId?k?.tiers?.find(W=>W.id===b.tierId)?.name:void 0,P=b.objectType!=="ga"?this.controller.seatByLabel(b.label):null,C=b.objectType==="table"?this.controller.tableSelection(b.label):null,H=P?this.controller.seatDetails(P.id):null,I=this.seatViewEnabled()&&!!P&&b.objectType!=="table"&&!!this.deliverableViewReference(P),N=u(this.tf("picker.heldForYou","Held for you")),te=(C?.bookingMode==="variable"?`<button type="button" class="sl-table-edit" data-table-edit="${u(encodeURIComponent(b.label))}">${u(D("picker.guestsCountEdit",{count:b.quantity??1}))}</button>`:"")+Mt(P?.wheelchairSpaceType)+sn(P?.commercial),ne=this.paidPrice(b.categoryKey,b.tierId,b.unitPrice,b.label)*(b.quantity??1);h.push({key:M,fresh:!this.lastTrayKeys.has(M),held:!0,seatIds:[],heldLabels:b.labels,removeAria:D("picker.removeHeldTicketLabel",{label:$i(b,t)}),locateId:P?.id??null,section:H?.sectionLabel??"",rowLabel:H&&q(H)||"",seatLabel:H?.seatNumber??b.label,categoryLabel:`${k?.label??b.categoryKey}${R?` \xB7 ${R}`:""}`,categoryColor:this.controller.getRenderer?.()?.categoryDisplayColor?.(b.categoryKey)??k?.color??"",identityHtml:d(P?.id??null,b.label,b.objectType,b.quantity??1,b.objectId,C??void 0,`${k?.label??b.categoryKey}${R?` \xB7 ${R}`:""}`),stateHtml:`<span class="sl-ticket-state held" aria-label="${N}" title="${N}"><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:te,amount:ne,amountText:this.suppressPricing?"":this.money(ne),noteHtml:rn(P?.commercial),railHtml:this.performanceGroup?"":yn(D("picker.removeHeldTicketLabel",{label:$i(b,t)}),I?b.label:null),groupable:!te&&!!H?.sectionLabel&&!this.performanceGroup})}let f=this.seatViewEnabled();for(let b of e.filter(M=>!s.has(M.label))){let M=`seat:${b.id}`;c.add(M);let k=this.controller.doc?.categories.find(W=>W.key===b.categoryKey),R=b.tiers&&b.tiers.length&&!this.suppressPricing?`<select class="tier" data-tier="${u(b.id)}" aria-label="${u(D("picker.ticketTierFor",{label:b.label}))}">`+b.tiers.map(W=>`<option value="${u(W.id)}"${W.id===b.tierId?" selected":""}>${u(W.name)} \xB7 ${u(this.money(this.paidPrice(b.categoryKey,W.id,W.price,b.label)))}</option>`).join("")+"</select>":"",P=b.tiers?.find(W=>W.id===b.tierId)??b.tiers?.[0],C=P?.buyerMessage?.trim()||(P?.restriction==="companion"?this.tf("picker.companionRequiresWheelchair","Requires the adjacent wheelchair place"):""),H=this.controller.seatDetails(b.id),I=u(this.tf("picker.selected","Selected")),N=D("picker.removeSeatLabel",{label:b.label}),te=(b.objectType==="table"&&b.bookingMode==="variable"?`<button type="button" class="sl-table-edit" data-table-edit="${u(encodeURIComponent(b.label))}">${u(D("picker.guestsCountEdit",{count:b.quantity??1}))}</button>`:"")+Mt(b.wheelchairSpaceType)+sn(b.commercial)+R,ne=this.paidPrice(b.categoryKey,b.tierId??null,b.price,b.label)*(b.quantity??1);h.push({key:M,fresh:!this.lastTrayKeys.has(M),held:!1,seatIds:[b.id],heldLabels:[],locateId:b.id,section:H?.sectionLabel??"",rowLabel:H&&q(H)||"",seatLabel:H?.seatNumber??b.label,categoryLabel:k?.label??b.categoryKey,identityHtml:d(b.id,b.label,b.objectType,b.quantity??1,b.objectId,b,k?.label??b.categoryKey),categoryColor:this.controller.getRenderer?.()?.categoryDisplayColor?.(b.categoryKey)??k?.color??"",stateHtml:`<span class="sl-ticket-state" aria-label="${I}" title="${I}"><svg viewBox="0 0 24 24"><path d="M5 12l4 4L19 6"/></svg></span>`,extrasHtml:te,amount:ne,amountText:this.suppressPricing?"":this.money(ne),removeAria:N,noteHtml:rn(b.commercial)+(C?`<small class="sl-tier-note">${u(C)}</small>`:""),railHtml:yn(N,f&&b.objectType!=="table"&&this.deliverableViewReference(this.controller.seatByLabel(b.label)??{})?b.label:null),groupable:!te&&!C&&!!H?.sectionLabel&&!this.performanceGroup})}h.length&&l.push(this.root?.dataset.layout==="narrow"?ca(h,{money:b=>this.money(b),suppressPricing:this.suppressPricing}):h.map(la).join("")),t.length&&l.push(as(this,t,n)),!this.performanceGroup&&!this.salesClosed&&!this.hold&&!p&&!this.baReopen&&!this.bestAvailableBusy&&!this.bestAvailableConfirm&&l.push(`<button type="button" class="sl-ba-reopen" data-ba-reopen><span aria-hidden="true">\u2726</span>${u(this.tf("picker.findTogetherInstead","Find seats together instead"))}</button>`),this.els.tray.innerHTML=l.join("")+(this.salesClosed?"":this.lapse.noteHtml()),this.lastTrayKeys=c,da(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&&xr(this.els.tray,b=>g(b)),this.els.tray.querySelectorAll("[data-ba]").forEach(b=>{b.addEventListener("click",()=>{this.baQty=Math.max(1,Math.min(this.maxTickets,this.baQty+Number(b.dataset.ba))),this.syncTray()})}),this.els.tray.querySelector("[data-ba-cat]")?.addEventListener("change",b=>{this.baCat=b.target.value}),this.els.tray.querySelector("[data-ba-zone]")?.addEventListener("change",b=>{this.baZone=b.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(b=>{b.addEventListener("click",()=>{let M=b.closest(".sl-chip");if(M.dataset.held){this.removeHeldLabels(decodeURIComponent(M.dataset.held).split(`
|
|
2802
|
+
`),M);return}let k=M.dataset.seat.split(" "),R=this.controller.getSelection().find(C=>C.id===k[0])?.label??this.tf("picker.seat","Seat"),P=()=>{this.controller.deselect(k),this.toast(D("picker.labelRemoved",{label:R}),"neutral",{label:this.tf("picker.undo","Undo"),onClick:()=>{let C=this.controller.select(k);this.toast(C.length?D("picker.labelRestored",{label:R}):D("picker.labelNoLongerAvailable",{label:R}),C.length?"success":"warning")}})};if(this.reducedMotion()){P();return}M.classList.remove("sl-enter"),M.classList.add("sl-leave","sl-mo-collapse"),this.scheduleMotion(P,G.collapse)})}),this.els.tray.querySelectorAll("[data-table-edit]").forEach(b=>{b.addEventListener("click",M=>{M.stopPropagation();let k=decodeURIComponent(b.dataset.tableEdit??""),R=this.controller.tableSelection(k);if(!R)return;let P=n.find(C=>C.label===k&&C.objectType==="table");this.showTableDialog({...R,quantity:P?.quantity??R.quantity},!!P,b)})}),this.els.tray.querySelectorAll(".sl-chip .tier").forEach(b=>{b.addEventListener("change",()=>this.controller.setSeatTier(b.dataset.tier,b.value||null))}),this.els.tray.querySelectorAll(".sl-chip .view[data-view-label]").forEach(b=>{b.addEventListener("click",()=>{let M=this.controller.seatByLabel(b.dataset.viewLabel);M&&this.openSeatView(M)})}),this.els.tray.querySelectorAll(".sl-chip[data-locate]").forEach(b=>{let M=()=>this.controller.flashSeat(b.dataset.locate,this.cssVar("--sl-accent")||"#f4b740");b.addEventListener("mouseenter",M),b.addEventListener("focusin",M)}),ls(this,this.els.tray,t),this.controller.setGASelection(Jn(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(b=>{b.disabled=!0});let x=this.pendingSelectionCount(),w=this.lastTrayCount,y=this.lastTrayTotal,T=wr(this.performanceGroup?.groupSelectionSummary?.(),this.performanceGroup?.selectionMode??"same_seat");if(this.els.count.textContent=T||(a?Li("picker.ticketsCount",a):this.tf("picker.noSeatsSelected","No seats selected")),this.els.total.textContent=a&&!this.suppressPricing?this.money(o):"",this.root?.setAttribute("data-has-selection",String(a>0)),this.root?.setAttribute("data-ba-active",String(this.bestAvailableConfirm||this.bestAvailableBusy||this.baReopen)),this.els.foot?.classList.toggle("empty",a===0),this.els.seatSummary&&(this.els.seatSummary.textContent=T||(a?Li("picker.seatsSelectedCount",a):"")),this.syncCta(a,x),this.hold){this.holdCopyPending=x>0;let b=So({secured:r||this.hold.seats?.length||0,pendingCount:x,expiresAt:this.holdExpiresAt,releasing:this.releasingHold});this.els.holdTitle&&(this.els.holdTitle.textContent=b.title),this.els.holdCopy&&(this.els.holdCopy.textContent=b.copy);let M=this.els.holdChange;M&&(M.disabled=this.releasingHold,M.textContent=b.change)}a!==w&&this.animateOnce(this.els.count,"sl-value-pop",380),o!==y&&this.animateOnce(this.els.total,"sl-value-pop",380),w===0&&a>0&&(this.animateOnce(this.els.cta,"sl-ready",520),this.sideCollapsed&&this.root?.dataset.layout!=="narrow"&&this.setPanelCollapsed(!1)),this.renderPeek(a,o,x,a>w),this.lastTrayCount=a,this.lastTrayTotal=o,this.opts.onSelectionChange?.(e),this.emitSelectionValidity(a,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(){Os(this.confirmEl?.querySelector(".sl-confirm-row")),this.els.tray?.querySelectorAll(".sl-chip-pos").forEach(_s),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,s=!1){if(!this.els.peek)return;let r=(this.controller.doc?.categories??[]).map(o=>this.catPrice(o)).filter(o=>o!=null);this.els.peek.innerHTML=yo({count:e,total:t,pendingCount:n,ctaPhase:this.ctaPhase,hasHold:!!this.hold,salesClosed:this.salesClosed,suppressPricing:this.suppressPricing,fromPrice:r.length?Math.min(...r):null,addMore:this.root?.dataset.layout==="narrow"?null:vo({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?lt(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"))),s&&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 s=n[0];n.forEach(o=>this.releasingLabels.add(o)),t?.setAttribute("aria-busy","true");let r=t?.querySelector(".rm");r&&(r.disabled=!0);try{let o=this.handedOff;if(!await this.controller.releaseLabels(n))return this.toast(D("picker.couldNotRemoveLabel",{label:s}),"error"),!1;ns(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(),this.toast(D("picker.labelRemovedFromHold",{label:s}),"success"),!0}finally{n.forEach(o=>this.releasingLabels.delete(o)),t?.removeAttribute("aria-busy"),r?.isConnected&&(r.disabled=!1)}}async handleChangeSeats(){if(!this.hold||this.releasingHold)return;this.releasingHold=!0;let e=this.els.holdChange;e&&(e.disabled=!0,e.textContent=this.tf("picker.releasingEllipsis","Releasing\u2026"));try{await this.release(),this.hold||this.toast(this.tf("picker.heldTicketsReleased","Held tickets released. Choose your new seats."),"success")}finally{this.releasingHold=!1,e?.isConnected&&(e.disabled=!1,e.textContent=this.tf("picker.change","Change"))}}async handleCta(){if(this.salesClosed)return;let e=this.controller.getSelectionValidity(this.totalTicketCount());if(e&&!e.isValid){this.toast(Ti(e,(n,s)=>this.tf(n,s)),"warning");return}if(this.totalTicketCount()>this.maxTickets){this.toast(D("picker.removeTicketsUntilOrFewer",{count:this.maxTickets}),"warning");return}let t=this.committedSelection();if(this.hold&&!t.some(n=>!(this.hold.items??[]).some(s=>s.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,s=Zn(this.gaQty),r=this.committedSelection();if(r.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 s){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??r)}catch(n){this.opts.onError?.(n);let s=n,r=(s.conflicts??[]).map(a=>a.label).filter(Boolean).slice(0,3);s.reason==="event_closed"&&this.setSalesClosed(!0);let o=s.reason==="event_closed"?this.tf("picker.seatSalesClosedForEvent","Seat sales have closed for this event."):s.reason==="companion_pair_required"?this.tf("picker.companionPairRequired","Select the adjacent wheelchair place with each companion ticket."):s.reason==="ticket_option_not_applicable"?this.tf("picker.ticketOptionNotApplicable","That ticket choice is not available for the selected seat."):r.length?r.length===1?D("picker.labelsNoLongerAvailable.one",{labels:r.join(", ")}):D("picker.labelsNoLongerAvailable.other",{labels:r.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){Vo(this,e)}stopHoldTimer(){Fo(this)}setExtendPrompt(e,t){$o(this,e,t)}handleExtend(){return zo(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((s,r)=>s+r.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(s=>{let o=[s.sectionLabel,s.rowLabel&&`${this.tf("picker.row","Row")} ${s.rowLabel}`,s.seatNumber&&`${this.tf("picker.seat","Seat")} ${s.seatNumber}`].filter(Boolean).join(" \xB7 ")||s.displayLabel||s.label,a=s.quantity>1?` <span class="sl-booked-qty">\xD7${s.quantity}</span>`:"";return`<li>${O(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),s=null;try{s=await(this.paymentOptions??=this.pubApi.paymentOptions(this.opts.event))}catch(o){this.opts.onError?.(o)}if(this.destroyed)return;let r=s?.providers?.[0];if(!r){let o=vs(s?.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:r,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 bs())}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}}),s=n[0]?.currency??this.currency,r=n.reduce((o,a)=>o+a.unitPrice*a.quantity,0);return{holdId:e.holdId,expiresAt:e.expiresAt,currency:s,lineItems:n,total:r}}emitHoldChange(){let e=this.hold;this.scheduleOfferRefresh(!0),this.opts.onHoldChange?.(e,e?.seats??[],e?this.buildHandoff(e):null)}toast(e,t="neutral",n){let s=this.els.toast;if(!s)return;s.replaceChildren();let r=document.createElement("span");if(r.textContent=e,s.appendChild(r),s.classList.toggle("has-action",!!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}),s.appendChild(o)}s.dataset.tone=t,s.classList.add("on","sl-mo-rise"),this.liftToastOverConfirmSoon(),this.toastTimer&&clearTimeout(this.toastTimer),this.toastTimer=setTimeout(()=>{s.classList.remove("on","sl-mo-rise"),s.classList.remove("has-action"),s.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 s=this.els.map.clientHeight;if(s<=0)return;let r=n.getBoundingClientRect(),o=r.height||n.offsetHeight||Kd,a=r.height?r.top-this.els.map.getBoundingClientRect().top:s-dn-o,l=Math.round(s-a+qd);if(l+Ud>s){e.style.removeProperty("bottom");return}e.style.bottom=`${l}px`}liftToastOverConfirmSoon(){this.liftToastOverConfirm(),typeof requestAnimationFrame=="function"&&requestAnimationFrame(()=>{this.destroyed||this.liftToastOverConfirm()})}dismissSkeleton(){Br({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?Tr(this.tipPos,e,t):null,s=n??kr(this.tipPos,e.width,e.height,t);this.tipEl.style.left=`${s.left}px`,this.tipEl.style.top=`${s.top}px`,n?this.tipEl.dataset.placement=n.placement:delete this.tipEl.dataset.placement}nightStripFor(e,t){let n=this.performanceGroup,s=ln(e.mark,n?.nights?.()),r=s?.states.filter(o=>o.free).length??0;return pr(s,{locale:this.opts.locale,switchLabel:n?.selectionModeSwitch?.label??null,selectPartialLabel:n?.partialSeatSelection?.label(r)??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.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),s=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 r=this.nightStripFor(e,s);this.tipEl.style.setProperty("--sl-cat",e.categoryColor),this.tipEl.innerHTML=Sr(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:r+(s?`<button type="button" class="sl-tip-close" data-pg-tip-close aria-label="${O(this.tf("picker.group.closeSeatDetails","Close seat details"))}">\xD7</button>`:"")}),this.tipPinned=s,this.tipEl.classList.toggle("sl-tip-pinned",s),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()}),Ar(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[s,r]of Object.entries(e())){let o=this.controller.idForLabel(s);o&&(n[o]=r)}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(s=>t.has(s.id)||t.has(s.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,!1)}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=Vt(this.themeMode),n=We(this.controller.doc?.theme,this.opts.theme,t);for(let[s,r]of Object.entries(n))e.style.setProperty(s,r);t?e.dataset.theme=t:delete e.dataset.theme,this.applyMapChromeTokens()}watchThemeMode(){this.colorSchemeStop?.(),this.colorSchemeStop=null,this.themeMode==="auto"&&(this.colorSchemeStop=Ft(()=>{this.destroyed||this.repaintForThemeMode()}))}repaintForThemeMode(){this.root&&(this.applyThemeTokens(this.root),this.controller.setMapTheme(Ke(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:Vt(e)??null}))}getThemeMode(){return this.themeMode}applyMapChromeTokens(){let e=this.els.map?.parentElement;if(!e||!this.root)return;let t=Vt(this.themeMode),n=We(this.controller.doc?.theme,this.opts.theme,t),s=Ke(this.opts.theme,this.themeMode)?.background??this.controller.doc?.theme?.background??void 0,r=Nn(n,s);for(let o of["--sl-bg","--sl-surface","--sl-text","--sl-muted","--sl-line","--sl-accent-text"])r?e.style.setProperty(o,r[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=Un(e,{languages:this.opts.languages,label:this.tf("picker.preferredTicketType","Language"),onChange:t=>{this.setLocale(t)}})}async setLocale(e){let t=va(),n=this.localeGeneration+=1,s=await Nd(e);return this.opts.messages&&Vd(this.opts.messages),s===t||this.applyActiveLocale(s,n),s}applyActiveLocale(e,t){t===this.localeGeneration&&this.root&&(Kn(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(),Yd(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 Zr(this)}setBuyerView(e,t){Jr(this,e,t)}seatState3dFor(e){return eo(this,e)}pushAvailabilityTo3d(){to(this)}syncSelectionTo3d(){io(this)}seatViewFor3d(e){return no(this,e)}onView3dSeatPick(e){so(this,e)}seatViewCaption(e){return ro(this,e)}showUnavailable3dSeat(e,t,n){oo(this,e,t,n)}dismissUnavailable3dSeat(){ao(this)}saveView3dComparisonSeat(e){lo(this,e)}clearView3dComparison(){co(this)}view3dComparisonSnapshot(e){return po(this,e)}enter3d(e){return ho(this,e)}publish3dTopInset(){uo(this)}exit3d(){mo(this)}openSeatConfidencePassport(e,t=null){bn(this,e,t)}closeSeatConfidencePassport(e=!0){Rt(this,e)}openView3dComparison(){Kr(this)}closeView3dComparison(e=!0){$e(this,e)}getCurrentHold(){return this.hold}async resumeHold(e){return this.resumeHoldFromServer(e,!1)}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(s){this.opts.onError?.(s);let r=s?.reason,o=r==="not_enough_together"?D("picker.couldNotFindSeatsTogether",{count:e}):r==="companion_pair_required"?this.tf("picker.companionPairRequired","Select the adjacent wheelchair place with each companion ticket."):r==="ticket_option_not_applicable"?this.tf("picker.ticketOptionNotApplicable","That ticket choice is not available for the selected seat."):r==="sold_out"?this.tf("picker.ticketTypeSoldOut","That ticket type is sold out. Try another ticket type."):r==="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 s=this.els.tray?.querySelector(".sl-ba-go");s&&(s.disabled=!0,s.classList.add("sl-busy"),s.innerHTML=`<span class="sl-ba-spin" aria-hidden="true"></span>${this.tf("picker.findingEllipsis","Finding\u2026")}`);try{let r=await this.controller.bestAvailable(e,t,{...n,ttlMs:this.opts.holdTtlMs});return r?(this.hold={holdId:r.holdId,expiresAt:r.expiresAt,seats:r.seats,items:r.items},this.handedOff=!1,this.bookedShown=!1,this.gaQty.clear(),this.startHoldTimer(r.expiresAt),this.flashHeldSeats(this.hold),this.syncTray(),this.emitHoldChange(),n.preferPremium&&r.seats.length&&!r.seats.every(o=>o.commercial?.premium)&&this.toast(D("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 s=[...new Set([...(e.items??[]).map(r=>r.label),...(e.seats??[]).map(r=>r.label)])];if(s.length)try{await this.api.release(this.opts.event,s,e.holdId)}catch(r){this.opts.onError?.(r),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 ye({url:this.pubApi.subscribeUrl(e),mintTicket:()=>this.pubApi.subscribeTicket(e),onAccessUnavailable:t=>{this.opts.onAccessUnavailable?.(t),this.showAccessPanel(t)},sink:bt(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),he(this,!1)}showAccessPanel(e){if(this.destroyed||!this.root)return;this.dismissAccessPanel(),this.clearDecisionSurfaces();let t=ir(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=sa({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||na({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),he(this,!1),this.closeSeatView(),this.closeCheckoutPanel(),this.exit3d(),this.buyerAssetUrls.dispose(),this.stopHoldTimer(),this.detachAttention?.(),this.toastTimer&&clearTimeout(this.toastTimer),this.liveTimer&&clearTimeout(this.liveTimer),this.offerRefreshTimer&&clearTimeout(this.offerRefreshTimer),this.offerBoundaryTimer&&clearTimeout(this.offerBoundaryTimer),this.offerRefreshTimer=null,this.offerBoundaryTimer=null,this.offerVisibilityHandler&&(document.removeEventListener("visibilitychange",this.offerVisibilityHandler),this.offerVisibilityHandler=null);for(let e of this.motionTimers)clearTimeout(e);this.motionTimers.clear(),this.ro?.disconnect(),this.ro=null,this.framedFs&&this.setFramedFs(!1),this.escHandler&&document.removeEventListener("keydown",this.escHandler),this.fsChangeHandler&&document.removeEventListener("fullscreenchange",this.fsChangeHandler),this.fsEscHandler&&window.removeEventListener("keydown",this.fsEscHandler),this.controller.destroy(),this.projectionEl=null,this.root?.remove(),this.root=null,this.modalScrim&&(this.modalScrim.remove(),this.modalScrim=null,this.prevFocus?.isConnected&&this.prevFocus.focus({preventScroll:!0}),this.prevFocus=null)}};import{formatMoney as ap,loadLocale as lp,setStringOverrides as cp,t as dp}from"@seatlayer/core";var Sa="seatlayer-performance-group-picker-style";function ka(){if(document.getElementById(Sa))return;let i=document.createElement("style");i.id=Sa,i.textContent=`
|
|
2768
2803
|
.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)}
|
|
2769
2804
|
.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)}
|
|
2770
2805
|
.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}
|
|
@@ -2824,7 +2859,7 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default}
|
|
|
2824
2859
|
@media(min-width:900px){.sl-pg-legend-list{justify-content:flex-start}}
|
|
2825
2860
|
.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}
|
|
2826
2861
|
@media(max-width:640px){.sl-pg-head{padding:13px 14px}.sl-pg-head h2{font-size:18px}.sl-pg-inner{min-height:590px}}
|
|
2827
|
-
`,document.head.appendChild(n)}var Nc="https://api.seatlayer.io",$c=6e4,Fc=2e3,Vc=1e3,zc=36e5,jc=5e3,Gc=5e3,qc=15e3,Uc=12e4,Kc=new Set(["preparing","commit_pending","abort_pending","expire_pending"]),q=class extends Error{constructor(){super("performance_group_destroyed"),this.name="PerformanceGroupDestroyedError"}};function Wc(n){return new Promise(e=>setTimeout(e,n))}function Cn(n){let e=Number(n.headers.get("Retry-After")??"1");return Number.isFinite(e)?Math.max(50,Math.min(jc,e*1e3)):1e3}function at(n,e){return`/pub/performance-groups/${encodeURIComponent(n)}/operations/${encodeURIComponent(e)}`}function Rt(n){return n.replace(/^pghop_/,"").replace(/-/g,"").slice(-8).toUpperCase()}var En=class{constructor(e,t,i){this.api=e;this.sink=t;this.intervalMs=i;this.stopped=!0;this.timer=null;this.prior=new Map}start(){this.stopped&&(this.stopped=!1,this.tick())}stop(){this.stopped=!0,this.timer&&clearTimeout(this.timer),this.timer=null}async tick(){try{let e=await this.api.objects(this.api.groupKey);if(this.stopped)return;let t=new Map(Object.entries(e.seats)),s=[...new Set([...this.prior.keys(),...t.keys()])].filter(r=>this.prior.get(r)!==t.get(r)).map(r=>({label:r,status:t.get(r)??"blocked"}));this.prior=t,s.length&&this.sink.applyStatuses(s),this.sink.onSections?.(e.hidden??[],e.closed??[])}catch(e){if(e instanceof q){this.stop();return}this.stopped||await this.sink.resync()}finally{this.stopped||(this.timer=setTimeout(()=>{this.tick()},this.intervalMs))}}},Pi=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??Nc).replace(/\/+$/,""),this.access=t.access,this.fetcher=t.fetch??globalThis.fetch.bind(globalThis),this.recoveryTimeoutMs=t.recoveryTimeoutMs??$c,this.realtimePollMs=Math.max(500,t.realtimePollMs??Fc),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(s=>this.adoptSession(s));let i=this.readOperationRecord();i&&this.storedIsUndecided(i)&&(this.pendingOperationId=i.operationId)}get pendingOperation(){return this.pendingOperationId}get holdBlocked(){return!!this.adoptFailure||!!this.pendingOperationId&&this.lastRecovery.kind!=="idle"}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(s=>{throw this.chartRequest=null,s});let[t,i]=await Promise.all([this.descriptorCache?Promise.resolve(this.descriptorCache):this.descriptor(),this.chartRequest]);return{doc:i,event:{key:t.key,name:t.name,salesClosed:t.state!=="active",venue:t.venue,startsAt:t.performances[0]?.startsAt??null,timezone:t.timezone,currency:t.currency,mode:t.mode,inventoryModelVersion:2}}}asset(e,t){return/^[a-zA-Z0-9._-]+$/.test(t)?this.blob(`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/assets/${encodeURIComponent(t)}`):Promise.reject(new $(404,"not_found","not_found"))}async objects(e){let t=this.descriptorCache?.inclusionMode==="flexible_dates",i=`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/objects`+(this.selectionMode==="per_performance"||t?"?view=per-performance":"");if(this.reuseObjectsCacheOnce&&this.objectsCache)this.reuseObjectsCacheOnce=!1;else{let o=await this.authorized(i,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 $(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 s=this.objectsCache;if(this.selectionMode==="same_seat"){let o=s.performances.filter(p=>this.includedEventKeys.has(p.eventKey));if(!o.length)throw new $(409,"group_selection_incomplete","group_selection_incomplete");let a=Object.keys(o[0]?.seats??{}),l=Object.fromEntries(a.map(p=>[p,o.every(u=>u.seats[p]==="free")?"free":"blocked"])),c=Object.fromEntries(a.flatMap(p=>{let u=o.filter(h=>h.seats[p]!=="free").map(h=>h.eventKey);return u.length>0&&u.length<o.length?[[p,u]]:[]})),d={seats:l,partial:c,hidden:[...new Set(o.flatMap(p=>p.hidden??[]))],closed:[...new Set(o.flatMap(p=>p.closed??[]))],revision:s.revision,state:s.state,salesClosed:o.some(p=>p.salesClosed)};return this.noteAvailability(s,d.salesClosed,d),d}let r=s.performances.find(o=>o.eventKey===this.activePerformanceKey);if(!r)throw new $(409,"group_performance_unavailable","group_performance_unavailable");return this.noteAvailability(s,s.salesClosed||s.performances.some(o=>o.salesClosed),r),r}setSelectionMode(e,t){if(this.pendingOperationId||this.holdBlocked)throw new $(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 $(404,"group_performance_not_found","group_performance_not_found");this.activePerformanceKey=e}setIncludedEventKeys(e){let t=new Set(this.descriptorCache?.performances.map(i=>i.eventKey)??[]);if(!e.length||new Set(e).size!==e.length||e.some(i=>!t.has(i)))throw new $(422,"invalid_event_keys","invalid_event_keys");this.includedEventKeys=new Set(e),this.reuseObjectsCacheOnce=!!this.objectsCache}includedPerformanceKeys(){return(this.descriptorCache?.performances??[]).map(e=>e.eventKey).filter(e=>this.includedEventKeys.has(e))}setPerformanceSelections(e,t){this.selectionsByEvent.set(e,t.map(i=>({...i})))}allocationsForHold(e){return(this.allocationsByHold.get(e)??[]).map(t=>({eventKey:t.eventKey,items:t.items.map(i=>({...i}))}))}async hold(e,t,i,s){if(this.assertUsable(),s)throw new $(409,"group_hold_replace_unsupported","group_hold_replace_unsupported");let r=t.map(c=>c.label),o={labels:r};if(this.descriptorCache?.inclusionMode==="flexible_dates"&&(o.eventKeys=this.includedPerformanceKeys()),this.selectionMode==="per_performance"){if(!this.activePerformanceKey||!this.descriptorCache||!this.partySize)throw new $(409,"group_selection_incomplete","group_selection_incomplete");this.setPerformanceSelections(this.activePerformanceKey,t);let c=this.descriptorCache.performances.filter(d=>this.includedEventKeys.has(d.eventKey)).map(d=>({eventKey:d.eventKey,selections:this.selectionsByEvent.get(d.eventKey)??[]}));if(c.some(d=>d.selections.length!==this.partySize))throw new $(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,...i?{ttlMs:i}:{}})})}catch(c){if(c instanceof q)throw c;if(c instanceof ae)throw this.failOperation(a),c;return this.recover(a,r,Date.now()+this.recoveryTimeoutMs)}if(l.status===201||l.status===202||l.status===504){let c=await this.responseJson(l);return this.emit(c.operation),l.status===201?this.complete(c.operation):this.recover(a,r,Date.now()+this.recoveryTimeoutMs,Cn(l))}if(l.status===503){let c=await l.clone().json().catch(()=>null);if((c?.code??c?.error)==="performance_group_abort_pending"){let d=c?.operation?.operationId??a;return this.beginOperation(d),c?.operation&&this.emit(c.operation),this.recover(d,r,Date.now()+this.recoveryTimeoutMs,Cn(l))}}try{return await this.throwResponse(l,r)}catch(c){throw this.failOperation(a),c}}async release(e,t,i){this.assertUsable();let s=this.operationForHold(i),r=await this.json(`${at(this.groupKey,s)}/release`,{method:"POST",body:"{}"});return this.operationByHold.delete(i),this.allocationsByHold.delete(i),this.clearOperationRecord(),r}async resume(e,t){this.assertUsable();let i=this.operationForHold(t),s=await this.json(at(this.groupKey,i));return this.complete(s.operation)}async extend(e,t,i=12e4){this.assertUsable();let s=this.operationForHold(t),r=Math.max(Vc,Math.min(zc,Math.round(i))),o=await this.json(`${at(this.groupKey,s)}/extend`,{method:"POST",body:JSON.stringify({ttlMs:r})}),a=this.complete(o.operation);return{holdId:a.holdId,expiresAt:a.expiresAt}}bestAvailable(){return Promise.reject(new $(400,"group_best_available_unsupported","group_best_available_unsupported"))}socketUrl(){return""}createRealtime(e,t){return new En(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:Rt(e.operationId)});let t;try{t=await this.authorized(at(this.groupKey,e.operationId))}catch(r){return r instanceof q||this.recoveryFailed(e.operationId,"request_failed"),null}if(t.status===404)return this.failOperation(e.operationId),null;if(!t.ok)return this.recoveryFailed(e.operationId,"request_failed"),null;let i=await this.responseJson(t);this.emit(i.operation);let s=i.operation.state;return s==="committed"||s==="booked"?(this.emitRecovery({kind:"idle"}),this.complete(i.operation)):s==="aborted"||s==="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>=Uc?qc:Gc;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 s=await this.authorized(at(this.groupKey,e));if(!s.ok)return this.scheduleSettlementPoll();t=(await this.responseJson(s)).operation}catch(s){return s instanceof q?this.stopSettlementWatch():this.scheduleSettlementPoll()}if(this.destroyed||this.settleOperationId!==e)return;let i=t.state!==this.settleState;if(this.settleState=t.state,i&&this.noteOperationState(e,t.state),this.settled(t.state)){this.stopSettlementWatch(),t.state!=="booked"&&this.clearOperationRecord(),this.emit(t);return}i&&this.emit(t),this.scheduleSettlementPoll()}destroy(){if(!this.destroyed){this.destroyed=!0,this.stopSettlementWatch(),this.access.onRenewed(void 0);try{this.aborter.abort()}catch{}}}operationRecordKey(){return`@seatlayer/performance-group-operation/v1/${encodeURIComponent(this.base)}/${encodeURIComponent(this.groupKey)}`}readOperationRecord(){try{let e=window.sessionStorage.getItem(this.operationRecordKey());if(!e)return null;let t=JSON.parse(e);return!t?.operationId||t.groupKey!==this.groupKey?null:t}catch{return null}}storedIsUndecided(e){return e.state==="undecided"||Kc.has(e.state)}writeOperationRecord(e){try{window.sessionStorage.setItem(this.operationRecordKey(),JSON.stringify(e))}catch{}}clearOperationRecord(){try{window.sessionStorage.removeItem(this.operationRecordKey())}catch{}}beginOperation(e){this.pendingOperationId=e;let t=this.readOperationRecord();this.writeOperationRecord({operationId:e,groupKey:this.groupKey,state:"undecided",createdAt:t?.operationId===e?t.createdAt:Date.now()})}noteOperationState(e,t){let i=this.readOperationRecord();!i||i.operationId!==e||this.writeOperationRecord({...i,state:t})}failOperation(e){this.pendingOperationId=null,this.clearOperationRecord(),this.emitRecovery({kind:"idle"}),this.onOperationState?.({operationId:e,state:"aborted",decision:"abort"})}async adoptSession(e){if(this.destroyed)return;let t=`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/session/adopt`;for(let s=0;s<2;s++){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 $(409,"performance_group_session_adopt_failed","performance_group_session_adopt_failed");let i=this.pendingOperationId??"";throw this.emitRecovery({kind:"failed",operationId:i,reference:i?Rt(i):"",reason:"session_adopt_failed",retryable:!1}),this.adoptFailure}async recover(e,t,i,s=100){let r=s,o=Date.now()+Math.min(8e3,Math.max(500,this.recoveryTimeoutMs/2)),a="unknown";for(;Date.now()<=i;){if(this.destroyed)throw new q;if(this.emitRecovery({kind:"pending",operationId:e,phase:a,longRunning:Date.now()>=o,reference:Rt(e)}),await Wc(r),this.destroyed)throw new q;let l;try{l=await this.authorized(at(this.groupKey,e))}catch(p){if(p instanceof q)throw p;if(p instanceof ae)throw this.recoveryFailed(e,"request_failed"),p;r=Math.min(2e3,Math.max(100,r*2));continue}if(l.status===404){r=Math.min(1e3,Math.max(100,r*2));continue}if(!l.ok){this.recoveryFailed(e,"request_failed");try{return await this.throwResponse(l,t)}finally{this.pendingOperationId=null,this.clearOperationRecord()}}let d=(await this.responseJson(l)).operation;if(a=d.state,this.noteOperationState(e,d.state),this.emit(d),d.state==="committed"||d.state==="booked")return this.emitRecovery({kind:"idle"}),this.complete(d);if(d.state==="aborted"||d.state==="expired")throw this.failOperation(e),new $(409,"conflict","conflict",t.map(p=>({label:p,status:"held"})));r=Cn(l)}throw this.recoveryFailed(e,"deadline"),new $(504,"performance_group_outcome_unknown","performance_group_outcome_unknown")}recoveryFailed(e,t){this.emitRecovery({kind:"failed",operationId:e,reference:Rt(e),reason:t,retryable:!0})}emitRecovery(e){if(this.destroyed)return;let t=this.lastRecovery.kind===e.kind&&JSON.stringify(this.lastRecovery)===JSON.stringify(e);this.lastRecovery=e,t||this.onRecoveryState?.(e)}noteAvailability(e,t,i){if(this.destroyed||!this.onAvailability)return;let s=e.state??this.descriptorCache?.state??"active",r=e.revision??null,o=!!r&&!!this.knownRevision&&r!==this.knownRevision;r&&!this.knownRevision&&(this.knownRevision=r);let a=i?.partial??{},l=Object.values(i?.seats??{});this.onAvailability({partial:a,freeCount:l.filter(c=>c==="free").length,blockedCount:Object.keys(i?.seats??{}).filter(c=>i.seats[c]!=="free"&&!(c in a)).length,state:s,salesClosed:!!t||s!=="active",revision:r,revisionChanged:o})}acceptRevision(e){this.knownRevision=e}complete(e){if(!e.hold||e.hold.expiresAt==null)throw new $(409,"group_hold_not_active","group_hold_not_active");this.pendingOperationId=null,this.noteOperationState(e.operationId,e.state),this.operationByHold.set(e.hold.id,e.operationId),this.writeMapping(e.hold.id,e.operationId);let t=e.hold.allocations??[];this.allocationsByHold.set(e.hold.id,t);let i=t.find(s=>s.eventKey===this.activePerformanceKey)?.items;return{holdId:e.hold.id,expiresAt:e.hold.expiresAt,items:i??e.hold.items??[]}}emit(e){this.destroyed||this.onOperationState?.({operationId:e.operationId,state:e.state,decision:e.decision})}operationForHold(e){let t=this.operationIdForHold(e);if(!t)throw new $(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 q;if(this.adoptFailure)throw this.adoptFailure}async authorized(e,t={},i=!1){if(this.destroyed)throw new q;if(this.adoptFailure)throw this.adoptFailure;let s={...t.headers};t.body!==void 0&&(s["Content-Type"]="application/json");let r=await this.access.authorization(i?"unauthorized":"initial");if(this.destroyed)throw new q;if(this.adoptFailure)throw this.adoptFailure;if(!r)throw new Error("performance_group_buyer_access_required");s.Authorization=r;let o=await this.fetcher(`${this.base}${e}`,{method:t.method??"GET",headers:s,body:t.body,credentials:"omit",signal:this.aborter.signal});if(!i&&(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 i=await this.authorized(e,t);return i.ok?this.responseJson(i):this.throwResponse(i)}async blob(e){let t=await this.authorized(e);return t.ok?t.blob():this.throwResponse(t)}async responseJson(e){return e.json()}async throwResponse(e,t=[]){let s=await e.json().catch(()=>null)??{},r=s.code??s.error??`request_failed_${e.status}`;throw e.status===409&&!s.conflicts?.length&&t.length&&(s.conflicts=t.map(o=>({label:o,status:"held"}))),new $(e.status,s.error??r,r,s.conflicts)}};var Jc="https://api.seatlayer.io";function Po(n){let e=typeof n=="string"?document.querySelector(n):n;if(!e)throw new Error("seatlayer: Performance Group picker container was not found");return e}var 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 pe({provider:e.buyerAccessTokenProvider,token:e.buyerAccessToken,onExpired:e.onAccessExpired,onUnavailable:e.onAccessUnavailable}),this.api=new Pi(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,Ao(),await Qc(this.options.locale),this.options.messages&&Xc(this.options.messages),this.destroyed)return this;let t;try{t=await this.api.descriptor()}catch(i){throw ke({apiBase:this.options.apiBase??Jc,event:this.options.performanceGroup,scope:"performance_group",surface:"performance_group_picker",outcome:"failure",stage:"group_descriptor",ms:performance.now()-e,load:He(this.options.performanceGroup),transport:"pubapi"}),i}return this.destroyed?this:(this.descriptorValue=t,this.activePerformanceKey=t.performances[0]?.eventKey??null,this.buildChrome(Po(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 i=document.createElement("div");i.className="sl-pg-root",i.dataset.performanceGroup=t.key,i.dataset.selectionMode=this.mode;let s=document.createElement("div");s.className="sl-pg-progress";let r=document.createElement("section");r.className="sl-pg-head",r.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 d=document.createElement("summary");d.textContent=this.copy(t.inclusionMode==="flexible_dates"?"picker.group.flexibleDatesInView":"picker.group.allDates",{count:t.performanceCount});let p=document.createElement("div");p.innerHTML=dn(this.performanceCards(t),this.copy(t.inclusionMode==="flexible_dates"?"picker.group.flexibleDatesNote":"picker.group.includedNote",{count:t.performanceCount})),c.append(d,p);let u=document.createElement("div");u.className="sl-pg-held-summary",u.hidden=!0,r.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 m=this.mode==="per_performance"?this.performanceTabs(t):null,y=document.createElement("div");y.className="sl-pg-inner",y.id=this.panelId,y.setAttribute("aria-busy","false"),y.dataset.locked="false",this.mode==="per_performance"&&(y.setAttribute("role","tabpanel"),y.tabIndex=-1);let k=document.createElement("div");k.className="sl-pg-status",k.setAttribute("role","status"),k.setAttribute("aria-live","polite"),k.hidden=!0;let w=document.createElement("p"),T=document.createElement("button");T.type="button",T.hidden=!0,T.textContent=this.copy("picker.group.retry"),T.addEventListener("click",()=>{this.retryRecovery()}),k.append(w,T),y.appendChild(k);let b=document.createElement("div");b.className="sl-pg-live",b.setAttribute("role","status"),b.setAttribute("aria-live","polite"),i.append(s,r),m&&i.append(m),i.append(h,y,g,b),e.appendChild(i),this.root=i,this.progressHost=s,this.legendHost=h,this.paneHost=g,this.datesSummaryHost=d,this.datesCardsHost=p,this.innerHost=y,this.heldSummary=u,this.live=b,this.statusHost=k,this.statusCopy=w,this.statusAction=T,this.syncProgress(),this.syncLegend(),this.syncPane()}async mountPicker(e){let t=new ze(Ai({container:this.innerHost,event:e.key,apiBase:this.options.apiBase,transport:this.api,hideEventDetails:!0,maxSelection:this.options.maxSelection,selectedObjects:this.options.selectedObjects,selectableObjects:this.options.selectableObjects,numberOfPlacesToSelect:this.options.numberOfPlacesToSelect,selectionValidators:this.options.selectionValidators,locale:this.options.locale,messages:this.options.messages,languages:this.options.languages,colorblindSafe:this.options.colorblindSafe,initialView:this.options.initialView,enable3D:this.options.enable3D,max3DSeats:this.options.max3DSeats,onBuyerViewChange:this.options.onBuyerViewChange,onAnalytics:(i,s)=>{try{this.options.onAnalytics?.(i,{...s,metricScope:"performance_group",performanceGroupKey:e.key,performanceCount:e.performanceCount,selectionMode:this.mode})}catch{}},hideBadge:this.options.hideBadge,theme:this.options.theme,holdTtlMs:this.options.holdTtlMs,initialHoldId:this.options.initialHoldId,restoreHold:this.options.restoreHold,confirmSelection:this.options.confirmSelection,seatView:this.options.seatView,onSelectionChange:i=>this.selectionChanged(i),onSelectionValidityChange:i=>this.selectionValidityChanged(i),onSelectionValid:this.options.onSelectionValid,onSelectionInvalid:this.options.onSelectionInvalid,onSelectionLimit:this.options.onSelectionLimit,onHoldChange:(i,s)=>this.holdChanged(i,s),onCheckout:(i,s)=>this.checkout(i,s),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"?pr(this.includedPerformances(),e.performanceCount,this.options.locale,this.copy("picker.group.flexibleSelectedNote",{count:this.includedPerformances().length})):null,selectNight:i=>{this.switchPerformance(i)},selectionModeSwitch:this.options.allowSelectionModeSwitch&&this.mode==="same_seat"?{label:this.copy("picker.group.chooseNightByNight"),activate:()=>{this.switchSelectionMode("per_performance")}}:null,partialSeatSelection:e.inclusionMode==="flexible_dates"&&this.mode==="same_seat"?{label:i=>this.copy("picker.group.selectAvailableDates",{count:i}),activate:(i,s)=>{this.selectPartialSeat(i,s)}}:null,confirmDateSelection:e.inclusionMode==="flexible_dates"&&this.mode==="same_seat"?{includedEventKeys:()=>this.api.includedPerformanceKeys(),availableEventKeys:i=>this.partialSeatDates.get(i)??this.nights().map(s=>s.eventKey),label:i=>this.copy("picker.group.selectAvailableDates",{count:i}),apply:(i,s)=>this.applySeatDates(i,s,!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:ui(t,this.options.locale),time:mi(t,this.options.locale)}))}nights(){return(this.descriptorValue?.performances??[]).map(e=>({eventKey:e.eventKey,name:e.name,shortDate:fi(e,this.options.locale)}))}seatMarks(){let e=this.descriptorValue?.performanceCount??0,t=this.availability,i=!!t?.salesClosed||!!t&&t.state!=="active",s=this.mode==="same_seat"&&!i?t?.partial??{}:{},r={};for(let o of this.markedLabels)r[o]=null;if(this.markedLabels.clear(),e>0)for(let[o,a]of Object.entries(s))!a.length||a.length>=e||(r[o]={kind:"partial",fraction:(e-a.length)/e,data:{blockedEventKeys:[...a]}},this.markedLabels.add(o));return r}activePerformanceLabel(){if(this.mode!=="per_performance")return null;let e=this.descriptorValue?.performances.find(s=>s.eventKey===this.activePerformanceKey);if(!e)return null;let t=fi(e,this.options.locale),i=e.name?.trim();return i&&i!==t?`${i} \xB7 ${t}`:t}nightSummary(){return this.mode!=="per_performance"?[]:(this.descriptorValue?.performances??[]).map(e=>({eventKey:e.eventKey,name:fi(e,this.options.locale),labels:(this.selectionsByEvent.get(e.eventKey)??[]).map(t=>t.label),active:e.eventKey===this.activePerformanceKey}))}groupSelectionSummary(){let e=this.includedPerformances();if(!e.length)return null;if(this.mode==="same_seat"){let r=this.activeHandoff?.seatLabels.length??this.picker?.getSelection().length??0;return{seats:r*e.length,performances:e.length,totalPerformances:this.descriptorValue?.performanceCount??e.length,performancesChosen:r?e.length:0,perPerformance:r}}let t=e.map(r=>this.selectionsByEvent.get(r.eventKey)?.length??0),i=t.filter(r=>r>0),s=i.length===t.length&&i.every(r=>r===i[0]);return{seats:t.reduce((r,o)=>r+o,0),performances:e.length,totalPerformances:this.descriptorValue?.performanceCount??e.length,performancesChosen:i.length,perPerformance:s&&i.length?i[0]:null}}syncProgress(){if(!this.progressHost)return;let e=!!this.activeHandoff,t=[{id:"performances",label:this.copy("picker.group.stepPerformances"),state:"done"},{id:"seats",label:this.copy("picker.group.stepSeats"),state:e?"done":"current"},{id:"review",label:this.copy("picker.group.stepReview"),state:this.booked?"done":e?"current":"upcoming"}];this.progressHost.innerHTML=xr(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=ur({available:e.freeCount>0,selected:(this.picker?.getSelection().length??0)>0,partial:Object.keys(e.partial).length>0,unavailable:e.blockedCount>0},{title:this.copy("picker.group.legendTitle"),available:this.copy("picker.group.legendAvailable"),selected:this.copy("picker.group.legendSelected"),partial:this.copy("picker.group.legendNotEveryDate"),unavailable:this.copy("picker.group.legendUnavailable")},this.categoryColor())}categoryColor(){return this.picker?.categoryLegendColor()??"#2563eb"}syncPane(){let e=this.paneHost;if(!e)return;let t=this.includedPerformances();if(this.mode!=="same_seat"||!t.length){e.hidden=!0,e.replaceChildren();return}let i=this.activeHandoff?.seatLabels??this.picker?.getSelection().map(r=>r.label)??[],s=this.heldTotal();e.hidden=!1,e.innerHTML=kr({title:this.copy("picker.group.yourSelection"),rows:t.map(r=>({eventKey:r.eventKey,name:`${ui(r,this.options.locale)} ${mi(r,this.options.locale)}`,labels:i})),empty:this.copy("picker.group.noSeatsChosenYet"),note:s?null:this.copy("picker.group.pricesPerPerformance"),total:s?{label:this.copy("picker.group.total"),amount:s}:null,holdStatus:this.booked?this.copy("picker.group.bookedAll",{count:t.length}):this.activeHandoff?this.copy("picker.group.heldTogether",{count:t.length,time:Sr(this.activeHandoff.expiresAt-Date.now())}):null})}heldTotal(){let e=this.activeHandoff,t=this.descriptorValue;if(!e||!t)return null;let s=this.api.allocationsForHold(e.holdId).flatMap(a=>a.items);if(!s.length)return null;let r=s.reduce((a,l)=>a+l.unitPrice*(l.quantity??1),0),o=s[0]?.currency??t.currency;try{return Yc(r,o,void 0,this.options.locale)}catch{return`${o} ${r.toFixed(2)}`}}includedPerformances(){let e=this.descriptorValue?.performances??[];if(this.descriptorValue?.inclusionMode!=="flexible_dates")return e;let t=new Set(this.api.includedPerformanceKeys());return e.filter(i=>t.has(i.eventKey))}syncIncludedDates(){let e=this.descriptorValue;if(!e||!this.datesSummaryHost||!this.datesCardsHost)return;let t=this.includedPerformances(),i=e.inclusionMode==="flexible_dates";this.datesSummaryHost.textContent=i&&t.length<e.performanceCount?this.copy("picker.group.flexibleDatesSelected",{selected:t.length,total:e.performanceCount}):this.copy(i?"picker.group.flexibleDatesInView":"picker.group.allDates",{count:e.performanceCount}),this.datesCardsHost.innerHTML=dn(this.performanceCards({...e,performances:t}),this.copy(i&&t.length<e.performanceCount?"picker.group.flexibleSelectedNote":i?"picker.group.flexibleDatesNote":"picker.group.includedNote",{count:t.length}))}async selectPartialSeat(e,t){if(!(this.destroyed||this.holdBlocked()||this.activeHandoff||!t.length)){if((this.picker?.getSelection().length??0)>0){this.announce(this.copy("picker.group.clearBeforePartial"));return}this.partialSeatDates.set(e,[...t]),await this.applySeatDates(e,t,!1)}}async applySeatDates(e,t,i){if(this.destroyed||this.holdBlocked()||this.activeHandoff||!t.length)return!1;let s=this.api.includedPerformanceKeys();if(s.length===t.length&&s.every(r=>t.includes(r)))return!0;this.selectingPartialSeat=!0;try{if(this.api.setIncludedEventKeys(t),this.syncIncludedDates(),await this.picker?.refreshAvailability(),!(i?this.picker?.selectObjectsWithoutConfirmation([e])??[]:this.picker?.selectObjects([e])??[]).length)throw new Error("performance_group_partial_seat_unavailable");return this.announce(this.copy("picker.group.selectedAvailableDates",{count:t.length})),this.syncPane(),this.syncLegend(),!0}catch(r){return s.length&&(this.api.setIncludedEventKeys(s),this.syncIncludedDates(),await this.picker?.refreshAvailability().catch(()=>{})),this.options.onError?.(r),!1}finally{this.selectingPartialSeat=!1}}syncHoldTicker(){this.booked||(this.activeHandoff&&!this.holdTicker?this.holdTicker=setInterval(()=>this.syncPane(),1e3):!this.activeHandoff&&this.holdTicker&&(clearInterval(this.holdTicker),this.holdTicker=null))}async switchSelectionMode(e){if(!(this.destroyed||this.switchingMode||e===this.mode)&&!(this.activeHandoff||this.holdBlocked())){this.switchingMode=!0;try{this.api.setSelectionMode(e,this.options.numberOfPlacesToSelect),this.selectionModeValue=e,this.picker?.destroy(),this.picker=null,this.selectionsByEvent.clear(),this.validByEvent.clear(),this.markedLabels.clear(),this.availability=null;let t=this.descriptorValue;if(this.activePerformanceKey=t.performances[0]?.eventKey??null,this.buildChrome(Po(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 q)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 i=this.options.messages?.[e];return i!==void 0?t?i.replace(/\{(\w+)\}/g,(s,r)=>String(t[r]??`{${r}}`)):i:Zc(e,t)}performanceTabs(e){let t=document.createElement("div");t.className="sl-pg-tabsbar";let i=document.createElement("button");i.type="button",i.className="sl-pg-step",i.dataset.step="previous",i.setAttribute("aria-label",this.copy("picker.group.previousPerformance")),i.textContent="\u2039",i.addEventListener("click",()=>{this.stepPerformance(-1)});let s=document.createElement("button");s.type="button",s.className="sl-pg-step",s.dataset.step="next",s.setAttribute("aria-label",this.copy("picker.group.nextPerformance")),s.textContent="\u203A",s.addEventListener("click",()=>{this.stepPerformance(1)});let r=document.createElement("div");return r.className="sl-pg-tabs",r.setAttribute("role","tablist"),r.setAttribute("aria-label",this.copy("picker.group.performances")),e.performances.forEach((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 d=document.createElement("span");d.className="sl-pg-tab-state",d.textContent=this.copy("picker.group.stillNeedsSeat");let p=document.createElement("span");p.className="sl-pg-tab-badge",p.textContent=this.copy("picker.group.chosenOfTotal",{chosen:0,total:this.options.numberOfPlacesToSelect??1}),l.append(c,p,d),l.addEventListener("click",()=>{this.switchPerformance(o.eventKey)}),l.addEventListener("keydown",u=>this.tabKeydown(u)),r.appendChild(l)}),t.append(i,r,s),this.tabsHost=r,this.prevButton=i,this.nextButton=s,t}tabButtons(){return[...this.tabsHost?.querySelectorAll(".sl-pg-tab")??[]]}tabKeydown(e){let t=this.tabButtons(),i=t.findIndex(a=>a===e.target);if(i<0)return;let s=getComputedStyle(this.tabsHost??document.body).direction==="rtl",r=-1;switch(e.key){case"ArrowRight":r=i+(s?-1:1);break;case"ArrowLeft":r=i+(s?1:-1);break;case"ArrowDown":r=i+1;break;case"ArrowUp":r=i-1;break;case"Home":r=0;break;case"End":r=t.length-1;break;default:return}if(r<0||r>=t.length)return;e.preventDefault();let o=t[r];o.focus({preventScroll:!0}),o.disabled||this.switchPerformance(o.dataset.eventKey)}stepPerformance(e){let t=this.tabButtons(),i=t.findIndex(r=>r.dataset.eventKey===this.activePerformanceKey),s=t[i+e];!s||s.disabled||(s.focus({preventScroll:!0}),this.switchPerformance(s.dataset.eventKey))}submissionState(){let e=this.descriptorValue?.performances??[];if(this.mode!=="per_performance"){let s=!this.holdBlocked();return{complete:e.length,total:e.length,ready:s}}let t=this.options.numberOfPlacesToSelect,i=e.filter(s=>this.selectionsByEvent.get(s.eventKey)?.length===t&&this.validByEvent.get(s.eventKey)!==!1).length;return{complete:i,total:e.length,ready:i===e.length&&!this.holdBlocked()}}holdBlocked(){return this.operationPending||this.recovery.kind!=="idle"||!!this.availability?.salesClosed}selectionChanged(e){if(this.mode!=="per_performance"){this.options.onSelectionChange?.(e),this.syncPane(),this.syncLegend(),!e.length&&!this.activeHandoff&&!this.resettingFlexibleSelection&&!this.selectingPartialSeat&&this.descriptorValue?.inclusionMode==="flexible_dates"&&this.api.includedPerformanceKeys().length<this.descriptorValue.performanceCount&&(this.resettingFlexibleSelection=!0,this.api.setIncludedEventKeys(this.descriptorValue.performances.map(i=>i.eventKey)),this.syncIncludedDates(),this.picker?.refreshAvailability().catch(i=>this.options.onError?.(i)).finally(()=>{this.resettingFlexibleSelection=!1}));return}if(this.refreshingComposition||this.switchingPerformance||!this.activePerformanceKey)return;let t=e.map(i=>({...i}));this.selectionsByEvent.set(this.activePerformanceKey,t),this.api.setPerformanceSelections(this.activePerformanceKey,t.map(i=>({label:i.label}))),t.length!==this.options.numberOfPlacesToSelect?this.validByEvent.set(this.activePerformanceKey,!1):this.validByEvent.has(this.activePerformanceKey)||this.validByEvent.set(this.activePerformanceKey,!0),this.updateTabs(),this.options.onSelectionChange?.(e),this.refreshComposition(),this.syncLegend()}selectionValidityChanged(e){if(this.mode==="per_performance"&&!this.switchingPerformance&&this.activePerformanceKey){let t=this.validByEvent.get(this.activePerformanceKey);this.validByEvent.set(this.activePerformanceKey,e.isValid),this.updateTabs(),!this.refreshingComposition&&t!==e.isValid&&this.refreshComposition()}this.options.onSelectionValidityChange?.(e)}refreshComposition(){if(this.refreshingComposition||!this.picker)return;let e=this.submissionState();this.refreshingComposition=!0;try{this.picker.refreshPerformanceGroupComposition();let t=this.submissionState();(e.complete!==t.complete||e.ready!==t.ready)&&this.picker.refreshPerformanceGroupComposition()}finally{this.refreshingComposition=!1}}tabState(e){let t=this.options.numberOfPlacesToSelect??1,i=(this.selectionsByEvent.get(e)??[]).map(r=>r.label),s=this.copy("picker.group.chosenOfTotal",{chosen:i.length,total:t});return i.length===0?{key:"not-started",label:this.copy("picker.group.stillNeedsSeat"),badge:s}:i.length===t&&this.validByEvent.get(e)!==!1?{key:"complete",label:this.copy("picker.group.completeWithSeats",{seats:i.join(", ")}),badge:s}:i.length===t?{key:"needs-attention",label:this.copy("picker.group.needsAttention"),badge:s}:{key:"in-progress",label:this.copy("picker.group.needsMoreSeats",{count:t-i.length}),badge:s}}updateTabs(){let e=this.tabButtons(),t=this.switchingPerformance||this.operationPending||this.recovery.kind!=="idle"||!!this.activeHandoff;e.forEach(s=>{let r=s.dataset.eventKey,o=this.tabState(r),a=r===this.activePerformanceKey;s.dataset.state=o.key,s.disabled=t,s.setAttribute("aria-selected",String(a)),s.tabIndex=a?0:-1;let l=s.querySelector(".sl-pg-tab-state");l&&(l.textContent=o.label);let c=s.querySelector(".sl-pg-tab-badge");c&&(c.textContent=o.badge);let d=s.querySelector(".sl-pg-tab-name")?.textContent??r;s.setAttribute("aria-label",`${d}: ${o.badge} \xB7 ${o.label}`),a&&this.innerHost?.setAttribute("aria-labelledby",s.id)});let i=e.findIndex(s=>s.dataset.eventKey===this.activePerformanceKey);this.prevButton&&(this.prevButton.disabled=t||i<=0),this.nextButton&&(this.nextButton.disabled=t||i<0||i>=e.length-1)}async switchPerformance(e){if(this.mode!=="per_performance"||this.switchingPerformance||this.holdBlocked()||this.activeHandoff||e===this.activePerformanceKey||!this.picker)return;this.activePerformanceKey&&this.selectionChanged(this.picker.getSelection());let t=this.selectionsByEvent.get(e)?.map(i=>i.label)??[];this.switchingPerformance=!0,this.activePerformanceKey=e,this.updateTabs(),this.setInteractionLocked(!0);try{this.picker.clearSelection(),this.api.setActivePerformance(e),await this.picker.refreshAvailability();let i=this.picker.selectObjects(t);this.switchingPerformance=!1,this.selectionChanged(i),i.length!==t.length&&this.validByEvent.set(e,!1),this.options.onSelectionChange?.(i);let s=this.descriptorValue?.performances.find(r=>r.eventKey===e);s&&this.announce(this.copy("picker.group.performanceOpened",{performance:s.name}))}catch(i){this.options.onError?.(i)}finally{this.switchingPerformance=!1,!this.operationPending&&this.recovery.kind==="idle"&&this.setInteractionLocked(!1),this.updateTabs(),this.picker.refreshPerformanceGroupComposition()}}setInteractionLocked(e){let t=this.innerHost;t&&(t.dataset.locked=String(e),t.setAttribute("aria-busy",String(e)),t.setAttribute("aria-disabled",String(e)))}announce(e){this.live&&(this.live.textContent=e)}showStatus(e,t,i={}){this.statusHost&&this.statusCopy&&this.statusAction&&(this.statusCopy.textContent=t,this.statusHost.hidden=!t,this.statusAction.hidden=!i.retry),this.announce(t),this.options.onStatusChange?.({kind:e,message:t,...i.reference?{reference:i.reference}:{}})}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 q)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 q)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 q)return;this.options.onError?.(t)}}handoff(e,t){let i=this.descriptorValue,s=this.api.operationIdForHold(e.holdId);if(!i||!s)throw new Error("seatlayer: Performance Group hold identity is unavailable");let r=this.api.allocationsForHold(e.holdId);return{operationId:s,holdId:e.holdId,expiresAt:e.expiresAt,performanceGroup:i,selectionMode:this.mode,performanceKeys:r.map(o=>o.eventKey),bookingState:this.booked?"booked":"held",seatLabels:t.map(o=>o.label),...this.mode==="per_performance"?{allocations:r.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 i=this.descriptorValue?.performances.find(o=>o.eventKey===t.eventKey),s=document.createElement("p"),r=document.createElement("strong");r.textContent=i?.name??t.eventKey,s.append(r,document.createTextNode(t.items.map(o=>o.label).join(", "))),this.heldSummary.appendChild(s)}this.heldSummary.hidden=e.length===0}}resetPerPerformanceSelection(){this.mode==="per_performance"&&(this.selectionsByEvent.clear(),this.validByEvent.clear(),this.heldSummary?.replaceChildren(),this.heldSummary&&(this.heldSummary.hidden=!0),this.updateTabs(),this.picker?.refreshPerformanceGroupComposition())}holdChanged(e,t){if(!e){this.activeHandoff=null,this.api.stopSettlementWatch(),this.resetPerPerformanceSelection(),this.syncProgress(),this.syncPane(),this.syncHoldTicker(),this.options.onHoldChange?.(null);return}let i=this.handoff(e,t),s=this.activeHandoff?.holdId!==i.holdId;this.activeHandoff=i,this.renderHeldAllocations(this.api.allocationsForHold(e.holdId)),this.updateTabs(),this.api.watchSettlement(e.holdId),this.syncProgress(),this.syncPane(),this.syncHoldTicker(),s&&this.options.onHold?.(i),this.options.onHoldChange?.(i)}checkout(e,t){let i=this.handoff(e,t);this.continued=!0,this.activeHandoff=i,this.options.onCheckout?.(i)}};var Lo="seatlayer-season-picker-style";function Mo(){if(document.getElementById(Lo))return;let n=document.createElement("style");n.id=Lo,n.textContent=`
|
|
2862
|
+
`,document.head.appendChild(i)}var Qd="https://api.seatlayer.io",Xd=6e4,Zd=2e3,Jd=1e3,ep=36e5,tp=5e3,ip=5e3,np=15e3,sp=12e4,rp=new Set(["preparing","commit_pending","abort_pending","expire_pending"]),U=class extends Error{constructor(){super("performance_group_destroyed"),this.name="PerformanceGroupDestroyedError"}};function op(i){return new Promise(e=>setTimeout(e,i))}function Cn(i){let e=Number(i.headers.get("Retry-After")??"1");return Number.isFinite(e)?Math.max(50,Math.min(tp,e*1e3)):1e3}function ct(i,e){return`/pub/performance-groups/${encodeURIComponent(i)}/operations/${encodeURIComponent(e)}`}function It(i){return i.replace(/^pghop_/,"").replace(/-/g,"").slice(-8).toUpperCase()}var En=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)),s=[...new Set([...this.prior.keys(),...t.keys()])].filter(r=>this.prior.get(r)!==t.get(r)).map(r=>({label:r,status:t.get(r)??"blocked"}));this.prior=t,s.length&&this.sink.applyStatuses(s),this.sink.onSections?.(e.hidden??[],e.closed??[])}catch(e){if(e instanceof U){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??Qd).replace(/\/+$/,""),this.access=t.access,this.fetcher=t.fetch??globalThis.fetch.bind(globalThis),this.recoveryTimeoutMs=t.recoveryTimeoutMs??Xd,this.realtimePollMs=Math.max(500,t.realtimePollMs??Zd),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(s=>this.adoptSession(s));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(s=>{throw this.chartRequest=null,s});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 F(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 F(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 s=this.objectsCache;if(this.selectionMode==="same_seat"){let o=s.performances.filter(d=>this.includedEventKeys.has(d.eventKey));if(!o.length)throw new F(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:s.revision,state:s.state,salesClosed:o.some(d=>d.salesClosed)};return this.noteAvailability(s,p.salesClosed,p),p}let r=s.performances.find(o=>o.eventKey===this.activePerformanceKey);if(!r)throw new F(409,"group_performance_unavailable","group_performance_unavailable");return this.noteAvailability(s,s.salesClosed||s.performances.some(o=>o.salesClosed),r),r}setSelectionMode(e,t){if(this.pendingOperationId||this.holdBlocked)throw new F(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 F(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 F(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,s){if(this.assertUsable(),s)throw new F(409,"group_hold_replace_unsupported","group_hold_replace_unsupported");let r=t.map(c=>c.label),o={labels:r};if(this.descriptorCache?.inclusionMode==="flexible_dates"&&(o.eventKeys=this.includedPerformanceKeys()),this.selectionMode==="per_performance"){if(!this.activePerformanceKey||!this.descriptorCache||!this.partySize)throw new F(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 F(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 U)throw c;if(c instanceof le)throw this.failOperation(a),c;return this.recover(a,r,Date.now()+this.recoveryTimeoutMs)}if(l.status===201||l.status===202||l.status===504){let c=await this.responseJson(l);return this.emit(c.operation),l.status===201?this.complete(c.operation):this.recover(a,r,Date.now()+this.recoveryTimeoutMs,Cn(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,r,Date.now()+this.recoveryTimeoutMs,Cn(l))}}try{return await this.throwResponse(l,r)}catch(c){throw this.failOperation(a),c}}async release(e,t,n){this.assertUsable();let s=this.operationForHold(n),r=await this.json(`${ct(this.groupKey,s)}/release`,{method:"POST",body:"{}"});return this.operationByHold.delete(n),this.allocationsByHold.delete(n),this.clearOperationRecord(),r}async resume(e,t){this.assertUsable();let n=this.operationForHold(t),s=await this.json(ct(this.groupKey,n));return this.complete(s.operation)}async extend(e,t,n=12e4){this.assertUsable();let s=this.operationForHold(t),r=Math.max(Jd,Math.min(ep,Math.round(n))),o=await this.json(`${ct(this.groupKey,s)}/extend`,{method:"POST",body:JSON.stringify({ttlMs:r})}),a=this.complete(o.operation);return{holdId:a.holdId,expiresAt:a.expiresAt}}bestAvailable(){return Promise.reject(new F(400,"group_best_available_unsupported","group_best_available_unsupported"))}socketUrl(){return""}createRealtime(e,t){return new En(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:It(e.operationId)});let t;try{t=await this.authorized(ct(this.groupKey,e.operationId))}catch(r){return r instanceof U||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 s=n.operation.state;return s==="committed"||s==="booked"?(this.emitRecovery({kind:"idle"}),this.complete(n.operation)):s==="aborted"||s==="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>=sp?np:ip;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 s=await this.authorized(ct(this.groupKey,e));if(!s.ok)return this.scheduleSettlementPoll();t=(await this.responseJson(s)).operation}catch(s){return s instanceof U?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"||rp.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 s=0;s<2;s++){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 F(409,"performance_group_session_adopt_failed","performance_group_session_adopt_failed");let n=this.pendingOperationId??"";throw this.emitRecovery({kind:"failed",operationId:n,reference:n?It(n):"",reason:"session_adopt_failed",retryable:!1}),this.adoptFailure}async recover(e,t,n,s=100){let r=s,o=Date.now()+Math.min(8e3,Math.max(500,this.recoveryTimeoutMs/2)),a="unknown";for(;Date.now()<=n;){if(this.destroyed)throw new U;if(this.emitRecovery({kind:"pending",operationId:e,phase:a,longRunning:Date.now()>=o,reference:It(e)}),await op(r),this.destroyed)throw new U;let l;try{l=await this.authorized(ct(this.groupKey,e))}catch(d){if(d instanceof U)throw d;if(d instanceof le)throw this.recoveryFailed(e,"request_failed"),d;r=Math.min(2e3,Math.max(100,r*2));continue}if(l.status===404){r=Math.min(1e3,Math.max(100,r*2));continue}if(!l.ok){this.recoveryFailed(e,"request_failed");try{return await this.throwResponse(l,t)}finally{this.pendingOperationId=null,this.clearOperationRecord()}}let 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 F(409,"conflict","conflict",t.map(d=>({label:d,status:"held"})));r=Cn(l)}throw this.recoveryFailed(e,"deadline"),new F(504,"performance_group_outcome_unknown","performance_group_outcome_unknown")}recoveryFailed(e,t){this.emitRecovery({kind:"failed",operationId:e,reference:It(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 s=e.state??this.descriptorCache?.state??"active",r=e.revision??null,o=!!r&&!!this.knownRevision&&r!==this.knownRevision;r&&!this.knownRevision&&(this.knownRevision=r);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:s,salesClosed:!!t||s!=="active",revision:r,revisionChanged:o})}acceptRevision(e){this.knownRevision=e}complete(e){if(!e.hold||e.hold.expiresAt==null)throw new F(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(s=>s.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 F(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 U;if(this.adoptFailure)throw this.adoptFailure}async authorized(e,t={},n=!1){if(this.destroyed)throw new U;if(this.adoptFailure)throw this.adoptFailure;let s={...t.headers};t.body!==void 0&&(s["Content-Type"]="application/json");let r=await this.access.authorization(n?"unauthorized":"initial");if(this.destroyed)throw new U;if(this.adoptFailure)throw this.adoptFailure;if(!r)throw new Error("performance_group_buyer_access_required");s.Authorization=r;let o=await this.fetcher(`${this.base}${e}`,{method:t.method??"GET",headers:s,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 s=await e.json().catch(()=>null)??{},r=s.code??s.error??`request_failed_${e.status}`;throw e.status===409&&!s.conflicts?.length&&t.length&&(s.conflicts=t.map(o=>({label:o,status:"held"}))),new F(e.status,s.error??r,r,s.conflicts)}};var pp="https://api.seatlayer.io";function Ta(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 pe({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,ka(),await lp(this.options.locale),this.options.messages&&cp(this.options.messages),this.destroyed)return this;let t;try{t=await this.api.descriptor()}catch(n){throw Se({apiBase:this.options.apiBase??pp,event:this.options.performanceGroup,scope:"performance_group",surface:"performance_group_picker",outcome:"failure",stage:"group_descriptor",ms:performance.now()-e,load:He(this.options.performanceGroup),transport:"pubapi"}),n}return this.destroyed?this:(this.descriptorValue=t,this.activePerformanceKey=t.performances[0]?.eventKey??null,this.buildChrome(Ta(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 s=document.createElement("div");s.className="sl-pg-progress";let r=document.createElement("section");r.className="sl-pg-head",r.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,r.append(o,a,l,c,u);let h=document.createElement("div");h.className="sl-pg-legend";let f=document.createElement("div");f.className="sl-pg-pane",f.setAttribute("role","group"),f.setAttribute("aria-label",this.copy("picker.group.yourSelection")),f.hidden=!0;let g=this.mode==="per_performance"?this.performanceTabs(t):null,x=document.createElement("div");x.className="sl-pg-inner",x.id=this.panelId,x.setAttribute("aria-busy","false"),x.dataset.locked="false",this.mode==="per_performance"&&(x.setAttribute("role","tabpanel"),x.tabIndex=-1);let w=document.createElement("div");w.className="sl-pg-status",w.setAttribute("role","status"),w.setAttribute("aria-live","polite"),w.hidden=!0;let y=document.createElement("p"),T=document.createElement("button");T.type="button",T.hidden=!0,T.textContent=this.copy("picker.group.retry"),T.addEventListener("click",()=>{this.retryRecovery()}),w.append(y,T),x.appendChild(w);let b=document.createElement("div");b.className="sl-pg-live",b.setAttribute("role","status"),b.setAttribute("aria-live","polite"),n.append(s,r),g&&n.append(g),n.append(h,x,f,b),e.appendChild(n),this.root=n,this.progressHost=s,this.legendHost=h,this.paneHost=f,this.datesSummaryHost=p,this.datesCardsHost=d,this.innerHost=x,this.heldSummary=u,this.live=b,this.statusHost=w,this.statusCopy=y,this.statusAction=T,this.syncProgress(),this.syncLegend(),this.syncPane()}async mountPicker(e){let t=new je(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,s)=>{try{this.options.onAnalytics?.(n,{...s,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,s)=>this.holdChanged(n,s),onCheckout:(n,s)=>this.checkout(n,s),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"?ar(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,s)=>{this.selectPartialSeat(n,s)}}:null,confirmDateSelection:e.inclusionMode==="flexible_dates"&&this.mode==="same_seat"?{includedEventKeys:()=>this.api.includedPerformanceKeys(),availableEventKeys:n=>this.partialSeatDates.get(n)??this.nights().map(s=>s.eventKey),label:n=>this.copy("picker.group.selectAvailableDates",{count:n}),apply:(n,s)=>this.applySeatDates(n,s,!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:ui(t,this.options.locale),time:mi(t,this.options.locale)}))}nights(){return(this.descriptorValue?.performances??[]).map(e=>({eventKey:e.eventKey,name:e.name,shortDate:fi(e,this.options.locale)}))}seatMarks(){let e=this.descriptorValue?.performanceCount??0,t=this.availability,n=!!t?.salesClosed||!!t&&t.state!=="active",s=this.mode==="same_seat"&&!n?t?.partial??{}:{},r={};for(let o of this.markedLabels)r[o]=null;if(this.markedLabels.clear(),e>0)for(let[o,a]of Object.entries(s))!a.length||a.length>=e||(r[o]={kind:"partial",fraction:(e-a.length)/e,data:{blockedEventKeys:[...a]}},this.markedLabels.add(o));return r}activePerformanceLabel(){if(this.mode!=="per_performance")return null;let e=this.descriptorValue?.performances.find(s=>s.eventKey===this.activePerformanceKey);if(!e)return null;let t=fi(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:fi(e,this.options.locale),labels:(this.selectionsByEvent.get(e.eventKey)??[]).map(t=>t.label),active:e.eventKey===this.activePerformanceKey}))}groupSelectionSummary(){let e=this.includedPerformances();if(!e.length)return null;if(this.mode==="same_seat"){let r=this.activeHandoff?.seatLabels.length??this.picker?.getSelection().length??0;return{seats:r*e.length,performances:e.length,totalPerformances:this.descriptorValue?.performanceCount??e.length,performancesChosen:r?e.length:0,perPerformance:r}}let t=e.map(r=>this.selectionsByEvent.get(r.eventKey)?.length??0),n=t.filter(r=>r>0),s=n.length===t.length&&n.every(r=>r===n[0]);return{seats:t.reduce((r,o)=>r+o,0),performances:e.length,totalPerformances:this.descriptorValue?.performanceCount??e.length,performancesChosen:n.length,perPerformance:s&&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=br(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=cr({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(r=>r.label)??[],s=this.heldTotal();e.hidden=!1,e.innerHTML=vr({title:this.copy("picker.group.yourSelection"),rows:t.map(r=>({eventKey:r.eventKey,name:`${ui(r,this.options.locale)} ${mi(r,this.options.locale)}`,labels:n})),empty:this.copy("picker.group.noSeatsChosenYet"),note:s?null:this.copy("picker.group.pricesPerPerformance"),total:s?{label:this.copy("picker.group.total"),amount:s}:null,holdStatus:this.booked?this.copy("picker.group.bookedAll",{count:t.length}):this.activeHandoff?this.copy("picker.group.heldTogether",{count:t.length,time:yr(this.activeHandoff.expiresAt-Date.now())}):null})}heldTotal(){let e=this.activeHandoff,t=this.descriptorValue;if(!e||!t)return null;let s=this.api.allocationsForHold(e.holdId).flatMap(a=>a.items);if(!s.length)return null;let r=s.reduce((a,l)=>a+l.unitPrice*(l.quantity??1),0),o=s[0]?.currency??t.currency;try{return ap(r,o,void 0,this.options.locale)}catch{return`${o} ${r.toFixed(2)}`}}includedPerformances(){let e=this.descriptorValue?.performances??[];if(this.descriptorValue?.inclusionMode!=="flexible_dates")return e;let t=new Set(this.api.includedPerformanceKeys());return e.filter(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 s=this.api.includedPerformanceKeys();if(s.length===t.length&&s.every(r=>t.includes(r)))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(r){return s.length&&(this.api.setIncludedEventKeys(s),this.syncIncludedDates(),await this.picker?.refreshAvailability().catch(()=>{})),this.options.onError?.(r),!1}finally{this.selectingPartialSeat=!1}}syncHoldTicker(){this.booked||(this.activeHandoff&&!this.holdTicker?this.holdTicker=setInterval(()=>this.syncPane(),1e3):!this.activeHandoff&&this.holdTicker&&(clearInterval(this.holdTicker),this.holdTicker=null))}async switchSelectionMode(e){if(!(this.destroyed||this.switchingMode||e===this.mode)&&!(this.activeHandoff||this.holdBlocked())){this.switchingMode=!0;try{this.api.setSelectionMode(e,this.options.numberOfPlacesToSelect),this.selectionModeValue=e,this.picker?.destroy(),this.picker=null,this.selectionsByEvent.clear(),this.validByEvent.clear(),this.markedLabels.clear(),this.availability=null;let t=this.descriptorValue;if(this.activePerformanceKey=t.performances[0]?.eventKey??null,this.buildChrome(Ta(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 U)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,(s,r)=>String(t[r]??`{${r}}`)):n:dp(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 s=document.createElement("button");s.type="button",s.className="sl-pg-step",s.dataset.step="next",s.setAttribute("aria-label",this.copy("picker.group.nextPerformance")),s.textContent="\u203A",s.addEventListener("click",()=>{this.stepPerformance(1)});let r=document.createElement("div");return r.className="sl-pg-tabs",r.setAttribute("role","tablist"),r.setAttribute("aria-label",this.copy("picker.group.performances")),e.performances.forEach((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)),r.appendChild(l)}),t.append(n,r,s),this.tabsHost=r,this.prevButton=n,this.nextButton=s,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 s=getComputedStyle(this.tabsHost??document.body).direction==="rtl",r=-1;switch(e.key){case"ArrowRight":r=n+(s?-1:1);break;case"ArrowLeft":r=n+(s?1:-1);break;case"ArrowDown":r=n+1;break;case"ArrowUp":r=n-1;break;case"Home":r=0;break;case"End":r=t.length-1;break;default:return}if(r<0||r>=t.length)return;e.preventDefault();let o=t[r];o.focus({preventScroll:!0}),o.disabled||this.switchPerformance(o.dataset.eventKey)}stepPerformance(e){let t=this.tabButtons(),n=t.findIndex(r=>r.dataset.eventKey===this.activePerformanceKey),s=t[n+e];!s||s.disabled||(s.focus({preventScroll:!0}),this.switchPerformance(s.dataset.eventKey))}submissionState(){let e=this.descriptorValue?.performances??[];if(this.mode!=="per_performance"){let s=!this.holdBlocked();return{complete:e.length,total:e.length,ready:s}}let t=this.options.numberOfPlacesToSelect,n=e.filter(s=>this.selectionsByEvent.get(s.eventKey)?.length===t&&this.validByEvent.get(s.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(r=>r.label),s=this.copy("picker.group.chosenOfTotal",{chosen:n.length,total:t});return n.length===0?{key:"not-started",label:this.copy("picker.group.stillNeedsSeat"),badge:s}:n.length===t&&this.validByEvent.get(e)!==!1?{key:"complete",label:this.copy("picker.group.completeWithSeats",{seats:n.join(", ")}),badge:s}:n.length===t?{key:"needs-attention",label:this.copy("picker.group.needsAttention"),badge:s}:{key:"in-progress",label:this.copy("picker.group.needsMoreSeats",{count:t-n.length}),badge:s}}updateTabs(){let e=this.tabButtons(),t=this.switchingPerformance||this.operationPending||this.recovery.kind!=="idle"||!!this.activeHandoff;e.forEach(s=>{let r=s.dataset.eventKey,o=this.tabState(r),a=r===this.activePerformanceKey;s.dataset.state=o.key,s.disabled=t,s.setAttribute("aria-selected",String(a)),s.tabIndex=a?0:-1;let l=s.querySelector(".sl-pg-tab-state");l&&(l.textContent=o.label);let c=s.querySelector(".sl-pg-tab-badge");c&&(c.textContent=o.badge);let p=s.querySelector(".sl-pg-tab-name")?.textContent??r;s.setAttribute("aria-label",`${p}: ${o.badge} \xB7 ${o.label}`),a&&this.innerHost?.setAttribute("aria-labelledby",s.id)});let n=e.findIndex(s=>s.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 s=this.descriptorValue?.performances.find(r=>r.eventKey===e);s&&this.announce(this.copy("picker.group.performanceOpened",{performance:s.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 U)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 U)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 U)return;this.options.onError?.(t)}}handoff(e,t){let n=this.descriptorValue,s=this.api.operationIdForHold(e.holdId);if(!n||!s)throw new Error("seatlayer: Performance Group hold identity is unavailable");let r=this.api.allocationsForHold(e.holdId);return{operationId:s,holdId:e.holdId,expiresAt:e.expiresAt,performanceGroup:n,selectionMode:this.mode,performanceKeys:r.map(o=>o.eventKey),bookingState:this.booked?"booked":"held",seatLabels:t.map(o=>o.label),...this.mode==="per_performance"?{allocations:r.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),s=document.createElement("p"),r=document.createElement("strong");r.textContent=n?.name??t.eventKey,s.append(r,document.createTextNode(t.items.map(o=>o.label).join(", "))),this.heldSummary.appendChild(s)}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),s=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(),s&&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 Ca="seatlayer-season-picker-style";function Ea(){if(document.getElementById(Ca))return;let i=document.createElement("style");i.id=Ca,i.textContent=`
|
|
2828
2863
|
.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)}
|
|
2829
2864
|
.sl-season-root *{box-sizing:border-box}.sl-season-root button,.sl-season-root summary{font:inherit}
|
|
2830
2865
|
.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}
|
|
@@ -2838,4 +2873,4 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default}
|
|
|
2838
2873
|
.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}
|
|
2839
2874
|
@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}}
|
|
2840
2875
|
@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}}
|
|
2841
|
-
`,document.head.appendChild(n)}var ed="https://api.seatlayer.io",td=6e4,id=5e3,z=class extends Error{constructor(t,i){super(`season_request_failed:${t}`);this.code=t;this.status=i;this.name="SeasonApiError"}},Li=class extends Error{constructor(t){super(`season_operation_timeout:${t}`);this.operationId=t;this.name="SeasonRecoveryTimeoutError"}};function nd(n,e){let t=Number(n.headers.get("Retry-After")),i=Number.isFinite(t)&&t>=0?t:e.retryAfterSeconds;return Math.max(0,Math.min(id,i*1e3))}function sd(n,e){return e?.aborted?Promise.reject(e.reason??new DOMException("Aborted","AbortError")):new Promise((t,i)=>{let s=setTimeout(t,n);e?.addEventListener("abort",()=>{clearTimeout(s),i(e.reason??new DOMException("Aborted","AbortError"))},{once:!0})})}function rd(n){if(!n||typeof n!="object")return"unknown";let e=n;return typeof e.code=="string"?e.code:typeof e.error=="string"?e.error:"unknown"}var od=/^shc_[a-f0-9]{40}$/,ad=/^shh_[a-f0-9]{40}$/,ld=new Set(["preparing","commit_pending","committed","expire_pending","booking_pending","abort_pending","aborted","partial_terminal","expired","booked"]),cd=new Set(["pending","prepared","refused","applied","expired","booked","aborted"]);function Pn(n){return Array.isArray(n)?n.some(Pn):!n||typeof n!="object"?!1:Object.entries(n).some(([e,t])=>e==="childHoldId"||e==="child_hold_id"||e==="holdId"&&typeof t=="string"&&od.test(t)||Pn(t))}function It(n,e,t="invalid_operation_response"){if(!n||typeof n!="object"||Array.isArray(n))throw new z(t,502);if(Pn(n))throw new z("unsafe_operation_response",502);let i=n,s=i.allocations,r=new Set,o=Array.isArray(s)&&s.length>0&&s.every(p=>{if(!p||typeof p!="object")return!1;let u=p.eventId,h=p.state;return typeof u!="string"||!u||typeof h!="string"||!cd.has(h)||r.has(u)?!1:(r.add(u),!0)}),a=i.bookingRef===null||typeof i.bookingRef=="string"&&i.bookingRef.length>0,l=i.state!=="booked"||typeof i.bookingRef=="string"&&o&&s.every(p=>p.state==="booked"),c=i.state!=="booking_pending"||typeof i.bookingRef=="string"&&o&&s.some(p=>p.state!=="booked"),d=i.state!=="committed"||i.bookingRef===null;if(i.operationId!==e.operationId||i.seasonId!==e.seasonId||i.kind!=="HOLD"||typeof i.holdId!="string"||!ad.test(i.holdId)||i.policy!=="fixed_inclusion_same_seat"||typeof i.state!="string"||!ld.has(i.state)||typeof i.expiresAt!="number"||!Number.isFinite(i.expiresAt)||i.expiresAt<0||!a||typeof i.location!="string"||!i.location||typeof i.retryAfterSeconds!="number"||!Number.isFinite(i.retryAfterSeconds)||i.retryAfterSeconds<0||!o||!l||!c||!d||i.pricingAuthority!==void 0&&i.pricingAuthority!=="host"||i.authoritativeAmountIncluded!==void 0&&i.authoritativeAmountIncluded!==!1)throw new z(t,502);return{operationId:i.operationId,seasonId:i.seasonId,kind:i.kind,holdId:i.holdId,expiresAt:i.expiresAt,policy:i.policy,pricingAuthority:"host",authoritativeAmountIncluded:!1,state:i.state,bookingRef:i.bookingRef,location:i.location,retryAfterSeconds:i.retryAfterSeconds,allocations:s.map(p=>({eventId:p.eventId,state:p.state}))}}function dd(n,e,t){if(!Array.isArray(n)||n.length!==t||n.some(o=>typeof o!="string"||!o)||new Set(n).size!==n.length||!Array.isArray(e)||e.length!==n.length)throw new z("invalid_best_available_response",502);let i=n,s=new Set(i),r=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"||!s.has(a.label)||r.has(a.label)||typeof a.objectId!="string"||!a.objectId||a.objectType!=="seat"||typeof a.categoryKey!="string"||!a.categoryKey||a.tierId!==null&&(typeof a.tierId!="string"||!a.tierId)||a.quantity!==void 0&&a.quantity!==1)throw new z("invalid_best_available_response",502);r.set(a.label,{label:a.label,objectId:a.objectId,objectType:"seat",categoryKey:a.categoryKey,tierId:a.tierId,...a.quantity===void 0?{}:{quantity:a.quantity}})}return{labels:i,items:i.map(o=>r.get(o))}}function Ho(n,e){return{seasonKey:n.key,planActivationId:n.planActivationId,operationId:e.operationId,holdId:e.holdId,expiresAt:e.expiresAt,policy:e.policy,pricingAuthority:"host",authoritativeAmountIncluded:!1,state:e.state,allocations:e.allocations.map(({eventId:t,state:i})=>({eventKey:t,state:i}))}}var de,lt,me,ct,_t,fe,ge,ie,ue,Oo,Mi=class{constructor(e,t){_(this,ie);_(this,de);_(this,lt);_(this,me);_(this,ct);_(this,_t);_(this,fe,!1);_(this,ge,null);C(this,de,e),C(this,lt,(t.apiBase??ed).replace(/\/$/,"")),C(this,me,t.access),C(this,ct,t.fetch??globalThis.fetch.bind(globalThis)),C(this,_t,t.recoveryTimeoutMs??td),f(this,me).onRenewed(i=>E(this,ie,Oo).call(this,i))}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(i=>i==="free").length,blockedCount:t.filter(i=>i!=="free").length}}async hold(e,t){let{body:i,response:s}=await E(this,ie,ue).call(this,"POST","/holds",{operationId:t,labels:[...e]});return{operation:It(i.operation,{seasonId:f(this,de),operationId:t}),response:s}}async bestAvailable(e){let{body:t,response:i}=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}:{}}),s=It(t.operation,{seasonId:f(this,de),operationId:e.operationId},"invalid_best_available_response"),{labels:r,items:o}=dd(t.labels,t.items,e.qty);return{operation:s,labels:r,items:o,response:i}}async operation(e){let{body:t,response:i}=await E(this,ie,ue).call(this,"GET",`/operations/${encodeURIComponent(e)}`);return{operation:It(t.operation,{seasonId:f(this,de),operationId:e}),response:i}}async release(e,t){let{body:i,response:s}=await E(this,ie,ue).call(this,"POST",`/holds/${encodeURIComponent(e)}/release`,{releaseActionId:t});return{operation:It(i.operation,{seasonId:f(this,de),operationId:e}),response:s}}async renewalIntent(e){let{body:t}=await E(this,ie,ue).call(this,"POST","/renewal-intents",{offerId:e}),i=t.intent;if(!i||i.offerId!==e||i.state!=="intent_received"||!i.intentId||!Number.isFinite(i.receivedAt))throw new z("invalid_renewal_intent_response",502);return i}async waitForTerminal(e,t,i){let s=Date.now(),r=t?{operation:It(t.operation,{seasonId:f(this,de),operationId:e}),response:t.response}:await this.operation(e);for(;r.operation.state==="preparing"||r.operation.state==="commit_pending"||r.operation.state==="expire_pending"||r.operation.state==="booking_pending"||r.operation.state==="abort_pending";){if(Date.now()-s>=f(this,_t))throw new Li(e);await sd(nd(r.response,r.operation),i),r=await this.operation(e)}return r.operation}destroy(){f(this,fe)||(C(this,fe,!0),f(this,me).onRenewed(void 0),f(this,me).clear())}};de=new WeakMap,lt=new WeakMap,me=new WeakMap,ct=new WeakMap,_t=new WeakMap,fe=new WeakMap,ge=new WeakMap,ie=new WeakSet,ue=async function(e,t,i,s=!0){if(f(this,fe))throw new z("season_api_destroyed",409);if(f(this,ge))throw f(this,ge);let r=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(!r)throw new ae({reason:"no_token",retryable:!1});let o=await f(this,ct).call(this,`${f(this,lt)}/pub/seasons/${encodeURIComponent(f(this,de))}${t}`,{method:e,headers:{Authorization:r,...i===void 0?{}:{"Content-Type":"application/json"}},body:i===void 0?void 0:JSON.stringify(i)}),a=await o.json().catch(()=>null);if(!o.ok){let l=rd(a);if(s&&await f(this,me).handleFailure(o.status,l))return E(this,ie,ue).call(this,e,t,i,!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}},Oo=async function(e){if(f(this,fe))return;let t=`/pub/seasons/${encodeURIComponent(f(this,de))}/session/adopt`;for(let i=0;i<2;i++){if(f(this,fe))return;try{if((await f(this,ct).call(this,`${f(this,lt)}${t}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e.token}`},body:JSON.stringify({previousToken:e.previousToken}),credentials:"omit"})).ok){C(this,ge,null);return}}catch{}}if(!f(this,fe))throw C(this,ge,new z("season_session_adopt_failed",409)),f(this,ge)};var pd=2500;function hd(n){let e=typeof n=="string"?document.querySelector(n):n;if(!e)throw new Error("seatlayer: Season picker container was not found");return e}function ud(n,e,t){if(n.startsAt==null)return{date:"Date to be announced",time:null};try{let i=new Date(n.startsAt),s=e?{timeZone:e}:{};return{date:new Intl.DateTimeFormat(t,{dateStyle:"medium",...s}).format(i),time:new Intl.DateTimeFormat(t,{timeStyle:"short",...s}).format(i)}}catch{return{date:"Date to be announced",time:null}}}function Ro(n){return n.state==="committed"||n.state==="booked"}var Ln=class{constructor(e,t,i){this.transport=e;this.sink=t;this.intervalMs=i;this.timer=null;this.stopped=!0;this.prior={}}start(){this.stopped&&(this.stopped=!1,this.timer=setTimeout(()=>{this.tick()},this.intervalMs))}stop(){this.stopped=!0,this.timer&&clearTimeout(this.timer),this.timer=null}async tick(){if(!this.stopped)try{let e=await this.transport.objects(""),t=Object.entries(e.seats).filter(([i,s])=>this.prior[i]!==s).map(([i,s])=>({label:i,status:s}));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 i={operationId:e,...t.accessibility?.length?{accessibility:[...t.accessibility]}:{},...t.requireContiguous===!0?{requireContiguous:!0}:{}};return this.nextBestAvailable=i,i}clearBestAvailable(e){this.nextBestAvailable===e&&(this.nextBestAvailable=null)}queueRelease(e){this.nextReleaseActionId=e}operationForHold(e){return this.operationByHold.get(e)??null}remember(e){this.operationByHold.set(e.holdId,e)}forget(e){this.operationByHold.delete(e)}async chart(e){let[t,i]=await Promise.all([this.descriptorValue?Promise.resolve(this.descriptorValue):this.api.descriptor(),this.api.chart()]);return this.descriptorValue=t,{doc:i,event:{key:t.key,name:t.name,venue:t.venue,startsAt:t.occurrences[0]?.startsAt??null,timezone:t.timezone,currency:t.currency,mode:t.mode,inventoryModelVersion:2}}}async objects(e){let t;return this.reuseAvailabilityOnce&&this.availabilityValue?(this.reuseAvailabilityOnce=!1,t=this.availabilityValue):(t=await this.api.availability(),this.availabilityValue=t),{seats:{...t.seats}}}async hold(e,t,i,s){if(s)throw new z("season_hold_replace_unsupported",409);let r=this.nextOperationId??`sop_${crypto.randomUUID()}`;this.nextOperationId=null;let o=await this.api.hold(t.map(l=>l.label),r),a=await this.api.waitForTerminal(r,o);if(!Ro(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,i){let s=this.operationForHold(i);if(!s)throw new z("season_hold_not_found",404);let r=this.nextReleaseActionId??`sra_${crypto.randomUUID()}`;this.nextReleaseActionId=null;let o=await this.api.release(s.operationId,r),a=await this.api.waitForTerminal(s.operationId,o);if(a.state==="partial_terminal")throw this.remember(a),new z("season_operation_partial_terminal",409);this.forget(i)}async bestAvailable(e,t,i,s){let r=this.nextBestAvailable;this.nextBestAvailable=null;let o=r?.operationId??`sop_${crypto.randomUUID()}`,a=await this.api.bestAvailable({operationId:o,qty:t,...i?{categoryKey:i}:{},...s?{zoneId:s}:{},...r?.accessibility?.length?{accessibility:r.accessibility}:{},...r?.requireContiguous===!0?{requireContiguous:!0}:{}}),l=await this.api.waitForTerminal(o,a);if(!Ro(l))throw new z(`season_operation_${l.state}`,409);this.remember(l);let c=new Map(a.items.map(d=>[d.label,d]));return{holdId:l.holdId,expiresAt:l.expiresAt,labels:[...a.labels],items:a.labels.map(d=>{let p=c.get(d);return{label:d,objectId:p?.objectId??d,objectType:"seat",categoryKey:p?.categoryKey??i??"",tierId:p?.tierId??null,unitPrice:0,currency:this.descriptorValue?.currency??"USD",...p?.quantity==null?{}:{quantity:p.quantity}}})}}socketUrl(){return""}createRealtime(e,t){return new Ln(this,t,this.realtimePollMs)}},D,Ge,Dt,be,Q,Bt,oe,Te,j,ee,Ce,ut,Oe,Ee,qe,Ae,Re,mt,M,Io,_o,Do,On,Hi,dt,pt,K,je,Rn,ht,Hn=class{constructor(e){_(this,M);_(this,D);_(this,Ge);_(this,Dt);_(this,be);_(this,Q);_(this,Bt,new AbortController);_(this,oe,null);_(this,Te,null);_(this,j,null);_(this,ee,null);_(this,Ce,null);_(this,ut,null);_(this,Oe,null);_(this,Ee,null);_(this,qe,null);_(this,Ae,[]);_(this,Re,!1);_(this,mt,!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");C(this,D,e),C(this,Ge,hd(e.container)),C(this,Dt,new pe({token:e.buyerAccessToken,provider:e.buyerAccessTokenProvider,onExpired:e.onAccessExpired,onUnavailable:e.onAccessUnavailable})),C(this,be,new Mi(e.season,{apiBase:e.apiBase,access:f(this,Dt),fetch:e.fetch,recoveryTimeoutMs:e.recoveryTimeoutMs})),C(this,Q,new Mn(f(this,be),Math.max(750,e.realtimePollMs??pd)))}async render(){E(this,M,Rn).call(this),Mo(),E(this,M,_o).call(this),E(this,M,K).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:(C(this,oe,e),C(this,Te,t),f(this,Q).prime(e,t),E(this,M,Do).call(this),await E(this,M,Io).call(this,e),E(this,M,K).call(this,{kind:"ready",message:`${t.freeCount} seat${t.freeCount===1?"":"s"} available for every included performance.`}),f(this,D).initialOperationId&&await this.restoreOperation(f(this,D).initialOperationId),this)}catch(e){if(f(this,Re))return this;throw E(this,M,je).call(this,e),e}}async holdSameSeat(e,t){if(E(this,M,ht).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,Q).queueOperation(t),f(this,ee).selectObjectsWithoutConfirmation([...e]),E(this,M,K).call(this,{kind:"pending",message:"Holding the same seats for every performance.",operationId:t},!0),await f(this,ee).handleCta(),!f(this,j))throw new z("season_hold_not_created",409);return f(this,j)}async holdBestAvailable(e,t,i={}){if(E(this,M,ht).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 s=f(this,ee).maxTickets;if(e>s)throw new Error(`seatlayer: Best Available quantity cannot exceed the configured maximum (${s})`);if(f(this,mt))throw new z("season_best_available_in_progress",409);C(this,mt,!0);let r=null;try{if(r=f(this,Q).queueBestAvailable(t,i),E(this,M,K).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,i.categoryKey,{zoneId:i.zoneId})||!f(this,j))throw new z("season_hold_not_created",409);return f(this,j)}catch(o){throw E(this,M,je).call(this,o,t),o}finally{r&&f(this,Q).clearBestAvailable(r),C(this,mt,!1)}}async restoreOperation(e){E(this,M,ht).call(this),E(this,M,K).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,Bt).signal);return t.state==="aborted"||t.state==="expired"?(C(this,j,null),f(this,D).onHoldChange?.(null),E(this,M,K).call(this,{kind:"released",message:"The previous Season selection is no longer held.",operationId:e}),null):(f(this,Q).remember(t),E(this,M,On).call(this,t,!1))}catch(t){throw E(this,M,je).call(this,t,e),t}}async release(e){E(this,M,ht).call(this);let t=f(this,j);if(t){if(!e)throw new Error("seatlayer: caller-stable release action id is required");f(this,Q).queueRelease(e),E(this,M,K).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,Q).release("",[],t.holdId),E(this,M,Hi).call(this)),E(this,M,K).call(this,{kind:"released",message:"The Season seats were released.",operationId:t.operationId})}catch(i){throw E(this,M,je).call(this,i,t.operationId),i}}}async createRenewalIntent(e){if(E(this,M,ht).call(this),!e.startsWith("sro_"))throw new Error("seatlayer: Season renewal offer id is required");E(this,M,K).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,M,K).call(this,{kind:"renewal_intent",message:"Renewal intent recorded. Your ticketing platform will confirm price, payment, and renewal."}),f(this,D).onRenewalIntent?.(t),t}catch(t){throw E(this,M,je).call(this,t),t}}getDescriptor(){return f(this,oe)}getAvailability(){return f(this,Te)}getHandoff(){return f(this,j)}destroy(){f(this,Re)||(C(this,Re,!0),f(this,Bt).abort(),f(this,ee)?.destroy(),f(this,be).destroy(),f(this,Ge).replaceChildren(),C(this,Ce,null),C(this,ut,null),C(this,Oe,null),C(this,Ee,null),C(this,qe,null),C(this,oe,null),C(this,Te,null),C(this,j,null))}};D=new WeakMap,Ge=new WeakMap,Dt=new WeakMap,be=new WeakMap,Q=new WeakMap,Bt=new WeakMap,oe=new WeakMap,Te=new WeakMap,j=new WeakMap,ee=new WeakMap,Ce=new WeakMap,ut=new WeakMap,Oe=new WeakMap,Ee=new WeakMap,qe=new WeakMap,Ae=new WeakMap,Re=new WeakMap,mt=new WeakMap,M=new WeakSet,Io=async function(e){let t=new ze(Ai({container:f(this,ut),event:e.key,apiBase:f(this,D).apiBase,transport:f(this,Q),hideEventDetails:!0,maxSelection:f(this,D).maxSelection,selectedObjects:f(this,D).selectedObjects,selectableObjects:f(this,D).selectableObjects,numberOfPlacesToSelect:f(this,D).numberOfPlacesToSelect,selectionValidators:f(this,D).selectionValidators,locale:f(this,D).locale,messages:f(this,D).messages,languages:f(this,D).languages,colorblindSafe:f(this,D).colorblindSafe,initialView:f(this,D).initialView,enable3D:f(this,D).enable3D,max3DSeats:f(this,D).max3DSeats,hideBadge:f(this,D).hideBadge,theme:f(this,D).theme,confirmSelection:f(this,D).confirmSelection,seatView:f(this,D).seatView,onBuyerViewChange:f(this,D).onBuyerViewChange,onAnalytics:(i,s)=>{try{f(this,D).onAnalytics?.(i,{...s,metricScope:"season",seasonKey:e.key,planActivationId:e.planActivationId,performanceCount:e.occurrenceCount})}catch{}},onSelectionChange:i=>{C(this,Ae,i.map(s=>s.label)),E(this,M,dt).call(this),f(this,D).onSelectionChange?.(i)},onSelectionValidityChange:f(this,D).onSelectionValidityChange,onHoldChange:i=>{if(!i){E(this,M,Hi).call(this);return}let s=f(this,Q).operationForHold(i.holdId);s&&E(this,M,On).call(this,s,!0)},onCheckout:()=>{f(this,j)&&(E(this,M,pt).call(this,"checkout"),f(this,D).onContinue?.(f(this,j)))},onHoldExpired:()=>{E(this,M,Hi).call(this),E(this,M,K).call(this,{kind:"released",message:"The Season hold expired. Choose seats again."}),f(this,D).onHoldExpired?.()},onError:i=>E(this,M,je).call(this,i)},{surface:"season",performanceCount:e.occurrenceCount,selectionMode:"same_seat",suppressPricing:!0,groupSelectionSummary:()=>{let i=f(this,Ae).length;return i?{seats:i,performances:e.occurrenceCount,performancesChosen:e.occurrenceCount,perPerformance:i}:null}}));C(this,ee,t),await t.render()},_o=function(){f(this,Ge).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 i=document.createElement("ol");i.className="sl-season-progress",i.setAttribute("aria-label","Season checkout progress");for(let[m,y]of["Choose seats","Review package","Checkout"].entries()){let k=document.createElement("li");k.dataset.state=m===0?"current":"upcoming";let w=document.createElement("span");w.textContent=String(m+1),k.append(w,y),i.append(k)}let s=document.createElement("div");s.className="sl-season-stage";let r=document.createElement("div");r.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 d=document.createElement("i");d.textContent="1\xD7";let p=document.createElement("span");p.textContent="Each seat you choose is reserved for every included performance.",c.append(d,p);let u=document.createElement("p");u.className="sl-season-availability";let h=document.createElement("p");h.className="sl-season-checkout-note",h.textContent="Your ticketing platform confirms package price, payment, admission passes, and member benefits.",o.append(a,l,c,u,h),s.append(r,o);let g=document.createElement("p");g.className="sl-season-status",g.setAttribute("role","status"),g.setAttribute("aria-live","polite"),e.append(t,i,s,g),f(this,Ge).append(e),C(this,Ce,e),C(this,ut,r),C(this,Oe,g),C(this,Ee,l),C(this,qe,u)},Do=function(){let e=f(this,oe),t=f(this,D).offer,i=f(this,Ce).querySelector(".sl-season-hero");i.replaceChildren();let s=document.createElement("div");s.className="sl-season-copy";let r=document.createElement("p");r.className="sl-season-eyebrow",r.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 m of[`${e.occurrenceCount} performances`,e.venue,t?.renewalLabel??"Same-seat package"].filter(Boolean)){let y=document.createElement("span");y.className="sl-season-fact",y.textContent=m,l.append(y)}s.append(r,o,a,l),i.append(s);let c=document.createElement("div");c.className="sl-season-offer";let d=document.createElement("span");d.className="sl-season-offer-label",d.textContent=t?.priceLabel?"Season package":"Package price";let p=document.createElement(t?.priceLabel?"strong":"span");if(p.className=t?.priceLabel?"sl-season-price":"sl-season-price-note",p.textContent=t?.priceLabel??"Confirmed by your ticketing platform at checkout",c.append(d,p),t?.compareAtPriceLabel){let m=document.createElement("span");m.className="sl-season-was",m.textContent=t.compareAtPriceLabel,c.append(m)}if(t?.savingsLabel){let m=document.createElement("span");m.className="sl-season-saving",m.textContent=t.savingsLabel,c.append(m)}if(t?.priceNote){let m=document.createElement("span");m.className="sl-season-price-note",m.textContent=t.priceNote,c.append(m)}if(i.append(c),t?.benefits?.length){let m=document.createElement("ul");m.className="sl-season-benefits";for(let y of t.benefits.slice(0,6)){let k=document.createElement("li");k.textContent=y,m.append(k)}i.append(m)}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 m of e.occurrences){let y=document.createElement("li");y.className="sl-season-date";let k=document.createElement("b");k.textContent=m.name;let w=ud(m,e.timezone,f(this,D).locale),T=document.createElement("time");m.startsAt!=null&&(T.dateTime=new Date(m.startsAt).toISOString()),T.textContent=w.time?`${w.date} \xB7 ${w.time}`:w.date,y.append(k,T),g.append(y)}u.append(h,g),i.append(u),E(this,M,dt).call(this)},On=function(e,t){if(e.state==="booked")return C(this,j,null),f(this,Q).forget(e.holdId),f(this,ee)?.notifyGroupSettled("booked"),E(this,M,pt).call(this,"complete"),E(this,M,K).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,D).onHoldChange?.(null),null;if(e.state==="partial_terminal")return C(this,j,null),C(this,Ae,[]),f(this,Q).forget(e.holdId),f(this,ee)?.notifyGroupSettled("lost"),E(this,M,dt).call(this),E(this,M,pt).call(this,"review"),E(this,M,K).call(this,{kind:"partial_terminal",message:"This Season selection needs organizer review. Do not try another selection.",operationId:e.operationId}),f(this,D).onHoldChange?.(null),null;if(e.state!=="committed")return C(this,j,null),f(this,Q).forget(e.holdId),f(this,ee)?.notifyGroupSettled("lost"),E(this,M,K).call(this,{kind:"failed",message:"The Season selection could not be completed.",operationId:e.operationId}),f(this,D).onHoldChange?.(null),null;let i=Ho(f(this,oe),e),s=f(this,j)?.holdId!==i.holdId;return C(this,j,i),E(this,M,dt).call(this),E(this,M,pt).call(this,"review"),f(this,D).onHoldChange?.(i),E(this,M,K).call(this,{kind:"held",message:`Your seats are held for all ${f(this,oe).occurrenceCount} performances. Review and continue to checkout.`,operationId:e.operationId}),s&&t&&f(this,D).onHold?.(i),i},Hi=function(){C(this,j,null),C(this,Ae,[]),E(this,M,dt).call(this),E(this,M,pt).call(this,"choose"),f(this,D).onHoldChange?.(null)},dt=function(){if(!f(this,Ee))return;let e=f(this,Ae).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,Ae).join(", "),f(this,Ee).append(t,` \xB7 ${e} Season seat${e===1?"":"s"} across all ${f(this,oe)?.occurrenceCount??0} performances`)}f(this,qe)&&f(this,Te)&&(f(this,qe).textContent=`${f(this,Te).freeCount} seat${f(this,Te).freeCount===1?"":"s"} currently available for the complete Season`)},pt=function(e){let t=e==="choose"?0:e==="review"?1:e==="checkout"?2:3;f(this,Ce)?.querySelectorAll(".sl-season-progress li").forEach((i,s)=>{i.dataset.state=s<t?"done":s===t?"current":"upcoming";let r=i.querySelector("span");r&&(r.textContent=s<t?"\u2713":String(s+1))})},K=function(e,t=!1){f(this,Oe)&&(f(this,Oe).textContent=e.message,f(this,Oe).dataset.kind=e.kind),f(this,Ce)&&(f(this,Ce).dataset.busy=String(t)),f(this,D).onStatusChange?.(e)},je=function(e,t){let i=e instanceof z?`Season selection unavailable (${e.code}).`:"Season selection could not be completed.";E(this,M,K).call(this,{kind:"failed",message:i,operationId:t}),f(this,D).onError?.(e)},Rn=function(){if(f(this,Re))throw new Error("seatlayer: SeasonPicker was destroyed")},ht=function(){if(E(this,M,Rn).call(this),!f(this,oe)||!f(this,ee))throw new Error("seatlayer: render SeasonPicker before using it")};function md(n,e={}){let t=e.origin??"";if(!t)try{t=new URL(n.src,window.location.href).origin}catch{t=""}let i=!1,s=null,r=null,o=null,a="",l=null,c=()=>{if(i)return;i=!0,s=n.getAttribute("style"),Object.assign(n.style,{position:"fixed",inset:"0",width:"100vw",height:"100vh",margin:"0",border:"0",zIndex:"2147483000",background:"#101625"});let u=document.documentElement;r=u.style.overflow,u.style.overflow="hidden",document.body&&(o=document.body.style.overflow,document.body.style.overflow="hidden"),l=h=>{h.key==="Escape"&&d()},window.addEventListener("keydown",l)},d=()=>{i&&(i=!1,s===null?n.removeAttribute("style"):n.setAttribute("style",s),s=null,a&&(n.style.height=a),r!==null&&(document.documentElement.style.overflow=r,r=null),o!==null&&document.body&&(document.body.style.overflow=o,o=null),l&&(window.removeEventListener("keydown",l),l=null))},p=u=>{if(u.source!==n.contentWindow||t&&u.origin!==t||!u.data||typeof u.data!="object")return;let h=u.data;if(h.type==="seatlayer:height"){typeof h.px=="number"&&Number.isFinite(h.px)&&h.px>0&&(a=`${Math.round(h.px)}px`,i||(n.style.height=a));return}h.type==="seatlayer:fullscreen"&&(h.on===!0?c():h.on===!1&&d())};return window.addEventListener("message",p),()=>{window.removeEventListener("message",p),d()}}export{$ as ApiError,pe as BuyerAccessContext,ae as BuyerAccessUnavailableError,ve as BuyerRealtimeClient,Qi as EmbeddedDesigner,q as PerformanceGroupDestroyedError,An as PerformanceGroupPicker,Os as SEATING_CHART_CALLBACK_PROPS,Ls as SEATING_CHART_HANDLE_METHODS,Ms as SEATING_CHART_IDENTITY_PROPS,Hs as SEATING_CHART_VALUE_PROPS,z as SeasonApiError,Hn as SeasonPicker,Li as SeasonRecoveryTimeoutError,ze as SeatPicker,Wi as SeatingChart,md as attachPickerFrame,el as bindSeatingChartHandle,tl as buildSeatingChartOptions,xt as createBuyerAccessContext,gt as createControllerSink,en as parseTicketOfferAvailability,Rt as shortOperationReference,tn as ticketOfferPrices};
|
|
2876
|
+
`,document.head.appendChild(i)}var hp="https://api.seatlayer.io",up=6e4,mp=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 fp(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(mp,n*1e3))}function gp(i,e){return e?.aborted?Promise.reject(e.reason??new DOMException("Aborted","AbortError")):new Promise((t,n)=>{let s=setTimeout(t,i);e?.addEventListener("abort",()=>{clearTimeout(s),n(e.reason??new DOMException("Aborted","AbortError"))},{once:!0})})}function bp(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 vp=/^shc_[a-f0-9]{40}$/,yp=/^shh_[a-f0-9]{40}$/,wp=new Set(["preparing","commit_pending","committed","expire_pending","booking_pending","abort_pending","aborted","partial_terminal","expired","booked"]),xp=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"&&vp.test(t)||Pn(t))}function Ot(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,s=n.allocations,r=new Set,o=Array.isArray(s)&&s.length>0&&s.every(d=>{if(!d||typeof d!="object")return!1;let u=d.eventId,h=d.state;return typeof u!="string"||!u||typeof h!="string"||!xp.has(h)||r.has(u)?!1:(r.add(u),!0)}),a=n.bookingRef===null||typeof n.bookingRef=="string"&&n.bookingRef.length>0,l=n.state!=="booked"||typeof n.bookingRef=="string"&&o&&s.every(d=>d.state==="booked"),c=n.state!=="booking_pending"||typeof n.bookingRef=="string"&&o&&s.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"||!yp.test(n.holdId)||n.policy!=="fixed_inclusion_same_seat"||typeof n.state!="string"||!wp.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:s.map(d=>({eventId:d.eventId,state:d.state}))}}function Sp(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,s=new Set(n),r=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"||!s.has(a.label)||r.has(a.label)||typeof a.objectId!="string"||!a.objectId||a.objectType!=="seat"||typeof a.categoryKey!="string"||!a.categoryKey||a.tierId!==null&&(typeof a.tierId!="string"||!a.tierId)||a.quantity!==void 0&&a.quantity!==1)throw new z("invalid_best_available_response",502);r.set(a.label,{label:a.label,objectId:a.objectId,objectType:"seat",categoryKey:a.categoryKey,tierId:a.tierId,...a.quantity===void 0?{}:{quantity:a.quantity}})}return{labels:n,items:n.map(o=>r.get(o))}}function Aa(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 de,dt,fe,pt,_t,ge,be,ie,me,Pa,Ri=class{constructor(e,t){_(this,ie);_(this,de);_(this,dt);_(this,fe);_(this,pt);_(this,_t);_(this,ge,!1);_(this,be,null);E(this,de,e),E(this,dt,(t.apiBase??hp).replace(/\/$/,"")),E(this,fe,t.access),E(this,pt,t.fetch??globalThis.fetch.bind(globalThis)),E(this,_t,t.recoveryTimeoutMs??up),m(this,fe).onRenewed(n=>A(this,ie,Pa).call(this,n))}async descriptor(){let{body:e}=await A(this,ie,me).call(this,"GET","");return e.season}async chart(){let{body:e}=await A(this,ie,me).call(this,"GET","/chart");return e}async availability(){let{body:e}=await A(this,ie,me).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:s}=await A(this,ie,me).call(this,"POST","/holds",{operationId:t,labels:[...e]});return{operation:Ot(n.operation,{seasonId:m(this,de),operationId:t}),response:s}}async bestAvailable(e){let{body:t,response:n}=await A(this,ie,me).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}:{}}),s=Ot(t.operation,{seasonId:m(this,de),operationId:e.operationId},"invalid_best_available_response"),{labels:r,items:o}=Sp(t.labels,t.items,e.qty);return{operation:s,labels:r,items:o,response:n}}async operation(e){let{body:t,response:n}=await A(this,ie,me).call(this,"GET",`/operations/${encodeURIComponent(e)}`);return{operation:Ot(t.operation,{seasonId:m(this,de),operationId:e}),response:n}}async release(e,t){let{body:n,response:s}=await A(this,ie,me).call(this,"POST",`/holds/${encodeURIComponent(e)}/release`,{releaseActionId:t});return{operation:Ot(n.operation,{seasonId:m(this,de),operationId:e}),response:s}}async renewalIntent(e){let{body:t}=await A(this,ie,me).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 s=Date.now(),r=t?{operation:Ot(t.operation,{seasonId:m(this,de),operationId:e}),response:t.response}:await this.operation(e);for(;r.operation.state==="preparing"||r.operation.state==="commit_pending"||r.operation.state==="expire_pending"||r.operation.state==="booking_pending"||r.operation.state==="abort_pending";){if(Date.now()-s>=m(this,_t))throw new Hi(e);await gp(fp(r.response,r.operation),n),r=await this.operation(e)}return r.operation}destroy(){m(this,ge)||(E(this,ge,!0),m(this,fe).onRenewed(void 0),m(this,fe).clear())}};de=new WeakMap,dt=new WeakMap,fe=new WeakMap,pt=new WeakMap,_t=new WeakMap,ge=new WeakMap,be=new WeakMap,ie=new WeakSet,me=async function(e,t,n,s=!0){if(m(this,ge))throw new z("season_api_destroyed",409);if(m(this,be))throw m(this,be);let r=await m(this,fe).authorization();if(m(this,ge))throw new z("season_api_destroyed",409);if(m(this,be))throw m(this,be);if(!r)throw new le({reason:"no_token",retryable:!1});let o=await m(this,pt).call(this,`${m(this,dt)}/pub/seasons/${encodeURIComponent(m(this,de))}${t}`,{method:e,headers:{Authorization:r,...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=bp(a);if(s&&await m(this,fe).handleFailure(o.status,l))return A(this,ie,me).call(this,e,t,n,!1);let c=m(this,fe).unavailable;throw c?new le(c):new z(l,o.status)}if(a===null)throw new z("invalid_json_response",502);return{body:a,response:o}},Pa=async function(e){if(m(this,ge))return;let t=`/pub/seasons/${encodeURIComponent(m(this,de))}/session/adopt`;for(let n=0;n<2;n++){if(m(this,ge))return;try{if((await m(this,pt).call(this,`${m(this,dt)}${t}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e.token}`},body:JSON.stringify({previousToken:e.previousToken}),credentials:"omit"})).ok){E(this,be,null);return}}catch{}}if(!m(this,ge))throw E(this,be,new z("season_session_adopt_failed",409)),m(this,be)};var kp=2500;function Tp(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 Cp(i,e,t){if(i.startsAt==null)return{date:"Date to be announced",time:null};try{let n=new Date(i.startsAt),s=e?{timeZone:e}:{};return{date:new Intl.DateTimeFormat(t,{dateStyle:"medium",...s}).format(n),time:new Intl.DateTimeFormat(t,{timeStyle:"short",...s}).format(n)}}catch{return{date:"Date to be announced",time:null}}}function La(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,s])=>this.prior[n]!==s).map(([n,s])=>({label:n,status:s}));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,s){if(s)throw new z("season_hold_replace_unsupported",409);let r=this.nextOperationId??`sop_${crypto.randomUUID()}`;this.nextOperationId=null;let o=await this.api.hold(t.map(l=>l.label),r),a=await this.api.waitForTerminal(r,o);if(!La(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 s=this.operationForHold(n);if(!s)throw new z("season_hold_not_found",404);let r=this.nextReleaseActionId??`sra_${crypto.randomUUID()}`;this.nextReleaseActionId=null;let o=await this.api.release(s.operationId,r),a=await this.api.waitForTerminal(s.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,s){let r=this.nextBestAvailable;this.nextBestAvailable=null;let o=r?.operationId??`sop_${crypto.randomUUID()}`,a=await this.api.bestAvailable({operationId:o,qty:t,...n?{categoryKey:n}:{},...s?{zoneId:s}:{},...r?.accessibility?.length?{accessibility:r.accessibility}:{},...r?.requireContiguous===!0?{requireContiguous:!0}:{}}),l=await this.api.waitForTerminal(o,a);if(!La(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)}},B,qe,Dt,ve,Q,Bt,ae,Te,j,ee,Ce,ft,Re,Ee,Ue,Ae,Ie,gt,L,Ma,Ha,Ra,Rn,Ii,ht,ut,K,Ge,In,mt,Hn=class{constructor(e){_(this,L);_(this,B);_(this,qe);_(this,Dt);_(this,ve);_(this,Q);_(this,Bt,new AbortController);_(this,ae,null);_(this,Te,null);_(this,j,null);_(this,ee,null);_(this,Ce,null);_(this,ft,null);_(this,Re,null);_(this,Ee,null);_(this,Ue,null);_(this,Ae,[]);_(this,Ie,!1);_(this,gt,!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");E(this,B,e),E(this,qe,Tp(e.container)),E(this,Dt,new pe({token:e.buyerAccessToken,provider:e.buyerAccessTokenProvider,onExpired:e.onAccessExpired,onUnavailable:e.onAccessUnavailable})),E(this,ve,new Ri(e.season,{apiBase:e.apiBase,access:m(this,Dt),fetch:e.fetch,recoveryTimeoutMs:e.recoveryTimeoutMs})),E(this,Q,new Mn(m(this,ve),Math.max(750,e.realtimePollMs??kp)))}async render(){A(this,L,In).call(this),Ea(),A(this,L,Ha).call(this),A(this,L,K).call(this,{kind:"loading",message:"Loading Season seats available for every performance."},!0);try{let[e,t]=await Promise.all([m(this,ve).descriptor(),m(this,ve).availability()]);return m(this,Ie)?this:(E(this,ae,e),E(this,Te,t),m(this,Q).prime(e,t),A(this,L,Ra).call(this),await A(this,L,Ma).call(this,e),A(this,L,K).call(this,{kind:"ready",message:`${t.freeCount} seat${t.freeCount===1?"":"s"} available for every included performance.`}),m(this,B).initialOperationId&&await this.restoreOperation(m(this,B).initialOperationId),this)}catch(e){if(m(this,Ie))return this;throw A(this,L,Ge).call(this,e),e}}async holdSameSeat(e,t){if(A(this,L,mt).call(this),!t.startsWith("sop_"))throw new Error("seatlayer: caller-stable Season operation id is required");if(!e.length)throw new Error("seatlayer: select at least one seat");if(m(this,Q).queueOperation(t),m(this,ee).selectObjectsWithoutConfirmation([...e]),A(this,L,K).call(this,{kind:"pending",message:"Holding the same seats for every performance.",operationId:t},!0),await m(this,ee).handleCta(),!m(this,j))throw new z("season_hold_not_created",409);return m(this,j)}async holdBestAvailable(e,t,n={}){if(A(this,L,mt).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 s=m(this,ee).maxTickets;if(e>s)throw new Error(`seatlayer: Best Available quantity cannot exceed the configured maximum (${s})`);if(m(this,gt))throw new z("season_best_available_in_progress",409);E(this,gt,!0);let r=null;try{if(r=m(this,Q).queueBestAvailable(t,n),A(this,L,K).call(this,{kind:"pending",message:`Finding ${e} Season seat${e===1?"":"s"} available for every performance.`,operationId:t},!0),!await m(this,ee).bestAvailableOrThrow(e,n.categoryKey,{zoneId:n.zoneId})||!m(this,j))throw new z("season_hold_not_created",409);return m(this,j)}catch(o){throw A(this,L,Ge).call(this,o,t),o}finally{r&&m(this,Q).clearBestAvailable(r),E(this,gt,!1)}}async restoreOperation(e){A(this,L,mt).call(this),A(this,L,K).call(this,{kind:"pending",message:"Restoring your Season selection.",operationId:e},!0);try{let t=await m(this,ve).waitForTerminal(e,void 0,m(this,Bt).signal);return t.state==="aborted"||t.state==="expired"?(E(this,j,null),m(this,B).onHoldChange?.(null),A(this,L,K).call(this,{kind:"released",message:"The previous Season selection is no longer held.",operationId:e}),null):(m(this,Q).remember(t),A(this,L,Rn).call(this,t,!1))}catch(t){throw A(this,L,Ge).call(this,t,e),t}}async release(e){A(this,L,mt).call(this);let t=m(this,j);if(t){if(!e)throw new Error("seatlayer: caller-stable release action id is required");m(this,Q).queueRelease(e),A(this,L,K).call(this,{kind:"pending",message:"Releasing the Season seats.",operationId:t.operationId},!0);try{m(this,ee)?.getCurrentHold()?.holdId===t.holdId?await m(this,ee).release():(await m(this,Q).release("",[],t.holdId),A(this,L,Ii).call(this)),A(this,L,K).call(this,{kind:"released",message:"The Season seats were released.",operationId:t.operationId})}catch(n){throw A(this,L,Ge).call(this,n,t.operationId),n}}}async createRenewalIntent(e){if(A(this,L,mt).call(this),!e.startsWith("sro_"))throw new Error("seatlayer: Season renewal offer id is required");A(this,L,K).call(this,{kind:"pending",message:"Recording renewal intent. No purchase is made in the browser."},!0);try{let t=await m(this,ve).renewalIntent(e);return A(this,L,K).call(this,{kind:"renewal_intent",message:"Renewal intent recorded. Your ticketing platform will confirm price, payment, and renewal."}),m(this,B).onRenewalIntent?.(t),t}catch(t){throw A(this,L,Ge).call(this,t),t}}getDescriptor(){return m(this,ae)}getAvailability(){return m(this,Te)}getHandoff(){return m(this,j)}destroy(){m(this,Ie)||(E(this,Ie,!0),m(this,Bt).abort(),m(this,ee)?.destroy(),m(this,ve).destroy(),m(this,qe).replaceChildren(),E(this,Ce,null),E(this,ft,null),E(this,Re,null),E(this,Ee,null),E(this,Ue,null),E(this,ae,null),E(this,Te,null),E(this,j,null))}};B=new WeakMap,qe=new WeakMap,Dt=new WeakMap,ve=new WeakMap,Q=new WeakMap,Bt=new WeakMap,ae=new WeakMap,Te=new WeakMap,j=new WeakMap,ee=new WeakMap,Ce=new WeakMap,ft=new WeakMap,Re=new WeakMap,Ee=new WeakMap,Ue=new WeakMap,Ae=new WeakMap,Ie=new WeakMap,gt=new WeakMap,L=new WeakSet,Ma=async function(e){let t=new je(Pi({container:m(this,ft),event:e.key,apiBase:m(this,B).apiBase,transport:m(this,Q),hideEventDetails:!0,maxSelection:m(this,B).maxSelection,selectedObjects:m(this,B).selectedObjects,selectableObjects:m(this,B).selectableObjects,numberOfPlacesToSelect:m(this,B).numberOfPlacesToSelect,selectionValidators:m(this,B).selectionValidators,locale:m(this,B).locale,messages:m(this,B).messages,languages:m(this,B).languages,colorblindSafe:m(this,B).colorblindSafe,initialView:m(this,B).initialView,enable3D:m(this,B).enable3D,max3DSeats:m(this,B).max3DSeats,hideBadge:m(this,B).hideBadge,theme:m(this,B).theme,confirmSelection:m(this,B).confirmSelection,seatView:m(this,B).seatView,onBuyerViewChange:m(this,B).onBuyerViewChange,onAnalytics:(n,s)=>{try{m(this,B).onAnalytics?.(n,{...s,metricScope:"season",seasonKey:e.key,planActivationId:e.planActivationId,performanceCount:e.occurrenceCount})}catch{}},onSelectionChange:n=>{E(this,Ae,n.map(s=>s.label)),A(this,L,ht).call(this),m(this,B).onSelectionChange?.(n)},onSelectionValidityChange:m(this,B).onSelectionValidityChange,onHoldChange:n=>{if(!n){A(this,L,Ii).call(this);return}let s=m(this,Q).operationForHold(n.holdId);s&&A(this,L,Rn).call(this,s,!0)},onCheckout:()=>{m(this,j)&&(A(this,L,ut).call(this,"checkout"),m(this,B).onContinue?.(m(this,j)))},onHoldExpired:()=>{A(this,L,Ii).call(this),A(this,L,K).call(this,{kind:"released",message:"The Season hold expired. Choose seats again."}),m(this,B).onHoldExpired?.()},onError:n=>A(this,L,Ge).call(this,n)},{surface:"season",performanceCount:e.occurrenceCount,selectionMode:"same_seat",suppressPricing:!0,groupSelectionSummary:()=>{let n=m(this,Ae).length;return n?{seats:n,performances:e.occurrenceCount,performancesChosen:e.occurrenceCount,perPerformance:n}:null}}));E(this,ee,t),await t.render()},Ha=function(){m(this,qe).replaceChildren();let e=document.createElement("section");e.className="sl-season-root",e.setAttribute("aria-label","Season ticket selection");let t=document.createElement("header");t.className="sl-season-hero";let n=document.createElement("ol");n.className="sl-season-progress",n.setAttribute("aria-label","Season checkout progress");for(let[g,x]of["Choose seats","Review package","Checkout"].entries()){let w=document.createElement("li");w.dataset.state=g===0?"current":"upcoming";let y=document.createElement("span");y.textContent=String(g+1),w.append(y,x),n.append(w)}let s=document.createElement("div");s.className="sl-season-stage";let r=document.createElement("div");r.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),s.append(r,o);let f=document.createElement("p");f.className="sl-season-status",f.setAttribute("role","status"),f.setAttribute("aria-live","polite"),e.append(t,n,s,f),m(this,qe).append(e),E(this,Ce,e),E(this,ft,r),E(this,Re,f),E(this,Ee,l),E(this,Ue,u)},Ra=function(){let e=m(this,ae),t=m(this,B).offer,n=m(this,Ce).querySelector(".sl-season-hero");n.replaceChildren();let s=document.createElement("div");s.className="sl-season-copy";let r=document.createElement("p");r.className="sl-season-eyebrow",r.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 g of[`${e.occurrenceCount} performances`,e.venue,t?.renewalLabel??"Same-seat package"].filter(Boolean)){let x=document.createElement("span");x.className="sl-season-fact",x.textContent=g,l.append(x)}s.append(r,o,a,l),n.append(s);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 g=document.createElement("span");g.className="sl-season-was",g.textContent=t.compareAtPriceLabel,c.append(g)}if(t?.savingsLabel){let g=document.createElement("span");g.className="sl-season-saving",g.textContent=t.savingsLabel,c.append(g)}if(t?.priceNote){let g=document.createElement("span");g.className="sl-season-price-note",g.textContent=t.priceNote,c.append(g)}if(n.append(c),t?.benefits?.length){let g=document.createElement("ul");g.className="sl-season-benefits";for(let x of t.benefits.slice(0,6)){let w=document.createElement("li");w.textContent=x,g.append(w)}n.append(g)}let u=document.createElement("details");u.className="sl-season-dates";let h=document.createElement("summary");h.textContent=`All ${e.occurrenceCount} performances included`;let f=document.createElement("ol");f.className="sl-season-date-list";for(let g of e.occurrences){let x=document.createElement("li");x.className="sl-season-date";let w=document.createElement("b");w.textContent=g.name;let y=Cp(g,e.timezone,m(this,B).locale),T=document.createElement("time");g.startsAt!=null&&(T.dateTime=new Date(g.startsAt).toISOString()),T.textContent=y.time?`${y.date} \xB7 ${y.time}`:y.date,x.append(w,T),f.append(x)}u.append(h,f),n.append(u),A(this,L,ht).call(this)},Rn=function(e,t){if(e.state==="booked")return E(this,j,null),m(this,Q).forget(e.holdId),m(this,ee)?.notifyGroupSettled("booked"),A(this,L,ut).call(this,"complete"),A(this,L,K).call(this,{kind:"booked",message:`Your Season booking is complete for all ${m(this,ae).occurrenceCount} performances. No further checkout action is needed.`,operationId:e.operationId}),m(this,B).onHoldChange?.(null),null;if(e.state==="partial_terminal")return E(this,j,null),E(this,Ae,[]),m(this,Q).forget(e.holdId),m(this,ee)?.notifyGroupSettled("lost"),A(this,L,ht).call(this),A(this,L,ut).call(this,"review"),A(this,L,K).call(this,{kind:"partial_terminal",message:"This Season selection needs organizer review. Do not try another selection.",operationId:e.operationId}),m(this,B).onHoldChange?.(null),null;if(e.state!=="committed")return E(this,j,null),m(this,Q).forget(e.holdId),m(this,ee)?.notifyGroupSettled("lost"),A(this,L,K).call(this,{kind:"failed",message:"The Season selection could not be completed.",operationId:e.operationId}),m(this,B).onHoldChange?.(null),null;let n=Aa(m(this,ae),e),s=m(this,j)?.holdId!==n.holdId;return E(this,j,n),A(this,L,ht).call(this),A(this,L,ut).call(this,"review"),m(this,B).onHoldChange?.(n),A(this,L,K).call(this,{kind:"held",message:`Your seats are held for all ${m(this,ae).occurrenceCount} performances. Review and continue to checkout.`,operationId:e.operationId}),s&&t&&m(this,B).onHold?.(n),n},Ii=function(){E(this,j,null),E(this,Ae,[]),A(this,L,ht).call(this),A(this,L,ut).call(this,"choose"),m(this,B).onHoldChange?.(null)},ht=function(){if(!m(this,Ee))return;let e=m(this,Ae).length;if(!e)m(this,Ee).textContent="Choose a seat on the map. Unavailable seats are already booked on at least one included performance.";else{m(this,Ee).replaceChildren();let t=document.createElement("strong");t.textContent=m(this,Ae).join(", "),m(this,Ee).append(t,` \xB7 ${e} Season seat${e===1?"":"s"} across all ${m(this,ae)?.occurrenceCount??0} performances`)}m(this,Ue)&&m(this,Te)&&(m(this,Ue).textContent=`${m(this,Te).freeCount} seat${m(this,Te).freeCount===1?"":"s"} currently available for the complete Season`)},ut=function(e){let t=e==="choose"?0:e==="review"?1:e==="checkout"?2:3;m(this,Ce)?.querySelectorAll(".sl-season-progress li").forEach((n,s)=>{n.dataset.state=s<t?"done":s===t?"current":"upcoming";let r=n.querySelector("span");r&&(r.textContent=s<t?"\u2713":String(s+1))})},K=function(e,t=!1){m(this,Re)&&(m(this,Re).textContent=e.message,m(this,Re).dataset.kind=e.kind),m(this,Ce)&&(m(this,Ce).dataset.busy=String(t)),m(this,B).onStatusChange?.(e)},Ge=function(e,t){let n=e instanceof z?`Season selection unavailable (${e.code}).`:"Season selection could not be completed.";A(this,L,K).call(this,{kind:"failed",message:n,operationId:t}),m(this,B).onError?.(e)},In=function(){if(m(this,Ie))throw new Error("seatlayer: SeasonPicker was destroyed")},mt=function(){if(A(this,L,In).call(this),!m(this,ae)||!m(this,ee))throw new Error("seatlayer: render SeasonPicker before using it")};function Ep(i,e={}){let t=e.origin??"";if(!t)try{t=new URL(i.src,window.location.href).origin}catch{t=""}let n=!1,s=null,r=null,o=null,a="",l=null,c="",p=()=>{if(n)return;n=!0,s=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;r=h.style.overflow,h.style.overflow="hidden",document.body&&(o=document.body.style.overflow,document.body.style.overflow="hidden"),l=f=>{f.key==="Escape"&&d()},window.addEventListener("keydown",l)},d=()=>{n&&(n=!1,s===null?i.removeAttribute("style"):i.setAttribute("style",s),s=null,a&&(i.style.height=a),r!==null&&(document.documentElement.style.overflow=r,r=null),o!==null&&document.body&&(document.body.style.overflow=o,o=null),l&&(window.removeEventListener("keydown",l),l=null))},u=h=>{if(h.source!==i.contentWindow||t&&h.origin!==t||!h.data||typeof h.data!="object")return;let f=h.data;if(f.type==="seatlayer:height"){typeof f.px=="number"&&Number.isFinite(f.px)&&f.px>0&&(a=`${Math.round(f.px)}px`,n||(i.style.height=a));return}f.type==="seatlayer:fullscreen"&&(typeof f.background=="string"&&/^[#a-zA-Z0-9(),.%\s-]{1,64}$/.test(f.background)&&(c=f.background,n&&(i.style.background=c)),f.on===!0?p():f.on===!1&&d())};return window.addEventListener("message",u),()=>{window.removeEventListener("message",u),d()}}export{F as ApiError,pe as BuyerAccessContext,le as BuyerAccessUnavailableError,ye as BuyerRealtimeClient,Xi as EmbeddedDesigner,U as PerformanceGroupDestroyedError,An as PerformanceGroupPicker,Hs as SEATING_CHART_CALLBACK_PROPS,Ps as SEATING_CHART_HANDLE_METHODS,Ls as SEATING_CHART_IDENTITY_PROPS,Ms as SEATING_CHART_VALUE_PROPS,z as SeasonApiError,Hn as SeasonPicker,Hi as SeasonRecoveryTimeoutError,je as SeatPicker,Yi as SeatingChart,Ep as attachPickerFrame,Ql as bindSeatingChartHandle,Xl as buildSeatingChartOptions,St as createBuyerAccessContext,bt as createControllerSink,en as parseTicketOfferAvailability,It as shortOperationReference,tn as ticketOfferPrices};
|