@seatlayer/js 0.105.0 → 0.106.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -3377,7 +3377,7 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default;text-decoration-color:t
3377
3377
  <div class="sl-designer-skeleton-rail" aria-hidden="true"><i></i><i></i><i></i><i></i><i></i></div>
3378
3378
  <div class="sl-designer-skeleton-canvas"><div class="sl-designer-skeleton-caption"><span class="sl-designer-skeleton-spinner" aria-hidden="true"></span><span>Loading designer\u2026<small>Preparing your floor plan</small></span></div></div>
3379
3379
  <div class="sl-designer-skeleton-inspector" aria-hidden="true"><div class="sl-designer-skeleton-bar"></div></div>
3380
- </div>`,e.append(n)}buildErrorCard(e,t){let n=Ip[t],r=document.createElement("div");Object.assign(r.style,{maxWidth:"420px",margin:"auto 24px",padding:"28px",textAlign:"center",background:"rgba(255, 255, 255, 0.03)",border:"1px solid rgba(255, 255, 255, 0.08)",borderRadius:"16px",boxShadow:"0 12px 40px rgba(0, 0, 0, 0.35)"});let o=document.createElement("h2");o.textContent=n.title,Object.assign(o.style,{margin:"0 0 8px",fontSize:"17px",fontWeight:"600",color:"#f4f7ff"});let s=document.createElement("p");s.textContent=n.body,Object.assign(s.style,{margin:"0 0 20px",fontSize:"13.5px",lineHeight:"1.5",color:"#aab4c8"});let a=document.createElement("button");a.type="button",a.textContent="Try again",Object.assign(a.style,{appearance:"none",cursor:"pointer",border:"0",borderRadius:"10px",padding:"10px 22px",fontSize:"14px",fontWeight:"600",color:"#101625",background:"#7aa2ff"}),a.addEventListener("click",()=>this.handleTryAgain()),r.append(o,s,a),e.append(r)}};function Ht(i,e){let t=document.createElement("div");t.className="sl-loading-state";let n=document.createElement("div");if(n.setAttribute("role",e.busy?"status":"alert"),n.setAttribute("aria-atomic","true"),e.busy){let s=document.createElement("div");s.className="sl-boot-spin",s.setAttribute("aria-hidden","true"),t.append(s)}let r=document.createElement("div");if(r.className="sl-boot-title",r.textContent=e.title,n.append(r),e.description){let s=document.createElement("p");s.className="sl-loading-description",s.textContent=e.description,n.append(s)}t.append(n);let o=null;return e.actionLabel&&(o=document.createElement("button"),o.type="button",o.className="sl-boot-retry",o.textContent=e.actionLabel,t.append(o)),i.replaceChildren(t),o}function Op(i){let{viewportWidth:e,viewportHeight:t,offsetTop:n,offsetLeft:r,clientWidth:o,clientHeight:s,innerHeight:a,largeViewportHeight:l}=i;if(![e,t,n,r].every(Number.isFinite)||e<=0||t<=0)return null;let c=Number.isFinite(o)&&o>0?o:e,d=Number.isFinite(s)&&s>0?s:t,u=n;return Number.isFinite(l)&&a>l+1&&d<l-1&&(u=Math.max(u,l-d)),{width:Math.min(e,c),height:Math.min(t,d),top:u,left:r}}function _s(i){let e=window.visualViewport;if(!e)return()=>{};let t=document.createElement("div");t.setAttribute("aria-hidden","true"),Object.assign(t.style,{position:"absolute",visibility:"hidden",pointerEvents:"none",width:"0",height:"100lvh",overflow:"hidden"}),document.body.appendChild(t);let n=()=>{let c=Op({viewportWidth:e.width,viewportHeight:e.height,offsetTop:e.offsetTop,offsetLeft:e.offsetLeft,clientWidth:document.documentElement.clientWidth,clientHeight:document.documentElement.clientHeight,innerHeight:window.innerHeight,largeViewportHeight:t.getBoundingClientRect().height});c&&Object.assign(i.style,{right:"auto",bottom:"auto",top:`${c.top}px`,left:`${c.left}px`,width:`${c.width}px`,height:`${c.height}px`})},r=0,o=0,s=0,a=()=>{r&&window.cancelAnimationFrame(r),o&&window.cancelAnimationFrame(o),s&&window.clearTimeout(s),r=window.requestAnimationFrame(()=>{r=0,o=window.requestAnimationFrame(()=>{o=0,n()})}),s=window.setTimeout(()=>{s=0,n()},250)},l=()=>{n(),a()};return l(),e.addEventListener("resize",l),e.addEventListener("scroll",l),window.addEventListener("resize",l),window.addEventListener("orientationchange",l),window.addEventListener("pageshow",l),()=>{r&&window.cancelAnimationFrame(r),o&&window.cancelAnimationFrame(o),s&&window.clearTimeout(s),e.removeEventListener("resize",l),e.removeEventListener("scroll",l),window.removeEventListener("resize",l),window.removeEventListener("orientationchange",l),window.removeEventListener("pageshow",l),t.remove()}}function Ns(i,e){let t=new Set(["chart","objects","resume","availability"]),n=new Map;return new Proxy(Object.create(i),{get(r,o){let s=i,a=Reflect.get(s,o,s);return typeof a!="function"?a:(n.has(o)||n.set(o,t.has(String(o))?async(...l)=>{let c=await vt(()=>a.apply(s,l),e,()=>{});if(c.outcome==="loaded")return c.value;if(c.outcome==="error")throw c.error;let d=new Error(c.outcome==="timeout"?"request_timeout":"request_cancelled");throw d.name=c.outcome==="timeout"?"TimeoutError":"AbortError",d}:a.bind(s)),n.get(o))}})}import{PickerController as ru,effectiveFloorOverview as ou,formatMoney as su,getLocale as ic,loadLocale as au,setStringOverrides as lu,t as N,tCount as wn}from"@seatlayer/core";import{isAuthoredSeatView as cu,seatViewDisclosure as du}from"@seatlayer/core/view3d/crossfade/panorama";function Ds(i){return!!i&&i.clientWidth>0&&i.scrollWidth>i.clientWidth+1}function _p(i){return i.some(e=>Ds(e))}var tn="data-fit-gone",Np=12;function er(i,e,t=Ds){if(!i)return 0;for(let n of e)i.classList.remove(n.cls);if(i.querySelectorAll(`[${tn}]`).forEach(n=>{n.removeAttribute(tn),n.hidden=!1}),i.dataset.fit="0",i.clientWidth<=0||!t(i))return 0;for(let n=0;n<e.length;n+=1){let r=e[n];n>0&&i.classList.remove(e[n-1].cls),i.classList.add(r.cls),i.dataset.fit=String(n+1);let o=r.give?r.give(i):!0;if(!t(i))return n+1;if(r.repeat&&r.give){for(let s=1;o&&s<Np;s+=1)if(o=r.give(i),!t(i))return n+1}}return e.length}function Dp(i,e="[data-fit-seg]"){let t=[...i.querySelectorAll(e)].filter(n=>!n.hidden);return t.length<2?!1:Bs(t[t.length-1])}function Bp(i,e){let t=i.querySelector(e);return t&&!t.hidden?Bs(t):!1}function Bs(i){let e=i.previousElementSibling;return e instanceof HTMLElement&&e.tagName==="I"&&(e.setAttribute(tn,""),e.hidden=!0),i.setAttribute(tn,""),i.hidden=!0,!0}function Fp(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 Fs(i){if(!i)return 0;let e=i.querySelector(".sl-confirm-cancel"),t=i.querySelector(".sl-confirm-add-t");return er(i,[{cls:"sl-fit-track"},{cls:"sl-fit-type"},{cls:"sl-fit-icon",give:()=>Fp(e)}],()=>_p([e,t]))}function Vs(i){return er(i,[{cls:"sl-fit-notype",give:e=>Bp(e,"[data-fit-type]")},{cls:"sl-fit-short",give:e=>Dp(e),repeat:!0}])}function zs(i){return i?(i.classList.add("sl-fitpill"),er(i,[{cls:"sl-fit-p1"},{cls:"sl-fit-p2"},{cls:"sl-fit-p3"}])):0}var Rt;function $s(i){if(!i)return!1;delete i.dataset.fit;let e=i.selectedOptions?.[0]?.textContent??i.options[i.selectedIndex]?.textContent??"",t=i.clientWidth;if(!e||!t)return!1;if(Rt===void 0)try{Rt=document.createElement("canvas").getContext("2d")}catch{Rt=null}if(!Rt)return!1;let n=getComputedStyle(i);Rt.font=`${n.fontStyle} ${n.fontWeight} ${n.fontSize} ${n.fontFamily}`;let r=Rt.measureText(e).width,o=(parseFloat(n.paddingLeft)||0)+(parseFloat(n.paddingRight)||0)+(parseFloat(n.borderLeftWidth)||0)+(parseFloat(n.borderRightWidth)||0);return r+o<=t?!1:(i.dataset.fit="row",!0)}var Vp=["on-sale","low","sold-out","presale","closed"];function ni(i){return i==null?null:typeof i=="number"&&Number.isFinite(i)&&i>=0?i:void 0}function tr(i){return i==null?null:typeof i=="number"&&Number.isFinite(i)&&i>=0?i:void 0}function js(i){if(i==null)return null;if(typeof i!="object"||Array.isArray(i))return;let e=i,t=e.count,n=e.index;if(typeof n!="number"||!Number.isInteger(n)||n<1||typeof t!="number"||!Number.isInteger(t)||t<n)return;let r=e.remaining;if(r!=null&&(typeof r!="number"||!Number.isInteger(r)||r<0))return;let o={index:n,count:t,remaining:r??null};if(e.pricingMode!==void 0){if(e.pricingMode!=="matrix")return;o.pricingMode="matrix"}if(e.id!==void 0){if(typeof e.id!="string"||!e.id.trim())return;o.id=e.id.trim()}if(e.name!==void 0){if(typeof e.name!="string"||!e.name.trim())return;o.name=e.name.trim()}if(e.categoryKey!==void 0){if(e.categoryKey!==null&&(typeof e.categoryKey!="string"||!e.categoryKey.trim()))return;o.categoryKey=e.categoryKey==null?null:e.categoryKey.trim()}for(let s of["startsAt","endsAt"]){if(e[s]===void 0)continue;let a=tr(e[s]);if(a===void 0)return;o[s]=a}return o}function zp(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 s of e.channels){if(!s||typeof s!="object"||Array.isArray(s))return;let a=s,l=typeof a.channelId=="string"?a.channelId.trim():"";if(!l||n.has(l)||!Number.isInteger(a.pricingVersion)||a.pricingVersion<0||!Array.isArray(a.priceOverrides))return;let c=[],d=new Set;for(let u of a.priceOverrides){if(!u||typeof u!="object"||Array.isArray(u))return;let m=u,p=typeof m.categoryKey=="string"?m.categoryKey.trim():"",v=m.tierId===null?null:typeof m.tierId=="string"&&m.tierId.trim()?m.tierId.trim():void 0,g=ni(m.price);if(!p||v===void 0||g===void 0||g===null)return;let T=`${p}\0${v??""}`;if(d.has(T))return;d.add(T),c.push({categoryKey:p,tierId:v,price:g})}n.add(l),t.push({channelId:l,pricingVersion:a.pricingVersion,priceOverrides:c})}let r=[],o=new Set;for(let s of e.objects){if(!s||typeof s!="object"||Array.isArray(s))return;let a=s,l=typeof a.label=="string"?a.label.trim():"",c=typeof a.channelId=="string"?a.channelId.trim():"";if(!l||o.has(l)||!n.has(c))return;o.add(l),r.push({label:l,channelId:c})}return{assignmentVersion:e.assignmentVersion,channels:t,objects:r}}function ir(i){if(!i||typeof i!="object"||Array.isArray(i))return null;let e=i,t=Vp.find(u=>u===e.state);if(!t)return null;let n=ni(e.fromPrice),r=ni(e.previousPrice);if(n===void 0||r===void 0)return null;let o=e.currency==null?null:typeof e.currency=="string"&&e.currency.trim()?e.currency.trim():void 0;if(o===void 0)return null;let s=js(e.release);if(s===void 0)return null;let a=e.upcoming===void 0?null:js(e.upcoming);if(a===void 0)return null;let l=[];if(e.prices!=null){if(!Array.isArray(e.prices))return null;let u=[];for(let m of e.prices){if(!m||typeof m!="object"||Array.isArray(m))return null;let p=m,v=typeof p.categoryKey=="string"?p.categoryKey.trim():"";if(!v)return null;let g=ni(p.price),T=ni(p.previousPrice);if(g==null||T===void 0)return null;let S={categoryKey:v,price:g,previousPrice:T};if(p.tierId!==void 0){if(p.tierId!==null&&(typeof p.tierId!="string"||!p.tierId.trim()))return null;S.tierId=p.tierId===null?null:p.tierId.trim()}if(p.offerId!==void 0){if(typeof p.offerId!="string"||!p.offerId.trim())return null;S.offerId=p.offerId.trim()}if(p.offerName!==void 0){if(typeof p.offerName!="string"||!p.offerName.trim())return null;S.offerName=p.offerName.trim()}if(p.remaining!==void 0){if(p.remaining!==null&&(typeof p.remaining!="number"||!Number.isInteger(p.remaining)||p.remaining<0))return null;S.remaining=p.remaining==null?null:p.remaining}for(let y of["startsAt","endsAt"]){if(p[y]===void 0)continue;let P=tr(p[y]);if(P===void 0)return null;S[y]=P}u.push(S)}l=u}let c=zp(e.channelPricing);if(c===void 0)return null;let d=tr(e.nextPriceChangeAt);return d===void 0?null:{state:t,fromPrice:n,previousPrice:r,currency:o,release:s,upcoming:a,prices:l,channelPricing:c,...e.nextPriceChangeAt!==void 0?{nextPriceChangeAt:d}:{}}}function Gs(i){return i?.changed!==!1}function Ks(i,e){if(!i)return null;let t=null,n=r=>{r!=null&&r>e&&(t===null||r<t)&&(t=r)};for(let r of[i.release,i.upcoming])n(r?.startsAt),n(r?.endsAt);for(let r of i.prices)n(r.startsAt),n(r.endsAt);return n(i.nextPriceChangeAt),t}function Us(i){let e={};for(let t of i?.prices??[])if(t.tierId==null)e[t.categoryKey]=t.price;else{let n=e[t.categoryKey],r=typeof n=="number"?{base:n}:n??{};e[t.categoryKey]={...r,tiers:{...r.tiers,[t.tierId]:t.price}}}return e}function qs(i,e){let t={...i};for(let[n,r]of Object.entries(Us(e))){let o=t[n];t[n]=typeof r=="number"?r:{...typeof o=="number"?{base:o}:o,...r,tiers:{...typeof o=="object"?o.tiers:{},...r.tiers}}}return t}import{tCount as $p}from"@seatlayer/core";var Ws="maintenance_mode";function jp(i){if(!i||typeof i!="object")return!1;let e=i;return e.reason===Ws||e.code===Ws}function Gp(i){return typeof i!="number"||!Number.isFinite(i)||i<0?null:Math.max(1,Math.ceil(i/60))}function nr(i){if(!jp(i))return null;if(typeof i.notice=="string"&&i.notice.trim())return i.notice.trim();let e=Gp(i.retryAfterS);if(e===null)return b("picker.maintenancePausedShortly","Booking is paused for a few minutes for maintenance. Please try again shortly.");let t=$p("picker.maintenancePaused",e);return t==="picker.maintenancePaused"?`Booking is paused for maintenance. Please try again in about ${e} minute${e===1?"":"s"}.`:t}var Ys=["pointerdown","pointermove","keydown","wheel","touchstart"],nn=class{constructor(e){this.opts=e;this.timer=null;this.root=null;this.doc=null;this.disposed=!1;this.onInput=()=>this.touch();this.onVisibility=()=>{this.doc&&!this.doc.hidden&&this.check()};this.lastInput=this.now()}get enabled(){return this.opts.minutes>0}now(){return this.opts.now?this.opts.now():Date.now()}attach(e,t=e.ownerDocument){if(!(this.disposed||!this.enabled)){this.root=e,this.doc=t;for(let n of Ys)e.addEventListener(n,this.onInput,{capture:!0,passive:!0});t.addEventListener("visibilitychange",this.onVisibility),this.touch()}}touch(){this.lastInput=this.now(),this.arm(this.opts.minutes*6e4)}recentlyActive(){return!this.enabled||this.now()-this.lastInput<this.opts.minutes*6e4}resume(){this.disposed||this.touch()}dispose(){if(this.disposed=!0,this.clear(),this.root)for(let e of Ys)this.root.removeEventListener(e,this.onInput,{capture:!0});this.doc?.removeEventListener("visibilitychange",this.onVisibility),this.root=null,this.doc=null}arm(e){if(this.disposed||!this.enabled)return;this.clear();let t=this.opts.setTimeout??((n,r)=>setTimeout(n,r));this.timer=t(()=>{this.timer=null,this.check()},Math.max(0,e))}clear(){if(this.timer===null)return;(this.opts.clearTimeout??(t=>clearTimeout(t)))(this.timer),this.timer=null}check(){if(this.disposed||!this.enabled)return;let e=this.lastInput+this.opts.minutes*6e4-this.now();if(e>0){this.arm(e);return}if(this.opts.blocked()){this.arm(6e4);return}this.clear(),this.opts.onIdle()}};async function Zs(i,e){let t=await i.pubApi?.pickerIdleMinutes().catch(()=>null)??null;if(i.destroyed||i.idleClock)return;let n=new nn({minutes:t??30,blocked:()=>!!i.hold,onIdle:()=>Qs(i)});n.enabled&&(i.idleClock=n,n.attach(e))}function Qs(i){i.destroyed||!i.root||i.holdExpiredEl||(i.realtime?.stop(),i.realtime=null,i.showAccessPanel({reason:"idle",retryable:!0}))}async function Xs(i){if(i.destroyed)return!1;if(i.pubApi?.rotateViewerId(),i.access?.configured){let e=await i.refreshAccess();return e&&i.idleClock?.resume(),e}return i.dismissAccessPanel(),await i.controller.refresh(),i.realtime?i.realtime.restart():i.startRealtime(),i.idleClock?.resume(),!0}function Js(i){if(!i.destroyed){if(i.hold||i.idleClock?.recentlyActive()){i.pubApi?.rotateViewerId(),i.realtime?.restart();return}Qs(i)}}function ea(i,e,t=[],n=8,r=[]){let o=e.reduce((l,c)=>!c||c.width<=0||c.height<=0?l:Math.max(l,c.bottom-i.top+n),0),s=t.reduce((l,c)=>!c||c.width<=0||c.height<=0?l:Math.max(l,i.bottom-c.top+n),o>0?n:0),a=r.reduce((l,c)=>!c||c.width<=0||c.height<=0?l:Math.max(l,i.right-c.left+n),0);return{top:Math.max(0,Math.ceil(o)),right:Math.max(0,Math.ceil(a)),bottom:Math.max(0,Math.ceil(s)),left:0}}function ta(i){let e=document.createElement("div");e.className="sl-floors sl-levels on",e.setAttribute("role","group"),e.setAttribute("aria-label",i.tf("picker.chooseLevel","Choose level")),e.title=i.tf("picker.floorHelp","All levels shows the complete venue. Choose one level to inspect and select its seats.");let t=i.tf("picker.allLevels","All levels"),n=[...i.floors.map((r,o)=>({id:r.id,name:r.name,code:Kp(o)})).reverse(),{id:"",name:t,code:""}];for(let r of n){let o=document.createElement("button");if(o.type="button",o.className="sl-level",o.dataset.level=r.id,o.setAttribute("aria-pressed","false"),o.title=r.name,r.code){let a=document.createElement("b");a.className="sl-level-code",a.textContent=r.code,o.appendChild(a),o.setAttribute("aria-label",`${r.name} (${r.code})`)}let s=document.createElement("span");if(s.className="sl-level-name",s.textContent=r.name,o.appendChild(s),!r.code){let a=document.createElement("span");a.className="sl-level-short",a.setAttribute("aria-hidden","true"),a.textContent=i.tf("picker.allLevelsShort","All"),o.appendChild(a)}o.addEventListener("click",()=>i.onChoose(r.id)),e.appendChild(o)}return e.addEventListener("keydown",r=>{if(r.key!=="ArrowUp"&&r.key!=="ArrowDown")return;let o=[...e.querySelectorAll(".sl-level")],s=o.indexOf(document.activeElement);s<0||(r.preventDefault(),o[Math.max(0,Math.min(o.length-1,s+(r.key==="ArrowUp"?-1:1)))].focus())}),e}function Kp(i){return i===0?"G":String(i)}function ia(i,e,t){if(!i)return;let n=t?"":e;for(let r of i.querySelectorAll(".sl-level"))r.setAttribute("aria-pressed",String(r.dataset.level===n))}var rn=class{constructor(e){this.el=null;this.current=null;this.collapsed=!1;this.shownAt=0;this.host=e}get summary(){return this.current}adopt(e){this.current=e}get element(){return this.el}show(e){if(e&&e.id!==this.current?.id&&this.host.collapseSheet(),this.current=e,!e){this.el?.remove(),this.el=null,this.host.refreshMinimap();return}this.collapsed=this.host.controller.getRung()==="seats",this.shownAt=Date.now(),this.render(e),this.host.refreshMinimap()}render(e){this.el?.remove(),this.el=null}collapse(){!this.el||this.collapsed||!this.current||(this.collapsed=!0,this.render(this.current))}onView(){if(!(!this.el||this.collapsed||!this.current)){if(this.host.controller.getRung()==="seats"){this.collapse();return}if(Date.now()-this.shownAt<1400){this.coverage()>.25&&this.collapse();return}this.collapse()}}coverage(){let e=this.el,t=this.current,n=this.host.map();if(!e||!t||!n)return 0;let r=this.host.activeFloorObjects().find(y=>y.type==="section"&&y.id===t.id)?.outline;if(!r||r.length<3)return 0;let o=r.map(y=>this.host.controller.worldToScreen(y)),s=o.map(y=>y.x),a=o.map(y=>y.y),l=Math.min(...s),c=Math.min(...a),d=Math.max(...s)-l,u=Math.max(...a)-c;if(d<=0||u<=0)return 0;let m=n.getBoundingClientRect(),p=e.getBoundingClientRect(),v=p.left-m.left,g=p.top-m.top,T=Math.max(0,Math.min(v+p.width,l+d)-Math.max(v,l)),S=Math.max(0,Math.min(g+p.height,c+u)-Math.max(g,c));return T*S/(d*u)}};import{t as cr,tCount as oh}from"@seatlayer/core";import{contrastRatio as sh}from"@seatlayer/core/core/color";import{t as na,tCount as on}from"@seatlayer/core";function rr(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 sn=(i,e)=>rr(i,e,{dateStyle:"medium"}),an=(i,e)=>rr(i,e,{timeStyle:"short"}),It=(i,e)=>rr(i,e,{weekday:"short",day:"numeric",month:"short"});function ra(i,e,t,n){return!i.length||i.length>=e?null:{summary:n,labels:i.map(r=>`${sn(r,t)} \xB7 ${an(r,t)}`)}}function Up(i,e){let t=new Set(e);return i.map(n=>({...n,free:!t.has(n.eventKey)}))}function oa(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 qp(i,e,t="",n=!1){if(!i.length)return"";let r=i.map(o=>{let s=o.free?e.free:e.blocked,a=n&&o.free?`<input class="sl-night-choice" type="checkbox" data-pg-event-key="${E(o.eventKey)}" aria-label="${E(`${o.shortDate}: ${s}`)}" checked>`:"";return`<li class="sl-night${o.free?" ok":" no"}" aria-label="${E(`${o.shortDate}: ${s}`)}">`+a+`<i class="sl-night-dot" aria-hidden="true"></i><span class="d">${E(o.shortDate)}</span><span class="st">${E(s)}</span></li>`}).join("");return`<div class="sl-tip-nights"><div class="sl-tip-nights-title">${E(e.title)}</div><ul class="sl-nightstrip">${r}</ul><p class="sl-tip-nights-note">${E(e.notAvailableOn)}</p>`+t+"</div>"}function Wp(i){return i.selectPartialLabel&&i.pinned?`<button type="button" class="sl-tip-switch" data-pg-select-partial>${E(i.selectPartialLabel)}</button>`:i.switchLabel&&i.pinned?`<button type="button" class="sl-tip-switch" data-pg-switch-mode>${E(i.switchLabel)}</button>`:i.switchLabel||i.selectPartialLabel?"":`<p class="sl-tip-advice">${E(i.advice)}</p>`}function Yp(i){return Number(i.available)+Number(i.selected)+Number(i.partial)+Number(i.unavailable)}function sa(i,e,t){if(Yp(i)<2)return"";let n=(o,s,a="")=>`<li class="sl-pg-legend-item"><i class="sl-pg-sw ${o}"${a}></i>${E(s)}</li>`,r=[];return i.available&&r.push(n("sl-pg-sw-free",e.available,` style="background:${E(t)}"`)),i.selected&&r.push(n("sl-pg-sw-sel",e.selected)),i.partial&&r.push(n("sl-pg-sw-split",e.partial,` style="--sl-pg-sw-cat:${E(t)}"`)),i.unavailable&&r.push(n("sl-pg-sw-off",e.unavailable)),`<ul class="sl-pg-legend-list" aria-label="${E(e.title)}">${r.join("")}</ul>`}function aa(i,e){if(!i.length)return"";let t=i.map(n=>{let r=n.labels.length?n.labels.join(", "):e.empty;return`<li class="sl-pg-night-row${n.labels.length?"":" empty"}${n.active?" active":""}" role="button" tabindex="0"${n.active?' aria-current="true"':""} data-event-key="${E(n.eventKey)}"><span class="n">${E(n.name)}</span><span class="s">${E(r)}</span></li>`}).join("");return`<div class="sl-pg-nights" role="group" aria-label="${E(e.title)}"><div class="sl-pg-nights-title">${E(e.title)}</div><ul class="sl-pg-nights-list">${t}</ul></div>`}function or(i,e){if(i?.kind!=="partial"||!e?.length)return null;let t=i.data?.blockedEventKeys??[],n=Up(e,t);return{states:n,missing:n.filter(r=>!r.free).map(r=>r.shortDate)}}function la(i,e){return i?qp(i.states,{title:b("picker.group.partlyAvailableTitle","Free on some nights only"),free:b("picker.group.nightFree","Free"),blocked:b("picker.group.nightBlocked","Not available"),notAvailableOn:na("picker.group.notAvailableOn",{dates:oa(i.missing,e.locale)})},Wp({switchLabel:e.switchLabel??null,selectPartialLabel:e.selectPartialLabel??null,pinned:e.pinned,advice:b("picker.group.pickSeatFreeEveryNight","Pick a seat that is free every night.")}),!!e.selectPartialLabel&&!!e.pinned):""}function Zp(i,e,t,n){if(!i.length)return"";let r=new Set(e),o=new Set(t),s=i.map(a=>{let l=r.has(a.eventKey);return`<li class="sl-confirm-date${l?"":" blocked"}"><label><input type="checkbox" data-pg-confirm-event-key="${E(a.eventKey)}" aria-label="${E(`${a.shortDate}: ${l?n.available:n.unavailable}`)}"${l&&o.has(a.eventKey)?" checked":""}${l?"":" disabled"}><span class="sl-confirm-date-label">${E(a.shortDate)}</span><span class="sl-confirm-date-state">${E(l?n.available:n.unavailable)}</span></label></li>`}).join("");return`<fieldset class="sl-confirm-dates" data-pg-confirm-dates><legend>${E(n.title)}</legend><p class="sl-confirm-dates-copy">${E(n.copy)}</p><label class="sl-confirm-date-all"><input type="checkbox" data-pg-confirm-all><span>${E(n.selectAll)}</span></label><ul>${s}</ul><p class="sl-confirm-dates-summary" data-pg-confirm-summary aria-live="polite"></p></fieldset>`}function ca(i,e,t,n){let r=e.availableEventKeys(t);return Zp(i,r,e.includedEventKeys(),{title:n("picker.group.confirmDatesTitle","Choose performance dates"),copy:r.length===i.length?n("picker.group.confirmAllDatesCopy","This seat is available for all {count} dates. Keep all selected, or remove dates you do not want.").replace("{count}",String(i.length)):n("picker.group.confirmPartialDatesCopy","This seat is available for {available} of {total} dates. Choose one date or keep every available date.").replace("{available}",String(r.length)).replace("{total}",String(i.length)),selectAll:n("picker.group.confirmSelectAll","Select all available dates"),available:n("picker.group.nightFree","Available"),unavailable:n("picker.group.nightBlocked","Unavailable")})}function da(i){return[...i.querySelectorAll("[data-pg-confirm-event-key]")].filter(e=>e.checked&&!e.disabled).map(e=>e.dataset.pgConfirmEventKey).filter(Boolean)}function pa(i,e,t,n){let r=[...i.querySelectorAll("[data-pg-confirm-event-key]")];if(!e||!r.length)return;let o=i.querySelector(".sl-confirm-add"),s=i.querySelector("[data-pg-confirm-all]"),a=()=>{let l=r.filter(u=>!u.disabled),c=da(i).length;s&&(s.checked=c===l.length,s.indeterminate=c>0&&c<l.length);let d=i.querySelector("[data-pg-confirm-summary]");d&&(d.textContent=c===l.length?t("picker.group.confirmAllSelected","All {count} available dates are selected.").replace("{count}",String(c)):t("picker.group.confirmSelectedOfAvailable","{selected} of {available} available dates selected.").replace("{selected}",String(c)).replace("{available}",String(l.length))),o.disabled=c===0,o.textContent=c?e.label(c):t("picker.group.confirmChooseOne","Choose at least 1 date"),n()};r.forEach(l=>l.addEventListener("change",a)),s?.addEventListener("change",()=>{r.filter(l=>!l.disabled).forEach(l=>{l.checked=s.checked}),a()}),a()}async function ha(i,e,t){if(!i||!t||!i.querySelector("[data-pg-confirm-event-key]"))return!0;let n=da(i);if(!n.length)return!1;let r=i.querySelector(".sl-confirm-add");return r?.setAttribute("aria-busy","true"),r&&(r.disabled=!0),await t.apply(e,n)?!0:(r?.removeAttribute("aria-busy"),r?.isConnected&&(r.disabled=!1),!1)}function ua(i,e,t){return i?na("picker.group.seatPartlyAvailable",{label:e,free:i.states.length-i.missing.length,total:i.states.length,dates:oa(i.missing,t)}):""}function ma(i,e){let t=i.map((n,r)=>{let o=n.state==="done"?e.done:n.state==="current"?e.current:e.upcoming;return`<li class="sl-pg-step-item" data-step="${E(n.id)}" data-state="${E(n.state)}"${n.state==="current"?' aria-current="step"':""}><span class="i" aria-hidden="true">${n.state==="done"?"\u2713":String(r+1)}</span><span class="l">${E(n.label)}</span><span class="sl-pg-sr">${E(o)}</span></li>`}).join("");return`<ol class="sl-pg-steps" aria-label="${E(e.label)}">${t}</ol>`}function sr(i,e){return`<ul class="sl-pg-cards">${i.map(n=>`<li class="sl-pg-card" data-event-key="${E(n.eventKey)}"><span class="n">${E(n.name)}</span><time datetime="${E(n.iso)}"><span class="d">${E(n.date)}</span><span class="t">${E(n.time)}</span></time></li>`).join("")}</ul><p class="sl-pg-included">${E(e)}</p>`}function fa(i){let e=i.rows.map(t=>`<li class="sl-pg-pane-row${t.labels.length?"":" empty"}" data-event-key="${E(t.eventKey)}"><span class="n">${E(t.name)}</span><span class="s">${E(t.labels.length?t.labels.join(", "):i.empty)}</span></li>`).join("");return`<div class="sl-pg-pane-title">${E(i.title)}</div><ul class="sl-pg-pane-list">${e}</ul>`+(i.note?`<p class="sl-pg-pane-note">${E(i.note)}</p>`:"")+(i.total?`<div class="sl-pg-pane-total"><span>${E(i.total.label)}</span><b>${E(i.total.amount)}</b></div>`:"")+(i.holdStatus?`<p class="sl-pg-hold-status" role="status">${E(i.holdStatus)}</p>`:"")}function ga(i){let e=Math.max(0,i);return`${Math.floor(e/6e4)}:${String(Math.floor(e/1e3)%60).padStart(2,"0")}`}function ba(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?on("picker.group.performancesChosenOf",t,{chosen:i.performances,total:i.totalPerformances}):on("picker.group.seatsEveryPerformance",t)}return i.perPerformance!=null&&i.performancesChosen===i.performances?on("picker.group.seatsPerPerformance",i.seats,{per:i.perPerformance}):on("picker.group.performancesChosenOf",i.seats,{chosen:i.performancesChosen,total:i.performances})}function ya(i,e){i.querySelectorAll(".sl-pg-night-row[data-event-key]").forEach(t=>{let n=()=>e(t.dataset.eventKey);t.addEventListener("click",n),t.addEventListener("keydown",r=>{r.key!=="Enter"&&r.key!==" "||(r.preventDefault(),n())})})}import{t as Qp}from"@seatlayer/core";function Fe(i){return String(i??"\u2014").replace(/[&<>"]/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[e])}function Xp(i,e){let t=i.objectType==="table"&&!!i.bookingMode,n=i.objectType==="booth",r=t||n||!i.seatNumber,o=r?i.rowLabel??i.displayLabel??i.label:i.seatNumber,s=t?`${b("picker.guests","Guests")} ${i.bookingMode==="variable"?`${i.minOccupancy}\u2013${i.maxOccupancy}`:i.capacity}`:!n&&i.rowLabel?`${e} ${q(i)??""}`.trim():"";return`<div class="sl-tip-head"><div class="sl-tip-id"><span class="sl-tip-seat${r?" name":""}">${Fe(o)}</span>`+(s?`<span class="sl-tip-row">${Fe(s)}</span>`:"")+"</div>"+(i.sectionLabel?`<div class="sl-tip-sec"><span class="sl-tip-eyebrow">${b("picker.section","Section")}</span><span class="sl-tip-secname">${Fe(i.sectionLabel)}</span></div>`:"")+"</div>"}function va(i,e){let t=i.status==="not_for_sale",n=i.mark?.kind==="partial",r=i.status==="free"||n?"":`<span class="sl-tip-tag">${t?b("picker.notAvailable","Not available"):i.status==="held"?Qp("map.statusHeld"):b("picker.sold","Sold")}</span>`,o=t?"":e.price,s=o?`<span class="sl-tip-amt">${Fe(o)}</span>`:"",a=!o&&e.priceNote?`<div class="sl-tip-note">${Fe(e.priceNote)}</div>`:"",l=Qe(i,{compact:!0}),c=e.reason?`<div class="sl-tip-reason">${Fe(e.reason)}</div>`:"";return'<i class="sl-tip-rail" aria-hidden="true"></i>'+Xp(i,e.rowTypeWord)+`<div class="sl-tip-cat"><span class="sl-tip-dot" style="background:${Fe(i.categoryColor)}"></span><span class="sl-tip-name">${Fe(i.categoryLabel)}</span>`+r+s+"</div>"+a+c+l+(e.extra??"")}function wa(i,e,t,n){let r=i.x+14,o=i.y-n.height-12,s=i.y+18,a=o;r+n.width>e-8&&(r=i.x-n.width-14),o<8&&s+n.height<=t-8&&(a=s);let l=Math.max(8,t-n.height-8);return{left:Math.max(8,Math.min(r,Math.max(8,e-n.width-8))),top:Math.max(8,Math.min(a,l))}}function xa(i,e,t,n=22){let r=Math.max(8,Math.min(i.x-t.width/2,Math.max(8,e.width-t.width-8))),o=i.y-n-t.height,s=i.y+n;return o>=8?{left:r,top:o,placement:"above"}:s+t.height<=e.height-8?{left:r,top:s,placement:"below"}:{left:r,top:Math.max(8,Math.min(o<8?s:o,Math.max(8,e.height-t.height-8))),placement:o<8?"below":"above"}}var ar=14,Jp=12,eh=12,th=8;function ka(i,e,t,n=Jp){let r=e.height-ar-t.height,o=eh,s=r-n;if(s<=o)return{placement:"sheet",nudgeY:0};let a=(o+s)/2-i;return Math.abs(a)<=th?{placement:"sheet",nudgeY:0}:{placement:"sheet",nudgeY:Math.round(a)}}function Sa(i,e,t,n,r=0){let o=t.width/2+12,s=Math.max(o,Math.min(e.width-o,i.x)),a=i.y+r+t.height+24<=e.height,l=i.y-r<t.height+24&&a?"below":"above",c=l==="above"?i.y-r:i.y+r,d=n&&l==="above"?Math.max(t.height+24,c):c;return{left:s,top:Math.max(8,Math.min(e.height-8,d)),placement:l}}function Ta(i,e,t){let n=i.querySelector("[data-pg-select-partial]"),r=[...i.querySelectorAll("[data-pg-event-key]")],o=()=>r.filter(a=>a.checked).map(a=>a.dataset.pgEventKey).filter(Boolean),s=()=>{if(!n)return;let a=o().length;n.disabled=a===0,n.textContent=e?.(a)??n.textContent};r.forEach(a=>{a.addEventListener("change",s);let l=a.closest(".sl-night");l?.classList.add("selectable"),l?.addEventListener("click",c=>{c.target!==a&&(a.checked=!a.checked,s())})}),n?.addEventListener("click",()=>{let a=o();a.length&&t?.(a)})}function it(i){let e=i?.displayType?.trim()||i?.rowType?.trim();return e||(i?.objectType==="table"?b("picker.table","Table"):i?.objectType==="booth"?b("picker.booth","Booth"):b("picker.row","Row"))}var ih="sl-confirm-scrim",nh="--sl-scrim-mask";function rh(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 Ea(i,e,t,n){let r=i??document.createElement("div");return i||(r.className=ih),r.style.setProperty(nh,rh(n)),t.parentNode===e?r.nextSibling!==t&&e.insertBefore(r,t):r.parentNode!==e&&e.appendChild(r),r}function lr(i){return i?.remove(),null}var Ca={passport:!1,compare:!1},ah=360,lh=160,ch=700,Aa=450,dh=8;function Pa(){try{return globalThis.matchMedia?.("(pointer: coarse)").matches??!1}catch{return!1}}function ph(i){return sh("#ffffff",i)>=3?"#ffffff":"#0b0f19"}var ln=class{constructor(e){this.el=null;this.seat=null;this.outsideTap=null;this.scrim=null;this.shownAt=0;this.lift=null;this.framing=null;this.mode="add";this.host=e}get element(){return this.el}set element(e){this.el=e}get candidate(){return this.seat}set candidate(e){this.seat=e}thumbHtml(e){let t=this.host.controller.doc;if(!t)return"";let n=Mt(e)?e.viewUrl??"":"",r=Ji(t);if(!n&&!r)return"";let o=n?null:en(e,e.focalPoint??t.focalPoint);if(!n&&o==null)return"";let s="";if(!n)return s;let a=_(cr("picker.viewFromSeat",{label:e.label})),l=_(this.host.tf("picker.viewFromHere","View from here"));return`<button type="button" class="sl-confirm-view sl-confirm-thumbwrap" aria-label="${a}"><img class="sl-confirm-thumb" alt="" /><span class="sl-confirm-thumb-badge">\u{1F52D} ${l}</span></button>`+s}show(e,t="add"){let n=this.host;this.mode=t;let r=this.seat?.id;this.el?.remove(),this.el=null,this.seat=e,n.root()?.setAttribute("data-confirming","true"),n.els().side?.toggleAttribute("inert",!0),Object.values(n.regions()).forEach(A=>A.toggleAttribute("inert",!0)),n.controller.setSelectionFocus(e.id),r&&r!==e.id&&n.controller.deselect([r]),n.hideTooltip();let o=n.controller.seatDetails(e.id),s=n.controller.doc?.categories.find(A=>A.key===e.categoryKey),a=o?.price??(s?.tiers?.length?s.tiers[0].price:s?.price),l=a!=null?n.paidPrice(e.categoryKey,o?.tierId??s?.tiers?.[0]?.id??null,a,e.label):void 0,c=xo(o,e.displayLabel??e.label,it(o)),d=o?.tiers??s?.tiers??[],u=o?.tierId??d[0]?.id,m=n.suppressPricing()?"":Li(d,u,A=>n.money(n.paidPrice(e.categoryKey,A.id,A.price,e.label)),A=>n.offerName(e.categoryKey,A.id)),p=n.buyerView()==="venue3d",v=n.performanceGroup()?.confirmDateSelection??void 0,g=v?n.performanceGroup()?.nights?.()??[]:[],T=v?ca(g,v,e.id,(A,I)=>n.tf(A,I)):"";this.shownAt=performance.now();let S=document.createElement("div");S.className="sl-confirm sl-mo-in",t==="remove"&&S.classList.add("sl-confirm-removing"),T&&S.classList.add("sl-confirm-group-dates"),S.setAttribute("role","dialog"),S.setAttribute("aria-label",cr("picker.confirmSeatLabel",{label:e.label}));let y=n.controller.getRenderer?.()?.categoryDisplayColor?.(e.categoryKey)??s?.color??"#6e7bff";S.style.setProperty("--sl-cat",y),S.style.setProperty("--sl-cat-ink",ph(y));let P=String(o?.categoryLabel??s?.label??e.categoryKey),R=n.controller.categoryAvailability()[e.categoryKey],G=typeof R=="number"&&R>0?oh("picker.leftCount",R):"",f=n.suppressPricing()?`${o?.displayLabel??e.displayLabel??e.label}`:`${o?.displayLabel??e.displayLabel??e.label} \xB7 ${l==null?n.tf("picker.priceNotSupplied","Price not supplied"):n.money(l)}`,L=Ca.passport?wo(e,f,p):"",D=Ca.compare?vo(e,p?n.view3dCompareSeatIds():null):"";S.innerHTML=Eo({identityFields:c,identity:ko(o,e.displayLabel??e.label,it(o)),marker:yo({...o?.wheelchairSpaceType?{wheelchairSpaceType:o.wheelchairSpaceType}:{}}),see3dPill:So(n.canOffer3d(),p),categoryColor:y,categoryLabel:P,priceLabel:!n.suppressPricing()&&l!=null?n.money(l):"",categoryLeftLabel:G,tierChoices:m,groupDates:T,wheelchair:"",commercial:Qe({...e.accessibility?.length?{accessibility:e.accessibility}:{},...o?.wheelchairSpaceType?{wheelchairSpaceType:o.wheelchairSpaceType}:{},...e.commercial?{commercial:e.commercial}:{},...o?.aisle?{aisle:!0}:{},...o?.boothType?{boothType:o.boothType}:{},...o?.entrance?{entrance:o.entrance}:{}}),thumb:n.seatViewEnabled()&&n.buyerView()!=="venue3d"?this.thumbHtml(e):"",inspect:p?`<div class="sl-confirm-inspect-row">${L}${D}${In(n.canOffer3d(),p)}</div>`:In(n.canOffer3d(),p),see3dRow:To(n.canOffer3d(),p),cancelLabel:cr("common.cancel"),selectLabel:t==="remove"?n.tf("picker.removeSeat","Remove seat"):n.addSeatLabel(o?.objectType)}),t==="remove"&&S.querySelector(".sl-confirm-add svg path")?.setAttribute("d","M6 6l12 12M18 6L6 18"),n.els().map.appendChild(S),this.el=S;let M=S.querySelector(".sl-confirm-thumb"),O=M?.closest(".sl-confirm-thumbwrap")??null;if(M&&O){let A=!1,I=()=>{if(A||!O.isConnected)return;A=!0;let $=()=>{O.remove(),this.el===S&&n.reanchor()};if(n.reducedMotion()||typeof requestAnimationFrame!="function"){$();return}O.style.height=`${O.offsetHeight}px`,O.classList.add("sl-confirm-thumb-out"),requestAnimationFrame(()=>{O.style.height="0px",O.style.opacity="0"}),setTimeout($,lh)};M.addEventListener("error",I),M.addEventListener("load",()=>{M.naturalWidth||I()});let j=e.viewMeta?.previewUrl??e.viewUrl;j?n.resolveAssetUrl(j).then($=>{if(!(!S.isConnected||this.el!==S)){if(!$){I();return}M.src=$}}).catch($=>{I(),n.onError($)}):I()}n.reanchor(),this.liftSeatClearOfSheet(e),S.querySelector(".sl-confirm-view")?.addEventListener("click",()=>{n.openSeatView(e)}),S.querySelector(".sl-confirm-confidence")?.addEventListener("click",A=>{n.openSeatConfidencePassport(e,A.currentTarget instanceof HTMLElement?A.currentTarget:null)}),S.querySelector(".sl-confirm-compare")?.addEventListener("click",()=>n.saveView3dComparisonSeat(e)),S.querySelectorAll("[data-confirm-tier]").forEach(A=>{A.addEventListener("click",()=>{let I=A.dataset.confirmTier,j=d.find(de=>de.id===I);if(!j)return;n.controller.setSeatTier(e.id,j.id),S.querySelectorAll("[data-confirm-tier]").forEach(de=>{de.setAttribute("aria-pressed",String(de===A))});let $=S.querySelector(".sl-confirm-price");$&&($.textContent=n.money(n.paidPrice(e.categoryKey,j.id,j.price,e.label))),n.reanchor()})}),S.querySelectorAll(".sl-confirm-3d,.sl-confirm-3dpill,.sl-confirm-3drow").forEach(A=>{A.addEventListener("pointerdown",vi,{once:!0}),A.addEventListener("click",()=>{n.buyerView()==="venue3d"?(n.dismiss(),n.view3dHandle()?.flyToSeat(e.id)):(n.rememberView3dReturnSeat(e),n.dismiss(),n.enter3d(e.id))})}),pa(S,v,(A,I)=>n.tf(A,I),()=>n.reanchor()),S.querySelector(".sl-confirm-add").addEventListener("click",()=>{if(!this.ghostActivation()){if(this.mode==="remove"){this.removeCommitted();return}this.commit()}}),S.querySelector(".sl-confirm-cancel").addEventListener("click",()=>{this.ghostActivation()||this.cancel()}),this.armOutsideTap(S),requestAnimationFrame(()=>{let A=S.querySelector(".sl-confirm-add");A?.focus(),n.liftToastOverConfirm(),n.fitTranslatedRows(),n.inviteCommit(S,A)})}liftSeatClearOfSheet(e){let t=this.host.controller.getRenderer();this.framing={gestures:t?.getCameraGestureCount?.()??0,quietUntil:0},this.frameSeatForSheet(e)}frameSeatForSheet(e){let t=this.host,n=t.root();if(!this.el||n?.dataset.layout!=="narrow"||n?.dataset.view3d==="on")return;let r=t.els().map;if(!r)return;let o=t.controller.worldToScreen({x:e.x,y:e.y}),s=t.controller.getRenderer(),a=s?.getCameraGestureCount?.()??0,{nudgeY:l}=ka(o.y,{height:r.clientHeight},{height:this.el.offsetHeight||230}),c=this.lift&&this.lift.gestures===a?this.lift.dy:0;if(!l){this.lift=c?{dy:c,gestures:a}:null;return}let d=!t.reducedMotion();s?.panScreenBy?.({x:0,y:l},{animate:d}),this.lift={dy:c+l,gestures:a},this.framing&&(this.framing.gestures=a,this.framing.quietUntil=d?this.now()+ch:0)}reframeSeatForSheet(){let e=this.framing,t=this.seat;!e||!t||e.quietUntil&&this.now()<e.quietUntil||(this.host.controller.getRenderer()?.getCameraGestureCount?.()??e.gestures)!==e.gestures||this.frameSeatForSheet(t)}now(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}settleLift(){let e=this.lift;if(this.lift=null,this.framing=null,!e)return;let t=this.host.controller.getRenderer();(t?.getCameraGestureCount?.()??e.gestures)===e.gestures&&t?.panScreenBy?.({x:0,y:-e.dy},{animate:!this.host.reducedMotion()})}reanchor(){let e=this.host;if(!this.el||!this.seat||e.root()?.dataset.view3d==="on")return;let t=e.controller.worldToScreen({x:this.seat.x,y:this.seat.y}),n=e.els().map;if(e.root()?.dataset.layout==="narrow"){this.el.removeAttribute("data-placement"),this.el.style.removeProperty("bottom"),this.scrim=Ea(this.scrim,n,this.el,t),Zo(this.el,t,n),e.liftToastOverConfirm(),this.reframeSeatForSheet();return}this.scrim=lr(this.scrim);let r=n.clientWidth,o=n.clientHeight,s=this.el.offsetWidth||276,a=this.el.offsetHeight||230,l=this.el.classList.contains("sl-confirm-group-dates"),c=e.controller.seatScreenRadius()*1.5,d=Sa(t,{width:r,height:o},{width:s,height:a},l,c);this.el.dataset.placement=d.placement,this.el.style.left=`${d.left}px`,this.el.style.top=`${d.top}px`,$i(this.el,t,{left:d.left,top:d.top,width:s,height:a})}ghostActivation(){return Pa()?performance.now()-this.shownAt<Aa:!1}armOutsideTap(e){this.disarmOutsideTap();let t=this.host,n=new Map,r=s=>{if(this.el!==e){this.disarmOutsideTap();return}let a=s.target,l=s;if(s.type!=="pointerdown"){let d=n.get(l.pointerId);n.delete(l.pointerId),d&&s.type==="pointerup"&&n.size===0&&Math.hypot(l.clientX-d.x,l.clientY-d.y)<=dh&&this.cancel();return}if(!(!a||e.contains(a)||t.els().tray?.contains(a))){if(a instanceof Element&&a.closest(".sl-view3d")){if(n.set(l.pointerId,{x:l.clientX,y:l.clientY}),n.size>1)for(let d of n.keys())n.set(d,{x:Number.NaN,y:Number.NaN});return}this.cancel()}};this.outsideTap=r;let o=t.root();setTimeout(()=>{this.outsideTap===r&&((o??document).addEventListener("pointerdown",r,!0),(o??document).addEventListener("pointerup",r,!0),(o??document).addEventListener("pointercancel",r,!0))},Pa()?Aa:0)}disarmOutsideTap(){if(!this.outsideTap)return;let e=this.outsideTap;this.outsideTap=null;for(let t of["pointerdown","pointerup","pointercancel"])(this.host.root()??document).removeEventListener(t,e,!0),document.removeEventListener(t,e,!0)}dismiss(){let e=this.host;this.disarmOutsideTap(),this.scrim=lr(this.scrim),this.settleLift(),this.el&&ji(this.el),this.el=null,this.seat=null,e.liftToastOverConfirm(),e.root()?.removeAttribute("data-confirming"),Object.values(e.regions()).forEach(t=>t.toggleAttribute("inert",!1)),e.applyPanelCollapsed(),e.controller.setSelectionFocus(null),e.syncTray()}async commit(){let e=this.host,t=this.seat;if(!t)return;let r=this.el?.querySelector(".sl-confirm-add")??null;if(r?.classList.contains("is-adding")||!await ha(this.el,t.id,e.performanceGroup()?.confirmDateSelection??void 0))return;e.collapseSectionCard(),this.seat=null,e.syncTray(),e.syncSelectionTo3d();let o=()=>{let l=e.root()?.dataset.layout==="narrow"?this.lift:null;l&&(this.lift=null),e.dismiss();let c=e.controller.worldToScreen(t);Yn(e.els(),c,t,e.controller.doc?.categories,()=>{e.cartLanded?.(),l&&(this.lift=l,this.settleLift())})};if(!r||e.reducedMotion()){o();return}r.classList.remove("sl-confirm-add-invite"),r.classList.add("is-adding"),r.setAttribute("aria-disabled","true");let s=r.querySelector(".sl-confirm-add-t");s&&(s.textContent=e.tf("picker.added","Added")),e.scheduleMotion(o,ah)}cancel(){let e=this.host,t=this.seat;t&&(this.mode!=="remove"&&e.controller.deselect([t.id]),this.seat&&e.dismiss(),e.syncSelectionTo3d(),e.root()?.focus({preventScroll:!0}))}removeCommitted(){let e=this.host,t=this.seat;if(!t)return;let n=e.releaseHeldSeat(t);n||e.controller.deselect([t.id]),e.dismiss(),e.syncTray(),e.syncSelectionTo3d(),e.root()?.focus({preventScroll:!0})}};function La(i,e,t){if(!e||t||i.classList.contains("sl-confirm-removing"))return;e.classList.add("sl-confirm-add-invite");let n=()=>e.classList.remove("sl-confirm-add-invite");i.addEventListener("pointerdown",n,{once:!0}),i.addEventListener("keydown",n,{once:!0}),e.addEventListener("focus",n,{once:!0})}function Ma(i,e){return i&&i!=="seat"?e("picker.select","Select"):e("picker.addSeat","Add seat")}import{t as dr}from"@seatlayer/core";var hh=12;function Ha(i,e){let t=e.floors(),n=new Set(t.map(f=>f.label.trim().toLocaleLowerCase())),r=e.zones().filter(f=>f.seatCount>0&&!n.has(f.label.trim().toLocaleLowerCase())),o=e.sections().filter(f=>f.seatCount>0&&!n.has(f.label.trim().toLocaleLowerCase())),s=r.length>1?[]:o,a=t.length>1,l=r.length>1,c=s.length>1;if(!a&&!l&&!c)return null;let d=document.createElement("div");d.className="sl-view3d-nav";let u=null,m=document.createElement("button");m.type="button",m.className="sl-view3d-nav-toggle",m.setAttribute("aria-expanded","false");let p='<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>',v=document.createElement("span");m.innerHTML=p,m.appendChild(v);let g=()=>{for(let f of d.querySelectorAll(":scope > div")){let L=f.querySelector('[aria-pressed="true"]');!L||f.scrollWidth<=f.clientWidth||L.scrollIntoView({block:"nearest",inline:"nearest"})}},T=()=>{if(u)return u;for(let f of d.querySelectorAll(":scope > div")){let L=f.querySelector('button[aria-pressed="true"]'),D=L?.textContent?.trim();if(D&&L?.dataset.floor!=="")return D}return a&&(l||c)?b("picker.levelsAndAreas","Levels & areas"):a?b("picker.levels","Levels"):b("picker.areas","Areas")},S=f=>{d.classList.toggle("is-open",f),m.setAttribute("aria-expanded",String(f)),f&&typeof requestAnimationFrame=="function"&&requestAnimationFrame(g),v.textContent=T()};m.addEventListener("click",()=>S(!d.classList.contains("is-open"))),d.addEventListener("keydown",f=>{f.key!=="Escape"||!d.classList.contains("is-open")||(f.preventDefault(),f.stopPropagation(),S(!1),m.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 P=b("picker.closeVenueNavigation","Close venue navigation");y.setAttribute("aria-label",P),y.title=P,y.addEventListener("click",()=>{S(!1),m.focus()}),S(!1),d.appendChild(m);let R=f=>{},G=f=>{};if(a){let f=document.createElement("div");f.setAttribute("role","group"),f.setAttribute("aria-label",b("picker.levels","Levels"));let L=[];G=O=>{L.forEach(A=>{A.setAttribute("aria-pressed",String((A.dataset.floor===""?null:Number(A.dataset.floor))===O))})};let D=O=>{e.focusFloor(O)&&(G(O),R(O))},M=(O,A)=>{let I=document.createElement("button");I.type="button",I.textContent=O,I.dataset.floor=A===null?"":String(A),I.setAttribute("aria-pressed",String(A===null)),I.addEventListener("click",()=>{D(A),S(!1)}),L.push(I),f.appendChild(I)};M(b("picker.allLevels","All levels"),null);for(let O of t)M(O.label||dr("picker.levelNumber",{number:O.index+1}),O.index);d.appendChild(f)}if(l||c){let f=document.createElement("div");f.setAttribute("role","group"),f.setAttribute("aria-label",b("picker.areas","Areas"));let L=l?r.map(M=>({id:M.id,label:M.label||M.id,go:()=>{e.focusZone(M.id)}})):s.map(M=>({id:M.id,label:M.label||M.id,floorIndex:M.floorIndex,go:()=>{e.focusSection(M.id),Number.isFinite(M.floorIndex)&&G(M.floorIndex)}})),D=M=>{let O=l||M===null?L:L.filter(A=>A.floorIndex===void 0||A.floorIndex===M);if(f.replaceChildren(),!O.length){f.remove();return}if(f.isConnected||d.insertBefore(f,y.isConnected?y:null),!l&&O.length>hh){let A=document.createElement("select");A.setAttribute("aria-label",b("picker.jumpToSection","Jump to section"));let I=document.createElement("option");I.value="",I.textContent=b("picker.jumpToSection","Jump to section"),A.appendChild(I);for(let j of O){let $=document.createElement("option");$.value=j.id,$.textContent=j.label,A.appendChild($)}A.addEventListener("change",()=>{O.find(j=>j.id===A.value)?.go()}),f.appendChild(A);return}for(let A of O){let I=document.createElement("button");I.type="button",I.textContent=A.label,I.dataset.area=A.id,I.addEventListener("click",()=>{u=A.label,A.go(),S(!1)}),f.appendChild(I)}};R=D,D(null)}return d.appendChild(y),i.appendChild(d),d}var cn=class{constructor(e){this.host=e;this.chip=null}sync(){let e=this.host.overlay();if(!e||this.host.savedSeatIds().length===0){this.chip?.remove(),this.chip=null;return}let t=this.chip;if(!t){t=document.createElement("div"),t.className="sl-view3d-compare-saved",t.setAttribute("role","group"),t.setAttribute("aria-label",b("picker.savedSeatComparison","Saved seat comparison"));let o=document.createElement("button");o.type="button",o.className="main",o.addEventListener("click",()=>{this.host.savedSeatIds().length>1?this.host.openComparison():this.host.toast(b("picker.chooseAnotherToCompare","Choose another seat to compare."),"neutral")});let s=document.createElement("button");s.type="button",s.className="clear",s.textContent="\xD7",s.setAttribute("aria-label",b("picker.clearSavedSeatComparison","Clear saved seat comparison")),s.addEventListener("click",()=>this.host.clearComparison()),t.append(o,s),e.appendChild(t),this.chip=t}let n=this.host.savedSeatIds().length,r=t.querySelector(".main");r&&(r.textContent=n>1?dr("picker.compareCount",{count:n}):b("picker.oneSeatSaved","1 seat saved"),r.setAttribute("aria-label",n>1?dr("picker.openComparisonOfSeats",{count:n}):b("picker.oneSeatSavedChooseAnother","One seat saved; choose another to compare")))}remove(){this.chip?.remove(),this.chip=null}mainButton(){return this.chip?.querySelector(".main")??null}};function Ra(i){return!i?.querySelector('[data-ref="zfs"]')}var Ia="sl:sheet-hint";function Oa(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(),450),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"),uh(i.root)},700)}function uh(i){if(!i||i.dataset.layout!=="narrow")return;try{if(window.sessionStorage.getItem(Ia))return;window.sessionStorage.setItem(Ia,"1")}catch{}let e=i.querySelector(".sl-sheet-toggle");e&&(e.classList.add("sl-mo-hint"),e.addEventListener("animationend",()=>e.classList.remove("sl-mo-hint"),{once:!0}))}function _a(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 dn(i){let e=i.committedSelection(),t=i.controller.getGAAreas(),n=i.hold?.items??[],r=new Set(n.map(m=>m.label)),o=ns(i,t,n),s=Be(i.gaQty,n),a=n.reduce((m,p)=>m+i.paidPrice(p.categoryKey,p.tierId,p.unitPrice,p.label)*(p.quantity??1),0),l=n.reduce((m,p)=>m+(p.quantity??1),0),c=e.filter(m=>!r.has(m.label)),d=c.reduce((m,p)=>m+i.paidPrice(p.categoryKey,p.tierId??null,p.price,p.label)*(p.quantity??1),0)+o+a,u=c.reduce((m,p)=>m+(p.quantity??1),0)+s+l;return{seats:e,freshSeats:c,gaAreas:t,heldItems:n,heldLabels:r,heldCount:l,total:d,count:u}}function pn(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 hn(i,e){let t=e.tiers?.length?e.tiers.map(n=>i.paidPrice(e.key,n.id??null,n.price)):e.price==null?[]:[i.paidPrice(e.key,null,e.price)];if(e.key)for(let n of i.pricesByChannel.values())for(let r of n)r.categoryKey===e.key&&t.push(r.price);return t.length?{min:Math.min(...t),max:Math.max(...t)}:void 0}var ri="seatlayer_";function mh(){let i=globalThis;return i.document?.modelContext??i.navigator?.modelContext??null}function ce(i,e){return e?{ok:!1,reason:i,message:e}:{ok:!1,reason:i}}function fh(i){return Array.isArray(i)?i.filter(e=>typeof e=="string"&&!!e):[]}function gh(i,e){let t=i.event();if(!t)return ce("not_loaded","The seat map has not finished loading.");let n=i.selectionLimits();return{ok:!0,event:t,selection:{max:n.max,...n.required!=null?{required:n.required}:{}},categories:i.categories(),zones:i.zones(),hasPremiumSeats:i.hasPremiumSeats(),holdsAllowed:e}}function Na(i,e){let t=r=>!!r&&r.toLowerCase()===e.toLowerCase(),n=i.find(r=>t(r.key??r.id))??i.find(r=>t(r.label));return n?.key??n?.id??null}function Da(i,e){let t=e.map(n=>i.describeSeat(n.id));return{seatIds:e.map(n=>n.id),labels:e.map(n=>n.label),section:t[0]?.section??"",row:t[0]?.row??"",seats:e.map((n,r)=>t[r]?.seat||n.label),category:t[0]?.category??e[0].categoryKey,unitPrice:e[0].price,total:e.reduce((n,r)=>n+r.price,0)}}function bh(i,e,t){let n=new Map;for(let o of e){let s=n.get(o.rowKey);s?s.push(o):n.set(o.rowKey,[o])}let r=[];for(let o of n.values()){let s=[...o].sort((l,c)=>l.index-c.index),a=0;for(let l=1;l<=s.length;l++)if(l===s.length||s[l].index!==s[l-1].index+1||s[l].categoryKey!==s[l-1].categoryKey){for(let d=a;d+t<=l;d+=t)r.push(Da(i,s.slice(d,d+t)));a=l}}return r}function yh(i,e,t){let n=new Map;for(let o of e){let s=n.get(o.sectionKey);s?s.push(o):n.set(o.sectionKey,[o])}let r=[];for(let o of n.values()){if(o.length<t)continue;let s=[...o].sort((a,l)=>a.price!==l.price?l.price-a.price:a.rowKey.localeCompare(l.rowKey)||a.index-l.index);r.push(Da(i,s.slice(0,t)))}return r}function vh(i,e){if(!i.event())return ce("not_loaded","The seat map has not finished loading.");let n=i.selectionLimits(),r=Math.floor(Number(e.count));if(!Number.isInteger(r)||r<1||r>n.max)return ce("bad_count",`count must be a whole number between 1 and ${n.max}.`);let o=Number.isInteger(Number(e.limit))?Math.max(1,Math.min(20,Number(e.limit))):5,s=e.together===void 0?!0:!!e.together,a=typeof e.max_price=="number"&&Number.isFinite(e.max_price)?e.max_price:null,l=typeof e.category=="string"&&e.category?e.category:null,c=typeof e.zone=="string"&&e.zone?e.zone:null,d=l?Na(i.categories(),l):null;if(l&&!d)return ce("no_match",`No ticket type called "${l}".`);if(d&&i.categories().find(g=>g.key===d)?.available===0)return ce("sold_out",`"${l}" is sold out.`);let u=c?Na(i.zones(),c):null;if(c&&!u)return ce("no_match",`No zone called "${c}".`);let m=i.seats().filter(g=>g.available);if(!m.length)return ce("sold_out");let p=m.filter(g=>(!d||g.categoryKey===d)&&(!u||g.zoneId===u)&&(a==null||g.price<=a));if(!p.length)return ce("no_match");let v=s?bh(i,p,r):yh(i,p,r);return v.length?(v.sort((g,T)=>T.unitPrice!==g.unitPrice?T.unitPrice-g.unitPrice:g.row.localeCompare(T.row)||g.labels[0].localeCompare(T.labels[0])),{ok:!0,groups:v.slice(0,o),searched:{count:r,filters:{...a!=null?{max_price:a}:{},...d?{category:d}:{},...u?{zone:u}:{},together:s}}}):ce(s?"not_enough_together":"no_match")}function Ba(i){return{ok:!0,...i.selection()}}function wh(i,e){let t=i.event();if(!t)return ce("not_loaded","The seat map has not finished loading.");if(t.salesClosed)return ce("event_closed","Sales are closed for this event.");let n=fh(e.seat_ids);return n.length?(i.clearSelection(),i.selectObjects(n),Ba(i)):ce("nothing_requested","Pass one or more seat ids or labels in seat_ids.")}function xh(i,e){let t=async r=>{try{return await r()}catch(o){return ce("error",o instanceof Error?o.message:String(o))}},n=[{name:`${ri}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(()=>gh(i,e))},{name:`${ri}find_seats`,title:"Find available seats",description:"Search the seat map for groups of available seats. Read-only: it never selects, holds or reserves anything. Returns candidate groups with their seat ids, prices and location.",inputSchema:{type:"object",properties:{count:{type:"integer",minimum:1,description:"How many seats are needed."},max_price:{type:"number",description:"Highest acceptable price per seat."},category:{type:"string",description:"Ticket type key or label to restrict the search to."},zone:{type:"string",description:"Zone id or label to restrict the search to."},together:{type:"boolean",description:"Require the seats to be side by side in one row (default true)."},limit:{type:"integer",minimum:1,maximum:20,description:"How many candidate groups to return (default 5)."}},required:["count"],additionalProperties:!1},annotations:{readOnlyHint:!0,untrustedContentHint:!0},execute:r=>t(()=>vh(i,r))},{name:`${ri}select_seats`,title:"Select seats on the map",description:"Replace the current selection with the given seats, exactly as tapping them would. The buyer sees the seats light up and the basket update. No reservation is made.",inputSchema:{type:"object",properties:{seat_ids:{type:"array",items:{type:"string"},description:"Seat ids or labels, e.g. from find_seats."}},required:["seat_ids"],additionalProperties:!1},annotations:{readOnlyHint:!1,untrustedContentHint:!0},execute:r=>t(()=>wh(i,r))},{name:`${ri}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(()=>Ba(i))}];return e&&n.push({name:`${ri}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 Fa(i,e={}){let t=mh();if(!t||typeof t.registerTool!="function")return null;let n=new AbortController,r=xh(i,!!e.holds),o=[],s=e.exposedTo?.length?[...new Set(e.exposedTo)]:void 0;try{for(let a of r)await t.registerTool(a,{signal:n.signal,...s?{exposedTo:s}:{}}),o.push(a.name)}catch(a){console.warn("seatmap: WebMCP tools could not be registered",a)}return o.length?{names:o,dispose:()=>{if(n.abort(),typeof t.unregisterTool=="function")for(let a of o)try{t.unregisterTool(a)}catch{}}}:null}async function Va(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 Fa(hr(i,t),{holds:t,exposedTo:n}),i.destroyed&&pr(i)}catch(r){console.warn("seatmap: WebMCP registration failed",r)}}function pr(i){i.webMcp?.dispose(),i.webMcp=null}function hr(i,e){let t=(n,r)=>{if(Number.isInteger(n.logicalSeatIndex))return n.logicalSeatIndex;let o=n.id.lastIndexOf(":"),s=o<0?NaN:Number(n.id.slice(o+1));return Number.isFinite(s)?s:r};return{event:()=>{let n=i.renderInfo;return n?{name:n.eventName??"",venue:n.venue??null,startsAt:n.startsAt??null,timezone:n.timezone??null,currency:i.currency,salesClosed:i.salesClosed}:null},selectionLimits:()=>({max:i.maxTickets,required:i.exactTickets}),categories:()=>{let n=i.controller.categoryAvailability();return(i.controller.doc?.categories??[]).filter(r=>!r.notForSale).map(r=>{let o=hn(i,r),s=pn(i,r);return{key:r.key,label:r.label??r.key,...s===void 0?{}:{price:s},...o&&o.min!==o.max?{priceRange:o}:{},available:n[r.key]??0}})},zones:()=>i.controller.getBestAvailableZones(),hasPremiumSeats:()=>i.controller.hasPremiumSeats(),seats:()=>{let n=i.controller.getActiveFloorId(),r=[];return i.allSeats().forEach((o,s)=>{if(o.floorId&&n&&o.floorId!==n)return;let a=i.controller.getStatus(o.id)??"free",l=i.controller.doc?.categories.find(d=>d.key===o.categoryKey),c=l?.tiers?.length?l.tiers[0].price:l?.price??0;r.push({id:o.id,label:o.label,rowKey:o.logicalRowId??o.rowId,sectionKey:o.sectionId??o.rowId,index:t(o,s),categoryKey:o.categoryKey,price:i.paidPrice(o.categoryKey,l?.tiers?.[0]?.id??null,c,o.label),...o.zoneId?{zoneId:o.zoneId}:{},available:a==="free"&&!l?.notForSale})}),r},describeSeat:n=>{let r=i.controller.seatDetails(n);return r?{section:r.sectionLabel??"",row:q(r)??"",seat:r.seatNumber??r.label,category:r.categoryLabel??r.categoryKey}:null},selection:()=>{let{freshSeats:n,total:r,count:o}=dn(i);return{seats:n.map(s=>({id:s.id,label:s.label,section:s.sectionLabel??"",row:q(s)??"",seat:s.seatNumber??s.label,category:s.categoryKey,price:i.paidPrice(s.categoryKey,s.tierId??null,s.price,s.label)})),count:o,total:r,currency:i.currency,hold:i.hold?{id:i.hold.holdId,expiresAt:i.hold.expiresAt}:null,validity:i.getSelectionValidity()}},clearSelection:()=>i.clearSelection(),selectObjects:n=>{i.selectObjects(n)},hold:()=>e?kh(i):Promise.resolve({ok:!1,reason:"not_allowed"})}}async function kh(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 za(i,e){if(e.objectType!=="seat"&&e.objectType!=="booth")return null;let t=i.seatByLabel(e.label),n=t?i.toSeat(t).tiers:void 0;return n&&n.length>1?n:null}async function $a(i,e,t,n){let r=i.currentHold(),o=r?.items??[],s=o.find(c=>c.label===e);if(!r||!s||s.tierId===t)return null;let a=o.map(c=>({label:c.label,tierId:c.label===e?t:c.tierId,...c.quantity!=null?{quantity:c.quantity}:{}})),l=await i.api.hold(i.key,a,n,r.holdId);return i.setHold({holdId:l.holdId,labels:a.map(c=>c.label),expiresAt:l.expiresAt,items:l.items}),i.currentHold()}function ur(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 ja(i,e){ve({apiBase:i.apiBase,event:i.eventKey,scope:i.metricScope,surface:i.surface,outcome:"success",ms:i.ms,performanceProfile:i.performanceProfile,seats:i.seatCount,floors:i.floorCount,view:i.view,load:i.load,transport:i.transport,revealWaitMs:i.revealWaitMs,handoverMs:i.handoverMs}),e("chart_rendered",ur(i))}import{seatConfidenceDisclosure as Sh}from"@seatlayer/core/core/seatConfidence";function te(i){return String(i??"").replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#39;")}function Ga(i){let e=Sh(i.seat.confidenceEvidence),t=i.seat.confidenceEvidence,n=e.limitations.length?`<h4>Known limits</h4><ul>${e.limitations.map(c=>`<li>${te(c)}</li>`).join("")}</ul>`:"",r=e.modeledTarget?`<div><dt>Modeled target</dt><dd>${te(e.modeledTarget)}</dd></div>`:"",o=t?`<div><dt>Evidence ID</dt><dd>${te(t.evidenceId)}</dd></div><div><dt>Model version</dt><dd>${te(t.modelVersion)}</dd></div><div><dt>Event configuration</dt><dd>${te(t.eventConfigurationId??"Not configuration-specific")}</dd></div><div><dt>Approval</dt><dd>${te(t.approvedByRole??"No external approval supplied")}</dd></div>`+(t.validUntil?`<div><dt>Valid until</dt><dd>${te(t.validUntil.slice(0,10))}</dd></div>`:""):"<div><dt>Evidence ID</dt><dd>None supplied</dd></div>",s=Pi(i.seat.commercial).join(" \xB7 ")||i.restrictionFallback,a=`<div><dt>View restriction</dt><dd>${te(s)}</dd></div>`+(i.seat.commercial?.note?`<div><dt>Organizer note</dt><dd>${te(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">${te(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>${te(e.headline)}</strong><span>${te(e.coverage)} \xB7 ${te(e.freshness)}</span></div><dl><div><dt>Model status</dt><dd>${te(e.model)}</dd></div><div><dt>Reality evidence</dt><dd>${te(e.reality)}</dd></div><div><dt>Source</dt><dd>${te(e.provenance)}</dd></div>`+a+r+o+`</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 Ka(i){return i?i.closest("[data-report]")?"report":i.closest("[data-close]")||i.classList.contains("sl-view3d-passport-scrim")?"close":null:null}function un(i,e,t){let n=i?.querySelector("[data-report]"),r=i?.querySelector("[data-report-status]");n&&(n.disabled=e!=="failed",n.textContent=e==="received"?"Report received":"Report this view"),r&&(r.setAttribute("role",e==="failed"?"alert":"status"),r.textContent=e==="sending"?"Sending report\u2026":e==="received"?`Report received. Reference ${t??""}.`:"The report could not be sent. Please try again.")}function mr(i,e,t=null){let n=i.view3dEl;if(!n)return;oi(i,!1);let r=e.confidenceEvidence,o=i.controller.seatDetails(e.id),s=document.createElement("div");s.className="sl-view3d-passport-shell",s.innerHTML=Ga({seat:e,title:o?.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(m=>m!==n)])].filter(m=>m instanceof HTMLElement),l=a.map(m=>({element:m,inert:m.inert,ariaHidden:m.getAttribute("aria-hidden")}));for(let m of a)m.inert=!0,m.setAttribute("aria-hidden","true");n.appendChild(s),n.classList.add("has-passport"),i.view3dPassportEl=s;let c=s.querySelector(".sl-view3d-passport"),d=()=>[...c.querySelectorAll('button:not(:disabled),[href],[tabindex]:not([tabindex="-1"])')],u=m=>{if(m.key==="Escape"){m.preventDefault(),m.stopPropagation(),m.stopImmediatePropagation(),oi(i);return}if(m.key!=="Tab")return;let p=d();if(!p.length)return;let v=p[0],g=p[p.length-1];m.shiftKey&&document.activeElement===v?(m.preventDefault(),g.focus()):!m.shiftKey&&document.activeElement===g&&(m.preventDefault(),v.focus())};window.addEventListener("keydown",u,!0),i.view3dPassportCleanup=()=>{window.removeEventListener("keydown",u,!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 m=t?.isConnected?t:i.confirmEl?.querySelector(".sl-confirm-confidence")??i.view3dCompareEl?.querySelector("[data-passport-seat]")??null,p=m?.closest(".sl-confirm,.sl-view3d-compare");p?.isConnected&&(p.inert=!1,p.removeAttribute("aria-hidden")),s.remove(),n.classList.remove("has-passport"),i.view3dPassportEl===s&&(i.view3dPassportEl=null);let v=m??i.view3dCompareEl?.querySelector("[data-passport-seat]")??i.confirmEl?.querySelector(".sl-confirm-confidence")??i.view3dCompareChip.mainButton();(t?.isConnected?t:v)?.focus()},s.addEventListener("click",m=>{let p=Ka(m.target instanceof HTMLElement?m.target:null);p==="close"&&oi(i),p==="report"&&Th(i,e)}),requestAnimationFrame(()=>d()[0]?.focus()),i.emit3dAnalytics("3d_confidence_passport_opened",{seatId:e.id,evidenceId:r?.evidenceId??null,eventConfigurationId:r?.eventConfigurationId??null,modelLevel:r?.modelLevel??"unverified",realityLevel:r?.realityLevel??"none"})}async function Th(i,e){if(i.api.reportViewEvidence){un(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}),un(i.view3dPassportEl,"received",t.report.id)}catch{un(i.view3dPassportEl,"failed")}}}function oi(i,e=!0){let t=i.view3dPassportCleanup;if(i.view3dPassportCleanup=null,!t){i.view3dPassportEl?.remove(),i.view3dPassportEl=null,i.view3dEl?.classList.remove("has-passport");return}e||(document.activeElement instanceof HTMLElement?document.activeElement:null)?.blur(),t(),e||i.root?.focus({preventScroll:!0})}function Ua(i){let e=i.view3dEl;if(!e||i.view3dCompareSeatIds.length<2)return;nt(i,!1);let t=i.view3dCompareSeatIds.map(p=>i.view3dComparisonSnapshot(p)).filter(p=>!!p);if(t.length<2){i.clearView3dComparison();return}let n=p=>E(p),r=t.some(p=>!!p.price),o=document.createElement("div");o.className="sl-view3d-compare-shell";let s=t.map((p,v)=>`<article><span>Seat ${v===0?"A":"B"}</span><strong>${n(p.label)}</strong><small>Section ${n(p.section)} \xB7 Row ${n(p.row)}</small><dl>`+(r?`<div><dt>Current price</dt><dd>${n(p.price)}</dd></div>`:"")+`<div><dt>Ticket type</dt><dd>${n(p.category)}</dd></div><div><dt>Availability</dt><dd>${n(p.availability)}</dd></div><div><dt>View source</dt><dd>${n(p.viewSource)}</dd></div><div><dt>View restriction</dt><dd>${n(p.limited)}</dd></div><div><dt>Seat confidence</dt><dd>${n(p.confidence.headline)}</dd></div><div><dt>Reality check</dt><dd>${n(p.confidence.reality)}</dd></div><div><dt>Accessibility</dt><dd>${n(p.accessibility)}</dd></div></dl><div class="sl-view3d-compare-actions"><button type="button" data-passport-seat="${n(p.seat.id)}">Passport</button><button type="button" data-view-seat="${n(p.seat.id)}">View seat</button><button type="button" class="select" data-select-seat="${n(p.seat.id)}"${p.selectable?"":" disabled"}>Select seat</button></div></article>`).join("");o.innerHTML=`<div class="sl-view3d-compare-scrim" aria-hidden="true"></div><section class="sl-view3d-compare" role="dialog" aria-modal="true" aria-labelledby="sl-view3d-compare-title"><header><div><span>Seat inspection</span><strong id="sl-view3d-compare-title">Compare disclosed attributes</strong></div><button type="button" data-close aria-label="Close seat comparison">\xD7</button></header><p class="sl-view3d-compare-note">${r?"Current price and availability":"Availability"} comes from this picker. Modeled views are chart-derived unless organizer media is labeled.</p><div class="sl-view3d-compare-grid">${s}</div></section>`;let a=document.activeElement instanceof HTMLElement?document.activeElement:null,l=[...e.children].filter(p=>p instanceof HTMLElement),c=l.map(p=>({element:p,inert:p.inert,ariaHidden:p.getAttribute("aria-hidden")}));for(let p of l)p.inert=!0,p.setAttribute("aria-hidden","true");e.appendChild(o),e.classList.add("has-comparison"),i.view3dCompareEl=o;let d=o.querySelector(".sl-view3d-compare"),u=()=>[...d.querySelectorAll('button:not(:disabled),[href],[tabindex]:not([tabindex="-1"])')],m=p=>{if(p.key==="Escape"){p.preventDefault(),nt(i);return}if(p.key!=="Tab")return;let v=u();if(!v.length)return;let g=v[0],T=v[v.length-1];p.shiftKey&&document.activeElement===g?(p.preventDefault(),T.focus()):!p.shiftKey&&document.activeElement===T&&(p.preventDefault(),g.focus())};window.addEventListener("keydown",m),i.view3dCompareCleanup=()=>{window.removeEventListener("keydown",m);for(let p of c)p.element.inert=p.inert,p.ariaHidden===null?p.element.removeAttribute("aria-hidden"):p.element.setAttribute("aria-hidden",p.ariaHidden);o.remove(),e.classList.remove("has-comparison"),i.view3dCompareEl===o&&(i.view3dCompareEl=null),a?.isConnected?a.focus():i.view3dCompareChip.mainButton()?.focus()},o.querySelector("[data-close]")?.addEventListener("click",()=>nt(i)),o.querySelectorAll("[data-passport-seat]").forEach(p=>p.addEventListener("click",()=>{let v=p.dataset.passportSeat,g=v?i.allSeats().find(T=>T.id===v):void 0;g&&mr(i,g,p)})),o.querySelectorAll("[data-view-seat]").forEach(p=>p.addEventListener("click",()=>{let v=p.dataset.viewSeat;nt(i,!1),v&&i.view3dHandle?.flyToSeat(v)})),o.querySelectorAll("[data-select-seat]").forEach(p=>p.addEventListener("click",()=>{let v=p.dataset.selectSeat;v&&Eh(i,v)})),requestAnimationFrame(()=>u()[0]?.focus()),i.emit3dAnalytics("3d_comparison_opened",{seatIds:i.view3dCompareSeatIds.slice()})}function nt(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 Eh(i,e){if(i.salesClosed){i.toast(i.closedWords?.().toast??i.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}let t=i.allSeats().find(r=>r.id===e);if(!t)return;if(nt(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{seatViewDisclosure as Rh}from"@seatlayer/core/view3d/crossfade/panorama";import{t as qa}from"@seatlayer/core";var Ch=900,Ah=450;function Ph(i){switch(i){case"seat":return b("picker.stopYourSeat","Your seat");case"row":return b("picker.stopYourRow","Your row");case"section":return b("picker.stopYourSection","Your section");default:return b("picker.stopWholeVenue","Whole venue")}}function Wa(i,e){let t=document.createElement("button");t.type="button",t.className="sl-view3d-recentre sl-mo-rotate-in",t.textContent="\u25CE";let n=b("picker.recentreOnStage","Recentre on the stage");t.setAttribute("aria-label",n),t.title=n,t.addEventListener("click",()=>{e.handle()?.recentreSeatView()});let r=document.createElement("div");r.className="sl-view3d-stop",r.setAttribute("role","status"),r.setAttribute("aria-live","polite"),i.append(t,r);let o=null,s=null;return{onStopChange(a){if(o&&(clearTimeout(o),o=null),s&&(clearTimeout(s),s=null),!a){r.classList.remove("is-shown"),r.textContent="",s=setTimeout(()=>{s=null,i.classList.remove("is-seat-view")},Ah);return}i.classList.add("is-seat-view"),r.textContent=Ph(a),r.classList.add("is-shown"),o=setTimeout(()=>{o=null,r.classList.remove("is-shown")},Ch)},dispose(){o&&(clearTimeout(o),o=null),s&&(clearTimeout(s),s=null),t.remove(),r.remove(),i.classList.remove("is-seat-view")}}}var Lh=44,Mh=92;function Ya(i,e,t,n={}){let r=i?.sectionLabel,o=q(i),s=Hh(i,e),a=[r,o?qa("picker.rowLabel",{label:o}):null,s?qa("picker.seatLabel",{label:s}):null].filter(Boolean).join(" \xB7 "),l=n.maxChars??(n.narrow?Lh:Mh);for(let c of[t,n.shortTail??t,null]){let d=[a,c].filter(Boolean).join(" \xB7 ");if(d.length<=l||c==null)return d}return a}function Hh(i,e){if(i?.seatNumber)return i.seatNumber;let t=i?.displayLabel??e,n=r=>{!r||!t.startsWith(r)||t.length<=r.length||(t=t.slice(r.length).replace(/^[\s·\-\/_]+/,""))};return n(i?.sectionLabel),n(q(i)),t}import{seatConfidenceDisclosure as Ih}from"@seatlayer/core/core/seatConfidence";var Oh=220;function _h(i,e,t){let n=null,r=null,o=null;return(s,a)=>{i()?.presentSeatHover?.(s,a,e),o=a,s!==r&&(r=s,n&&(clearTimeout(n),n=null),!(!s||!t)&&(n=setTimeout(()=>{if(n=null,r!==s)return;let c=t()?.(s)??null;c&&r===s&&i()?.presentSeatHover?.(s,o,e,c)},Oh)))}}function Za(i){return i.buyerView}function Qa(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 Xa(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 Ja(i){if(!i.view3dHandle)return;let e=i.allSeats().map(t=>({seatId:t.id,state:i.seatState3dFor(t)}));i.view3dHandle.setAvailability(e)}function el(i){i.view3dHandle&&i.view3dHandle.setSelection(i.controller.getSelection().map(e=>e.id))}async function tl(i,e){let t=i.allSeats().find(n=>n.id===e);if(!t)return null;if(t.viewUrl)try{let n=t.viewMeta?.previewUrl,r=!!n&&n!==t.viewUrl,o=r?await i.buyerAssetUrls.resolve(n):null,s=r?t.viewUrl:await i.buyerAssetUrls.resolve(t.viewUrl);return!s||r&&!o?null:{url:s,...o?{previewUrl:o}:{},...r?{resolveUrl:a=>i.buyerAssetUrls.resolve(a)}:{},...t.viewMeta?.sourceWidth!==void 0?{sourceWidth:t.viewMeta.sourceWidth}:{},...t.viewMeta?.sourceHeight!==void 0?{sourceHeight:t.viewMeta.sourceHeight}:{},...t.viewMeta?.previewWidth!==void 0?{previewWidth:t.viewMeta.previewWidth}:{},...t.viewMeta?.previewHeight!==void 0?{previewHeight:t.viewMeta.previewHeight}:{},...t.viewMeta?.variants?.length?{variants:t.viewMeta.variants}:{},...t.viewMeta?.initialBearingDeg!==void 0?{initialBearingDeg:t.viewMeta.initialBearingDeg}:{},...t.viewMeta?.initialPitchDeg!==void 0?{initialPitchDeg:t.viewMeta.initialPitchDeg}:{},...t.viewMeta?.coverage?{coverage:t.viewMeta.coverage}:{},...t.viewMeta?.capturedAt?{capturedAt:t.viewMeta.capturedAt}:{},...t.viewMeta?.sourceLabel?{sourceLabel:t.viewMeta.sourceLabel}:{}}}catch(n){return i.opts.onError?.(n),null}return{url:"",generated:!0,mediaKind:"model",coverage:"exact-seat",sourceLabel:i.tf("picker.chartDerivedModel","Chart-derived model")}}function il(i,e){if(i.salesClosed){i.toast(i.closedWords?.().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 o=i.controller.getStatus(t.id);if(o==="held"||o==="booked"||o==="not_for_sale"){i.syncSelectionTo3d();return}if(!i.controller.select([e]).length){i.syncSelectionTo3d(),i.dismissConfirm();return}if(i.opts.onBuyerViewChange?.({view:"venue3d",seatId:e}),i.flashPickedSeat(e),n){i.showTableDialog(n,!1),i.syncSelectionTo3d();return}i.opts.confirmSelection!==!1?i.showConfirm(t):i.syncTray(),i.syncSelectionTo3d()}function nl(i,e){let t=i.allSeats().find(n=>n.id===e);return Ya(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 rl(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 ol(i){i.closeView3dComparison(!1),i.view3dCompareSeatIds=[],i.view3dCompareChip.remove(),i.emit3dAnalytics("3d_comparison_cleared")}function sl(i,e){let t=i.allSeats().find(v=>v.id===e);if(!t)return null;let n=i.controller.seatDetails(t.id),r=i.controller.doc?.categories.find(v=>v.key===t.categoryKey),o=n?.price??(r?.tiers?.length?r.tiers[0].price:r?.price),s=o!=null?i.paidPrice(t.categoryKey,n?.tierId??r?.tiers?.[0]?.id??null,o,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?Rh({url:t.viewUrl,...t.viewMeta?.coverage?{coverage:t.viewMeta.coverage}:{},...t.viewMeta?.capturedAt?{capturedAt:t.viewMeta.capturedAt}:{},...t.viewMeta?.sourceLabel?{sourceLabel:t.viewMeta.sourceLabel}:{}}):i.tf("picker.chartDerivedSeatEye","Live 3D \xB7 chart-derived seat-eye \xB7 not surveyed"),d=Pi(t.commercial).join(" \xB7 ")||i.tf("picker.noAuthoredRestriction","No organizer-authored restriction"),u=bo({...t.accessibility?.length?{accessibility:t.accessibility}:{},...n?.wheelchairSpaceType?{wheelchairSpaceType:n.wheelchairSpaceType}:{}}),m=u.length?`${u.join(" \xB7 ")} \xB7 metadata, not access certification`:i.tf("picker.noAccessibilityMetadata","No accessibility metadata supplied"),p=Ih(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??r?.label??t.categoryKey,price:i.suppressPricing||s==null?"":i.money(s),availability:l,selectable:a==null||a==="free",viewSource:c,limited:d,accessibility:m,confidence:p}}async function al(i,e){if(i.view3dEl||!i.canOffer3d()||!i.els.map)return;let t=i.controller.doc;if(!t)return;i.buyerView="venue3d",i.view3dTargetSeatId=null,i.opts.onBuyerViewChange?.({view:"venue3d",...e?{seatId:e}:{}}),i.root?.setAttribute("data-view3d","on"),i.dismissConfirm(),i.syncProjection(),i.syncTray();let n=document.createElement("div");n.className="sl-view3d sl-mo-zoom",n.setAttribute("role","group"),n.setAttribute("aria-label",i.tf("picker.interactive3dVenueView","Interactive 3D venue view"));let r=document.createElement("button");r.type="button",r.className="sl-view3d-back",r.innerHTML=`<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M15 18l-6-6 6-6"/></svg><span>${i.tf("picker.backToMap","Back to map")}</span>`;let o=r.querySelector("span"),s=c=>{i.view3dTargetSeatId=c;let d=!!c;n.classList.toggle("is-seat-focused",d),i.root&&(i.root.dataset.view3dSeat=d?"on":"off");let u=d?i.tf("picker.backToVenue","Back to venue"):i.tf("picker.backToMap","Back to map");o&&(o.textContent=u),r.setAttribute("aria-label",u)};if(r.addEventListener("click",()=>{if(i.view3dTargetSeatId&&i.view3dHandle){i.view3dHandle.focusOverview();return}i.exit3d()}),i.regions["top-left"]?.prepend(r),i.view3dBack=r,i.publish3dTopInset(),Ra(i.root)){let c=document.createElement("button");c.type="button",c.className="sl-view3d-fs",c.textContent="\u26F6";let d=i.tf("picker.fullScreen","Full screen");c.setAttribute("aria-label",d),c.title=d,c.setAttribute("aria-pressed",String(!!document.fullscreenElement||i.fsFallback||i.framedFs)),c.addEventListener("click",()=>i.toggleFullscreen()),n.appendChild(c)}let a=document.createElement("div");a.className="sl-view3d-loading",a.setAttribute("role","status"),a.setAttribute("aria-live","polite"),a.textContent=i.tf("picker.loading3d","Building the 3D venue\u2026"),n.appendChild(a),i.els.map.appendChild(n),i.view3dEl=n,i.view3dCompareChip.sync(),requestAnimationFrame(()=>{n.style.opacity="1"});let l=++i.view3dGen;try{let c=i.allSeats(),[d,u]=await Promise.all([yi(),i.controller.loadEventConfiguration()]),m=u?await Ui(u,y=>i.buyerAssetUrls.resolve(y)):null,p=t.theme?.venue3d?.shellAssetUrl,v=await qi(p,y=>i.buyerAssetUrls.resolve(y));if(l!==i.view3dGen||i.buyerView!=="venue3d"||i.view3dEl!==n)return;let g={doc:t,seats:c,...m?{eventConfigurationId:m.id,eventConfiguration:m}:{},...v?{registeredShellGlb:v}:{}};a.textContent=i.tf("picker.building3d","Building venue geometry\u2026");let T=await d.prepareVenue3D(g);if(l!==i.view3dGen||i.buyerView!=="venue3d"||i.view3dEl!==n)return;let S=d.mountVenue3D(n,{...g,prepared:T},{portraitOverviewCrop:!0,arriveAtSeatEye:!0,lookAroundHint:We(),navLabels:gi(),seatViewActionLabel:y=>i.allSeats().find(P=>P.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),onSeatHover:_h(()=>i.controller.getRenderer(),n,()=>{let y=S.captureSeatView;return y?P=>y.call(S,P):void 0}),onSectionFocusChange:y=>{let P=n.querySelector('select[data-locator="section"]'),R=y??"";!P||P.value===R||(P.value=R,P.dispatchEvent(new Event("change")))},onViewTargetChange:y=>{n.querySelector(".sl-view3d-nav")?.classList.toggle("is-seat-focused",!!y),s(y),i.opts.onBuyerViewChange?.({view:"venue3d",...y?{seatId:y}:{}})},...i.seatViewEnabled()?{getSeatView:y=>new Promise((P,R)=>{let G=()=>{i.seatViewFor3d(y).then(L=>{L?P(L):R(new Error("seat_view_unavailable"))})},f=globalThis.requestIdleCallback;typeof f=="function"?f(G,{timeout:1500}):setTimeout(G,50)})}:{},onAnalytics:(y,P)=>i.emit3dAnalytics(y,P)});i.view3dHandle=S,i.view3dSeatViewChrome=Wa(n,{handle:()=>i.view3dHandle}),requestAnimationFrame(()=>a.remove()),i.pushAvailabilityTo3d(),i.syncSelectionTo3d(),i.view3dNav=Ha(i.regions["bottom-left"]??n,S),e&&S.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 ll(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 cl(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 Dh}from"@seatlayer/core";import{t as mn}from"@seatlayer/core";function dl(i){return Array.isArray(i)?i.reduce((e,t)=>t.type==="minimumSelectedPlaces"?Math.max(e,t.minimum):e,0):0}function fn(i,e,t=!1){let n=i.violations[0];return n==="numberOfPlacesToSelect"?i.remaining>0?mn("picker.selectExactMore",{count:i.remaining}):mn("picker.selectExactCount",{count:i.required}):n==="minimumSelectedPlaces"?mn("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."):mn("picker.orphanHint")}var fr=6e4,pl=5*6e4,Bh=String(Math.round(pl/6e4));function hl(i){let e=document.createElement("div");e.className="sl-extend",e.dataset.dock="map",e.setAttribute("role","status"),e.innerHTML='<button type="button" class="sl-extend-btn" data-ref="extendBtn"></button><button type="button" class="sl-extend-x" data-ref="extendDismiss" aria-label=""><svg viewBox="0 0 16 16" width="12" height="12" aria-hidden="true" focusable="false"><path d="M3.5 3.5 12.5 12.5M12.5 3.5 3.5 12.5" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg></button>',(i.regions["bottom-center"]??i.els.map).appendChild(e),i.extendEl=e,i.els.extendBtn=e.querySelector('[data-ref="extendBtn"]'),i.els.extendDismiss=e.querySelector('[data-ref="extendDismiss"]'),i.els.extendBtn.textContent=ul(i),i.els.extendDismiss.setAttribute("aria-label",i.tf("picker.close","Close")),i.els.extendBtn.addEventListener("click",()=>{i.handleExtend()}),i.els.extendDismiss.addEventListener("click",()=>{i.extendDismissed=!0,i.setExtendPrompt(!1,0)})}function ul(i){return i.tf("picker.addMinutes","+{count} min").replace("{count}",Bh)}function ml(i){let e=i.hold?.items??[],t=new Set(e.map(r=>r.label));return i.committedSelection().filter(r=>!t.has(r.label)).reduce((r,o)=>r+(o.quantity??1),0)+Be(i.gaQty,i.hold?.items??[])}function fl(i){return(i.hold?.items??[]).reduce((e,t)=>e+(t.quantity??1),0)}function gl(i){let e=new Set((i.hold?.items??[]).map(n=>n.label)),t=i.committedSelection().filter(n=>!e.has(n.label)).reduce((n,r)=>n+(r.quantity??1),0);return i.heldTicketCount()+t+Be(i.gaQty,i.hold?.items??[])}function bl(i){let e=new Set((i.hold?.items??[]).map(r=>r.label)),t=i.committedSelection().filter(r=>e.has(r.label)).reduce((r,o)=>r+(o.quantity??1),0),n=Math.max(0,i.maxTickets-i.heldTicketCount()-Be(i.gaQty,i.hold?.items??[]));i.controller.setMaxSelection(t+n)}function yl(i,e=i.lastTrayCount,t=i.pendingSelectionCount()){let n=i.els.cta;if(!n)return;if(delete n.dataset.act,i.salesClosed){n.disabled=!0,n.textContent=i.closedWords?.().cta??i.tf("picker.salesClosedCta","Sales closed");return}if(i.ctaPhase==="holding"){n.disabled=!0,n.innerHTML=`<span class="sl-cta-spin" aria-hidden="true"></span>${i.tf("picker.securingSeats","Securing your seats\u2026")}`;return}if(i.ctaPhase==="checkout"){n.disabled=!0,n.innerHTML=`<span class="sl-cta-spin" aria-hidden="true"></span>${i.tf("picker.openingCheckout","Opening secure checkout\u2026")}`;return}let r=!i.hold&&i.performanceGroup?.selectionMode==="per_performance"?i.performanceGroup.submissionState?.():null;if(r&&!r.ready){n.disabled=!0,n.textContent=i.tf("picker.completeAllPerformances","Complete all performances ({complete}/{total})").replace("{complete}",String(r.complete)).replace("{total}",String(r.total));return}let o=i.controller.getSelectionValidity(e);if(o&&!o.isValid){n.disabled=!0,n.textContent=fn(o,(s,a)=>i.tf(s,a),!0);return}if(!e&&i.root?.dataset.layout==="narrow"&&!i.performanceGroup&&!i.hold&&!i.bestAvailableSoldOut){n.disabled=!1,n.dataset.act="find",n.textContent=i.tf("picker.findBestSeats","Find best seats");return}n.disabled=e===0,n.textContent=i.hold?t?Dh("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 vl(i,e){i.ctaPhase=e,i.syncCta()}async function wl(i,e,t){i.setCtaPhase("checkout");try{await i.checkoutHandoff(e,t)}finally{i.ctaPhase==="checkout"&&!i.bookedShown&&i.setCtaPhase("idle")}}function xl(i){return`@seatlayer/hold/v1/${encodeURIComponent(i.apiBase)}/${encodeURIComponent(i.opts.event)}`}function kl(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 Sl(i,e){if(!(i.opts.restoreHold===!1||typeof window>"u"))try{window.sessionStorage.setItem(i.holdStorageKey(),e.holdId)}catch{}}function Tl(i){if(!(typeof window>"u"))try{window.sessionStorage.removeItem(i.holdStorageKey())}catch{}}async function El(i,e,t=!1){try{let n=await i.controller.resumeHold(e);if(!n||i.destroyed)return null;let r={holdId:n.holdId,expiresAt:n.expiresAt,seats:n.seats,items:n.items};return i.hold=r,i.handedOff=!0,i.bookedShown=!1,i.ctaPhase="idle",i.startHoldTimer(r.expiresAt),i.rememberHold(r),i.syncTray(),i.emitHoldChange(),i.opts.onHoldRestored?.(r,r.seats??[],i.buildHandoff(r)),r}catch(n){let r=n?.status;if(r===404||r===409)i.forgetHold();else if(r===401&&n?.code==="buyer_access_invalid")i.forgetHold(),i.toast(i.tf("picker.savedSeatsNotRestored","Your earlier seats could not be restored. Please choose again."),"warning");else if(i.opts.onError?.(n),t)throw n;return null}}async function Cl(i){let e=i.rememberedHoldId();e&&await i.resumeHoldFromServer(e,!0)}function Al(i,e){i.stopHoldTimer(),i.holdExpiresAt=e,i.extendDismissed=!1,i.extendUsed=!1,i.hold&&i.rememberHold(i.hold);let t=i.els.hold;t.innerHTML=`<span class="sl-hold-dot" aria-hidden="true"></span><span>${i.tf("picker.held","Held")}</span><span class="sl-hold-time" data-ref="holdTime"></span>`;let n=t.querySelector('[data-ref="holdTime"]'),r=()=>{let o=Math.max(0,i.holdExpiresAt-Date.now());n&&(n.textContent=Ho(o)),t.classList.add("on"),t.classList.toggle("is-expiring",o>0&&o<=fr),i.setExtendPrompt(o>0&&o<=fr,o),(o<=0||!i.controller.currentHold())&&i.stopHoldTimer()};i.holdTimer=setInterval(r,500),r()}function Pl(i){i.holdTimer&&clearInterval(i.holdTimer),i.holdTimer=null,i.els.hold?.classList.remove("on","is-expiring"),i.setExtendPrompt(!1,0)}function Ll(i,e,t){if(!i.extendEl)return;let n=e&&t>0&&i.root?.dataset.layout!=="narrow"&&!i.extendDismissed&&!i.extendUsed&&!!i.controller.currentHold()&&!i.bookedShown;i.extendEl.classList.toggle("on",n)}function Ml(i){if(!i.holdTimer)return;let e=Math.max(0,i.holdExpiresAt-Date.now());i.setExtendPrompt(e>0&&e<=fr,e)}async function Hl(i){let e=i.els.extendBtn,t=i.controller.currentHold();if(!(!t||!i.api.extend||i.extendUsed)){e.disabled=!0,e.textContent=i.tf("picker.addingEllipsis","Adding\u2026");try{let n=await i.api.extend(i.controller.key,t.holdId,pl);if(i.controller.currentHold()?.holdId!==t.holdId)return;i.controller.setHold({holdId:t.holdId,labels:t.labels,expiresAt:n.expiresAt,items:t.items});let r=i.controller.currentHold();if(!r)return;i.hold={holdId:r.holdId,expiresAt:r.expiresAt,seats:r.seats,items:r.items},i.holdExpiresAt=r.expiresAt,i.extendUsed=!0,i.extendEl?.classList.remove("on"),i.rememberHold(i.hold),i.emitHoldChange(),i.toast(i.tf("picker.moreTimeAdded","More time added. Your seats are still held."),"success")}catch(n){if(n?.reason==="extend_limit"){i.extendUsed=!0,i.setExtendPrompt(!1,0);return}i.opts.onError?.(n),i.toast(i.tf("picker.couldNotAddMoreTime","Couldn't add more time. Please head to checkout now."),"warning")}finally{e.disabled=!1,e.textContent=ul(i)}}}import{t as Nl}from"@seatlayer/core";function Rl(i){return i?.previousPrice!=null&&i.previousPrice>i.price?i.previousPrice:null}function Il(i){return Vh(i)+(i.moreLabel?`<button type="button" class="sl-price-more" aria-expanded="${!i.collapsed}">${i.esc(i.moreLabel)}</button>`:"")+zh(i.status)}function Vh(i){let{esc:e,money:t}=i;return i.categories.map(n=>{let r=i.priceOf(n),o=i.rangeOf(n),s=i.offerOf(n.key),a=Rl(s),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"><span class="sl-price-name">${e(n.label)}</span>`+(s?.offerName?Ci(s.offerName,e):"")+"</span>"+(a!=null?`<span class="sl-price-was">${e(t(a))}</span>`:"")+(o!=null?`<span class="sl-price-amt">${o.min===o.max?e(t(o.min)):`${e(t(o.min))}\u2013${e(t(o.max))}`}</span>`:r!=null?`<span class="sl-price-amt">${e(t(r))}</span>`:"")+"</div>"}).join("")}function zh(i){let e=t=>t.replace(/[&<>"']/g,n=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[n]);return`<div class="sl-status-key" aria-label="${e(i.legend)}"><span class="sl-status-item"><i class="sl-status-icon unavailable" aria-hidden="true"></i>${e(i.unavailable)}</span></div>`}function gr(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 Ol(i){let{esc:e,money:t}=i;return`<button type="button" class="sl-rc sl-rc-all" data-rail-all aria-pressed="${i.allActive}" title="${e(i.allWord)}"><span class="sl-rc-t">${e(i.allWord)}</span></button>`+i.categories.map(r=>{let o=i.rangeOf(r),s=i.priceOf(r),a=o?o.min===o.max?t(o.min):`${t(o.min)}+`:s!=null?t(s):null,l=Object.prototype.hasOwnProperty.call(i.left,r.key)&&i.left[r.key]<=0,c=Rl(i.offerOf(r.key)),d=a?`${r.label}: ${a}${l?` (${i.soldOutWord})`:""}`:r.label;return`<button type="button" class="sl-rc" data-cat="${e(r.key)}" aria-pressed="${i.activeKey===r.key}" aria-label="${e(d)}" title="${e(d)}"${l?" disabled":""}><i class="sl-rc-dot" style="--sl-cat-dot:${e(i.colorOf(r))}"></i>`+(c!=null?`<span class="sl-rc-was">${e(t(c))}</span>`:"")+`<span class="sl-rc-t">${e(a??r.label)}</span></button>`}).join("")}function _l(i,e){let t=i.map(a=>({key:a.key,range:e.rangeOf(a)})).filter(a=>a.range!=null);if(!t.length)return[];let n=[...new Map(t.map(a=>[`${a.range.min}:${a.range.max}`,a.range])).values()].sort((a,l)=>a.min-l.min||a.max-l.max);if(n.length<=5)return n.map(a=>({id:`p${a.min}-${a.max}`,label:a.min===a.max?e.money(a.min):`${e.money(a.min)}\u2013${e.money(a.max)}`,keys:t.filter(l=>l.range.min===a.min&&l.range.max===a.max).map(l=>l.key),min:a.min,max:a.max}));let r=[...t].sort((a,l)=>a.range.min-l.range.min||a.range.max-l.range.max),o=Math.ceil(r.length/4),s=[];for(let a=0;a<r.length;a+=o){let l=r.slice(a,a+o),c=Math.min(...l.map(u=>u.range.min)),d=Math.max(...l.map(u=>u.range.max));s.push({id:`b${a}`,label:c===d?e.money(c):`${e.money(c)}\u2013${e.money(d)}`,keys:l.map(u=>u.key),min:c,max:d})}return s}function Dl(i){if(i.els.pricesSec?.querySelectorAll(".sl-price-select").forEach(r=>r.remove()),i.priceSelect=null,i.suppressPricing||!i.els.prices||!i.els.pricesSec)return;let e=_l((i.controller.doc?.categories??[]).filter(r=>!r.notForSale),i.legendDeps());if(e.length<2)return;let t=document.createElement("select");t.className="sl-price-select",t.setAttribute("aria-label",i.tf("picker.filterAndFocusByPrice","Filter and focus seats by price"));let n=document.createElement("option");n.value="all",n.textContent=i.tf("picker.allPrices","All prices"),t.appendChild(n);for(let r of e){let o=document.createElement("option");o.value=r.id,o.textContent=r.label,t.appendChild(o)}i.els.pricesSec.appendChild(t),i.priceSelect=t,t.addEventListener("change",()=>{i.applyPriceBand(e.find(r=>r.id===t.value)?.keys??null)})}function Bl(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 Fl(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:_}}function Vl(i,e,t,n=i.legendDeps()){let r=i.els.railScroll,o=e.length>1;if(i.els.rail?.classList.toggle("has",o),!r)return;r.innerHTML=o?Ol({...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 s=e.map(a=>a.key).join("|");i.lastRailSignature!==s&&(i.lastRailSignature=s,r.scrollLeft=0),r.querySelectorAll(".sl-rc").forEach(a=>{a.addEventListener("click",()=>{if(a.hasAttribute("data-rail-all")){i.applyPriceBand(null);return}i.focusCategory(a.dataset.cat??"")})}),i.railEdgesBound||(i.railEdgesBound=!0,r.addEventListener("scroll",()=>gr(r),{passive:!0})),requestAnimationFrame(()=>gr(r))}function zl(i){let e=i.controller.doc;if(!e||!i.els.prices)return;let t=i.controller.categoryAvailability(),n=e.categories.filter(u=>!u.notForSale);i.syncSoldout(n,t);let r=i.legendDeps(),o=i.suppressPricing,s=o?{...r,priceOf:()=>{},rangeOf:()=>{},offerOf:()=>null}:r;o&&(i.els.pricesSec?.querySelector("span")?.replaceChildren(i.tf("picker.seatCategories","Seat categories")),i.els.pricesInfo?.remove()),i.syncPriceRail(n,t,s);let a=5,l=n.length-a,c=l>1&&!i.pricesExpanded,d=c?n.slice(0,a):n;i.els.prices.classList.toggle("sl-expanded",l>1&&i.pricesExpanded),i.els.prices.innerHTML=Il({...s,categories:d,left:t,collapsed:c,activeKey:i.focusedCatKey,bandKeys:i.priceBandKeys,titleFor:(u,m)=>m?i.tf("picker.showAllSeats","Show all seats"):Nl("picker.showLabelSeatsOnMap",{label:u.label}),moreLabel:l>1?c?o?i.tf("picker.showAllCategories","Show all categories"):Nl("picker.showAllTicketTypes",{count:n.length}):i.tf("picker.showFewer","Show fewer"):null,status:{legend:i.tf("picker.seatStatusLegend","Seat status legend"),unavailable:i.tf("picker.notAvailable","Not available")}}),i.els.prices.querySelectorAll(".sl-price-row").forEach(u=>{u.addEventListener("mouseenter",()=>i.controller.getRenderer()?.setCategoryHighlight?.(u.dataset.cat??null)),u.addEventListener("mouseleave",()=>i.controller.getRenderer()?.setCategoryHighlight?.(null));let m=()=>i.focusCategory(u.dataset.cat??"");u.addEventListener("click",m),u.addEventListener("keydown",p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),m())})}),i.els.prices.querySelector(".sl-price-more")?.addEventListener("click",()=>{i.pricesExpanded=!i.pricesExpanded,i.syncPrices()})}function $l(i,e){if(!e)return;let t=i.focusedCatKey===e?null:e;i.focusedCatKey=t,i.priceBandKeys=t?new Set([t]):null;let n=i.els.pricesSec?.querySelector(".sl-price-select");n&&(n.value="all"),i.controller.setCategoryFilter(t?[t]:null),i.controller.focusCategoryFilter(t?[t]:null),i.pushAvailabilityTo3d(),i.syncFloors(),i.syncRung(),i.minimap?.refreshMinimap(),i.syncPrices(),i.lastSection&&i.showSectionCard(i.lastSection)}import{t as jl,tCount as Gl}from"@seatlayer/core";function pe(i,e,t){let n=jl(i,t);return n&&n!==i?n:t?e.replace(/\{(\w+)\}/g,(r,o)=>o in t?String(t[o]):r):e}function jh(i){let e=Gl("picker.seatCount",i);return e.includes("picker.seatCount")?`${i} ${i===1?"seat":"seats"}`:e}function Gh(i){try{let e=Intl.ListFormat;if(e)return new e(void 0,{style:"long",type:"conjunction"}).format(i)}catch{}return i.join(", ")}function Kh(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 Uh(i){let e=i.filter(r=>r.objectType==="ga"),t=i.filter(r=>r.objectType!=="ga"),n=[];if(t.length){let r=jh(t.length),o=[...new Set(t.map(l=>l.sectionLabel).filter(Boolean))],s=[...new Set(t.map(l=>l.rowLabel).filter(Boolean))],a=t.map(l=>Number(l.seatNumber)).filter(l=>Number.isFinite(l));if(o.length===1&&s.length===1&&a.length===t.length){let l=t.length===1?pe("picker.releasedSeatPlace","Section {section}, Row {row}, Seat {seat}",{section:o[0],row:s[0],seat:String(t[0].seatNumber??"")}):Kh(a)?pe("picker.releasedSeatRange","Section {section}, Row {row}, Seats {from}\u2013{to}",{section:o[0],row:s[0],from:Math.min(...a),to:Math.max(...a)}):"";n.push(l?pe("picker.releasedPair","{first} \xB7 {second}",{first:r,second:l}):pe("picker.releasedInSection","{seats} in Section {section}",{seats:r,section:o[0]}))}else o.length===1?n.push(pe("picker.releasedInSection","{seats} in Section {section}",{seats:r,section:o[0]})):o.length>1?n.push(pe("picker.releasedInSections","{seats} in Sections {sections}",{seats:r,sections:Gh(o)})):n.push(r)}for(let r of e)n.push(pe("picker.releasedGa","{quantity} \xD7 {area}",{quantity:r.quantity??1,area:r.label}));return n.length?n.reduce((r,o)=>pe("picker.releasedPair","{first} \xB7 {second}",{first:r,second:o})):""}function Kl(i){if(!i)return[];let e=new Map((i.seats??[]).map(r=>[r.label,r])),t=i.items??[];return(t.length?t.map(r=>({label:r.label,objectType:r.objectType,quantity:r.quantity})):[...e.keys()].map(r=>({label:r}))).map(r=>{let o=e.get(r.label);return{label:r.label,...r.objectType?{objectType:r.objectType}:{},...r.quantity==null?{}:{quantity:r.quantity},...o?.sectionLabel?{sectionLabel:o.sectionLabel}:{},...o?.rowLabel?{rowLabel:q(o)??o.rowLabel}:{},...o?.seatNumber?{seatNumber:o.seatNumber}:{}}})}function Ul(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 ql(i,e){if(!e.recoverable.length||!i.isConnected)return;let t=i.querySelector(".sl-hold-expired-next");t&&(e.taken.length?t.textContent=e.taken.slice(0,3).map(s=>jl("picker.seatJustTakenByAnother",{label:s})).join(" "):t.remove());let n=i.querySelector(".sl-interrupt-actions"),r=n?.querySelector(".sl-interrupt-act");if(!n||!r)return;r.classList.add("sl-interrupt-act-secondary");let o=document.createElement("button");o.type="button",o.className="sl-interrupt-act sl-hold-expired-recover",o.textContent=Gl("picker.holdLapsedSelectAgain",e.recoverable.length),o.addEventListener("click",()=>e.onRecover([...e.recoverable])),n.insertBefore(o,r),i.classList.add("has-recovery"),o.focus()}function Wl(i,e=[]){let t=document.createElement("div");t.className="sl-interrupt sl-hold-expired sl-mo-scrim",t.setAttribute("role","alertdialog"),t.setAttribute("aria-modal","true");let n=document.createElement("div");n.className="sl-interrupt-card sl-mo-in";let r=document.createElement("div");r.className="sl-interrupt-title",r.id="sl-hold-expired-title";let o=document.createElement("span");o.className="sl-interrupt-glyph",o.setAttribute("aria-hidden","true"),o.textContent="\u23F1";let s=document.createElement("span");s.textContent=pe("picker.holdExpiredTitle","Your seats were released"),r.append(o,s);let a=document.createElement("div");a.className="sl-interrupt-body",a.id="sl-hold-expired-body",a.textContent=pe("picker.holdExpiredBody","Your hold time ran out and the seats went back on sale."),n.append(r,a);let l=Uh(e);if(l){let m=document.createElement("div");m.className="sl-interrupt-body sl-interrupt-fact sl-hold-expired-seats",m.textContent=l,n.appendChild(m)}let c=document.createElement("div");c.className="sl-interrupt-body sl-hold-expired-next",c.textContent=pe("picker.holdExpiredPickAgain","Pick your seats again to continue. They may already be taken."),n.appendChild(c),t.setAttribute("aria-labelledby",r.id),t.setAttribute("aria-describedby",a.id);let d=document.createElement("div");d.className="sl-interrupt-actions";let u=document.createElement("button");return u.type="button",u.className="sl-interrupt-act sl-hold-expired-restart",u.textContent=pe("picker.holdExpiredRestart","Choose seats again"),u.addEventListener("click",()=>i.restart()),d.appendChild(u),n.appendChild(d),t.appendChild(n),t.addEventListener("pointerdown",m=>{m.target===t&&i.restart()}),t}import{ACCESSIBILITY_TYPES as br,seatTypeIconSvg as Yl,t as qh}from"@seatlayer/core";var Zl={wheelchair:"Wheelchair space",companion:"Companion seat","semi-ambulatory":"Limited mobility","designated-aisle":"Aisle / transfer","step-free":"Step-free",hearing:"Assistive listening",cart:"Live captions","sign-language":"Sign language","low-vision":"Low vision","sensory-friendly":"Sensory-friendly","plus-size":"Plus-size","lift-armrest":"Lift-up armrest"},Wh='<svg viewBox="0 0 20 20" width="17" height="17" fill="none" stroke="currentColor" stroke-width="1.45" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><circle cx="10" cy="10" r="7.5" /><path d="M10 2.5a7.5 7.5 0 0 1 0 15Z" fill="currentColor" stroke="none" /></svg>',Yh='<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>',Zh=8,Qh=8,Xh=88;function Jh(i){let e=i.gap??Zh,t=i.margin??Qh,n=i.min??Xh,r=Math.max(i.boundsTop,0);return Math.max(Math.round(i.buttonTop-r-e-t),n)}var gn=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 r=this.offered().length>0?t.tf("picker.accessibilityOptions","Accessibility and colour options"):t.tf("picker.displayOptions","Display options");this.button.setAttribute("aria-label",r),this.button.innerHTML=Yh,this.menu=document.createElement("div"),this.menu.className="sl-a11ymenu",this.menu.hidden=!0;for(let o of this.stored())this.offeredFree().has(o)&&this.active.add(o);if(this.menu.innerHTML=Po(r,t.tf("picker.close","Close"))+Lo(this.rows()),this.root.append(this.menu,this.button),e.prepend(this.root),this.button.addEventListener("pointerdown",o=>o.stopPropagation()),this.button.addEventListener("click",o=>{o.stopPropagation(),this.open(this.menu.hidden)}),this.menu.querySelector("[data-a11y-close]")?.addEventListener("click",o=>{o.stopPropagation(),this.open(!1),this.button.focus({preventScroll:!0})}),this.menu.addEventListener("pointerdown",o=>o.stopPropagation()),this.menu.addEventListener("click",o=>o.stopPropagation()),this.menu.addEventListener("focusin",o=>{let s=o.target;s&&typeof s.scrollIntoView=="function"&&s.scrollIntoView({block:"nearest"})}),this.dismiss=()=>this.open(!1),this.escape=o=>{o.key==="Escape"&&this.open(!1)},this.reflow=()=>{this.menu.hidden||this.fit()},document.addEventListener("pointerdown",this.dismiss),document.addEventListener("keydown",this.escape),window.addEventListener("resize",this.reflow),this.promoteCounts(),this.wire(),this.active.size){this.applyFilter({focus:!1});let o=()=>this.deps.focusSeatsForFilter();typeof requestAnimationFrame=="function"?requestAnimationFrame(o):o()}}colorblindRow(){return this.menu.querySelector(".sl-cbbtn")}syncCounts(){let e=new Map(this.offered().map(({key:n,count:r})=>[n,r])),t=!1;for(let n of this.menu.querySelectorAll("[data-a11y-row]")){let r=n.dataset.a11yRow??"";if(!r.startsWith("a11y:"))continue;let o=r.slice(5),s=e.get(o);if(s===void 0)continue;let a=this.countNode(n),l=s==null?"":this.countText(s);a&&(a.textContent=l);let c=s===0;a instanceof HTMLButtonElement&&(a.disabled=c,a.setAttribute("aria-label",this.jumpLabel(o,l))),n.disabled=c,c?n.setAttribute("aria-disabled","true"):n.removeAttribute("aria-disabled"),c&&this.active.delete(o)&&(this.paint(n,!1),t=!0)}t&&this.applyFilter()}syncAccessibilityFilter(e){this.active.clear();for(let t of e??[])this.active.add(t);this.remember(e&&e.length?e:null);for(let t of this.menu.querySelectorAll("[data-a11y-row]")){let n=t.dataset.a11yRow??"";n.startsWith("a11y:")&&this.paint(t,this.active.has(n.slice(5)))}}refit(){this.menu.hidden||this.fit()}destroy(){document.removeEventListener("pointerdown",this.dismiss),document.removeEventListener("keydown",this.escape),window.removeEventListener("resize",this.reflow),this.root.remove()}fit(){this.menu.style.setProperty("--sl-a11ymenu-max",`${Jh({boundsTop:this.boundsTop(),buttonTop:this.button.getBoundingClientRect().top})}px`)}boundsTop(){let e=this.root.closest(".sl-map")??this.root.closest(".sl-picker");return e instanceof HTMLElement?e.getBoundingClientRect().top:0}open(e){if(e===!this.menu.hidden)return;if(this.button.setAttribute("aria-expanded",String(e)),!e){this.menu.hidden=!0,this.menu.classList.remove("sl-mo-in","sl-mo-stagger");return}this.menu.hidden=!1,this.fit(),this.menu.scrollTop=0;let t=this.button.getBoundingClientRect();Fn(this.menu,{x:t.left+t.width/2,y:t.top}),Xo(this.menu),Qo(this.menu)}rows(){return[...this.filterRows(),...this.deps.hasLimitedView?[{key:"limited",iconHtml:Yl("restrictedView",{size:17}),label:this.deps.tf("picker.hideLimitedView","Hide limited-view seats"),on:this.deps.isLimitedViewHidden()}]:[],{key:"colorblind",iconHtml:Wh,className:"sl-cbbtn",label:this.deps.tf("picker.colorblindColors","Colourblind-friendly colours"),on:this.deps.isColorblindSafe()}]}offered(){let e=this.deps.needs?.();if(e)return e.map(({key:n,count:r})=>({key:n,count:r}));let t=this.deps.present;return t?br.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(br.map(n=>[n.key,n]));return this.offered().flatMap(({key:n,count:r})=>{let o=t.get(n);return o?[{key:`a11y:${n}`,iconHtml:Yl(n,{size:17}),label:this.deps.tf(`picker.accessShort.${n}`,Zl[n]??o.label),...n==="wheelchair"&&e.has("companion")?{note:this.deps.tf("picker.companionSeatsNote","Companion places beside them stay selectable")}:{},...r==null?{}:{count:this.countText(r),disabled:r===0},on:this.active.has(n)}]:[]})}wire(){for(let e of this.menu.querySelectorAll("[data-sl-info]"))e.addEventListener("click",()=>{let t=e.closest(".sl-info"),n=!t?.classList.contains("open");for(let r of this.menu.querySelectorAll(".sl-info.open"))r.classList.remove("open"),r.querySelector("[data-sl-info]")?.setAttribute("aria-expanded","false");t?.classList.toggle("open",n),e.setAttribute("aria-expanded",String(n))});for(let e of this.menu.querySelectorAll("[data-a11y-row]"))e.addEventListener("click",()=>{let t=e.dataset.a11yRow??"";if(t==="colorblind"){let o=!this.deps.isColorblindSafe();this.deps.setColorblindSafe(o),this.paint(e,o);return}if(t==="limited"){let o=!this.deps.isLimitedViewHidden();this.deps.setLimitedViewHidden(o),o&&this.deps.focusSeatsForFilter(),this.paint(e,o);return}let n=t.slice(5),r=!this.active.has(n);r?this.active.add(n):this.active.delete(n),this.paint(e,r),this.applyFilter()})}promoteCounts(){if(this.deps.stepToAccessibleSection)for(let e of this.menu.querySelectorAll('[data-a11y-row^="a11y:"]')){let t=e.querySelector(".sl-a11yrow-c");if(!t)continue;let n=(e.dataset.a11yRow??"").slice(5),r=e.parentElement;r?.classList.contains("sl-a11yrow-w")||(r=document.createElement("div"),r.className="sl-a11yrow-w",e.replaceWith(r),r.appendChild(e));let o=document.createElement("button");o.type="button",o.className="sl-a11yrow-c sl-a11yjump",o.dataset.a11yJump=n,o.textContent=t.textContent,o.disabled=e.disabled,o.setAttribute("aria-label",this.jumpLabel(n,t.textContent??"")),t.remove(),e.setAttribute("aria-label",this.rowLabel(n,o.textContent??""));let s=r.querySelector(".sl-info");s?s.after(o):e.after(o),r.dataset.a11yTapThrough||(r.dataset.a11yTapThrough="true",r.addEventListener("click",a=>{a.target===r&&!e.disabled&&e.click()})),o.addEventListener("click",a=>{a.stopPropagation(),this.active.has(n)||(this.active.add(n),this.paint(e,!0),this.applyFilter({focus:!1}));let l=this.deps.stepToAccessibleSection?.(n);l&&o.setAttribute("aria-label",this.jumpLabel(n,o.textContent??"",l.label))})}}countText(e){return e>0?qh("picker.accessFreeCount",{count:e}):"0"}countNode(e){return e.querySelector(".sl-a11yrow-c")??e.parentElement?.querySelector(".sl-a11yrow-c")??null}typeLabel(e){let t=Zl[e]??br.find(n=>n.key===e)?.label??e;return this.deps.tf(`picker.accessShort.${e}`,t)}jumpLabel(e,t,n){return[this.deps.tf("picker.jumpToSection","Jump to section"),this.typeLabel(e),t,...n?[`${this.deps.tf("picker.section","Section")} ${n}`]:[]].filter(Boolean).join(" \xB7 ")}rowLabel(e,t){return[this.typeLabel(e),t].filter(Boolean).join(" \xB7 ")}paint(e,t){e.classList.toggle("on",t),e.setAttribute("aria-checked",String(t)),e.setAttribute("aria-pressed",String(t))}applyFilter(e={}){let t=this.active.size?[...this.active]:null;this.deps.applyAccessibilityFilter(t),this.remember(t),t&&e.focus!==!1&&this.deps.focusSeatsForFilter()}key(){let e=this.deps.chart?.();return`seatmap.a11y.filter.${this.deps.event}${e?`.${e}`:""}`}stored(){try{let e=window.sessionStorage.getItem(this.key()),t=e?JSON.parse(e):null;return Array.isArray(t)?t:[]}catch{return[]}}remember(e){try{e&&e.length?window.sessionStorage.setItem(this.key(),JSON.stringify(e)):window.sessionStorage.removeItem(this.key())}catch{}}};import{attachVisibilityCatchUp as eu}from"@seatlayer/core";var tu=250;function Ql(i,e=tu){let t=null,n=()=>{t===null&&(t=setTimeout(()=>{t=null,i()},e))},r=eu(n),o=typeof window<"u"&&typeof window.addEventListener=="function";return o&&window.addEventListener("focus",n),()=>{t!==null&&(clearTimeout(t),t=null),r(),o&&window.removeEventListener("focus",n)}}import{holdRecoveryShape as iu,tCount as bn}from"@seatlayer/core";var yn=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=iu(e),n=e.lapsedLabels.length,r=n-e.recoverable.length,o=t==="all"?bn("picker.holdLapsedStillFree",n):t==="partial"?bn("picker.holdLapsedSomeTaken",r):bn("picker.holdLapsedAllTaken",n);this.note={message:o,recoverable:t==="none"?[]:[...e.recoverable]},this.deps.toast(o,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>${_(this.actionLabel())}</button>`:"";return`<div class="sl-lapse-note" role="status"><span>${_(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 bn("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 Xl=Symbol("seatlayer.performance-group-picker");function vn(i,e){return Object.defineProperty(i,Xl,{configurable:!1,enumerable:!1,value:Object.freeze({...e})}),i}function Jl(i){return i[Xl]??null}var ec="@seatlayer/pending-checkout/v1";function nu(i){return typeof i=="string"&&i.length<=160&&/^ord_[A-Za-z0-9_-]+$/.test(i)}function Ot(i){if(typeof location>"u")return null;let e=new URLSearchParams(location.search),t=e.get("seatlayer_checkout");if(t!=="success"&&t!=="cancelled")return null;let n=null;try{let r=window.sessionStorage.getItem(ec);if(r){let o=null;try{o=JSON.parse(r)}catch{}if(o&&nu(o.orderId)){let s=Date.now()-Number(o.storedAt);if(s>=0&&s<=144e5){if(o.eventKey&&o.eventKey!==i)return null;n=o.orderId}}}window.sessionStorage.removeItem(ec)}catch{}e.delete("seatlayer_checkout");try{let r=e.toString();history.replaceState(history.state,"",`${location.pathname}${r?`?${r}`:""}${location.hash}`)}catch{}return{outcome:t,orderId:n}}function tc(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 nc="https://api.seatlayer.io",pu=10,hu=250,rc=6e4,oc=4,uu=10,mu=40,fu=220,yr=["mini","peek","open"],sc="seatmap.a11y.cb";function gu(){try{if(typeof window>"u")return null;let i=window.localStorage.getItem(sc);return i==null?null:i==="1"}catch{return null}}function bu(i){try{window.localStorage.setItem(sc,i?"1":"0")}catch{}}var Ve=class i{constructor(e){this.renderErrorEmitted=!1;this.realtime=null;this.accessEl=null;this.idleClock=null;this.lastSelectionValidity=null;this.root=null;this.mapHost=null;this.rendered=!1;this.destroyed=!1;this.renderInfo=null;this.webMcp=null;this.localeGeneration=0;this.els={};this.regions={};this.ro=null;this.viewportResizeHandler=null;this.holdTimer=null;this.loadAbort=null;this.transportAbort=new AbortController;this.toastTimer=null;this.offerReadInFlight=null;this.offerReadSettledAt=0;this.offerRefreshTimer=null;this.offerBoundaryTimer=null;this.offerCountdownTimer=null;this.offerVisibilityHandler=null;this.motionTimers=new Set;this.currency="USD";this.currencyResolved=!1;this.eventTimezone=null;this.eventWhenText=null;this.offerAvailability=null;this.channelByObject=new Map;this.pricesByChannel=new Map;this.hold=null;this.holdExpiresAt=0;this.handedOff=!1;this.bookedShown=!1;this.holdConflicted=!1;this.paymentOptions=null;this.checkoutPanel=null;this.extendEl=null;this.extendDismissed=!1;this.extendUsed=!1;this.bookedEl=null;this.holdExpiredEl=null;this.holdExpiredFresh=!1;this.holdExpiredUnits=[];this.gaQty=new Map;this.gaPromptEl=null;this.gaPromptReturnFocus=null;this.gaAreasExpanded=!1;this.lastMapPoint=null;this.tipEl=null;this.tipPos={x:0,y:0};this.tipPinned=!1;this.tipMarkedHoverLabel=null;this.lastPointerType="mouse";this.themeMode=null;this.colorSchemeStop=null;this.seatsRevealed=!1;this.seatsRevealedWaiters=[];this.seatsRevealedReport=null;this.renderResolvedAt=null;this.revealWaitMs=null;this.handoverMs=null;this.confirmCardCache=null;this.suppressConfirmationSeatId=null;this.tableDialogEl=null;this.tableDialog=null;this.tableDialogHeld=!1;this.tableDialogReturnFocus=null;this.srEl=null;this.baQty=2;this.baCat="";this.baZone="";this.baPremium=!1;this.bestAvailableConfirm=!1;this.baSoldOutSig="";this.bestAvailableSoldOut=!1;this.salesClosed=!1;this.salesState=null;this.soldOut=!1;this.soldoutEl=null;this.cbSafe=!1;this.rungsEl=null;this.testBadgeEl=null;this.projectionEl=null;this.buyerView="map";this.view3dEl=null;this.view3dHandle=null;this.view3dGen=0;this.view3dReturnSeat=null;this.view3dTargetSeatId=null;this.view3dCompareSeatIds=[];this.view3dCompareChip=new cn({overlay:()=>this.view3dEl,savedSeatIds:()=>this.view3dCompareSeatIds,openComparison:()=>this.openView3dComparison(),clearComparison:()=>this.clearView3dComparison(),toast:(e,t)=>this.toast(e,t)});this.view3dCompareEl=null;this.view3dCompareCleanup=null;this.view3dSeatViewChrome=null;this.view3dPassportEl=null;this.view3dPassportCleanup=null;this.floorsEl=null;this.arenaViewportInsets={top:0,right:0,bottom:0,left:0};this.viewEl=null;this.viewCleanup=null;this.seatViewGen=0;this.allSeatsCache=null;this.view3dBack=null;this.view3dNav=null;this.lastRailSignature="";this.priceSelect=null;this.minimap=null;this.pickerLayoutSize={width:0,height:0};this.fullscreenAffordanceSize={rootWidth:-1,rootHeight:-1,viewportWidth:-1,viewportHeight:-1};this.priceBandKeys=null;this.focusedCatKey=null;this.limitedViewFilter=!1;this.pricesExpanded=!1;this.sectionCardCache=null;this.lastTrayCount=0;this.langSel=null;this.lastTrayTotal=0;this.lastTrayKeys=new Set;this.bestAvailableBusy=!1;this.releasingLabels=new Set;this.holdingLabels=new Set;this.ctaPhase="idle";this.a11yMenu=null;this.detachAttention=null;this.lapse=new yn({toast:(e,t,n)=>this.toast(e,t,n),reselect:e=>{this.controller.select(e),this.handleCta()},syncTray:()=>this.syncTray()});this.railEdgesBound=!1;this.fsFallback=!1;this.fsChangeHandler=null;this.fsEscHandler=null;this.eventDetailsHidden=!1;this.sideCollapsed=!1;this.sideToggleEl=null;this.framedFs=!1;this.lastPostedHeight=0;this.cbEl=null;this.modalCleanup=null;this.prevFocus=null;this.escHandler=null;this.closeModal=null;this.fitScheduled=!1;this.perspectiveWarned=!1;if(!e||typeof e!="object")throw new Error("seatmap: options object is required");if(!e.event||typeof e.event!="string")throw new Error("seatmap: `event` key is required");if(!e.container)throw new Error("seatmap: `container` is required (or use SeatPicker.open())");this.performanceGroup=Jl(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??nc).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?Vi({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??ei(e,t),this.pubApi=e.transport?null:n?.api??new Oe(this.apiBase,{access:this.access??void 0,referral:e.referral,onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)}),this.api=Ns(e.transport??this.pubApi,this.transportAbort.signal),this.chartFetch=Ni(this.api),this.buyerAssetUrls=new At(e.event,this.api.asset?(a,l)=>this.api.asset(a,l):void 0),e.checkout==="hosted"&&!this.pubApi&&console.warn('seatlayer: checkout: "hosted" needs the widget\'s own transport \u2014 a custom `transport` owns its backend, so the picker is staying on onCheckout for this mount.'),this.checkoutMode=e.checkout==="hosted"&&this.pubApi?"hosted":"handoff";let r=e.numberOfPlacesToSelect;if(r!=null&&(!Number.isInteger(r)||r<1))throw new Error("seatmap: `numberOfPlacesToSelect` must be a positive integer");this.exactTickets=r??null;let o=dl(e.selectionValidators);if(this.exactTickets!=null&&o>this.exactTickets)throw new Error("seatmap: `minimumSelectedPlaces.minimum` cannot exceed `numberOfPlacesToSelect`");let s=Math.max(1,Math.floor(e.maxSelection??this.exactTickets??Math.max(pu,o)));if(this.exactTickets!=null&&s<this.exactTickets)throw new Error("seatmap: `maxSelection` cannot be lower than `numberOfPlacesToSelect`");if(e.maxSelection!=null&&s<o)throw new Error("seatmap: `maxSelection` cannot be lower than `minimumSelectedPlaces.minimum`");this.maxTickets=this.exactTickets??s,this.cbSafe=gu()??!!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 Mt(e)}isFramed(){return typeof window<"u"&&window.parent!==window}postToHost(e){if(!this.isFramed())return;let t=tc({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-oc&&t.width>=window.innerWidth-oc}syncFullscreenAffordance(){let e=this.els.zfs;if(!e)return;let n=!(!!document.fullscreenElement||this.fsFallback||this.framedFs)&&this.root?.dataset.layout==="narrow"&&this.fillsViewport();e.hidden=n,e.tabIndex=n?-1:0,e.setAttribute("aria-hidden",String(n))}fullscreenMeasurementChanged(e,t){let n=typeof window>"u"?0:window.innerWidth,r=typeof window>"u"?0:window.innerHeight,o=e!==this.fullscreenAffordanceSize.rootWidth||t!==this.fullscreenAffordanceSize.rootHeight||n!==this.fullscreenAffordanceSize.viewportWidth||r!==this.fullscreenAffordanceSize.viewportHeight;return this.fullscreenAffordanceSize={rootWidth:e,rootHeight:t,viewportWidth:n,viewportHeight:r},o}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){Pt();let t=document.activeElement instanceof HTMLElement?document.activeElement:null,n=document.createElement("div");n.className="sl-modal-scrim";let r=document.createElement("div");r.className="sl-modal-frame",r.style.setProperty("--sl-bg",bt(void 0,e.theme)["--sl-bg"]),r.setAttribute("role","dialog"),r.setAttribute("aria-modal","true"),r.setAttribute("aria-label",b("picker.seatSelection","Seat selection")),r.tabIndex=-1,n.appendChild(r),document.body.appendChild(n);let o=document.body.style.overflow;document.body.style.overflow="hidden";let s=_s(n),a;try{a=new i({...e,container:r})}catch(g){throw s(),n.remove(),document.body.style.overflow=o,g}a.prevFocus=t,a.modalCleanup=()=>{a.modalCleanup=null,s(),document.body.style.overflow=o,a.escHandler&&document.removeEventListener("keydown",a.escHandler),n.remove();let g=a.prevFocus;a.prevFocus=null,g?.isConnected&&g.focus({preventScroll:!0})};let l=["a[href]","area[href]","button","input","select","textarea","iframe","object","embed","summary","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"[tabindex]"].join(","),c=()=>{let g=[...r.querySelectorAll('[role="dialog"][aria-modal="true"]')].filter(T=>T.isConnected&&!T.closest('[hidden], [aria-hidden="true"], [inert]'));return g[g.length-1]??r},d=(g,T)=>{let S=g;for(;S;){let y=window.getComputedStyle(S);if(S.hidden||S.getAttribute("aria-hidden")==="true"||S.hasAttribute("inert")||y.display==="none"||y.visibility==="hidden"||y.visibility==="collapse")return!0;if(S===T)return!1;S=S.parentElement}return!0},u=g=>[...g.querySelectorAll(l)].filter(T=>T.tabIndex>=0&&!T.matches(":disabled")&&!d(T,g)),m=(g,T)=>{let S=u(g),y=T?S[S.length-1]:S[0];y?y.focus({preventScroll:!0}):(g.hasAttribute("tabindex")||(g.tabIndex=-1),g.focus({preventScroll:!0}))},p=!1,v=()=>{if(p)return;p=!0,a.modalCleanup?.();let g=()=>{a.destroy(),e.onClose?.()};a.hold&&!a.handedOff&&e.holdOnClose!=="keep"?a.release().finally(g):g()};a.closeModal=v,n.addEventListener("mousedown",g=>{g.target===n&&v()}),a.escHandler=g=>{if(g.key==="Tab"){if(g.defaultPrevented)return;let T=c(),S=u(T),y=S[0],P=S[S.length-1],R=document.activeElement;!y||!P?(g.preventDefault(),m(T,g.shiftKey)):R===T||!R||!T.contains(R)?(g.preventDefault(),(g.shiftKey?P:y).focus({preventScroll:!0})):g.shiftKey&&R===y?(g.preventDefault(),P.focus({preventScroll:!0})):!g.shiftKey&&R===P&&(g.preventDefault(),y.focus({preventScroll:!0}));return}g.key==="Escape"&&(a.tableDialog?(g.preventDefault(),a.cancelTableDialog()):a.confirmSeat?(g.preventDefault(),a.cancelConfirm()):a.bestAvailableConfirm?(g.preventDefault(),a.bestAvailableConfirm=!1,a.syncTray()):(g.preventDefault(),v()))},document.addEventListener("keydown",a.escHandler);try{let g=a.render();a.els.close?.classList.add("on"),a.els.close?.addEventListener("click",v),await g}catch(g){throw a.destroy(),g}return a.destroyed||m(c(),!1),a}static prewarm(e){try{if(!e||typeof e!="object"||typeof e.event!="string"||!e.event||typeof e.publicKey!="string"||!e.publicKey)return;Wo({base:(e.apiBase??nc).replace(/\/+$/,""),event:e.event,publicKey:e.publicKey})}catch{}}wireController(e){return new ru({sectionPreview:!0,transport:this.chartFetch.transport,eventKey:e.event,maxSelection:this.maxTickets,selectedObjects:e.selectedObjects,selectableObjects:e.selectableObjects,numberOfPlacesToSelect:e.numberOfPlacesToSelect,selectionValidators:e.selectionValidators,currency:e.currency,categoryPriceRanges:()=>this.mapPriceRanges(),flashOnLiveChange:!0,colorblindSafe:this.cbSafe,...e.loadingReveal?{loadingReveal:e.loadingReveal}:{},mapTheme:gt(e.theme),onSeatsRevealed:()=>{this.seatsRevealed=!0,this.drainSeatsRevealedWaiters(),this.revealWaitMs===null&&this.renderResolvedAt!==null&&(this.revealWaitMs=performance.now()-this.renderResolvedAt),e.onSeatsRevealed?.(),this.seatsRevealedReport?.()},onGAClick:t=>{let n=this.controller.getGAAreas().find(r=>r.id===t);n&&(this.collapseSheet(),Kn(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(),Gs(t)&&this.scheduleOfferRefresh(!0),this.evictTakenSelections(),this.detectBooked(),this.minimap?.refreshMinimap(),this.pushAvailabilityTo3d()}),onHoldExpired:()=>{let t=this.handedOff,n=this.holdConflicted;this.holdExpiredUnits=Kl(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(N("picker.holdExpired",void 0)||"Your hold expired. 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.closedWords().toast,"warning");return}this.controller.tableSelection(t.id)||(this.collapseSheet(),this.flashPickedSeat(t.id),this.opts.confirmSelection&&this.suppressConfirmationSeatId!==t.id&&this.showConfirm(t))},onTableSelectionRequest:t=>{if(this.salesClosed){this.controller.deselect(t.physicalSeatIds),this.toast(this.closedWords().toast,"warning");return}this.showTableDialog(t,!1)},onDeselect:t=>{if(this.controller.currentHold()?.labels.includes(t.label)){if(this.opts.confirmSelection===!1||this.salesClosed){this.removeHeldLabels([t.label]);return}if(this.confirmSeat?.id===t.id){this.dismissConfirm();return}this.showConfirm(t,"remove");return}if(this.confirmSeat?.id===t.id){this.dismissConfirm();return}if(this.tableDialog?.physicalSeatIds.includes(t.id)){this.dismissTableDialog();return}this.opts.confirmSelection===!1||this.salesClosed||this.controller.tableSelection(t.id)||(this.controller.select([t.id]),this.showConfirm(t,"remove"))},onSelectionLimit:()=>{this.toast(N("picker.maxTicketsForOrder",{count:this.maxTickets}),"warning"),this.opts.onSelectionLimit?.(this.maxTickets)},onViewChange:()=>{this.reanchorConfirm(),this.syncRung(),this.syncProjection(),this.minimap?.drawMinimapRect(),this.sectionCardOnView()},onSectionFocus:t=>this.showSectionCard(t),onDeckTap:()=>{this.showSectionCard(null),this.syncFloors(),this.syncRung(),this.minimap?.refreshMinimap()},onFocusSeat:t=>this.announceSeat(t),onSeatHover:t=>this.updateTooltip(t),hostCardOpen:()=>this.tipPinned||!!this.confirmSeat,onHint:t=>{t&&this.toast(t)},onSalesClosed:()=>this.setSalesClosed(!0),onError:t=>{this.renderErrorEmitted=!0,this.opts.onError?.(t)}})}async render(){if(this.rendered)return this;let e=performance.now(),t={},n=p=>Math.round((performance.now()-p)*100)/100;this.rendered=!0,Pt();let r=performance.now(),o=Ri(this.opts.locale,this.opts.messages),s=this.localeGeneration+=1;this.checkoutMode==="hosted"&&(this.paymentOptions=this.pubApi.paymentOptions(this.opts.event));let a=performance.now(),l=$r(this.opts.container),{root:c,els:d,mapHost:u}=Fo(l,(p,v)=>this.tf(p,v),this.opts.theme);this.root=c,this.els=d,this.mapHost=u,Ii(c,o,p=>{t.loadLocale=n(r),this.destroyed||this.applyActiveLocale(p,s)}),_a(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 m=document.createElement("div");return m.style.cssText="position:absolute;inset:0",this.mapHost.appendChild(m),t.mountBuyerShell=n(a),t.skeletonPaint=n(e),this.loadAndFinishChart(m,t,n,e,c)}async loadAndFinishChart(e,t,n,r,o){this.startRealtime(),this.startIdleClock(o);let s=await this.loadChart(e,t,n);if(!s)return this.realtime?.stop(),this.realtime=null,this;t.shellsPaint=n(r);let a=performance.now();if(this.salesClosed=!!s.salesClosed||!!this.opts.readOnly,this.salesState=s.salesState??null,o.dataset.eventMode=s.mode==="test"?"test":"live",!this.opts.locale&&s.locale&&this.setLocale(s.locale),this.controller.setViewMode(this.normalizeInitialView(this.opts.initialView)),this.buildRegions(),this.regions["bottom-right"].appendChild(this.els.zoom),this.regions["bottom-center"].appendChild(this.els.toast),s.mode==="test"){let y=document.createElement("div");y.className="sl-testbadge",this.testBadgeEl=y,this.syncTestBadge(),this.regions["top-left"].appendChild(y)}let l=this.controller.doc?.theme;this.themeMode=this.opts.theme?.mode??null,this.applyThemeTokens(o),this.watchThemeMode(),this.currency=s.currency??this.opts.currency??"USD",this.currencyResolved=!0,this.eventTimezone=s.timezone??null,jr(this.els.logo,[this.opts.theme?.logoUrl,l?.logoUrl,s.posterUrl],this.opts.theme?.brandName??l?.brandName??s.eventName??"?"),this.els.name.textContent=s.eventName??"";let c=s.startsAt?xi(s.startsAt,s.timezone??null,this.opts.locale):"";this.eventWhenText=c||null,this.els.meta.textContent=[s.venue,c].filter(Boolean).join(" \xB7 "),this.syncProjection(),this.buildBadge(l);let d=!!this.controller.doc&&this.controller.getExpandedSeats().some(y=>y.commercial?.restrictedView||y.commercial?.obstructedView);this.buildAccessibilityMenu(d),this.buildLanguageSwitcher(this.els.zoom??this.regions["bottom-right"]),this.srEl=document.createElement("div"),this.srEl.className="sl-sr",this.srEl.setAttribute("aria-live","polite"),o.appendChild(this.srEl),this.buildArenaChrome(),this.buildMinimap(),this.buildPriceFilter(),this.buildExtendPrompt(),this.buildBookedOverlay(),this.buildSoldoutOverlay(),this.buildPanelToggle(),this.opts.panelCollapsed&&this.setPanelCollapsed(!0),this.dockLayoutChrome(),t.buildBuyerControls=n(a);let u=performance.now();if(!await this.restoreHoldForFirstPaint(t))return this;if(t.restoreHold=n(u),this.destroyed)return this;this.dismissSkeleton(),this.salesClosed&&this.applySalesClosed(),this.syncOffer(),this.syncPrices(),this.syncTray(),this.resumeHostedOrder();let m=this.controller.doc,p=Ei(this.opts.event),v=this.performanceGroup?.surface??(this.performanceGroup?"performance_group":null),g=v??"event",T={apiBase:this.apiBase,eventKey:this.opts.event,metricScope:g,surface:v==="season"?"season_picker":v==="performance_group"?"performance_group_picker":"seat_picker",ms:n(r),performanceProfile:t,seatCount:this.allSeats().length,objectCount:m?.objects.length??0,sectionCount:m?.objects.filter(y=>y.type==="section").length??0,floorCount:this.controller.getFloors().length,chartName:m?.name,view:this.buyerView,load:p,transport:this.opts.transport?"custom":"pubapi",revealWaitMs:this.revealWaitMs??this.sinceRenderResolved(),handoverMs:this.handoverMs??void 0};ja(T,(y,P)=>this.emitAnalytics(y,P));let S=s.performanceProfile;return this.seatsRevealedReport=()=>this.emitAnalytics("chart_seats_revealed",ur({...T,performanceProfile:{...T.performanceProfile,...S}})),this.seatsRevealed&&this.seatsRevealedReport(),this.renderInfo=s,await this.registerAgentTools(),this}registerAgentTools(){return Va(this)}webMcpHost(e){return hr(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=Ql(()=>{this.destroyed||this.controller.refreshAvailability()}),this.observeLayout(e),this.els.zin.addEventListener("click",()=>this.controller.zoomIn()),this.els.zout.addEventListener("click",()=>this.controller.zoomOut()),this.els.zfit?.addEventListener("click",()=>this.controller.overview()),this.els.zfs.addEventListener("click",()=>this.toggleFullscreen()),this.fsChangeHandler=()=>{document.fullscreenElement||this.setFsFallback(!1),this.syncFullscreenButtons(),requestAnimationFrame(()=>this.controller.refitCurrentView())},document.addEventListener("fullscreenchange",this.fsChangeHandler);let t=this.els.sheetHead;if(t){let r=this.els.sheetToggle;this.syncSheetAffordance();let o=0,s=!1,a=!1,l=!1;r?.addEventListener("click",c=>{c.stopPropagation(),!s&&this.cycleSheet()}),t.addEventListener("pointerdown",c=>{if(c.target.closest?.(".sl-seccard")){a=!1;return}l=!!c.target.closest?.(".sl-sheet-toggle"),a=!0,s=!1,o=c.clientY,(l&&r?r:t).setPointerCapture?.(c.pointerId)}),t.addEventListener("pointermove",c=>{if(!a||s)return;let d=c.clientY-o;d<-18?(this.stepSheet(1),s=!0):d>18&&(this.stepSheet(-1),s=!0)}),t.addEventListener("pointerup",c=>{a&&!s&&!l&&Math.abs(c.clientY-o)<6&&this.cycleSheet(),a=!1,(l&&r?r:t).releasePointerCapture?.(c.pointerId),l=!1})}this.els.foot?.addEventListener("click",r=>{this.root?.dataset.layout==="narrow"&&(r.target.closest?.('.sl-chip,button,a,input,select,label,[role="button"]')||this.cycleSheet())});let n=()=>{if(this.root?.dataset.layout!=="narrow")return;let r=this.root.getAttribute("data-prices-open")==="true";this.root.setAttribute("data-prices-open",String(!r)),this.els.pricesSec?.setAttribute("aria-expanded",String(!r)),!r&&this.root.dataset.sheet!=="open"&&this.setSheetOpen(!0)};this.els.pricesSec?.addEventListener("click",r=>{r.target.closest("select,button")||n()}),this.els.pricesSec?.addEventListener("keydown",r=>{r.key!=="Enter"&&r.key!==" "||r.target.closest("select,button")||(r.preventDefault(),n())}),e.addEventListener("click",r=>{let o=r.target.closest("[data-sl-info]");if(!o||!e.contains(o))return;r.stopPropagation();let s=o.closest(".sl-info"),a=!s?.classList.contains("open");this.closeInfoPops(s),s?.classList.toggle("open",a),o.setAttribute("aria-expanded",String(a))}),e.addEventListener("pointerdown",r=>{r.target.closest(".sl-info")||this.closeInfoPops()}),this.tipEl=document.createElement("div"),this.tipEl.setAttribute("role","tooltip"),this.tipEl.className="sl-tip",this.els.map.appendChild(this.tipEl),this.els.map.addEventListener("pointerdown",r=>{this.handleMapPointerDown(r)},!0),this.els.map.addEventListener("mousemove",r=>{if(this.tipPinned)return;let o=this.els.map.getBoundingClientRect();this.tipPos={x:r.clientX-o.left,y:r.clientY-o.top},this.tipEl&&this.tipEl.style.display!=="none"&&this.placeTooltip()}),this.els.cta.addEventListener("click",()=>{this.els.cta.dataset.act==="find"?this.openBestSeatsForm():this.handleCta()})}sheetState(){let e=this.root?.dataset.sheet;return e==="mini"||e==="open"?e:"peek"}sheetHasCards(){return this.root?.getAttribute("data-has-selection")==="true"}setSheetState(e){let t=this.root;if(!t)return;let n=t.dataset.sheet;t.dataset.sheet=e==="mini"&&!this.sheetHasCards()?"peek":e,this.syncSheetAffordance(),n==="mini"&&t.dataset.sheet!=="mini"&&this.scheduleFit()}syncSheetAffordance(){let e=this.sheetState(),t=e==="open"||e==="peek"&&this.sheetHasCards(),n=this.els.sheetToggle;n?.setAttribute("aria-expanded",String(e==="open")),n?.setAttribute("aria-label",t?this.tf("picker.collapseTicketPanel","Collapse ticket panel"):this.tf("picker.openTicketPanel","Open ticket panel"))}cycleSheet(){let e=this.sheetState();e==="open"||e==="mini"?this.setSheetState("peek"):this.setSheetState(this.sheetHasCards()?"mini":"open")}stepSheet(e){let t=yr.indexOf(this.sheetState()),n=Math.min(yr.length-1,Math.max(0,t+e));this.setSheetState(yr[n])}setSheetOpen(e){this.setSheetState(e?"open":"peek")}openBestSeatsForm(){this.setSheetOpen(!0),this.els.tray?.querySelector(".sl-ba")?.scrollIntoView({block:"nearest",behavior:this.reducedMotion()?"auto":"smooth"}),this.els.tray?.querySelector(".sl-ba-go")?.focus()}collapseSheet(){let e=this.root;!e||e.dataset.layout!=="narrow"||e.dataset.sheet!=="open"||this.setSheetState("peek")}observeLayout(e){let t=()=>{let n=e.clientWidth;if(n<=0)return;let r=e.clientHeight,o=n!==this.pickerLayoutSize.width||r!==this.pickerLayoutSize.height;this.pickerLayoutSize={width:n,height:r};let s=this.fullscreenMeasurementChanged(n,r);this.reportFramedHeight();let a=n<640?"narrow":"wide",l=r<560?"compact":"comfortable",c=e.dataset.layout!==a||e.dataset.density!==l;c&&(e.dataset.layout=a,e.dataset.density=l,this.controller.setNarrowLayout?.(a==="narrow"),queueMicrotask(()=>this.syncFitClearance()),this.controller.getRenderer()?.setSectionFocusDim?.(a!=="narrow"),a==="narrow"&&!e.dataset.sheet&&(e.dataset.sheet="peek"),this.dockLayoutChrome(),this.syncMinimapForLayout(),this.lastTrayKeys.size&&this.syncTray(),this.syncMapStepBack(),this.refreshExtendPrompt()),(s||c)&&this.syncFullscreenAffordance(),this.syncArenaViewportInsets(),o&&(this.minimap?.refreshMinimap(),this.scheduleFit())};this.ro=new ResizeObserver(t),this.ro.observe(e),this.els.map&&this.ro.observe(this.els.map),this.viewportResizeHandler=()=>{this.fullscreenMeasurementChanged(e.clientWidth,e.clientHeight)&&this.syncFullscreenAffordance()},window.addEventListener("resize",this.viewportResizeHandler),t(),requestAnimationFrame(t)}async loadChart(e,t,n){let r=performance.now();this.seatsRevealed=!1,this.seatsRevealedWaiters=[],this.seatsRevealedReport=null,this.renderResolvedAt=null,this.revealWaitMs=null,this.handoverMs=null,this.loadAbort=new AbortController;let o=await vt(async()=>{this.renderErrorEmitted=!1;let l=await this.controller.render(e);return this.renderResolvedAt=performance.now(),this.seatsRevealed&&(this.revealWaitMs=0),this.viewportLoading()&&this.drainSeatsRevealedWaiters(),l},this.loadAbort.signal,()=>{let l=this.els.boot.querySelector(".sl-boot-say");l&&(l.classList.add("is-visible"),l.textContent=this.tf("picker.loadingTakingLonger","The seat map is taking longer to load. Please wait\u2026"))});if(this.loadAbort=null,o.outcome==="cancelled"||this.destroyed)return null;let s=o.outcome==="loaded"?o.value:null,a=o.outcome==="loaded"&&!s&&!this.opts.transport?Di(this.chartFetch?.outcome(),this.renderErrorEmitted):null;if(s||this.controller.destroy(),t.loadChartAndStatuses=n(r),this.destroyed)return null;if(!s){a&&Bi({apiBase:this.apiBase,eventKey:this.opts.event,reason:a}),ve({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:o.outcome==="timeout"?"load_timeout":o.outcome==="error"?"render_error":"load_chart",ms:t.loadChartAndStatuses,performanceProfile:t,view:"map",load:Ee(this.opts.event),transport:this.opts.transport?"custom":"pubapi"});let l=this.opts.transport?void 0:this.chartFetch?.outcome();if(l?.state==="rejected"&&l.error?.status===404){let c=l.error;c.serverMessage&&console.warn(`[SeatLayer] ${c.serverMessage}`),this.opts.onError?.(c),Ht(this.els.boot,{title:this.tf("picker.eventUnavailableTitle","This event isn\u2019t available"),description:this.tf("picker.eventUnavailable","Tickets can\u2019t be booked here right now.")});for(let d of[this.els.side,this.els.rail])d&&(d.setAttribute("inert",""),d.style.display="none");return null}return Ht(this.els.boot,{title:this.tf("picker.mapDidNotLoad","The seat map didn\u2019t load"),description:this.tf("picker.checkConnection","Check your connection and try again."),actionLabel:this.tf("picker.accessRetry","Try again")}),this.els.boot.querySelector("button").addEventListener("click",()=>{if(this.destroyed||!this.root)return;this.controller=this.wireController(this.opts),Ht(this.els.boot,{title:this.tf("picker.loadingSeatMap","Loading seat map\u2026"),busy:!0});let c=performance.now();this.loadAndFinishChart(e,{},n,c,this.root)},{once:!0}),null}return Object.assign(t,s.performanceProfile),s}sinceRenderResolved(){return this.renderResolvedAt===null?void 0:performance.now()-this.renderResolvedAt}whenSeatsRevealed(e){if(!this.destroyed){if(this.seatsRevealed||this.viewportLoading()&&this.renderResolvedAt!==null){e();return}this.seatsRevealedWaiters.push(()=>{this.destroyed||e()})}}viewportLoading(){return this.opts.loadingReveal==="viewport"}drainSeatsRevealedWaiters(){let e=this.seatsRevealedWaiters;this.seatsRevealedWaiters=[];for(let t of e)try{t()}catch{}}async restoreHoldForFirstPaint(e){let t=[this.els.side,this.els.rail].filter(Boolean),n=t.map(r=>r.hasAttribute("inert"));t.forEach(r=>r.setAttribute("inert",""));try{for(;!this.destroyed;){let r=performance.now();try{return await this.restoreRememberedHold(),!this.destroyed}catch{if(this.destroyed)return!1;ve({apiBase:this.apiBase,event:this.opts.event,reconnects:this.realtime?.reconnects??0,scope:this.performanceGroup?.surface??(this.performanceGroup?"performance_group":"event"),surface:this.performanceGroup?.surface==="season"?"season_picker":this.performanceGroup?"performance_group_picker":"seat_picker",outcome:"failure",stage:"restore_hold",ms:performance.now()-r,performanceProfile:e,view:"map",load:Ee(this.opts.event),transport:this.opts.transport?"custom":"pubapi"});let s=Ht(this.els.boot,{title:this.tf("picker.restoreUnavailableTitle","Unable to check saved seats"),description:this.tf("picker.restoreUnavailable","Try again to check whether your saved seats are still held."),actionLabel:this.tf("picker.accessRetry","Try again")}),a=this.transportAbort.signal;if(await new Promise(l=>{let c=()=>{s.removeEventListener("click",c),a.removeEventListener("abort",c),l()};s.addEventListener("click",c,{once:!0}),a.addEventListener("abort",c,{once:!0}),a.aborted&&c()}),this.destroyed||a.aborted)return!1;Ht(this.els.boot,{title:this.tf("picker.restoringSeats","Checking your saved seats\u2026"),busy:!0})}}return!1}finally{t.forEach((r,o)=>{n[o]||r.removeAttribute("inert")})}}resumeHostedOrder(){if(this.checkoutMode!=="hosted")return;let e=Ot(this.opts.event);e?.outcome!=="success"||!e.orderId||this.openCheckoutPanel({kind:"resume",orderId:e.orderId})}buildPanelToggle(){if(!this.regions["top-right"])return;let e=document.createElement("button");e.type="button",e.className="sl-side-toggle",e.addEventListener("click",()=>this.setPanelCollapsed(!this.sideCollapsed)),this.sideToggleEl=e,this.regions["top-right"].appendChild(e),this.syncPanelToggle()}syncPanelToggle(){let e=this.sideToggleEl;if(!e)return;let t=this.sideCollapsed;e.setAttribute("aria-expanded",String(!t)),e.setAttribute("aria-label",t?this.tf("picker.showTicketPanel","Show the ticket panel"):this.tf("picker.hideTicketPanel","Hide the ticket panel")),e.title=t?this.tf("picker.showTicketPanel","Show the ticket panel"):this.tf("picker.hideTicketPanel","Hide the ticket panel"),e.innerHTML=t?`<svg viewBox="0 0 24 24"><path d="M15 6l-6 6 6 6"/></svg><span>${this.tf("picker.tickets","Tickets")}</span>`:'<svg viewBox="0 0 24 24"><path d="M9 6l6 6-6 6"/></svg>'}setPanelCollapsed(e){this.destroyed||(this.sideCollapsed=e,this.applyPanelCollapsed(),this.scheduleMotion(()=>this.controller.refitCurrentView(),340))}applyPanelCollapsed(){let e=this.root?.dataset.layout!=="narrow";this.root?.setAttribute("data-side-collapsed",String(this.sideCollapsed)),this.els.side?.toggleAttribute("inert",this.sideCollapsed&&e),this.syncPanelToggle()}buildAccessibilityMenu(e){let t=this.els.zoom??this.regions["bottom-right"]??this.els.map;t&&(this.a11yMenu=new gn(t,{event:String(this.opts.event),chart:()=>this.controller.doc?.name??null,needs:()=>this.controller.getAccessNeeds(),hasLimitedView:e,tf:(n,r)=>this.tf(n,r),isColorblindSafe:()=>this.cbSafe,setColorblindSafe:n=>this.setColorblindSafe(n),isLimitedViewHidden:()=>this.limitedViewFilter,setLimitedViewHidden:n=>{this.limitedViewFilter=n,this.controller.setCommercialLimitedFilter(n),this.pushAvailabilityTo3d()},applyAccessibilityFilter:n=>this.applyAccessibilityFilter(n),focusSeatsForFilter:()=>this.whenSeatsRevealed(()=>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(N("picker.accessSpreadHint",{count:e.spaces,sections:e.sections.length}),"neutral")}applyAccessibilityFilter(e){this.controller.setAccessibilityFilter(e),this.syncPrices(),this.minimap?.refreshMinimap(),this.pushAvailabilityTo3d()}setAccessibilityFilter(e){this.applyAccessibilityFilter(e),this.a11yMenu?.syncAccessibilityFilter(e),e?.length&&this.focusSeatsForFilter()}focusAccessibilityFilter(){this.focusSeatsForFilter()}dockLayoutChrome(){let e=this.root?.dataset.layout==="narrow";this.applyPanelCollapsed();let t=this.els.zfs,n=this.els.headInfo?.parentElement;t&&n&&t.parentElement!==n&&(t.classList.add("sl-fs-pill"),n.insertBefore(t,this.els.hold??null));let r=this.extendEl;if(r){let s=e?this.regions["bottom-center"]??this.els.map:n;s&&r.parentElement!==s&&(r.dataset.dock=e?"map":"head",s===n?s.insertBefore(r,this.els.close??null):s.appendChild(r))}let o=this.els.pricesSec;o&&(e?(o.setAttribute("role","button"),o.tabIndex=0,o.setAttribute("aria-expanded",String(this.root?.getAttribute("data-prices-open")==="true"))):(o.removeAttribute("role"),o.removeAttribute("aria-expanded"),o.tabIndex=-1)),this.lastSection&&this.renderSectionCard(this.lastSection)}buildExtendPrompt(){hl(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>${_(this.tf("picker.backToMap","Back to map"))}</span></button>`,this.root.appendChild(e),this.bookedEl=e,this.els.bookedSub=e.querySelector('[data-ref="bookedSub"]'),this.els.bookedList=e.querySelector('[data-ref="bookedList"]'),e.querySelector('[data-ref="bookedBack"]')?.addEventListener("click",()=>this.dismissBooked())}get onGAPromptHook(){return this.opts.onGAPrompt}closedWords(){return No(this.salesState,!!this.opts.readOnly)}tf(e,t){return b(e,t)}buildSoldoutOverlay(){if(!this.els.map)return;let e=document.createElement("div");e.className="sl-soldout",e.setAttribute("role","status");let t=(this.controller.doc?.theme?.brandName??this.opts.theme?.brandName??this.els.name?.textContent??this.tf("picker.soldOutEyebrow","This event")).toUpperCase(),n=document.createElement("div");n.className="sl-soldout-eyebrow",n.textContent=t;let r=document.createElement("div");r.className="sl-soldout-title",r.textContent=this.tf("picker.soldOutTitle","Sold out");let o=document.createElement("p");o.className="sl-soldout-copy",o.textContent=this.tf("picker.soldOutCopy","No reserved seats are currently available for this event."),e.append(n,r,o),this.els.map.appendChild(e),this.soldoutEl=e}syncSoldout(e,t){let n=this.controller.getGAAreas().length>0,r=this.isSoldOut(e,t,n),o=[...Mi(e,t)].join("|");o!==this.baSoldOutSig&&(this.baSoldOutSig=o,this.syncTray()),r!==this.soldOut&&(this.soldOut=r,this.soldoutEl?.classList.toggle("on",r))}isSoldOut(e,t,n){return!n&&e.length>0&&e.every(r=>(t[r.key]??0)===0)}setSalesClosed(e){let t=e||!!this.opts.readOnly;this.salesClosed!==t&&(this.salesClosed=t,this.applySalesClosed())}applySalesClosed(){this.salesClosed&&this.tableDialog&&!this.tableDialogHeld&&this.cancelTableDialog();let e=this.els.closedPill;if(e){e.classList.toggle("on",this.salesClosed);let t=this.els.closedPillText??e;t.textContent=this.closedWords().pill}this.root?.setAttribute("data-sales-closed",String(this.salesClosed)),this.salesClosed&&this.srEl&&(this.srEl.textContent=this.closedWords().toast),this.syncCta(),this.syncTray()}badgeHidden(e){return!!e?.hideBadge}buildBadge(e){if(this.badgeHidden(e))return;let t=this.els.foot;if(!t)return;let 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")),n.dataset.slA="picker.poweredBy";let r=document.createElement("span");r.className="sl-powered-mark",r.setAttribute("aria-hidden","true"),r.innerHTML=Ki;let o=document.createElement("span");o.textContent=this.tf("picker.poweredBy","Powered by SeatLayer"),o.dataset.slT="picker.poweredBy",n.append(r,o),t.appendChild(n)}buildRegions(){if(!this.els.map)return;let e=["top-left","top-center","top-right","left-rail","bottom-left","bottom-center","bottom-right"];for(let t of e){let n=document.createElement("div");n.className="sl-anchor",n.dataset.region=t,this.els.map.appendChild(n),this.regions[t]=n}}cssVar(e){return this.root?getComputedStyle(this.root).getPropertyValue(e).trim():""}reducedMotion(){return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}scheduleMotion(e,t){let n=setTimeout(()=>{this.motionTimers.delete(n),this.destroyed||e()},t);this.motionTimers.add(n)}animateOnce(e,t,n=600){!e||this.reducedMotion()||(e.classList.remove(t),e.offsetWidth,e.classList.add(t),this.scheduleMotion(()=>e.classList.remove(t),n))}flashPickedSeat(e){this.reducedMotion()||this.controller.flashSeat(e,this.cssVar("--sl-accent")||"#f4b740")}flashHeldSeats(e){let t=this.reducedMotion(),n=(e.items??[]).filter(r=>r.objectType!=="ga").slice(0,10).map(r=>this.controller.seatByLabel(r.label)).filter(r=>!!r);Cs({regions:this.els,categories:this.controller.doc?.categories,pop:r=>this.controller.flashSeat(r,this.cssVar("--sl-accent")||"#f4b740"),focus:(r,o)=>this.controller.focusSection(r,o),focusSeats:r=>this.controller.focusSeats?.(r,{animate:!t})===!0,reducedMotion:t,screenPoint:r=>this.controller.worldToScreen(r),schedule:(r,o)=>this.scheduleMotion(r,o)},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 ml(this)}heldTicketCount(){return fl(this)}totalTicketCount(){return gl(this)}updateSelectionCapacity(){bl(this)}syncCta(e=this.lastTrayCount,t=this.pendingSelectionCount()){yl(this,e,t)}setCtaPhase(e){vl(this,e)}runCheckoutHandoff(e,t){return wl(this,e,t)}holdStorageKey(){return xl(this)}rememberedHoldId(){return kl(this)}rememberHold(e){Sl(this,e)}forgetHold(){Tl(this)}resumeHoldFromServer(e,t=!1){return El(this,e,t)}restoreRememberedHold(){return Cl(this)}activeFloorObjects(){let e=this.controller.doc;if(!e)return[];let t=e.floors;if(t?.length){let n=this.controller.getActiveFloorId();return(t.find(r=>r.id===n)??t[0]).objects??[]}return e.objects??[]}buildMinimap(){!this.els.map||this.root?.dataset.layout==="narrow"||(this.minimap=Qr({controller:this.controller,root:()=>this.root,cssVar:e=>this.cssVar(e),focusedSectionLabel:()=>this.lastSection?.label,tint:e=>this.controller.getRenderer?.()?.categoryDisplayColor?.(e)||void 0},this.regions["bottom-left"]??this.els.map))}syncMinimapForLayout(){let e=this.root?.dataset.layout==="narrow";if(e&&this.minimap){this.minimap.dispose(),this.minimap=null;return}!e&&!this.minimap&&this.buildMinimap()}catPrice(e){return pn(this,e)}catPriceRange(e){return hn(this,e)}buildPriceFilter(){Dl(this)}applyPriceBand(e){Bl(this,e)}buildArenaChrome(){let e=this.controller.doc;if(this.rungsEl=null,this.projectionEl=null,this.floorsEl=null,!e||!this.els.map){this.syncArenaViewportInsets();return}let t=e.objects.some(n=>n.type==="section")||(e.floors??[]).some(n=>n.objects.some(r=>r.type==="section"));if(this.canOffer3d()){let n=document.createElement("div");n.className="sl-projection",n.setAttribute("role","group"),n.setAttribute("aria-label",this.tf("picker.venueView","Venue view")),n.dataset.slA="picker.venueView",n.innerHTML=`<button type="button" data-view="map" aria-pressed="true" data-sl-t="picker.map" data-sl-ti="picker.flat2dMap" title="${this.tf("picker.flat2dMap","Flat 2D map")}">${this.tf("picker.map","Map")}</button><button type="button" data-view="venue3d" aria-pressed="false" data-sl-ti="picker.interactive3dVenueView" title="${this.tf("picker.interactive3dVenueView","Interactive 3D venue view")}">3D</button>`,n.querySelectorAll("button").forEach(r=>{if(r.dataset.view==="venue3d")for(let o of["pointerenter","focus","pointerdown"])r.addEventListener(o,vi,{once:!0});r.addEventListener("click",()=>{this.setBuyerView(r.dataset.view)})}),this.regions["top-right"].appendChild(n),this.projectionEl=n,this.syncProjection()}if(t){let n=[...e.objects,...(e.floors??[]).flatMap(u=>u.objects)],r=new Set((e.zones??[]).map(u=>u.id)),a=ou(e)==="combined"&&(e.floors?.length??0)>1&&r.size===0||n.some(u=>u.type==="section"&&typeof u.zone=="string"&&r.has(u.zone))?["zones","sections","seats"]:["sections","seats"],l=document.createElement("div");l.className="sl-rungs on sl-mo-indicator",l.setAttribute("role","group"),l.setAttribute("aria-label",N("picker.zoomLevel")),l.dataset.slA="picker.zoomLevel";let c={zones:N("picker.rungLabel.zones"),sections:N("picker.rungLabel.sections"),seats:N("picker.rungLabel.seats")},d={zones:N("picker.rungTip.zones"),sections:N("picker.rungTip.sections"),seats:N("picker.rungTip.seats")};l.innerHTML=a.map(u=>`<button type="button" data-rung="${u}" data-sl-t="picker.rungLabel.${u}" data-sl-ti="picker.rungTip.${u}" title="${d[u]}" aria-pressed="false">${c[u]}</button>`).join(""),l.querySelectorAll("button").forEach(u=>{u.addEventListener("click",()=>{let m=u.dataset.rung;this.controller.setRung(m),m==="seats"&&this.collapseSectionCard()})}),this.regions["top-center"].appendChild(l),this.rungsEl=l,this.syncRung()}if(this.controller.isMultiFloor()){let n=ta({floors:this.controller.getFloors(),tf:(r,o)=>this.tf(r,o),onChoose:r=>{r===""?this.controller.setFloorOverview(!0):this.controller.setFloor(r),this.showSectionCard(null),this.syncFloors(),this.syncRung(),this.minimap?.refreshMinimap()}});(this.regions["bottom-right"]??this.regions["top-left"]).prepend(n),this.floorsEl=n,this.syncFloors()}this.syncArenaViewportInsets()}syncArenaViewportInsets(){let e=this.els.map;e&&ws(this.root,e,this.regions);let t=e?ea(e.getBoundingClientRect(),[this.rungsEl,this.projectionEl].map(n=>n?.isConnected?n.getBoundingClientRect():null),[],8,this.floorsEl?.isConnected?[this.floorsEl.getBoundingClientRect()]:[]):{top:0,right:0,bottom:0,left:0};Object.keys(t).every(n=>t[n]===this.arenaViewportInsets[n])||(this.arenaViewportInsets=t,this.controller.setViewportInsets(t),this.syncFitClearance())}syncFitClearance(){let e=this.els.map,t=this.els.zoom,n=this.root?.dataset.layout==="narrow",r=0;if(n&&e&&t?.isConnected){let o=e.getBoundingClientRect(),s=t.getBoundingClientRect();s.height>0&&(r=Math.max(0,o.bottom-s.top+8))}this.controller.setFitClearance?.(r)}syncTestBadge(){let e=this.testBadgeEl;e&&(e.textContent=zr(N("picker.testMode"),ic()),e.setAttribute("aria-label",N("picker.testMode")),e.title=this.tf("picker.testModeExplained","Bookings here are not real and no card is charged"))}syncRung(){let e=this.controller.getRung(),t=this.controller.seatsRevealed?.()??(e==="seats"||!!this.controller.getFocusedSection?.());this.root&&(this.root.dataset.zoomed=String(t)),this.syncMapStepBack(),this.minimap?.setAutoOpen(!1),this.rungsEl&&this.rungsEl.querySelectorAll("button").forEach(n=>{let r=n.dataset.rung===e;n.classList.toggle("on",r),n.setAttribute("aria-pressed",String(r))})}syncMapStepBack(){let e=this.els?.zout,t=this.els?.zfit,n=this.els?.zin;if(!e||!this.root)return;let r=this.controller.getRenderer?.(),o=this.controller.canZoomIn?.()===!1||r?.seatsPickable?.()===!0,s=Zr({focusedSection:this.controller.getFocusedSection?.()??null,seatsRevealed:this.controller.seatsRevealed?.()??!0,atVenueFit:this.controller.atVenueFit?.()})==="none",a=e.disabled!==s||!!t&&t.disabled!==s||!!n&&n.disabled!==o||e.hidden||!!n?.hidden||!!t?.hidden;e.disabled=s,e.hidden=!1,n&&(n.disabled=o,n.hidden=!1),t&&(t.disabled=s,t.hidden=!1),a&&this.a11yMenu?.refit()}syncProjection(){this.els.pricesHint&&(this.els.pricesHint.textContent=this.buyerView==="venue3d"?this.tf("picker.priceHint3d","Colours in the venue are ticket types. Choose one below to show just those seats."):this.tf("picker.priceHint","Colours on the map are ticket types. Tap one below to show just those seats.")),this.projectionEl&&this.projectionEl.querySelectorAll("button").forEach(e=>{let t=e.dataset.view===this.buyerView;e.classList.toggle("on",t),e.setAttribute("aria-pressed",String(t))})}canOffer3d(){return this.opts.enable3D===!1||!this.controller.doc||!bi()?!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)?rc/2:rc}syncFloors(){ia(this.floorsEl,this.controller.getActiveFloorId(),this.controller.isFloorOverview())}get sectionCard(){return this.sectionCardCache||(this.sectionCardCache=new rn({controller:this.controller,map:()=>this.els.map,root:()=>this.root,collapseSheet:()=>this.collapseSheet(),region:e=>this.regions[e],refreshMinimap:()=>this.minimap?.refreshMinimap(),activeFloorObjects:()=>this.activeFloorObjects(),sectionNeighbours:e=>this.sectionNeighbours(e),catPriceRange:e=>this.catPriceRange(e),money:e=>this.money(e),suppressPricing:()=>this.suppressPricing,priceBandKeys:()=>this.priceBandKeys})),this.sectionCardCache}showSectionCard(e){this.sectionCard.show(e)}renderSectionCard(e){this.sectionCard.render(e)}collapseSectionCard(){this.sectionCard.collapse()}sectionCardOnView(){this.sectionCard.onView()}sectionNeighbours(e){let t=this.activeFloorObjects().filter(r=>r.type==="section"&&!this.controller.isSectionClosed(r.id)&&this.controller.getSectionSeatCount(r.id)>0);if(t.length<2)return null;let n=t.findIndex(r=>r.id===e);return n<0?null:{previous:t[(n-1+t.length)%t.length],next:t[(n+1)%t.length]}}markedSeatAnnouncement(e){let t=or(this.controller.getRenderer()?.getSeatMark?.(e.id),this.performanceGroup?.nights?.());return ua(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(p=>p.key===e.categoryKey),r=this.controller.getStatus(e.id)??"free",o=r==="free"?this.tf("picker.statusAvailable","available"):r==="held"?this.tf("picker.statusOnHold","on hold"):this.tf("picker.statusTaken2","taken"),s=n?this.catPriceRange(n):void 0,a=!this.suppressPricing&&s?s.min===s.max?this.money(s.min):`${this.money(s.min)}\u2013${this.money(s.max)}`:void 0,l=this.controller.tableSelection(e.id),c=l??this.controller.seatDetails(e.id),d=it(c),u=c?.rowLabel??c?.displayLabel??e.displayLabel??e.label,m=l?`${d} ${u}, ${l.bookingMode==="variable"?N("picker.minToMaxGuests",{min:l.minOccupancy,max:l.maxOccupancy}):N("picker.capacityGuests",{count:l.capacity})}`:c?.objectType==="booth"?`${d} ${u}`:c?.objectType==="table"?`${d} ${u}, ${N("picker.seatNumberLower",{label:c.seatNumber??e.label})}`:N("picker.seatLabel",{label:c?.displayLabel??e.displayLabel??e.label});this.srEl.textContent=`${m}, ${n?.label??e.categoryKey}${a?`, ${a}`:""}, ${o}`}showTableDialog(e,t,n){this.dismissTableDialog(!1),this.tableDialog={...e},this.tableDialogHeld=t,this.tableDialogReturnFocus=n??document.activeElement;let r=this.controller.doc?.categories.find(a=>a.key===e.categoryKey),o=e.bookingMode==="variable",s=document.createElement("div");s.className="sl-table-scrim",s.innerHTML=Co(e,{variable:o,held:t,typeWord:it(e),categoryLabel:r?.label??e.categoryKey,suppressPricing:this.suppressPricing,unitPrice:this.money(this.paidPrice(e.categoryKey,e.tierId??null,e.price,e.label))}),this.root.appendChild(s),this.tableDialogEl=s,this.renderTableDialogState(),s.querySelectorAll("[data-table-step]").forEach(a=>{a.addEventListener("click",()=>{if(!this.tableDialog)return;let l=Math.max(this.tableDialog.minOccupancy,Math.min(this.tableDialog.maxOccupancy,this.tableDialog.quantity+Number(a.dataset.tableStep)));this.tableDialog={...this.tableDialog,quantity:l},this.renderTableDialogState()})}),s.querySelector(".sl-table-cancel").addEventListener("click",()=>this.cancelTableDialog()),s.querySelector(".sl-table-confirm").addEventListener("click",()=>{this.confirmTableDialog()}),s.addEventListener("mousedown",a=>{a.target===s&&this.cancelTableDialog()}),s.addEventListener("keydown",a=>{if(a.key!=="Tab")return;let l=[...s.querySelectorAll('button:not(:disabled),[tabindex]:not([tabindex="-1"])')];if(!l.length)return;let c=l[0],d=l[l.length-1];a.shiftKey&&document.activeElement===c?(a.preventDefault(),d.focus()):!a.shiftKey&&document.activeElement===d&&(a.preventDefault(),c.focus())}),requestAnimationFrame(()=>s.querySelector(o?'[data-table-step="-1"]':".sl-table-confirm")?.focus())}renderTableDialogState(){let e=this.tableDialog,t=this.tableDialogEl;if(!e||!t)return;let n=t.querySelector("output[data-table-qty]");n&&(n.value=String(e.quantity));let r=t.querySelector("input[data-table-qty]");r&&(r.value=String(e.quantity)),t.querySelectorAll("[data-table-step]").forEach(a=>{let l=Number(a.dataset.tableStep);a.disabled=l<0?e.quantity<=e.minOccupancy:e.quantity>=e.maxOccupancy});let o=this.paidPrice(e.categoryKey,e.tierId??null,e.price,e.label),s=t.querySelector("[data-table-total]");s&&(s.textContent=this.money(o*e.quantity))}async confirmTableDialog(){let e=this.tableDialog,t=this.tableDialogHeld;if(!e)return;let n=this.tableDialogEl?.querySelector(".sl-table-confirm");if(n&&(n.disabled=!0,n.textContent=t?this.tf("picker.updatingEllipsis","Updating\u2026"):this.tf("picker.selectingEllipsis","Selecting\u2026")),t){try{let r=await this.controller.replaceTableQuantity(e.label,e.quantity,this.opts.holdTtlMs);if(!r){this.toast(this.tf("picker.guestCountCouldNotBeSecured","That guest count could not be secured. Your current table hold is unchanged."),"warning"),this.renderTableDialogState(),n&&(n.disabled=!1,n.textContent=this.tf("picker.updateTable","Update table"));return}this.hold={holdId:r.holdId,expiresAt:r.expiresAt,seats:r.seats,items:r.items},this.startHoldTimer(r.expiresAt),this.dismissTableDialog(),this.syncTray(),this.emitHoldChange(),this.toast(N("picker.tableUpdatedForGuests",{label:e.label,count:e.quantity}),"success")}catch(r){this.opts.onError?.(r),this.toast(this.tf("picker.guestCountNoLongerAvailable","That guest count is no longer available. Your current hold is unchanged."),"error"),n&&(n.disabled=!1,n.textContent=this.tf("picker.updateTable","Update table"))}return}if(!this.controller.setTableQuantity(e.label,e.quantity)){n&&(n.disabled=!1,n.textContent=e.bookingMode==="variable"?this.tf("picker.selectTable","Select table"):this.tf("picker.selectWholeTable","Select whole table"));return}this.dismissTableDialog(),this.collapseSectionCard(),this.syncTray()}cancelTableDialog(){let e=this.tableDialog,t=this.tableDialogHeld;this.dismissTableDialog(),e&&!t&&this.controller.deselect(e.physicalSeatIds)}dismissTableDialog(e=!0){let t=this.tableDialogReturnFocus;this.tableDialogEl?.remove(),this.tableDialogEl=null,this.tableDialog=null,this.tableDialogHeld=!1,this.tableDialogReturnFocus=null,e&&requestAnimationFrame(()=>(t?.isConnected?t:this.root)?.focus())}get confirmCard(){return this.confirmCardCache||(this.confirmCardCache=new ln({controller:this.controller,root:()=>this.root,els:()=>this.els,regions:()=>this.regions,hideTooltip:()=>{this.tipEl&&(this.tipEl.style.display="none")},tf:(e,t)=>this.tf(e,t),money:e=>this.money(e),paidPrice:(e,t,n,r)=>this.paidPrice(e,t,n,r),offerName:(e,t)=>this.offerPrice(e,t)?.offerName,suppressPricing:()=>this.suppressPricing,reducedMotion:()=>this.reducedMotion(),scheduleMotion:(e,t)=>this.scheduleMotion(e,t),canOffer3d:()=>this.canOffer3d(),buyerView:()=>this.buyerView,view3dHandle:()=>this.view3dHandle,view3dCompareSeatIds:()=>this.view3dCompareSeatIds,rememberView3dReturnSeat:e=>{this.view3dReturnSeat=e},enter3d:e=>{this.enter3d(e)},performanceGroup:()=>this.performanceGroup,seatViewEnabled:()=>this.seatViewEnabled(),openSeatView:e=>{this.openSeatView(e)},openSeatConfidencePassport:(e,t)=>this.openSeatConfidencePassport(e,t),saveView3dComparisonSeat:e=>this.saveView3dComparisonSeat(e),resolveAssetUrl:e=>this.buyerAssetUrls.resolve(e),onError:e=>this.opts.onError?.(e),liftToastOverConfirm:()=>this.liftToastOverConfirm(),fitTranslatedRows:()=>this.fitTranslatedRows(),syncTray:()=>this.syncTray(),syncSelectionTo3d:()=>this.syncSelectionTo3d(),collapseSectionCard:()=>this.collapseSectionCard(),applyPanelCollapsed:()=>this.applyPanelCollapsed(),dismiss:()=>this.dismissConfirm(),releaseHeldSeat:e=>this.controller.currentHold()?.labels.includes(e.label)?this.removeHeldLabels([e.label]):null,reanchor:()=>this.reanchorConfirm(),inviteCommit:(e,t)=>this.inviteCommit(e,t),addSeatLabel:e=>this.addSeatLabel(e),cartLanded:()=>this.cartLanded()})),this.confirmCardCache}showConfirm(e,t="add"){this.confirmCard.show(e,t)}reanchorConfirm(){this.confirmCard.reanchor()}dismissConfirm(){this.confirmCard.dismiss()}cartLanded(){this.animateOnce(this.els.count,"sl-value-pop",380),this.animateOnce(this.els.total,"sl-value-pop",380)}async commitConfirm(){await this.confirmCard.commit()}cancelConfirm(){this.confirmCard.cancel()}closeConfirm(){this.dismissConfirm()}inviteCommit(e,t){La(e,t,this.reducedMotion())}addSeatLabel(e){return Ma(e,(t,n)=>this.tf(t,n))}seatViewEnabled(){return this.opts.seatView!==!1}allSeats(){return this.allSeatsCache||(this.allSeatsCache=[...this.controller.getExpandedSeats()]),this.allSeatsCache}async openSeatView(e){if(!this.root||!this.seatViewEnabled())return;let t=++this.seatViewGen,n=this.controller.doc,r=this.controller.getActiveFloorId(),o=e.focalPoint??n?.floors?.find(u=>u.id===r)?.focalPoint??n?.focalPoint??{x:0,y:0},s,a,l=!1;if(e.viewUrl){let u,m=null;try{let v=e.viewMeta?.previewUrl;v&&v!==e.viewUrl?(m=await this.buyerAssetUrls.resolve(v),u=e.viewUrl):u=await this.buyerAssetUrls.resolve(e.viewUrl)}catch(v){t===this.seatViewGen&&this.opts.onError?.(v);return}if(t!==this.seatViewGen||!u||e.viewMeta?.previewUrl&&e.viewMeta.previewUrl!==e.viewUrl&&!m||!this.root||!this.seatViewEnabled())return;let p={url:u,...m?{previewUrl:m}:{},...e.viewMeta?.sourceWidth!==void 0?{sourceWidth:e.viewMeta.sourceWidth}:{},...e.viewMeta?.sourceHeight!==void 0?{sourceHeight:e.viewMeta.sourceHeight}:{},...e.viewMeta?.previewWidth!==void 0?{previewWidth:e.viewMeta.previewWidth}:{},...e.viewMeta?.previewHeight!==void 0?{previewHeight:e.viewMeta.previewHeight}:{},...e.viewMeta?.variants?.length?{variants:e.viewMeta.variants}:{},...e.viewMeta?.coverage?{coverage:e.viewMeta.coverage}:{},...e.viewMeta?.capturedAt?{capturedAt:e.viewMeta.capturedAt}:{},...e.viewMeta?.sourceLabel?{sourceLabel:e.viewMeta.sourceLabel}:{}};s=p,a=du(p),l=cu(p)}else{let u;try{let{generateSeatPanorama:m}=await wi();u=m(e,o,this.allSeats())}catch(m){t===this.seatViewGen&&this.opts.onError?.(m);return}if(t!==this.seatViewGen||!this.root||!this.seatViewEnabled())return;s={url:u.url,generated:!0},a=N("picker.illustrationCaption",{m:u.distanceM})}this.closeSeatView(!1);let c=N("picker.viewFromSeat",{label:e.label}),d=Wi({root:this.root,source:s,caption:a,real:l,closeLabel:this.tf("picker.close","Close"),dragHint:We(),viewFromSeatLabel:c,real360Label:N("picker.real360"),previewLabel:N("picker.preview"),resolveAsset:u=>this.buyerAssetUrls.resolve(u),onClose:()=>this.closeSeatView()});this.viewEl=d.element,this.viewCleanup=()=>d.dispose()}closeSeatView(e=!0){e&&(this.seatViewGen+=1),this.viewCleanup?.(),this.viewCleanup=null,this.viewEl?.remove(),this.viewEl=null}money(e){let t=this.opts.pricing?.formatter;if(t)return t(e,this.currency);let n=Number.isInteger(e);return su(e,this.currency,{locale:this.opts.locale,fallback:(r,o)=>`${r} ${o}`,...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=Ks(e,t);if(n==null)return;let r=6*36e5,o=Math.min(Math.max(n-t+1e3,1e3),r);this.offerBoundaryTimer=setTimeout(()=>{this.offerBoundaryTimer=null,!document.hidden&&this.refreshOfferAvailability(!1)},o)}offerReadIsCurrent(){return!!this.offerReadInFlight||Date.now()-this.offerReadSettledAt<hu}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=ir(t);if(!n)return;this.offerAvailability=n,this.applyChannelPricing(n.channelPricing),this.scheduleOfferBoundary(n);let r=qs(this.hostPricing?.prices,n),o=Object.keys(r).length>0||this.hostPricing?.formatter?{prices:r,...this.hostPricing?.formatter?{formatter:this.hostPricing.formatter}:{}}:void 0;this.setPricing(o),this.syncMapPriceRanges(),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,t){if(!e)return null;let n=this.offerAvailability?.prices.filter(r=>r.categoryKey===e)??[];return t!==void 0?n.find(r=>(r.tierId??null)===t)??n.find(r=>r.tierId==null)??null:n[0]??null}mapPriceRanges(){if(this.api.availability&&!this.offerAvailability)return null;let e=this.offerAvailability?.prices.some(n=>n.tierId!==void 0)??!1,t=Object.keys(this.opts.pricing?.prices??{}).length>0;if(!(!e&&!t))return Object.fromEntries((this.controller.doc?.categories??[]).flatMap(n=>{let r=this.catPriceRange(n);return r?[[n.key,r]]:[]}))}syncMapPriceRanges(){this.controller.getRenderer()?.setCategoryPriceRanges?.(this.mapPriceRanges())}applyChannelPricing(e){this.channelByObject.clear(),this.pricesByChannel.clear();for(let t of e?.channels??[])this.pricesByChannel.set(t.channelId,t.priceOverrides);for(let t of e?.objects??[])this.pricesByChannel.has(t.channelId)&&this.channelByObject.set(t.label,t.channelId)}syncOffer(){let e=this.els.offer;if(!e)return;if(this.offerCountdownTimer&&clearTimeout(this.offerCountdownTimer),this.offerCountdownTimer=null,e.classList.remove("sl-offer-compact","sl-offer-early-bird"),!this.currencyResolved){e.classList.remove("has"),e.replaceChildren();return}if(this.suppressPricing){e.classList.remove("has"),e.replaceChildren();return}let t=this.offerAvailability,n=t?.release??null,r=!n&&t?.upcoming?.pricingMode!=="matrix"?t?.upcoming??null:null;if(!t||t.state==="closed"||t.state==="sold-out"||!n&&!r){e.classList.remove("has"),e.replaceChildren();return}let o=n??r,s=o.pricingMode==="matrix",a=document.createElement("div");a.className="sl-offer-main";let l=document.createElement("div");l.className="sl-offer-copy";let c=document.createElement("span");c.className="sl-offer-kicker",c.textContent=n?this.tf("picker.currentTicketOffer","Current ticket offer"):this.tf("picker.upcomingTicketOffer","Upcoming ticket offer");let d=document.createElement("strong");d.className="sl-offer-name";let u=o.name||(n?this.tf("picker.currentOffer","Current offer"):this.tf("picker.scheduledOffer","Scheduled offer"));Ln(u)&&e.classList.add("sl-offer-early-bird"),d.innerHTML=Ai(u,_);let m=document.createElement("span");m.className="sl-offer-line";let p=[];if(!s&&n&&t.fromPrice!=null&&p.push(this.money(t.fromPrice/100)),!s&&n&&o.remaining!=null&&p.push(N("picker.offerRemainingAvailable",{count:o.remaining})),n&&o.endsAt!=null){let y=!this.opts.locale||/^en(?:-|$)/i.test(this.opts.locale)?mo(o.endsAt):null;if(p.push(y??N("picker.offerUntil",{time:xi(o.endsAt,this.eventTimezone,this.opts.locale)})),y){let P=Math.max(1e3,o.endsAt-Date.now()),R=P%6e4||6e4;this.offerCountdownTimer=setTimeout(()=>{this.offerCountdownTimer=null,Date.now()>=o.endsAt?this.refreshOfferAvailability(!1):this.syncOffer()},Math.min(R+25,P+25))}}if(r?.startsAt!=null&&p.push(N("picker.offerStarts",{time:xi(r.startsAt,this.eventTimezone,this.opts.locale)})),m.textContent=p.join(" \xB7 "),s||l.append(c),l.append(d,m),s){e.classList.add("sl-offer-compact"),a.append(l),e.replaceChildren(a),e.classList.add("has");return}let v=document.createElement("details");v.className="sl-offer-info";let g=document.createElement("summary");g.setAttribute("aria-label",N("picker.howOfferWorks",{name:d.textContent??""})),g.textContent="i";let T=document.createElement("div");T.className="sl-offer-detail",T.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."),v.append(g,T),a.append(l,v),e.replaceChildren(a),e.classList.add("has")}paidPrice(e,t,n,r){let o=r?this.channelByObject.get(r):void 0;if(o&&e){let a=this.pricesByChannel.get(o)?.find(l=>l.categoryKey===e&&l.tierId===(t??null));if(a)return a.price}let s=e?this.opts.pricing?.prices?.[e]:void 0;return s===void 0?n:typeof s=="number"?s:t&&s.tiers?.[t]!==void 0?s.tiers[t]:s.base??n}legendDeps(){return Fl(this)}syncPriceRail(e,t,n=this.legendDeps()){Vl(this,e,t,n)}syncPrices(){this.currencyResolved&&zl(this)}focusCategory(e){$l(this,e)}evictTakenSelections(){let e=new Set([...this.controller.currentHold()?.labels??[],...this.holdingLabels]),t=this.controller.getSelection().filter(n=>!e.has(n.label)&&(this.controller.getStatus(n.id)??"free")!=="free");t.length&&(this.controller.deselect(t.map(n=>n.id)),this.toast(N("picker.seatJustTakenByAnother",{label:t[0].label}),"error"))}syncTray(){if(!this.els.tray)return;this.updateSelectionCapacity();let{seats:e,gaAreas:t,heldItems:n,heldLabels:r,total:o,count:s}=dn(this),a=[],l=new Set;if(!this.salesClosed){let f=this.performanceGroup?.nightSummary?.()??[];f.length&&a.push(aa(f,{title:this.tf("picker.group.yourSeatsByNight","Your seats by night"),empty:this.tf("picker.group.noSeatsChosenYet","No seats yet")}));let L=this.performanceGroup?.selectionModeSwitch;L&&a.push(`<button type="button" class="sl-pg-switch" data-pg-switch-mode>${_(L.label)}</button>`)}let c={salesClosed:this.salesClosed,salesState:this.salesState,hasPicks:e.length>0||n.length>0,hasGaAreas:t.length>0,groupMode:this.performanceGroup?this.performanceGroup.selectionMode??"same_seat":null,seated:!!this.controller.doc?.objects?.some(f=>f.type!=="gaArea"),venue3d:this.buyerView==="venue3d",whenText:this.eventWhenText?String(this.eventWhenText):void 0};a.push(Do(c)),this.els.trayHint&&(this.els.trayHint.textContent=Bo(c)),this.els.seatsInfo&&(this.els.seatsInfo.hidden=this.salesClosed);let d=!e.length&&!n.length&&!Be(this.gaQty,this.hold?.items??[]);if(!this.performanceGroup&&!this.salesClosed&&!this.hold&&(d||this.bestAvailableBusy||this.bestAvailableConfirm)){let f=(this.controller.doc?.categories??[]).filter(M=>!M.notForSale),L=this.controller.getBestAvailableZones();this.baZone&&!L.some(M=>M.id===this.baZone)&&(this.baZone="");let D=Mi(f,this.controller.categoryAvailability());this.baSoldOutSig=[...D].join("|"),this.bestAvailableSoldOut=f.length>0&&D.size===f.length,D.has(this.baCat)&&(this.baCat=""),(!this.bestAvailableSoldOut||this.bestAvailableBusy||this.bestAvailableConfirm)&&a.push(Oo({confirming:this.bestAvailableConfirm,busy:this.bestAvailableBusy,reopened:!1,quantity:this.baQty,premium:this.baPremium,offerPremium:this.controller.hasPremiumSeats(),categories:f.map(M=>D.has(M.key)?{...M,soldOut:!0}:M),zones:L,selectedCategory:this.baCat,selectedZone:this.baZone}))}let u=(f,L,D,M=1,O,A,I,j)=>Ro({categoryLabel:I,offerName:j,d:f?this.controller.seatDetails(f):null,area:D==="ga"?t.find($=>$.id===O):void 0,label:L,objectType:D,quantity:M,identity:A,performanceLabel:this.performanceGroup?.activePerformanceLabel?.(),performanceDates:this.performanceGroup?.selectedPerformanceDates?.()}),m=_,p=[];for(let f of rs(n)){let L=f.objectType==="ga"?`held:ga:${f.objectId}:${f.tierId??""}`:`held:${f.label}`;l.add(L);let D=this.controller.doc?.categories.find(mt=>mt.key===f.categoryKey),M=this.performanceGroup||this.suppressPricing?null:za(this.controller,f),O=f.tierId&&!M?D?.tiers?.find(mt=>mt.id===f.tierId)?.name:void 0,A=this.offerPrice(f.categoryKey,f.tierId??null)?.offerName,I=f.objectType!=="ga"?this.controller.seatByLabel(f.label):null,j=f.objectType==="table"?this.controller.tableSelection(f.label):null,$=I?this.controller.seatDetails(I.id):null,de=this.seatViewEnabled()&&!!I&&f.objectType!=="table"&&!!this.deliverableViewReference(I),Te=m(this.tf("picker.heldForYou","Held for you")),qe=(j?.bookingMode==="variable"?`<button type="button" class="sl-table-edit" data-table-edit="${m(encodeURIComponent(f.label))}">${m(N("picker.guestsCountEdit",{count:f.quantity??1}))}</button>`:"")+(M?`<select class="tier" data-held-tier="${m(f.label)}" aria-label="${m(N("picker.ticketTierFor",{label:f.label}))}">${On(M,f.tierId??void 0,m)}</select>`:""),ye=this.paidPrice(f.categoryKey,f.tierId,f.unitPrice,f.label)*(f.quantity??1);p.push({key:L,fresh:!this.lastTrayKeys.has(L),held:!0,seatIds:[],heldLabels:f.labels,removeAria:N("picker.removeHeldTicketLabel",{label:$n(f,t)}),locateId:I?.id??null,section:$?.sectionLabel??"",rowLabel:$&&q($)||"",seatLabel:$?.seatNumber??f.label,categoryLabel:`${D?.label??f.categoryKey}${O?` \xB7 ${O}`:""}`,categoryColor:this.controller.getRenderer?.()?.categoryDisplayColor?.(f.categoryKey)??D?.color??"",identityHtml:u(I?.id??null,f.label,f.objectType,f.quantity??1,f.objectId,j??void 0,`${D?.label??f.categoryKey}${O?` \xB7 ${O}`:""}`,A),stateHtml:`<span class="sl-ticket-state held" aria-label="${Te}" title="${Te}"><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:qe,amount:ye,amountText:this.suppressPricing?"":this.money(ye),noteHtml:Qe(I??void 0),railHtml:this.performanceGroup?"":_n(N("picker.removeHeldTicketLabel",{label:$n(f,t)}),de?f.label:null)})}let v=this.seatViewEnabled();for(let f of e.filter(L=>!r.has(L.label))){let L=`seat:${f.id}`;l.add(L);let D=this.controller.doc?.categories.find(ye=>ye.key===f.categoryKey),M=f.tiers&&f.tiers.length&&!this.suppressPricing?`<select class="tier" data-tier="${m(f.id)}" aria-label="${m(N("picker.ticketTierFor",{label:f.label}))}">`+On(f.tiers,f.tierId,m)+"</select>":"",O=f.tiers?.find(ye=>ye.id===f.tierId)??f.tiers?.[0],A=this.offerPrice(f.categoryKey,O?.id??null)?.offerName,I=O?.buyerMessage?.trim()||(O?.restriction==="companion"?this.tf("picker.companionRequiresWheelchair","Requires the adjacent wheelchair place"):""),j=this.controller.seatDetails(f.id),$=m(this.tf("picker.selected","Selected")),de=N("picker.removeSeatLabel",{label:f.label}),Te=(f.objectType==="table"&&f.bookingMode==="variable"?`<button type="button" class="sl-table-edit" data-table-edit="${m(encodeURIComponent(f.label))}">${m(N("picker.guestsCountEdit",{count:f.quantity??1}))}</button>`:"")+M,qe=this.paidPrice(f.categoryKey,f.tierId??null,f.price,f.label)*(f.quantity??1);p.push({key:L,fresh:!this.lastTrayKeys.has(L),held:!1,seatIds:[f.id],heldLabels:[],locateId:f.id,section:j?.sectionLabel??"",rowLabel:j&&q(j)||"",seatLabel:j?.seatNumber??f.label,categoryLabel:D?.label??f.categoryKey,identityHtml:u(f.id,f.label,f.objectType,f.quantity??1,f.objectId,f,D?.label??f.categoryKey,A),categoryColor:this.controller.getRenderer?.()?.categoryDisplayColor?.(f.categoryKey)??D?.color??"",stateHtml:`<span class="sl-ticket-state" aria-label="${$}" title="${$}"><svg viewBox="0 0 24 24"><path d="M5 12l4 4L19 6"/></svg></span>`,extrasHtml:Te,amount:qe,amountText:this.suppressPricing?"":this.money(qe),removeAria:de,noteHtml:Qe(f)+(I?`<small class="sl-tier-note">${m(I)}</small>`:""),railHtml:_n(de,v&&f.objectType!=="table"&&this.deliverableViewReference(this.controller.seatByLabel(f.label)??{})?f.label:null)})}p.length&&a.push(p.map(Io).join("")),t.length&&a.push(ds(this,t,n)),this.els.tray.innerHTML=a.join("")+(this.salesClosed?"":this.lapse.noteHtml()),this.lastTrayKeys=l,this.lapse.wire(this.els.tray),this.els.tray.querySelector("[data-pg-switch-mode]")?.addEventListener("click",()=>this.performanceGroup?.selectionModeSwitch?.activate());let g=this.performanceGroup?.selectNight;g&&ya(this.els.tray,f=>g(f)),this.els.tray.querySelectorAll("[data-ba]").forEach(f=>{f.addEventListener("click",()=>{this.baQty=Math.max(1,Math.min(this.maxTickets,this.baQty+Number(f.dataset.ba))),this.syncTray()})}),this.els.tray.querySelector("[data-ba-cat]")?.addEventListener("change",f=>{this.baCat=f.target.value,this.scheduleFit()}),this.els.tray.querySelector("[data-ba-zone]")?.addEventListener("change",f=>{this.baZone=f.target.value}),this.els.tray.querySelector("[data-ba-premium]")?.addEventListener("click",()=>{this.baPremium=!this.baPremium,this.syncTray()}),this.els.tray.querySelector(".sl-ba-go")?.addEventListener("click",()=>{if(this.pendingSelectionCount()>0){this.bestAvailableConfirm=!0,this.syncTray(),this.els.tray.querySelector("[data-ba-replace]")?.focus();return}this.bestAvailable(this.baQty,this.baCat||void 0,{preferPremium:this.baPremium,zoneId:this.baZone||void 0})}),this.els.tray.querySelector("[data-ba-cancel]")?.addEventListener("click",()=>{this.bestAvailableConfirm=!1,this.syncTray(),this.els.tray.querySelector(".sl-ba-go")?.focus()}),this.els.tray.querySelector("[data-ba-replace]")?.addEventListener("click",()=>{this.bestAvailableConfirm=!1,this.bestAvailable(this.baQty,this.baCat||void 0,{preferPremium:this.baPremium,zoneId:this.baZone||void 0})}),this.els.tray.querySelectorAll(".sl-chip .rm").forEach(f=>{f.addEventListener("click",()=>{let L=f.closest(".sl-chip");if(L.dataset.held){this.removeHeldLabels(decodeURIComponent(L.dataset.held).split(`
3380
+ </div>`,e.append(n)}buildErrorCard(e,t){let n=Ip[t],r=document.createElement("div");Object.assign(r.style,{maxWidth:"420px",margin:"auto 24px",padding:"28px",textAlign:"center",background:"rgba(255, 255, 255, 0.03)",border:"1px solid rgba(255, 255, 255, 0.08)",borderRadius:"16px",boxShadow:"0 12px 40px rgba(0, 0, 0, 0.35)"});let o=document.createElement("h2");o.textContent=n.title,Object.assign(o.style,{margin:"0 0 8px",fontSize:"17px",fontWeight:"600",color:"#f4f7ff"});let s=document.createElement("p");s.textContent=n.body,Object.assign(s.style,{margin:"0 0 20px",fontSize:"13.5px",lineHeight:"1.5",color:"#aab4c8"});let a=document.createElement("button");a.type="button",a.textContent="Try again",Object.assign(a.style,{appearance:"none",cursor:"pointer",border:"0",borderRadius:"10px",padding:"10px 22px",fontSize:"14px",fontWeight:"600",color:"#101625",background:"#7aa2ff"}),a.addEventListener("click",()=>this.handleTryAgain()),r.append(o,s,a),e.append(r)}};function Ht(i,e){let t=document.createElement("div");t.className="sl-loading-state";let n=document.createElement("div");if(n.setAttribute("role",e.busy?"status":"alert"),n.setAttribute("aria-atomic","true"),e.busy){let s=document.createElement("div");s.className="sl-boot-spin",s.setAttribute("aria-hidden","true"),t.append(s)}let r=document.createElement("div");if(r.className="sl-boot-title",r.textContent=e.title,n.append(r),e.description){let s=document.createElement("p");s.className="sl-loading-description",s.textContent=e.description,n.append(s)}t.append(n);let o=null;return e.actionLabel&&(o=document.createElement("button"),o.type="button",o.className="sl-boot-retry",o.textContent=e.actionLabel,t.append(o)),i.replaceChildren(t),o}function Op(i){let{viewportWidth:e,viewportHeight:t,offsetTop:n,offsetLeft:r,clientWidth:o,clientHeight:s,innerHeight:a,largeViewportHeight:l}=i;if(![e,t,n,r].every(Number.isFinite)||e<=0||t<=0)return null;let c=Number.isFinite(o)&&o>0?o:e,d=Number.isFinite(s)&&s>0?s:t,u=n;return Number.isFinite(l)&&a>l+1&&d<l-1&&(u=Math.max(u,l-d)),{width:Math.min(e,c),height:Math.min(t,d),top:u,left:r}}function _s(i){let e=window.visualViewport;if(!e)return()=>{};let t=document.createElement("div");t.setAttribute("aria-hidden","true"),Object.assign(t.style,{position:"absolute",visibility:"hidden",pointerEvents:"none",width:"0",height:"100lvh",overflow:"hidden"}),document.body.appendChild(t);let n=()=>{let c=Op({viewportWidth:e.width,viewportHeight:e.height,offsetTop:e.offsetTop,offsetLeft:e.offsetLeft,clientWidth:document.documentElement.clientWidth,clientHeight:document.documentElement.clientHeight,innerHeight:window.innerHeight,largeViewportHeight:t.getBoundingClientRect().height});c&&Object.assign(i.style,{right:"auto",bottom:"auto",top:`${c.top}px`,left:`${c.left}px`,width:`${c.width}px`,height:`${c.height}px`})},r=0,o=0,s=0,a=()=>{r&&window.cancelAnimationFrame(r),o&&window.cancelAnimationFrame(o),s&&window.clearTimeout(s),r=window.requestAnimationFrame(()=>{r=0,o=window.requestAnimationFrame(()=>{o=0,n()})}),s=window.setTimeout(()=>{s=0,n()},250)},l=()=>{n(),a()};return l(),e.addEventListener("resize",l),e.addEventListener("scroll",l),window.addEventListener("resize",l),window.addEventListener("orientationchange",l),window.addEventListener("pageshow",l),()=>{r&&window.cancelAnimationFrame(r),o&&window.cancelAnimationFrame(o),s&&window.clearTimeout(s),e.removeEventListener("resize",l),e.removeEventListener("scroll",l),window.removeEventListener("resize",l),window.removeEventListener("orientationchange",l),window.removeEventListener("pageshow",l),t.remove()}}function Ns(i,e){let t=new Set(["chart","objects","resume","availability"]),n=new Map;return new Proxy(Object.create(i),{get(r,o){let s=i,a=Reflect.get(s,o,s);return typeof a!="function"?a:(n.has(o)||n.set(o,t.has(String(o))?async(...l)=>{let c=await vt(()=>a.apply(s,l),e,()=>{});if(c.outcome==="loaded")return c.value;if(c.outcome==="error")throw c.error;let d=new Error(c.outcome==="timeout"?"request_timeout":"request_cancelled");throw d.name=c.outcome==="timeout"?"TimeoutError":"AbortError",d}:a.bind(s)),n.get(o))}})}import{PickerController as ru,effectiveFloorOverview as ou,formatMoney as su,getLocale as ic,loadLocale as au,setStringOverrides as lu,t as N,tCount as wn}from"@seatlayer/core";import{isAuthoredSeatView as cu,seatViewDisclosure as du}from"@seatlayer/core/view3d/crossfade/panorama";function Ds(i){return!!i&&i.clientWidth>0&&i.scrollWidth>i.clientWidth+1}function _p(i){return i.some(e=>Ds(e))}var tn="data-fit-gone",Np=12;function er(i,e,t=Ds){if(!i)return 0;for(let n of e)i.classList.remove(n.cls);if(i.querySelectorAll(`[${tn}]`).forEach(n=>{n.removeAttribute(tn),n.hidden=!1}),i.dataset.fit="0",i.clientWidth<=0||!t(i))return 0;for(let n=0;n<e.length;n+=1){let r=e[n];n>0&&i.classList.remove(e[n-1].cls),i.classList.add(r.cls),i.dataset.fit=String(n+1);let o=r.give?r.give(i):!0;if(!t(i))return n+1;if(r.repeat&&r.give){for(let s=1;o&&s<Np;s+=1)if(o=r.give(i),!t(i))return n+1}}return e.length}function Dp(i,e="[data-fit-seg]"){let t=[...i.querySelectorAll(e)].filter(n=>!n.hidden);return t.length<2?!1:Bs(t[t.length-1])}function Bp(i,e){let t=i.querySelector(e);return t&&!t.hidden?Bs(t):!1}function Bs(i){let e=i.previousElementSibling;return e instanceof HTMLElement&&e.tagName==="I"&&(e.setAttribute(tn,""),e.hidden=!0),i.setAttribute(tn,""),i.hidden=!0,!0}function Fp(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 Fs(i){if(!i)return 0;let e=i.querySelector(".sl-confirm-cancel"),t=i.querySelector(".sl-confirm-add-t");return er(i,[{cls:"sl-fit-track"},{cls:"sl-fit-type"},{cls:"sl-fit-icon",give:()=>Fp(e)}],()=>_p([e,t]))}function Vs(i){return er(i,[{cls:"sl-fit-notype",give:e=>Bp(e,"[data-fit-type]")},{cls:"sl-fit-short",give:e=>Dp(e),repeat:!0}])}function zs(i){return i?(i.classList.add("sl-fitpill"),er(i,[{cls:"sl-fit-p1"},{cls:"sl-fit-p2"},{cls:"sl-fit-p3"}])):0}var Rt;function $s(i){if(!i)return!1;delete i.dataset.fit;let e=i.selectedOptions?.[0]?.textContent??i.options[i.selectedIndex]?.textContent??"",t=i.clientWidth;if(!e||!t)return!1;if(Rt===void 0)try{Rt=document.createElement("canvas").getContext("2d")}catch{Rt=null}if(!Rt)return!1;let n=getComputedStyle(i);Rt.font=`${n.fontStyle} ${n.fontWeight} ${n.fontSize} ${n.fontFamily}`;let r=Rt.measureText(e).width,o=(parseFloat(n.paddingLeft)||0)+(parseFloat(n.paddingRight)||0)+(parseFloat(n.borderLeftWidth)||0)+(parseFloat(n.borderRightWidth)||0);return r+o<=t?!1:(i.dataset.fit="row",!0)}var Vp=["on-sale","low","sold-out","presale","closed"];function ni(i){return i==null?null:typeof i=="number"&&Number.isFinite(i)&&i>=0?i:void 0}function tr(i){return i==null?null:typeof i=="number"&&Number.isFinite(i)&&i>=0?i:void 0}function js(i){if(i==null)return null;if(typeof i!="object"||Array.isArray(i))return;let e=i,t=e.count,n=e.index;if(typeof n!="number"||!Number.isInteger(n)||n<1||typeof t!="number"||!Number.isInteger(t)||t<n)return;let r=e.remaining;if(r!=null&&(typeof r!="number"||!Number.isInteger(r)||r<0))return;let o={index:n,count:t,remaining:r??null};if(e.pricingMode!==void 0){if(e.pricingMode!=="matrix")return;o.pricingMode="matrix"}if(e.id!==void 0){if(typeof e.id!="string"||!e.id.trim())return;o.id=e.id.trim()}if(e.name!==void 0){if(typeof e.name!="string"||!e.name.trim())return;o.name=e.name.trim()}if(e.categoryKey!==void 0){if(e.categoryKey!==null&&(typeof e.categoryKey!="string"||!e.categoryKey.trim()))return;o.categoryKey=e.categoryKey==null?null:e.categoryKey.trim()}for(let s of["startsAt","endsAt"]){if(e[s]===void 0)continue;let a=tr(e[s]);if(a===void 0)return;o[s]=a}return o}function zp(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 s of e.channels){if(!s||typeof s!="object"||Array.isArray(s))return;let a=s,l=typeof a.channelId=="string"?a.channelId.trim():"";if(!l||n.has(l)||!Number.isInteger(a.pricingVersion)||a.pricingVersion<0||!Array.isArray(a.priceOverrides))return;let c=[],d=new Set;for(let u of a.priceOverrides){if(!u||typeof u!="object"||Array.isArray(u))return;let m=u,p=typeof m.categoryKey=="string"?m.categoryKey.trim():"",v=m.tierId===null?null:typeof m.tierId=="string"&&m.tierId.trim()?m.tierId.trim():void 0,g=ni(m.price);if(!p||v===void 0||g===void 0||g===null)return;let T=`${p}\0${v??""}`;if(d.has(T))return;d.add(T),c.push({categoryKey:p,tierId:v,price:g})}n.add(l),t.push({channelId:l,pricingVersion:a.pricingVersion,priceOverrides:c})}let r=[],o=new Set;for(let s of e.objects){if(!s||typeof s!="object"||Array.isArray(s))return;let a=s,l=typeof a.label=="string"?a.label.trim():"",c=typeof a.channelId=="string"?a.channelId.trim():"";if(!l||o.has(l)||!n.has(c))return;o.add(l),r.push({label:l,channelId:c})}return{assignmentVersion:e.assignmentVersion,channels:t,objects:r}}function ir(i){if(!i||typeof i!="object"||Array.isArray(i))return null;let e=i,t=Vp.find(u=>u===e.state);if(!t)return null;let n=ni(e.fromPrice),r=ni(e.previousPrice);if(n===void 0||r===void 0)return null;let o=e.currency==null?null:typeof e.currency=="string"&&e.currency.trim()?e.currency.trim():void 0;if(o===void 0)return null;let s=js(e.release);if(s===void 0)return null;let a=e.upcoming===void 0?null:js(e.upcoming);if(a===void 0)return null;let l=[];if(e.prices!=null){if(!Array.isArray(e.prices))return null;let u=[];for(let m of e.prices){if(!m||typeof m!="object"||Array.isArray(m))return null;let p=m,v=typeof p.categoryKey=="string"?p.categoryKey.trim():"";if(!v)return null;let g=ni(p.price),T=ni(p.previousPrice);if(g==null||T===void 0)return null;let S={categoryKey:v,price:g,previousPrice:T};if(p.tierId!==void 0){if(p.tierId!==null&&(typeof p.tierId!="string"||!p.tierId.trim()))return null;S.tierId=p.tierId===null?null:p.tierId.trim()}if(p.offerId!==void 0){if(typeof p.offerId!="string"||!p.offerId.trim())return null;S.offerId=p.offerId.trim()}if(p.offerName!==void 0){if(typeof p.offerName!="string"||!p.offerName.trim())return null;S.offerName=p.offerName.trim()}if(p.remaining!==void 0){if(p.remaining!==null&&(typeof p.remaining!="number"||!Number.isInteger(p.remaining)||p.remaining<0))return null;S.remaining=p.remaining==null?null:p.remaining}for(let y of["startsAt","endsAt"]){if(p[y]===void 0)continue;let P=tr(p[y]);if(P===void 0)return null;S[y]=P}u.push(S)}l=u}let c=zp(e.channelPricing);if(c===void 0)return null;let d=tr(e.nextPriceChangeAt);return d===void 0?null:{state:t,fromPrice:n,previousPrice:r,currency:o,release:s,upcoming:a,prices:l,channelPricing:c,...e.nextPriceChangeAt!==void 0?{nextPriceChangeAt:d}:{}}}function Gs(i){return i?.changed!==!1}function Ks(i,e){if(!i)return null;let t=null,n=r=>{r!=null&&r>e&&(t===null||r<t)&&(t=r)};for(let r of[i.release,i.upcoming])n(r?.startsAt),n(r?.endsAt);for(let r of i.prices)n(r.startsAt),n(r.endsAt);return n(i.nextPriceChangeAt),t}function Us(i){let e={};for(let t of i?.prices??[])if(t.tierId==null)e[t.categoryKey]=t.price;else{let n=e[t.categoryKey],r=typeof n=="number"?{base:n}:n??{};e[t.categoryKey]={...r,tiers:{...r.tiers,[t.tierId]:t.price}}}return e}function qs(i,e){let t={...i};for(let[n,r]of Object.entries(Us(e))){let o=t[n];t[n]=typeof r=="number"?r:{...typeof o=="number"?{base:o}:o,...r,tiers:{...typeof o=="object"?o.tiers:{},...r.tiers}}}return t}import{tCount as $p}from"@seatlayer/core";var Ws="maintenance_mode";function jp(i){if(!i||typeof i!="object")return!1;let e=i;return e.reason===Ws||e.code===Ws}function Gp(i){return typeof i!="number"||!Number.isFinite(i)||i<0?null:Math.max(1,Math.ceil(i/60))}function nr(i){if(!jp(i))return null;if(typeof i.notice=="string"&&i.notice.trim())return i.notice.trim();let e=Gp(i.retryAfterS);if(e===null)return b("picker.maintenancePausedShortly","Booking is paused for a few minutes for maintenance. Please try again shortly.");let t=$p("picker.maintenancePaused",e);return t==="picker.maintenancePaused"?`Booking is paused for maintenance. Please try again in about ${e} minute${e===1?"":"s"}.`:t}var Ys=["pointerdown","pointermove","keydown","wheel","touchstart"],nn=class{constructor(e){this.opts=e;this.timer=null;this.root=null;this.doc=null;this.disposed=!1;this.onInput=()=>this.touch();this.onVisibility=()=>{this.doc&&!this.doc.hidden&&this.check()};this.lastInput=this.now()}get enabled(){return this.opts.minutes>0}now(){return this.opts.now?this.opts.now():Date.now()}attach(e,t=e.ownerDocument){if(!(this.disposed||!this.enabled)){this.root=e,this.doc=t;for(let n of Ys)e.addEventListener(n,this.onInput,{capture:!0,passive:!0});t.addEventListener("visibilitychange",this.onVisibility),this.touch()}}touch(){this.lastInput=this.now(),this.arm(this.opts.minutes*6e4)}recentlyActive(){return!this.enabled||this.now()-this.lastInput<this.opts.minutes*6e4}resume(){this.disposed||this.touch()}dispose(){if(this.disposed=!0,this.clear(),this.root)for(let e of Ys)this.root.removeEventListener(e,this.onInput,{capture:!0});this.doc?.removeEventListener("visibilitychange",this.onVisibility),this.root=null,this.doc=null}arm(e){if(this.disposed||!this.enabled)return;this.clear();let t=this.opts.setTimeout??((n,r)=>setTimeout(n,r));this.timer=t(()=>{this.timer=null,this.check()},Math.max(0,e))}clear(){if(this.timer===null)return;(this.opts.clearTimeout??(t=>clearTimeout(t)))(this.timer),this.timer=null}check(){if(this.disposed||!this.enabled)return;let e=this.lastInput+this.opts.minutes*6e4-this.now();if(e>0){this.arm(e);return}if(this.opts.blocked()){this.arm(6e4);return}this.clear(),this.opts.onIdle()}};async function Zs(i,e){let t=await i.pubApi?.pickerIdleMinutes().catch(()=>null)??null;if(i.destroyed||i.idleClock)return;let n=new nn({minutes:t??30,blocked:()=>!!i.hold,onIdle:()=>Qs(i)});n.enabled&&(i.idleClock=n,n.attach(e))}function Qs(i){i.destroyed||!i.root||i.holdExpiredEl||(i.realtime?.stop(),i.realtime=null,i.showAccessPanel({reason:"idle",retryable:!0}))}async function Xs(i){if(i.destroyed)return!1;if(i.pubApi?.rotateViewerId(),i.access?.configured){let e=await i.refreshAccess();return e&&i.idleClock?.resume(),e}return i.dismissAccessPanel(),await i.controller.refresh(),i.realtime?i.realtime.restart():i.startRealtime(),i.idleClock?.resume(),!0}function Js(i){if(!i.destroyed){if(i.hold||i.idleClock?.recentlyActive()){i.pubApi?.rotateViewerId(),i.realtime?.restart();return}Qs(i)}}function ea(i,e,t=[],n=8,r=[]){let o=e.reduce((l,c)=>!c||c.width<=0||c.height<=0?l:Math.max(l,c.bottom-i.top+n),0),s=t.reduce((l,c)=>!c||c.width<=0||c.height<=0?l:Math.max(l,i.bottom-c.top+n),o>0?n:0),a=r.reduce((l,c)=>!c||c.width<=0||c.height<=0?l:Math.max(l,i.right-c.left+n),0);return{top:Math.max(0,Math.ceil(o)),right:Math.max(0,Math.ceil(a)),bottom:Math.max(0,Math.ceil(s)),left:0}}function ta(i){let e=document.createElement("div");e.className="sl-floors sl-levels on",e.setAttribute("role","group"),e.setAttribute("aria-label",i.tf("picker.chooseLevel","Choose level")),e.title=i.tf("picker.floorHelp","All levels shows the complete venue. Choose one level to inspect and select its seats.");let t=i.tf("picker.allLevels","All levels"),n=[...i.floors.map((r,o)=>({id:r.id,name:r.name,code:Kp(o)})).reverse(),{id:"",name:t,code:""}];for(let r of n){let o=document.createElement("button");if(o.type="button",o.className="sl-level",o.dataset.level=r.id,o.setAttribute("aria-pressed","false"),o.title=r.name,r.code){let a=document.createElement("b");a.className="sl-level-code",a.textContent=r.code,o.appendChild(a),o.setAttribute("aria-label",`${r.name} (${r.code})`)}let s=document.createElement("span");if(s.className="sl-level-name",s.textContent=r.name,o.appendChild(s),!r.code){let a=document.createElement("span");a.className="sl-level-short",a.setAttribute("aria-hidden","true"),a.textContent=i.tf("picker.allLevelsShort","All"),o.appendChild(a)}o.addEventListener("click",()=>i.onChoose(r.id)),e.appendChild(o)}return e.addEventListener("keydown",r=>{if(r.key!=="ArrowUp"&&r.key!=="ArrowDown")return;let o=[...e.querySelectorAll(".sl-level")],s=o.indexOf(document.activeElement);s<0||(r.preventDefault(),o[Math.max(0,Math.min(o.length-1,s+(r.key==="ArrowUp"?-1:1)))].focus())}),e}function Kp(i){return i===0?"G":String(i)}function ia(i,e,t){if(!i)return;let n=t?"":e;for(let r of i.querySelectorAll(".sl-level"))r.setAttribute("aria-pressed",String(r.dataset.level===n))}var rn=class{constructor(e){this.el=null;this.current=null;this.collapsed=!1;this.shownAt=0;this.host=e}get summary(){return this.current}adopt(e){this.current=e}get element(){return this.el}show(e){if(e&&e.id!==this.current?.id&&this.host.collapseSheet(),this.current=e,!e){this.el?.remove(),this.el=null,this.host.refreshMinimap();return}this.collapsed=this.host.controller.getRung()==="seats",this.shownAt=Date.now(),this.render(e),this.host.refreshMinimap()}render(e){this.el?.remove(),this.el=null}collapse(){!this.el||this.collapsed||!this.current||(this.collapsed=!0,this.render(this.current))}onView(){if(!(!this.el||this.collapsed||!this.current)){if(this.host.controller.getRung()==="seats"){this.collapse();return}if(Date.now()-this.shownAt<1400){this.coverage()>.25&&this.collapse();return}this.collapse()}}coverage(){let e=this.el,t=this.current,n=this.host.map();if(!e||!t||!n)return 0;let r=this.host.activeFloorObjects().find(y=>y.type==="section"&&y.id===t.id)?.outline;if(!r||r.length<3)return 0;let o=r.map(y=>this.host.controller.worldToScreen(y)),s=o.map(y=>y.x),a=o.map(y=>y.y),l=Math.min(...s),c=Math.min(...a),d=Math.max(...s)-l,u=Math.max(...a)-c;if(d<=0||u<=0)return 0;let m=n.getBoundingClientRect(),p=e.getBoundingClientRect(),v=p.left-m.left,g=p.top-m.top,T=Math.max(0,Math.min(v+p.width,l+d)-Math.max(v,l)),S=Math.max(0,Math.min(g+p.height,c+u)-Math.max(g,c));return T*S/(d*u)}};import{t as cr,tCount as oh}from"@seatlayer/core";import{contrastRatio as sh}from"@seatlayer/core/core/color";import{t as na,tCount as on}from"@seatlayer/core";function rr(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 sn=(i,e)=>rr(i,e,{dateStyle:"medium"}),an=(i,e)=>rr(i,e,{timeStyle:"short"}),It=(i,e)=>rr(i,e,{weekday:"short",day:"numeric",month:"short"});function ra(i,e,t,n){return!i.length||i.length>=e?null:{summary:n,labels:i.map(r=>`${sn(r,t)} \xB7 ${an(r,t)}`)}}function Up(i,e){let t=new Set(e);return i.map(n=>({...n,free:!t.has(n.eventKey)}))}function oa(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 qp(i,e,t="",n=!1){if(!i.length)return"";let r=i.map(o=>{let s=o.free?e.free:e.blocked,a=n&&o.free?`<input class="sl-night-choice" type="checkbox" data-pg-event-key="${E(o.eventKey)}" aria-label="${E(`${o.shortDate}: ${s}`)}" checked>`:"";return`<li class="sl-night${o.free?" ok":" no"}" aria-label="${E(`${o.shortDate}: ${s}`)}">`+a+`<i class="sl-night-dot" aria-hidden="true"></i><span class="d">${E(o.shortDate)}</span><span class="st">${E(s)}</span></li>`}).join("");return`<div class="sl-tip-nights"><div class="sl-tip-nights-title">${E(e.title)}</div><ul class="sl-nightstrip">${r}</ul><p class="sl-tip-nights-note">${E(e.notAvailableOn)}</p>`+t+"</div>"}function Wp(i){return i.selectPartialLabel&&i.pinned?`<button type="button" class="sl-tip-switch" data-pg-select-partial>${E(i.selectPartialLabel)}</button>`:i.switchLabel&&i.pinned?`<button type="button" class="sl-tip-switch" data-pg-switch-mode>${E(i.switchLabel)}</button>`:i.switchLabel||i.selectPartialLabel?"":`<p class="sl-tip-advice">${E(i.advice)}</p>`}function Yp(i){return Number(i.available)+Number(i.selected)+Number(i.partial)+Number(i.unavailable)}function sa(i,e,t){if(Yp(i)<2)return"";let n=(o,s,a="")=>`<li class="sl-pg-legend-item"><i class="sl-pg-sw ${o}"${a}></i>${E(s)}</li>`,r=[];return i.available&&r.push(n("sl-pg-sw-free",e.available,` style="background:${E(t)}"`)),i.selected&&r.push(n("sl-pg-sw-sel",e.selected)),i.partial&&r.push(n("sl-pg-sw-split",e.partial,` style="--sl-pg-sw-cat:${E(t)}"`)),i.unavailable&&r.push(n("sl-pg-sw-off",e.unavailable)),`<ul class="sl-pg-legend-list" aria-label="${E(e.title)}">${r.join("")}</ul>`}function aa(i,e){if(!i.length)return"";let t=i.map(n=>{let r=n.labels.length?n.labels.join(", "):e.empty;return`<li class="sl-pg-night-row${n.labels.length?"":" empty"}${n.active?" active":""}" role="button" tabindex="0"${n.active?' aria-current="true"':""} data-event-key="${E(n.eventKey)}"><span class="n">${E(n.name)}</span><span class="s">${E(r)}</span></li>`}).join("");return`<div class="sl-pg-nights" role="group" aria-label="${E(e.title)}"><div class="sl-pg-nights-title">${E(e.title)}</div><ul class="sl-pg-nights-list">${t}</ul></div>`}function or(i,e){if(i?.kind!=="partial"||!e?.length)return null;let t=i.data?.blockedEventKeys??[],n=Up(e,t);return{states:n,missing:n.filter(r=>!r.free).map(r=>r.shortDate)}}function la(i,e){return i?qp(i.states,{title:b("picker.group.partlyAvailableTitle","Free on some nights only"),free:b("picker.group.nightFree","Free"),blocked:b("picker.group.nightBlocked","Not available"),notAvailableOn:na("picker.group.notAvailableOn",{dates:oa(i.missing,e.locale)})},Wp({switchLabel:e.switchLabel??null,selectPartialLabel:e.selectPartialLabel??null,pinned:e.pinned,advice:b("picker.group.pickSeatFreeEveryNight","Pick a seat that is free every night.")}),!!e.selectPartialLabel&&!!e.pinned):""}function Zp(i,e,t,n){if(!i.length)return"";let r=new Set(e),o=new Set(t),s=i.map(a=>{let l=r.has(a.eventKey);return`<li class="sl-confirm-date${l?"":" blocked"}"><label><input type="checkbox" data-pg-confirm-event-key="${E(a.eventKey)}" aria-label="${E(`${a.shortDate}: ${l?n.available:n.unavailable}`)}"${l&&o.has(a.eventKey)?" checked":""}${l?"":" disabled"}><span class="sl-confirm-date-label">${E(a.shortDate)}</span><span class="sl-confirm-date-state">${E(l?n.available:n.unavailable)}</span></label></li>`}).join("");return`<fieldset class="sl-confirm-dates" data-pg-confirm-dates><legend>${E(n.title)}</legend><p class="sl-confirm-dates-copy">${E(n.copy)}</p><label class="sl-confirm-date-all"><input type="checkbox" data-pg-confirm-all><span>${E(n.selectAll)}</span></label><ul>${s}</ul><p class="sl-confirm-dates-summary" data-pg-confirm-summary aria-live="polite"></p></fieldset>`}function ca(i,e,t,n){let r=e.availableEventKeys(t);return Zp(i,r,e.includedEventKeys(),{title:n("picker.group.confirmDatesTitle","Choose performance dates"),copy:r.length===i.length?n("picker.group.confirmAllDatesCopy","This seat is available for all {count} dates. Keep all selected, or remove dates you do not want.").replace("{count}",String(i.length)):n("picker.group.confirmPartialDatesCopy","This seat is available for {available} of {total} dates. Choose one date or keep every available date.").replace("{available}",String(r.length)).replace("{total}",String(i.length)),selectAll:n("picker.group.confirmSelectAll","Select all available dates"),available:n("picker.group.nightFree","Available"),unavailable:n("picker.group.nightBlocked","Unavailable")})}function da(i){return[...i.querySelectorAll("[data-pg-confirm-event-key]")].filter(e=>e.checked&&!e.disabled).map(e=>e.dataset.pgConfirmEventKey).filter(Boolean)}function pa(i,e,t,n){let r=[...i.querySelectorAll("[data-pg-confirm-event-key]")];if(!e||!r.length)return;let o=i.querySelector(".sl-confirm-add"),s=i.querySelector("[data-pg-confirm-all]"),a=()=>{let l=r.filter(u=>!u.disabled),c=da(i).length;s&&(s.checked=c===l.length,s.indeterminate=c>0&&c<l.length);let d=i.querySelector("[data-pg-confirm-summary]");d&&(d.textContent=c===l.length?t("picker.group.confirmAllSelected","All {count} available dates are selected.").replace("{count}",String(c)):t("picker.group.confirmSelectedOfAvailable","{selected} of {available} available dates selected.").replace("{selected}",String(c)).replace("{available}",String(l.length))),o.disabled=c===0,o.textContent=c?e.label(c):t("picker.group.confirmChooseOne","Choose at least 1 date"),n()};r.forEach(l=>l.addEventListener("change",a)),s?.addEventListener("change",()=>{r.filter(l=>!l.disabled).forEach(l=>{l.checked=s.checked}),a()}),a()}async function ha(i,e,t){if(!i||!t||!i.querySelector("[data-pg-confirm-event-key]"))return!0;let n=da(i);if(!n.length)return!1;let r=i.querySelector(".sl-confirm-add");return r?.setAttribute("aria-busy","true"),r&&(r.disabled=!0),await t.apply(e,n)?!0:(r?.removeAttribute("aria-busy"),r?.isConnected&&(r.disabled=!1),!1)}function ua(i,e,t){return i?na("picker.group.seatPartlyAvailable",{label:e,free:i.states.length-i.missing.length,total:i.states.length,dates:oa(i.missing,t)}):""}function ma(i,e){let t=i.map((n,r)=>{let o=n.state==="done"?e.done:n.state==="current"?e.current:e.upcoming;return`<li class="sl-pg-step-item" data-step="${E(n.id)}" data-state="${E(n.state)}"${n.state==="current"?' aria-current="step"':""}><span class="i" aria-hidden="true">${n.state==="done"?"\u2713":String(r+1)}</span><span class="l">${E(n.label)}</span><span class="sl-pg-sr">${E(o)}</span></li>`}).join("");return`<ol class="sl-pg-steps" aria-label="${E(e.label)}">${t}</ol>`}function sr(i,e){return`<ul class="sl-pg-cards">${i.map(n=>`<li class="sl-pg-card" data-event-key="${E(n.eventKey)}"><span class="n">${E(n.name)}</span><time datetime="${E(n.iso)}"><span class="d">${E(n.date)}</span><span class="t">${E(n.time)}</span></time></li>`).join("")}</ul><p class="sl-pg-included">${E(e)}</p>`}function fa(i){let e=i.rows.map(t=>`<li class="sl-pg-pane-row${t.labels.length?"":" empty"}" data-event-key="${E(t.eventKey)}"><span class="n">${E(t.name)}</span><span class="s">${E(t.labels.length?t.labels.join(", "):i.empty)}</span></li>`).join("");return`<div class="sl-pg-pane-title">${E(i.title)}</div><ul class="sl-pg-pane-list">${e}</ul>`+(i.note?`<p class="sl-pg-pane-note">${E(i.note)}</p>`:"")+(i.total?`<div class="sl-pg-pane-total"><span>${E(i.total.label)}</span><b>${E(i.total.amount)}</b></div>`:"")+(i.holdStatus?`<p class="sl-pg-hold-status" role="status">${E(i.holdStatus)}</p>`:"")}function ga(i){let e=Math.max(0,i);return`${Math.floor(e/6e4)}:${String(Math.floor(e/1e3)%60).padStart(2,"0")}`}function ba(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?on("picker.group.performancesChosenOf",t,{chosen:i.performances,total:i.totalPerformances}):on("picker.group.seatsEveryPerformance",t)}return i.perPerformance!=null&&i.performancesChosen===i.performances?on("picker.group.seatsPerPerformance",i.seats,{per:i.perPerformance}):on("picker.group.performancesChosenOf",i.seats,{chosen:i.performancesChosen,total:i.performances})}function ya(i,e){i.querySelectorAll(".sl-pg-night-row[data-event-key]").forEach(t=>{let n=()=>e(t.dataset.eventKey);t.addEventListener("click",n),t.addEventListener("keydown",r=>{r.key!=="Enter"&&r.key!==" "||(r.preventDefault(),n())})})}import{t as Qp}from"@seatlayer/core";function Fe(i){return String(i??"\u2014").replace(/[&<>"]/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[e])}function Xp(i,e){let t=i.objectType==="table"&&!!i.bookingMode,n=i.objectType==="booth",r=t||n||!i.seatNumber,o=r?i.rowLabel??i.displayLabel??i.label:i.seatNumber,s=t?`${b("picker.guests","Guests")} ${i.bookingMode==="variable"?`${i.minOccupancy}\u2013${i.maxOccupancy}`:i.capacity}`:!n&&i.rowLabel?`${e} ${q(i)??""}`.trim():"";return`<div class="sl-tip-head"><div class="sl-tip-id"><span class="sl-tip-seat${r?" name":""}">${Fe(o)}</span>`+(s?`<span class="sl-tip-row">${Fe(s)}</span>`:"")+"</div>"+(i.sectionLabel?`<div class="sl-tip-sec"><span class="sl-tip-eyebrow">${b("picker.section","Section")}</span><span class="sl-tip-secname">${Fe(i.sectionLabel)}</span></div>`:"")+"</div>"}function va(i,e){let t=i.status==="not_for_sale",n=i.mark?.kind==="partial",r=i.status==="free"||n?"":`<span class="sl-tip-tag">${t?b("picker.notAvailable","Not available"):i.status==="held"?Qp("map.statusHeld"):b("picker.sold","Sold")}</span>`,o=t?"":e.price,s=o?`<span class="sl-tip-amt">${Fe(o)}</span>`:"",a=!o&&e.priceNote?`<div class="sl-tip-note">${Fe(e.priceNote)}</div>`:"",l=Qe(i,{compact:!0}),c=e.reason?`<div class="sl-tip-reason">${Fe(e.reason)}</div>`:"";return'<i class="sl-tip-rail" aria-hidden="true"></i>'+Xp(i,e.rowTypeWord)+`<div class="sl-tip-cat"><span class="sl-tip-dot" style="background:${Fe(i.categoryColor)}"></span><span class="sl-tip-name">${Fe(i.categoryLabel)}</span>`+r+s+"</div>"+a+c+l+(e.extra??"")}function wa(i,e,t,n){let r=i.x+14,o=i.y-n.height-12,s=i.y+18,a=o;r+n.width>e-8&&(r=i.x-n.width-14),o<8&&s+n.height<=t-8&&(a=s);let l=Math.max(8,t-n.height-8);return{left:Math.max(8,Math.min(r,Math.max(8,e-n.width-8))),top:Math.max(8,Math.min(a,l))}}function xa(i,e,t,n=22){let r=Math.max(8,Math.min(i.x-t.width/2,Math.max(8,e.width-t.width-8))),o=i.y-n-t.height,s=i.y+n;return o>=8?{left:r,top:o,placement:"above"}:s+t.height<=e.height-8?{left:r,top:s,placement:"below"}:{left:r,top:Math.max(8,Math.min(o<8?s:o,Math.max(8,e.height-t.height-8))),placement:o<8?"below":"above"}}var ar=14,Jp=12,eh=12,th=8;function ka(i,e,t,n=Jp){let r=e.height-ar-t.height,o=eh,s=r-n;if(s<=o)return{placement:"sheet",nudgeY:0};let a=(o+s)/2-i;return Math.abs(a)<=th?{placement:"sheet",nudgeY:0}:{placement:"sheet",nudgeY:Math.round(a)}}function Sa(i,e,t,n,r=0){let o=t.width/2+12,s=Math.max(o,Math.min(e.width-o,i.x)),a=i.y+r+t.height+24<=e.height,l=i.y-r<t.height+24&&a?"below":"above",c=l==="above"?i.y-r:i.y+r,d=n&&l==="above"?Math.max(t.height+24,c):c;return{left:s,top:Math.max(8,Math.min(e.height-8,d)),placement:l}}function Ta(i,e,t){let n=i.querySelector("[data-pg-select-partial]"),r=[...i.querySelectorAll("[data-pg-event-key]")],o=()=>r.filter(a=>a.checked).map(a=>a.dataset.pgEventKey).filter(Boolean),s=()=>{if(!n)return;let a=o().length;n.disabled=a===0,n.textContent=e?.(a)??n.textContent};r.forEach(a=>{a.addEventListener("change",s);let l=a.closest(".sl-night");l?.classList.add("selectable"),l?.addEventListener("click",c=>{c.target!==a&&(a.checked=!a.checked,s())})}),n?.addEventListener("click",()=>{let a=o();a.length&&t?.(a)})}function it(i){let e=i?.displayType?.trim()||i?.rowType?.trim();return e||(i?.objectType==="table"?b("picker.table","Table"):i?.objectType==="booth"?b("picker.booth","Booth"):b("picker.row","Row"))}var ih="sl-confirm-scrim",nh="--sl-scrim-mask";function rh(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 Ea(i,e,t,n){let r=i??document.createElement("div");return i||(r.className=ih),r.style.setProperty(nh,rh(n)),t.parentNode===e?r.nextSibling!==t&&e.insertBefore(r,t):r.parentNode!==e&&e.appendChild(r),r}function lr(i){return i?.remove(),null}var Ca={passport:!1,compare:!1},ah=360,lh=160,ch=700,Aa=450,dh=8;function Pa(){try{return globalThis.matchMedia?.("(pointer: coarse)").matches??!1}catch{return!1}}function ph(i){return sh("#ffffff",i)>=3?"#ffffff":"#0b0f19"}var ln=class{constructor(e){this.el=null;this.seat=null;this.outsideTap=null;this.scrim=null;this.shownAt=0;this.lift=null;this.framing=null;this.mode="add";this.host=e}get element(){return this.el}set element(e){this.el=e}get candidate(){return this.seat}set candidate(e){this.seat=e}thumbHtml(e){let t=this.host.controller.doc;if(!t)return"";let n=Mt(e)?e.viewUrl??"":"",r=Ji(t);if(!n&&!r)return"";let o=n?null:en(e,e.focalPoint??t.focalPoint);if(!n&&o==null)return"";let s="";if(!n)return s;let a=_(cr("picker.viewFromSeat",{label:e.label})),l=_(this.host.tf("picker.viewFromHere","View from here"));return`<button type="button" class="sl-confirm-view sl-confirm-thumbwrap" aria-label="${a}"><img class="sl-confirm-thumb" alt="" /><span class="sl-confirm-thumb-badge">\u{1F52D} ${l}</span></button>`+s}show(e,t="add"){let n=this.host;this.mode=t;let r=this.seat?.id;this.el?.remove(),this.el=null,this.seat=e,n.root()?.setAttribute("data-confirming","true"),n.els().side?.toggleAttribute("inert",!0),Object.values(n.regions()).forEach(A=>A.toggleAttribute("inert",!0)),n.controller.setSelectionFocus(e.id),r&&r!==e.id&&n.controller.deselect([r]),n.hideTooltip();let o=n.controller.seatDetails(e.id),s=n.controller.doc?.categories.find(A=>A.key===e.categoryKey),a=o?.price??(s?.tiers?.length?s.tiers[0].price:s?.price),l=a!=null?n.paidPrice(e.categoryKey,o?.tierId??s?.tiers?.[0]?.id??null,a,e.label):void 0,c=xo(o,e.displayLabel??e.label,it(o)),d=o?.tiers??s?.tiers??[],u=o?.tierId??d[0]?.id,m=n.suppressPricing()?"":Li(d,u,A=>n.money(n.paidPrice(e.categoryKey,A.id,A.price,e.label)),A=>n.offerName(e.categoryKey,A.id)),p=n.buyerView()==="venue3d",v=n.performanceGroup()?.confirmDateSelection??void 0,g=v?n.performanceGroup()?.nights?.()??[]:[],T=v?ca(g,v,e.id,(A,I)=>n.tf(A,I)):"";this.shownAt=performance.now();let S=document.createElement("div");S.className="sl-confirm sl-mo-in",t==="remove"&&S.classList.add("sl-confirm-removing"),T&&S.classList.add("sl-confirm-group-dates"),S.setAttribute("role","dialog"),S.setAttribute("aria-label",cr("picker.confirmSeatLabel",{label:e.label}));let y=n.controller.getRenderer?.()?.categoryDisplayColor?.(e.categoryKey)??s?.color??"#6e7bff";S.style.setProperty("--sl-cat",y),S.style.setProperty("--sl-cat-ink",ph(y));let P=String(o?.categoryLabel??s?.label??e.categoryKey),R=n.controller.categoryAvailability()[e.categoryKey],G=typeof R=="number"&&R>0?oh("picker.leftCount",R):"",f=n.suppressPricing()?`${o?.displayLabel??e.displayLabel??e.label}`:`${o?.displayLabel??e.displayLabel??e.label} \xB7 ${l==null?n.tf("picker.priceNotSupplied","Price not supplied"):n.money(l)}`,L=Ca.passport?wo(e,f,p):"",D=Ca.compare?vo(e,p?n.view3dCompareSeatIds():null):"";S.innerHTML=Eo({identityFields:c,identity:ko(o,e.displayLabel??e.label,it(o)),marker:yo({...o?.wheelchairSpaceType?{wheelchairSpaceType:o.wheelchairSpaceType}:{}}),see3dPill:So(n.canOffer3d(),p),categoryColor:y,categoryLabel:P,priceLabel:!n.suppressPricing()&&l!=null?n.money(l):"",categoryLeftLabel:G,tierChoices:m,groupDates:T,wheelchair:"",commercial:Qe({...e.accessibility?.length?{accessibility:e.accessibility}:{},...o?.wheelchairSpaceType?{wheelchairSpaceType:o.wheelchairSpaceType}:{},...e.commercial?{commercial:e.commercial}:{},...o?.aisle?{aisle:!0}:{},...o?.boothType?{boothType:o.boothType}:{},...o?.entrance?{entrance:o.entrance}:{}}),thumb:n.seatViewEnabled()&&n.buyerView()!=="venue3d"?this.thumbHtml(e):"",inspect:p?`<div class="sl-confirm-inspect-row">${L}${D}${In(n.canOffer3d(),p)}</div>`:In(n.canOffer3d(),p),see3dRow:To(n.canOffer3d(),p),cancelLabel:cr("common.cancel"),selectLabel:t==="remove"?n.tf("picker.removeSeat","Remove seat"):n.addSeatLabel(o?.objectType)}),t==="remove"&&S.querySelector(".sl-confirm-add svg path")?.setAttribute("d","M6 6l12 12M18 6L6 18"),n.els().map.appendChild(S),this.el=S;let M=S.querySelector(".sl-confirm-thumb"),O=M?.closest(".sl-confirm-thumbwrap")??null;if(M&&O){let A=!1,I=()=>{if(A||!O.isConnected)return;A=!0;let $=()=>{O.remove(),this.el===S&&n.reanchor()};if(n.reducedMotion()||typeof requestAnimationFrame!="function"){$();return}O.style.height=`${O.offsetHeight}px`,O.classList.add("sl-confirm-thumb-out"),requestAnimationFrame(()=>{O.style.height="0px",O.style.opacity="0"}),setTimeout($,lh)};M.addEventListener("error",I),M.addEventListener("load",()=>{M.naturalWidth||I()});let j=e.viewMeta?.previewUrl??e.viewUrl;j?n.resolveAssetUrl(j).then($=>{if(!(!S.isConnected||this.el!==S)){if(!$){I();return}M.src=$}}).catch($=>{I(),n.onError($)}):I()}n.reanchor(),this.liftSeatClearOfSheet(e),S.querySelector(".sl-confirm-view")?.addEventListener("click",()=>{n.openSeatView(e)}),S.querySelector(".sl-confirm-confidence")?.addEventListener("click",A=>{n.openSeatConfidencePassport(e,A.currentTarget instanceof HTMLElement?A.currentTarget:null)}),S.querySelector(".sl-confirm-compare")?.addEventListener("click",()=>n.saveView3dComparisonSeat(e)),S.querySelectorAll("[data-confirm-tier]").forEach(A=>{A.addEventListener("click",()=>{let I=A.dataset.confirmTier,j=d.find(de=>de.id===I);if(!j)return;n.controller.setSeatTier(e.id,j.id),S.querySelectorAll("[data-confirm-tier]").forEach(de=>{de.setAttribute("aria-pressed",String(de===A))});let $=S.querySelector(".sl-confirm-price");$&&($.textContent=n.money(n.paidPrice(e.categoryKey,j.id,j.price,e.label))),n.reanchor()})}),S.querySelectorAll(".sl-confirm-3d,.sl-confirm-3dpill,.sl-confirm-3drow").forEach(A=>{A.addEventListener("pointerdown",vi,{once:!0}),A.addEventListener("click",()=>{n.buyerView()==="venue3d"?(n.dismiss(),n.view3dHandle()?.flyToSeat(e.id)):(n.rememberView3dReturnSeat(e),n.dismiss(),n.enter3d(e.id))})}),pa(S,v,(A,I)=>n.tf(A,I),()=>n.reanchor()),S.querySelector(".sl-confirm-add").addEventListener("click",()=>{if(!this.ghostActivation()){if(this.mode==="remove"){this.removeCommitted();return}this.commit()}}),S.querySelector(".sl-confirm-cancel").addEventListener("click",()=>{this.ghostActivation()||this.cancel()}),this.armOutsideTap(S),requestAnimationFrame(()=>{let A=S.querySelector(".sl-confirm-add");A?.focus(),n.liftToastOverConfirm(),n.fitTranslatedRows(),n.inviteCommit(S,A)})}liftSeatClearOfSheet(e){let t=this.host.controller.getRenderer();this.framing={gestures:t?.getCameraGestureCount?.()??0,quietUntil:0},this.frameSeatForSheet(e)}frameSeatForSheet(e){let t=this.host,n=t.root();if(!this.el||n?.dataset.layout!=="narrow"||n?.dataset.view3d==="on")return;let r=t.els().map;if(!r)return;let o=t.controller.worldToScreen({x:e.x,y:e.y}),s=t.controller.getRenderer(),a=s?.getCameraGestureCount?.()??0,{nudgeY:l}=ka(o.y,{height:r.clientHeight},{height:this.el.offsetHeight||230}),c=this.lift&&this.lift.gestures===a?this.lift.dy:0;if(!l){this.lift=c?{dy:c,gestures:a}:null;return}let d=!t.reducedMotion();s?.panScreenBy?.({x:0,y:l},{animate:d}),this.lift={dy:c+l,gestures:a},this.framing&&(this.framing.gestures=a,this.framing.quietUntil=d?this.now()+ch:0)}reframeSeatForSheet(){let e=this.framing,t=this.seat;!e||!t||e.quietUntil&&this.now()<e.quietUntil||(this.host.controller.getRenderer()?.getCameraGestureCount?.()??e.gestures)!==e.gestures||this.frameSeatForSheet(t)}now(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}settleLift(){let e=this.lift;if(this.lift=null,this.framing=null,!e)return;let t=this.host.controller.getRenderer();(t?.getCameraGestureCount?.()??e.gestures)===e.gestures&&t?.panScreenBy?.({x:0,y:-e.dy},{animate:!this.host.reducedMotion()})}reanchor(){let e=this.host;if(!this.el||!this.seat||e.root()?.dataset.view3d==="on")return;let t=e.controller.worldToScreen({x:this.seat.x,y:this.seat.y}),n=e.els().map;if(e.root()?.dataset.layout==="narrow"){this.el.removeAttribute("data-placement"),this.el.style.removeProperty("bottom"),this.scrim=Ea(this.scrim,n,this.el,t),Zo(this.el,t,n),e.liftToastOverConfirm(),this.reframeSeatForSheet();return}this.scrim=lr(this.scrim);let r=n.clientWidth,o=n.clientHeight,s=this.el.offsetWidth||276,a=this.el.offsetHeight||230,l=this.el.classList.contains("sl-confirm-group-dates"),c=e.controller.seatScreenRadius()*1.5,d=Sa(t,{width:r,height:o},{width:s,height:a},l,c);this.el.dataset.placement=d.placement,this.el.style.left=`${d.left}px`,this.el.style.top=`${d.top}px`,$i(this.el,t,{left:d.left,top:d.top,width:s,height:a})}ghostActivation(){return Pa()?performance.now()-this.shownAt<Aa:!1}armOutsideTap(e){this.disarmOutsideTap();let t=this.host,n=new Map,r=s=>{if(this.el!==e){this.disarmOutsideTap();return}let a=s.target,l=s;if(s.type!=="pointerdown"){let d=n.get(l.pointerId);n.delete(l.pointerId),d&&s.type==="pointerup"&&n.size===0&&Math.hypot(l.clientX-d.x,l.clientY-d.y)<=dh&&this.cancel();return}if(!(!a||e.contains(a)||t.els().tray?.contains(a))){if(a instanceof Element&&a.closest(".sl-view3d")){if(n.set(l.pointerId,{x:l.clientX,y:l.clientY}),n.size>1)for(let d of n.keys())n.set(d,{x:Number.NaN,y:Number.NaN});return}this.cancel()}};this.outsideTap=r;let o=t.root();setTimeout(()=>{this.outsideTap===r&&((o??document).addEventListener("pointerdown",r,!0),(o??document).addEventListener("pointerup",r,!0),(o??document).addEventListener("pointercancel",r,!0))},Pa()?Aa:0)}disarmOutsideTap(){if(!this.outsideTap)return;let e=this.outsideTap;this.outsideTap=null;for(let t of["pointerdown","pointerup","pointercancel"])(this.host.root()??document).removeEventListener(t,e,!0),document.removeEventListener(t,e,!0)}dismiss(){let e=this.host;this.disarmOutsideTap(),this.scrim=lr(this.scrim),this.settleLift(),this.el&&ji(this.el),this.el=null,this.seat=null,e.liftToastOverConfirm(),e.root()?.removeAttribute("data-confirming"),Object.values(e.regions()).forEach(t=>t.toggleAttribute("inert",!1)),e.applyPanelCollapsed(),e.controller.setSelectionFocus(null),e.syncTray()}async commit(){let e=this.host,t=this.seat;if(!t)return;let r=this.el?.querySelector(".sl-confirm-add")??null;if(r?.classList.contains("is-adding")||!await ha(this.el,t.id,e.performanceGroup()?.confirmDateSelection??void 0))return;e.collapseSectionCard(),this.seat=null,e.syncTray(),e.syncSelectionTo3d();let o=()=>{let l=e.root()?.dataset.layout==="narrow"?this.lift:null;l&&(this.lift=null),e.dismiss();let c=e.controller.worldToScreen(t);Yn(e.els(),c,t,e.controller.doc?.categories,()=>{e.cartLanded?.(),l&&(this.lift=l,this.settleLift())})};if(!r||e.reducedMotion()){o();return}r.classList.remove("sl-confirm-add-invite"),r.classList.add("is-adding"),r.setAttribute("aria-disabled","true");let s=r.querySelector(".sl-confirm-add-t");s&&(s.textContent=e.tf("picker.added","Added")),e.scheduleMotion(o,ah)}cancel(){let e=this.host,t=this.seat;t&&(this.mode!=="remove"&&e.controller.deselect([t.id]),this.seat&&e.dismiss(),e.syncSelectionTo3d(),e.root()?.focus({preventScroll:!0}))}removeCommitted(){let e=this.host,t=this.seat;if(!t)return;let n=e.releaseHeldSeat(t);n||e.controller.deselect([t.id]),e.dismiss(),e.syncTray(),e.syncSelectionTo3d(),e.root()?.focus({preventScroll:!0})}};function La(i,e,t){if(!e||t||i.classList.contains("sl-confirm-removing"))return;e.classList.add("sl-confirm-add-invite");let n=()=>e.classList.remove("sl-confirm-add-invite");i.addEventListener("pointerdown",n,{once:!0}),i.addEventListener("keydown",n,{once:!0}),e.addEventListener("focus",n,{once:!0})}function Ma(i,e){return i&&i!=="seat"?e("picker.select","Select"):e("picker.addSeat","Add seat")}import{t as dr}from"@seatlayer/core";var hh=12;function Ha(i,e){let t=e.floors(),n=new Set(t.map(f=>f.label.trim().toLocaleLowerCase())),r=e.zones().filter(f=>f.seatCount>0&&!n.has(f.label.trim().toLocaleLowerCase())),o=e.sections().filter(f=>f.seatCount>0&&!n.has(f.label.trim().toLocaleLowerCase())),s=r.length>1?[]:o,a=t.length>1,l=r.length>1,c=s.length>1;if(!a&&!l&&!c)return null;let d=document.createElement("div");d.className="sl-view3d-nav";let u=null,m=document.createElement("button");m.type="button",m.className="sl-view3d-nav-toggle",m.setAttribute("aria-expanded","false");let p='<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>',v=document.createElement("span");m.innerHTML=p,m.appendChild(v);let g=()=>{for(let f of d.querySelectorAll(":scope > div")){let L=f.querySelector('[aria-pressed="true"]');!L||f.scrollWidth<=f.clientWidth||L.scrollIntoView({block:"nearest",inline:"nearest"})}},T=()=>{if(u)return u;for(let f of d.querySelectorAll(":scope > div")){let L=f.querySelector('button[aria-pressed="true"]'),D=L?.textContent?.trim();if(D&&L?.dataset.floor!=="")return D}return a&&(l||c)?b("picker.levelsAndAreas","Levels & areas"):a?b("picker.levels","Levels"):b("picker.areas","Areas")},S=f=>{d.classList.toggle("is-open",f),m.setAttribute("aria-expanded",String(f)),f&&typeof requestAnimationFrame=="function"&&requestAnimationFrame(g),v.textContent=T()};m.addEventListener("click",()=>S(!d.classList.contains("is-open"))),d.addEventListener("keydown",f=>{f.key!=="Escape"||!d.classList.contains("is-open")||(f.preventDefault(),f.stopPropagation(),S(!1),m.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 P=b("picker.closeVenueNavigation","Close venue navigation");y.setAttribute("aria-label",P),y.title=P,y.addEventListener("click",()=>{S(!1),m.focus()}),S(!1),d.appendChild(m);let R=f=>{},G=f=>{};if(a){let f=document.createElement("div");f.setAttribute("role","group"),f.setAttribute("aria-label",b("picker.levels","Levels"));let L=[];G=O=>{L.forEach(A=>{A.setAttribute("aria-pressed",String((A.dataset.floor===""?null:Number(A.dataset.floor))===O))})};let D=O=>{e.focusFloor(O)&&(G(O),R(O))},M=(O,A)=>{let I=document.createElement("button");I.type="button",I.textContent=O,I.dataset.floor=A===null?"":String(A),I.setAttribute("aria-pressed",String(A===null)),I.addEventListener("click",()=>{D(A),S(!1)}),L.push(I),f.appendChild(I)};M(b("picker.allLevels","All levels"),null);for(let O of t)M(O.label||dr("picker.levelNumber",{number:O.index+1}),O.index);d.appendChild(f)}if(l||c){let f=document.createElement("div");f.setAttribute("role","group"),f.setAttribute("aria-label",b("picker.areas","Areas"));let L=l?r.map(M=>({id:M.id,label:M.label||M.id,go:()=>{e.focusZone(M.id)}})):s.map(M=>({id:M.id,label:M.label||M.id,floorIndex:M.floorIndex,go:()=>{e.focusSection(M.id),Number.isFinite(M.floorIndex)&&G(M.floorIndex)}})),D=M=>{let O=l||M===null?L:L.filter(A=>A.floorIndex===void 0||A.floorIndex===M);if(f.replaceChildren(),!O.length){f.remove();return}if(f.isConnected||d.insertBefore(f,y.isConnected?y:null),!l&&O.length>hh){let A=document.createElement("select");A.setAttribute("aria-label",b("picker.jumpToSection","Jump to section"));let I=document.createElement("option");I.value="",I.textContent=b("picker.jumpToSection","Jump to section"),A.appendChild(I);for(let j of O){let $=document.createElement("option");$.value=j.id,$.textContent=j.label,A.appendChild($)}A.addEventListener("change",()=>{O.find(j=>j.id===A.value)?.go()}),f.appendChild(A);return}for(let A of O){let I=document.createElement("button");I.type="button",I.textContent=A.label,I.dataset.area=A.id,I.addEventListener("click",()=>{u=A.label,A.go(),S(!1)}),f.appendChild(I)}};R=D,D(null)}return d.appendChild(y),i.appendChild(d),d}var cn=class{constructor(e){this.host=e;this.chip=null}sync(){let e=this.host.overlay();if(!e||this.host.savedSeatIds().length===0){this.chip?.remove(),this.chip=null;return}let t=this.chip;if(!t){t=document.createElement("div"),t.className="sl-view3d-compare-saved",t.setAttribute("role","group"),t.setAttribute("aria-label",b("picker.savedSeatComparison","Saved seat comparison"));let o=document.createElement("button");o.type="button",o.className="main",o.addEventListener("click",()=>{this.host.savedSeatIds().length>1?this.host.openComparison():this.host.toast(b("picker.chooseAnotherToCompare","Choose another seat to compare."),"neutral")});let s=document.createElement("button");s.type="button",s.className="clear",s.textContent="\xD7",s.setAttribute("aria-label",b("picker.clearSavedSeatComparison","Clear saved seat comparison")),s.addEventListener("click",()=>this.host.clearComparison()),t.append(o,s),e.appendChild(t),this.chip=t}let n=this.host.savedSeatIds().length,r=t.querySelector(".main");r&&(r.textContent=n>1?dr("picker.compareCount",{count:n}):b("picker.oneSeatSaved","1 seat saved"),r.setAttribute("aria-label",n>1?dr("picker.openComparisonOfSeats",{count:n}):b("picker.oneSeatSavedChooseAnother","One seat saved; choose another to compare")))}remove(){this.chip?.remove(),this.chip=null}mainButton(){return this.chip?.querySelector(".main")??null}};function Ra(i){return!i?.querySelector('[data-ref="zfs"]')}var Ia="sl:sheet-hint";function Oa(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(),450),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"),uh(i.root)},700)}function uh(i){if(!i||i.dataset.layout!=="narrow")return;try{if(window.sessionStorage.getItem(Ia))return;window.sessionStorage.setItem(Ia,"1")}catch{}let e=i.querySelector(".sl-sheet-toggle");e&&(e.classList.add("sl-mo-hint"),e.addEventListener("animationend",()=>e.classList.remove("sl-mo-hint"),{once:!0}))}function _a(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 dn(i){let e=i.committedSelection(),t=i.controller.getGAAreas(),n=i.hold?.items??[],r=new Set(n.map(m=>m.label)),o=ns(i,t,n),s=Be(i.gaQty,n),a=n.reduce((m,p)=>m+i.paidPrice(p.categoryKey,p.tierId,p.unitPrice,p.label)*(p.quantity??1),0),l=n.reduce((m,p)=>m+(p.quantity??1),0),c=e.filter(m=>!r.has(m.label)),d=c.reduce((m,p)=>m+i.paidPrice(p.categoryKey,p.tierId??null,p.price,p.label)*(p.quantity??1),0)+o+a,u=c.reduce((m,p)=>m+(p.quantity??1),0)+s+l;return{seats:e,freshSeats:c,gaAreas:t,heldItems:n,heldLabels:r,heldCount:l,total:d,count:u}}function pn(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 hn(i,e){let t=e.tiers?.length?e.tiers.map(n=>i.paidPrice(e.key,n.id??null,n.price)):e.price==null?[]:[i.paidPrice(e.key,null,e.price)];if(e.key)for(let n of i.pricesByChannel.values())for(let r of n)r.categoryKey===e.key&&t.push(r.price);return t.length?{min:Math.min(...t),max:Math.max(...t)}:void 0}var ri="seatlayer_";function mh(){let i=globalThis;return i.document?.modelContext??i.navigator?.modelContext??null}function ce(i,e){return e?{ok:!1,reason:i,message:e}:{ok:!1,reason:i}}function fh(i){return Array.isArray(i)?i.filter(e=>typeof e=="string"&&!!e):[]}function gh(i,e){let t=i.event();if(!t)return ce("not_loaded","The seat map has not finished loading.");let n=i.selectionLimits();return{ok:!0,event:t,selection:{max:n.max,...n.required!=null?{required:n.required}:{}},categories:i.categories(),zones:i.zones(),hasPremiumSeats:i.hasPremiumSeats(),holdsAllowed:e}}function Na(i,e){let t=r=>!!r&&r.toLowerCase()===e.toLowerCase(),n=i.find(r=>t(r.key??r.id))??i.find(r=>t(r.label));return n?.key??n?.id??null}function Da(i,e){let t=e.map(n=>i.describeSeat(n.id));return{seatIds:e.map(n=>n.id),labels:e.map(n=>n.label),section:t[0]?.section??"",row:t[0]?.row??"",seats:e.map((n,r)=>t[r]?.seat||n.label),category:t[0]?.category??e[0].categoryKey,unitPrice:e[0].price,total:e.reduce((n,r)=>n+r.price,0)}}function bh(i,e,t){let n=new Map;for(let o of e){let s=n.get(o.rowKey);s?s.push(o):n.set(o.rowKey,[o])}let r=[];for(let o of n.values()){let s=[...o].sort((l,c)=>l.index-c.index),a=0;for(let l=1;l<=s.length;l++)if(l===s.length||s[l].index!==s[l-1].index+1||s[l].categoryKey!==s[l-1].categoryKey){for(let d=a;d+t<=l;d+=t)r.push(Da(i,s.slice(d,d+t)));a=l}}return r}function yh(i,e,t){let n=new Map;for(let o of e){let s=n.get(o.sectionKey);s?s.push(o):n.set(o.sectionKey,[o])}let r=[];for(let o of n.values()){if(o.length<t)continue;let s=[...o].sort((a,l)=>a.price!==l.price?l.price-a.price:a.rowKey.localeCompare(l.rowKey)||a.index-l.index);r.push(Da(i,s.slice(0,t)))}return r}function vh(i,e){if(!i.event())return ce("not_loaded","The seat map has not finished loading.");let n=i.selectionLimits(),r=Math.floor(Number(e.count));if(!Number.isInteger(r)||r<1||r>n.max)return ce("bad_count",`count must be a whole number between 1 and ${n.max}.`);let o=Number.isInteger(Number(e.limit))?Math.max(1,Math.min(20,Number(e.limit))):5,s=e.together===void 0?!0:!!e.together,a=typeof e.max_price=="number"&&Number.isFinite(e.max_price)?e.max_price:null,l=typeof e.category=="string"&&e.category?e.category:null,c=typeof e.zone=="string"&&e.zone?e.zone:null,d=l?Na(i.categories(),l):null;if(l&&!d)return ce("no_match",`No ticket type called "${l}".`);if(d&&i.categories().find(g=>g.key===d)?.available===0)return ce("sold_out",`"${l}" is sold out.`);let u=c?Na(i.zones(),c):null;if(c&&!u)return ce("no_match",`No zone called "${c}".`);let m=i.seats().filter(g=>g.available);if(!m.length)return ce("sold_out");let p=m.filter(g=>(!d||g.categoryKey===d)&&(!u||g.zoneId===u)&&(a==null||g.price<=a));if(!p.length)return ce("no_match");let v=s?bh(i,p,r):yh(i,p,r);return v.length?(v.sort((g,T)=>T.unitPrice!==g.unitPrice?T.unitPrice-g.unitPrice:g.row.localeCompare(T.row)||g.labels[0].localeCompare(T.labels[0])),{ok:!0,groups:v.slice(0,o),searched:{count:r,filters:{...a!=null?{max_price:a}:{},...d?{category:d}:{},...u?{zone:u}:{},together:s}}}):ce(s?"not_enough_together":"no_match")}function Ba(i){return{ok:!0,...i.selection()}}function wh(i,e){let t=i.event();if(!t)return ce("not_loaded","The seat map has not finished loading.");if(t.salesClosed)return ce("event_closed","Sales are closed for this event.");let n=fh(e.seat_ids);return n.length?(i.clearSelection(),i.selectObjects(n),Ba(i)):ce("nothing_requested","Pass one or more seat ids or labels in seat_ids.")}function xh(i,e){let t=async r=>{try{return await r()}catch(o){return ce("error",o instanceof Error?o.message:String(o))}},n=[{name:`${ri}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(()=>gh(i,e))},{name:`${ri}find_seats`,title:"Find available seats",description:"Search the seat map for groups of available seats. Read-only: it never selects, holds or reserves anything. Returns candidate groups with their seat ids, prices and location.",inputSchema:{type:"object",properties:{count:{type:"integer",minimum:1,description:"How many seats are needed."},max_price:{type:"number",description:"Highest acceptable price per seat."},category:{type:"string",description:"Ticket type key or label to restrict the search to."},zone:{type:"string",description:"Zone id or label to restrict the search to."},together:{type:"boolean",description:"Require the seats to be side by side in one row (default true)."},limit:{type:"integer",minimum:1,maximum:20,description:"How many candidate groups to return (default 5)."}},required:["count"],additionalProperties:!1},annotations:{readOnlyHint:!0,untrustedContentHint:!0},execute:r=>t(()=>vh(i,r))},{name:`${ri}select_seats`,title:"Select seats on the map",description:"Replace the current selection with the given seats, exactly as tapping them would. The buyer sees the seats light up and the basket update. No reservation is made.",inputSchema:{type:"object",properties:{seat_ids:{type:"array",items:{type:"string"},description:"Seat ids or labels, e.g. from find_seats."}},required:["seat_ids"],additionalProperties:!1},annotations:{readOnlyHint:!1,untrustedContentHint:!0},execute:r=>t(()=>wh(i,r))},{name:`${ri}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(()=>Ba(i))}];return e&&n.push({name:`${ri}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 Fa(i,e={}){let t=mh();if(!t||typeof t.registerTool!="function")return null;let n=new AbortController,r=xh(i,!!e.holds),o=[],s=e.exposedTo?.length?[...new Set(e.exposedTo)]:void 0;try{for(let a of r)await t.registerTool(a,{signal:n.signal,...s?{exposedTo:s}:{}}),o.push(a.name)}catch(a){console.warn("seatmap: WebMCP tools could not be registered",a)}return o.length?{names:o,dispose:()=>{if(n.abort(),typeof t.unregisterTool=="function")for(let a of o)try{t.unregisterTool(a)}catch{}}}:null}async function Va(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 Fa(hr(i,t),{holds:t,exposedTo:n}),i.destroyed&&pr(i)}catch(r){console.warn("seatmap: WebMCP registration failed",r)}}function pr(i){i.webMcp?.dispose(),i.webMcp=null}function hr(i,e){let t=(n,r)=>{if(Number.isInteger(n.logicalSeatIndex))return n.logicalSeatIndex;let o=n.id.lastIndexOf(":"),s=o<0?NaN:Number(n.id.slice(o+1));return Number.isFinite(s)?s:r};return{event:()=>{let n=i.renderInfo;return n?{name:n.eventName??"",venue:n.venue??null,startsAt:n.startsAt??null,timezone:n.timezone??null,currency:i.currency,salesClosed:i.salesClosed}:null},selectionLimits:()=>({max:i.maxTickets,required:i.exactTickets}),categories:()=>{let n=i.controller.categoryAvailability();return(i.controller.doc?.categories??[]).filter(r=>!r.notForSale).map(r=>{let o=hn(i,r),s=pn(i,r);return{key:r.key,label:r.label??r.key,...s===void 0?{}:{price:s},...o&&o.min!==o.max?{priceRange:o}:{},available:n[r.key]??0}})},zones:()=>i.controller.getBestAvailableZones(),hasPremiumSeats:()=>i.controller.hasPremiumSeats(),seats:()=>{let n=i.controller.getActiveFloorId(),r=[];return i.allSeats().forEach((o,s)=>{if(o.floorId&&n&&o.floorId!==n)return;let a=i.controller.getStatus(o.id)??"free",l=i.controller.doc?.categories.find(d=>d.key===o.categoryKey),c=l?.tiers?.length?l.tiers[0].price:l?.price??0;r.push({id:o.id,label:o.label,rowKey:o.logicalRowId??o.rowId,sectionKey:o.sectionId??o.rowId,index:t(o,s),categoryKey:o.categoryKey,price:i.paidPrice(o.categoryKey,l?.tiers?.[0]?.id??null,c,o.label),...o.zoneId?{zoneId:o.zoneId}:{},available:a==="free"&&!l?.notForSale})}),r},describeSeat:n=>{let r=i.controller.seatDetails(n);return r?{section:r.sectionLabel??"",row:q(r)??"",seat:r.seatNumber??r.label,category:r.categoryLabel??r.categoryKey}:null},selection:()=>{let{freshSeats:n,total:r,count:o}=dn(i);return{seats:n.map(s=>({id:s.id,label:s.label,section:s.sectionLabel??"",row:q(s)??"",seat:s.seatNumber??s.label,category:s.categoryKey,price:i.paidPrice(s.categoryKey,s.tierId??null,s.price,s.label)})),count:o,total:r,currency:i.currency,hold:i.hold?{id:i.hold.holdId,expiresAt:i.hold.expiresAt}:null,validity:i.getSelectionValidity()}},clearSelection:()=>i.clearSelection(),selectObjects:n=>{i.selectObjects(n)},hold:()=>e?kh(i):Promise.resolve({ok:!1,reason:"not_allowed"})}}async function kh(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 za(i,e){if(e.objectType!=="seat"&&e.objectType!=="booth")return null;let t=i.seatByLabel(e.label),n=t?i.toSeat(t).tiers:void 0;return n&&n.length>1?n:null}async function $a(i,e,t,n){let r=i.currentHold(),o=r?.items??[],s=o.find(c=>c.label===e);if(!r||!s||s.tierId===t)return null;let a=o.map(c=>({label:c.label,tierId:c.label===e?t:c.tierId,...c.quantity!=null?{quantity:c.quantity}:{}})),l=await i.api.hold(i.key,a,n,r.holdId);return i.setHold({holdId:l.holdId,labels:a.map(c=>c.label),expiresAt:l.expiresAt,items:l.items}),i.currentHold()}function ur(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 ja(i,e){ve({apiBase:i.apiBase,event:i.eventKey,scope:i.metricScope,surface:i.surface,outcome:"success",ms:i.ms,performanceProfile:i.performanceProfile,seats:i.seatCount,floors:i.floorCount,view:i.view,load:i.load,transport:i.transport,revealWaitMs:i.revealWaitMs,handoverMs:i.handoverMs}),e("chart_rendered",ur(i))}import{seatConfidenceDisclosure as Sh}from"@seatlayer/core/core/seatConfidence";function te(i){return String(i??"").replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#39;")}function Ga(i){let e=Sh(i.seat.confidenceEvidence),t=i.seat.confidenceEvidence,n=e.limitations.length?`<h4>Known limits</h4><ul>${e.limitations.map(c=>`<li>${te(c)}</li>`).join("")}</ul>`:"",r=e.modeledTarget?`<div><dt>Modeled target</dt><dd>${te(e.modeledTarget)}</dd></div>`:"",o=t?`<div><dt>Evidence ID</dt><dd>${te(t.evidenceId)}</dd></div><div><dt>Model version</dt><dd>${te(t.modelVersion)}</dd></div><div><dt>Event configuration</dt><dd>${te(t.eventConfigurationId??"Not configuration-specific")}</dd></div><div><dt>Approval</dt><dd>${te(t.approvedByRole??"No external approval supplied")}</dd></div>`+(t.validUntil?`<div><dt>Valid until</dt><dd>${te(t.validUntil.slice(0,10))}</dd></div>`:""):"<div><dt>Evidence ID</dt><dd>None supplied</dd></div>",s=Pi(i.seat.commercial).join(" \xB7 ")||i.restrictionFallback,a=`<div><dt>View restriction</dt><dd>${te(s)}</dd></div>`+(i.seat.commercial?.note?`<div><dt>Organizer note</dt><dd>${te(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">${te(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>${te(e.headline)}</strong><span>${te(e.coverage)} \xB7 ${te(e.freshness)}</span></div><dl><div><dt>Model status</dt><dd>${te(e.model)}</dd></div><div><dt>Reality evidence</dt><dd>${te(e.reality)}</dd></div><div><dt>Source</dt><dd>${te(e.provenance)}</dd></div>`+a+r+o+`</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 Ka(i){return i?i.closest("[data-report]")?"report":i.closest("[data-close]")||i.classList.contains("sl-view3d-passport-scrim")?"close":null:null}function un(i,e,t){let n=i?.querySelector("[data-report]"),r=i?.querySelector("[data-report-status]");n&&(n.disabled=e!=="failed",n.textContent=e==="received"?"Report received":"Report this view"),r&&(r.setAttribute("role",e==="failed"?"alert":"status"),r.textContent=e==="sending"?"Sending report\u2026":e==="received"?`Report received. Reference ${t??""}.`:"The report could not be sent. Please try again.")}function mr(i,e,t=null){let n=i.view3dEl;if(!n)return;oi(i,!1);let r=e.confidenceEvidence,o=i.controller.seatDetails(e.id),s=document.createElement("div");s.className="sl-view3d-passport-shell",s.innerHTML=Ga({seat:e,title:o?.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(m=>m!==n)])].filter(m=>m instanceof HTMLElement),l=a.map(m=>({element:m,inert:m.inert,ariaHidden:m.getAttribute("aria-hidden")}));for(let m of a)m.inert=!0,m.setAttribute("aria-hidden","true");n.appendChild(s),n.classList.add("has-passport"),i.view3dPassportEl=s;let c=s.querySelector(".sl-view3d-passport"),d=()=>[...c.querySelectorAll('button:not(:disabled),[href],[tabindex]:not([tabindex="-1"])')],u=m=>{if(m.key==="Escape"){m.preventDefault(),m.stopPropagation(),m.stopImmediatePropagation(),oi(i);return}if(m.key!=="Tab")return;let p=d();if(!p.length)return;let v=p[0],g=p[p.length-1];m.shiftKey&&document.activeElement===v?(m.preventDefault(),g.focus()):!m.shiftKey&&document.activeElement===g&&(m.preventDefault(),v.focus())};window.addEventListener("keydown",u,!0),i.view3dPassportCleanup=()=>{window.removeEventListener("keydown",u,!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 m=t?.isConnected?t:i.confirmEl?.querySelector(".sl-confirm-confidence")??i.view3dCompareEl?.querySelector("[data-passport-seat]")??null,p=m?.closest(".sl-confirm,.sl-view3d-compare");p?.isConnected&&(p.inert=!1,p.removeAttribute("aria-hidden")),s.remove(),n.classList.remove("has-passport"),i.view3dPassportEl===s&&(i.view3dPassportEl=null);let v=m??i.view3dCompareEl?.querySelector("[data-passport-seat]")??i.confirmEl?.querySelector(".sl-confirm-confidence")??i.view3dCompareChip.mainButton();(t?.isConnected?t:v)?.focus()},s.addEventListener("click",m=>{let p=Ka(m.target instanceof HTMLElement?m.target:null);p==="close"&&oi(i),p==="report"&&Th(i,e)}),requestAnimationFrame(()=>d()[0]?.focus()),i.emit3dAnalytics("3d_confidence_passport_opened",{seatId:e.id,evidenceId:r?.evidenceId??null,eventConfigurationId:r?.eventConfigurationId??null,modelLevel:r?.modelLevel??"unverified",realityLevel:r?.realityLevel??"none"})}async function Th(i,e){if(i.api.reportViewEvidence){un(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}),un(i.view3dPassportEl,"received",t.report.id)}catch{un(i.view3dPassportEl,"failed")}}}function oi(i,e=!0){let t=i.view3dPassportCleanup;if(i.view3dPassportCleanup=null,!t){i.view3dPassportEl?.remove(),i.view3dPassportEl=null,i.view3dEl?.classList.remove("has-passport");return}e||(document.activeElement instanceof HTMLElement?document.activeElement:null)?.blur(),t(),e||i.root?.focus({preventScroll:!0})}function Ua(i){let e=i.view3dEl;if(!e||i.view3dCompareSeatIds.length<2)return;nt(i,!1);let t=i.view3dCompareSeatIds.map(p=>i.view3dComparisonSnapshot(p)).filter(p=>!!p);if(t.length<2){i.clearView3dComparison();return}let n=p=>E(p),r=t.some(p=>!!p.price),o=document.createElement("div");o.className="sl-view3d-compare-shell";let s=t.map((p,v)=>`<article><span>Seat ${v===0?"A":"B"}</span><strong>${n(p.label)}</strong><small>Section ${n(p.section)} \xB7 Row ${n(p.row)}</small><dl>`+(r?`<div><dt>Current price</dt><dd>${n(p.price)}</dd></div>`:"")+`<div><dt>Ticket type</dt><dd>${n(p.category)}</dd></div><div><dt>Availability</dt><dd>${n(p.availability)}</dd></div><div><dt>View source</dt><dd>${n(p.viewSource)}</dd></div><div><dt>View restriction</dt><dd>${n(p.limited)}</dd></div><div><dt>Seat confidence</dt><dd>${n(p.confidence.headline)}</dd></div><div><dt>Reality check</dt><dd>${n(p.confidence.reality)}</dd></div><div><dt>Accessibility</dt><dd>${n(p.accessibility)}</dd></div></dl><div class="sl-view3d-compare-actions"><button type="button" data-passport-seat="${n(p.seat.id)}">Passport</button><button type="button" data-view-seat="${n(p.seat.id)}">View seat</button><button type="button" class="select" data-select-seat="${n(p.seat.id)}"${p.selectable?"":" disabled"}>Select seat</button></div></article>`).join("");o.innerHTML=`<div class="sl-view3d-compare-scrim" aria-hidden="true"></div><section class="sl-view3d-compare" role="dialog" aria-modal="true" aria-labelledby="sl-view3d-compare-title"><header><div><span>Seat inspection</span><strong id="sl-view3d-compare-title">Compare disclosed attributes</strong></div><button type="button" data-close aria-label="Close seat comparison">\xD7</button></header><p class="sl-view3d-compare-note">${r?"Current price and availability":"Availability"} comes from this picker. Modeled views are chart-derived unless organizer media is labeled.</p><div class="sl-view3d-compare-grid">${s}</div></section>`;let a=document.activeElement instanceof HTMLElement?document.activeElement:null,l=[...e.children].filter(p=>p instanceof HTMLElement),c=l.map(p=>({element:p,inert:p.inert,ariaHidden:p.getAttribute("aria-hidden")}));for(let p of l)p.inert=!0,p.setAttribute("aria-hidden","true");e.appendChild(o),e.classList.add("has-comparison"),i.view3dCompareEl=o;let d=o.querySelector(".sl-view3d-compare"),u=()=>[...d.querySelectorAll('button:not(:disabled),[href],[tabindex]:not([tabindex="-1"])')],m=p=>{if(p.key==="Escape"){p.preventDefault(),nt(i);return}if(p.key!=="Tab")return;let v=u();if(!v.length)return;let g=v[0],T=v[v.length-1];p.shiftKey&&document.activeElement===g?(p.preventDefault(),T.focus()):!p.shiftKey&&document.activeElement===T&&(p.preventDefault(),g.focus())};window.addEventListener("keydown",m),i.view3dCompareCleanup=()=>{window.removeEventListener("keydown",m);for(let p of c)p.element.inert=p.inert,p.ariaHidden===null?p.element.removeAttribute("aria-hidden"):p.element.setAttribute("aria-hidden",p.ariaHidden);o.remove(),e.classList.remove("has-comparison"),i.view3dCompareEl===o&&(i.view3dCompareEl=null),a?.isConnected?a.focus():i.view3dCompareChip.mainButton()?.focus()},o.querySelector("[data-close]")?.addEventListener("click",()=>nt(i)),o.querySelectorAll("[data-passport-seat]").forEach(p=>p.addEventListener("click",()=>{let v=p.dataset.passportSeat,g=v?i.allSeats().find(T=>T.id===v):void 0;g&&mr(i,g,p)})),o.querySelectorAll("[data-view-seat]").forEach(p=>p.addEventListener("click",()=>{let v=p.dataset.viewSeat;nt(i,!1),v&&i.view3dHandle?.flyToSeat(v)})),o.querySelectorAll("[data-select-seat]").forEach(p=>p.addEventListener("click",()=>{let v=p.dataset.selectSeat;v&&Eh(i,v)})),requestAnimationFrame(()=>u()[0]?.focus()),i.emit3dAnalytics("3d_comparison_opened",{seatIds:i.view3dCompareSeatIds.slice()})}function nt(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 Eh(i,e){if(i.salesClosed){i.toast(i.closedWords?.().toast??i.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}let t=i.allSeats().find(r=>r.id===e);if(!t)return;if(nt(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{seatViewDisclosure as Rh}from"@seatlayer/core/view3d/crossfade/panorama";import{t as qa}from"@seatlayer/core";var Ch=900,Ah=450;function Ph(i){switch(i){case"seat":return b("picker.stopYourSeat","Your seat");case"row":return b("picker.stopYourRow","Your row");case"section":return b("picker.stopYourSection","Your section");default:return b("picker.stopWholeVenue","Whole venue")}}function Wa(i,e){let t=document.createElement("button");t.type="button",t.className="sl-view3d-recentre sl-mo-rotate-in",t.textContent="\u25CE";let n=b("picker.recentreOnStage","Recentre on the stage");t.setAttribute("aria-label",n),t.title=n,t.addEventListener("click",()=>{e.handle()?.recentreSeatView()});let r=document.createElement("div");r.className="sl-view3d-stop",r.setAttribute("role","status"),r.setAttribute("aria-live","polite"),i.append(t,r);let o=null,s=null;return{onStopChange(a){if(o&&(clearTimeout(o),o=null),s&&(clearTimeout(s),s=null),!a){r.classList.remove("is-shown"),r.textContent="",s=setTimeout(()=>{s=null,i.classList.remove("is-seat-view")},Ah);return}i.classList.add("is-seat-view"),r.textContent=Ph(a),r.classList.add("is-shown"),o=setTimeout(()=>{o=null,r.classList.remove("is-shown")},Ch)},dispose(){o&&(clearTimeout(o),o=null),s&&(clearTimeout(s),s=null),t.remove(),r.remove(),i.classList.remove("is-seat-view")}}}var Lh=44,Mh=92;function Ya(i,e,t,n={}){let r=i?.sectionLabel,o=q(i),s=Hh(i,e),a=[r,o?qa("picker.rowLabel",{label:o}):null,s?qa("picker.seatLabel",{label:s}):null].filter(Boolean).join(" \xB7 "),l=n.maxChars??(n.narrow?Lh:Mh);for(let c of[t,n.shortTail??t,null]){let d=[a,c].filter(Boolean).join(" \xB7 ");if(d.length<=l||c==null)return d}return a}function Hh(i,e){if(i?.seatNumber)return i.seatNumber;let t=i?.displayLabel??e,n=r=>{!r||!t.startsWith(r)||t.length<=r.length||(t=t.slice(r.length).replace(/^[\s·\-\/_]+/,""))};return n(i?.sectionLabel),n(q(i)),t}import{seatConfidenceDisclosure as Ih}from"@seatlayer/core/core/seatConfidence";var Oh=220;function _h(i,e,t){let n=null,r=null,o=null;return(s,a)=>{i()?.presentSeatHover?.(s,a,e),o=a,s!==r&&(r=s,n&&(clearTimeout(n),n=null),!(!s||!t)&&(n=setTimeout(()=>{if(n=null,r!==s)return;let c=t()?.(s)??null;c&&r===s&&i()?.presentSeatHover?.(s,o,e,c)},Oh)))}}function Za(i){return i.buyerView}function Qa(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 Xa(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 Ja(i){if(!i.view3dHandle)return;let e=i.allSeats().map(t=>({seatId:t.id,state:i.seatState3dFor(t)}));i.view3dHandle.setAvailability(e)}function el(i){i.view3dHandle&&i.view3dHandle.setSelection(i.controller.getSelection().map(e=>e.id))}async function tl(i,e){let t=i.allSeats().find(n=>n.id===e);if(!t)return null;if(t.viewUrl)try{let n=t.viewMeta?.previewUrl,r=!!n&&n!==t.viewUrl,o=r?await i.buyerAssetUrls.resolve(n):null,s=r?t.viewUrl:await i.buyerAssetUrls.resolve(t.viewUrl);return!s||r&&!o?null:{url:s,...o?{previewUrl:o}:{},...r?{resolveUrl:a=>i.buyerAssetUrls.resolve(a)}:{},...t.viewMeta?.sourceWidth!==void 0?{sourceWidth:t.viewMeta.sourceWidth}:{},...t.viewMeta?.sourceHeight!==void 0?{sourceHeight:t.viewMeta.sourceHeight}:{},...t.viewMeta?.previewWidth!==void 0?{previewWidth:t.viewMeta.previewWidth}:{},...t.viewMeta?.previewHeight!==void 0?{previewHeight:t.viewMeta.previewHeight}:{},...t.viewMeta?.variants?.length?{variants:t.viewMeta.variants}:{},...t.viewMeta?.initialBearingDeg!==void 0?{initialBearingDeg:t.viewMeta.initialBearingDeg}:{},...t.viewMeta?.initialPitchDeg!==void 0?{initialPitchDeg:t.viewMeta.initialPitchDeg}:{},...t.viewMeta?.coverage?{coverage:t.viewMeta.coverage}:{},...t.viewMeta?.capturedAt?{capturedAt:t.viewMeta.capturedAt}:{},...t.viewMeta?.sourceLabel?{sourceLabel:t.viewMeta.sourceLabel}:{}}}catch(n){return i.opts.onError?.(n),null}return{url:"",generated:!0,mediaKind:"model",coverage:"exact-seat",sourceLabel:i.tf("picker.chartDerivedModel","Chart-derived model")}}function il(i,e){if(i.salesClosed){i.toast(i.closedWords?.().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 o=i.controller.getStatus(t.id);if(o==="held"||o==="booked"||o==="not_for_sale"){i.syncSelectionTo3d();return}if(!i.controller.select([e]).length){i.syncSelectionTo3d(),i.dismissConfirm();return}if(i.opts.onBuyerViewChange?.({view:"venue3d",seatId:e}),i.flashPickedSeat(e),n){i.showTableDialog(n,!1),i.syncSelectionTo3d();return}i.opts.confirmSelection!==!1?i.showConfirm(t):i.syncTray(),i.syncSelectionTo3d()}function nl(i,e){let t=i.allSeats().find(n=>n.id===e);return Ya(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 rl(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 ol(i){i.closeView3dComparison(!1),i.view3dCompareSeatIds=[],i.view3dCompareChip.remove(),i.emit3dAnalytics("3d_comparison_cleared")}function sl(i,e){let t=i.allSeats().find(v=>v.id===e);if(!t)return null;let n=i.controller.seatDetails(t.id),r=i.controller.doc?.categories.find(v=>v.key===t.categoryKey),o=n?.price??(r?.tiers?.length?r.tiers[0].price:r?.price),s=o!=null?i.paidPrice(t.categoryKey,n?.tierId??r?.tiers?.[0]?.id??null,o,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?Rh({url:t.viewUrl,...t.viewMeta?.coverage?{coverage:t.viewMeta.coverage}:{},...t.viewMeta?.capturedAt?{capturedAt:t.viewMeta.capturedAt}:{},...t.viewMeta?.sourceLabel?{sourceLabel:t.viewMeta.sourceLabel}:{}}):i.tf("picker.chartDerivedSeatEye","Live 3D \xB7 chart-derived seat-eye \xB7 not surveyed"),d=Pi(t.commercial).join(" \xB7 ")||i.tf("picker.noAuthoredRestriction","No organizer-authored restriction"),u=bo({...t.accessibility?.length?{accessibility:t.accessibility}:{},...n?.wheelchairSpaceType?{wheelchairSpaceType:n.wheelchairSpaceType}:{}}),m=u.length?`${u.join(" \xB7 ")} \xB7 metadata, not access certification`:i.tf("picker.noAccessibilityMetadata","No accessibility metadata supplied"),p=Ih(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??r?.label??t.categoryKey,price:i.suppressPricing||s==null?"":i.money(s),availability:l,selectable:a==null||a==="free",viewSource:c,limited:d,accessibility:m,confidence:p}}async function al(i,e){if(i.view3dEl||!i.canOffer3d()||!i.els.map)return;let t=i.controller.doc;if(!t)return;i.buyerView="venue3d",i.view3dTargetSeatId=null,i.opts.onBuyerViewChange?.({view:"venue3d",...e?{seatId:e}:{}}),i.root?.setAttribute("data-view3d","on"),i.dismissConfirm(),i.syncProjection(),i.syncTray();let n=document.createElement("div");n.className="sl-view3d sl-mo-zoom",n.setAttribute("role","group"),n.setAttribute("aria-label",i.tf("picker.interactive3dVenueView","Interactive 3D venue view"));let r=document.createElement("button");r.type="button",r.className="sl-view3d-back",r.innerHTML=`<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M15 18l-6-6 6-6"/></svg><span>${i.tf("picker.backToMap","Back to map")}</span>`;let o=r.querySelector("span"),s=c=>{i.view3dTargetSeatId=c;let d=!!c;n.classList.toggle("is-seat-focused",d),i.root&&(i.root.dataset.view3dSeat=d?"on":"off");let u=d?i.tf("picker.backToVenue","Back to venue"):i.tf("picker.backToMap","Back to map");o&&(o.textContent=u),r.setAttribute("aria-label",u)};if(r.addEventListener("click",()=>{if(i.view3dTargetSeatId&&i.view3dHandle){i.view3dHandle.focusOverview();return}i.exit3d()}),i.regions["top-left"]?.prepend(r),i.view3dBack=r,i.publish3dTopInset(),Ra(i.root)){let c=document.createElement("button");c.type="button",c.className="sl-view3d-fs",c.textContent="\u26F6";let d=i.tf("picker.fullScreen","Full screen");c.setAttribute("aria-label",d),c.title=d,c.setAttribute("aria-pressed",String(!!document.fullscreenElement||i.fsFallback||i.framedFs)),c.addEventListener("click",()=>i.toggleFullscreen()),n.appendChild(c)}let a=document.createElement("div");a.className="sl-view3d-loading",a.setAttribute("role","status"),a.setAttribute("aria-live","polite"),a.textContent=i.tf("picker.loading3d","Building the 3D venue\u2026"),n.appendChild(a),i.els.map.appendChild(n),i.view3dEl=n,i.view3dCompareChip.sync(),requestAnimationFrame(()=>{n.style.opacity="1"});let l=++i.view3dGen;try{let c=i.allSeats(),[d,u]=await Promise.all([yi(),i.controller.loadEventConfiguration()]),m=u?await Ui(u,y=>i.buyerAssetUrls.resolve(y)):null,p=t.theme?.venue3d?.shellAssetUrl,v=await qi(p,y=>i.buyerAssetUrls.resolve(y));if(l!==i.view3dGen||i.buyerView!=="venue3d"||i.view3dEl!==n)return;let g={doc:t,seats:c,...m?{eventConfigurationId:m.id,eventConfiguration:m}:{},...v?{registeredShellGlb:v}:{}};a.textContent=i.tf("picker.building3d","Building venue geometry\u2026");let T=await d.prepareVenue3D(g);if(l!==i.view3dGen||i.buyerView!=="venue3d"||i.view3dEl!==n)return;let S=d.mountVenue3D(n,{...g,prepared:T},{portraitOverviewCrop:!0,arriveAtSeatEye:!0,lookAroundHint:We(),navLabels:gi(),seatViewActionLabel:y=>i.allSeats().find(P=>P.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),onSeatHover:_h(()=>i.controller.getRenderer(),n,()=>{let y=S.captureSeatView;return y?P=>y.call(S,P):void 0}),onSectionFocusChange:y=>{let P=n.querySelector('select[data-locator="section"]'),R=y??"";!P||P.value===R||(P.value=R,P.dispatchEvent(new Event("change")))},onViewTargetChange:y=>{n.querySelector(".sl-view3d-nav")?.classList.toggle("is-seat-focused",!!y),s(y),i.opts.onBuyerViewChange?.({view:"venue3d",...y?{seatId:y}:{}})},...i.seatViewEnabled()?{getSeatView:y=>new Promise((P,R)=>{let G=()=>{i.seatViewFor3d(y).then(L=>{L?P(L):R(new Error("seat_view_unavailable"))})},f=globalThis.requestIdleCallback;typeof f=="function"?f(G,{timeout:1500}):setTimeout(G,50)})}:{},onAnalytics:(y,P)=>i.emit3dAnalytics(y,P)});i.view3dHandle=S,i.view3dSeatViewChrome=Wa(n,{handle:()=>i.view3dHandle}),requestAnimationFrame(()=>a.remove()),i.pushAvailabilityTo3d(),i.syncSelectionTo3d(),i.view3dNav=Ha(i.regions["bottom-left"]??n,S),e&&S.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 ll(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 cl(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 Dh}from"@seatlayer/core";import{t as mn}from"@seatlayer/core";function dl(i){return Array.isArray(i)?i.reduce((e,t)=>t.type==="minimumSelectedPlaces"?Math.max(e,t.minimum):e,0):0}function fn(i,e,t=!1){let n=i.violations[0];return n==="numberOfPlacesToSelect"?i.remaining>0?mn("picker.selectExactMore",{count:i.remaining}):mn("picker.selectExactCount",{count:i.required}):n==="minimumSelectedPlaces"?mn("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."):mn("picker.orphanHint")}var fr=6e4,pl=5*6e4,Bh=String(Math.round(pl/6e4));function hl(i){let e=document.createElement("div");e.className="sl-extend",e.dataset.dock="map",e.setAttribute("role","status"),e.innerHTML='<button type="button" class="sl-extend-btn" data-ref="extendBtn"></button><button type="button" class="sl-extend-x" data-ref="extendDismiss" aria-label=""><svg viewBox="0 0 16 16" width="12" height="12" aria-hidden="true" focusable="false"><path d="M3.5 3.5 12.5 12.5M12.5 3.5 3.5 12.5" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg></button>',(i.regions["bottom-center"]??i.els.map).appendChild(e),i.extendEl=e,i.els.extendBtn=e.querySelector('[data-ref="extendBtn"]'),i.els.extendDismiss=e.querySelector('[data-ref="extendDismiss"]'),i.els.extendBtn.textContent=ul(i),i.els.extendDismiss.setAttribute("aria-label",i.tf("picker.close","Close")),i.els.extendBtn.addEventListener("click",()=>{i.handleExtend()}),i.els.extendDismiss.addEventListener("click",()=>{i.extendDismissed=!0,i.setExtendPrompt(!1,0)})}function ul(i){return i.tf("picker.addMinutes","+{count} min").replace("{count}",Bh)}function ml(i){let e=i.hold?.items??[],t=new Set(e.map(r=>r.label));return i.committedSelection().filter(r=>!t.has(r.label)).reduce((r,o)=>r+(o.quantity??1),0)+Be(i.gaQty,i.hold?.items??[])}function fl(i){return(i.hold?.items??[]).reduce((e,t)=>e+(t.quantity??1),0)}function gl(i){let e=new Set((i.hold?.items??[]).map(n=>n.label)),t=i.committedSelection().filter(n=>!e.has(n.label)).reduce((n,r)=>n+(r.quantity??1),0);return i.heldTicketCount()+t+Be(i.gaQty,i.hold?.items??[])}function bl(i){let e=new Set((i.hold?.items??[]).map(r=>r.label)),t=i.committedSelection().filter(r=>e.has(r.label)).reduce((r,o)=>r+(o.quantity??1),0),n=Math.max(0,i.maxTickets-i.heldTicketCount()-Be(i.gaQty,i.hold?.items??[]));i.controller.setMaxSelection(t+n)}function yl(i,e=i.lastTrayCount,t=i.pendingSelectionCount()){let n=i.els.cta;if(!n)return;if(delete n.dataset.act,i.salesClosed){n.disabled=!0,n.textContent=i.closedWords?.().cta??i.tf("picker.salesClosedCta","Sales closed");return}if(i.ctaPhase==="holding"){n.disabled=!0,n.innerHTML=`<span class="sl-cta-spin" aria-hidden="true"></span>${i.tf("picker.securingSeats","Securing your seats\u2026")}`;return}if(i.ctaPhase==="checkout"){n.disabled=!0,n.innerHTML=`<span class="sl-cta-spin" aria-hidden="true"></span>${i.tf("picker.openingCheckout","Opening secure checkout\u2026")}`;return}let r=!i.hold&&i.performanceGroup?.selectionMode==="per_performance"?i.performanceGroup.submissionState?.():null;if(r&&!r.ready){n.disabled=!0,n.textContent=i.tf("picker.completeAllPerformances","Complete all performances ({complete}/{total})").replace("{complete}",String(r.complete)).replace("{total}",String(r.total));return}let o=i.controller.getSelectionValidity(e);if(o&&!o.isValid){n.disabled=!0,n.textContent=fn(o,(s,a)=>i.tf(s,a),!0);return}if(!e&&i.root?.dataset.layout==="narrow"&&!i.performanceGroup&&!i.hold&&!i.bestAvailableSoldOut){n.disabled=!1,n.dataset.act="find",n.textContent=i.tf("picker.findBestSeats","Find best seats");return}n.disabled=e===0,n.textContent=i.hold?t?Dh("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 vl(i,e){i.ctaPhase=e,i.syncCta()}async function wl(i,e,t){i.setCtaPhase("checkout");try{await i.checkoutHandoff(e,t)}finally{i.ctaPhase==="checkout"&&!i.bookedShown&&i.setCtaPhase("idle")}}function xl(i){return`@seatlayer/hold/v1/${encodeURIComponent(i.apiBase)}/${encodeURIComponent(i.opts.event)}`}function kl(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 Sl(i,e){if(!(i.opts.restoreHold===!1||typeof window>"u"))try{window.sessionStorage.setItem(i.holdStorageKey(),e.holdId)}catch{}}function Tl(i){if(!(typeof window>"u"))try{window.sessionStorage.removeItem(i.holdStorageKey())}catch{}}async function El(i,e,t=!1){try{let n=await i.controller.resumeHold(e);if(!n||i.destroyed)return null;let r={holdId:n.holdId,expiresAt:n.expiresAt,seats:n.seats,items:n.items};return i.hold=r,i.handedOff=!0,i.bookedShown=!1,i.ctaPhase="idle",i.startHoldTimer(r.expiresAt),i.rememberHold(r),i.syncTray(),i.emitHoldChange(),i.opts.onHoldRestored?.(r,r.seats??[],i.buildHandoff(r)),r}catch(n){let r=n?.status;if(r===404||r===409)i.forgetHold();else if(r===401&&n?.code==="buyer_access_invalid")i.forgetHold(),i.toast(i.tf("picker.savedSeatsNotRestored","Your earlier seats could not be restored. Please choose again."),"warning");else if(i.opts.onError?.(n),t)throw n;return null}}async function Cl(i){let e=i.rememberedHoldId();e&&await i.resumeHoldFromServer(e,!0)}function Al(i,e){i.stopHoldTimer(),i.holdExpiresAt=e,i.extendDismissed=!1,i.extendUsed=!1,i.hold&&i.rememberHold(i.hold);let t=i.els.hold;t.innerHTML=`<span class="sl-hold-dot" aria-hidden="true"></span><span>${i.tf("picker.held","Held")}</span><span class="sl-hold-time" data-ref="holdTime"></span>`;let n=t.querySelector('[data-ref="holdTime"]'),r=()=>{let o=Math.max(0,i.holdExpiresAt-Date.now());n&&(n.textContent=Ho(o)),t.classList.add("on"),t.classList.toggle("is-expiring",o>0&&o<=fr),i.setExtendPrompt(o>0&&o<=fr,o),(o<=0||!i.controller.currentHold())&&i.stopHoldTimer()};i.holdTimer=setInterval(r,500),r()}function Pl(i){i.holdTimer&&clearInterval(i.holdTimer),i.holdTimer=null,i.els.hold?.classList.remove("on","is-expiring"),i.setExtendPrompt(!1,0)}function Ll(i,e,t){if(!i.extendEl)return;let n=e&&t>0&&i.root?.dataset.layout!=="narrow"&&!i.extendDismissed&&!i.extendUsed&&!!i.controller.currentHold()&&!i.bookedShown;i.extendEl.classList.toggle("on",n)}function Ml(i){if(!i.holdTimer)return;let e=Math.max(0,i.holdExpiresAt-Date.now());i.setExtendPrompt(e>0&&e<=fr,e)}async function Hl(i){let e=i.els.extendBtn,t=i.controller.currentHold();if(!(!t||!i.api.extend||i.extendUsed)){e.disabled=!0,e.textContent=i.tf("picker.addingEllipsis","Adding\u2026");try{let n=await i.api.extend(i.controller.key,t.holdId,pl);if(i.controller.currentHold()?.holdId!==t.holdId)return;i.controller.setHold({holdId:t.holdId,labels:t.labels,expiresAt:n.expiresAt,items:t.items});let r=i.controller.currentHold();if(!r)return;i.hold={holdId:r.holdId,expiresAt:r.expiresAt,seats:r.seats,items:r.items},i.holdExpiresAt=r.expiresAt,i.extendUsed=!0,i.extendEl?.classList.remove("on"),i.rememberHold(i.hold),i.emitHoldChange(),i.toast(i.tf("picker.moreTimeAdded","More time added. Your seats are still held."),"success")}catch(n){if(n?.reason==="extend_limit"){i.extendUsed=!0,i.setExtendPrompt(!1,0);return}i.opts.onError?.(n),i.toast(i.tf("picker.couldNotAddMoreTime","Couldn't add more time. Please head to checkout now."),"warning")}finally{e.disabled=!1,e.textContent=ul(i)}}}import{t as Nl}from"@seatlayer/core";function Rl(i){return i?.previousPrice!=null&&i.previousPrice>i.price?i.previousPrice:null}function Il(i){return Vh(i)+(i.moreLabel?`<button type="button" class="sl-price-more" aria-expanded="${!i.collapsed}">${i.esc(i.moreLabel)}</button>`:"")+zh(i.status)}function Vh(i){let{esc:e,money:t}=i;return i.categories.map(n=>{let r=i.priceOf(n),o=i.rangeOf(n),s=i.offerOf(n.key),a=Rl(s),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"><span class="sl-price-name">${e(n.label)}</span>`+(s?.offerName?Ci(s.offerName,e):"")+"</span>"+(a!=null?`<span class="sl-price-was">${e(t(a))}</span>`:"")+(o!=null?`<span class="sl-price-amt">${o.min===o.max?e(t(o.min)):`${e(t(o.min))}\u2013${e(t(o.max))}`}</span>`:r!=null?`<span class="sl-price-amt">${e(t(r))}</span>`:"")+"</div>"}).join("")}function zh(i){let e=t=>t.replace(/[&<>"']/g,n=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[n]);return`<div class="sl-status-key" aria-label="${e(i.legend)}"><span class="sl-status-item"><i class="sl-status-icon unavailable" aria-hidden="true"></i>${e(i.unavailable)}</span></div>`}function gr(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 Ol(i){let{esc:e,money:t}=i;return`<button type="button" class="sl-rc sl-rc-all" data-rail-all aria-pressed="${i.allActive}" title="${e(i.allWord)}"><span class="sl-rc-t">${e(i.allWord)}</span></button>`+i.categories.map(r=>{let o=i.rangeOf(r),s=i.priceOf(r),a=o?o.min===o.max?t(o.min):`${t(o.min)}+`:s!=null?t(s):null,l=Object.prototype.hasOwnProperty.call(i.left,r.key)&&i.left[r.key]<=0,c=Rl(i.offerOf(r.key)),d=a?`${r.label}: ${a}${l?` (${i.soldOutWord})`:""}`:r.label;return`<button type="button" class="sl-rc" data-cat="${e(r.key)}" aria-pressed="${i.activeKey===r.key}" aria-label="${e(d)}" title="${e(d)}"${l?" disabled":""}><i class="sl-rc-dot" style="--sl-cat-dot:${e(i.colorOf(r))}"></i>`+(c!=null?`<span class="sl-rc-was">${e(t(c))}</span>`:"")+`<span class="sl-rc-t">${e(a??r.label)}</span></button>`}).join("")}function _l(i,e){let t=i.map(a=>({key:a.key,range:e.rangeOf(a)})).filter(a=>a.range!=null);if(!t.length)return[];let n=[...new Map(t.map(a=>[`${a.range.min}:${a.range.max}`,a.range])).values()].sort((a,l)=>a.min-l.min||a.max-l.max);if(n.length<=5)return n.map(a=>({id:`p${a.min}-${a.max}`,label:a.min===a.max?e.money(a.min):`${e.money(a.min)}\u2013${e.money(a.max)}`,keys:t.filter(l=>l.range.min===a.min&&l.range.max===a.max).map(l=>l.key),min:a.min,max:a.max}));let r=[...t].sort((a,l)=>a.range.min-l.range.min||a.range.max-l.range.max),o=Math.ceil(r.length/4),s=[];for(let a=0;a<r.length;a+=o){let l=r.slice(a,a+o),c=Math.min(...l.map(u=>u.range.min)),d=Math.max(...l.map(u=>u.range.max));s.push({id:`b${a}`,label:c===d?e.money(c):`${e.money(c)}\u2013${e.money(d)}`,keys:l.map(u=>u.key),min:c,max:d})}return s}function Dl(i){if(i.els.pricesSec?.querySelectorAll(".sl-price-select").forEach(r=>r.remove()),i.priceSelect=null,i.suppressPricing||!i.els.prices||!i.els.pricesSec)return;let e=_l((i.controller.doc?.categories??[]).filter(r=>!r.notForSale),i.legendDeps());if(e.length<2)return;let t=document.createElement("select");t.className="sl-price-select",t.setAttribute("aria-label",i.tf("picker.filterAndFocusByPrice","Filter and focus seats by price"));let n=document.createElement("option");n.value="all",n.textContent=i.tf("picker.allPrices","All prices"),t.appendChild(n);for(let r of e){let o=document.createElement("option");o.value=r.id,o.textContent=r.label,t.appendChild(o)}i.els.pricesSec.appendChild(t),i.priceSelect=t,t.addEventListener("change",()=>{i.applyPriceBand(e.find(r=>r.id===t.value)?.keys??null)})}function Bl(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 Fl(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=>e?i.money(e):i.tf("checkout.free","Free"),esc:_}}function Vl(i,e,t,n=i.legendDeps()){let r=i.els.railScroll,o=e.length>1;if(i.els.rail?.classList.toggle("has",o),!r)return;r.innerHTML=o?Ol({...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 s=e.map(a=>a.key).join("|");i.lastRailSignature!==s&&(i.lastRailSignature=s,r.scrollLeft=0),r.querySelectorAll(".sl-rc").forEach(a=>{a.addEventListener("click",()=>{if(a.hasAttribute("data-rail-all")){i.applyPriceBand(null);return}i.focusCategory(a.dataset.cat??"")})}),i.railEdgesBound||(i.railEdgesBound=!0,r.addEventListener("scroll",()=>gr(r),{passive:!0})),requestAnimationFrame(()=>gr(r))}function zl(i){let e=i.controller.doc;if(!e||!i.els.prices)return;let t=i.controller.categoryAvailability(),n=e.categories.filter(u=>!u.notForSale);i.syncSoldout(n,t);let r=i.legendDeps(),o=i.suppressPricing,s=o?{...r,priceOf:()=>{},rangeOf:()=>{},offerOf:()=>null}:r;o&&(i.els.pricesSec?.querySelector("span")?.replaceChildren(i.tf("picker.seatCategories","Seat categories")),i.els.pricesInfo?.remove()),i.syncPriceRail(n,t,s);let a=5,l=n.length-a,c=l>1&&!i.pricesExpanded,d=c?n.slice(0,a):n;i.els.prices.classList.toggle("sl-expanded",l>1&&i.pricesExpanded),i.els.prices.innerHTML=Il({...s,categories:d,left:t,collapsed:c,activeKey:i.focusedCatKey,bandKeys:i.priceBandKeys,titleFor:(u,m)=>m?i.tf("picker.showAllSeats","Show all seats"):Nl("picker.showLabelSeatsOnMap",{label:u.label}),moreLabel:l>1?c?o?i.tf("picker.showAllCategories","Show all categories"):Nl("picker.showAllTicketTypes",{count:n.length}):i.tf("picker.showFewer","Show fewer"):null,status:{legend:i.tf("picker.seatStatusLegend","Seat status legend"),unavailable:i.tf("picker.notAvailable","Not available")}}),i.els.prices.querySelectorAll(".sl-price-row").forEach(u=>{u.addEventListener("mouseenter",()=>i.controller.getRenderer()?.setCategoryHighlight?.(u.dataset.cat??null)),u.addEventListener("mouseleave",()=>i.controller.getRenderer()?.setCategoryHighlight?.(null));let m=()=>i.focusCategory(u.dataset.cat??"");u.addEventListener("click",m),u.addEventListener("keydown",p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),m())})}),i.els.prices.querySelector(".sl-price-more")?.addEventListener("click",()=>{i.pricesExpanded=!i.pricesExpanded,i.syncPrices()})}function $l(i,e){if(!e)return;let t=i.focusedCatKey===e?null:e;i.focusedCatKey=t,i.priceBandKeys=t?new Set([t]):null;let n=i.els.pricesSec?.querySelector(".sl-price-select");n&&(n.value="all"),i.controller.setCategoryFilter(t?[t]:null),i.controller.focusCategoryFilter(t?[t]:null),i.pushAvailabilityTo3d(),i.syncFloors(),i.syncRung(),i.minimap?.refreshMinimap(),i.syncPrices(),i.lastSection&&i.showSectionCard(i.lastSection)}import{t as jl,tCount as Gl}from"@seatlayer/core";function pe(i,e,t){let n=jl(i,t);return n&&n!==i?n:t?e.replace(/\{(\w+)\}/g,(r,o)=>o in t?String(t[o]):r):e}function jh(i){let e=Gl("picker.seatCount",i);return e.includes("picker.seatCount")?`${i} ${i===1?"seat":"seats"}`:e}function Gh(i){try{let e=Intl.ListFormat;if(e)return new e(void 0,{style:"long",type:"conjunction"}).format(i)}catch{}return i.join(", ")}function Kh(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 Uh(i){let e=i.filter(r=>r.objectType==="ga"),t=i.filter(r=>r.objectType!=="ga"),n=[];if(t.length){let r=jh(t.length),o=[...new Set(t.map(l=>l.sectionLabel).filter(Boolean))],s=[...new Set(t.map(l=>l.rowLabel).filter(Boolean))],a=t.map(l=>Number(l.seatNumber)).filter(l=>Number.isFinite(l));if(o.length===1&&s.length===1&&a.length===t.length){let l=t.length===1?pe("picker.releasedSeatPlace","Section {section}, Row {row}, Seat {seat}",{section:o[0],row:s[0],seat:String(t[0].seatNumber??"")}):Kh(a)?pe("picker.releasedSeatRange","Section {section}, Row {row}, Seats {from}\u2013{to}",{section:o[0],row:s[0],from:Math.min(...a),to:Math.max(...a)}):"";n.push(l?pe("picker.releasedPair","{first} \xB7 {second}",{first:r,second:l}):pe("picker.releasedInSection","{seats} in Section {section}",{seats:r,section:o[0]}))}else o.length===1?n.push(pe("picker.releasedInSection","{seats} in Section {section}",{seats:r,section:o[0]})):o.length>1?n.push(pe("picker.releasedInSections","{seats} in Sections {sections}",{seats:r,sections:Gh(o)})):n.push(r)}for(let r of e)n.push(pe("picker.releasedGa","{quantity} \xD7 {area}",{quantity:r.quantity??1,area:r.label}));return n.length?n.reduce((r,o)=>pe("picker.releasedPair","{first} \xB7 {second}",{first:r,second:o})):""}function Kl(i){if(!i)return[];let e=new Map((i.seats??[]).map(r=>[r.label,r])),t=i.items??[];return(t.length?t.map(r=>({label:r.label,objectType:r.objectType,quantity:r.quantity})):[...e.keys()].map(r=>({label:r}))).map(r=>{let o=e.get(r.label);return{label:r.label,...r.objectType?{objectType:r.objectType}:{},...r.quantity==null?{}:{quantity:r.quantity},...o?.sectionLabel?{sectionLabel:o.sectionLabel}:{},...o?.rowLabel?{rowLabel:q(o)??o.rowLabel}:{},...o?.seatNumber?{seatNumber:o.seatNumber}:{}}})}function Ul(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 ql(i,e){if(!e.recoverable.length||!i.isConnected)return;let t=i.querySelector(".sl-hold-expired-next");t&&(e.taken.length?t.textContent=e.taken.slice(0,3).map(s=>jl("picker.seatJustTakenByAnother",{label:s})).join(" "):t.remove());let n=i.querySelector(".sl-interrupt-actions"),r=n?.querySelector(".sl-interrupt-act");if(!n||!r)return;r.classList.add("sl-interrupt-act-secondary");let o=document.createElement("button");o.type="button",o.className="sl-interrupt-act sl-hold-expired-recover",o.textContent=Gl("picker.holdLapsedSelectAgain",e.recoverable.length),o.addEventListener("click",()=>e.onRecover([...e.recoverable])),n.insertBefore(o,r),i.classList.add("has-recovery"),o.focus()}function Wl(i,e=[]){let t=document.createElement("div");t.className="sl-interrupt sl-hold-expired sl-mo-scrim",t.setAttribute("role","alertdialog"),t.setAttribute("aria-modal","true");let n=document.createElement("div");n.className="sl-interrupt-card sl-mo-in";let r=document.createElement("div");r.className="sl-interrupt-title",r.id="sl-hold-expired-title";let o=document.createElement("span");o.className="sl-interrupt-glyph",o.setAttribute("aria-hidden","true"),o.textContent="\u23F1";let s=document.createElement("span");s.textContent=pe("picker.holdExpiredTitle","Your seats were released"),r.append(o,s);let a=document.createElement("div");a.className="sl-interrupt-body",a.id="sl-hold-expired-body",a.textContent=pe("picker.holdExpiredBody","Your hold time ran out and the seats went back on sale."),n.append(r,a);let l=Uh(e);if(l){let m=document.createElement("div");m.className="sl-interrupt-body sl-interrupt-fact sl-hold-expired-seats",m.textContent=l,n.appendChild(m)}let c=document.createElement("div");c.className="sl-interrupt-body sl-hold-expired-next",c.textContent=pe("picker.holdExpiredPickAgain","Pick your seats again to continue. They may already be taken."),n.appendChild(c),t.setAttribute("aria-labelledby",r.id),t.setAttribute("aria-describedby",a.id);let d=document.createElement("div");d.className="sl-interrupt-actions";let u=document.createElement("button");return u.type="button",u.className="sl-interrupt-act sl-hold-expired-restart",u.textContent=pe("picker.holdExpiredRestart","Choose seats again"),u.addEventListener("click",()=>i.restart()),d.appendChild(u),n.appendChild(d),t.appendChild(n),t.addEventListener("pointerdown",m=>{m.target===t&&i.restart()}),t}import{ACCESSIBILITY_TYPES as br,seatTypeIconSvg as Yl,t as qh}from"@seatlayer/core";var Zl={wheelchair:"Wheelchair space",companion:"Companion seat","semi-ambulatory":"Limited mobility","designated-aisle":"Aisle / transfer","step-free":"Step-free",hearing:"Assistive listening",cart:"Live captions","sign-language":"Sign language","low-vision":"Low vision","sensory-friendly":"Sensory-friendly","plus-size":"Plus-size","lift-armrest":"Lift-up armrest"},Wh='<svg viewBox="0 0 20 20" width="17" height="17" fill="none" stroke="currentColor" stroke-width="1.45" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><circle cx="10" cy="10" r="7.5" /><path d="M10 2.5a7.5 7.5 0 0 1 0 15Z" fill="currentColor" stroke="none" /></svg>',Yh='<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>',Zh=8,Qh=8,Xh=88;function Jh(i){let e=i.gap??Zh,t=i.margin??Qh,n=i.min??Xh,r=Math.max(i.boundsTop,0);return Math.max(Math.round(i.buttonTop-r-e-t),n)}var gn=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 r=this.offered().length>0?t.tf("picker.accessibilityOptions","Accessibility and colour options"):t.tf("picker.displayOptions","Display options");this.button.setAttribute("aria-label",r),this.button.innerHTML=Yh,this.menu=document.createElement("div"),this.menu.className="sl-a11ymenu",this.menu.hidden=!0;for(let o of this.stored())this.offeredFree().has(o)&&this.active.add(o);if(this.menu.innerHTML=Po(r,t.tf("picker.close","Close"))+Lo(this.rows()),this.root.append(this.menu,this.button),e.prepend(this.root),this.button.addEventListener("pointerdown",o=>o.stopPropagation()),this.button.addEventListener("click",o=>{o.stopPropagation(),this.open(this.menu.hidden)}),this.menu.querySelector("[data-a11y-close]")?.addEventListener("click",o=>{o.stopPropagation(),this.open(!1),this.button.focus({preventScroll:!0})}),this.menu.addEventListener("pointerdown",o=>o.stopPropagation()),this.menu.addEventListener("click",o=>o.stopPropagation()),this.menu.addEventListener("focusin",o=>{let s=o.target;s&&typeof s.scrollIntoView=="function"&&s.scrollIntoView({block:"nearest"})}),this.dismiss=()=>this.open(!1),this.escape=o=>{o.key==="Escape"&&this.open(!1)},this.reflow=()=>{this.menu.hidden||this.fit()},document.addEventListener("pointerdown",this.dismiss),document.addEventListener("keydown",this.escape),window.addEventListener("resize",this.reflow),this.promoteCounts(),this.wire(),this.active.size){this.applyFilter({focus:!1});let o=()=>this.deps.focusSeatsForFilter();typeof requestAnimationFrame=="function"?requestAnimationFrame(o):o()}}colorblindRow(){return this.menu.querySelector(".sl-cbbtn")}syncCounts(){let e=new Map(this.offered().map(({key:n,count:r})=>[n,r])),t=!1;for(let n of this.menu.querySelectorAll("[data-a11y-row]")){let r=n.dataset.a11yRow??"";if(!r.startsWith("a11y:"))continue;let o=r.slice(5),s=e.get(o);if(s===void 0)continue;let a=this.countNode(n),l=s==null?"":this.countText(s);a&&(a.textContent=l);let c=s===0;a instanceof HTMLButtonElement&&(a.disabled=c,a.setAttribute("aria-label",this.jumpLabel(o,l))),n.disabled=c,c?n.setAttribute("aria-disabled","true"):n.removeAttribute("aria-disabled"),c&&this.active.delete(o)&&(this.paint(n,!1),t=!0)}t&&this.applyFilter()}syncAccessibilityFilter(e){this.active.clear();for(let t of e??[])this.active.add(t);this.remember(e&&e.length?e:null);for(let t of this.menu.querySelectorAll("[data-a11y-row]")){let n=t.dataset.a11yRow??"";n.startsWith("a11y:")&&this.paint(t,this.active.has(n.slice(5)))}}refit(){this.menu.hidden||this.fit()}destroy(){document.removeEventListener("pointerdown",this.dismiss),document.removeEventListener("keydown",this.escape),window.removeEventListener("resize",this.reflow),this.root.remove()}fit(){this.menu.style.setProperty("--sl-a11ymenu-max",`${Jh({boundsTop:this.boundsTop(),buttonTop:this.button.getBoundingClientRect().top})}px`)}boundsTop(){let e=this.root.closest(".sl-map")??this.root.closest(".sl-picker");return e instanceof HTMLElement?e.getBoundingClientRect().top:0}open(e){if(e===!this.menu.hidden)return;if(this.button.setAttribute("aria-expanded",String(e)),!e){this.menu.hidden=!0,this.menu.classList.remove("sl-mo-in","sl-mo-stagger");return}this.menu.hidden=!1,this.fit(),this.menu.scrollTop=0;let t=this.button.getBoundingClientRect();Fn(this.menu,{x:t.left+t.width/2,y:t.top}),Xo(this.menu),Qo(this.menu)}rows(){return[...this.filterRows(),...this.deps.hasLimitedView?[{key:"limited",iconHtml:Yl("restrictedView",{size:17}),label:this.deps.tf("picker.hideLimitedView","Hide limited-view seats"),on:this.deps.isLimitedViewHidden()}]:[],{key:"colorblind",iconHtml:Wh,className:"sl-cbbtn",label:this.deps.tf("picker.colorblindColors","Colourblind-friendly colours"),on:this.deps.isColorblindSafe()}]}offered(){let e=this.deps.needs?.();if(e)return e.map(({key:n,count:r})=>({key:n,count:r}));let t=this.deps.present;return t?br.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(br.map(n=>[n.key,n]));return this.offered().flatMap(({key:n,count:r})=>{let o=t.get(n);return o?[{key:`a11y:${n}`,iconHtml:Yl(n,{size:17}),label:this.deps.tf(`picker.accessShort.${n}`,Zl[n]??o.label),...n==="wheelchair"&&e.has("companion")?{note:this.deps.tf("picker.companionSeatsNote","Companion places beside them stay selectable")}:{},...r==null?{}:{count:this.countText(r),disabled:r===0},on:this.active.has(n)}]:[]})}wire(){for(let e of this.menu.querySelectorAll("[data-sl-info]"))e.addEventListener("click",()=>{let t=e.closest(".sl-info"),n=!t?.classList.contains("open");for(let r of this.menu.querySelectorAll(".sl-info.open"))r.classList.remove("open"),r.querySelector("[data-sl-info]")?.setAttribute("aria-expanded","false");t?.classList.toggle("open",n),e.setAttribute("aria-expanded",String(n))});for(let e of this.menu.querySelectorAll("[data-a11y-row]"))e.addEventListener("click",()=>{let t=e.dataset.a11yRow??"";if(t==="colorblind"){let o=!this.deps.isColorblindSafe();this.deps.setColorblindSafe(o),this.paint(e,o);return}if(t==="limited"){let o=!this.deps.isLimitedViewHidden();this.deps.setLimitedViewHidden(o),o&&this.deps.focusSeatsForFilter(),this.paint(e,o);return}let n=t.slice(5),r=!this.active.has(n);r?this.active.add(n):this.active.delete(n),this.paint(e,r),this.applyFilter()})}promoteCounts(){if(this.deps.stepToAccessibleSection)for(let e of this.menu.querySelectorAll('[data-a11y-row^="a11y:"]')){let t=e.querySelector(".sl-a11yrow-c");if(!t)continue;let n=(e.dataset.a11yRow??"").slice(5),r=e.parentElement;r?.classList.contains("sl-a11yrow-w")||(r=document.createElement("div"),r.className="sl-a11yrow-w",e.replaceWith(r),r.appendChild(e));let o=document.createElement("button");o.type="button",o.className="sl-a11yrow-c sl-a11yjump",o.dataset.a11yJump=n,o.textContent=t.textContent,o.disabled=e.disabled,o.setAttribute("aria-label",this.jumpLabel(n,t.textContent??"")),t.remove(),e.setAttribute("aria-label",this.rowLabel(n,o.textContent??""));let s=r.querySelector(".sl-info");s?s.after(o):e.after(o),r.dataset.a11yTapThrough||(r.dataset.a11yTapThrough="true",r.addEventListener("click",a=>{a.target===r&&!e.disabled&&e.click()})),o.addEventListener("click",a=>{a.stopPropagation(),this.active.has(n)||(this.active.add(n),this.paint(e,!0),this.applyFilter({focus:!1}));let l=this.deps.stepToAccessibleSection?.(n);l&&o.setAttribute("aria-label",this.jumpLabel(n,o.textContent??"",l.label))})}}countText(e){return e>0?qh("picker.accessFreeCount",{count:e}):"0"}countNode(e){return e.querySelector(".sl-a11yrow-c")??e.parentElement?.querySelector(".sl-a11yrow-c")??null}typeLabel(e){let t=Zl[e]??br.find(n=>n.key===e)?.label??e;return this.deps.tf(`picker.accessShort.${e}`,t)}jumpLabel(e,t,n){return[this.deps.tf("picker.jumpToSection","Jump to section"),this.typeLabel(e),t,...n?[`${this.deps.tf("picker.section","Section")} ${n}`]:[]].filter(Boolean).join(" \xB7 ")}rowLabel(e,t){return[this.typeLabel(e),t].filter(Boolean).join(" \xB7 ")}paint(e,t){e.classList.toggle("on",t),e.setAttribute("aria-checked",String(t)),e.setAttribute("aria-pressed",String(t))}applyFilter(e={}){let t=this.active.size?[...this.active]:null;this.deps.applyAccessibilityFilter(t),this.remember(t),t&&e.focus!==!1&&this.deps.focusSeatsForFilter()}key(){let e=this.deps.chart?.();return`seatmap.a11y.filter.${this.deps.event}${e?`.${e}`:""}`}stored(){try{let e=window.sessionStorage.getItem(this.key()),t=e?JSON.parse(e):null;return Array.isArray(t)?t:[]}catch{return[]}}remember(e){try{e&&e.length?window.sessionStorage.setItem(this.key(),JSON.stringify(e)):window.sessionStorage.removeItem(this.key())}catch{}}};import{attachVisibilityCatchUp as eu}from"@seatlayer/core";var tu=250;function Ql(i,e=tu){let t=null,n=()=>{t===null&&(t=setTimeout(()=>{t=null,i()},e))},r=eu(n),o=typeof window<"u"&&typeof window.addEventListener=="function";return o&&window.addEventListener("focus",n),()=>{t!==null&&(clearTimeout(t),t=null),r(),o&&window.removeEventListener("focus",n)}}import{holdRecoveryShape as iu,tCount as bn}from"@seatlayer/core";var yn=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=iu(e),n=e.lapsedLabels.length,r=n-e.recoverable.length,o=t==="all"?bn("picker.holdLapsedStillFree",n):t==="partial"?bn("picker.holdLapsedSomeTaken",r):bn("picker.holdLapsedAllTaken",n);this.note={message:o,recoverable:t==="none"?[]:[...e.recoverable]},this.deps.toast(o,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>${_(this.actionLabel())}</button>`:"";return`<div class="sl-lapse-note" role="status"><span>${_(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 bn("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 Xl=Symbol("seatlayer.performance-group-picker");function vn(i,e){return Object.defineProperty(i,Xl,{configurable:!1,enumerable:!1,value:Object.freeze({...e})}),i}function Jl(i){return i[Xl]??null}var ec="@seatlayer/pending-checkout/v1";function nu(i){return typeof i=="string"&&i.length<=160&&/^ord_[A-Za-z0-9_-]+$/.test(i)}function Ot(i){if(typeof location>"u")return null;let e=new URLSearchParams(location.search),t=e.get("seatlayer_checkout");if(t!=="success"&&t!=="cancelled")return null;let n=null;try{let r=window.sessionStorage.getItem(ec);if(r){let o=null;try{o=JSON.parse(r)}catch{}if(o&&nu(o.orderId)){let s=Date.now()-Number(o.storedAt);if(s>=0&&s<=144e5){if(o.eventKey&&o.eventKey!==i)return null;n=o.orderId}}}window.sessionStorage.removeItem(ec)}catch{}e.delete("seatlayer_checkout");try{let r=e.toString();history.replaceState(history.state,"",`${location.pathname}${r?`?${r}`:""}${location.hash}`)}catch{}return{outcome:t,orderId:n}}function tc(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 nc="https://api.seatlayer.io",pu=10,hu=250,rc=6e4,oc=4,uu=10,mu=40,fu=220,yr=["mini","peek","open"],sc="seatmap.a11y.cb";function gu(){try{if(typeof window>"u")return null;let i=window.localStorage.getItem(sc);return i==null?null:i==="1"}catch{return null}}function bu(i){try{window.localStorage.setItem(sc,i?"1":"0")}catch{}}var Ve=class i{constructor(e){this.renderErrorEmitted=!1;this.realtime=null;this.accessEl=null;this.idleClock=null;this.lastSelectionValidity=null;this.root=null;this.mapHost=null;this.rendered=!1;this.destroyed=!1;this.renderInfo=null;this.webMcp=null;this.localeGeneration=0;this.els={};this.regions={};this.ro=null;this.viewportResizeHandler=null;this.holdTimer=null;this.loadAbort=null;this.transportAbort=new AbortController;this.toastTimer=null;this.offerReadInFlight=null;this.offerReadSettledAt=0;this.offerRefreshTimer=null;this.offerBoundaryTimer=null;this.offerCountdownTimer=null;this.offerVisibilityHandler=null;this.motionTimers=new Set;this.currency="USD";this.currencyResolved=!1;this.eventTimezone=null;this.eventWhenText=null;this.offerAvailability=null;this.channelByObject=new Map;this.pricesByChannel=new Map;this.hold=null;this.holdExpiresAt=0;this.handedOff=!1;this.bookedShown=!1;this.holdConflicted=!1;this.paymentOptions=null;this.checkoutPanel=null;this.extendEl=null;this.extendDismissed=!1;this.extendUsed=!1;this.bookedEl=null;this.holdExpiredEl=null;this.holdExpiredFresh=!1;this.holdExpiredUnits=[];this.gaQty=new Map;this.gaPromptEl=null;this.gaPromptReturnFocus=null;this.gaAreasExpanded=!1;this.lastMapPoint=null;this.tipEl=null;this.tipPos={x:0,y:0};this.tipPinned=!1;this.tipMarkedHoverLabel=null;this.lastPointerType="mouse";this.themeMode=null;this.colorSchemeStop=null;this.seatsRevealed=!1;this.seatsRevealedWaiters=[];this.seatsRevealedReport=null;this.renderResolvedAt=null;this.revealWaitMs=null;this.handoverMs=null;this.confirmCardCache=null;this.suppressConfirmationSeatId=null;this.tableDialogEl=null;this.tableDialog=null;this.tableDialogHeld=!1;this.tableDialogReturnFocus=null;this.srEl=null;this.baQty=2;this.baCat="";this.baZone="";this.baPremium=!1;this.bestAvailableConfirm=!1;this.baSoldOutSig="";this.bestAvailableSoldOut=!1;this.salesClosed=!1;this.salesState=null;this.soldOut=!1;this.soldoutEl=null;this.cbSafe=!1;this.rungsEl=null;this.testBadgeEl=null;this.projectionEl=null;this.buyerView="map";this.view3dEl=null;this.view3dHandle=null;this.view3dGen=0;this.view3dReturnSeat=null;this.view3dTargetSeatId=null;this.view3dCompareSeatIds=[];this.view3dCompareChip=new cn({overlay:()=>this.view3dEl,savedSeatIds:()=>this.view3dCompareSeatIds,openComparison:()=>this.openView3dComparison(),clearComparison:()=>this.clearView3dComparison(),toast:(e,t)=>this.toast(e,t)});this.view3dCompareEl=null;this.view3dCompareCleanup=null;this.view3dSeatViewChrome=null;this.view3dPassportEl=null;this.view3dPassportCleanup=null;this.floorsEl=null;this.arenaViewportInsets={top:0,right:0,bottom:0,left:0};this.viewEl=null;this.viewCleanup=null;this.seatViewGen=0;this.allSeatsCache=null;this.view3dBack=null;this.view3dNav=null;this.lastRailSignature="";this.priceSelect=null;this.minimap=null;this.pickerLayoutSize={width:0,height:0};this.fullscreenAffordanceSize={rootWidth:-1,rootHeight:-1,viewportWidth:-1,viewportHeight:-1};this.priceBandKeys=null;this.focusedCatKey=null;this.limitedViewFilter=!1;this.pricesExpanded=!1;this.sectionCardCache=null;this.lastTrayCount=0;this.langSel=null;this.lastTrayTotal=0;this.lastTrayKeys=new Set;this.bestAvailableBusy=!1;this.releasingLabels=new Set;this.holdingLabels=new Set;this.ctaPhase="idle";this.a11yMenu=null;this.detachAttention=null;this.lapse=new yn({toast:(e,t,n)=>this.toast(e,t,n),reselect:e=>{this.controller.select(e),this.handleCta()},syncTray:()=>this.syncTray()});this.railEdgesBound=!1;this.fsFallback=!1;this.fsChangeHandler=null;this.fsEscHandler=null;this.eventDetailsHidden=!1;this.sideCollapsed=!1;this.sideToggleEl=null;this.framedFs=!1;this.lastPostedHeight=0;this.cbEl=null;this.modalCleanup=null;this.prevFocus=null;this.escHandler=null;this.closeModal=null;this.fitScheduled=!1;this.perspectiveWarned=!1;if(!e||typeof e!="object")throw new Error("seatmap: options object is required");if(!e.event||typeof e.event!="string")throw new Error("seatmap: `event` key is required");if(!e.container)throw new Error("seatmap: `container` is required (or use SeatPicker.open())");this.performanceGroup=Jl(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??nc).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?Vi({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??ei(e,t),this.pubApi=e.transport?null:n?.api??new Oe(this.apiBase,{access:this.access??void 0,referral:e.referral,onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)}),this.api=Ns(e.transport??this.pubApi,this.transportAbort.signal),this.chartFetch=Ni(this.api),this.buyerAssetUrls=new At(e.event,this.api.asset?(a,l)=>this.api.asset(a,l):void 0),e.checkout==="hosted"&&!this.pubApi&&console.warn('seatlayer: checkout: "hosted" needs the widget\'s own transport \u2014 a custom `transport` owns its backend, so the picker is staying on onCheckout for this mount.'),this.checkoutMode=e.checkout==="hosted"&&this.pubApi?"hosted":"handoff";let r=e.numberOfPlacesToSelect;if(r!=null&&(!Number.isInteger(r)||r<1))throw new Error("seatmap: `numberOfPlacesToSelect` must be a positive integer");this.exactTickets=r??null;let o=dl(e.selectionValidators);if(this.exactTickets!=null&&o>this.exactTickets)throw new Error("seatmap: `minimumSelectedPlaces.minimum` cannot exceed `numberOfPlacesToSelect`");let s=Math.max(1,Math.floor(e.maxSelection??this.exactTickets??Math.max(pu,o)));if(this.exactTickets!=null&&s<this.exactTickets)throw new Error("seatmap: `maxSelection` cannot be lower than `numberOfPlacesToSelect`");if(e.maxSelection!=null&&s<o)throw new Error("seatmap: `maxSelection` cannot be lower than `minimumSelectedPlaces.minimum`");this.maxTickets=this.exactTickets??s,this.cbSafe=gu()??!!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 Mt(e)}isFramed(){return typeof window<"u"&&window.parent!==window}postToHost(e){if(!this.isFramed())return;let t=tc({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-oc&&t.width>=window.innerWidth-oc}syncFullscreenAffordance(){let e=this.els.zfs;if(!e)return;let n=!(!!document.fullscreenElement||this.fsFallback||this.framedFs)&&this.root?.dataset.layout==="narrow"&&this.fillsViewport();e.hidden=n,e.tabIndex=n?-1:0,e.setAttribute("aria-hidden",String(n))}fullscreenMeasurementChanged(e,t){let n=typeof window>"u"?0:window.innerWidth,r=typeof window>"u"?0:window.innerHeight,o=e!==this.fullscreenAffordanceSize.rootWidth||t!==this.fullscreenAffordanceSize.rootHeight||n!==this.fullscreenAffordanceSize.viewportWidth||r!==this.fullscreenAffordanceSize.viewportHeight;return this.fullscreenAffordanceSize={rootWidth:e,rootHeight:t,viewportWidth:n,viewportHeight:r},o}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){Pt();let t=document.activeElement instanceof HTMLElement?document.activeElement:null,n=document.createElement("div");n.className="sl-modal-scrim";let r=document.createElement("div");r.className="sl-modal-frame",r.style.setProperty("--sl-bg",bt(void 0,e.theme)["--sl-bg"]),r.setAttribute("role","dialog"),r.setAttribute("aria-modal","true"),r.setAttribute("aria-label",b("picker.seatSelection","Seat selection")),r.tabIndex=-1,n.appendChild(r),document.body.appendChild(n);let o=document.body.style.overflow;document.body.style.overflow="hidden";let s=_s(n),a;try{a=new i({...e,container:r})}catch(g){throw s(),n.remove(),document.body.style.overflow=o,g}a.prevFocus=t,a.modalCleanup=()=>{a.modalCleanup=null,s(),document.body.style.overflow=o,a.escHandler&&document.removeEventListener("keydown",a.escHandler),n.remove();let g=a.prevFocus;a.prevFocus=null,g?.isConnected&&g.focus({preventScroll:!0})};let l=["a[href]","area[href]","button","input","select","textarea","iframe","object","embed","summary","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"[tabindex]"].join(","),c=()=>{let g=[...r.querySelectorAll('[role="dialog"][aria-modal="true"]')].filter(T=>T.isConnected&&!T.closest('[hidden], [aria-hidden="true"], [inert]'));return g[g.length-1]??r},d=(g,T)=>{let S=g;for(;S;){let y=window.getComputedStyle(S);if(S.hidden||S.getAttribute("aria-hidden")==="true"||S.hasAttribute("inert")||y.display==="none"||y.visibility==="hidden"||y.visibility==="collapse")return!0;if(S===T)return!1;S=S.parentElement}return!0},u=g=>[...g.querySelectorAll(l)].filter(T=>T.tabIndex>=0&&!T.matches(":disabled")&&!d(T,g)),m=(g,T)=>{let S=u(g),y=T?S[S.length-1]:S[0];y?y.focus({preventScroll:!0}):(g.hasAttribute("tabindex")||(g.tabIndex=-1),g.focus({preventScroll:!0}))},p=!1,v=()=>{if(p)return;p=!0,a.modalCleanup?.();let g=()=>{a.destroy(),e.onClose?.()};a.hold&&!a.handedOff&&e.holdOnClose!=="keep"?a.release().finally(g):g()};a.closeModal=v,n.addEventListener("mousedown",g=>{g.target===n&&v()}),a.escHandler=g=>{if(g.key==="Tab"){if(g.defaultPrevented)return;let T=c(),S=u(T),y=S[0],P=S[S.length-1],R=document.activeElement;!y||!P?(g.preventDefault(),m(T,g.shiftKey)):R===T||!R||!T.contains(R)?(g.preventDefault(),(g.shiftKey?P:y).focus({preventScroll:!0})):g.shiftKey&&R===y?(g.preventDefault(),P.focus({preventScroll:!0})):!g.shiftKey&&R===P&&(g.preventDefault(),y.focus({preventScroll:!0}));return}g.key==="Escape"&&(a.tableDialog?(g.preventDefault(),a.cancelTableDialog()):a.confirmSeat?(g.preventDefault(),a.cancelConfirm()):a.bestAvailableConfirm?(g.preventDefault(),a.bestAvailableConfirm=!1,a.syncTray()):(g.preventDefault(),v()))},document.addEventListener("keydown",a.escHandler);try{let g=a.render();a.els.close?.classList.add("on"),a.els.close?.addEventListener("click",v),await g}catch(g){throw a.destroy(),g}return a.destroyed||m(c(),!1),a}static prewarm(e){try{if(!e||typeof e!="object"||typeof e.event!="string"||!e.event||typeof e.publicKey!="string"||!e.publicKey)return;Wo({base:(e.apiBase??nc).replace(/\/+$/,""),event:e.event,publicKey:e.publicKey})}catch{}}wireController(e){return new ru({sectionPreview:!0,transport:this.chartFetch.transport,eventKey:e.event,maxSelection:this.maxTickets,selectedObjects:e.selectedObjects,selectableObjects:e.selectableObjects,numberOfPlacesToSelect:e.numberOfPlacesToSelect,selectionValidators:e.selectionValidators,currency:e.currency,categoryPriceRanges:()=>this.mapPriceRanges(),flashOnLiveChange:!0,colorblindSafe:this.cbSafe,...e.loadingReveal?{loadingReveal:e.loadingReveal}:{},mapTheme:gt(e.theme),onSeatsRevealed:()=>{this.seatsRevealed=!0,this.drainSeatsRevealedWaiters(),this.revealWaitMs===null&&this.renderResolvedAt!==null&&(this.revealWaitMs=performance.now()-this.renderResolvedAt),e.onSeatsRevealed?.(),this.seatsRevealedReport?.()},onGAClick:t=>{let n=this.controller.getGAAreas().find(r=>r.id===t);n&&(this.collapseSheet(),Kn(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(),Gs(t)&&this.scheduleOfferRefresh(!0),this.evictTakenSelections(),this.detectBooked(),this.minimap?.refreshMinimap(),this.pushAvailabilityTo3d()}),onHoldExpired:()=>{let t=this.handedOff,n=this.holdConflicted;this.holdExpiredUnits=Kl(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(N("picker.holdExpired",void 0)||"Your hold expired. 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.closedWords().toast,"warning");return}this.controller.tableSelection(t.id)||(this.collapseSheet(),this.flashPickedSeat(t.id),this.opts.confirmSelection&&this.suppressConfirmationSeatId!==t.id&&this.showConfirm(t))},onTableSelectionRequest:t=>{if(this.salesClosed){this.controller.deselect(t.physicalSeatIds),this.toast(this.closedWords().toast,"warning");return}this.showTableDialog(t,!1)},onDeselect:t=>{if(this.controller.currentHold()?.labels.includes(t.label)){if(this.opts.confirmSelection===!1||this.salesClosed){this.removeHeldLabels([t.label]);return}if(this.confirmSeat?.id===t.id){this.dismissConfirm();return}this.showConfirm(t,"remove");return}if(this.confirmSeat?.id===t.id){this.dismissConfirm();return}if(this.tableDialog?.physicalSeatIds.includes(t.id)){this.dismissTableDialog();return}this.opts.confirmSelection===!1||this.salesClosed||this.controller.tableSelection(t.id)||(this.controller.select([t.id]),this.showConfirm(t,"remove"))},onSelectionLimit:()=>{this.toast(N("picker.maxTicketsForOrder",{count:this.maxTickets}),"warning"),this.opts.onSelectionLimit?.(this.maxTickets)},onViewChange:()=>{this.reanchorConfirm(),this.syncRung(),this.syncProjection(),this.minimap?.drawMinimapRect(),this.sectionCardOnView()},onSectionFocus:t=>this.showSectionCard(t),onDeckTap:()=>{this.showSectionCard(null),this.syncFloors(),this.syncRung(),this.minimap?.refreshMinimap()},onFocusSeat:t=>this.announceSeat(t),onSeatHover:t=>this.updateTooltip(t),hostCardOpen:()=>this.tipPinned||!!this.confirmSeat,onHint:t=>{t&&this.toast(t)},onSalesClosed:()=>this.setSalesClosed(!0),onError:t=>{this.renderErrorEmitted=!0,this.opts.onError?.(t)}})}async render(){if(this.rendered)return this;let e=performance.now(),t={},n=p=>Math.round((performance.now()-p)*100)/100;this.rendered=!0,Pt();let r=performance.now(),o=Ri(this.opts.locale,this.opts.messages),s=this.localeGeneration+=1;this.checkoutMode==="hosted"&&(this.paymentOptions=this.pubApi.paymentOptions(this.opts.event));let a=performance.now(),l=$r(this.opts.container),{root:c,els:d,mapHost:u}=Fo(l,(p,v)=>this.tf(p,v),this.opts.theme);this.root=c,this.els=d,this.mapHost=u,Ii(c,o,p=>{t.loadLocale=n(r),this.destroyed||this.applyActiveLocale(p,s)}),_a(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 m=document.createElement("div");return m.style.cssText="position:absolute;inset:0",this.mapHost.appendChild(m),t.mountBuyerShell=n(a),t.skeletonPaint=n(e),this.loadAndFinishChart(m,t,n,e,c)}async loadAndFinishChart(e,t,n,r,o){this.startRealtime(),this.startIdleClock(o);let s=await this.loadChart(e,t,n);if(!s)return this.realtime?.stop(),this.realtime=null,this;t.shellsPaint=n(r);let a=performance.now();if(this.salesClosed=!!s.salesClosed||!!this.opts.readOnly,this.salesState=s.salesState??null,o.dataset.eventMode=s.mode==="test"?"test":"live",!this.opts.locale&&s.locale&&this.setLocale(s.locale),this.controller.setViewMode(this.normalizeInitialView(this.opts.initialView)),this.buildRegions(),this.regions["bottom-right"].appendChild(this.els.zoom),this.regions["bottom-center"].appendChild(this.els.toast),s.mode==="test"){let y=document.createElement("div");y.className="sl-testbadge",this.testBadgeEl=y,this.syncTestBadge(),this.regions["top-left"].appendChild(y)}let l=this.controller.doc?.theme;this.themeMode=this.opts.theme?.mode??null,this.applyThemeTokens(o),this.watchThemeMode(),this.currency=s.currency??this.opts.currency??"USD",this.currencyResolved=!0,this.eventTimezone=s.timezone??null,jr(this.els.logo,[this.opts.theme?.logoUrl,l?.logoUrl,s.posterUrl],this.opts.theme?.brandName??l?.brandName??s.eventName??"?"),this.els.name.textContent=s.eventName??"";let c=s.startsAt?xi(s.startsAt,s.timezone??null,this.opts.locale):"";this.eventWhenText=c||null,this.els.meta.textContent=[s.venue,c].filter(Boolean).join(" \xB7 "),this.syncProjection(),this.buildBadge(l);let d=!!this.controller.doc&&this.controller.getExpandedSeats().some(y=>y.commercial?.restrictedView||y.commercial?.obstructedView);this.buildAccessibilityMenu(d),this.buildLanguageSwitcher(this.els.zoom??this.regions["bottom-right"]),this.srEl=document.createElement("div"),this.srEl.className="sl-sr",this.srEl.setAttribute("aria-live","polite"),o.appendChild(this.srEl),this.buildArenaChrome(),this.buildMinimap(),this.buildPriceFilter(),this.buildExtendPrompt(),this.buildBookedOverlay(),this.buildSoldoutOverlay(),this.buildPanelToggle(),this.opts.panelCollapsed&&this.setPanelCollapsed(!0),this.dockLayoutChrome(),t.buildBuyerControls=n(a);let u=performance.now();if(!await this.restoreHoldForFirstPaint(t))return this;if(t.restoreHold=n(u),this.destroyed)return this;this.dismissSkeleton(),this.salesClosed&&this.applySalesClosed(),this.syncOffer(),this.syncPrices(),this.syncTray(),this.resumeHostedOrder();let m=this.controller.doc,p=Ei(this.opts.event),v=this.performanceGroup?.surface??(this.performanceGroup?"performance_group":null),g=v??"event",T={apiBase:this.apiBase,eventKey:this.opts.event,metricScope:g,surface:v==="season"?"season_picker":v==="performance_group"?"performance_group_picker":"seat_picker",ms:n(r),performanceProfile:t,seatCount:this.allSeats().length,objectCount:m?.objects.length??0,sectionCount:m?.objects.filter(y=>y.type==="section").length??0,floorCount:this.controller.getFloors().length,chartName:m?.name,view:this.buyerView,load:p,transport:this.opts.transport?"custom":"pubapi",revealWaitMs:this.revealWaitMs??this.sinceRenderResolved(),handoverMs:this.handoverMs??void 0};ja(T,(y,P)=>this.emitAnalytics(y,P));let S=s.performanceProfile;return this.seatsRevealedReport=()=>this.emitAnalytics("chart_seats_revealed",ur({...T,performanceProfile:{...T.performanceProfile,...S}})),this.seatsRevealed&&this.seatsRevealedReport(),this.renderInfo=s,await this.registerAgentTools(),this}registerAgentTools(){return Va(this)}webMcpHost(e){return hr(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=Ql(()=>{this.destroyed||this.controller.refreshAvailability()}),this.observeLayout(e),this.els.zin.addEventListener("click",()=>this.controller.zoomIn()),this.els.zout.addEventListener("click",()=>this.controller.zoomOut()),this.els.zfit?.addEventListener("click",()=>this.controller.overview()),this.els.zfs.addEventListener("click",()=>this.toggleFullscreen()),this.fsChangeHandler=()=>{document.fullscreenElement||this.setFsFallback(!1),this.syncFullscreenButtons(),requestAnimationFrame(()=>this.controller.refitCurrentView())},document.addEventListener("fullscreenchange",this.fsChangeHandler);let t=this.els.sheetHead;if(t){let r=this.els.sheetToggle;this.syncSheetAffordance();let o=0,s=!1,a=!1,l=!1;r?.addEventListener("click",c=>{c.stopPropagation(),!s&&this.cycleSheet()}),t.addEventListener("pointerdown",c=>{if(c.target.closest?.(".sl-seccard")){a=!1;return}l=!!c.target.closest?.(".sl-sheet-toggle"),a=!0,s=!1,o=c.clientY,(l&&r?r:t).setPointerCapture?.(c.pointerId)}),t.addEventListener("pointermove",c=>{if(!a||s)return;let d=c.clientY-o;d<-18?(this.stepSheet(1),s=!0):d>18&&(this.stepSheet(-1),s=!0)}),t.addEventListener("pointerup",c=>{a&&!s&&!l&&Math.abs(c.clientY-o)<6&&this.cycleSheet(),a=!1,(l&&r?r:t).releasePointerCapture?.(c.pointerId),l=!1})}this.els.foot?.addEventListener("click",r=>{this.root?.dataset.layout==="narrow"&&(r.target.closest?.('.sl-chip,button,a,input,select,label,[role="button"]')||this.cycleSheet())});let n=()=>{if(this.root?.dataset.layout!=="narrow")return;let r=this.root.getAttribute("data-prices-open")==="true";this.root.setAttribute("data-prices-open",String(!r)),this.els.pricesSec?.setAttribute("aria-expanded",String(!r)),!r&&this.root.dataset.sheet!=="open"&&this.setSheetOpen(!0)};this.els.pricesSec?.addEventListener("click",r=>{r.target.closest("select,button")||n()}),this.els.pricesSec?.addEventListener("keydown",r=>{r.key!=="Enter"&&r.key!==" "||r.target.closest("select,button")||(r.preventDefault(),n())}),e.addEventListener("click",r=>{let o=r.target.closest("[data-sl-info]");if(!o||!e.contains(o))return;r.stopPropagation();let s=o.closest(".sl-info"),a=!s?.classList.contains("open");this.closeInfoPops(s),s?.classList.toggle("open",a),o.setAttribute("aria-expanded",String(a))}),e.addEventListener("pointerdown",r=>{r.target.closest(".sl-info")||this.closeInfoPops()}),this.tipEl=document.createElement("div"),this.tipEl.setAttribute("role","tooltip"),this.tipEl.className="sl-tip",this.els.map.appendChild(this.tipEl),this.els.map.addEventListener("pointerdown",r=>{this.handleMapPointerDown(r)},!0),this.els.map.addEventListener("mousemove",r=>{if(this.tipPinned)return;let o=this.els.map.getBoundingClientRect();this.tipPos={x:r.clientX-o.left,y:r.clientY-o.top},this.tipEl&&this.tipEl.style.display!=="none"&&this.placeTooltip()}),this.els.cta.addEventListener("click",()=>{this.els.cta.dataset.act==="find"?this.openBestSeatsForm():this.handleCta()})}sheetState(){let e=this.root?.dataset.sheet;return e==="mini"||e==="open"?e:"peek"}sheetHasCards(){return this.root?.getAttribute("data-has-selection")==="true"}setSheetState(e){let t=this.root;if(!t)return;let n=t.dataset.sheet;t.dataset.sheet=e==="mini"&&!this.sheetHasCards()?"peek":e,this.syncSheetAffordance(),n==="mini"&&t.dataset.sheet!=="mini"&&this.scheduleFit()}syncSheetAffordance(){let e=this.sheetState(),t=e==="open"||e==="peek"&&this.sheetHasCards(),n=this.els.sheetToggle;n?.setAttribute("aria-expanded",String(e==="open")),n?.setAttribute("aria-label",t?this.tf("picker.collapseTicketPanel","Collapse ticket panel"):this.tf("picker.openTicketPanel","Open ticket panel"))}cycleSheet(){let e=this.sheetState();e==="open"||e==="mini"?this.setSheetState("peek"):this.setSheetState(this.sheetHasCards()?"mini":"open")}stepSheet(e){let t=yr.indexOf(this.sheetState()),n=Math.min(yr.length-1,Math.max(0,t+e));this.setSheetState(yr[n])}setSheetOpen(e){this.setSheetState(e?"open":"peek")}openBestSeatsForm(){this.setSheetOpen(!0),this.els.tray?.querySelector(".sl-ba")?.scrollIntoView({block:"nearest",behavior:this.reducedMotion()?"auto":"smooth"}),this.els.tray?.querySelector(".sl-ba-go")?.focus()}collapseSheet(){let e=this.root;!e||e.dataset.layout!=="narrow"||e.dataset.sheet!=="open"||this.setSheetState("peek")}observeLayout(e){let t=()=>{let n=e.clientWidth;if(n<=0)return;let r=e.clientHeight,o=n!==this.pickerLayoutSize.width||r!==this.pickerLayoutSize.height;this.pickerLayoutSize={width:n,height:r};let s=this.fullscreenMeasurementChanged(n,r);this.reportFramedHeight();let a=n<640?"narrow":"wide",l=r<560?"compact":"comfortable",c=e.dataset.layout!==a||e.dataset.density!==l;c&&(e.dataset.layout=a,e.dataset.density=l,this.controller.setNarrowLayout?.(a==="narrow"),queueMicrotask(()=>this.syncFitClearance()),this.controller.getRenderer()?.setSectionFocusDim?.(a!=="narrow"),a==="narrow"&&!e.dataset.sheet&&(e.dataset.sheet="peek"),this.dockLayoutChrome(),this.syncMinimapForLayout(),this.lastTrayKeys.size&&this.syncTray(),this.syncMapStepBack(),this.refreshExtendPrompt()),(s||c)&&this.syncFullscreenAffordance(),this.syncArenaViewportInsets(),o&&(this.minimap?.refreshMinimap(),this.scheduleFit())};this.ro=new ResizeObserver(t),this.ro.observe(e),this.els.map&&this.ro.observe(this.els.map),this.viewportResizeHandler=()=>{this.fullscreenMeasurementChanged(e.clientWidth,e.clientHeight)&&this.syncFullscreenAffordance()},window.addEventListener("resize",this.viewportResizeHandler),t(),requestAnimationFrame(t)}async loadChart(e,t,n){let r=performance.now();this.seatsRevealed=!1,this.seatsRevealedWaiters=[],this.seatsRevealedReport=null,this.renderResolvedAt=null,this.revealWaitMs=null,this.handoverMs=null,this.loadAbort=new AbortController;let o=await vt(async()=>{this.renderErrorEmitted=!1;let l=await this.controller.render(e);return this.renderResolvedAt=performance.now(),this.seatsRevealed&&(this.revealWaitMs=0),this.viewportLoading()&&this.drainSeatsRevealedWaiters(),l},this.loadAbort.signal,()=>{let l=this.els.boot.querySelector(".sl-boot-say");l&&(l.classList.add("is-visible"),l.textContent=this.tf("picker.loadingTakingLonger","The seat map is taking longer to load. Please wait\u2026"))});if(this.loadAbort=null,o.outcome==="cancelled"||this.destroyed)return null;let s=o.outcome==="loaded"?o.value:null,a=o.outcome==="loaded"&&!s&&!this.opts.transport?Di(this.chartFetch?.outcome(),this.renderErrorEmitted):null;if(s||this.controller.destroy(),t.loadChartAndStatuses=n(r),this.destroyed)return null;if(!s){a&&Bi({apiBase:this.apiBase,eventKey:this.opts.event,reason:a}),ve({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:o.outcome==="timeout"?"load_timeout":o.outcome==="error"?"render_error":"load_chart",ms:t.loadChartAndStatuses,performanceProfile:t,view:"map",load:Ee(this.opts.event),transport:this.opts.transport?"custom":"pubapi"});let l=this.opts.transport?void 0:this.chartFetch?.outcome();if(l?.state==="rejected"&&l.error?.status===404){let c=l.error;c.serverMessage&&console.warn(`[SeatLayer] ${c.serverMessage}`),this.opts.onError?.(c),Ht(this.els.boot,{title:this.tf("picker.eventUnavailableTitle","This event isn\u2019t available"),description:this.tf("picker.eventUnavailable","Tickets can\u2019t be booked here right now.")});for(let d of[this.els.side,this.els.rail])d&&(d.setAttribute("inert",""),d.style.display="none");return null}return Ht(this.els.boot,{title:this.tf("picker.mapDidNotLoad","The seat map didn\u2019t load"),description:this.tf("picker.checkConnection","Check your connection and try again."),actionLabel:this.tf("picker.accessRetry","Try again")}),this.els.boot.querySelector("button").addEventListener("click",()=>{if(this.destroyed||!this.root)return;this.controller=this.wireController(this.opts),Ht(this.els.boot,{title:this.tf("picker.loadingSeatMap","Loading seat map\u2026"),busy:!0});let c=performance.now();this.loadAndFinishChart(e,{},n,c,this.root)},{once:!0}),null}return Object.assign(t,s.performanceProfile),s}sinceRenderResolved(){return this.renderResolvedAt===null?void 0:performance.now()-this.renderResolvedAt}whenSeatsRevealed(e){if(!this.destroyed){if(this.seatsRevealed||this.viewportLoading()&&this.renderResolvedAt!==null){e();return}this.seatsRevealedWaiters.push(()=>{this.destroyed||e()})}}viewportLoading(){return this.opts.loadingReveal==="viewport"}drainSeatsRevealedWaiters(){let e=this.seatsRevealedWaiters;this.seatsRevealedWaiters=[];for(let t of e)try{t()}catch{}}async restoreHoldForFirstPaint(e){let t=[this.els.side,this.els.rail].filter(Boolean),n=t.map(r=>r.hasAttribute("inert"));t.forEach(r=>r.setAttribute("inert",""));try{for(;!this.destroyed;){let r=performance.now();try{return await this.restoreRememberedHold(),!this.destroyed}catch{if(this.destroyed)return!1;ve({apiBase:this.apiBase,event:this.opts.event,reconnects:this.realtime?.reconnects??0,scope:this.performanceGroup?.surface??(this.performanceGroup?"performance_group":"event"),surface:this.performanceGroup?.surface==="season"?"season_picker":this.performanceGroup?"performance_group_picker":"seat_picker",outcome:"failure",stage:"restore_hold",ms:performance.now()-r,performanceProfile:e,view:"map",load:Ee(this.opts.event),transport:this.opts.transport?"custom":"pubapi"});let s=Ht(this.els.boot,{title:this.tf("picker.restoreUnavailableTitle","Unable to check saved seats"),description:this.tf("picker.restoreUnavailable","Try again to check whether your saved seats are still held."),actionLabel:this.tf("picker.accessRetry","Try again")}),a=this.transportAbort.signal;if(await new Promise(l=>{let c=()=>{s.removeEventListener("click",c),a.removeEventListener("abort",c),l()};s.addEventListener("click",c,{once:!0}),a.addEventListener("abort",c,{once:!0}),a.aborted&&c()}),this.destroyed||a.aborted)return!1;Ht(this.els.boot,{title:this.tf("picker.restoringSeats","Checking your saved seats\u2026"),busy:!0})}}return!1}finally{t.forEach((r,o)=>{n[o]||r.removeAttribute("inert")})}}resumeHostedOrder(){if(this.checkoutMode!=="hosted")return;let e=Ot(this.opts.event);e?.outcome!=="success"||!e.orderId||this.openCheckoutPanel({kind:"resume",orderId:e.orderId})}buildPanelToggle(){if(!this.regions["top-right"])return;let e=document.createElement("button");e.type="button",e.className="sl-side-toggle",e.addEventListener("click",()=>this.setPanelCollapsed(!this.sideCollapsed)),this.sideToggleEl=e,this.regions["top-right"].appendChild(e),this.syncPanelToggle()}syncPanelToggle(){let e=this.sideToggleEl;if(!e)return;let t=this.sideCollapsed;e.setAttribute("aria-expanded",String(!t)),e.setAttribute("aria-label",t?this.tf("picker.showTicketPanel","Show the ticket panel"):this.tf("picker.hideTicketPanel","Hide the ticket panel")),e.title=t?this.tf("picker.showTicketPanel","Show the ticket panel"):this.tf("picker.hideTicketPanel","Hide the ticket panel"),e.innerHTML=t?`<svg viewBox="0 0 24 24"><path d="M15 6l-6 6 6 6"/></svg><span>${this.tf("picker.tickets","Tickets")}</span>`:'<svg viewBox="0 0 24 24"><path d="M9 6l6 6-6 6"/></svg>'}setPanelCollapsed(e){this.destroyed||(this.sideCollapsed=e,this.applyPanelCollapsed(),this.scheduleMotion(()=>this.controller.refitCurrentView(),340))}applyPanelCollapsed(){let e=this.root?.dataset.layout!=="narrow";this.root?.setAttribute("data-side-collapsed",String(this.sideCollapsed)),this.els.side?.toggleAttribute("inert",this.sideCollapsed&&e),this.syncPanelToggle()}buildAccessibilityMenu(e){let t=this.els.zoom??this.regions["bottom-right"]??this.els.map;t&&(this.a11yMenu=new gn(t,{event:String(this.opts.event),chart:()=>this.controller.doc?.name??null,needs:()=>this.controller.getAccessNeeds(),hasLimitedView:e,tf:(n,r)=>this.tf(n,r),isColorblindSafe:()=>this.cbSafe,setColorblindSafe:n=>this.setColorblindSafe(n),isLimitedViewHidden:()=>this.limitedViewFilter,setLimitedViewHidden:n=>{this.limitedViewFilter=n,this.controller.setCommercialLimitedFilter(n),this.pushAvailabilityTo3d()},applyAccessibilityFilter:n=>this.applyAccessibilityFilter(n),focusSeatsForFilter:()=>this.whenSeatsRevealed(()=>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(N("picker.accessSpreadHint",{count:e.spaces,sections:e.sections.length}),"neutral")}applyAccessibilityFilter(e){this.controller.setAccessibilityFilter(e),this.syncPrices(),this.minimap?.refreshMinimap(),this.pushAvailabilityTo3d()}setAccessibilityFilter(e){this.applyAccessibilityFilter(e),this.a11yMenu?.syncAccessibilityFilter(e),e?.length&&this.focusSeatsForFilter()}focusAccessibilityFilter(){this.focusSeatsForFilter()}dockLayoutChrome(){let e=this.root?.dataset.layout==="narrow";this.applyPanelCollapsed();let t=this.els.zfs,n=this.els.headInfo?.parentElement;t&&n&&t.parentElement!==n&&(t.classList.add("sl-fs-pill"),n.insertBefore(t,this.els.hold??null));let r=this.extendEl;if(r){let s=e?this.regions["bottom-center"]??this.els.map:n;s&&r.parentElement!==s&&(r.dataset.dock=e?"map":"head",s===n?s.insertBefore(r,this.els.close??null):s.appendChild(r))}let o=this.els.pricesSec;o&&(e?(o.setAttribute("role","button"),o.tabIndex=0,o.setAttribute("aria-expanded",String(this.root?.getAttribute("data-prices-open")==="true"))):(o.removeAttribute("role"),o.removeAttribute("aria-expanded"),o.tabIndex=-1)),this.lastSection&&this.renderSectionCard(this.lastSection)}buildExtendPrompt(){hl(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>${_(this.tf("picker.backToMap","Back to map"))}</span></button>`,this.root.appendChild(e),this.bookedEl=e,this.els.bookedSub=e.querySelector('[data-ref="bookedSub"]'),this.els.bookedList=e.querySelector('[data-ref="bookedList"]'),e.querySelector('[data-ref="bookedBack"]')?.addEventListener("click",()=>this.dismissBooked())}get onGAPromptHook(){return this.opts.onGAPrompt}closedWords(){return No(this.salesState,!!this.opts.readOnly)}tf(e,t){return b(e,t)}buildSoldoutOverlay(){if(!this.els.map)return;let e=document.createElement("div");e.className="sl-soldout",e.setAttribute("role","status");let t=(this.controller.doc?.theme?.brandName??this.opts.theme?.brandName??this.els.name?.textContent??this.tf("picker.soldOutEyebrow","This event")).toUpperCase(),n=document.createElement("div");n.className="sl-soldout-eyebrow",n.textContent=t;let r=document.createElement("div");r.className="sl-soldout-title",r.textContent=this.tf("picker.soldOutTitle","Sold out");let o=document.createElement("p");o.className="sl-soldout-copy",o.textContent=this.tf("picker.soldOutCopy","No reserved seats are currently available for this event."),e.append(n,r,o),this.els.map.appendChild(e),this.soldoutEl=e}syncSoldout(e,t){let n=this.controller.getGAAreas().length>0,r=this.isSoldOut(e,t,n),o=[...Mi(e,t)].join("|");o!==this.baSoldOutSig&&(this.baSoldOutSig=o,this.syncTray()),r!==this.soldOut&&(this.soldOut=r,this.soldoutEl?.classList.toggle("on",r))}isSoldOut(e,t,n){return!n&&e.length>0&&e.every(r=>(t[r.key]??0)===0)}setSalesClosed(e){let t=e||!!this.opts.readOnly;this.salesClosed!==t&&(this.salesClosed=t,this.applySalesClosed())}applySalesClosed(){this.salesClosed&&this.tableDialog&&!this.tableDialogHeld&&this.cancelTableDialog();let e=this.els.closedPill;if(e){e.classList.toggle("on",this.salesClosed);let t=this.els.closedPillText??e;t.textContent=this.closedWords().pill}this.root?.setAttribute("data-sales-closed",String(this.salesClosed)),this.salesClosed&&this.srEl&&(this.srEl.textContent=this.closedWords().toast),this.syncCta(),this.syncTray()}badgeHidden(e){return!!e?.hideBadge}buildBadge(e){if(this.badgeHidden(e))return;let t=this.els.foot;if(!t)return;let 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")),n.dataset.slA="picker.poweredBy";let r=document.createElement("span");r.className="sl-powered-mark",r.setAttribute("aria-hidden","true"),r.innerHTML=Ki;let o=document.createElement("span");o.textContent=this.tf("picker.poweredBy","Powered by SeatLayer"),o.dataset.slT="picker.poweredBy",n.append(r,o),t.appendChild(n)}buildRegions(){if(!this.els.map)return;let e=["top-left","top-center","top-right","left-rail","bottom-left","bottom-center","bottom-right"];for(let t of e){let n=document.createElement("div");n.className="sl-anchor",n.dataset.region=t,this.els.map.appendChild(n),this.regions[t]=n}}cssVar(e){return this.root?getComputedStyle(this.root).getPropertyValue(e).trim():""}reducedMotion(){return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}scheduleMotion(e,t){let n=setTimeout(()=>{this.motionTimers.delete(n),this.destroyed||e()},t);this.motionTimers.add(n)}animateOnce(e,t,n=600){!e||this.reducedMotion()||(e.classList.remove(t),e.offsetWidth,e.classList.add(t),this.scheduleMotion(()=>e.classList.remove(t),n))}flashPickedSeat(e){this.reducedMotion()||this.controller.flashSeat(e,this.cssVar("--sl-accent")||"#f4b740")}flashHeldSeats(e){let t=this.reducedMotion(),n=(e.items??[]).filter(r=>r.objectType!=="ga").slice(0,10).map(r=>this.controller.seatByLabel(r.label)).filter(r=>!!r);Cs({regions:this.els,categories:this.controller.doc?.categories,pop:r=>this.controller.flashSeat(r,this.cssVar("--sl-accent")||"#f4b740"),focus:(r,o)=>this.controller.focusSection(r,o),focusSeats:r=>this.controller.focusSeats?.(r,{animate:!t})===!0,reducedMotion:t,screenPoint:r=>this.controller.worldToScreen(r),schedule:(r,o)=>this.scheduleMotion(r,o)},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 ml(this)}heldTicketCount(){return fl(this)}totalTicketCount(){return gl(this)}updateSelectionCapacity(){bl(this)}syncCta(e=this.lastTrayCount,t=this.pendingSelectionCount()){yl(this,e,t)}setCtaPhase(e){vl(this,e)}runCheckoutHandoff(e,t){return wl(this,e,t)}holdStorageKey(){return xl(this)}rememberedHoldId(){return kl(this)}rememberHold(e){Sl(this,e)}forgetHold(){Tl(this)}resumeHoldFromServer(e,t=!1){return El(this,e,t)}restoreRememberedHold(){return Cl(this)}activeFloorObjects(){let e=this.controller.doc;if(!e)return[];let t=e.floors;if(t?.length){let n=this.controller.getActiveFloorId();return(t.find(r=>r.id===n)??t[0]).objects??[]}return e.objects??[]}buildMinimap(){!this.els.map||this.root?.dataset.layout==="narrow"||(this.minimap=Qr({controller:this.controller,root:()=>this.root,cssVar:e=>this.cssVar(e),focusedSectionLabel:()=>this.lastSection?.label,tint:e=>this.controller.getRenderer?.()?.categoryDisplayColor?.(e)||void 0},this.regions["bottom-left"]??this.els.map))}syncMinimapForLayout(){let e=this.root?.dataset.layout==="narrow";if(e&&this.minimap){this.minimap.dispose(),this.minimap=null;return}!e&&!this.minimap&&this.buildMinimap()}catPrice(e){return pn(this,e)}catPriceRange(e){return hn(this,e)}buildPriceFilter(){Dl(this)}applyPriceBand(e){Bl(this,e)}buildArenaChrome(){let e=this.controller.doc;if(this.rungsEl=null,this.projectionEl=null,this.floorsEl=null,!e||!this.els.map){this.syncArenaViewportInsets();return}let t=e.objects.some(n=>n.type==="section")||(e.floors??[]).some(n=>n.objects.some(r=>r.type==="section"));if(this.canOffer3d()){let n=document.createElement("div");n.className="sl-projection",n.setAttribute("role","group"),n.setAttribute("aria-label",this.tf("picker.venueView","Venue view")),n.dataset.slA="picker.venueView",n.innerHTML=`<button type="button" data-view="map" aria-pressed="true" data-sl-t="picker.map" data-sl-ti="picker.flat2dMap" title="${this.tf("picker.flat2dMap","Flat 2D map")}">${this.tf("picker.map","Map")}</button><button type="button" data-view="venue3d" aria-pressed="false" data-sl-ti="picker.interactive3dVenueView" title="${this.tf("picker.interactive3dVenueView","Interactive 3D venue view")}">3D</button>`,n.querySelectorAll("button").forEach(r=>{if(r.dataset.view==="venue3d")for(let o of["pointerenter","focus","pointerdown"])r.addEventListener(o,vi,{once:!0});r.addEventListener("click",()=>{this.setBuyerView(r.dataset.view)})}),this.regions["top-right"].appendChild(n),this.projectionEl=n,this.syncProjection()}if(t){let n=[...e.objects,...(e.floors??[]).flatMap(u=>u.objects)],r=new Set((e.zones??[]).map(u=>u.id)),a=ou(e)==="combined"&&(e.floors?.length??0)>1&&r.size===0||n.some(u=>u.type==="section"&&typeof u.zone=="string"&&r.has(u.zone))?["zones","sections","seats"]:["sections","seats"],l=document.createElement("div");l.className="sl-rungs on sl-mo-indicator",l.setAttribute("role","group"),l.setAttribute("aria-label",N("picker.zoomLevel")),l.dataset.slA="picker.zoomLevel";let c={zones:N("picker.rungLabel.zones"),sections:N("picker.rungLabel.sections"),seats:N("picker.rungLabel.seats")},d={zones:N("picker.rungTip.zones"),sections:N("picker.rungTip.sections"),seats:N("picker.rungTip.seats")};l.innerHTML=a.map(u=>`<button type="button" data-rung="${u}" data-sl-t="picker.rungLabel.${u}" data-sl-ti="picker.rungTip.${u}" title="${d[u]}" aria-pressed="false">${c[u]}</button>`).join(""),l.querySelectorAll("button").forEach(u=>{u.addEventListener("click",()=>{let m=u.dataset.rung;this.controller.setRung(m),m==="seats"&&this.collapseSectionCard()})}),this.regions["top-center"].appendChild(l),this.rungsEl=l,this.syncRung()}if(this.controller.isMultiFloor()){let n=ta({floors:this.controller.getFloors(),tf:(r,o)=>this.tf(r,o),onChoose:r=>{r===""?this.controller.setFloorOverview(!0):this.controller.setFloor(r),this.showSectionCard(null),this.syncFloors(),this.syncRung(),this.minimap?.refreshMinimap()}});(this.regions["bottom-right"]??this.regions["top-left"]).prepend(n),this.floorsEl=n,this.syncFloors()}this.syncArenaViewportInsets()}syncArenaViewportInsets(){let e=this.els.map;e&&ws(this.root,e,this.regions);let t=e?ea(e.getBoundingClientRect(),[this.rungsEl,this.projectionEl].map(n=>n?.isConnected?n.getBoundingClientRect():null),[],8,this.floorsEl?.isConnected?[this.floorsEl.getBoundingClientRect()]:[]):{top:0,right:0,bottom:0,left:0};Object.keys(t).every(n=>t[n]===this.arenaViewportInsets[n])||(this.arenaViewportInsets=t,this.controller.setViewportInsets(t),this.syncFitClearance())}syncFitClearance(){let e=this.els.map,t=this.els.zoom,n=this.root?.dataset.layout==="narrow",r=0;if(n&&e&&t?.isConnected){let o=e.getBoundingClientRect(),s=t.getBoundingClientRect();s.height>0&&(r=Math.max(0,o.bottom-s.top+8))}this.controller.setFitClearance?.(r)}syncTestBadge(){let e=this.testBadgeEl;e&&(e.textContent=zr(N("picker.testMode"),ic()),e.setAttribute("aria-label",N("picker.testMode")),e.title=this.tf("picker.testModeExplained","Bookings here are not real and no card is charged"))}syncRung(){let e=this.controller.getRung(),t=this.controller.seatsRevealed?.()??(e==="seats"||!!this.controller.getFocusedSection?.());this.root&&(this.root.dataset.zoomed=String(t)),this.syncMapStepBack(),this.minimap?.setAutoOpen(!1),this.rungsEl&&this.rungsEl.querySelectorAll("button").forEach(n=>{let r=n.dataset.rung===e;n.classList.toggle("on",r),n.setAttribute("aria-pressed",String(r))})}syncMapStepBack(){let e=this.els?.zout,t=this.els?.zfit,n=this.els?.zin;if(!e||!this.root)return;let r=this.controller.getRenderer?.(),o=this.controller.canZoomIn?.()===!1||r?.seatsPickable?.()===!0,s=Zr({focusedSection:this.controller.getFocusedSection?.()??null,seatsRevealed:this.controller.seatsRevealed?.()??!0,atVenueFit:this.controller.atVenueFit?.()})==="none",a=e.disabled!==s||!!t&&t.disabled!==s||!!n&&n.disabled!==o||e.hidden||!!n?.hidden||!!t?.hidden;e.disabled=s,e.hidden=!1,n&&(n.disabled=o,n.hidden=!1),t&&(t.disabled=s,t.hidden=!1),a&&this.a11yMenu?.refit()}syncProjection(){this.els.pricesHint&&(this.els.pricesHint.textContent=this.buyerView==="venue3d"?this.tf("picker.priceHint3d","Colours in the venue are ticket types. Choose one below to show just those seats."):this.tf("picker.priceHint","Colours on the map are ticket types. Tap one below to show just those seats.")),this.projectionEl&&this.projectionEl.querySelectorAll("button").forEach(e=>{let t=e.dataset.view===this.buyerView;e.classList.toggle("on",t),e.setAttribute("aria-pressed",String(t))})}canOffer3d(){return this.opts.enable3D===!1||!this.controller.doc||!bi()?!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)?rc/2:rc}syncFloors(){ia(this.floorsEl,this.controller.getActiveFloorId(),this.controller.isFloorOverview())}get sectionCard(){return this.sectionCardCache||(this.sectionCardCache=new rn({controller:this.controller,map:()=>this.els.map,root:()=>this.root,collapseSheet:()=>this.collapseSheet(),region:e=>this.regions[e],refreshMinimap:()=>this.minimap?.refreshMinimap(),activeFloorObjects:()=>this.activeFloorObjects(),sectionNeighbours:e=>this.sectionNeighbours(e),catPriceRange:e=>this.catPriceRange(e),money:e=>this.money(e),suppressPricing:()=>this.suppressPricing,priceBandKeys:()=>this.priceBandKeys})),this.sectionCardCache}showSectionCard(e){this.sectionCard.show(e)}renderSectionCard(e){this.sectionCard.render(e)}collapseSectionCard(){this.sectionCard.collapse()}sectionCardOnView(){this.sectionCard.onView()}sectionNeighbours(e){let t=this.activeFloorObjects().filter(r=>r.type==="section"&&!this.controller.isSectionClosed(r.id)&&this.controller.getSectionSeatCount(r.id)>0);if(t.length<2)return null;let n=t.findIndex(r=>r.id===e);return n<0?null:{previous:t[(n-1+t.length)%t.length],next:t[(n+1)%t.length]}}markedSeatAnnouncement(e){let t=or(this.controller.getRenderer()?.getSeatMark?.(e.id),this.performanceGroup?.nights?.());return ua(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(p=>p.key===e.categoryKey),r=this.controller.getStatus(e.id)??"free",o=r==="free"?this.tf("picker.statusAvailable","available"):r==="held"?this.tf("picker.statusOnHold","on hold"):this.tf("picker.statusTaken2","taken"),s=n?this.catPriceRange(n):void 0,a=!this.suppressPricing&&s?s.min===s.max?this.money(s.min):`${this.money(s.min)}\u2013${this.money(s.max)}`:void 0,l=this.controller.tableSelection(e.id),c=l??this.controller.seatDetails(e.id),d=it(c),u=c?.rowLabel??c?.displayLabel??e.displayLabel??e.label,m=l?`${d} ${u}, ${l.bookingMode==="variable"?N("picker.minToMaxGuests",{min:l.minOccupancy,max:l.maxOccupancy}):N("picker.capacityGuests",{count:l.capacity})}`:c?.objectType==="booth"?`${d} ${u}`:c?.objectType==="table"?`${d} ${u}, ${N("picker.seatNumberLower",{label:c.seatNumber??e.label})}`:N("picker.seatLabel",{label:c?.displayLabel??e.displayLabel??e.label});this.srEl.textContent=`${m}, ${n?.label??e.categoryKey}${a?`, ${a}`:""}, ${o}`}showTableDialog(e,t,n){this.dismissTableDialog(!1),this.tableDialog={...e},this.tableDialogHeld=t,this.tableDialogReturnFocus=n??document.activeElement;let r=this.controller.doc?.categories.find(a=>a.key===e.categoryKey),o=e.bookingMode==="variable",s=document.createElement("div");s.className="sl-table-scrim",s.innerHTML=Co(e,{variable:o,held:t,typeWord:it(e),categoryLabel:r?.label??e.categoryKey,suppressPricing:this.suppressPricing,unitPrice:this.money(this.paidPrice(e.categoryKey,e.tierId??null,e.price,e.label))}),this.root.appendChild(s),this.tableDialogEl=s,this.renderTableDialogState(),s.querySelectorAll("[data-table-step]").forEach(a=>{a.addEventListener("click",()=>{if(!this.tableDialog)return;let l=Math.max(this.tableDialog.minOccupancy,Math.min(this.tableDialog.maxOccupancy,this.tableDialog.quantity+Number(a.dataset.tableStep)));this.tableDialog={...this.tableDialog,quantity:l},this.renderTableDialogState()})}),s.querySelector(".sl-table-cancel").addEventListener("click",()=>this.cancelTableDialog()),s.querySelector(".sl-table-confirm").addEventListener("click",()=>{this.confirmTableDialog()}),s.addEventListener("mousedown",a=>{a.target===s&&this.cancelTableDialog()}),s.addEventListener("keydown",a=>{if(a.key!=="Tab")return;let l=[...s.querySelectorAll('button:not(:disabled),[tabindex]:not([tabindex="-1"])')];if(!l.length)return;let c=l[0],d=l[l.length-1];a.shiftKey&&document.activeElement===c?(a.preventDefault(),d.focus()):!a.shiftKey&&document.activeElement===d&&(a.preventDefault(),c.focus())}),requestAnimationFrame(()=>s.querySelector(o?'[data-table-step="-1"]':".sl-table-confirm")?.focus())}renderTableDialogState(){let e=this.tableDialog,t=this.tableDialogEl;if(!e||!t)return;let n=t.querySelector("output[data-table-qty]");n&&(n.value=String(e.quantity));let r=t.querySelector("input[data-table-qty]");r&&(r.value=String(e.quantity)),t.querySelectorAll("[data-table-step]").forEach(a=>{let l=Number(a.dataset.tableStep);a.disabled=l<0?e.quantity<=e.minOccupancy:e.quantity>=e.maxOccupancy});let o=this.paidPrice(e.categoryKey,e.tierId??null,e.price,e.label),s=t.querySelector("[data-table-total]");s&&(s.textContent=this.money(o*e.quantity))}async confirmTableDialog(){let e=this.tableDialog,t=this.tableDialogHeld;if(!e)return;let n=this.tableDialogEl?.querySelector(".sl-table-confirm");if(n&&(n.disabled=!0,n.textContent=t?this.tf("picker.updatingEllipsis","Updating\u2026"):this.tf("picker.selectingEllipsis","Selecting\u2026")),t){try{let r=await this.controller.replaceTableQuantity(e.label,e.quantity,this.opts.holdTtlMs);if(!r){this.toast(this.tf("picker.guestCountCouldNotBeSecured","That guest count could not be secured. Your current table hold is unchanged."),"warning"),this.renderTableDialogState(),n&&(n.disabled=!1,n.textContent=this.tf("picker.updateTable","Update table"));return}this.hold={holdId:r.holdId,expiresAt:r.expiresAt,seats:r.seats,items:r.items},this.startHoldTimer(r.expiresAt),this.dismissTableDialog(),this.syncTray(),this.emitHoldChange(),this.toast(N("picker.tableUpdatedForGuests",{label:e.label,count:e.quantity}),"success")}catch(r){this.opts.onError?.(r),this.toast(this.tf("picker.guestCountNoLongerAvailable","That guest count is no longer available. Your current hold is unchanged."),"error"),n&&(n.disabled=!1,n.textContent=this.tf("picker.updateTable","Update table"))}return}if(!this.controller.setTableQuantity(e.label,e.quantity)){n&&(n.disabled=!1,n.textContent=e.bookingMode==="variable"?this.tf("picker.selectTable","Select table"):this.tf("picker.selectWholeTable","Select whole table"));return}this.dismissTableDialog(),this.collapseSectionCard(),this.syncTray()}cancelTableDialog(){let e=this.tableDialog,t=this.tableDialogHeld;this.dismissTableDialog(),e&&!t&&this.controller.deselect(e.physicalSeatIds)}dismissTableDialog(e=!0){let t=this.tableDialogReturnFocus;this.tableDialogEl?.remove(),this.tableDialogEl=null,this.tableDialog=null,this.tableDialogHeld=!1,this.tableDialogReturnFocus=null,e&&requestAnimationFrame(()=>(t?.isConnected?t:this.root)?.focus())}get confirmCard(){return this.confirmCardCache||(this.confirmCardCache=new ln({controller:this.controller,root:()=>this.root,els:()=>this.els,regions:()=>this.regions,hideTooltip:()=>{this.tipEl&&(this.tipEl.style.display="none")},tf:(e,t)=>this.tf(e,t),money:e=>this.money(e),paidPrice:(e,t,n,r)=>this.paidPrice(e,t,n,r),offerName:(e,t)=>this.offerPrice(e,t)?.offerName,suppressPricing:()=>this.suppressPricing,reducedMotion:()=>this.reducedMotion(),scheduleMotion:(e,t)=>this.scheduleMotion(e,t),canOffer3d:()=>this.canOffer3d(),buyerView:()=>this.buyerView,view3dHandle:()=>this.view3dHandle,view3dCompareSeatIds:()=>this.view3dCompareSeatIds,rememberView3dReturnSeat:e=>{this.view3dReturnSeat=e},enter3d:e=>{this.enter3d(e)},performanceGroup:()=>this.performanceGroup,seatViewEnabled:()=>this.seatViewEnabled(),openSeatView:e=>{this.openSeatView(e)},openSeatConfidencePassport:(e,t)=>this.openSeatConfidencePassport(e,t),saveView3dComparisonSeat:e=>this.saveView3dComparisonSeat(e),resolveAssetUrl:e=>this.buyerAssetUrls.resolve(e),onError:e=>this.opts.onError?.(e),liftToastOverConfirm:()=>this.liftToastOverConfirm(),fitTranslatedRows:()=>this.fitTranslatedRows(),syncTray:()=>this.syncTray(),syncSelectionTo3d:()=>this.syncSelectionTo3d(),collapseSectionCard:()=>this.collapseSectionCard(),applyPanelCollapsed:()=>this.applyPanelCollapsed(),dismiss:()=>this.dismissConfirm(),releaseHeldSeat:e=>this.controller.currentHold()?.labels.includes(e.label)?this.removeHeldLabels([e.label]):null,reanchor:()=>this.reanchorConfirm(),inviteCommit:(e,t)=>this.inviteCommit(e,t),addSeatLabel:e=>this.addSeatLabel(e),cartLanded:()=>this.cartLanded()})),this.confirmCardCache}showConfirm(e,t="add"){this.confirmCard.show(e,t)}reanchorConfirm(){this.confirmCard.reanchor()}dismissConfirm(){this.confirmCard.dismiss()}cartLanded(){this.animateOnce(this.els.count,"sl-value-pop",380),this.animateOnce(this.els.total,"sl-value-pop",380)}async commitConfirm(){await this.confirmCard.commit()}cancelConfirm(){this.confirmCard.cancel()}closeConfirm(){this.dismissConfirm()}inviteCommit(e,t){La(e,t,this.reducedMotion())}addSeatLabel(e){return Ma(e,(t,n)=>this.tf(t,n))}seatViewEnabled(){return this.opts.seatView!==!1}allSeats(){return this.allSeatsCache||(this.allSeatsCache=[...this.controller.getExpandedSeats()]),this.allSeatsCache}async openSeatView(e){if(!this.root||!this.seatViewEnabled())return;let t=++this.seatViewGen,n=this.controller.doc,r=this.controller.getActiveFloorId(),o=e.focalPoint??n?.floors?.find(u=>u.id===r)?.focalPoint??n?.focalPoint??{x:0,y:0},s,a,l=!1;if(e.viewUrl){let u,m=null;try{let v=e.viewMeta?.previewUrl;v&&v!==e.viewUrl?(m=await this.buyerAssetUrls.resolve(v),u=e.viewUrl):u=await this.buyerAssetUrls.resolve(e.viewUrl)}catch(v){t===this.seatViewGen&&this.opts.onError?.(v);return}if(t!==this.seatViewGen||!u||e.viewMeta?.previewUrl&&e.viewMeta.previewUrl!==e.viewUrl&&!m||!this.root||!this.seatViewEnabled())return;let p={url:u,...m?{previewUrl:m}:{},...e.viewMeta?.sourceWidth!==void 0?{sourceWidth:e.viewMeta.sourceWidth}:{},...e.viewMeta?.sourceHeight!==void 0?{sourceHeight:e.viewMeta.sourceHeight}:{},...e.viewMeta?.previewWidth!==void 0?{previewWidth:e.viewMeta.previewWidth}:{},...e.viewMeta?.previewHeight!==void 0?{previewHeight:e.viewMeta.previewHeight}:{},...e.viewMeta?.variants?.length?{variants:e.viewMeta.variants}:{},...e.viewMeta?.coverage?{coverage:e.viewMeta.coverage}:{},...e.viewMeta?.capturedAt?{capturedAt:e.viewMeta.capturedAt}:{},...e.viewMeta?.sourceLabel?{sourceLabel:e.viewMeta.sourceLabel}:{}};s=p,a=du(p),l=cu(p)}else{let u;try{let{generateSeatPanorama:m}=await wi();u=m(e,o,this.allSeats())}catch(m){t===this.seatViewGen&&this.opts.onError?.(m);return}if(t!==this.seatViewGen||!this.root||!this.seatViewEnabled())return;s={url:u.url,generated:!0},a=N("picker.illustrationCaption",{m:u.distanceM})}this.closeSeatView(!1);let c=N("picker.viewFromSeat",{label:e.label}),d=Wi({root:this.root,source:s,caption:a,real:l,closeLabel:this.tf("picker.close","Close"),dragHint:We(),viewFromSeatLabel:c,real360Label:N("picker.real360"),previewLabel:N("picker.preview"),resolveAsset:u=>this.buyerAssetUrls.resolve(u),onClose:()=>this.closeSeatView()});this.viewEl=d.element,this.viewCleanup=()=>d.dispose()}closeSeatView(e=!0){e&&(this.seatViewGen+=1),this.viewCleanup?.(),this.viewCleanup=null,this.viewEl?.remove(),this.viewEl=null}money(e){let t=this.opts.pricing?.formatter;if(t)return t(e,this.currency);let n=Number.isInteger(e);return su(e,this.currency,{locale:this.opts.locale,fallback:(r,o)=>`${r} ${o}`,...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=Ks(e,t);if(n==null)return;let r=6*36e5,o=Math.min(Math.max(n-t+1e3,1e3),r);this.offerBoundaryTimer=setTimeout(()=>{this.offerBoundaryTimer=null,!document.hidden&&this.refreshOfferAvailability(!1)},o)}offerReadIsCurrent(){return!!this.offerReadInFlight||Date.now()-this.offerReadSettledAt<hu}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=ir(t);if(!n)return;this.offerAvailability=n,this.applyChannelPricing(n.channelPricing),this.scheduleOfferBoundary(n);let r=qs(this.hostPricing?.prices,n),o=Object.keys(r).length>0||this.hostPricing?.formatter?{prices:r,...this.hostPricing?.formatter?{formatter:this.hostPricing.formatter}:{}}:void 0;this.setPricing(o),this.syncMapPriceRanges(),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,t){if(!e)return null;let n=this.offerAvailability?.prices.filter(r=>r.categoryKey===e)??[];return t!==void 0?n.find(r=>(r.tierId??null)===t)??n.find(r=>r.tierId==null)??null:n[0]??null}mapPriceRanges(){if(this.api.availability&&!this.offerAvailability)return null;let e=this.offerAvailability?.prices.some(n=>n.tierId!==void 0)??!1,t=Object.keys(this.opts.pricing?.prices??{}).length>0;if(!(!e&&!t))return Object.fromEntries((this.controller.doc?.categories??[]).flatMap(n=>{let r=this.catPriceRange(n);return r?[[n.key,r]]:[]}))}syncMapPriceRanges(){this.controller.getRenderer()?.setCategoryPriceRanges?.(this.mapPriceRanges())}applyChannelPricing(e){this.channelByObject.clear(),this.pricesByChannel.clear();for(let t of e?.channels??[])this.pricesByChannel.set(t.channelId,t.priceOverrides);for(let t of e?.objects??[])this.pricesByChannel.has(t.channelId)&&this.channelByObject.set(t.label,t.channelId)}syncOffer(){let e=this.els.offer;if(!e)return;if(this.offerCountdownTimer&&clearTimeout(this.offerCountdownTimer),this.offerCountdownTimer=null,e.classList.remove("sl-offer-compact","sl-offer-early-bird"),!this.currencyResolved){e.classList.remove("has"),e.replaceChildren();return}if(this.suppressPricing){e.classList.remove("has"),e.replaceChildren();return}let t=this.offerAvailability,n=t?.release??null,r=!n&&t?.upcoming?.pricingMode!=="matrix"?t?.upcoming??null:null;if(!t||t.state==="closed"||t.state==="sold-out"||!n&&!r){e.classList.remove("has"),e.replaceChildren();return}let o=n??r,s=o.pricingMode==="matrix",a=document.createElement("div");a.className="sl-offer-main";let l=document.createElement("div");l.className="sl-offer-copy";let c=document.createElement("span");c.className="sl-offer-kicker",c.textContent=n?this.tf("picker.currentTicketOffer","Current ticket offer"):this.tf("picker.upcomingTicketOffer","Upcoming ticket offer");let d=document.createElement("strong");d.className="sl-offer-name";let u=o.name||(n?this.tf("picker.currentOffer","Current offer"):this.tf("picker.scheduledOffer","Scheduled offer"));Ln(u)&&e.classList.add("sl-offer-early-bird"),d.innerHTML=Ai(u,_);let m=document.createElement("span");m.className="sl-offer-line";let p=[];if(!s&&n&&t.fromPrice!=null&&p.push(this.money(t.fromPrice/100)),!s&&n&&o.remaining!=null&&p.push(N("picker.offerRemainingAvailable",{count:o.remaining})),n&&o.endsAt!=null){let y=!this.opts.locale||/^en(?:-|$)/i.test(this.opts.locale)?mo(o.endsAt):null;if(p.push(y??N("picker.offerUntil",{time:xi(o.endsAt,this.eventTimezone,this.opts.locale)})),y){let P=Math.max(1e3,o.endsAt-Date.now()),R=P%6e4||6e4;this.offerCountdownTimer=setTimeout(()=>{this.offerCountdownTimer=null,Date.now()>=o.endsAt?this.refreshOfferAvailability(!1):this.syncOffer()},Math.min(R+25,P+25))}}if(r?.startsAt!=null&&p.push(N("picker.offerStarts",{time:xi(r.startsAt,this.eventTimezone,this.opts.locale)})),m.textContent=p.join(" \xB7 "),s||l.append(c),l.append(d,m),s){e.classList.add("sl-offer-compact"),a.append(l),e.replaceChildren(a),e.classList.add("has");return}let v=document.createElement("details");v.className="sl-offer-info";let g=document.createElement("summary");g.setAttribute("aria-label",N("picker.howOfferWorks",{name:d.textContent??""})),g.textContent="i";let T=document.createElement("div");T.className="sl-offer-detail",T.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."),v.append(g,T),a.append(l,v),e.replaceChildren(a),e.classList.add("has")}paidPrice(e,t,n,r){let o=r?this.channelByObject.get(r):void 0;if(o&&e){let a=this.pricesByChannel.get(o)?.find(l=>l.categoryKey===e&&l.tierId===(t??null));if(a)return a.price}let s=e?this.opts.pricing?.prices?.[e]:void 0;return s===void 0?n:typeof s=="number"?s:t&&s.tiers?.[t]!==void 0?s.tiers[t]:s.base??n}legendDeps(){return Fl(this)}syncPriceRail(e,t,n=this.legendDeps()){Vl(this,e,t,n)}syncPrices(){this.currencyResolved&&zl(this)}focusCategory(e){$l(this,e)}evictTakenSelections(){let e=new Set([...this.controller.currentHold()?.labels??[],...this.holdingLabels]),t=this.controller.getSelection().filter(n=>!e.has(n.label)&&(this.controller.getStatus(n.id)??"free")!=="free");t.length&&(this.controller.deselect(t.map(n=>n.id)),this.toast(N("picker.seatJustTakenByAnother",{label:t[0].label}),"error"))}syncTray(){if(!this.els.tray)return;this.updateSelectionCapacity();let{seats:e,gaAreas:t,heldItems:n,heldLabels:r,total:o,count:s}=dn(this),a=[],l=new Set;if(!this.salesClosed){let f=this.performanceGroup?.nightSummary?.()??[];f.length&&a.push(aa(f,{title:this.tf("picker.group.yourSeatsByNight","Your seats by night"),empty:this.tf("picker.group.noSeatsChosenYet","No seats yet")}));let L=this.performanceGroup?.selectionModeSwitch;L&&a.push(`<button type="button" class="sl-pg-switch" data-pg-switch-mode>${_(L.label)}</button>`)}let c={salesClosed:this.salesClosed,salesState:this.salesState,hasPicks:e.length>0||n.length>0,hasGaAreas:t.length>0,groupMode:this.performanceGroup?this.performanceGroup.selectionMode??"same_seat":null,seated:!!this.controller.doc?.objects?.some(f=>f.type!=="gaArea"),venue3d:this.buyerView==="venue3d",whenText:this.eventWhenText?String(this.eventWhenText):void 0};a.push(Do(c)),this.els.trayHint&&(this.els.trayHint.textContent=Bo(c)),this.els.seatsInfo&&(this.els.seatsInfo.hidden=this.salesClosed);let d=!e.length&&!n.length&&!Be(this.gaQty,this.hold?.items??[]);if(!this.performanceGroup&&!this.salesClosed&&!this.hold&&(d||this.bestAvailableBusy||this.bestAvailableConfirm)){let f=(this.controller.doc?.categories??[]).filter(M=>!M.notForSale),L=this.controller.getBestAvailableZones();this.baZone&&!L.some(M=>M.id===this.baZone)&&(this.baZone="");let D=Mi(f,this.controller.categoryAvailability());this.baSoldOutSig=[...D].join("|"),this.bestAvailableSoldOut=f.length>0&&D.size===f.length,D.has(this.baCat)&&(this.baCat=""),(!this.bestAvailableSoldOut||this.bestAvailableBusy||this.bestAvailableConfirm)&&a.push(Oo({confirming:this.bestAvailableConfirm,busy:this.bestAvailableBusy,reopened:!1,quantity:this.baQty,premium:this.baPremium,offerPremium:this.controller.hasPremiumSeats(),categories:f.map(M=>D.has(M.key)?{...M,soldOut:!0}:M),zones:L,selectedCategory:this.baCat,selectedZone:this.baZone}))}let u=(f,L,D,M=1,O,A,I,j)=>Ro({categoryLabel:I,offerName:j,d:f?this.controller.seatDetails(f):null,area:D==="ga"?t.find($=>$.id===O):void 0,label:L,objectType:D,quantity:M,identity:A,performanceLabel:this.performanceGroup?.activePerformanceLabel?.(),performanceDates:this.performanceGroup?.selectedPerformanceDates?.()}),m=_,p=[];for(let f of rs(n)){let L=f.objectType==="ga"?`held:ga:${f.objectId}:${f.tierId??""}`:`held:${f.label}`;l.add(L);let D=this.controller.doc?.categories.find(mt=>mt.key===f.categoryKey),M=this.performanceGroup||this.suppressPricing?null:za(this.controller,f),O=f.tierId&&!M?D?.tiers?.find(mt=>mt.id===f.tierId)?.name:void 0,A=this.offerPrice(f.categoryKey,f.tierId??null)?.offerName,I=f.objectType!=="ga"?this.controller.seatByLabel(f.label):null,j=f.objectType==="table"?this.controller.tableSelection(f.label):null,$=I?this.controller.seatDetails(I.id):null,de=this.seatViewEnabled()&&!!I&&f.objectType!=="table"&&!!this.deliverableViewReference(I),Te=m(this.tf("picker.heldForYou","Held for you")),qe=(j?.bookingMode==="variable"?`<button type="button" class="sl-table-edit" data-table-edit="${m(encodeURIComponent(f.label))}">${m(N("picker.guestsCountEdit",{count:f.quantity??1}))}</button>`:"")+(M?`<select class="tier" data-held-tier="${m(f.label)}" aria-label="${m(N("picker.ticketTierFor",{label:f.label}))}">${On(M,f.tierId??void 0,m)}</select>`:""),ye=this.paidPrice(f.categoryKey,f.tierId,f.unitPrice,f.label)*(f.quantity??1);p.push({key:L,fresh:!this.lastTrayKeys.has(L),held:!0,seatIds:[],heldLabels:f.labels,removeAria:N("picker.removeHeldTicketLabel",{label:$n(f,t)}),locateId:I?.id??null,section:$?.sectionLabel??"",rowLabel:$&&q($)||"",seatLabel:$?.seatNumber??f.label,categoryLabel:`${D?.label??f.categoryKey}${O?` \xB7 ${O}`:""}`,categoryColor:this.controller.getRenderer?.()?.categoryDisplayColor?.(f.categoryKey)??D?.color??"",identityHtml:u(I?.id??null,f.label,f.objectType,f.quantity??1,f.objectId,j??void 0,`${D?.label??f.categoryKey}${O?` \xB7 ${O}`:""}`,A),stateHtml:`<span class="sl-ticket-state held" aria-label="${Te}" title="${Te}"><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:qe,amount:ye,amountText:this.suppressPricing?"":this.money(ye),noteHtml:Qe(I??void 0),railHtml:this.performanceGroup?"":_n(N("picker.removeHeldTicketLabel",{label:$n(f,t)}),de?f.label:null)})}let v=this.seatViewEnabled();for(let f of e.filter(L=>!r.has(L.label))){let L=`seat:${f.id}`;l.add(L);let D=this.controller.doc?.categories.find(ye=>ye.key===f.categoryKey),M=f.tiers&&f.tiers.length&&!this.suppressPricing?`<select class="tier" data-tier="${m(f.id)}" aria-label="${m(N("picker.ticketTierFor",{label:f.label}))}">`+On(f.tiers,f.tierId,m)+"</select>":"",O=f.tiers?.find(ye=>ye.id===f.tierId)??f.tiers?.[0],A=this.offerPrice(f.categoryKey,O?.id??null)?.offerName,I=O?.buyerMessage?.trim()||(O?.restriction==="companion"?this.tf("picker.companionRequiresWheelchair","Requires the adjacent wheelchair place"):""),j=this.controller.seatDetails(f.id),$=m(this.tf("picker.selected","Selected")),de=N("picker.removeSeatLabel",{label:f.label}),Te=(f.objectType==="table"&&f.bookingMode==="variable"?`<button type="button" class="sl-table-edit" data-table-edit="${m(encodeURIComponent(f.label))}">${m(N("picker.guestsCountEdit",{count:f.quantity??1}))}</button>`:"")+M,qe=this.paidPrice(f.categoryKey,f.tierId??null,f.price,f.label)*(f.quantity??1);p.push({key:L,fresh:!this.lastTrayKeys.has(L),held:!1,seatIds:[f.id],heldLabels:[],locateId:f.id,section:j?.sectionLabel??"",rowLabel:j&&q(j)||"",seatLabel:j?.seatNumber??f.label,categoryLabel:D?.label??f.categoryKey,identityHtml:u(f.id,f.label,f.objectType,f.quantity??1,f.objectId,f,D?.label??f.categoryKey,A),categoryColor:this.controller.getRenderer?.()?.categoryDisplayColor?.(f.categoryKey)??D?.color??"",stateHtml:`<span class="sl-ticket-state" aria-label="${$}" title="${$}"><svg viewBox="0 0 24 24"><path d="M5 12l4 4L19 6"/></svg></span>`,extrasHtml:Te,amount:qe,amountText:this.suppressPricing?"":this.money(qe),removeAria:de,noteHtml:Qe(f)+(I?`<small class="sl-tier-note">${m(I)}</small>`:""),railHtml:_n(de,v&&f.objectType!=="table"&&this.deliverableViewReference(this.controller.seatByLabel(f.label)??{})?f.label:null)})}p.length&&a.push(p.map(Io).join("")),t.length&&a.push(ds(this,t,n)),this.els.tray.innerHTML=a.join("")+(this.salesClosed?"":this.lapse.noteHtml()),this.lastTrayKeys=l,this.lapse.wire(this.els.tray),this.els.tray.querySelector("[data-pg-switch-mode]")?.addEventListener("click",()=>this.performanceGroup?.selectionModeSwitch?.activate());let g=this.performanceGroup?.selectNight;g&&ya(this.els.tray,f=>g(f)),this.els.tray.querySelectorAll("[data-ba]").forEach(f=>{f.addEventListener("click",()=>{this.baQty=Math.max(1,Math.min(this.maxTickets,this.baQty+Number(f.dataset.ba))),this.syncTray()})}),this.els.tray.querySelector("[data-ba-cat]")?.addEventListener("change",f=>{this.baCat=f.target.value,this.scheduleFit()}),this.els.tray.querySelector("[data-ba-zone]")?.addEventListener("change",f=>{this.baZone=f.target.value}),this.els.tray.querySelector("[data-ba-premium]")?.addEventListener("click",()=>{this.baPremium=!this.baPremium,this.syncTray()}),this.els.tray.querySelector(".sl-ba-go")?.addEventListener("click",()=>{if(this.pendingSelectionCount()>0){this.bestAvailableConfirm=!0,this.syncTray(),this.els.tray.querySelector("[data-ba-replace]")?.focus();return}this.bestAvailable(this.baQty,this.baCat||void 0,{preferPremium:this.baPremium,zoneId:this.baZone||void 0})}),this.els.tray.querySelector("[data-ba-cancel]")?.addEventListener("click",()=>{this.bestAvailableConfirm=!1,this.syncTray(),this.els.tray.querySelector(".sl-ba-go")?.focus()}),this.els.tray.querySelector("[data-ba-replace]")?.addEventListener("click",()=>{this.bestAvailableConfirm=!1,this.bestAvailable(this.baQty,this.baCat||void 0,{preferPremium:this.baPremium,zoneId:this.baZone||void 0})}),this.els.tray.querySelectorAll(".sl-chip .rm").forEach(f=>{f.addEventListener("click",()=>{let L=f.closest(".sl-chip");if(L.dataset.held){this.removeHeldLabels(decodeURIComponent(L.dataset.held).split(`
3381
3381
  `),L);return}let D=L.dataset.seat.split(" "),M=()=>{this.controller.deselect(D)};if(this.reducedMotion()){M();return}L.classList.remove("sl-enter"),L.classList.add("sl-leave","sl-mo-collapse"),this.scheduleMotion(M,Y.collapse)})}),this.els.tray.querySelectorAll("[data-table-edit]").forEach(f=>{f.addEventListener("click",L=>{L.stopPropagation();let D=decodeURIComponent(f.dataset.tableEdit??""),M=this.controller.tableSelection(D);if(!M)return;let O=n.find(A=>A.label===D&&A.objectType==="table");this.showTableDialog({...M,quantity:O?.quantity??M.quantity},!!O,f)})}),this.els.tray.querySelectorAll(".sl-chip .tier").forEach(f=>{f.addEventListener("change",()=>f.dataset.heldTier?void this.changeHeldTier(f,f.dataset.heldTier):this.controller.setSeatTier(f.dataset.tier,f.value||null))}),this.els.tray.querySelectorAll(".sl-chip .view[data-view-label]").forEach(f=>{f.addEventListener("click",()=>{let L=this.controller.seatByLabel(f.dataset.viewLabel);L&&this.openSeatView(L)})}),this.els.tray.querySelectorAll(".sl-chip[data-locate]").forEach(f=>{let L=()=>this.controller.flashSeat(f.dataset.locate,this.cssVar("--sl-accent")||"#f4b740");f.addEventListener("mouseenter",L),f.addEventListener("focusin",L),f.addEventListener("click",D=>{D.target.closest?.('button,a,select,[role="button"],input')||!this.controller.focusSeats?.([f.dataset.locate],{animate:!this.reducedMotion()})||L()})}),ps(this,this.els.tray,t),this.controller.setGASelection(ts(this.gaQty)),this.salesClosed&&this.els.tray.querySelectorAll(".sl-ba-go,[data-ba],[data-ba-cat],[data-ba-zone],[data-ba-replace],.sl-ga button").forEach(f=>{f.disabled=!0});let T=this.pendingSelectionCount(),S=this.lastTrayCount,y=this.lastTrayTotal,P=ba(this.performanceGroup?.groupSelectionSummary?.(),this.performanceGroup?.selectionMode??"same_seat");this.els.count.textContent=P||(s?wn("picker.ticketsCount",s):this.tf("picker.noSeatsSelected","No seats selected")),this.els.total.textContent=s&&!this.suppressPricing?this.money(o):"",this.root?.setAttribute("data-has-selection",String(s>0)),this.sheetState()==="mini"&&s===0?this.setSheetState("mini"):s>S&&this.root?.dataset.layout==="narrow"?this.setSheetState("mini"):this.syncSheetAffordance(),this.root?.setAttribute("data-ba-active",String(this.bestAvailableConfirm||this.bestAvailableBusy)),this.els.seatSummary&&(this.els.seatSummary.textContent=P||(s?wn("picker.seatsSelectedCount",s):"")),this.syncCta(s,T);let G=this.root?.dataset.layout==="narrow"&&this.root?.dataset.confirming==="true";s!==S&&!G&&this.animateOnce(this.els.count,"sl-value-pop",380),o!==y&&!G&&this.animateOnce(this.els.total,"sl-value-pop",380),S===0&&s>0&&(this.animateOnce(this.els.cta,"sl-ready",520),this.sideCollapsed&&this.root?.dataset.layout!=="narrow"&&this.setPanelCollapsed(!1)),this.lastTrayCount=s,this.lastTrayTotal=o,this.opts.onSelectionChange?.(e),this.emitSelectionValidity(s,e),this.scheduleFit()}scheduleFit(){if(this.fitScheduled||this.destroyed)return;this.fitScheduled=!0;let e=()=>{this.fitScheduled=!1,this.destroyed||this.fitTranslatedRows()};typeof requestAnimationFrame=="function"?requestAnimationFrame(e):e()}fitTranslatedRows(){Fs(this.confirmEl?.querySelector(".sl-confirm-row")),this.els.tray?.querySelectorAll(".sl-chip-pos").forEach(Vs),this.els.tray?.querySelectorAll(".sl-ba-go").forEach(zs),$s(this.els.tray?.querySelector("select.sl-ba-cat"))}emitSelectionValidity(e,t){let n=this.controller.getSelectionValidity(e);n&&(n.seats=t,this.opts.onSelectionValidityChange?.(n),n.isValid?this.lastSelectionValidity!==!0&&this.opts.onSelectionValid?.(t):this.lastSelectionValidity!==!1&&this.opts.onSelectionInvalid?.(n),this.lastSelectionValidity=n.isValid)}async removeHeldLabels(e,t){let n=e.filter(s=>s&&!this.releasingLabels.has(s));if(!n.length)return!1;let r=n[0];n.forEach(s=>this.releasingLabels.add(s)),t?.setAttribute("aria-busy","true");let o=t?.querySelector(".rm");o&&(o.disabled=!0);try{let s=this.handedOff;if(!await this.controller.releaseLabels(n))return this.toast(N("picker.couldNotRemoveLabel",{label:r}),"error"),!1;os(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&&s,this.bookedShown=!1,this.ctaPhase="idle",this.hold?this.startHoldTimer(this.hold.expiresAt):(this.stopHoldTimer(),this.forgetHold()),this.syncTray(),this.emitHoldChange(),!0}finally{n.forEach(s=>this.releasingLabels.delete(s)),t?.removeAttribute("aria-busy"),o?.isConnected&&(o.disabled=!1)}}async handleCta(){if(this.salesClosed)return;let e=this.controller.getSelectionValidity(this.totalTicketCount());if(e&&!e.isValid){this.toast(fn(e,(n,r)=>this.tf(n,r)),"warning");return}if(this.totalTicketCount()>this.maxTickets){this.toast(N("picker.removeTicketsUntilOrFewer",{count:this.maxTickets}),"warning");return}let t=this.committedSelection();if(this.hold&&!t.some(n=>!(this.hold.items??[]).some(r=>r.label===n.label))){let n=this.hold.seats??t;this.handedOff=!0,this.holdConflicted=!1,await this.runCheckoutHandoff(this.hold,n);return}this.holdingLabels=new Set(t.map(n=>n.label)),this.setCtaPhase("holding");try{let n=null,r=es(this.gaQty),o=this.committedSelection();if(o.length){let s=await this.controller.hold(void 0,this.opts.holdTtlMs);n=s?{holdId:s.holdId,expiresAt:s.expiresAt,seats:s.seats,items:s.items}:null}for(let{areaId:s,tierId:a,qty:l}of r){let c=await this.controller.holdGA(s,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??o)}catch(n){this.opts.onError?.(n);let r=nr(n);if(r){this.toast(r,"warning"),this.setCtaPhase("idle");return}let o=n,s=(o.conflicts??[]).map(l=>l.label).filter(Boolean).slice(0,3);o.reason==="event_closed"&&this.setSalesClosed(!0);let a=o.reason==="event_closed"?this.tf("picker.seatSalesClosedForEvent","Seat sales have closed for this event."):o.reason==="companion_pair_required"?this.tf("picker.companionPairRequired","Select the adjacent wheelchair place with each companion ticket."):o.reason==="ticket_option_not_applicable"?this.tf("picker.ticketOptionNotApplicable","That ticket choice is not available for the selected seat."):s.length?s.length===1?N("picker.labelsNoLongerAvailable.one",{labels:s.join(", ")}):N("picker.labelsNoLongerAvailable.other",{labels:s.join(", ")}):this.tf("picker.seatsJustTaken","One or more seats were just taken. Please pick again.");this.raiseHoldConflict(a),this.setCtaPhase("idle")}finally{this.holdingLabels.clear(),this.ctaPhase==="holding"&&(this.ctaPhase="idle"),this.syncTray()}}startHoldTimer(e){Al(this,e)}stopHoldTimer(){Pl(this)}setExtendPrompt(e,t){Ll(this,e,t)}refreshExtendPrompt(){Ml(this)}handleExtend(){return Hl(this)}detectBooked(){this.bookedShown||!this.handedOff||!this.hold||this.controller.currentHold()===null&&(this.holdConflicted||this.showBooked())}raiseHoldConflict(e){this.holdConflicted=!0,this.bookedShown&&(this.bookedShown=!1,this.bookedEl?.classList.remove("on")),this.toast(e,"error")}showBooked(){if(this.bookedShown||!this.hold||this.holdConflicted)return;this.bookedShown=!0;let e=this.buildHandoff(this.hold);this.stopHoldTimer(),this.forgetHold();let t=e.lineItems.reduce((r,o)=>r+o.quantity,0),n=this.performanceGroup?.groupSelectionSummary?.();this.els.bookedSub&&(this.els.bookedSub.innerHTML=n?.seats?`<span class="sl-booked-seats">${wn("picker.group.ticketsConfirmedAcross",n.seats,{performances:n.performances})}</span>`:`<span class="sl-booked-seats">${wn("picker.ticketsCount",t)}</span> ${this.tf("picker.confirmedAndOnWay","confirmed. A confirmation is on its way.")}`),this.els.bookedList&&(this.els.bookedList.innerHTML=e.lineItems.map(r=>{let s=[r.sectionLabel,r.rowLabel&&`${this.tf("picker.row","Row")} ${r.rowLabel}`,r.seatNumber&&`${this.tf("picker.seat","Seat")} ${r.seatNumber}`].filter(Boolean).join(" \xB7 ")||r.displayLabel||r.label,a=r.quantity>1?` <span class="sl-booked-qty">\xD7${r.quantity}</span>`:"";return`<li>${_(s)}${a}</li>`}).join(""),this.els.bookedList.hidden=e.lineItems.length===0),this.bookedEl?.classList.add("on"),requestAnimationFrame(()=>this.bookedEl?.querySelector(".sl-booked-back")?.focus()),this.opts.onBooked?.(e)}dismissBooked(){this.bookedEl?.classList.remove("on"),this.resetAfterBooking(),this.root?.focus({preventScroll:!0})}resetAfterBooking(){this.bookedShown=!1,this.hold=null,this.handedOff=!1,this.holdConflicted=!1,this.holdingLabels.clear(),this.gaQty.clear(),this.stopHoldTimer(),this.forgetHold(),this.clearSelection(),this.setCtaPhase("idle"),this.setSheetOpen(!1),this.syncTray(),this.syncCta(),this.emitHoldChange()}notifyGroupSettled(e){e==="booked"?this.showBooked():this.dismissConfirm(),this.hold=null,this.handedOff=!1,this.ctaPhase="idle",this.stopHoldTimer(),this.forgetHold(),this.syncTray(),this.syncCta()}async checkoutHandoff(e,t){if(this.checkoutMode==="hosted"){await this.startHostedCheckout(e,t);return}await this.opts.onCheckout?.(e,t,this.buildHandoff(e))}async startHostedCheckout(e,t){let n=this.buildHandoff(e),r=null;try{r=await(this.paymentOptions??=this.pubApi.paymentOptions(this.opts.event))}catch(a){this.opts.onError?.(a)}if(this.destroyed)return;let o=r?.bookingMode==="free",s=r?.providers?.[0]??null;if(!s&&!o){let a=Gr(r?.reason),l=!!this.opts.onCheckoutUnavailable||!!this.opts.onCheckout;this.opts.onCheckoutUnavailable?.({reason:a,handoff:n}),this.opts.onCheckout?.(e,t,n),l||this.openCheckoutPanel({kind:"unavailable",reason:a,seatCount:Kr(n)});return}await this.openCheckoutPanel(Ur(n,s,r,this.pubApi.ticketKeysFor(e.holdId),this.controller.getGAAreas()))}async openCheckoutPanel(e){let t;try{({mountCheckout:t}=await ft())}catch(n){this.opts.onError?.(n),this.toast(this.tf("picker.checkoutCouldNotBeOpened","Checkout could not be opened. Your seats are still held. Please try again."),"error"),this.setCtaPhase("idle");return}this.destroyed||!this.root||(this.closeCheckoutPanel(),this.checkoutPanel=t({root:this.root,state:e,eventKey:this.opts.event,event:{name:this.els.name?.textContent||null,detail:this.els.meta?.textContent||null},formatMoney:n=>this.money(n),t: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=>{qr(n)&&(this.paymentOptions=null),n?.code==="seats_unavailable"&&this.controller.refresh(),this.opts.onError?.(n)}}))}closeCheckoutPanel(){this.checkoutPanel?.destroy(),this.checkoutPanel=null}buildHandoff(e){let n=(e.items??[]).map(s=>{let a=this.controller.lineItemDisplay(s),l=s.objectType==="seat"||s.objectType==="booth"?this.controller.seatByLabel(s.label):null,c=l?this.controller.seatDetails(l.id):null,d=c?q(c):void 0,u=this.controller.doc?.categories.find(p=>p.key===s.categoryKey),m=s.tierId?u?.tiers?.find(p=>p.id===s.tierId)?.name:void 0;return{label:s.label,...a.displayLabel?{displayLabel:a.displayLabel}:{},...a.displayType?{displayType:a.displayType}:{},...c?.sectionLabel?{sectionLabel:c.sectionLabel}:{},...d?{rowLabel:d}:{},...c?.seatNumber?{seatNumber:c.seatNumber}:{},...u?.label?{categoryLabel:u.label}:{},...m?{tierLabel:m}:{},objectId:s.objectId,objectType:s.objectType,categoryKey:s.categoryKey,tierId:s.tierId,unitPrice:this.paidPrice(s.categoryKey,s.tierId,s.unitPrice,s.label),currency:s.currency??this.currency,quantity:s.quantity??1}}),r=n[0]?.currency??this.currency,o=n.reduce((s,a)=>s+a.unitPrice*a.quantity,0);return{holdId:e.holdId,expiresAt:e.expiresAt,currency:r,lineItems:n,total:o}}emitHoldChange(){let e=this.hold;this.scheduleOfferRefresh(!0),this.opts.onHoldChange?.(e,e?.seats??[],e?this.buildHandoff(e):null)}toast(e,t="neutral",n){let r=this.els.toast;if(!r)return;r.replaceChildren();let o=document.createElement("span");if(o.textContent=e,r.appendChild(o),r.classList.toggle("has-action",!!n),n){let s=document.createElement("button");s.type="button",s.className="sl-toast-action",s.textContent=n.label,s.addEventListener("click",n.onClick,{once:!0}),r.appendChild(s)}r.dataset.tone=t,r.classList.add("on","sl-mo-rise"),this.liftToastOverConfirmSoon(),this.toastTimer&&clearTimeout(this.toastTimer),this.toastTimer=setTimeout(()=>{r.classList.remove("on","sl-mo-rise"),r.classList.remove("has-action"),r.dataset.tone="neutral",this.liftToastOverConfirm()},4200)}liftToastOverConfirm(){let e=this.regions["bottom-center"];if(!e)return;let t=this.els.toast?.classList.contains("on")||this.extendEl?.classList.contains("on"),n=this.confirmEl;if(!t||!n?.isConnected){e.style.removeProperty("bottom");return}let r=this.els.map.clientHeight;if(r<=0)return;let o=n.getBoundingClientRect(),s=o.height||n.offsetHeight||fu,a=o.height?o.top-this.els.map.getBoundingClientRect().top:r-ar-s,l=Math.round(r-a+uu);if(l+mu>r){e.style.removeProperty("bottom");return}e.style.bottom=`${l}px`}liftToastOverConfirmSoon(){this.liftToastOverConfirm(),typeof requestAnimationFrame=="function"&&requestAnimationFrame(()=>{this.destroyed||this.liftToastOverConfirm()})}dismissSkeleton(){this.handoverMs===null&&this.renderResolvedAt!==null&&(this.handoverMs=performance.now()-this.renderResolvedAt),Oa({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?xa(this.tipPos,e,t):null,r=n??wa(this.tipPos,e.width,e.height,t);this.tipEl.style.left=`${r.left}px`,this.tipEl.style.top=`${r.top}px`,n?this.tipEl.dataset.placement=n.placement:delete this.tipEl.dataset.placement}nightStripFor(e,t){let n=this.performanceGroup,r=or(e.mark,n?.nights?.()),o=r?.states.filter(s=>s.free).length??0;return la(r,{locale:this.opts.locale,switchLabel:n?.selectionModeSwitch?.label??null,selectPartialLabel:n?.partialSeatSelection?.label(o)??null,pinned:t})}unpinTooltip(){this.tipPinned&&(this.tipPinned=!1,this.tipEl?.classList.remove("sl-tip-pinned"),this.tipEl&&(this.tipEl.style.display="none"))}handleMapPointerDown(e){if(this.tipEl?.contains(e.target))return;this.lastMapPoint={x:e.clientX,y:e.clientY},this.lastPointerType=e.pointerType||"mouse";let t=this.els.map.getBoundingClientRect();this.tipPos={x:e.clientX-t.left,y:e.clientY-t.top},this.unpinTooltip()}closeInfoPops(e){this.root?.querySelectorAll(".sl-info.open").forEach(t=>{t!==e&&(t.classList.remove("open"),t.querySelector("[data-sl-info]")?.setAttribute("aria-expanded","false"))})}updateTooltip(e){if(!this.tipEl)return;if(this.confirmSeat){this.tipEl.style.display="none";return}if(this.tipPinned&&e?.interaction!=="press")return;if(!e){this.tipPinned||(this.tipEl.style.display="none",this.tipMarkedHoverLabel=null);return}let t=e.mark?.kind==="partial"&&this.tipMarkedHoverLabel===e.label;if(e.interaction!=="press"&&this.lastPointerType==="mouse"&&!e.mark&&!this.tipPinned){this.tipEl.style.display="none",this.tipMarkedHoverLabel=null;return}if(e.unavailable&&e.status==="free"&&e.interaction==="press"){this.toast(this.tf("picker.turnOffAccessibilityFilter","Turn off the wheelchair filter to pick this seat"),"neutral"),this.tipEl.style.display="none";return}if(e.unavailable&&!e.mark){this.tipEl.style.display="none",this.tipMarkedHoverLabel=null;return}let n=e.mark?.kind==="partial"&&(e.interaction==="press"||this.lastPointerType!=="mouse"||t);this.tipMarkedHoverLabel=e.mark?.kind==="partial"?e.label:null;let r=this.nightStripFor(e,n);this.tipEl.style.setProperty("--sl-cat",e.categoryColor),this.tipEl.innerHTML=va(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:it(e),extra:r+(n?`<button type="button" class="sl-tip-close" data-pg-tip-close aria-label="${_(this.tf("picker.group.closeSeatDetails","Close seat details"))}">\xD7</button>`:"")}),this.tipPinned=n,this.tipEl.classList.toggle("sl-tip-pinned",n),this.tipEl.querySelector("[data-pg-tip-close]")?.addEventListener("click",()=>this.unpinTooltip()),this.tipEl.querySelector("[data-pg-switch-mode]")?.addEventListener("click",()=>{this.unpinTooltip(),this.performanceGroup?.selectionModeSwitch?.activate()}),Ta(this.tipEl,this.performanceGroup?.partialSeatSelection?.label,o=>{this.unpinTooltip(),this.performanceGroup?.partialSeatSelection?.activate(e.id,o)}),this.tipEl.style.display="block",this.placeTooltip()}syncSeatMarks(){let e=this.performanceGroup?.seatMarks,t=this.controller.getRenderer();if(!e||!t?.setSeatMarks)return;let n={};for(let[r,o]of Object.entries(e())){let s=this.controller.idForLabel(r);s&&(n[s]=o)}Object.keys(n).length&&t.setSeatMarks(n)}getSelection(){return this.committedSelection()}selectObjects(e){return this.controller.select(e)}selectObjectsWithoutConfirmation(e){let t=new Set(e),n=this.controller.getSelection().filter(r=>t.has(r.id)||t.has(r.label));if(n.length===t.size)return n;this.suppressConfirmationSeatId=e[0]??null;try{return this.controller.select(e)}finally{this.suppressConfirmationSeatId=null}}deselectObjects(e){this.controller.deselect(e)}clearSelection(){this.dismissConfirm(),this.dismissTableDialog(),this.controller.clearSelection()}categoryLegendColor(){let e=(this.controller.doc?.categories??[]).find(t=>!t.notForSale);return(e?this.controller.getRenderer()?.categoryDisplayColor?.(e.key):null)||e?.color||"#2563eb"}async refreshAvailability(){await this.controller.refresh(),this.syncSeatMarks(),this.syncTray()}refreshPerformanceGroupComposition(){this.syncTray()}async adoptRestoredHold(e){!e||this.hold||await this.resumeHoldFromServer(e)}selectCategories(e){return this.controller.selectCategories(e)}deselectCategories(e){this.controller.deselectCategories(e)}setSelectableObjects(e){this.controller.setSelectableObjects(e)}setMaxSelection(e){this.maxTickets=Math.max(this.exactTickets??1,Math.floor(e)),this.controller.setMaxSelection(this.maxTickets),this.updateSelectionCapacity(),this.syncTray()}getSelectionValidity(){let e=this.controller.getSelectionValidity(this.totalTicketCount());return e&&(e.seats=this.committedSelection()),e}setMapTheme(e){this.destroyed||(this.opts.theme={...this.opts.theme??{},map:e??void 0},this.controller.setMapTheme(e),this.applyMapChromeTokens(),this.minimap?.refreshMinimap())}applyThemeTokens(e){let t=ki(this.themeMode),n=bt(this.controller.doc?.theme,this.opts.theme,t);for(let[r,o]of Object.entries(n))e.style.setProperty(r,o);t?e.dataset.theme=t:delete e.dataset.theme,this.applyMapChromeTokens()}watchThemeMode(){this.colorSchemeStop?.(),this.colorSchemeStop=null,this.themeMode==="auto"&&(this.colorSchemeStop=Si(()=>{this.destroyed||this.repaintForThemeMode()}))}repaintForThemeMode(){this.root&&(this.applyThemeTokens(this.root),this.controller.setMapTheme(gt(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:ki(e)??null}))}getThemeMode(){return this.themeMode}applyMapChromeTokens(){let e=this.els.map?.parentElement;if(!e||!this.root)return;let t=ki(this.themeMode),n=bt(this.controller.doc?.theme,this.opts.theme,t),r=gt(this.opts.theme,this.themeMode)?.background??this.controller.doc?.theme?.background??void 0,o=Yr(n,r);for(let s of Wr)o?e.style.setProperty(s,o[s]):e.style.removeProperty(s)}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.currencyResolved)&&(this.syncMapPriceRanges(),this.els.pricesSec?.querySelector(".sl-price-select")?.remove(),this.buildPriceFilter(),this.syncPrices(),this.syncTray(),this.lastSection&&this.showSectionCard(this.lastSection)))}buildLanguageSwitcher(e){this.langSel=jo(e,{languages:this.opts.languages,label:this.tf("picker.preferredTicketType","Language"),onChange:t=>{this.setLocale(t)}})}async setLocale(e){let t=ic(),n=this.localeGeneration+=1,r=await au(e);return this.opts.messages&&lu(this.opts.messages),r===t||this.applyActiveLocale(r,n),r}applyActiveLocale(e,t){t===this.localeGeneration&&this.root&&(Go(e,{root:this.root,painters:[()=>this.syncTray(),()=>this.syncPrices(),()=>this.syncOffer(),()=>this.syncRung(),()=>this.syncFloors(),()=>this.syncPanelToggle(),()=>this.syncFullscreenButtons(),()=>this.syncTestBadge()],refreshMapCopy:()=>this.controller.refreshMapCopy(),languageSelect:this.langSel}),this.scheduleFit())}isColorblindSafe(){return this.cbSafe}setColorblindSafe(e){e!==this.cbSafe&&(this.cbSafe=e,this.cbEl?.setAttribute("aria-pressed",String(e)),this.controller.setColorblindSafe(e),this.syncPrices(),this.minimap?.refreshMinimap(),bu(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 Za(this)}setBuyerView(e,t){Qa(this,e,t)}seatState3dFor(e){return Xa(this,e)}pushAvailabilityTo3d(){Ja(this)}syncSelectionTo3d(){el(this)}seatViewFor3d(e){return tl(this,e)}onView3dSeatPick(e){il(this,e)}seatViewCaption(e){return nl(this,e)}saveView3dComparisonSeat(e){rl(this,e)}clearView3dComparison(){ol(this)}view3dComparisonSnapshot(e){return sl(this,e)}enter3d(e){return al(this,e)}publish3dTopInset(){ll(this)}exit3d(){cl(this)}openSeatConfidencePassport(e,t=null){mr(this,e,t)}closeSeatConfidencePassport(e=!0){oi(this,e)}openView3dComparison(){Ua(this)}closeView3dComparison(e=!0){nt(this,e)}getCurrentHold(){return this.hold}async resumeHold(e){return this.resumeHoldFromServer(e)}async changeHeldTier(e,t){e.disabled=!0;try{let n=await $a(this.controller,t,e.value,this.opts.holdTtlMs);n&&(this.hold={holdId:n.holdId,expiresAt:n.expiresAt,seats:n.seats,items:n.items},this.startHoldTimer(n.expiresAt),this.emitHoldChange())}catch(n){this.opts.onError?.(n),this.toast(this.tf("picker.ticketTypeNotChanged","That ticket type is not available for this seat. Your hold is unchanged."),"error")}finally{this.syncTray()}}async removeHeldTicket(e){return this.removeHeldLabels([e])}async bestAvailable(e,t,n={}){if(this.salesClosed||this.bestAvailableBusy)return null;e=Math.max(1,Math.min(this.maxTickets,Math.floor(e)));try{return await this.bestAvailableOrThrow(e,t,n)}catch(r){this.opts.onError?.(r);let o=nr(r);if(o)return this.toast(o,"warning"),null;let s=r?.reason,a=s==="not_enough_together"?N("picker.couldNotFindSeatsTogether",{count:e}):s==="companion_pair_required"?this.tf("picker.companionPairRequired","Select the adjacent wheelchair place with each companion ticket."):s==="ticket_option_not_applicable"?this.tf("picker.ticketOptionNotApplicable","That ticket choice is not available for the selected seat."):s==="sold_out"?this.tf("picker.ticketTypeSoldOut","That ticket type is sold out. Try another ticket type."):s==="event_closed"?this.tf("picker.seatSalesClosedForEvent","Seat sales have closed for this event."):this.tf("picker.seatsNoLongerAvailableTryAnother","Those seats are no longer available. Try another quantity or ticket type.");return this.toast(a,"error"),null}}async bestAvailableOrThrow(e,t,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");let r=Hi(this.controller,t);if(r)throw r;this.confirmSeat&&this.cancelConfirm(),this.bestAvailableConfirm=!1,this.bestAvailableBusy=!0;let o=this.els.tray?.querySelector(".sl-ba-go");o&&(o.disabled=!0,o.classList.add("sl-busy"),o.innerHTML=`<span class="sl-ba-spin" aria-hidden="true"></span>${this.tf("picker.findingEllipsis","Finding\u2026")}`);try{let s=await this.controller.bestAvailable(e,t,{...n,ttlMs:this.opts.holdTtlMs});return s?(this.hold={holdId:s.holdId,expiresAt:s.expiresAt,seats:s.seats,items:s.items},this.handedOff=!1,this.bookedShown=!1,this.gaQty.clear(),this.startHoldTimer(s.expiresAt),this.flashHeldSeats(this.hold),this.syncTray(),this.emitHoldChange(),n.preferPremium&&s.seats.length&&!s.seats.every(a=>a.commercial?.premium)&&this.toast(N("picker.premiumFallbackNote",{count:e}),"neutral"),this.hold):null}finally{this.bestAvailableBusy=!1,this.syncTray()}}async release(){let e=this.hold,t=this.controller.currentHold(),n=!0;if(t)n=await this.controller.release();else if(e){let r=[...new Set([...(e.items??[]).map(o=>o.label),...(e.seats??[]).map(o=>o.label)])];if(r.length)try{await this.api.release(this.opts.event,r,e.holdId)}catch(o){this.opts.onError?.(o),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 Ce({url:()=>this.pubApi.subscribeUrl(e),mintTicket:()=>this.pubApi.subscribeTicket(e),onAccessUnavailable:t=>{this.opts.onAccessUnavailable?.(t),this.showAccessPanel(t)},onIdleExpired:()=>Js(this.idlePauseHost),sink:Wt(this.controller,{flashOnLiveChange:!0,ownLabels:()=>this.holdingLabels,onStatusChange:()=>{this.syncPrices(),this.scheduleOfferRefresh(!0),this.detectBooked(),this.minimap?.refreshMinimap(),this.pushAvailabilityTo3d()},onSelectedObjectUnavailable:(t,n)=>{this.opts.onSelectedObjectUnavailable?.({labels:t,reason:n}),this.syncTray(),this.toast(n==="ineligible"?this.tf("picker.seatNoLongerYours","Some seats are no longer available to you. They have been removed from your order."):this.tf("picker.seatTaken","Someone else took a seat you had picked. It has been removed from your order."),"warning")}})}),this.realtime.start()}async refreshAccess(){return!this.access?.configured||!await this.access.refresh("manual")?!1:(this.dismissAccessPanel(),await this.controller.refresh(),this.realtime?this.realtime.restart():this.startRealtime(),!0)}clearDecisionSurfaces(){this.dismissConfirm(),this.dismissTableDialog(!1),we(this,!1)}showAccessPanel(e){if(this.loadAbort&&e.reason==="provider_failed"||this.destroyed||!this.root)return;this.dismissAccessPanel(),this.clearDecisionSurfaces();let t=Ao(e.reason,e.reason==="idle"?()=>this.resumeFromIdle():()=>this.recoverAccess());(this.root.querySelector(".sl-body")??this.root).appendChild(t),this.accessEl=t}async recoverAccess(){return await this.refreshAccess()?!0:(this.opts.onAccessUnavailable||typeof window>"u"||window.location.reload(),!1)}dismissAccessPanel(){this.accessEl?.remove(),this.accessEl=null}get idlePauseHost(){return this}startIdleClock(e){return Zs(this.idlePauseHost,e)}resumeFromIdle(){return Xs(this.idlePauseHost)}showHoldExpired(){if(this.destroyed||!this.root||this.holdExpiredEl)return;this.clearDecisionSurfaces();let e=Wl({restart:()=>this.restartAfterHoldExpiry()},this.holdExpiredUnits);this.root.appendChild(e),this.holdExpiredEl=e,requestAnimationFrame(()=>e.querySelector(".sl-interrupt-act")?.focus());let t=this.holdExpiredUnits;this.holdExpiredFresh=!1,this.refreshAvailability().then(()=>{if(this.destroyed||this.holdExpiredEl!==e)return;this.holdExpiredFresh=!0;let n=t.filter(s=>s.objectType!=="ga"),r=[],o=[];for(let s of n){let a=this.controller.seatByLabel(s.label);(a&&this.controller.getStatus(a.id)==="free"?r:o).push(s.label)}ql(e,{recoverable:r,taken:o,onRecover:s=>this.recoverAfterHoldExpiry(s)})}).catch(()=>{})}recoverAfterHoldExpiry(e){this.holdExpiredUnits=[],this.dismissHoldExpired(),this.lapse.clear(),this.clearSelection(),this.controller.select(e),this.syncTray(),this.handleCta()}dismissHoldExpired(){this.holdExpiredEl?.remove(),this.holdExpiredEl=null}restartAfterHoldExpiry(){let e=this.holdExpiredUnits;this.holdExpiredUnits=[],this.dismissHoldExpired(),this.lapse.clear(),this.clearSelection(),this.controller.overview(),this.syncTray(),this.syncCta(),this.root?.focus({preventScroll:!0});let t=this.holdExpiredFresh;this.holdExpiredFresh=!1,(t?Promise.resolve():this.refreshAvailability()).then(()=>{this.destroyed||Ul({reducedMotion:this.reducedMotion(),accent:this.cssVar("--sl-accent")||"#f4b740",seatByLabel:n=>this.controller.seatByLabel(n),statusOf:n=>this.controller.getStatus(n),flash:(n,r)=>this.controller.flashSeat(n,r)},e)}).catch(()=>{})}destroy(){this.transportAbort.abort(),this.loadAbort?.abort(),this.loadAbort=null,this.destroyed=!0,pr(this),this.colorSchemeStop?.(),this.colorSchemeStop=null,this.realtime?.stop(),this.realtime=null,this.idleClock?.dispose(),this.idleClock=null,this.dismissAccessPanel(),this.dismissHoldExpired(),this.access?.clear(),this.hold&&!this.handedOff&&this.opts.holdOnClose!=="keep"&&this.controller.release(),this.closeConfirm(),this.dismissTableDialog(!1),we(this,!1),this.closeSeatView(),this.closeCheckoutPanel(),this.exit3d(),this.buyerAssetUrls.dispose(),this.stopHoldTimer(),this.detachAttention?.(),this.toastTimer&&clearTimeout(this.toastTimer),this.offerRefreshTimer&&clearTimeout(this.offerRefreshTimer),this.offerBoundaryTimer&&clearTimeout(this.offerBoundaryTimer),this.offerCountdownTimer&&clearTimeout(this.offerCountdownTimer),this.offerRefreshTimer=null,this.offerBoundaryTimer=null,this.offerCountdownTimer=null,this.offerVisibilityHandler&&(document.removeEventListener("visibilitychange",this.offerVisibilityHandler),this.offerVisibilityHandler=null);for(let e of this.motionTimers)clearTimeout(e);this.motionTimers.clear(),this.ro?.disconnect(),this.ro=null,this.viewportResizeHandler&&window.removeEventListener("resize",this.viewportResizeHandler),this.viewportResizeHandler=null,this.framedFs&&this.setFramedFs(!1),this.escHandler&&document.removeEventListener("keydown",this.escHandler),this.fsChangeHandler&&document.removeEventListener("fullscreenchange",this.fsChangeHandler),this.fsEscHandler&&window.removeEventListener("keydown",this.fsEscHandler),this.controller.destroy(),this.projectionEl=null,this.root?.remove(),this.root=null,this.modalCleanup?.(),this.closeModal=null}};function yu(i){Ve.prewarm(i)}import{formatMoney as Ou,loadLocale as _u,setStringOverrides as Nu,t as Du}from"@seatlayer/core";var ac="seatlayer-performance-group-picker-style";function lc(){if(document.getElementById(ac))return;let i=document.createElement("style");i.id=ac,i.textContent=`
3382
3382
  .sl-pg-root{display:grid;grid-template-columns:minmax(0,1fr);gap:12px;min-width:0;max-width:100%;color:var(--sl-text,#18202b);font-family:var(--sl-font,Inter,system-ui,sans-serif)}
3383
3383
  .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)}